From owner-svn-src-all@freebsd.org Sun Jan 15 00:50:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8F92CA4558; Sun, 15 Jan 2017 00:50:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 901FD131A; Sun, 15 Jan 2017 00:50:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0F0oAmB055430; Sun, 15 Jan 2017 00:50:10 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F0oAU8055428; Sun, 15 Jan 2017 00:50:10 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701150050.v0F0oAU8055428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sun, 15 Jan 2017 00:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312205 - in head/sys: kern net 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, 15 Jan 2017 00:50:11 -0000 Author: sbruno Date: Sun Jan 15 00:50:10 2017 New Revision: 312205 URL: https://svnweb.freebsd.org/changeset/base/312205 Log: Fix hangs in a uniprocessor configuration (qemu, virtualbox, real hw). sys/net/iflib.c: Add ctx to filter_info and don't skpi interrupt early on unless we're on an SMP system sys/kern/subr_gtaskqueue.c: Skip smp check if we're running UP Submitted by: Matt Macy Reported by: emaste bde Modified: head/sys/kern/subr_gtaskqueue.c head/sys/net/iflib.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Sat Jan 14 23:24:50 2017 (r312204) +++ head/sys/kern/subr_gtaskqueue.c Sun Jan 15 00:50:10 2017 (r312205) @@ -647,7 +647,7 @@ taskqgroup_attach(struct taskqgroup *qgr qgroup->tqg_queue[qid].tgc_cnt++; LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; - if (irq != -1 && smp_started) { + if (irq != -1 && (smp_started || mp_ncpus == 1)) { gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu; CPU_ZERO(&mask); CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, &mask); @@ -697,7 +697,7 @@ taskqgroup_attach_cpu(struct taskqgroup gtask->gt_irq = irq; gtask->gt_cpu = cpu; mtx_lock(&qgroup->tqg_lock); - if (smp_started) { + if (smp_started || mp_ncpus == 1) { for (i = 0; i < qgroup->tqg_cnt; i++) if (qgroup->tqg_queue[i].tgc_cpu == cpu) { qid = i; @@ -717,7 +717,7 @@ taskqgroup_attach_cpu(struct taskqgroup CPU_ZERO(&mask); CPU_SET(cpu, &mask); - if (irq != -1 && smp_started) + if (irq != -1 && (smp_started || mp_ncpus == 1)) intr_setaffinity(irq, &mask); return (0); } @@ -731,7 +731,7 @@ taskqgroup_attach_cpu_deferred(struct ta qid = -1; irq = gtask->gt_irq; cpu = gtask->gt_cpu; - MPASS(smp_started); + MPASS(smp_started || mp_ncpus == 1); mtx_lock(&qgroup->tqg_lock); for (i = 0; i < qgroup->tqg_cnt; i++) if (qgroup->tqg_queue[i].tgc_cpu == cpu) { @@ -824,7 +824,7 @@ _taskqgroup_adjust(struct taskqgroup *qg mtx_assert(&qgroup->tqg_lock, MA_OWNED); - if (cnt < 1 || cnt * stride > mp_ncpus || !smp_started) { + if (cnt < 1 || cnt * stride > mp_ncpus || (!smp_started && (mp_ncpus != 1))) { printf("taskqgroup_adjust failed cnt: %d stride: %d mp_ncpus: %d smp_started: %d\n", cnt, stride, mp_ncpus, smp_started); return (EINVAL); Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sat Jan 14 23:24:50 2017 (r312204) +++ head/sys/net/iflib.c Sun Jan 15 00:50:10 2017 (r312205) @@ -133,10 +133,13 @@ typedef struct iflib_rxq *iflib_rxq_t; struct iflib_fl; typedef struct iflib_fl *iflib_fl_t; +struct iflib_ctx; + typedef struct iflib_filter_info { driver_filter_t *ifi_filter; void *ifi_filter_arg; struct grouptask *ifi_task; + struct iflib_ctx *ifi_ctx; } *iflib_filter_info_t; struct iflib_ctx { @@ -300,6 +303,8 @@ typedef struct iflib_sw_tx_desc_array { #define IFC_MULTISEG 0x04 #define IFC_DMAR 0x08 #define IFC_SC_ALLOCATED 0x10 +#define IFC_INIT_DONE 0x20 + #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ @@ -1194,7 +1199,7 @@ iflib_fast_intr(void *arg) iflib_filter_info_t info = arg; struct grouptask *gtask = info->ifi_task; - if (!smp_started) + if (!smp_started && mp_ncpus > 1) return (FILTER_HANDLED); DBG_COUNTER_INC(fast_intrs); @@ -3753,6 +3758,7 @@ iflib_device_register(device_t dev, void if_setgetcounterfn(ctx->ifc_ifp, iflib_if_get_counter); iflib_add_device_sysctl_post(ctx); + ctx->ifc_flags |= IFC_INIT_DONE; return (0); fail_detach: ether_ifdetach(ctx->ifc_ifp); @@ -4471,6 +4477,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if info->ifi_filter = filter; info->ifi_filter_arg = filter_arg; info->ifi_task = gtask; + info->ifi_ctx = ctx; err = _iflib_irq_alloc(ctx, irq, rid, iflib_fast_intr, NULL, info, name); if (err != 0) { @@ -4567,6 +4574,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_ info->ifi_filter = filter; info->ifi_filter_arg = filter_arg; info->ifi_task = gtask; + info->ifi_ctx = ctx; /* We allocate a single interrupt resource */ if ((err = _iflib_irq_alloc(ctx, irq, tqrid, iflib_fast_intr, NULL, info, name)) != 0) From owner-svn-src-all@freebsd.org Sun Jan 15 03:50:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6662BCB0BEA; Sun, 15 Jan 2017 03:50:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AE0D1007; Sun, 15 Jan 2017 03:50:09 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0F3o80b030076; Sun, 15 Jan 2017 03:50:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F3o8oK030074; Sun, 15 Jan 2017 03:50:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701150350.v0F3o8oK030074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 15 Jan 2017 03:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312208 - 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, 15 Jan 2017 03:50:09 -0000 Author: markj Date: Sun Jan 15 03:50:08 2017 New Revision: 312208 URL: https://svnweb.freebsd.org/changeset/base/312208 Log: Avoid unnecessary page lookups in vm_object_madvise(). vm_object_madvise() is frequently used to apply advice to a contiguous set of pages in an object with no backing object. Optimize this case by skipping non-resident subranges in constant time, and by iterating over resident pages using the object memq, thus avoiding radix tree lookups on each page index in the specified range. While here, move MADV_WILLNEED handling to vm_page_advise(), and rename the "advise" parameter to vm_object_madvise() to "advice." Reviewed by: alc, kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D9098 Modified: head/sys/vm/vm_object.c head/sys/vm/vm_page.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sun Jan 15 01:36:45 2017 (r312207) +++ head/sys/vm/vm_object.c Sun Jan 15 03:50:08 2017 (r312208) @@ -1097,7 +1097,7 @@ vm_object_sync(vm_object_t object, vm_oo */ void vm_object_madvise(vm_object_t object, vm_pindex_t pindex, vm_pindex_t end, - int advise) + int advice) { vm_pindex_t tpindex; vm_object_t backing_object, tobject; @@ -1105,11 +1105,9 @@ vm_object_madvise(vm_object_t object, vm if (object == NULL) return; + VM_OBJECT_WLOCK(object); - /* - * Locate and adjust resident pages - */ - for (; pindex < end; pindex += 1) { + for (m = NULL; pindex < end; pindex++) { relookup: tobject = object; tpindex = pindex; @@ -1118,7 +1116,7 @@ shadowlookup: * MADV_FREE only operates on OBJT_DEFAULT or OBJT_SWAP pages * and those pages must be OBJ_ONEMAPPING. */ - if (advise == MADV_FREE) { + if (advice == MADV_FREE) { if ((tobject->type != OBJT_DEFAULT && tobject->type != OBJT_SWAP) || (tobject->flags & OBJ_ONEMAPPING) == 0) { @@ -1126,15 +1124,29 @@ shadowlookup: } } else if ((tobject->flags & OBJ_UNMANAGED) != 0) goto unlock_tobject; - m = vm_page_lookup(tobject, tpindex); - if (m == NULL) { - /* - * There may be swap even if there is no backing page - */ - if (advise == MADV_FREE && tobject->type == OBJT_SWAP) + + /* + * In the common case where the object has no backing object, we + * can avoid performing lookups at each pindex. In either case, + * when applying MADV_FREE we take care to release any swap + * space used to store non-resident pages. + */ + if (object->backing_object == NULL) { + m = (m != NULL) ? TAILQ_NEXT(m, listq) : + vm_page_find_least(object, pindex); + tpindex = (m != NULL && m->pindex < end) ? + m->pindex : end; + if (advice == MADV_FREE && object->type == OBJT_SWAP && + tpindex > pindex) + swap_pager_freespace(object, pindex, + tpindex - pindex); + if ((pindex = tpindex) == end) + break; + } else if ((m = vm_page_lookup(tobject, tpindex)) == NULL) { + if (advice == MADV_FREE && tobject->type == OBJT_SWAP) swap_pager_freespace(tobject, tpindex, 1); /* - * next object + * Prepare to search the next object in the chain. */ backing_object = tobject->backing_object; if (backing_object == NULL) @@ -1145,11 +1157,13 @@ shadowlookup: VM_OBJECT_WUNLOCK(tobject); tobject = backing_object; goto shadowlookup; - } else if (m->valid != VM_PAGE_BITS_ALL) - goto unlock_tobject; + } + /* * If the page is not in a normal state, skip it. */ + if (m->valid != VM_PAGE_BITS_ALL) + goto unlock_tobject; vm_page_lock(m); if (m->hold_count != 0 || m->wire_count != 0) { vm_page_unlock(m); @@ -1160,7 +1174,7 @@ shadowlookup: KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("vm_object_madvise: page %p is not managed", m)); if (vm_page_busied(m)) { - if (advise == MADV_WILLNEED) { + if (advice == MADV_WILLNEED) { /* * Reference the page before unlocking and * sleeping so that the page daemon is less @@ -1172,21 +1186,18 @@ shadowlookup: VM_OBJECT_WUNLOCK(object); VM_OBJECT_WUNLOCK(tobject); vm_page_busy_sleep(m, "madvpo", false); + m = NULL; VM_OBJECT_WLOCK(object); goto relookup; } - if (advise == MADV_WILLNEED) { - vm_page_activate(m); - } else { - vm_page_advise(m, advise); - } + vm_page_advise(m, advice); vm_page_unlock(m); - if (advise == MADV_FREE && tobject->type == OBJT_SWAP) + if (advice == MADV_FREE && tobject->type == OBJT_SWAP) swap_pager_freespace(tobject, tpindex, 1); unlock_tobject: if (tobject != object) VM_OBJECT_WUNLOCK(tobject); - } + } VM_OBJECT_WUNLOCK(object); } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Jan 15 01:36:45 2017 (r312207) +++ head/sys/vm/vm_page.c Sun Jan 15 03:50:08 2017 (r312208) @@ -3002,7 +3002,7 @@ vm_page_try_to_free(vm_page_t m) /* * vm_page_advise * - * Deactivate or do nothing, as appropriate. + * Apply the specified advice to the given page. * * The object and page must be locked. */ @@ -3020,8 +3020,11 @@ vm_page_advise(vm_page_t m, int advice) * would result in a page fault on a later access. */ vm_page_undirty(m); - else if (advice != MADV_DONTNEED) + else if (advice != MADV_DONTNEED) { + if (advice == MADV_WILLNEED) + vm_page_activate(m); return; + } /* * Clear any references to the page. Otherwise, the page daemon will From owner-svn-src-all@freebsd.org Sun Jan 15 03:53:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C6F2CB0E52; Sun, 15 Jan 2017 03:53:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5614014BD; Sun, 15 Jan 2017 03:53:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0F3rK8K034021; Sun, 15 Jan 2017 03:53:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F3rKpw034020; Sun, 15 Jan 2017 03:53:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701150353.v0F3rKpw034020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 15 Jan 2017 03:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312209 - 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: Sun, 15 Jan 2017 03:53:21 -0000 Author: markj Date: Sun Jan 15 03:53:20 2017 New Revision: 312209 URL: https://svnweb.freebsd.org/changeset/base/312209 Log: Suppress a warning about m_assertbuf being unused. MFC after: 1 week Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun Jan 15 03:50:08 2017 (r312208) +++ head/sys/kern/uipc_mbuf.c Sun Jan 15 03:53:20 2017 (r312209) @@ -169,7 +169,7 @@ CTASSERT(sizeof(struct m_ext) == 28); * plain pointer does. */ #ifdef INVARIANTS -static struct mbuf m_assertbuf; +static struct mbuf __used m_assertbuf; CTASSERT(sizeof(m_assertbuf.m_slist) == sizeof(m_assertbuf.m_next)); CTASSERT(sizeof(m_assertbuf.m_stailq) == sizeof(m_assertbuf.m_next)); CTASSERT(sizeof(m_assertbuf.m_slistpkt) == sizeof(m_assertbuf.m_nextpkt)); From owner-svn-src-all@freebsd.org Sun Jan 15 04:23:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 044F3CB03F0; Sun, 15 Jan 2017 04:23:22 +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 C7D3E192D; Sun, 15 Jan 2017 04:23:21 +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 v0F4NKdx049101; Sun, 15 Jan 2017 04:23:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F4NKvg049100; Sun, 15 Jan 2017 04:23:20 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701150423.v0F4NKvg049100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 15 Jan 2017 04:23:20 +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: r312210 - 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: Sun, 15 Jan 2017 04:23:22 -0000 Author: pfg Date: Sun Jan 15 04:23:20 2017 New Revision: 312210 URL: https://svnweb.freebsd.org/changeset/base/312210 Log: MFC r311896 Remove unused __gnu_inline() attribute. This was meant to be used by a future FORTIFY_SOURCE implementation. Probably for good, FORTIFY_SOURCE and this particular GCCism were never well supported by clang or other compilers. Furthermore, the technology has long since been replaced by either static checkers, sanitizers, or even just the strong stack protector that was enabled by default. Drop __gnu_inline to avoid cluttering the headers. Modified: stable/11/sys/sys/cdefs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/cdefs.h ============================================================================== --- stable/11/sys/sys/cdefs.h Sun Jan 15 03:53:20 2017 (r312209) +++ stable/11/sys/sys/cdefs.h Sun Jan 15 04:23:20 2017 (r312210) @@ -543,22 +543,6 @@ __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) #endif -/* - * FORTIFY_SOURCE, and perhaps other compiler-specific features, require - * the use of non-standard inlining. In general we should try to avoid - * using these but GCC-compatible compilers tend to support the extensions - * well enough to use them in limited cases. - */ -#if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__) -#if __GNUC_PREREQ__(4, 3) || __has_attribute(__artificial__) -#define __gnu_inline __attribute__((__gnu_inline__, __artificial__)) -#else -#define __gnu_inline __attribute__((__gnu_inline__)) -#endif /* artificial */ -#else -#define __gnu_inline -#endif - /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ defined(__GNUC__) && !defined(__INTEL_COMPILER) From owner-svn-src-all@freebsd.org Sun Jan 15 05:08:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98533CB0807; Sun, 15 Jan 2017 05:08:20 +0000 (UTC) (envelope-from julian@elischer.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 7EB001C13; Sun, 15 Jan 2017 05:08:20 +0000 (UTC) (envelope-from julian@elischer.org) Received: from Julian-MBP3.local (ppp121-45-252-76.lns20.per4.internode.on.net [121.45.252.76]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v0F583ac018905 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sat, 14 Jan 2017 21:08:06 -0800 (PST) (envelope-from julian@elischer.org) Subject: Re: svn commit: r311952 - head/sys/ddb To: Mark Johnston , Bruce Evans References: <201701120022.v0C0MaHq053076@repo.freebsd.org> <20170113131948.P1465@besplex.bde.org> <20170114220629.GB18065@raichu> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, rang@acm.org From: Julian Elischer Message-ID: <1755552c-a5e2-848a-38e2-3bacfbecfb23@elischer.org> Date: Sun, 15 Jan 2017 13:07:58 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170114220629.GB18065@raichu> 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: Sun, 15 Jan 2017 05:08:20 -0000 On 15/01/2017 6:06 AM, Mark Johnston wrote: > On Fri, Jan 13, 2017 at 02:51:04PM +1100, Bruce Evans wrote: >> On Thu, 12 Jan 2017, Mark Johnston wrote: >> >>> Log: >>> Enable the use of ^C and ^S/^Q in DDB. >>> >>> This lets one interrupt DDB's output, which is useful if paging is >>> disabled and the output device is slow. >> This is quite broken. It removes the code that was necessary for avoiding >> loss of input. > Hi Bruce, > > I've reverted this for now. I haven't thought much about how > db_check_interrupt() might losslessly poll the console driver for > ctrl-C, but I do think it's a valuable feature to have - just this > morning I absent-mindedly dumped a 128K-entry KTR ring from a DDB prompt > after having set $lines = 0, and had to wait for quite a while to get > my prompt back. > >>> Modified: head/sys/ddb/db_input.c >>> ============================================================================== >>> --- head/sys/ddb/db_input.c Thu Jan 12 00:09:31 2017 (r311951) >>> +++ head/sys/ddb/db_input.c Thu Jan 12 00:22:36 2017 (r311952) >>> @@ -63,7 +63,6 @@ static int db_lhist_nlines; >>> #define BLANK ' ' >>> #define BACKUP '\b' >>> >>> -static int cnmaygetc(void); >>> static void db_delete(int n, int bwd); >>> static int db_inputchar(int c); >>> static void db_putnchars(int c, int count); >>> @@ -291,12 +290,6 @@ db_inputchar(c) >>> return (0); >>> } >>> >>> -static int >>> -cnmaygetc() >>> -{ >>> - return (-1); >>> -} >>> - >> BSD never had a usable console API (function) for checking for input. >> cncheckc() is the correct name for such a function. The actual >> cncheckc() returns any input that it finds. This is not the main >> problem here. The input will have to be read here anyway to determine >> what it is. The problems are that there is no console API at all for >> ungetting characters in the input stream, and this function doesn't >> even use a stub cnungetc(), but drops the input on the floor. It does >> document this behaviour in a comment, but doesn't say that it is wrong. >> >>> int >>> db_readline(lstart, lsize) >>> char * lstart; >>> @@ -350,7 +343,7 @@ db_check_interrupt(void) >>> { >>> int c; >>> >>> - c = cnmaygetc(); >>> + c = cncheckc(); >>> switch (c) { >>> case -1: /* no character */ >>> return; >> The stub function always returns -1, so db_check_interrupt() is turned into >> a no-op. >> >> db_check_interrupt() now eats the first byte of any input on every call. >> >>> @@ -361,7 +354,7 @@ db_check_interrupt(void) >>> >>> case CTRL('s'): >>> do { >>> - c = cnmaygetc(); >>> + c = cncheckc(); >>> if (c == CTRL('c')) >>> db_error((char *)0); >>> } while (c != CTRL('q')); >> This is now a bad implementation of xon/xoff. It doesn't support ixany, >> but busy-waits for ^Q or ^C using cncheckc(). It should at least >> busy-wait using cngetc(), since that might be do a smarter busy wait. >> cngetc() is actually only slightly smarter -- it uses busy-waiting too, >> but with cpu_spinwait() in the loop. This cpu_spinwait() makes little >> difference since cncheckc() tends to be a heavyweight function. Only >> cpu_spinwait()s in the innermost loops of cncheckc(), if any, are likely >> to have much effect. >> >> Multiple consoles complicate this a bit. >> >> db_check_interrupt() is called after every db_putc() of a newline. So >> the breakage is mainly for type-ahead while writing many lines. > I'll note that type-ahead interacts rather poorly with DDB's behaviour > of repeating the previous command upon reading an empty input line: > entering a carriage return at any point while "show ktr" is working will > cause it to be started again once it's finished. the old DEC machines had (from memory) ^O which dropped all pending output. Not so useful when there is 2MB of network buffers queued up to you, but very useful on and asr-33 teletype. > >> Control processing belongs in the lowest level of console drivers, and >> at least the xon/xoff part is very easy to do. This makes it work for >> contexts like boot messages -- this can only be controlled now by booting >> with -p, which gives something like an automatic ^S after every line, >> but the control characters for this mode are unusual and there is no >> way to get back to -p mode after turning it off or not starting with it. >> >> [...] From owner-svn-src-all@freebsd.org Sun Jan 15 05:54:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CFF3CB08E3; Sun, 15 Jan 2017 05:54:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id B7E8110DC; Sun, 15 Jan 2017 05:54:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 6D60BD63CD1; Sun, 15 Jan 2017 16:54:56 +1100 (AEDT) Date: Sun, 15 Jan 2017 16:54:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312199 - head/sys/kern In-Reply-To: <201701142216.v0EMG3rN093070@repo.freebsd.org> Message-ID: <20170115161524.A55089@besplex.bde.org> References: <201701142216.v0EMG3rN093070@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=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=RAJ7xaerS_eBAxpZtjMA: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: Sun, 15 Jan 2017 05:54:59 -0000 On Sat, 14 Jan 2017, Mark Johnston wrote: > Log: > Stop the scheduler upon panic even in non-SMP kernels. > > This is needed for kernel dumps to work, as the panicking thread will call > into code that makes use of kernel locks. > > Reported and tested by: Eugene Grosbein > MFC after: 1 week > > Modified: > head/sys/kern/kern_shutdown.c > > Modified: head/sys/kern/kern_shutdown.c > ============================================================================== > --- head/sys/kern/kern_shutdown.c Sat Jan 14 22:16:01 2017 (r312198) > +++ head/sys/kern/kern_shutdown.c Sat Jan 14 22:16:03 2017 (r312199) > @@ -733,13 +733,13 @@ vpanic(const char *fmt, va_list ap) > CPU_CLR(PCPU_GET(cpuid), &other_cpus); > stop_cpus_hard(other_cpus); > } > +#endif > > /* > * Ensure that the scheduler is stopped while panicking, even if panic > * has been entered from kdb. > */ > td->td_stopsched = 1; > -#endif > > bootopt = RB_AUTOBOOT; > newpanic = 0; This variable causes various problems. In my patches for early use of the message buffer, I have to provide a fake td to point to it since curthread is not initialized early and message buffer code does bogus locking. This variable used to be a global, but was changed to per-thread because it was claimed to cause cache contention. I don't see how a the global can cause significant contention (or more than other globals) provided it is not in the same cache line as an often-written-to global. This variable is not even checked by inline mutex code, so this code is broken and without INVARIANTS the variable is mainly accessed in the contended case, but the contended case is already slow and accesses many other globals. The accesses are well obfuscated by ifdefs. __mtx_lock_sleep() seems to have only the following at the beginning in the non-INVARIANTS case: - SCHEDULER_STOPPED() accesses this variable - then if ADAPTIVE_MUTEXES is configured, the much larger global mtx_delay is accessed. Even standard compiler optimizations are likely to copy from static global data to initialize constants a bit like this. These seem to be the only globals in the main, not counting per-CPU ones like curthread. This and other mutex functions recently gained the dubious optimization of initializing lda early in the main path. This is correct if the main path is usually to do almost everything (because the usual case is contended). Scheduler code also checks 'cold' quite often and kdb_active sometimes. It is not called as often as mutex code. No care is taken to keep 'cold' away from other globals. On i386, it is just 'int cold = 1;' in machdep.c, so it is placed wherever the linker decides to pack it. WHen this variable was changed from global to thread-local, it was set for more threads. Now it is set for only 1 thread. This depends on all other CPUs being stopped so that they can't be running other threads. If another thread somehow runs, then the thread variable is much more broken than the global since it doesn't stop scheduling on all threads. Perhaps the change to stop other threads made the global less pessimal than before (I can't see why -- efficiency doesn't matter while the scheduler is stopped -- we just need to make the access efficient in normal operation when the variable is 0). Bruce From owner-svn-src-all@freebsd.org Sun Jan 15 06:35:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C30B8CB13EF; Sun, 15 Jan 2017 06:35:01 +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 926C0122E; Sun, 15 Jan 2017 06:35:01 +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 v0F6Z04x001636; Sun, 15 Jan 2017 06:35:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F6Z0tF001634; Sun, 15 Jan 2017 06:35:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701150635.v0F6Z0tF001634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 15 Jan 2017 06:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312211 - head/sys/mips/atheros 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, 15 Jan 2017 06:35:01 -0000 Author: adrian Date: Sun Jan 15 06:35:00 2017 New Revision: 312211 URL: https://svnweb.freebsd.org/changeset/base/312211 Log: [ar71xx] add EARLY_PRINTF support for the rest of the non-AR933x SoCs. Tested: * AR934x SoC Modified: head/sys/mips/atheros/ar71xxreg.h head/sys/mips/atheros/uart_bus_ar71xx.c Modified: head/sys/mips/atheros/ar71xxreg.h ============================================================================== --- head/sys/mips/atheros/ar71xxreg.h Sun Jan 15 04:23:20 2017 (r312210) +++ head/sys/mips/atheros/ar71xxreg.h Sun Jan 15 06:35:00 2017 (r312211) @@ -111,6 +111,10 @@ #define PCI_WINDOW7_CONF_ADDR 0x07000000 #define AR71XX_UART_ADDR 0x18020000 +#define AR71XX_UART_THR 0x0 +#define AR71XX_UART_LSR 0x14 +#define AR71XX_UART_LSR_THRE (1 << 5) +#define AR71XX_UART_LSR_TEMT (1 << 6) #define AR71XX_USB_CTRL_FLADJ 0x18030000 #define USB_CTRL_FLADJ_HOST_SHIFT 12 Modified: head/sys/mips/atheros/uart_bus_ar71xx.c ============================================================================== --- head/sys/mips/atheros/uart_bus_ar71xx.c Sun Jan 15 04:23:20 2017 (r312210) +++ head/sys/mips/atheros/uart_bus_ar71xx.c Sun Jan 15 06:35:00 2017 (r312211) @@ -86,4 +86,21 @@ uart_ar71xx_probe(device_t dev) return (uart_bus_probe(dev, 2, freq, 0, 0)); } +#ifdef EARLY_PRINTF +static void +ar71xx_early_putc(int c) +{ + int i; + + for (i = 0; i < 1000; i++) { + if (ATH_READ_REG(AR71XX_UART_ADDR + AR71XX_UART_LSR) + & AR71XX_UART_LSR_THRE) + break; + } + + ATH_WRITE_REG(AR71XX_UART_ADDR + AR71XX_UART_THR, (c & 0xff)); +} +early_putc_t *early_putc = ar71xx_early_putc; +#endif + DRIVER_MODULE(uart, apb, uart_ar71xx_driver, uart_devclass, 0, 0); From owner-svn-src-all@freebsd.org Sun Jan 15 06:49:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66B10CB1698; Sun, 15 Jan 2017 06:49:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 26F271849; Sun, 15 Jan 2017 06:49:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 762D3D64D15; Sun, 15 Jan 2017 17:49:33 +1100 (AEDT) Date: Sun, 15 Jan 2017 17:49:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ngie Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312119 - head/sys/kern In-Reply-To: <201701140506.v0E56EHT068275@repo.freebsd.org> Message-ID: <20170115172228.U55241@besplex.bde.org> References: <201701140506.v0E56EHT068275@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=H7qr+6Qi c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=sPGq-izdjwqvmuXUbnIA: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: Sun, 15 Jan 2017 06:49:35 -0000 On Sat, 14 Jan 2017, Ngie Cooper wrote: > Log: > encode_long, encode_timeval: mechanically replace `exp` with `exponent` > > This helps fix a -Wshadow issue with exp(3) with tests/sys/acct/acct_test, > which include math.h, which in turn defines exp(3) But kern_acct.c doesn't include math.h. This messes up the kernel sources to simplify abusing them in tests. The bug was only in the sed script in the makefile that translates kern_acct.c to convert.c. It converts 'log(' to 'syslog(', but is missing conversion of the exp identifier to sysexp. > ============================================================================== > --- head/sys/kern/kern_acct.c Sat Jan 14 05:02:53 2017 (r312118) > +++ head/sys/kern/kern_acct.c Sat Jan 14 05:06:14 2017 (r312119) > @@ -469,8 +469,8 @@ static uint32_t > encode_timeval(struct timeval tv) > { > int log2_s; > - int val, exp; /* Unnormalized value and exponent */ > - int norm_exp; /* Normalized exponent */ > + int val, exponent; /* Unnormalized value and exponent */ > + int norm_exponent; /* Normalized exponent */ > int shift; > > /* Now the bug is also bad style in the kernel sources. The regexp was too simple and munged norm_exp too, but not the exp's in comments. The comments are more banal than before now that they don't even expand 'exp' but just echo 'exponent'. > ... > - return (((FLT_MAX_EXP - 1 + exp + norm_exp) << (FLT_MANT_DIG - 1)) | > + return (((FLT_MAX_EXP - 1 + exponent + norm_exponent) << (FLT_MANT_DIG - 1)) | > ((shift > 0 ? val << shift : val >> -shift) & MANT_MASK)); Here the expansion also broke the formatting. The details of the abuse in the test program are that acct_test.c includes math.h and then includes then convert.c which is nearly a copy of the kernel source file. This takes clean include files and not enabling warnings about redundant declarations to have a chance of working. I use a similar hack to test libm, and didn't have to mess up the sources too much to make the translation not too hard. Files have to be copied just to make the include paths manageable, and to compile them all with the same CFLAGS since this is a performance test. The most complicated parts are to avoid library functions because they might not match the sources or were compiled with different CFLAGS. The sources are not well organized well enough for my preferred method of "cc ${CLAGS} *.c" to work. Bruce From owner-svn-src-all@freebsd.org Sun Jan 15 07:40:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C37EFCB1EF5; Sun, 15 Jan 2017 07:40:19 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv158.fwdcdn.com (frv158.fwdcdn.com [212.42.77.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A4BD1A09; Sun, 15 Jan 2017 07:40:18 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xGoVi2Rd9Z0E7HAEgjIsQt7JGc5btkVu2rCnv72YL+M=; b=CxFUfBErT/mbGeE9EoJg9+kYor GUDG3fkBvF0lqjbCRh574df2Andi65vBinpQ+n+PcmufNkagzIZ6N1pCVP7DR5UVFrqjmpBG1c9Ux uJ0K7iBkKyL/sj9fCQYsbExvJXyrLYY85ygkrtA2VXtEuAdZPhh9vSJQ/KQCOk8uJrKk=; Received: from [46.185.1.216] (helo=nonamehost) by frv158.fwdcdn.com with esmtpsa ID 1cSfQ9-000FwZ-JA ; Sun, 15 Jan 2017 09:40:09 +0200 Date: Sun, 15 Jan 2017 09:40:07 +0200 From: Ivan Klymenko To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312205 - in head/sys: kern net Message-ID: <20170115094007.1bfe58c8@nonamehost> In-Reply-To: <201701150050.v0F0oAU8055428@repo.freebsd.org> References: <201701150050.v0F0oAU8055428@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEWpqak/Pz/i4uIfHx8GBwZwcHAQEBA6o92AAAACHElEQVQ4jWWUTY7bMAyF6QzUPSEoa8PFHEBgqwuM4bVVg7MvZOj+R+ijpMTpjIwgkT7z75EKrdfattpXERG6zqvUOtAr2LCRYfEKcB4l/Q+2cc6XjQH7hv+2YZYreIk5nevZEPvuzUzptizHLzgDMnC5Wpbl7ewJlOEqlQF+DlCjgVLki0WV6FMDMsBxjlJiQulIznwZ+DxHiQyDyIg0wN3Oo6o6ZQ5s5AIfar+W2Wlmz+kCcb8tg6j3voMEwNrBQk69dDBDqw/urpqJH+m+Q6u/4QnoAeYpnUXC/s1iup9rhCd6xMgAqdDyAyFegbKkVAHeLCcOulPLawaoUIDos4M88iLNrVkU7uu5ccTDO6naJzWLum51C6Yb7y4HKKbdArLWir0PBiS8glJRBZHeyHl7J9lENpAC6qT9NlNG4u5hsVYDyJP6mlJJtY3oVju4WSUzHal1sDU17NASoBWSk40J2eBLBJhYrVmzC5gVALGpNIAiQgN6eGstOp9Oa6zFbbLTISYi28BGZDRUJKWeroECkCEkzXjUtbmmaKMfAx2RfbT69/cO+tgHcmx6AfyZOmj3NDIah0F0GB66d4CrdIoplNFFGHSpSheRxbo0W4S8azNItEoMWbw3uXAeJgCrmX5joz7CGXqSg6PcryEhnFr/C1C2ntPxBOYbdwY+8dO3+wZJyFlbMX9s8zNnvp/tLwAv03NB4j3HVpn8Awwm+GrlP6MVAAAAAElFTkSuQmCC MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=46.185.1.216; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jan 2017 07:40:19 -0000 On Sun, 15 Jan 2017 00:50:10 +0000 (UTC) Sean Bruno wrote: > Log: > Fix hangs in a uniprocessor configuration (qemu, virtualbox, real > hw). Hello. MFC to STABLE? From owner-svn-src-all@freebsd.org Sun Jan 15 08:05:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16213CB0AA0; Sun, 15 Jan 2017 08:05:02 +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 DC94B191A; Sun, 15 Jan 2017 08:05:01 +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 v0F8510p037294; Sun, 15 Jan 2017 08:05:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F851ZA037293; Sun, 15 Jan 2017 08:05:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701150805.v0F851ZA037293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 15 Jan 2017 08:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312212 - 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: Sun, 15 Jan 2017 08:05:02 -0000 Author: cem Date: Sun Jan 15 08:05:00 2017 New Revision: 312212 URL: https://svnweb.freebsd.org/changeset/base/312212 Log: Fix a minor typo (Seiral) PR: 216095 Reported by: Modified: head/sys/sys/ata.h Modified: head/sys/sys/ata.h ============================================================================== --- head/sys/sys/ata.h Sun Jan 15 06:35:00 2017 (r312211) +++ head/sys/sys/ata.h Sun Jan 15 08:05:00 2017 (r312212) @@ -682,7 +682,7 @@ struct atapi_sense { #define ATA_IDL_ATA_STRINGS 0x05 /* ATA Strings */ #define ATA_IDL_SECURITY 0x06 /* Security */ #define ATA_IDL_PARALLEL_ATA 0x07 /* Parallel ATA */ -#define ATA_IDL_SERIAL_ATA 0x08 /* Seiral ATA */ +#define ATA_IDL_SERIAL_ATA 0x08 /* Serial ATA */ #define ATA_IDL_ZDI 0x09 /* Zoned Device Information */ struct ata_gp_log_dir { From owner-svn-src-all@freebsd.org Sun Jan 15 09:05:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 405C1CB1C7F; Sun, 15 Jan 2017 09:05: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 EDD831593; Sun, 15 Jan 2017 09:05: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 v0F95RY6061488; Sun, 15 Jan 2017 09:05:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F95R5W061486; Sun, 15 Jan 2017 09:05:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701150905.v0F95R5W061486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 15 Jan 2017 09:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312213 - head/lib/msun/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: Sun, 15 Jan 2017 09:05:28 -0000 Author: ngie Date: Sun Jan 15 09:05:26 2017 New Revision: 312213 URL: https://svnweb.freebsd.org/changeset/base/312213 Log: Turn COMPILER_VERSION/COMPILER_TYPE make check into a compile-time check of the clang version This works around breakage on ^/stable/10 when running installworld from a ^/stable/10 host where the test wouldn't be compiled on the first go-around and would be missing when make installworld is run. MFC after: 1 week PR: 208703 Reported by: emaste Sponsored by: Dell EMC Isilon Modified: head/lib/msun/tests/Makefile head/lib/msun/tests/fmaxmin_test.c Modified: head/lib/msun/tests/Makefile ============================================================================== --- head/lib/msun/tests/Makefile Sun Jan 15 08:05:00 2017 (r312212) +++ head/lib/msun/tests/Makefile Sun Jan 15 09:05:26 2017 (r312213) @@ -55,10 +55,7 @@ TAP_TESTS_C+= ctrig_test TAP_TESTS_C+= exponential_test TAP_TESTS_C+= fenv_test TAP_TESTS_C+= fma_test -# clang 3.8.0 fails always fails this test. See: bug 208703 -.if ! (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30800) TAP_TESTS_C+= fmaxmin_test -.endif TAP_TESTS_C+= ilogb2_test TAP_TESTS_C+= invtrig_test TAP_TESTS_C+= invctrig_test Modified: head/lib/msun/tests/fmaxmin_test.c ============================================================================== --- head/lib/msun/tests/fmaxmin_test.c Sun Jan 15 08:05:00 2017 (r312212) +++ head/lib/msun/tests/fmaxmin_test.c Sun Jan 15 09:05:26 2017 (r312213) @@ -86,6 +86,8 @@ testall_r(long double big, long double s return (ok); } +const char *comment = NULL; + /* * Test all the functions: fmaxf, fmax, fmaxl, fminf, fmin, and fminl, * in all rounding modes and with the arguments in different orders. @@ -107,10 +109,17 @@ testall(int testnum, long double big, lo break; } } - printf("%sok %d - big = %.20Lg, small = %.20Lg\n", - (i == 4) ? "" : "not ", testnum, big, small); + printf("%sok %d - big = %.20Lg, small = %.20Lg%s\n", + (i == 4) ? "" : "not ", testnum, big, small, + comment == NULL ? "" : comment); } +/* Clang 3.8.0+ fails the invariants for testcase 6, 7, 10, and 11. */ +#if defined(__clang__) && \ + (__clang_major__ >= 3 && __clang_minor__ >= 8 && __clang_patchlevel__ >= 0) +#define affected_by_bug_208703 +#endif + int main(int argc, char *argv[]) { @@ -122,15 +131,23 @@ main(int argc, char *argv[]) testall(3, nextafterf(42.0, INFINITY), 42.0); testall(4, -5.0, -5.0); testall(5, -3.0, -4.0); +#ifdef affected_by_bug_208703 + comment = "# TODO: testcase 6-7 fails invariant with clang 3.8+ (bug 208703)"; +#endif testall(6, 1.0, NAN); testall(7, INFINITY, NAN); + comment = NULL; testall(8, INFINITY, 1.0); testall(9, -3.0, -INFINITY); testall(10, 3.0, -INFINITY); +#ifdef affected_by_bug_208703 + comment = "# TODO: testcase 11-12 fails invariant with clang 3.8+ (bug 208703)"; +#endif testall(11, NAN, NAN); /* This test isn't strictly required to work by C99. */ testall(12, 0.0, -0.0); + comment = NULL; return (0); } From owner-svn-src-all@freebsd.org Sun Jan 15 09:06:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5E3FCB1CF5; Sun, 15 Jan 2017 09:06:46 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F8331718; Sun, 15 Jan 2017 09:06:46 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0F96j2Q061587; Sun, 15 Jan 2017 09:06:45 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F96jN4061586; Sun, 15 Jan 2017 09:06:45 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201701150906.v0F96jN4061586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sun, 15 Jan 2017 09:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312214 - head/release/tools 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, 15 Jan 2017 09:06:46 -0000 Author: cperciva Date: Sun Jan 15 09:06:45 2017 New Revision: 312214 URL: https://svnweb.freebsd.org/changeset/base/312214 Log: Enable IPv6 networking on Amazon EC2. MFC after: 1 week Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Sun Jan 15 09:05:26 2017 (r312213) +++ head/release/tools/ec2.conf Sun Jan 15 09:06:45 2017 (r312214) @@ -6,7 +6,7 @@ # Packages to install into the image we're creating. This is a deliberately # minimalist set, providing only the packages necessary to bootstrap further # package installation as specified via EC2 user-data. -export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs" +export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient" # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_ephemeralswap ec2_loghostkey firstboot_freebsd_update firstboot_pkgs" @@ -39,8 +39,9 @@ vm_extra_pre_umount() { # time; expand our filesystem to fill the disk. echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf - # EC2 instances use DHCP to get their network configuration. - echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf + # EC2 instances use DHCP to get their network configuration. IPv6 + # requires accept_rtadv. + echo 'ifconfig_DEFAULT="SYNCDHCP accept_rtadv"' >> ${DESTDIR}/etc/rc.conf # Unless the system has been configured via EC2 user-data, the user # will need to SSH in to do anything. @@ -51,6 +52,10 @@ vm_extra_pre_umount() { # via EC2 user-data. echo 'firstboot_pkgs_list="awscli"' >> ${DESTDIR}/etc/rc.conf + # Enable IPv6 on all interfaces, and use DHCP on both IPv4 and IPv6. + echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf + echo 'dhclient_program="/usr/local/sbin/dual-dhclient"' >> ${DESTDIR}/etc/rc.conf + # The EC2 console is output-only, so while printing a backtrace can # be useful, there's no point dropping into a debugger or waiting # for a keypress. From owner-svn-src-all@freebsd.org Sun Jan 15 09:13:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48F9ECB1E5E; Sun, 15 Jan 2017 09:13:43 +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 ECD0F1BA4; Sun, 15 Jan 2017 09:13: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 v0F9Dg5H065584; Sun, 15 Jan 2017 09:13:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F9Dga2065583; Sun, 15 Jan 2017 09:13:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701150913.v0F9Dga2065583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 15 Jan 2017 09:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312215 - head/tests/sys/vfs 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, 15 Jan 2017 09:13:43 -0000 Author: ngie Date: Sun Jan 15 09:13:41 2017 New Revision: 312215 URL: https://svnweb.freebsd.org/changeset/base/312215 Log: Mark testcases which use cap_enter as expected failures until the PR is resolved so those of us that run the tests don't have the bogus failures counted against our overall results PR: 215690 Modified: head/tests/sys/vfs/lookup_cap_dotdot.c Modified: head/tests/sys/vfs/lookup_cap_dotdot.c ============================================================================== --- head/tests/sys/vfs/lookup_cap_dotdot.c Sun Jan 15 09:06:45 2017 (r312214) +++ head/tests/sys/vfs/lookup_cap_dotdot.c Sun Jan 15 09:13:41 2017 (r312215) @@ -124,6 +124,8 @@ ATF_TC_BODY(lookup_cap_dotdot__basic, tc cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); + atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); + ATF_REQUIRE(cap_enter() >= 0); ATF_REQUIRE_MSG(openat(dirfd, "d1/..", O_RDONLY) >= 0, "%s", @@ -144,6 +146,8 @@ ATF_TC_BODY(lookup_cap_dotdot__advanced, check_capsicum(); prepare_dotdot_tests(); + atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); + cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); @@ -187,6 +191,8 @@ ATF_TC_BODY(capmode__negative, tc) check_capsicum(); prepare_dotdot_tests(); + atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); + ATF_REQUIRE(cap_enter() == 0); /* open() not permitted in capability mode */ @@ -225,6 +231,8 @@ ATF_TC_BODY(lookup_cap_dotdot__negative, cap_rights_init(&rights, CAP_LOOKUP, CAP_READ); ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0); + atf_tc_expect_signal(SIGABRT, "needs change done upstream in atf/kyua according to cem: bug 215690"); + ATF_REQUIRE(cap_enter() >= 0); ATF_REQUIRE_ERRNO(ENOTCAPABLE, openat(dirfd, "..", O_RDONLY) < 0); From owner-svn-src-all@freebsd.org Sun Jan 15 09:25:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08092CA4154; Sun, 15 Jan 2017 09:25:35 +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 C8B411058; Sun, 15 Jan 2017 09:25: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 v0F9PXT6069574; Sun, 15 Jan 2017 09:25:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F9PXW8069572; Sun, 15 Jan 2017 09:25:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701150925.v0F9PXW8069572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 15 Jan 2017 09:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312216 - in head: sys/kern tests/sys/kern/acct 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, 15 Jan 2017 09:25:35 -0000 Author: ngie Date: Sun Jan 15 09:25:33 2017 New Revision: 312216 URL: https://svnweb.freebsd.org/changeset/base/312216 Log: Revert r312119 and reword the intent to fix -Wshadow issues between exp(3) and `exp` var. The approach taken previously was not ideal for multiple functional and stylistic reasons. Add to existing sed call in Makefile to replace `exp` with `exponent` instead. MFC after: 13 days Requested by: bde Modified: head/sys/kern/kern_acct.c head/tests/sys/kern/acct/Makefile Directory Properties: head/ (props changed) Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Sun Jan 15 09:13:41 2017 (r312215) +++ head/sys/kern/kern_acct.c Sun Jan 15 09:25:33 2017 (r312216) @@ -469,8 +469,8 @@ static uint32_t encode_timeval(struct timeval tv) { int log2_s; - int val, exponent; /* Unnormalized value and exponent */ - int norm_exponent; /* Normalized exponent */ + int val, exp; /* Unnormalized value and exponent */ + int norm_exp; /* Normalized exponent */ int shift; /* @@ -481,7 +481,7 @@ encode_timeval(struct timeval tv) if (tv.tv_sec == 0) { if (tv.tv_usec == 0) return (0); - exponent = 0; + exp = 0; val = tv.tv_usec; } else { /* @@ -490,24 +490,24 @@ encode_timeval(struct timeval tv) */ log2_s = fls(tv.tv_sec) - 1; if (log2_s + LOG2_1M < CALC_BITS) { - exponent = 0; + exp = 0; val = 1000000 * tv.tv_sec + tv.tv_usec; } else { - exponent = log2_s + LOG2_1M - CALC_BITS; + exp = log2_s + LOG2_1M - CALC_BITS; val = (unsigned int)(((uint64_t)1000000 * tv.tv_sec + - tv.tv_usec) >> exponent); + tv.tv_usec) >> exp); } } /* Now normalize and pack the value into an IEEE-754 float. */ - norm_exponent = fls(val) - 1; - shift = FLT_MANT_DIG - norm_exponent - 1; + norm_exp = fls(val) - 1; + shift = FLT_MANT_DIG - norm_exp - 1; #ifdef ACCT_DEBUG printf("val=%d exp=%d shift=%d log2(val)=%d\n", - val, exponent, shift, norm_exponent); - printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exponent + norm_exponent, + val, exp, shift, norm_exp); + printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exp, ((shift > 0 ? (val << shift) : (val >> -shift)) & MANT_MASK)); #endif - return (((FLT_MAX_EXP - 1 + exponent + norm_exponent) << (FLT_MANT_DIG - 1)) | + return (((FLT_MAX_EXP - 1 + exp + norm_exp) << (FLT_MANT_DIG - 1)) | ((shift > 0 ? val << shift : val >> -shift) & MANT_MASK)); } @@ -518,7 +518,7 @@ encode_timeval(struct timeval tv) static uint32_t encode_long(long val) { - int norm_exponent; /* Normalized exponent */ + int norm_exp; /* Normalized exponent */ int shift; if (val == 0) @@ -529,15 +529,15 @@ encode_long(long val) val); val = LONG_MAX; } - norm_exponent = fls(val) - 1; - shift = FLT_MANT_DIG - norm_exponent - 1; + norm_exp = fls(val) - 1; + shift = FLT_MANT_DIG - norm_exp - 1; #ifdef ACCT_DEBUG printf("val=%d shift=%d log2(val)=%d\n", - val, shift, norm_exponent); - printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exponent, + val, shift, norm_exp); + printf("exp=%x mant=%x\n", FLT_MAX_EXP - 1 + exp + norm_exp, ((shift > 0 ? (val << shift) : (val >> -shift)) & MANT_MASK)); #endif - return (((FLT_MAX_EXP - 1 + norm_exponent) << (FLT_MANT_DIG - 1)) | + return (((FLT_MAX_EXP - 1 + norm_exp) << (FLT_MANT_DIG - 1)) | ((shift > 0 ? val << shift : val >> -shift) & MANT_MASK)); } Modified: head/tests/sys/kern/acct/Makefile ============================================================================== --- head/tests/sys/kern/acct/Makefile Sun Jan 15 09:13:41 2017 (r312215) +++ head/tests/sys/kern/acct/Makefile Sun Jan 15 09:25:33 2017 (r312216) @@ -13,6 +13,7 @@ acct_test.o: convert.c convert.c: ${SRCTOP}/sys/kern/kern_acct.c sed -n -e 's/log(/syslog(/g' \ + -e 's/exp/expected/g' \ -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' ${.ALLSRC} >${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} From owner-svn-src-all@freebsd.org Sun Jan 15 09:26:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DB2ACA41CB; Sun, 15 Jan 2017 09:26:47 +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 3DCD011D6; Sun, 15 Jan 2017 09:26:47 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id e4so1951703pfg.0; Sun, 15 Jan 2017 01:26:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=wEWQI1T9e4E0AKmj/WQAKnYiI/P5JEqmn5BOGef8yLk=; b=edDJq9b6P3bb+7wgk01+vEqjtyU6aadSZFTGUdPNKyNnXAXmr8epXWSjAltY693UEU DwPVWTbKE014b3YPJ0Jw9EyITR54Q3xizcxDlIH/AzzqMDlbyKmfBAI0TqiPOpAFNl1o GxxPCNg+CA/UMctDL7A4wnogL8WFQJVl41zeaMLpZMzEc8sFOpgOYDRzqFnLSMLj1n5Y r+5hxt1Wc55EfgrqZsJn64hifd5qxFRzY0lSyqB+JUzlA6a7SSxOUsJKL/beiamJ10hy UmyQ25I7TX6bNPPq3Fu63IiyKCEsYqK7o4F4FF5uUTZ2r6c10XpMTdubNSsvcwRRKS3c urjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=wEWQI1T9e4E0AKmj/WQAKnYiI/P5JEqmn5BOGef8yLk=; b=NTAmpQEuiNNdB4WA24WHNBcNprF0T1yHm6pJqQuoQGNsF4iFLRf0CBdr2mLqpJ/OfQ o3wbh6c4w3SoBmMCS2Ex7fxFJ9BoeJzAcPnpmVvimQ/3OTeCBhOX9K3pLellhUC88zY7 BeQhPOuUIOTBz4pbryLiVQ70DMX2/QriatEI/MHwaR62Vn3OmBP7UEU+F0Ogz33aUm5A V/luPsMDKF0HDxpsLVPsMtovhnm6T1OArFDIvkpkanXLB+Q5FzIGa1SjZuaDaAxjJNRO YumOLGJjbPL+F9anSLeItnYA/FknLpLL7NZ+H9oyX8vke3UJrUp9eiXhG20sxnf4Hf1I kGZA== X-Gm-Message-State: AIkVDXJFMSHaNaqq2lOAFeNsZNIpmcDibGy2yVUn/tCoIQsPeAm75y7LryQMRWJ2f1xLVA== X-Received: by 10.98.102.21 with SMTP id a21mr26223007pfc.29.1484472406724; Sun, 15 Jan 2017 01:26:46 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id l12sm32092758pfj.37.2017.01.15.01.26.45 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Jan 2017 01:26:45 -0800 (PST) Subject: Re: svn commit: r312119 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_EC0928AB-B910-47A4-B5CE-0E75932072CE"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20170115172228.U55241@besplex.bde.org> Date: Sun, 15 Jan 2017 01:26:44 -0800 Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <53422412-6581-4C63-AD2F-8C3F5B4D4642@gmail.com> References: <201701140506.v0E56EHT068275@repo.freebsd.org> <20170115172228.U55241@besplex.bde.org> To: Bruce 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: Sun, 15 Jan 2017 09:26:47 -0000 --Apple-Mail=_EC0928AB-B910-47A4-B5CE-0E75932072CE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 14, 2017, at 22:49, Bruce Evans wrote: >=20 > On Sat, 14 Jan 2017, Ngie Cooper wrote: >=20 >> Log: >> encode_long, encode_timeval: mechanically replace `exp` with = `exponent` >>=20 >> This helps fix a -Wshadow issue with exp(3) with = tests/sys/acct/acct_test, >> which include math.h, which in turn defines exp(3) >=20 > But kern_acct.c doesn't include math.h. >=20 > This messes up the kernel sources to simplify abusing them in tests. >=20 > The bug was only in the sed script in the makefile that translates > kern_acct.c to convert.c. It converts 'log(' to 'syslog(', but is = missing > conversion of the exp identifier to sysexp. >=20 >> = =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/sys/kern/kern_acct.c Sat Jan 14 05:02:53 2017 = (r312118) >> +++ head/sys/kern/kern_acct.c Sat Jan 14 05:06:14 2017 = (r312119) >> @@ -469,8 +469,8 @@ static uint32_t >> encode_timeval(struct timeval tv) >> { >> int log2_s; >> - int val, exp; /* Unnormalized value and exponent */ >> - int norm_exp; /* Normalized exponent */ >> + int val, exponent; /* Unnormalized value and exponent */ >> + int norm_exponent; /* Normalized exponent */ >> int shift; >>=20 >> /* >=20 > Now the bug is also bad style in the kernel sources. The regexp was = too > simple and munged norm_exp too, but not the exp's in comments. The > comments are more banal than before now that they don't even expand = 'exp' > but just echo 'exponent'. >=20 >> ... >> - return (((FLT_MAX_EXP - 1 + exp + norm_exp) << (FLT_MANT_DIG - = 1)) | >> + return (((FLT_MAX_EXP - 1 + exponent + norm_exponent) << = (FLT_MANT_DIG - 1)) | >> ((shift > 0 ? val << shift : val >> -shift) & MANT_MASK)); >=20 > Here the expansion also broke the formatting. >=20 > The details of the abuse in the test program are that acct_test.c = includes > math.h and then includes then convert.c which is nearly a copy of the = kernel > source file. This takes clean include files and not enabling warnings > about redundant declarations to have a chance of working. >=20 > I use a similar hack to test libm, and didn't have to mess up the = sources > too much to make the translation not too hard. Files have to be = copied > just to make the include paths manageable, and to compile them all = with > the same CFLAGS since this is a performance test. The most = complicated > parts are to avoid library functions because they might not match the > sources or were compiled with different CFLAGS. The sources are not = well > organized well enough for my preferred method of "cc ${CLAGS} *.c" to = work. Thank you for the concerns. I=E2=80=99ve modified the approach based on = your recommendations above and submitted it as r312216. -Ngie --Apple-Mail=_EC0928AB-B910-47A4-B5CE-0E75932072CE 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 iQIcBAEBCgAGBQJYe0BVAAoJEPWDqSZpMIYVx4EQAMY2HVJRY8sJdUntdKbCqxkB Fp2y6FlEGyQqaSIYFqlzW5cAG1JtxjcBalKpT8mcN13JoN36IBYslxUmLyvo2GF6 tfOfavAYgIqJGJcnwmTfoRj99O7FIk72L43FbRSh1BOO7CHbpIMY1miOPZJX2hmK 2DUFFbXxBNT3K/43VXdLCXqbiMz9JRbOw8zu94anTDOyf6KNZ7OeKWgmXErD2dR5 TEcdJHxfUD6CxsM8Sy2hJ4dYp+gMYMTHtQWHmh0MyQiVyKN8t53nW80ziyInkXII wV65aagnuDzCa1S3CnwtAvMePfw6487fMj2OyKU1G2MsspnrZHEfgfvVaHXkgFRD u757fbaGGgov4EELv1IMAd6BePJ9h4AkkwS0EethWOehZb1Q84S91tANimwDmMS8 tURdqlcYxH/6iqMPyZCv1Fee47VC40CY6dcj6wZPZQrBVAl4UI4cfbCgVfgTtQTF wTBm4ROjui5Pbf47r2I062vUMnjRG48SX1kH5JaTdOMOZnRbN5VVYJLUcyXG53wO oxyF4kFv/sqz0mUED4LJArK34Cz/V1XNnoc+jLZ/LGuIh/xGPOwIQu1Tv3885PH3 L4hgm8yDlDKI0Fg1AFwIPvpIm3hVmC2N0AZbec3seQrRyjbaWlXc4LfEI7D3bzwR iP54g1hLCzw+P0cL6NAt =DKD0 -----END PGP SIGNATURE----- --Apple-Mail=_EC0928AB-B910-47A4-B5CE-0E75932072CE-- From owner-svn-src-all@freebsd.org Sun Jan 15 09:27:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D3F7CA4231; Sun, 15 Jan 2017 09:27:19 +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 0AD2A1352; Sun, 15 Jan 2017 09:27:19 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id 75so2685135pgf.3; Sun, 15 Jan 2017 01:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Zc2GZr3Rs2G0Qn1KGS3hK3rAcC6oC6MqxnZsRVtoBMc=; b=Xs8uxwjo0ZbceIxl/SM13JaY2hNvFwqYB9mTHrKI/HeVotCDTrCxPdclTv63oYdJdw L6bb3ZUAHidT+08ysKDtYOpRqa6fSWwY7jSEwyJ6bhEOX4XG/IUbJfN53IkKFW02JQdC UxWFrTlH3Cm8GoNB0B+RpoCZl/r0kRtJ1JKMAQpsGVry5VkZpyeWayA7ABx597W2KjzA 1qXuRGX4uiQIrN3ZS0c6dHmY4wRm8DQ7zaIbSWFeFCOeE/Y1F9Qm729UBHXvHbieuUko r3NSK+uXtUtEKEXD6xZa6z/11xS4R92ptK2MQ8InXVqkMVsF+YU4K3l+ZiomU2F+yL/R lX3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Zc2GZr3Rs2G0Qn1KGS3hK3rAcC6oC6MqxnZsRVtoBMc=; b=KvTJvqXwIuDxX11pYUZFFY5A+yNpk9zPlIVwIypPT91OpAwq7dcVFbEM9mK0b09rXp h7JXbP+POpf9/lMsyAi/1yVl3Cj3/6q7JWFuHcTSU8cZ9LhPRXnsy1uZdtJtI89gV8lp HulL3be/YVNeLhsxfzxhYtktOYY/9h6//uDjXImhP8E+Fwad8fieLFYzLoYAQlKs8mAh +nf+otJeqCysTDP95en8wYU//3QJlu8dZ2WxJLmA7DmSl19mWLVOhPR5vkvBO0zg0DKS vJiFUu7ziBUD78kedwFU4oCO9OE+cmKNA3Po/JveQcgLoC58NMUDpgtGsO4hqnBFqpRS dvNA== X-Gm-Message-State: AIkVDXKzcEpSqByBBeC03h9RcStJMGwqaVzjtTs1Q4ATrsfRp2rc+5qo2Hp5jCW8UrIbaw== X-Received: by 10.84.175.234 with SMTP id t97mr41816187plb.145.1484472438571; Sun, 15 Jan 2017 01:27:18 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id l12sm32092758pfj.37.2017.01.15.01.27.17 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Jan 2017 01:27:17 -0800 (PST) Subject: Re: svn commit: r312216 - in head: sys/kern tests/sys/kern/acct Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_8F75F5C7-AB4E-4939-B79E-FA4F86D95E53"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701150925.v0F9PXW8069572@repo.freebsd.org> Date: Sun, 15 Jan 2017 01:27:17 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <19F1D533-CF60-4541-B7C4-20D8C7D65583@gmail.com> References: <201701150925.v0F9PXW8069572@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: Sun, 15 Jan 2017 09:27:19 -0000 --Apple-Mail=_8F75F5C7-AB4E-4939-B79E-FA4F86D95E53 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jan 15, 2017, at 01:25, Ngie Cooper wrote: > > Author: ngie > Date: Sun Jan 15 09:25:33 2017 > New Revision: 312216 > URL: https://svnweb.freebsd.org/changeset/base/312216 > > Log: > Revert r312119 and reword the intent to fix -Wshadow issues *rework. Bah... --Apple-Mail=_8F75F5C7-AB4E-4939-B79E-FA4F86D95E53 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 iQIcBAEBCgAGBQJYe0B1AAoJEPWDqSZpMIYVLH0P/3TE7N7gGBpZQJlVp+fwJTZF wlF2Af+fNCMtanxqG5eyyZKRxQ+CG7ZpOiUASp8t2GCQUKtswCBwriGO9WluJzp2 39N8Z0Jvu6RnRIeH++qrLEkaZYxnPMsEAWDdtkq9pSQrehc2HFeixDSUFy6RFklR FRGMMzNpMonjL9RUWi085oc+CR+Us/lvH9kVploOxyMUFrYM5R7l4GG1HGbryGQs YPR4ZCAUykoCub9TclP0smlDweED30X+LWpupgW2D1M3GBPvSQzDjolU5HWwrvlJ +PXPCM+oBpV1/DgXiAPgZjwsxLKYkf2d2mpNIWOaEbj2Inth4J5U3FGmb3DdDo/a Hmv1gialnbasGT3rupWEnxYALacJGsaL5q5Hfzp5a20tlAuKcxWKhhTPEqSr2wP4 BDBHt3Fqqjm/c7QZKKFKnuL5IlP9ynty15fDn7JLhvWHJ/A+/kuia/qJz48bF7IC n2/inRVVjDJEAnPBJvAQmtnar/SFq2THB+nIZvFFl8gGiiG/Kq9HmrGM7ShWwPEf oxCApPIFwVL/YVVV7qeqnbuKFDGymxbW8ZeCYGtn/Z8dn881q7mL7Wgtj8cWbu0F Q7eMI6PRVfrE2YntB49mvVA6rI7uESBzfdf3FyPZXq/p4T8cd7AyiqsUZZ5CJbyd VoYdT/DRadfDOScZlDtk =pgwb -----END PGP SIGNATURE----- --Apple-Mail=_8F75F5C7-AB4E-4939-B79E-FA4F86D95E53-- From owner-svn-src-all@freebsd.org Sun Jan 15 09:31:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5358CA42B8; Sun, 15 Jan 2017 09:31:15 +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 84AF515D3; Sun, 15 Jan 2017 09:31:15 +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 v0F9VEmm069813; Sun, 15 Jan 2017 09:31:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F9VEML069812; Sun, 15 Jan 2017 09:31:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701150931.v0F9VEML069812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 15 Jan 2017 09:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312217 - 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: Sun, 15 Jan 2017 09:31:15 -0000 Author: ngie Date: Sun Jan 15 09:31:14 2017 New Revision: 312217 URL: https://svnweb.freebsd.org/changeset/base/312217 Log: Delete svn mergeinfo for r312193 so I can once again sync ^/projects/netbsd-tests-upstream-01-2017 with ^/head Modified: Directory Properties: head/ (props changed) From owner-svn-src-all@freebsd.org Sun Jan 15 09:35:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 343ACCA458D; Sun, 15 Jan 2017 09:35:52 +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 E69811C4E; Sun, 15 Jan 2017 09:35: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 v0F9Zpcw073991; Sun, 15 Jan 2017 09:35:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0F9Znex073975; Sun, 15 Jan 2017 09:35:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701150935.v0F9Znex073975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 15 Jan 2017 09:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312219 - in vendor/NetBSD/tests/dist: kernel lib/libc/c063 lib/libc/gen lib/libc/regex lib/libc/setjmp lib/libc/string lib/libc/sys lib/librt usr.bin/grep usr.sbin/mtree 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: Sun, 15 Jan 2017 09:35:52 -0000 Author: ngie Date: Sun Jan 15 09:35:49 2017 New Revision: 312219 URL: https://svnweb.freebsd.org/changeset/base/312219 Log: Pull in additional test changes accepted upstream as well as some additional testcases added in .../kernel/t_ptrace_wait.c Modified: vendor/NetBSD/tests/dist/kernel/t_mqueue.c vendor/NetBSD/tests/dist/kernel/t_ptrace_wait.c vendor/NetBSD/tests/dist/lib/libc/c063/t_mkfifoat.c vendor/NetBSD/tests/dist/lib/libc/gen/t_glob.c vendor/NetBSD/tests/dist/lib/libc/regex/t_regex_att.c vendor/NetBSD/tests/dist/lib/libc/setjmp/t_setjmp.c vendor/NetBSD/tests/dist/lib/libc/setjmp/t_threadjmp.c vendor/NetBSD/tests/dist/lib/libc/string/t_strlen.c vendor/NetBSD/tests/dist/lib/libc/sys/t_mincore.c vendor/NetBSD/tests/dist/lib/libc/sys/t_msync.c vendor/NetBSD/tests/dist/lib/libc/sys/t_unlink.c vendor/NetBSD/tests/dist/lib/librt/t_sem.c vendor/NetBSD/tests/dist/usr.bin/grep/d_binary.out vendor/NetBSD/tests/dist/usr.bin/grep/t_grep.sh vendor/NetBSD/tests/dist/usr.sbin/mtree/t_mtree.sh Modified: vendor/NetBSD/tests/dist/kernel/t_mqueue.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/t_mqueue.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/kernel/t_mqueue.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mqueue.c,v 1.5 2017/01/10 22:10:22 christos Exp $ */ +/* $NetBSD: t_mqueue.c,v 1.6 2017/01/14 20:57:24 christos Exp $ */ /* * Test for POSIX message queue priority handling. @@ -6,17 +6,17 @@ * This file is in the Public Domain. */ -#include #include +#include +#include +#include +#include #include #include #include -#include #include -#include - #define MQ_PRIO_BASE 24 static void Modified: vendor/NetBSD/tests/dist/kernel/t_ptrace_wait.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/t_ptrace_wait.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/kernel/t_ptrace_wait.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptrace_wait.c,v 1.58 2017/01/14 04:37:55 kamil Exp $ */ +/* $NetBSD: t_ptrace_wait.c,v 1.60 2017/01/14 19:17:10 kamil Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__RCSID("$NetBSD: t_ptrace_wait.c,v 1.58 2017/01/14 04:37:55 kamil Exp $"); +__RCSID("$NetBSD: t_ptrace_wait.c,v 1.60 2017/01/14 19:17:10 kamil Exp $"); #include #include @@ -39,6 +39,7 @@ __RCSID("$NetBSD: t_ptrace_wait.c,v 1.58 #include #include #include +#include #include #include #include @@ -1184,6 +1185,116 @@ ATF_TC_BODY(eventmask4, tc) TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); } +ATF_TC(eventmask5); +ATF_TC_HEAD(eventmask5, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Verify that PTRACE_LWP_CREATE in EVENT_MASK is preserved"); +} + +ATF_TC_BODY(eventmask5, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + ptrace_event_t set_event, get_event; + const int len = sizeof(ptrace_event_t); + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + set_event.pe_set_event = PTRACE_LWP_CREATE; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1); + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1); + ATF_REQUIRE(memcmp(&set_event, &get_event, len) == 0); + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_exited(status, exitval); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); +} + +ATF_TC(eventmask6); +ATF_TC_HEAD(eventmask6, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Verify that PTRACE_LWP_EXIT in EVENT_MASK is preserved"); +} + +ATF_TC_BODY(eventmask6, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + ptrace_event_t set_event, get_event; + const int len = sizeof(ptrace_event_t); + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + set_event.pe_set_event = PTRACE_LWP_EXIT; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &set_event, len) != -1); + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, child, &get_event, len) != -1); + ATF_REQUIRE(memcmp(&set_event, &get_event, len) == 0); + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_exited(status, exitval); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); +} + #if defined(TWAIT_HAVE_PID) ATF_TC(fork1); ATF_TC_HEAD(fork1, tc) @@ -5286,6 +5397,207 @@ ATF_TC_BODY(siginfo6, tc) } #endif +volatile lwpid_t the_lwp_id = 0; + +static void +lwp_main_func(void *arg) +{ + the_lwp_id = _lwp_self(); + _lwp_exit(); +} + +ATF_TC(lwp_create1); +ATF_TC_HEAD(lwp_create1, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Verify that 1 LWP creation is intercepted by ptrace(2) with " + "EVENT_MASK set to PTRACE_LWP_CREATE"); +} + +ATF_TC_BODY(lwp_create1, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + ptrace_state_t state; + const int slen = sizeof(state); + ptrace_event_t event; + const int elen = sizeof(event); + ucontext_t uc; + lwpid_t lid; + static const size_t ssize = 16*1024; + void *stack; + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("Before allocating memory for stack in child\n"); + FORKEE_ASSERT((stack = malloc(ssize)) != NULL); + + printf("Before making context for new lwp in child\n"); + _lwp_makecontext(&uc, lwp_main_func, NULL, NULL, stack, ssize); + + printf("Before creating new in child\n"); + FORKEE_ASSERT(_lwp_create(&uc, 0, &lid) == 0); + + printf("Before waiting for lwp %d to exit\n", lid); + FORKEE_ASSERT(_lwp_wait(lid, NULL) == 0); + + printf("Before verifying that reported %d and running lid %d " + "are the same\n", lid, the_lwp_id); + FORKEE_ASSERT_EQ(lid, the_lwp_id); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + printf("Set empty EVENT_MASK for the child %d\n", child); + event.pe_set_event = PTRACE_LWP_CREATE; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1); + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child - expected stopped " + "SIGTRAP\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, SIGTRAP); + + ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1); + + ATF_REQUIRE_EQ(state.pe_report_event, PTRACE_LWP_CREATE); + + lid = state.pe_lwp; + printf("Reported PTRACE_LWP_CREATE event with lid %d\n", lid); + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child - expected exited\n", + TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_exited(status, exitval); + + printf("Before calling %s() for the child - expected no process\n", + TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); +} + +ATF_TC(lwp_exit1); +ATF_TC_HEAD(lwp_exit1, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Verify that 1 LWP creation is intercepted by ptrace(2) with " + "EVENT_MASK set to PTRACE_LWP_EXIT"); +} + +ATF_TC_BODY(lwp_exit1, tc) +{ + const int exitval = 5; + const int sigval = SIGSTOP; + pid_t child, wpid; +#if defined(TWAIT_HAVE_STATUS) + int status; +#endif + ptrace_state_t state; + const int slen = sizeof(state); + ptrace_event_t event; + const int elen = sizeof(event); + ucontext_t uc; + lwpid_t lid; + static const size_t ssize = 16*1024; + void *stack; + + printf("Before forking process PID=%d\n", getpid()); + ATF_REQUIRE((child = fork()) != -1); + if (child == 0) { + printf("Before calling PT_TRACE_ME from child %d\n", getpid()); + FORKEE_ASSERT(ptrace(PT_TRACE_ME, 0, NULL, 0) != -1); + + printf("Before raising %s from child\n", strsignal(sigval)); + FORKEE_ASSERT(raise(sigval) == 0); + + printf("Before allocating memory for stack in child\n"); + FORKEE_ASSERT((stack = malloc(ssize)) != NULL); + + printf("Before making context for new lwp in child\n"); + _lwp_makecontext(&uc, lwp_main_func, NULL, NULL, stack, ssize); + + printf("Before creating new in child\n"); + FORKEE_ASSERT(_lwp_create(&uc, 0, &lid) == 0); + + printf("Before waiting for lwp %d to exit\n", lid); + FORKEE_ASSERT(_lwp_wait(lid, NULL) == 0); + + printf("Before verifying that reported %d and running lid %d " + "are the same\n", lid, the_lwp_id); + FORKEE_ASSERT_EQ(lid, the_lwp_id); + + printf("Before exiting of the child process\n"); + _exit(exitval); + } + printf("Parent process PID=%d, child's PID=%d\n", getpid(), child); + + printf("Before calling %s() for the child\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, sigval); + + printf("Set empty EVENT_MASK for the child %d\n", child); + event.pe_set_event = PTRACE_LWP_EXIT; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, child, &event, elen) != -1); + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child - expected stopped " + "SIGTRAP\n", TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_stopped(status, SIGTRAP); + + ATF_REQUIRE(ptrace(PT_GET_PROCESS_STATE, child, &state, slen) != -1); + + ATF_REQUIRE_EQ(state.pe_report_event, PTRACE_LWP_EXIT); + + lid = state.pe_lwp; + printf("Reported PTRACE_LWP_EXIT event with lid %d\n", lid); + + printf("Before resuming the child process where it left off and " + "without signal to be sent\n"); + ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); + + printf("Before calling %s() for the child - expected exited\n", + TWAIT_FNAME); + TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0), child); + + validate_status_exited(status, exitval); + + printf("Before calling %s() for the child - expected no process\n", + TWAIT_FNAME); + TWAIT_REQUIRE_FAILURE(ECHILD, wpid = TWAIT_GENERIC(child, &status, 0)); +} + ATF_TP_ADD_TCS(tp) { setvbuf(stdout, NULL, _IONBF, 0); @@ -5307,6 +5619,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, eventmask2); ATF_TP_ADD_TC(tp, eventmask3); ATF_TP_ADD_TC(tp, eventmask4); + ATF_TP_ADD_TC(tp, eventmask5); + ATF_TP_ADD_TC(tp, eventmask6); ATF_TP_ADD_TC_HAVE_PID(tp, fork1); ATF_TP_ADD_TC(tp, fork2); @@ -5380,5 +5694,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC_HAVE_PID(tp, siginfo5); ATF_TP_ADD_TC_PT_STEP(tp, siginfo6); + ATF_TP_ADD_TC(tp, lwp_create1); + + ATF_TP_ADD_TC(tp, lwp_exit1); + return atf_no_error(); } Modified: vendor/NetBSD/tests/dist/lib/libc/c063/t_mkfifoat.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/c063/t_mkfifoat.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/lib/libc/c063/t_mkfifoat.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mkfifoat.c,v 1.3 2017/01/10 15:15:09 christos Exp $ */ +/* $NetBSD: t_mkfifoat.c,v 1.4 2017/01/14 20:55:26 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_mkfifoat.c,v 1.3 2017/01/10 15:15:09 christos Exp $"); +__RCSID("$NetBSD: t_mkfifoat.c,v 1.4 2017/01/14 20:55:26 christos Exp $"); #include #include @@ -55,13 +55,11 @@ ATF_TC_HEAD(mkfifoat_fd, tc) ATF_TC_BODY(mkfifoat_fd, tc) { int dfd; - int fd; mode_t mode = 0600; ATF_REQUIRE(mkdir(DIR, 0755) == 0); ATF_REQUIRE((dfd = open(DIR, O_RDONLY, 0)) != -1); - ATF_REQUIRE((fd = mkfifoat(dfd, BASEFIFO, mode)) != -1); - ATF_REQUIRE(close(fd) == 0); + ATF_REQUIRE(mkfifoat(dfd, BASEFIFO, mode) != -1); ATF_REQUIRE(access(FIFO, F_OK) == 0); (void)close(dfd); } @@ -74,12 +72,10 @@ ATF_TC_HEAD(mkfifoat_fdcwd, tc) } ATF_TC_BODY(mkfifoat_fdcwd, tc) { - int fd; mode_t mode = 0600; ATF_REQUIRE(mkdir(DIR, 0755) == 0); - ATF_REQUIRE((fd = mkfifoat(AT_FDCWD, FIFO, mode)) != -1); - ATF_REQUIRE(close(fd) == 0); + ATF_REQUIRE(mkfifoat(AT_FDCWD, FIFO, mode) != -1); ATF_REQUIRE(access(FIFO, F_OK) == 0); } @@ -91,10 +87,9 @@ ATF_TC_HEAD(mkfifoat_fdcwderr, tc) } ATF_TC_BODY(mkfifoat_fdcwderr, tc) { - int fd; mode_t mode = 0600; - ATF_REQUIRE((fd = mkfifoat(AT_FDCWD, FIFOERR, mode)) == -1); + ATF_REQUIRE(mkfifoat(AT_FDCWD, FIFOERR, mode) == -1); } ATF_TC(mkfifoat_fderr); @@ -110,7 +105,7 @@ ATF_TC_BODY(mkfifoat_fderr, tc) ATF_REQUIRE(mkdir(DIR, 0755) == 0); ATF_REQUIRE((fd = open(FIFO, O_CREAT|O_RDWR, 0644)) != -1); ATF_REQUIRE(close(fd) == 0); - ATF_REQUIRE((fd = mkfifoat(-1, FIFO, mode)) == -1); + ATF_REQUIRE(mkfifoat(-1, FIFO, mode) == -1); } ATF_TP_ADD_TCS(tp) Modified: vendor/NetBSD/tests/dist/lib/libc/gen/t_glob.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/gen/t_glob.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/lib/libc/gen/t_glob.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_glob.c,v 1.4 2017/01/13 21:30:41 christos Exp $ */ +/* $NetBSD: t_glob.c,v 1.5 2017/01/14 20:47:41 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. * All rights reserved. @@ -32,7 +32,7 @@ */ #include -__RCSID("$NetBSD: t_glob.c,v 1.4 2017/01/13 21:30:41 christos Exp $"); +__RCSID("$NetBSD: t_glob.c,v 1.5 2017/01/14 20:47:41 christos Exp $"); #include @@ -146,7 +146,7 @@ gl_stat(const char *name , __gl_stat_t * memset(st, 0, sizeof(*st)); if (strcmp(buf, "a") == 0 || strcmp(buf, "a/b") == 0) { - st->st_mode |= _S_IFDIR; + st->st_mode |= S_IFDIR; return 0; } Modified: vendor/NetBSD/tests/dist/lib/libc/regex/t_regex_att.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/regex/t_regex_att.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/lib/libc/regex/t_regex_att.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_regex_att.c,v 1.2 2017/01/14 00:50:56 christos Exp $ */ +/* $NetBSD: t_regex_att.c,v 1.3 2017/01/14 20:59:23 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -37,17 +37,18 @@ */ #include -__RCSID("$NetBSD: t_regex_att.c,v 1.2 2017/01/14 00:50:56 christos Exp $"); +__RCSID("$NetBSD: t_regex_att.c,v 1.3 2017/01/14 20:59:23 christos Exp $"); #include -#include +#include +#include #include -#include +#include #include +#include +#include #include -#include -#include static const char sep[] = "\r\n\t"; static const char delim[3] = "\\\\\0"; Modified: vendor/NetBSD/tests/dist/lib/libc/setjmp/t_setjmp.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/setjmp/t_setjmp.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/lib/libc/setjmp/t_setjmp.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_setjmp.c,v 1.1 2010/12/27 19:35:31 pgoyette Exp $ */ +/* $NetBSD: t_setjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_setjmp.c,v 1.1 2010/12/27 19:35:31 pgoyette Exp $"); +__RCSID("$NetBSD: t_setjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $"); #include @@ -87,7 +87,7 @@ __RCSID("$NetBSD: t_setjmp.c,v 1.1 2010/ static int expectsignal; static void -aborthandler(int signo) +aborthandler(int signo __unused) { ATF_REQUIRE_MSG(expectsignal, "kill(SIGABRT) succeeded"); atf_tc_pass(); Modified: vendor/NetBSD/tests/dist/lib/libc/setjmp/t_threadjmp.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/setjmp/t_threadjmp.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/lib/libc/setjmp/t_threadjmp.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_threadjmp.c,v 1.1 2011/04/21 18:58:20 martin Exp $ */ +/* $NetBSD: t_threadjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_threadjmp.c,v 1.1 2011/04/21 18:58:20 martin Exp $"); +__RCSID("$NetBSD: t_threadjmp.c,v 1.2 2017/01/14 21:08:17 christos Exp $"); #include @@ -91,7 +91,7 @@ static pthread_t myself = NULL; static int expectsignal; static void -aborthandler(int signo) +aborthandler(int signo __unused) { ATF_REQUIRE(myself == pthread_self()); ATF_REQUIRE_MSG(expectsignal, "kill(SIGABRT) succeeded"); Modified: vendor/NetBSD/tests/dist/lib/libc/string/t_strlen.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/string/t_strlen.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/lib/libc/string/t_strlen.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_strlen.c,v 1.5 2011/07/14 07:33:20 jruoho Exp $ */ +/* $NetBSD: t_strlen.c,v 1.6 2017/01/14 20:49:24 christos Exp $ */ /* * Written by J.T. Conklin @@ -40,6 +40,7 @@ ATF_TC_HEAD(strlen_basic, tc) ATF_TC_BODY(strlen_basic, tc) { + void *dl_handle; /* try to trick the compiler */ size_t (*strlen_fn)(const char *); @@ -107,7 +108,8 @@ ATF_TC_BODY(strlen_basic, tc) * During testing it is useful have the rest of the program * use a known good version! */ - strlen_fn = dlsym(dlopen(NULL, RTLD_LAZY), "test_strlen"); + dl_handle = dlopen(NULL, RTLD_LAZY); + strlen_fn = dlsym(dl_handle, "test_strlen"); if (!strlen_fn) strlen_fn = strlen; @@ -134,6 +136,7 @@ ATF_TC_BODY(strlen_basic, tc) } } } + (void)dlclose(dl_handle); } ATF_TC(strlen_huge); Modified: vendor/NetBSD/tests/dist/lib/libc/sys/t_mincore.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/sys/t_mincore.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/lib/libc/sys/t_mincore.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mincore.c,v 1.9 2017/01/10 22:36:29 christos Exp $ */ +/* $NetBSD: t_mincore.c,v 1.10 2017/01/14 20:51:13 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_mincore.c,v 1.9 2017/01/10 22:36:29 christos Exp $"); +__RCSID("$NetBSD: t_mincore.c,v 1.10 2017/01/14 20:51:13 christos Exp $"); #include #include @@ -139,6 +139,7 @@ ATF_TC_WITH_CLEANUP(mincore_resid); ATF_TC_HEAD(mincore_resid, tc) { atf_tc_set_md_var(tc, "descr", "Test page residency with mincore(2)"); + atf_tc_set_md_var(tc, "require.user", "root"); } ATF_TC_BODY(mincore_resid, tc) @@ -150,6 +151,11 @@ ATF_TC_BODY(mincore_resid, tc) struct rlimit rlim; ATF_REQUIRE(getrlimit(RLIMIT_MEMLOCK, &rlim) == 0); + /* + * Bump the mlock limit to unlimited so the rest of the testcase + * passes instead of failing on the mlock call. + */ + rlim.rlim_max = RLIM_INFINITY; rlim.rlim_cur = rlim.rlim_max; ATF_REQUIRE(setrlimit(RLIMIT_MEMLOCK, &rlim) == 0); @@ -250,6 +256,7 @@ ATF_TC_BODY(mincore_resid, tc) (void)munmap(addr2, npgs * page); (void)munmap(addr3, npgs * page); (void)unlink(path); + free(buf); } ATF_TC_CLEANUP(mincore_resid, tc) Modified: vendor/NetBSD/tests/dist/lib/libc/sys/t_msync.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/sys/t_msync.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/lib/libc/sys/t_msync.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_msync.c,v 1.2 2012/03/16 06:15:17 matt Exp $ */ +/* $NetBSD: t_msync.c,v 1.3 2017/01/14 20:52:42 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_msync.c,v 1.2 2012/03/16 06:15:17 matt Exp $"); +__RCSID("$NetBSD: t_msync.c,v 1.3 2017/01/14 20:52:42 christos Exp $"); #include @@ -52,8 +52,7 @@ msync_sync(const char *garbage, int flag { char *buf, *map = MAP_FAILED; const char *str = NULL; - size_t i, len; - ssize_t tot; + size_t len; int fd, rv; /* @@ -65,29 +64,17 @@ msync_sync(const char *garbage, int flag if (buf == NULL) return NULL; - for (i = 0; i < (size_t)page; i++) - buf[i] = 'x'; + memset(buf, 'x', page); fd = open(path, O_RDWR | O_CREAT, 0700); if (fd < 0) { - str = "failed to open"; - goto out; + free(buf); + return "failed to open"; } - tot = 0; - - while (tot < page) { - - rv = write(fd, buf, sizeof(buf)); - - if (rv < 0) { - str = "failed to write"; - goto out; - } - - tot += rv; - } + ATF_REQUIRE_MSG(write(fd, buf, page) != -1, "write(2) failed: %s", + strerror(errno)); map = mmap(NULL, page, PROT_READ | PROT_WRITE, MAP_FILE|MAP_PRIVATE, fd, 0); Modified: vendor/NetBSD/tests/dist/lib/libc/sys/t_unlink.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/sys/t_unlink.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/lib/libc/sys/t_unlink.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_unlink.c,v 1.3 2017/01/13 19:33:03 christos Exp $ */ +/* $NetBSD: t_unlink.c,v 1.4 2017/01/14 20:55:26 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_unlink.c,v 1.3 2017/01/13 19:33:03 christos Exp $"); +__RCSID("$NetBSD: t_unlink.c,v 1.4 2017/01/14 20:55:26 christos Exp $"); #include @@ -107,11 +107,8 @@ ATF_TC_HEAD(unlink_fifo, tc) ATF_TC_BODY(unlink_fifo, tc) { - int fd; - ATF_REQUIRE_MSG((fd = mkfifo(path, 0666)) == 0, - "mkfifo failed: %s", strerror(errno)); - (void)close(fd); + ATF_REQUIRE(mkfifo(path, 0666) == 0); ATF_REQUIRE(unlink(path) == 0); errno = 0; Modified: vendor/NetBSD/tests/dist/lib/librt/t_sem.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/librt/t_sem.c Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/lib/librt/t_sem.c Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -/* $NetBSD: t_sem.c,v 1.2 2010/11/08 13:05:49 njoly Exp $ */ +/* $NetBSD: t_sem.c,v 1.3 2017/01/14 20:58:20 christos Exp $ */ /* * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008, 2010\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_sem.c,v 1.2 2010/11/08 13:05:49 njoly Exp $"); +__RCSID("$NetBSD: t_sem.c,v 1.3 2017/01/14 20:58:20 christos Exp $"); #include @@ -72,7 +72,7 @@ __RCSID("$NetBSD: t_sem.c,v 1.2 2010/11/ #define NCHILDREN 10 -ATF_TC(basic); +ATF_TC_WITH_CLEANUP(basic); ATF_TC_HEAD(basic, tc) { atf_tc_set_md_var(tc, "descr", "Checks basic functionality of POSIX " @@ -108,8 +108,12 @@ ATF_TC_BODY(basic, tc) ATF_REQUIRE_EQ(sem_close(sem_b), 0); ATF_REQUIRE_EQ(sem_unlink("/sem_b"), 0); } +ATF_TC_CLEANUP(basic, tc) +{ + (void)sem_unlink("/sem_b"); +} -ATF_TC(child); +ATF_TC_WITH_CLEANUP(child); ATF_TC_HEAD(child, tc) { atf_tc_set_md_var(tc, "descr", "Checks using semaphores to synchronize " @@ -124,7 +128,7 @@ ATF_TC_BODY(child, tc) pid_t pid; - if (sysconf(_SC_SEMAPHORES) == -1) + if (sysconf(_SC_SEMAPHORES) == -1) atf_tc_skip("POSIX semaphores not supported"); sem_a = sem_open("/sem_a", O_CREAT | O_EXCL, 0644, 0); @@ -164,6 +168,10 @@ ATF_TC_BODY(child, tc) ATF_REQUIRE_EQ(sem_close(sem_a), 0); ATF_REQUIRE_EQ(sem_unlink("/sem_a"), 0); } +ATF_TC_CLEANUP(child, tc) +{ + (void)sem_unlink("/sem_a"); +} ATF_TP_ADD_TCS(tp) { Modified: vendor/NetBSD/tests/dist/usr.bin/grep/d_binary.out ============================================================================== --- vendor/NetBSD/tests/dist/usr.bin/grep/d_binary.out Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/usr.bin/grep/d_binary.out Sun Jan 15 09:35:49 2017 (r312219) @@ -1 +1 @@ -Binary file /bin/sh matches +Binary file test.file matches Modified: vendor/NetBSD/tests/dist/usr.bin/grep/t_grep.sh ============================================================================== --- vendor/NetBSD/tests/dist/usr.bin/grep/t_grep.sh Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/usr.bin/grep/t_grep.sh Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -# $NetBSD: t_grep.sh,v 1.2 2013/05/17 15:39:17 christos Exp $ +# $NetBSD: t_grep.sh,v 1.3 2017/01/14 20:43:52 christos Exp $ # # Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. # All rights reserved. @@ -43,7 +43,9 @@ binary_head() } binary_body() { - atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep $(uname) /bin/sh + dd if=/dev/zero count=1 of=test.file + echo -n "foobar" >> test.file + atf_check -o file:"$(atf_get_srcdir)/d_binary.out" grep foobar test.file } atf_test_case recurse @@ -57,7 +59,7 @@ recurse_body() echo -e "cod\ndover sole\nhaddock\nhalibut\npilchard" > recurse/d/fish echo -e "cod\nhaddock\nplaice" > recurse/a/f/favourite-fish - atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" grep -r haddock recurse + atf_check -o file:"$(atf_get_srcdir)/d_recurse.out" -x "grep -r haddock recurse | sort" } atf_test_case recurse_symlink Modified: vendor/NetBSD/tests/dist/usr.sbin/mtree/t_mtree.sh ============================================================================== --- vendor/NetBSD/tests/dist/usr.sbin/mtree/t_mtree.sh Sun Jan 15 09:33:29 2017 (r312218) +++ vendor/NetBSD/tests/dist/usr.sbin/mtree/t_mtree.sh Sun Jan 15 09:35:49 2017 (r312219) @@ -1,4 +1,4 @@ -# $NetBSD: t_mtree.sh,v 1.6 2013/02/05 16:49:42 christos Exp $ +# $NetBSD: t_mtree.sh,v 1.7 2017/01/14 20:45:16 christos Exp $ # # Copyright (c) 2009, 2012 The NetBSD Foundation, Inc. # All rights reserved. @@ -284,6 +284,13 @@ ignore_head() ignore_body() { + # Kyua 0.11 and above point TMPDIR to our work directory and atf-check + # generates a temporary file, which confuses mtree. Put the mtree files + # into a subdirectory. + # + # See https://github.com/jmmv/kyua/issues/133 for details. + mkdir root && cd root + mkdir newdir mtree -F ${FLAVOR} -c | mtree -F ${FLAVOR} -Ck uid,gid,mode > mtree.spec ln -s newdir otherdir @@ -313,6 +320,13 @@ mtree_ignore_body() } netbsd6_ignore_body() { + # Kyua 0.11 and above point TMPDIR to our work directory and atf-check + # generates a temporary file, which confuses mtree. Put the mtree files + # into a subdirectory. + # + # See https://github.com/jmmv/kyua/issues/133 for details. + mkdir root && cd root + FLAVOR=netbsd6 ignore_body } From owner-svn-src-all@freebsd.org Sun Jan 15 09:45:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB0FBCA47E4; Sun, 15 Jan 2017 09:45:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 8ACF710C8; Sun, 15 Jan 2017 09:45:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 9F09542642B; Sun, 15 Jan 2017 20:45:16 +1100 (AEDT) Date: Sun, 15 Jan 2017 20:45:15 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ngie Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312216 - in head: sys/kern tests/sys/kern/acct In-Reply-To: <201701150925.v0F9PXW8069572@repo.freebsd.org> Message-ID: <20170115202828.R10440@besplex.bde.org> References: <201701150925.v0F9PXW8069572@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=H7qr+6Qi c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=t9cvuGNOZBUpZTa2tFkA: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: Sun, 15 Jan 2017 09:45:26 -0000 On Sun, 15 Jan 2017, Ngie Cooper wrote: > Log: > Revert r312119 and reword the intent to fix -Wshadow issues > between exp(3) and `exp` var. > > The approach taken previously was not ideal for multiple > functional and stylistic reasons. > > Add to existing sed call in Makefile to replace `exp` with > `exponent` instead. Thanks. > Modified: head/tests/sys/kern/acct/Makefile > ============================================================================== > --- head/tests/sys/kern/acct/Makefile Sun Jan 15 09:13:41 2017 (r312215) > +++ head/tests/sys/kern/acct/Makefile Sun Jan 15 09:25:33 2017 (r312216) > @@ -13,6 +13,7 @@ acct_test.o: convert.c > > convert.c: ${SRCTOP}/sys/kern/kern_acct.c > sed -n -e 's/log(/syslog(/g' \ > + -e 's/exp/expected/g' \ > -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' ${.ALLSRC} >${.TARGET}.tmp > mv ${.TARGET}.tmp ${.TARGET} Er, 'expected' is an unexpected spelling of 'exponent'.'. 'syslog' is a little dangerous too. log(9) is declared in systm.h and this renames it to syslog(9). syslog(3) is declared in syslog.h. The functions have the same API, but that is not enough for safety. Currently the result is a redeclaration that -Wredundant-decls should complain about. But any magic like the API being implemented as a macro would cause problems. Bruce From owner-svn-src-all@freebsd.org Sun Jan 15 10:21:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C912ECA5936; Sun, 15 Jan 2017 10:21:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DCA31831; Sun, 15 Jan 2017 10:21:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FALPld093623; Sun, 15 Jan 2017 10:21:25 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FALPMQ093618; Sun, 15 Jan 2017 10:21:25 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201701151021.v0FALPMQ093618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 15 Jan 2017 10:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312224 - head/sys/dev/etherswitch/arswitch 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, 15 Jan 2017 10:21:26 -0000 Author: kp Date: Sun Jan 15 10:21:25 2017 New Revision: 312224 URL: https://svnweb.freebsd.org/changeset/base/312224 Log: arswitch: Ensure the lock is always held when calling arswitch_modifyreg() arswitch_setled() and a number of _global_setup functions did not acquire the lock before calling arswitch_modifyreg(). With WITNESS enabled this would instantly panic. Discovered on a TPLink-3600: ("panic: mutex arswitch not owned at sys/dev/etherswitch/arswitch/arswitch_reg.c:236") Reviewed by: adrian, kan Differential Revision: https://reviews.freebsd.org/D9187 Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitch_7240.c head/sys/dev/etherswitch/arswitch/arswitch_8316.c head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitch_9340.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Sun Jan 15 10:17:15 2017 (r312223) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Sun Jan 15 10:21:25 2017 (r312224) @@ -845,6 +845,7 @@ static int arswitch_setled(struct arswitch_softc *sc, int phy, int led, int style) { int shift; + int err; if (phy < 0 || phy > sc->numphys) return EINVAL; @@ -852,10 +853,15 @@ arswitch_setled(struct arswitch_softc *s if (style < 0 || style > ETHERSWITCH_PORT_LED_MAX) return (EINVAL); + ARSWITCH_LOCK(sc); + shift = ar8327_led_mapping[phy][led].shift; - return (arswitch_modifyreg(sc->sc_dev, + err = (arswitch_modifyreg(sc->sc_dev, ar8327_led_mapping[phy][led].reg, 0x03 << shift, led_pattern_table[style] << shift)); + ARSWITCH_UNLOCK(sc); + + return (err); } static void Modified: head/sys/dev/etherswitch/arswitch/arswitch_7240.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_7240.c Sun Jan 15 10:17:15 2017 (r312223) +++ head/sys/dev/etherswitch/arswitch/arswitch_7240.c Sun Jan 15 10:21:25 2017 (r312224) @@ -81,6 +81,8 @@ static int ar7240_hw_global_setup(struct arswitch_softc *sc) { + ARSWITCH_LOCK(sc); + /* Enable CPU port; disable mirror port */ arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); @@ -103,6 +105,8 @@ ar7240_hw_global_setup(struct arswitch_s arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG, AR8X16_SERVICE_TAG_MASK, 0); + ARSWITCH_UNLOCK(sc); + return (0); } Modified: head/sys/dev/etherswitch/arswitch/arswitch_8316.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8316.c Sun Jan 15 10:17:15 2017 (r312223) +++ head/sys/dev/etherswitch/arswitch/arswitch_8316.c Sun Jan 15 10:21:25 2017 (r312224) @@ -127,6 +127,8 @@ static int ar8316_hw_global_setup(struct arswitch_softc *sc) { + ARSWITCH_LOCK(sc); + arswitch_writereg(sc->sc_dev, 0x38, AR8X16_MAGIC); /* Enable CPU port and disable mirror port. */ @@ -156,6 +158,7 @@ ar8316_hw_global_setup(struct arswitch_s arswitch_modifyreg(sc->sc_dev, AR8X16_REG_SERVICE_TAG, AR8X16_SERVICE_TAG_MASK, 0); + ARSWITCH_UNLOCK(sc); return (0); } Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Jan 15 10:17:15 2017 (r312223) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Jan 15 10:21:25 2017 (r312224) @@ -708,6 +708,8 @@ ar8327_hw_global_setup(struct arswitch_s { uint32_t t; + ARSWITCH_LOCK(sc); + /* enable CPU port and disable mirror port */ t = AR8327_FWD_CTRL0_CPU_PORT_EN | AR8327_FWD_CTRL0_MIRROR_PORT; @@ -741,6 +743,7 @@ ar8327_hw_global_setup(struct arswitch_s /* GMAC0 (CPU), GMAC1..5 (PHYs), GMAC6 (CPU) */ sc->info.es_nports = 7; + ARSWITCH_UNLOCK(sc); return (0); } Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_9340.c Sun Jan 15 10:17:15 2017 (r312223) +++ head/sys/dev/etherswitch/arswitch/arswitch_9340.c Sun Jan 15 10:21:25 2017 (r312224) @@ -81,6 +81,8 @@ static int ar9340_hw_global_setup(struct arswitch_softc *sc) { + ARSWITCH_LOCK(sc); + /* Enable CPU port; disable mirror port */ arswitch_writereg(sc->sc_dev, AR8X16_REG_CPU_PORT, AR8X16_CPU_PORT_EN | AR8X16_CPU_MIRROR_DIS); @@ -142,6 +144,7 @@ ar9340_hw_global_setup(struct arswitch_s } else { device_printf(sc->sc_dev, "%s: need is_gmii or is_mii set\n", __func__); + ARSWITCH_UNLOCK(sc); return (ENXIO); } @@ -163,6 +166,7 @@ ar9340_hw_global_setup(struct arswitch_s /* Settle time */ DELAY(1000); + ARSWITCH_UNLOCK(sc); return (0); } From owner-svn-src-all@freebsd.org Sun Jan 15 10:29:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5F4FCA5BA1; Sun, 15 Jan 2017 10:29:54 +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 A815C1D21; Sun, 15 Jan 2017 10:29:54 +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 v0FATrx8094877; Sun, 15 Jan 2017 10:29:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FATrQM094876; Sun, 15 Jan 2017 10:29:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701151029.v0FATrQM094876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 15 Jan 2017 10:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312226 - head/tests/sys/kern/acct 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, 15 Jan 2017 10:29:55 -0000 Author: ngie Date: Sun Jan 15 10:29:53 2017 New Revision: 312226 URL: https://svnweb.freebsd.org/changeset/base/312226 Log: Fix typo in r312216 I meant to replace "exp" with "exponent", not "expected" MFC after: 13 days Pointyhat to: ngie Submitted by: bde Modified: head/tests/sys/kern/acct/Makefile Modified: head/tests/sys/kern/acct/Makefile ============================================================================== --- head/tests/sys/kern/acct/Makefile Sun Jan 15 10:24:45 2017 (r312225) +++ head/tests/sys/kern/acct/Makefile Sun Jan 15 10:29:53 2017 (r312226) @@ -13,7 +13,7 @@ acct_test.o: convert.c convert.c: ${SRCTOP}/sys/kern/kern_acct.c sed -n -e 's/log(/syslog(/g' \ - -e 's/exp/expected/g' \ + -e 's/exp/exponent/g' \ -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' ${.ALLSRC} >${.TARGET}.tmp mv ${.TARGET}.tmp ${.TARGET} From owner-svn-src-all@freebsd.org Sun Jan 15 12:24:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B07FACAE114; Sun, 15 Jan 2017 12:24:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68D8F1B07; Sun, 15 Jan 2017 12:24:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FCONaL044455; Sun, 15 Jan 2017 12:24:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FCONoQ044454; Sun, 15 Jan 2017 12:24:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701151224.v0FCONoQ044454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 15 Jan 2017 12:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312228 - 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: Sun, 15 Jan 2017 12:24:24 -0000 Author: mav Date: Sun Jan 15 12:24:23 2017 New Revision: 312228 URL: https://svnweb.freebsd.org/changeset/base/312228 Log: Make `camcontrol cmd ... -i ...` return only valid bytes. Previously code ignored resid field and returned extra zeroes in case of data underflow. Now it returns only real bytes received from target. MFC after: 2 weeks Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Sun Jan 15 10:33:52 2017 (r312227) +++ head/sbin/camcontrol/camcontrol.c Sun Jan 15 12:24:23 2017 (r312228) @@ -4150,7 +4150,7 @@ scsicmd(struct cam_device *device, int a u_int8_t cdb[20]; u_int8_t atacmd[12]; struct get_hook hook; - int c, data_bytes = 0; + int c, data_bytes = 0, valid_bytes; int cdb_len = 0; int atacmd_len = 0; int dmacmd = 0; @@ -4454,16 +4454,20 @@ scsicmd(struct cam_device *device, int a } } + if (cdb_len) + valid_bytes = ccb->csio.dxfer_len - ccb->csio.resid; + else + valid_bytes = ccb->ataio.dxfer_len - ccb->ataio.resid; if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) && (arglist & CAM_ARG_CMD_IN) - && (data_bytes > 0)) { + && (valid_bytes > 0)) { if (fd_data == 0) { - buff_decode_visit(data_ptr, data_bytes, datastr, + buff_decode_visit(data_ptr, valid_bytes, datastr, arg_put, NULL); fprintf(stdout, "\n"); } else { ssize_t amt_written; - int amt_to_write = data_bytes; + int amt_to_write = valid_bytes; u_int8_t *buf_ptr = data_ptr; for (amt_written = 0; (amt_to_write > 0) && @@ -4478,7 +4482,7 @@ scsicmd(struct cam_device *device, int a } else if ((amt_written == 0) && (amt_to_write > 0)) { warnx("only wrote %u bytes out of %u", - data_bytes - amt_to_write, data_bytes); + valid_bytes - amt_to_write, valid_bytes); } } } From owner-svn-src-all@freebsd.org Sun Jan 15 13:40:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 232C0CB1C4C; Sun, 15 Jan 2017 13:40:16 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E467818D5; Sun, 15 Jan 2017 13:40:15 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FDeFWR073446; Sun, 15 Jan 2017 13:40:15 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FDeFdG073445; Sun, 15 Jan 2017 13:40:15 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201701151340.v0FDeFdG073445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 15 Jan 2017 13:40:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312230 - head/share/skel 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, 15 Jan 2017 13:40:16 -0000 Author: jilles Date: Sun Jan 15 13:40:14 2017 New Revision: 312230 URL: https://svnweb.freebsd.org/changeset/base/312230 Log: skel: Do not set -o emacs in .shrc. sh has defaulted to 'set -o emacs' since FreeBSD 9.0. Therefore, do not set this again in .shrc, since that only serves to prevent invocations like 'sh -o vi' and 'sh +o emacs' to have the intended effect. PR: 215958 Submitted by: Andras Farkas MFC after: 1 week Modified: head/share/skel/dot.shrc Modified: head/share/skel/dot.shrc ============================================================================== --- head/share/skel/dot.shrc Sun Jan 15 12:58:14 2017 (r312229) +++ head/share/skel/dot.shrc Sun Jan 15 13:40:14 2017 (r312230) @@ -13,10 +13,6 @@ # # umask 022 -# Enable the builtin emacs(1) command line editor in sh(1), -# e.g. C-a -> beginning-of-line. -set -o emacs - # Uncomment this and comment the above to enable the builtin vi(1) command # line editor in sh(1), e.g. ESC to go into visual mode. # set -o vi From owner-svn-src-all@freebsd.org Sun Jan 15 13:51:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C222CB11EC; Sun, 15 Jan 2017 13:51:45 +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 3B3E6134D; Sun, 15 Jan 2017 13:51:45 +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 v0FDpiMC080611; Sun, 15 Jan 2017 13:51:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FDpiXV080609; Sun, 15 Jan 2017 13:51:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701151351.v0FDpiXV080609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 15 Jan 2017 13:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312231 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jan 2017 13:51:45 -0000 Author: mav Date: Sun Jan 15 13:51:44 2017 New Revision: 312231 URL: https://svnweb.freebsd.org/changeset/base/312231 Log: When in kernel, map ctl_scsi_zero_io() to ctl_zero_io(). MFC after: 1 week Modified: head/sys/cam/ctl/ctl_util.c head/sys/cam/ctl/ctl_util.h Modified: head/sys/cam/ctl/ctl_util.c ============================================================================== --- head/sys/cam/ctl/ctl_util.c Sun Jan 15 13:40:14 2017 (r312230) +++ head/sys/cam/ctl/ctl_util.c Sun Jan 15 13:51:44 2017 (r312231) @@ -697,7 +697,6 @@ ctl_scsi_free_io(union ctl_io *io) free(io); } -#endif /* !_KERNEL */ void ctl_scsi_zero_io(union ctl_io *io) { @@ -707,11 +706,10 @@ ctl_scsi_zero_io(union ctl_io *io) return; pool_ref = io->io_hdr.pool; - memset(io, 0, sizeof(*io)); - io->io_hdr.pool = pool_ref; } +#endif /* !_KERNEL */ const char * ctl_scsi_task_string(struct ctl_taskio *taskio) Modified: head/sys/cam/ctl/ctl_util.h ============================================================================== --- head/sys/cam/ctl/ctl_util.h Sun Jan 15 13:40:14 2017 (r312230) +++ head/sys/cam/ctl/ctl_util.h Sun Jan 15 13:51:44 2017 (r312231) @@ -96,8 +96,10 @@ void ctl_scsi_maintenance_in(union ctl_i #ifndef _KERNEL union ctl_io *ctl_scsi_alloc_io(uint32_t initid); void ctl_scsi_free_io(union ctl_io *io); -#endif /* !_KERNEL */ void ctl_scsi_zero_io(union ctl_io *io); +#else +#define ctl_scsi_zero_io(io) ctl_zero_io(io) +#endif /* !_KERNEL */ const char *ctl_scsi_task_string(struct ctl_taskio *taskio); void ctl_io_sbuf(union ctl_io *io, struct sbuf *sb); void ctl_io_error_sbuf(union ctl_io *io, From owner-svn-src-all@freebsd.org Sun Jan 15 13:57:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB17BCB134B; Sun, 15 Jan 2017 13:57:43 +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 7FB1C1783; Sun, 15 Jan 2017 13:57:43 +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 v0FDvgBW081871; Sun, 15 Jan 2017 13:57:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FDvg6P081869; Sun, 15 Jan 2017 13:57:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701151357.v0FDvg6P081869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 15 Jan 2017 13:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312232 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jan 2017 13:57:43 -0000 Author: mav Date: Sun Jan 15 13:57:42 2017 New Revision: 312232 URL: https://svnweb.freebsd.org/changeset/base/312232 Log: Add under-/overrun support to IOCTL and CAM SIM frontends. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/ctl_frontend_ioctl.c Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Jan 15 13:51:44 2017 (r312231) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Jan 15 13:57:42 2017 (r312232) @@ -304,10 +304,6 @@ cfcs_datamove(union ctl_io *io) int ctl_watermark, cam_watermark; int i, j; - - cam_sg_offset = 0; - cam_sg_start = 0; - ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; /* @@ -330,6 +326,8 @@ cfcs_datamove(union ctl_io *io) cam_sglist = (bus_dma_segment_t *)ccb->csio.data_ptr; cam_sg_count = ccb->csio.sglist_cnt; + cam_sg_start = cam_sg_count; + cam_sg_offset = 0; for (i = 0, len_seen = 0; i < cam_sg_count; i++) { if ((len_seen + cam_sglist[i].ds_len) >= @@ -422,9 +420,20 @@ cfcs_datamove(union ctl_io *io) io->scsiio.ext_data_filled += len_copied; + /* + * Report write underflow as error, since CTL and backends don't + * really support it. + */ + if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT && + j < ctl_sg_count) { + io->io_hdr.port_status = 43; + } else + if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) { io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = NULL; io->io_hdr.flags |= CTL_FLAG_STATUS_SENT; + ccb->csio.resid = ccb->csio.dxfer_len - + io->scsiio.ext_data_filled; ccb->ccb_h.status &= ~CAM_STATUS_MASK; ccb->ccb_h.status |= CAM_REQ_CMP; xpt_done(ccb); @@ -453,6 +462,10 @@ cfcs_done(union ctl_io *io) /* * Translate CTL status to CAM status. */ + if (ccb->ccb_h.func_code == XPT_SCSI_IO) { + ccb->csio.resid = ccb->csio.dxfer_len - + io->scsiio.ext_data_filled; + } ccb->ccb_h.status &= ~CAM_STATUS_MASK; switch (io->io_hdr.status & CTL_STATUS_MASK) { case CTL_SUCCESS: Modified: head/sys/cam/ctl/ctl_frontend_ioctl.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_ioctl.c Sun Jan 15 13:51:44 2017 (r312231) +++ head/sys/cam/ctl/ctl_frontend_ioctl.c Sun Jan 15 13:57:42 2017 (r312232) @@ -143,16 +143,13 @@ ctl_ioctl_do_datamove(struct ctl_scsiio int ext_sglist_malloced; int i, j; - ext_sglist_malloced = 0; - ext_sg_start = 0; - ext_offset = 0; - CTL_DEBUG_PRINT(("ctl_ioctl_do_datamove\n")); /* * If this flag is set, fake the data transfer. */ if (ctsio->io_hdr.flags & CTL_FLAG_NO_DATAMOVE) { + ext_sglist_malloced = 0; ctsio->ext_data_filled = ctsio->ext_data_len; goto bailout; } @@ -165,7 +162,6 @@ ctl_ioctl_do_datamove(struct ctl_scsiio int len_seen; ext_sglen = ctsio->ext_sg_entries * sizeof(*ext_sglist); - ext_sglist = (struct ctl_sg_entry *)malloc(ext_sglen, M_CTL, M_WAITOK); ext_sglist_malloced = 1; @@ -174,6 +170,8 @@ ctl_ioctl_do_datamove(struct ctl_scsiio goto bailout; } ext_sg_entries = ctsio->ext_sg_entries; + ext_sg_start = ext_sg_entries; + ext_offset = 0; len_seen = 0; for (i = 0; i < ext_sg_entries; i++) { if ((len_seen + ext_sglist[i].len) >= @@ -186,6 +184,7 @@ ctl_ioctl_do_datamove(struct ctl_scsiio } } else { ext_sglist = &ext_entry; + ext_sglist_malloced = 0; ext_sglist->addr = ctsio->ext_data_ptr; ext_sglist->len = ctsio->ext_data_len; ext_sg_entries = 1; @@ -203,7 +202,6 @@ ctl_ioctl_do_datamove(struct ctl_scsiio kern_sg_entries = 1; } - kern_watermark = 0; ext_watermark = ext_offset; len_copied = 0; @@ -274,10 +272,16 @@ ctl_ioctl_do_datamove(struct ctl_scsiio "kern_data_len = %d\n", ctsio->ext_data_len, ctsio->kern_data_len)); + /* + * Report write underflow as error, since CTL and backends don't + * really support it. + */ + if ((ctsio->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT && + j < kern_sg_entries) { + ctsio->io_hdr.port_status = 43; + } - /* XXX KDM set residual?? */ bailout: - if (ext_sglist_malloced != 0) free(ext_sglist, M_CTL); @@ -397,7 +401,7 @@ ctl_ioctl_io(struct cdev *dev, u_long cm struct thread *td) { union ctl_io *io; - void *pool_tmp; + void *pool_tmp, *sc_tmp; int retval = 0; /* @@ -414,8 +418,10 @@ ctl_ioctl_io(struct cdev *dev, u_long cm * spammed by the user's ctl_io. */ pool_tmp = io->io_hdr.pool; + sc_tmp = CTL_SOFTC(io); memcpy(io, (void *)addr, sizeof(*io)); io->io_hdr.pool = pool_tmp; + CTL_SOFTC(io) = sc_tmp; /* * No status yet, so make sure the status is set properly. From owner-svn-src-all@freebsd.org Sun Jan 15 14:45:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5770BCB136A; Sun, 15 Jan 2017 14:45:37 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1827A122B; Sun, 15 Jan 2017 14:45:37 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cSm3n-000DEG-5v; Sun, 15 Jan 2017 17:45:31 +0300 Date: Sun, 15 Jan 2017 17:45:31 +0300 From: Slawa Olhovchenkov To: Julian Elischer Cc: Mark Johnston , Bruce Evans , svn-src-head@freebsd.org, rang@acm.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r311952 - head/sys/ddb Message-ID: <20170115144531.GB58505@zxy.spb.ru> References: <201701120022.v0C0MaHq053076@repo.freebsd.org> <20170113131948.P1465@besplex.bde.org> <20170114220629.GB18065@raichu> <1755552c-a5e2-848a-38e2-3bacfbecfb23@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1755552c-a5e2-848a-38e2-3bacfbecfb23@elischer.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jan 2017 14:45:37 -0000 On Sun, Jan 15, 2017 at 01:07:58PM +0800, Julian Elischer wrote: > > the old DEC machines had (from memory) ^O which dropped all pending > output. > Not so useful when there is 2MB of network buffers queued up to you, > but very useful on > and asr-33 teletype. Now it useful too, on serial console. ^O processing be present years ago in FreeBSD, but removed at time of tty code rewrite. As I know patch for restore exist, nobody review/commit. From owner-svn-src-all@freebsd.org Sun Jan 15 15:43:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1ABFCB145E; Sun, 15 Jan 2017 15:43:20 +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 8258E1E30; Sun, 15 Jan 2017 15:43:20 +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 v0FFhJnf029548; Sun, 15 Jan 2017 15:43:19 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FFhJh5029547; Sun, 15 Jan 2017 15:43:19 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201701151543.v0FFhJh5029547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 15 Jan 2017 15:43: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: r312233 - stable/11/sys/netipsec 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, 15 Jan 2017 15:43:20 -0000 Author: ae Date: Sun Jan 15 15:43:19 2017 New Revision: 312233 URL: https://svnweb.freebsd.org/changeset/base/312233 Log: MFC r311679: Add direction argument to ipsec_setspidx_inpcb() function. This function is used only by ipsec_getpolicybysock() to fill security policy index selector for locally generated packets (that have INPCB). The function incorrectly assumes that spidx is the same for both directions. Fix this by using new direction argument to specify correct INPCB security policy - sp_in or sp_out. There is no need to fill both policy indeces, because they are overwritten for each packet. This fixes security policy matching for outbound packets when user has specified TCP/UDP ports in the security policy upperspec. PR: 213869 Modified: stable/11/sys/netipsec/ipsec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netipsec/ipsec.c ============================================================================== --- stable/11/sys/netipsec/ipsec.c Sun Jan 15 13:57:42 2017 (r312232) +++ stable/11/sys/netipsec/ipsec.c Sun Jan 15 15:43:19 2017 (r312233) @@ -241,7 +241,7 @@ SYSCTL_VNET_PCPUSTAT(_net_inet6_ipsec6, #endif /* INET6 */ static int ipsec_in_reject(struct secpolicy *, const struct mbuf *); -static int ipsec_setspidx_inpcb(const struct mbuf *, struct inpcb *); +static int ipsec_setspidx_inpcb(const struct mbuf *, struct inpcb *, u_int); static int ipsec_setspidx(const struct mbuf *, struct secpolicyindex *, int); static void ipsec4_get_ulp(const struct mbuf *m, struct secpolicyindex *, int); static int ipsec4_setspidx_ipaddr(const struct mbuf *, struct secpolicyindex *); @@ -344,7 +344,7 @@ ipsec_getpolicybysock(const struct mbuf } /* Set spidx in pcb. */ - *error = ipsec_setspidx_inpcb(m, inp); + *error = ipsec_setspidx_inpcb(m, inp, dir); if (*error) return (NULL); @@ -501,8 +501,9 @@ ipsec4_checkpolicy(const struct mbuf *m, } static int -ipsec_setspidx_inpcb(const struct mbuf *m, struct inpcb *inp) +ipsec_setspidx_inpcb(const struct mbuf *m, struct inpcb *inp, u_int dir) { + struct secpolicyindex *spidx; int error; IPSEC_ASSERT(inp != NULL, ("null inp")); @@ -510,11 +511,13 @@ ipsec_setspidx_inpcb(const struct mbuf * IPSEC_ASSERT(inp->inp_sp->sp_out != NULL && inp->inp_sp->sp_in != NULL, ("null sp_in || sp_out")); - error = ipsec_setspidx(m, &inp->inp_sp->sp_in->spidx, 1); + if (dir == IPSEC_DIR_INBOUND) + spidx = &inp->inp_sp->sp_in->spidx; + else + spidx = &inp->inp_sp->sp_out->spidx; + error = ipsec_setspidx(m, spidx, 1); if (error == 0) { - inp->inp_sp->sp_in->spidx.dir = IPSEC_DIR_INBOUND; - inp->inp_sp->sp_out->spidx = inp->inp_sp->sp_in->spidx; - inp->inp_sp->sp_out->spidx.dir = IPSEC_DIR_OUTBOUND; + spidx->dir = dir; } else { bzero(&inp->inp_sp->sp_in->spidx, sizeof (inp->inp_sp->sp_in->spidx)); From owner-svn-src-all@freebsd.org Sun Jan 15 17:54:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9625CB14CC; Sun, 15 Jan 2017 17:54:07 +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 52A7116DA; Sun, 15 Jan 2017 17:54:07 +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 v0FHs6IU081929; Sun, 15 Jan 2017 17:54:06 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FHs14W081882; Sun, 15 Jan 2017 17:54:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701151754.v0FHs14W081882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 15 Jan 2017 17:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312234 - in head: sbin/camcontrol share/man/man4 share/man/man9 sys/arm/arm sys/arm/freescale/imx sys/arm/mv sys/cam sys/dev/bhnd sys/dev/fdt sys/dev/isp sys/dev/mmc sys/dev/mpt sys/de... 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, 15 Jan 2017 17:54:07 -0000 Author: cem Date: Sun Jan 15 17:54:01 2017 New Revision: 312234 URL: https://svnweb.freebsd.org/changeset/base/312234 Log: "Buses" is the preferred plural of "bus" Replace archaic "busses" with modern form "buses." Intentionally excluded: * Old/random drivers I didn't recognize * Old hardware in general * Use of "busses" in code as identifiers No functional change. http://grammarist.com/spelling/buses-busses/ PR: 216099 Reported by: bltsrc at mail.ru Sponsored by: Dell EMC Isilon Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/share/man/man4/ehci.4 head/share/man/man4/iicbus.4 head/share/man/man4/scsi.4 head/share/man/man9/BUS_CONFIG_INTR.9 head/share/man/man9/DEVICE_ATTACH.9 head/share/man/man9/DEVICE_IDENTIFY.9 head/share/man/man9/DRIVER_MODULE.9 head/share/man/man9/bus_generic_attach.9 head/share/man/man9/bus_generic_detach.9 head/share/man/man9/bus_generic_new_pass.9 head/share/man/man9/bus_generic_print_child.9 head/share/man/man9/bus_generic_read_ivar.9 head/share/man/man9/bus_generic_shutdown.9 head/share/man/man9/bus_space.9 head/share/man/man9/device.9 head/share/man/man9/device_add_child.9 head/share/man/man9/pci.9 head/sys/arm/arm/ofw_machdep.c head/sys/arm/freescale/imx/imx6_ccm.c head/sys/arm/freescale/imx/imx6_machdep.c head/sys/arm/freescale/imx/imx_i2c.c head/sys/arm/mv/mv_pci.c head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h head/sys/dev/bhnd/bhnd.h head/sys/dev/fdt/simplebus.c head/sys/dev/isp/isp.c head/sys/dev/mmc/mmcreg.h head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h head/sys/dev/mpt/mpt_raid.c head/sys/dev/pccbb/pccbb_pci.c head/sys/dev/pci/hostb_pci.c head/sys/dev/pci/pci.c head/sys/dev/pci/pci_private.h head/sys/dev/pci/pci_subr.c head/sys/dev/usb/usb_hub.c head/sys/kern/bus_if.m head/sys/kern/sched_ule.c head/sys/kern/subr_bus.c head/sys/sys/bus.h head/sys/x86/pci/pci_bus.c head/sys/x86/x86/mptable.c head/sys/x86/x86/nexus.c head/sys/xen/xenbus/xenbusb.c head/sys/xen/xenbus/xenbusb.h head/usr.sbin/mptutil/mpt_cam.c Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Sun Jan 15 15:43:19 2017 (r312233) +++ head/sbin/camcontrol/camcontrol.8 Sun Jan 15 17:54:01 2017 (r312234) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2017 +.Dd January 15, 2017 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -565,12 +565,12 @@ start bit set and the load/eject bit set Send the SCSI Start/Stop Unit (0x1B) command to the given device with the start bit cleared and the load/eject bit set. .It Ic rescan -Tell the kernel to scan all busses in the system (with the +Tell the kernel to scan all buses in the system (with the .Ar all argument), the given bus (XPT_SCAN_BUS), or bus:target:lun (XPT_SCAN_LUN) for new devices or devices that have gone away. The user -may specify a scan of all busses, a single bus, or a lun. +may specify a scan of all buses, a single bus, or a lun. Scanning all luns on a target is not supported. .It Ic reprobe @@ -580,7 +580,7 @@ notify the upper layer, This includes sending the SCSI READ CAPACITY command and updating the disk size visible to the rest of the system. .It Ic reset -Tell the kernel to reset all busses in the system (with the +Tell the kernel to reset all buses in the system (with the .Ar all argument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus reset for that bus, or to reset the given bus:target:lun @@ -2557,7 +2557,7 @@ write reallocation settings, among other .Pp .Dl camcontrol rescan all .Pp -Rescan all SCSI busses in the system for devices that have been added, +Rescan all SCSI buses in the system for devices that have been added, removed or changed. .Pp .Dl camcontrol rescan 0 Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sbin/camcontrol/camcontrol.c Sun Jan 15 17:54:01 2017 (r312234) @@ -3179,8 +3179,8 @@ rescan_or_reset_bus(path_id_t bus, int r /* * The right way to handle this is to modify the xpt so that it can * handle a wildcarded bus in a rescan or reset CCB. At the moment - * that isn't implemented, so instead we enumerate the busses and - * send the rescan or reset to those busses in the case where the + * that isn't implemented, so instead we enumerate the buses and + * send the rescan or reset to those buses in the case where the * given bus is -1 (wildcard). We don't send a rescan or reset * to the xpt bus; sending a rescan to the xpt bus is effectively a * no-op, sending a rescan to the xpt bus would result in a status of @@ -8954,8 +8954,8 @@ usage(int printlong) "load send a Start Unit command to the device with the load bit set\n" "eject send a Stop Unit command to the device with the eject bit set\n" "reprobe update capacity information of the given device\n" -"rescan rescan all busses, the given bus, or bus:target:lun\n" -"reset reset all busses, the given bus, or bus:target:lun\n" +"rescan rescan all buses, the given bus, or bus:target:lun\n" +"reset reset all buses, the given bus, or bus:target:lun\n" "defects read the defect list of the specified device\n" "modepage display or edit (-e) the given mode page\n" "cmd send the given SCSI command, may need -i or -o as well\n" Modified: head/share/man/man4/ehci.4 ============================================================================== --- head/share/man/man4/ehci.4 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man4/ehci.4 Sun Jan 15 17:54:01 2017 (r312234) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 4, 2012 +.Dd January 15, 2017 .Dt EHCI 4 .Os .Sh NAME @@ -68,7 +68,7 @@ but can be noticed since 1.x and .Tn USB 2.0 devices plugged in to the same -connector appear to connect to different USB busses. +connector appear to connect to different USB buses. .Sh SEE ALSO .Xr ohci 4 , .Xr uhci 4 , Modified: head/share/man/man4/iicbus.4 ============================================================================== --- head/share/man/man4/iicbus.4 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man4/iicbus.4 Sun Jan 15 17:54:01 2017 (r312234) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 17, 2014 +.Dd January 15, 2017 .Dt IICBUS 4 .Os .Sh NAME @@ -112,11 +112,11 @@ different speed. A general purpose I2C bus, such as those found in many embedded systems, will often support multiple bus frequencies. .Pp -When a system supports multiple I2C busses, a different frequency can +When a system supports multiple I2C buses, a different frequency can be configured for each bus by number, represented by the .Va %d in the variable names below. -Busses can be configured using any combination of device hints, +Buses can be configured using any combination of device hints, Flattened Device Tree (FDT) data, tunables set via .Xr loader 8 , or at runtime using Modified: head/share/man/man4/scsi.4 ============================================================================== --- head/share/man/man4/scsi.4 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man4/scsi.4 Sun Jan 15 17:54:01 2017 (r312234) @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd June 7, 2012 +.Dd January 15, 2017 .Dt CAM 4 .Os .Sh NAME @@ -62,7 +62,7 @@ devices, and to utilize different and .Tn ATA host adapters through host adapter drivers. -When the system probes busses, it attaches any devices it finds to the +When the system probes buses, it attaches any devices it finds to the appropriate drivers. The .Xr pass 4 @@ -150,7 +150,7 @@ In that case, the will be reset to 100ms. .El .Pp -All devices and busses support dynamic allocation so that +All devices and buses support dynamic allocation so that an upper number of devices and controllers does not need to be configured; .Cd "device da" will suffice for any number of disk drivers. @@ -297,7 +297,7 @@ see printfs for multiple debugging level This allows to set the various debugging flags from a kernel config file. .It Dv CAM_DEBUG_BUS Specify a bus to debug. -To debug all busses, set this to -1. +To debug all buses, set this to -1. .It Dv CAM_DEBUG_TARGET Specify a target to debug. To debug all targets, set this to -1. Modified: head/share/man/man9/BUS_CONFIG_INTR.9 ============================================================================== --- head/share/man/man9/BUS_CONFIG_INTR.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/BUS_CONFIG_INTR.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2005 +.Dd January 15, 2017 .Dt BUS_CONFIG_INTR 9 .Os .\" @@ -45,7 +45,7 @@ The .Fn BUS_CONFIG_INTR method allows bus or device drivers to provide interrupt polarity and trigger -mode to parent busses. +mode to parent buses. This typically bubbles all the way up to the root bus (e.g.\& nexus) where the necessary actions are taken to actually program the hardware. Since the Modified: head/share/man/man9/DEVICE_ATTACH.9 ============================================================================== --- head/share/man/man9/DEVICE_ATTACH.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/DEVICE_ATTACH.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2005 +.Dd January 15, 2017 .Dt DEVICE_ATTACH 9 .Os .Sh NAME @@ -51,7 +51,7 @@ system resources (such as .Xr devfs 5 entries). .Pp -Devices which implement busses should use this method to probe for +Devices which implement buses should use this method to probe for the existence of devices attached to the bus and add them as children. If this is combined with the use of Modified: head/share/man/man9/DEVICE_IDENTIFY.9 ============================================================================== --- head/share/man/man9/DEVICE_IDENTIFY.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/DEVICE_IDENTIFY.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2004 +.Dd January 15, 2017 .Dt DEVICE_IDENTIFY 9 .Os .Sh NAME @@ -40,7 +40,7 @@ .Ft void .Fn DEVICE_IDENTIFY "driver_t *driver" "device_t parent" .Sh DESCRIPTION -The identify function for a device is only needed for devices on busses +The identify function for a device is only needed for devices on buses that cannot identify their children independently, e.g.\& the ISA bus. It is used to recognize the device (usually done by accessing non-ambiguous registers in the hardware) and to tell the kernel about it and thus Modified: head/share/man/man9/DRIVER_MODULE.9 ============================================================================== --- head/share/man/man9/DRIVER_MODULE.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/DRIVER_MODULE.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 21, 2012 +.Dd January 15, 2017 .Dt DRIVER_MODULE 9 .Os .Sh NAME @@ -69,9 +69,9 @@ or The identifier used in .Fn DRIVER_MODULE can be different from the driver name. -Also, the same driver identifier can exist on different busses, +Also, the same driver identifier can exist on different buses, which is a pretty clean way of making front ends for different cards -using the same driver on the same or different busses. +using the same driver on the same or different buses. For example, the following is allowed: .Pp .Fn DRIVER_MODULE foo isa foo_driver foo_devclass NULL NULL ; Modified: head/share/man/man9/bus_generic_attach.9 ============================================================================== --- head/share/man/man9/bus_generic_attach.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/bus_generic_attach.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -28,14 +28,14 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 1998 +.Dd January 15, 2017 .Dt BUS_GENERIC_ATTACH 9 .Os .Sh NAME .Nm bus_generic_attach .Nd generic implementation of .Dv DEVICE_ATTACH -for busses +for buses .Sh SYNOPSIS .In sys/param.h .In sys/bus.h Modified: head/share/man/man9/bus_generic_detach.9 ============================================================================== --- head/share/man/man9/bus_generic_detach.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/bus_generic_detach.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -28,14 +28,14 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 1998 +.Dd January 15, 2017 .Dt BUS_GENERIC_DETACH 9 .Os .Sh NAME .Nm bus_generic_detach .Nd generic implementation of .Dv DEVICE_DETACH -for busses +for buses .Sh SYNOPSIS .In sys/param.h .In sys/bus.h Modified: head/share/man/man9/bus_generic_new_pass.9 ============================================================================== --- head/share/man/man9/bus_generic_new_pass.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/bus_generic_new_pass.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd January 15, 2017 .Dt BUS_GENERIC_NEW_PASS 9 .Os .Sh NAME @@ -47,7 +47,7 @@ It first invokes the method for any drivers whose pass level is equal to the new pass level. Then, for each attached child device it calls .Xr BUS_NEW_PASS 9 -to rescan child busses, +to rescan child buses, and for each unattached child device it calls .Xr device_probe_and_attach 9 . .Sh SEE ALSO Modified: head/share/man/man9/bus_generic_print_child.9 ============================================================================== --- head/share/man/man9/bus_generic_print_child.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/bus_generic_print_child.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -28,14 +28,14 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 1998 +.Dd January 15, 2017 .Dt BUS_GENERIC_PRINT_CHILD 9 .Os .Sh NAME .Nm bus_generic_print_child .Nd generic implementation of .Dv DEVICE_PRINT_CHILD -for busses +for buses .Sh SYNOPSIS .In sys/param.h .In sys/bus.h Modified: head/share/man/man9/bus_generic_read_ivar.9 ============================================================================== --- head/share/man/man9/bus_generic_read_ivar.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/bus_generic_read_ivar.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 1998 +.Dd January 15, 2017 .Dt BUS_GENERIC_READ_IVAR 9 .Os .Sh NAME @@ -38,7 +38,7 @@ .Dv BUS_READ_IVAR and .Dv BUS_WRITE_IVAR -for busses +for buses .Sh SYNOPSIS .In sys/param.h .In sys/bus.h Modified: head/share/man/man9/bus_generic_shutdown.9 ============================================================================== --- head/share/man/man9/bus_generic_shutdown.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/bus_generic_shutdown.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -28,14 +28,14 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 1998 +.Dd January 15, 2017 .Dt BUS_GENERIC_SHUTDOWN 9 .Os .Sh NAME .Nm bus_generic_shutdown .Nd generic implementation of .Dv DEVICE_SHUTDOWN -for busses +for buses .Sh SYNOPSIS .In sys/param.h .In sys/bus.h Modified: head/share/man/man9/bus_space.9 ============================================================================== --- head/share/man/man9/bus_space.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/bus_space.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -51,7 +51,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 13, 2005 +.Dd January 15, 2017 .Dt BUS_SPACE 9 .Os .Sh NAME @@ -601,7 +601,7 @@ of devices on different system architect object file to manipulate a set of devices on multiple bus types on a single architecture. .Pp -Not all busses have to implement all functions described in this +Not all buses have to implement all functions described in this document, though that is encouraged if the operations are logically supported by the bus. Unimplemented functions should cause @@ -625,7 +625,7 @@ machine-dependent code. A given machine may have several different types of bus space (e.g.\& memory space and I/O space), and thus may provide multiple different bus space tags. -Individual busses or devices on a machine may use more than one bus space +Individual buses or devices on a machine may use more than one bus space tag. For instance, ISA devices are given an ISA memory space tag and an ISA I/O space tag. @@ -639,7 +639,7 @@ The bus address describes the start of the range in bus space. The bus size describes the size of the range in bytes. -Busses which are not byte +Buses which are not byte addressable may require use of bus space ranges with appropriately aligned addresses and properly rounded sizes. .Pp @@ -656,7 +656,7 @@ argument, at least one handle argument, The bus space tag specifies the space, each handle specifies a region in the space, and each offset specifies the offset into the region of the actual location(s) to be accessed. -Offsets are given in bytes, though busses +Offsets are given in bytes, though buses may impose alignment constraints. The offset used to access data relative to a given handle must be such that all of the data being @@ -1049,7 +1049,7 @@ The and .Fn bus_space_write_N families of functions provide -the ability to read and write 1, 2, 4, and 8 byte data items on busses +the ability to read and write 1, 2, 4, and 8 byte data items on buses which support those access sizes. .Ss Fn bus_space_read_1 space handle offset .Ss Fn bus_space_read_2 space handle offset Modified: head/share/man/man9/device.9 ============================================================================== --- head/share/man/man9/device.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/device.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 1998 +.Dd January 15, 2017 .Dt DEVICE 9 .Os .Sh NAME @@ -44,7 +44,7 @@ The system defines one device, .Va root_bus and all other devices are created dynamically during autoconfiguration. -Normally devices representing top-level busses in +Normally devices representing top-level buses in the system (ISA, PCI etc.) will be attached directly to .Va root_bus and other devices will be added as children of their relevant bus. Modified: head/share/man/man9/device_add_child.9 ============================================================================== --- head/share/man/man9/device_add_child.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/device_add_child.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2015 +.Dd January 15, 2017 .Dt DEVICE_ADD_CHILD 9 .Os .Sh NAME @@ -63,10 +63,10 @@ If no name is given then all drivers for In any event, only the name of the device is stored so that one may safely unload/load a driver bound to that name. .Pp -This allows busses which can uniquely identify device instances (such +This allows buses which can uniquely identify device instances (such as PCI) to allow each driver to check each device instance for a match. -For busses which rely on supplied probe hints where only one +For buses which rely on supplied probe hints where only one driver can have a chance of probing the device, the driver name should be specified as the device name. .Pp Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Sun Jan 15 15:43:19 2017 (r312233) +++ head/share/man/man9/pci.9 Sun Jan 15 17:54:01 2017 (r312234) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 6, 2016 +.Dd January 15, 2017 .Dt PCI 9 .Os .Sh NAME @@ -583,14 +583,14 @@ full functionality to the user. .It Dv PCI_POWERSTATE_D1 Class-specific low-power state in which device context may or may not be lost. -Busses in this state cannot do anything to the bus, to +Buses in this state cannot do anything to the bus, to force devices to lose context. .It Dv PCI_POWERSTATE_D2 Class-specific low-power state in which device context may or may not be lost. Attains greater power savings than .Dv PCI_POWERSTATE_D1 . -Busses in this state can cause devices to lose some context. +Buses in this state can cause devices to lose some context. Devices .Em must be prepared for the bus to be in this state or higher. Modified: head/sys/arm/arm/ofw_machdep.c ============================================================================== --- head/sys/arm/arm/ofw_machdep.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/arm/arm/ofw_machdep.c Sun Jan 15 17:54:01 2017 (r312234) @@ -50,7 +50,7 @@ OF_decode_addr(phandle_t dev, int regno, return (res); /* - * Nothing special to do for PCI busses right now. + * Nothing special to do for PCI buses right now. * This may need to be handled per-platform when it does come up. */ #ifdef notyet Modified: head/sys/arm/freescale/imx/imx6_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_ccm.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/arm/freescale/imx/imx6_ccm.c Sun Jan 15 17:54:01 2017 (r312234) @@ -90,7 +90,7 @@ ccm_init_gates(struct ccm_softc *sc) { uint32_t reg; - /* ahpbdma, aipstz 1 & 2 busses */ + /* ahpbdma, aipstz 1 & 2 buses */ reg = CCGR0_AIPS_TZ1 | CCGR0_AIPS_TZ2 | CCGR0_ABPHDMA; WR4(sc, CCM_CCGR0, reg); Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/arm/freescale/imx/imx6_machdep.c Sun Jan 15 17:54:01 2017 (r312234) @@ -117,7 +117,7 @@ fdt_pic_decode_t fdt_pic_table[] = { * - GIC node exists and is its own interrupt parent. * * This applies to all models of imx6. Luckily all of them have the devices - * involved at the same addresses on the same busses, so we don't need any + * involved at the same addresses on the same buses, so we don't need any * per-soc logic. We handle this at platform attach time rather than via the * fdt_fixup_table, because the latter requires matching on the FDT "model" * property, and this applies to all boards including those not yet invented. Modified: head/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/arm/freescale/imx/imx_i2c.c Sun Jan 15 17:54:01 2017 (r312234) @@ -35,7 +35,7 @@ * Note that the hardware is capable of running as both a master and a slave. * This driver currently implements only master-mode operations. * - * This driver supports multi-master i2c busses, by detecting bus arbitration + * This driver supports multi-master i2c buses, by detecting bus arbitration * loss and returning IIC_EBUSBSY status. Notably, it does not do any kind of * retries if some other master jumps onto the bus and interrupts one of our * transfer cycles resulting in arbitration loss in mid-transfer. The caller Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/arm/mv/mv_pci.c Sun Jan 15 17:54:01 2017 (r312234) @@ -147,7 +147,7 @@ mv_pci_ranges_decode(phandle_t node, str /* * Initialize the ranges so that we don't have to worry about * having them all defined in the FDT. In particular, it is - * perfectly fine not to want I/O space on PCI busses. + * perfectly fine not to want I/O space on PCI buses. */ bzero(io_space, sizeof(*io_space)); bzero(mem_space, sizeof(*mem_space)); Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/cam/cam_xpt.c Sun Jan 15 17:54:01 2017 (r312234) @@ -106,7 +106,12 @@ struct xpt_softc { int buses_to_config; int buses_config_done; - /* Registered busses */ + /* + * Registered buses + * + * N.B., "busses" is an archaic spelling of "buses". In new code + * "buses" is preferred. + */ TAILQ_HEAD(,cam_eb) xpt_busses; u_int bus_generation; @@ -892,7 +897,7 @@ xpt_init(void *dummy) /* * The xpt layer is, itself, the equivalent of a SIM. * Allow 16 ccbs in the ccb pool for it. This should - * give decent parallelism when we probe busses and + * give decent parallelism when we probe buses and * perform other XPT functions. */ devq = cam_simq_alloc(16); @@ -1627,7 +1632,7 @@ xptedtbusfunc(struct cam_eb *bus, void * } /* - * If the user is only interested in busses, there's no + * If the user is only interested in buses, there's no * reason to descend to the next level in the tree. */ if ((retval & DM_RET_ACTION_MASK) == DM_RET_STOP) @@ -2070,7 +2075,7 @@ xptperiphlistmatch(struct ccb_dev_match /* * At this point in the edt traversal function, we check the bus - * list generation to make sure that no busses have been added or + * list generation to make sure that no buses have been added or * removed since the user last sent a XPT_DEV_MATCH ccb through. * For the peripheral driver list traversal function, however, we * don't have to worry about new peripheral driver types coming or @@ -2816,7 +2821,7 @@ call_sim: /* * There are two ways of getting at information in the EDT. * The first way is via the primary EDT tree. It starts - * with a list of busses, then a list of targets on a bus, + * with a list of buses, then a list of targets on a bus, * then devices/luns on a target, and then peripherals on a * device/lun. The "other" way is by the peripheral driver * lists. The peripheral driver lists are organized by @@ -3356,7 +3361,7 @@ xpt_run_devq(struct cam_devq *devq) /* * Device queues can be shared among multiple SIM instances - * that reside on different busses. Use the SIM from the + * that reside on different buses. Use the SIM from the * queued device, rather than the one from the calling bus. */ sim = device->sim; @@ -3865,7 +3870,7 @@ CAM_XPT_XPORT(xport_default); * A sim structure, listing the SIM entry points and instance * identification info is passed to xpt_bus_register to hook the SIM * into the CAM framework. xpt_bus_register creates a cam_eb entry - * for this new bus and places it in the array of busses and assigns + * for this new bus and places it in the array of buses and assigns * it a path_id. The path_id may be influenced by "hard wiring" * information specified by the user. Once interrupt services are * available, the bus will be probed. @@ -5040,7 +5045,7 @@ xpt_release_boot(void) xsoftc.buses_config_done = 1; xpt_unlock_buses(); - /* Call manually because we don't have any busses */ + /* Call manually because we don't have any buses */ task = malloc(sizeof(struct xpt_task), M_CAMXPT, M_NOWAIT); if (task != NULL) { TASK_INIT(&task->task, 0, xpt_finishconfig_task, task); @@ -5138,7 +5143,7 @@ xpt_register_async(int event, ac_callbac (csa.event_enable & AC_PATH_REGISTERED)) { /* * Get this peripheral up to date with all - * the currently existing busses. + * the currently existing buses. */ xpt_for_all_busses(xptsetasyncbusfunc, &csa); } Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/cam/cam_xpt_internal.h Sun Jan 15 17:54:01 2017 (r312234) @@ -88,7 +88,7 @@ SET_DECLARE(cam_xpt_proto_set, struct xp /* * The CAM EDT (Existing Device Table) contains the device information for - * all devices for all busses in the system. The table contains a + * all devices for all buses in the system. The table contains a * cam_ed structure for each device on the bus. */ struct cam_ed { Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/bhnd/bhnd.h Sun Jan 15 17:54:01 2017 (r312234) @@ -77,7 +77,7 @@ enum bhnd_device_vars { */ enum { BHND_PROBE_ROOT = 0, /**< Nexus or host bridge */ - BHND_PROBE_BUS = 1000, /**< Busses and bridges */ + BHND_PROBE_BUS = 1000, /**< Buses and bridges */ BHND_PROBE_CPU = 2000, /**< CPU devices */ BHND_PROBE_INTERRUPT = 3000, /**< Interrupt controllers. */ BHND_PROBE_TIMER = 4000, /**< Timers and clocks. */ Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/fdt/simplebus.c Sun Jan 15 17:54:01 2017 (r312234) @@ -125,7 +125,7 @@ simplebus_probe(device_t dev) /* * FDT data puts a "simple-bus" compatible string on many things that - * have children but aren't really busses in our world. Without a + * have children but aren't really buses in our world. Without a * ranges property we will fail to attach, so just fail to probe too. */ if (!(ofw_bus_is_compatible(dev, "simple-bus") && Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/isp/isp.c Sun Jan 15 17:54:01 2017 (r312234) @@ -4396,7 +4396,7 @@ isp_start(XS_T *xs) /* * Now see if we need to synchronize the ISP with respect to anything. - * We do dual duty here (cough) for synchronizing for busses other + * We do dual duty here (cough) for synchronizing for buses other * than which we got here to send a command to. */ reqp = (ispreq_t *) local; Modified: head/sys/dev/mmc/mmcreg.h ============================================================================== --- head/sys/dev/mmc/mmcreg.h Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/mmc/mmcreg.h Sun Jan 15 17:54:01 2017 (r312234) @@ -55,7 +55,7 @@ #define DEV_MMC_MMCREG_H /* - * This file contains the register definitions for the mmc and sd busses. + * This file contains the register definitions for the mmc and sd buses. * They are taken from publicly available sources. */ Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/mpt/mpt.c Sun Jan 15 17:54:01 2017 (r312234) @@ -1544,7 +1544,7 @@ mpt_get_portfacts(struct mpt_softc *mpt, /* * Send the initialization request. This is where we specify how many - * SCSI busses and how many devices per bus we wish to emulate. + * SCSI buses and how many devices per bus we wish to emulate. * This is also the command that specifies the max size of the reply * frames from the IOC that we will be allocating. */ @@ -1559,7 +1559,7 @@ mpt_send_ioc_init(struct mpt_softc *mpt, init.WhoInit = who; init.Function = MPI_FUNCTION_IOC_INIT; init.MaxDevices = 0; /* at least 256 devices per bus */ - init.MaxBuses = 16; /* at least 16 busses */ + init.MaxBuses = 16; /* at least 16 buses */ init.MsgVersion = htole16(MPI_VERSION); init.HeaderVersion = htole16(MPI_HEADER_VERSION); Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/mpt/mpt.h Sun Jan 15 17:54:01 2017 (r312234) @@ -809,7 +809,7 @@ mpt_read(struct mpt_softc *mpt, int offs /* * Some operations (e.g. diagnostic register writes while the ARM proccessor * is disabled), must be performed using "PCI pio" operations. On non-PCI - * busses, these operations likely map to normal register accesses. + * buses, these operations likely map to normal register accesses. */ static __inline void mpt_pio_write(struct mpt_softc *mpt, size_t offset, uint32_t val) Modified: head/sys/dev/mpt/mpt_raid.c ============================================================================== --- head/sys/dev/mpt/mpt_raid.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/mpt/mpt_raid.c Sun Jan 15 17:54:01 2017 (r312234) @@ -782,7 +782,7 @@ mpt_raid_quiesce_disk(struct mpt_softc * } #endif -/* XXX Ignores that there may be multiple busses/IOCs involved. */ +/* XXX Ignores that there may be multiple buses/IOCs involved. */ cam_status mpt_map_physdisk(struct mpt_softc *mpt, union ccb *ccb, target_id_t *tgt) { @@ -799,7 +799,7 @@ mpt_map_physdisk(struct mpt_softc *mpt, return (-1); } -/* XXX Ignores that there may be multiple busses/IOCs involved. */ +/* XXX Ignores that there may be multiple buses/IOCs involved. */ int mpt_is_raid_member(struct mpt_softc *mpt, target_id_t tgt) { @@ -818,7 +818,7 @@ mpt_is_raid_member(struct mpt_softc *mpt } -/* XXX Ignores that there may be multiple busses/IOCs involved. */ +/* XXX Ignores that there may be multiple buses/IOCs involved. */ int mpt_is_raid_volume(struct mpt_softc *mpt, target_id_t tgt) { Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/pccbb/pccbb_pci.c Sun Jan 15 17:54:01 2017 (r312234) @@ -351,7 +351,7 @@ cbb_pci_attach(device_t brdev) /* * This is a gross hack. We should be scanning the entire pci * tree, assigning bus numbers in a way such that we (1) can - * reserve 1 extra bus just in case and (2) all sub busses + * reserve 1 extra bus just in case and (2) all sub buses * are in an appropriate range. */ DEVPRINTF((brdev, "Secondary bus is %d\n", sc->bus.sec)); Modified: head/sys/dev/pci/hostb_pci.c ============================================================================== --- head/sys/dev/pci/hostb_pci.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/pci/hostb_pci.c Sun Jan 15 17:54:01 2017 (r312234) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); /* * Provide a device to "eat" the host->pci bridge devices that show up - * on PCI busses and stop them showing up twice on the probes. This also + * on PCI buses and stop them showing up twice on the probes. This also * stops them showing up as 'none' in pciconf -l. If the host bridge * provides an AGP capability then we create a child agp device for the * agp GART driver to attach to. Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/pci/pci.c Sun Jan 15 17:54:01 2017 (r312234) @@ -3095,7 +3095,7 @@ pci_add_map(device_t bus, device_t dev, * If base is 0, then we have problems if this architecture does * not allow that. It is best to ignore such entries for the * moment. These will be allocated later if the driver specifically - * requests them. However, some removable busses look better when + * requests them. However, some removable buses look better when * all resources are allocated, so allow '0' to be overriden. * * Similarly treat maps whose values is the same as the test value @@ -4178,7 +4178,7 @@ pci_attach(device_t dev) /* * Since there can be multiple independently numbered PCI - * busses on systems with multiple PCI domains, we can't use + * buses on systems with multiple PCI domains, we can't use * the unit number to decide which bus we are probing. We ask * the parent pcib what our domain and bus numbers are. */ Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/pci/pci_private.h Sun Jan 15 17:54:01 2017 (r312234) @@ -34,7 +34,7 @@ /* * Export definitions of the pci bus so that we can more easily share - * it with "subclass" busses. + * it with "subclass" buses. */ DECLARE_CLASS(pci_driver); Modified: head/sys/dev/pci/pci_subr.c ============================================================================== --- head/sys/dev/pci/pci_subr.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/pci/pci_subr.c Sun Jan 15 17:54:01 2017 (r312234) @@ -73,7 +73,7 @@ host_pcib_get_busno(pci_read_config_fn r * For the 450nx chipset, there is a whole bundle of * things pretending to be host bridges. The MIOC will * be seen first and isn't really a pci bridge (the - * actual busses are attached to the PXB's). We need to + * actual buses are attached to the PXB's). We need to * read the registers of the MIOC to figure out the * bus numbers for the PXB channels. * Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/dev/usb/usb_hub.c Sun Jan 15 17:54:01 2017 (r312234) @@ -2297,7 +2297,7 @@ usb_needs_explore(struct usb_bus *bus, u * usb_needs_explore_all * * This function is called whenever a new driver is loaded and will - * cause that all USB busses are re-explored. + * cause that all USB buses are re-explored. *------------------------------------------------------------------------*/ void usb_needs_explore_all(void) @@ -2315,7 +2315,7 @@ usb_needs_explore_all(void) return; } /* - * Explore all USB busses in parallel. + * Explore all USB buses in parallel. */ max = devclass_get_maxunit(dc); while (max >= 0) { Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/kern/bus_if.m Sun Jan 15 17:54:01 2017 (r312234) @@ -206,7 +206,7 @@ METHOD void driver_added { /** * @brief Create a new child device * - * For busses which use use drivers supporting DEVICE_IDENTIFY() to + * For buses which use use drivers supporting DEVICE_IDENTIFY() to * enumerate their devices, this method is used to create new * device instances. The new device will be added after the last * existing child with the same order. Implementations of bus_add_child @@ -475,7 +475,7 @@ METHOD int teardown_intr { * @brief Define a resource which can be allocated with * BUS_ALLOC_RESOURCE(). * - * This method is used by some busses (typically ISA) to allow a + * This method is used by some buses (typically ISA) to allow a * driver to describe a resource range that it would like to * allocate. The resource defined by @p _type and @p _rid is defined * to start at @p _start and to include @p _count indices in its @@ -562,7 +562,7 @@ METHOD struct resource_list * get_resour * should return -1 if it is present. Any errors in determining * should be returned as a normal errno value. Client drivers are to * assume that the device is present, even if there is an error - * determining if it is there. Busses are to try to avoid returning + * determining if it is there. Buses are to try to avoid returning * errors, but newcard will return an error if the device fails to * implement this method. * Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/kern/sched_ule.c Sun Jan 15 17:54:01 2017 (r312234) @@ -656,7 +656,7 @@ int __noinline cpu_search_both(const str * according to the match argument. This routine actually compares the * load on all paths through the tree and finds the least loaded cpu on * the least loaded path, which may differ from the least loaded cpu in - * the system. This balances work among caches and busses. + * the system. This balances work among caches and buses. * * This inline is instantiated in three forms below using constants for the * match argument. It is reduced to the minimum set for each case. It is Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/kern/subr_bus.c Sun Jan 15 17:54:01 2017 (r312234) @@ -1093,7 +1093,7 @@ devclass_driver_added(devclass_t dc, dri int i; /* - * Call BUS_DRIVER_ADDED for any existing busses in this class. + * Call BUS_DRIVER_ADDED for any existing buses in this class. */ for (i = 0; i < dc->maxunit; i++) if (dc->devices[i] && device_is_attached(dc->devices[i])) @@ -3269,7 +3269,7 @@ resource_list_delete(struct resource_lis /** * @brief Allocate a reserved resource * - * This can be used by busses to force the allocation of resources + * This can be used by buses to force the allocation of resources * that are always active in the system even if they are not allocated * by a driver (e.g. PCI BARs). This function is usually called when * adding a new child to the bus. The resource is allocated from the @@ -3648,7 +3648,7 @@ bus_generic_probe(device_t dev) * only call the identify routines of eligible drivers * when this routine is called. Drivers for later * passes should have their identify routines called - * on early-pass busses during BUS_NEW_PASS(). + * on early-pass buses during BUS_NEW_PASS(). */ if (dl->pass > bus_current_pass) continue; Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/sys/bus.h Sun Jan 15 17:54:01 2017 (r312234) @@ -392,14 +392,14 @@ int resource_list_print_type(struct reso const char *format); /* - * The root bus, to which all top-level busses are attached. + * The root bus, to which all top-level buses are attached. */ extern device_t root_bus; extern devclass_t root_devclass; void root_bus_configure(void); /* - * Useful functions for implementing busses. + * Useful functions for implementing buses. */ int bus_generic_activate_resource(device_t dev, device_t child, int type, @@ -675,7 +675,7 @@ void bus_data_generation_update(void); * supports the newer ones would return BUS_PROBE_DEFAULT. BUS_PROBE_GENERIC * is for drivers that wish to have a generic form and a specialized form, * like is done with the pci bus and the acpi pci bus. BUS_PROBE_HOOVER is - * for those busses that implement a generic device place-holder for devices on + * for those buses that implement a generic device place-holder for devices on * the bus that have no more specific driver for them (aka ugen). * BUS_PROBE_NOWILDCARD or lower means that the device isn't really bidding * for a device node, but accepts only devices that its parent has told it @@ -699,7 +699,7 @@ void bus_data_generation_update(void); * probed in earlier passes. */ #define BUS_PASS_ROOT 0 /* Used to attach root0. */ -#define BUS_PASS_BUS 10 /* Busses and bridges. */ +#define BUS_PASS_BUS 10 /* Buses and bridges. */ #define BUS_PASS_CPU 20 /* CPU devices. */ #define BUS_PASS_RESOURCE 30 /* Resource discovery. */ #define BUS_PASS_INTERRUPT 40 /* Interrupt controllers. */ @@ -734,7 +734,7 @@ struct module; int driver_module_handler(struct module *, int, void *); /** - * Module support for automatically adding drivers to busses. + * Module support for automatically adding drivers to buses. */ struct driver_module_data { int (*dmd_chainevh)(struct module *, int, void *); Modified: head/sys/x86/pci/pci_bus.c ============================================================================== --- head/sys/x86/pci/pci_bus.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/x86/pci/pci_bus.c Sun Jan 15 17:54:01 2017 (r312234) @@ -195,7 +195,7 @@ legacy_pcib_is_host_bridge(int bus, int * For the 450nx chipset, there is a whole bundle of * things pretending to be host bridges. The MIOC will * be seen first and isn't really a pci bridge (the - * actual busses are attached to the PXB's). We need to + * actual buses are attached to the PXB's). We need to * read the registers of the MIOC to figure out the * bus numbers for the PXB channels. * @@ -566,7 +566,7 @@ legacy_pcib_write_ivar(device_t dev, dev * * If no memory preference is given, use upper 32MB slot most BIOSes * use for their memory window. This is typically only used on older - * laptops that don't have PCI busses behind a PCI bridge, so assuming + * laptops that don't have PCI buses behind a PCI bridge, so assuming * > 32MB is likely OK. * * However, this can cause problems for other chipsets, so we make @@ -723,7 +723,7 @@ DRIVER_MODULE(pcibus_pnp, isa, pcibus_pn #ifdef __HAVE_PIR /* - * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges + * Provide a PCI-PCI bridge driver for PCI buses behind PCI-PCI bridges * that appear in the PCIBIOS Interrupt Routing Table to use the routing * table for interrupt routing when possible. */ Modified: head/sys/x86/x86/mptable.c ============================================================================== --- head/sys/x86/x86/mptable.c Sun Jan 15 15:43:19 2017 (r312233) +++ head/sys/x86/x86/mptable.c Sun Jan 15 17:54:01 2017 (r312234) @@ -385,7 +385,7 @@ mptable_setup_io(void) for (i = 0; i <= mptable_maxbusid; i++) busses[i].bus_type = NOBUS; - /* Second, we run through adding I/O APIC's and busses. */ + /* Second, we run through adding I/O APIC's and buses. */ mptable_parse_apics_and_busses(); /* Third, we run through the table tweaking interrupt sources. */ @@ -584,7 +584,7 @@ mptable_parse_apics_and_busses_handler(u } /* - * Enumerate I/O APIC's and busses. + * Enumerate I/O APIC's and buses. */ static void mptable_parse_apics_and_busses(void) @@ -988,7 +988,7 @@ mptable_pci_setup(void) /* * Find the first pci bus and call it 0. Panic if pci0 is not - * bus zero and there are multiple PCI busses. + * bus zero and there are multiple PCI buses. */ for (i = 0; i <= mptable_maxbusid; i++) if (busses[i].bus_type == PCI) { @@ -996,7 +996,7 @@ mptable_pci_setup(void) pci0 = i; else if (pci0 != 0) panic( - "MPTable contains multiple PCI busses but no PCI bus 0"); + "MPTable contains multiple PCI buses but no PCI bus 0"); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Jan 15 18:00:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50B69CB1732; Sun, 15 Jan 2017 18:00:48 +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 2DB351AB5; Sun, 15 Jan 2017 18:00:48 +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 v0FI0lpi082319; Sun, 15 Jan 2017 18:00:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FI0kO7082305; Sun, 15 Jan 2017 18:00:46 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701151800.v0FI0kO7082305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 15 Jan 2017 18:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312235 - in head/sys: amd64/vmm cam netinet/cc 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, 15 Jan 2017 18:00:48 -0000 Author: cem Date: Sun Jan 15 18:00:45 2017 New Revision: 312235 URL: https://svnweb.freebsd.org/changeset/base/312235 Log: Fix a variety of cosmetic typos and misspellings No functional change. PR: 216096, 216097, 216098, 216101, 216102, 216106, 216109, 216110 Reported by: Bulat Sponsored by: Dell EMC Isilon Modified: head/sys/amd64/vmm/vmm_host.h head/sys/cam/cam_compat.h head/sys/cam/cam_iosched.h head/sys/netinet/cc/cc.h head/sys/sys/buf_ring.h head/sys/sys/bus.h head/sys/sys/busdma_bufalloc.h head/sys/sys/devmap.h head/sys/sys/eventvar.h head/sys/sys/gtaskqueue.h head/sys/sys/ksem.h head/sys/sys/pipe.h head/sys/sys/sockopt.h head/sys/sys/taskqueue.h Modified: head/sys/amd64/vmm/vmm_host.h ============================================================================== --- head/sys/amd64/vmm/vmm_host.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/amd64/vmm/vmm_host.h Sun Jan 15 18:00:45 2017 (r312235) @@ -30,7 +30,7 @@ #define _VMM_HOST_H_ #ifndef _KERNEL -#error "no user-servicable parts inside" +#error "no user-serviceable parts inside" #endif struct xsave_limits { Modified: head/sys/cam/cam_compat.h ============================================================================== --- head/sys/cam/cam_compat.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/cam/cam_compat.h Sun Jan 15 18:00:45 2017 (r312235) @@ -31,7 +31,7 @@ #ifndef _CAM_CAM_COMPAT_H #define _CAM_CAM_COMPAT_H -/* No user-servicable parts in here. */ +/* No user-serviceable parts in here. */ #ifdef _KERNEL int cam_compat_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, Modified: head/sys/cam/cam_iosched.h ============================================================================== --- head/sys/cam/cam_iosched.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/cam/cam_iosched.h Sun Jan 15 18:00:45 2017 (r312235) @@ -31,7 +31,7 @@ #ifndef _CAM_CAM_IOSCHED_H #define _CAM_CAM_IOSCHED_H -/* No user-servicable parts in here. */ +/* No user-serviceable parts in here. */ #ifdef _KERNEL /* Forward declare all structs to keep interface thin */ Modified: head/sys/netinet/cc/cc.h ============================================================================== --- head/sys/netinet/cc/cc.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/netinet/cc/cc.h Sun Jan 15 18:00:45 2017 (r312235) @@ -52,7 +52,7 @@ #define _NETINET_CC_CC_H_ #if !defined(_KERNEL) -#error "no user-servicable parts inside" +#error "no user-serviceable parts inside" #endif /* Global CC vars. */ Modified: head/sys/sys/buf_ring.h ============================================================================== --- head/sys/sys/buf_ring.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/sys/buf_ring.h Sun Jan 15 18:00:45 2017 (r312235) @@ -250,16 +250,16 @@ buf_ring_advance_sc(struct buf_ring *br) /* * Used to return a buffer (most likely already there) - * to the top od the ring. The caller should *not* + * to the top of the ring. The caller should *not* * have used any dequeue to pull it out of the ring * but instead should have used the peek() function. * This is normally used where the transmit queue - * of a driver is full, and an mubf must be returned. + * of a driver is full, and an mbuf must be returned. * Most likely whats in the ring-buffer is what * is being put back (since it was not removed), but * sometimes the lower transmit function may have * done a pullup or other function that will have - * changed it. As an optimzation we always put it + * changed it. As an optimization we always put it * back (since jhb says the store is probably cheaper), * if we have to do a multi-queue version we will need * the compare and an atomic. Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/sys/bus.h Sun Jan 15 18:00:45 2017 (r312235) @@ -662,7 +662,7 @@ void bus_data_generation_update(void); * Some convenience defines for probe routines to return. These are just * suggested values, and there's nothing magical about them. * BUS_PROBE_SPECIFIC is for devices that cannot be reprobed, and that no - * possible other driver may exist (typically legacy drivers who don't fallow + * possible other driver may exist (typically legacy drivers who don't follow * all the rules, or special needs drivers). BUS_PROBE_VENDOR is the * suggested value that vendor supplied drivers use. This is for source or * binary drivers that are not yet integrated into the FreeBSD tree. Its use @@ -675,7 +675,7 @@ void bus_data_generation_update(void); * supports the newer ones would return BUS_PROBE_DEFAULT. BUS_PROBE_GENERIC * is for drivers that wish to have a generic form and a specialized form, * like is done with the pci bus and the acpi pci bus. BUS_PROBE_HOOVER is - * for those buses that implement a generic device place-holder for devices on + * for those buses that implement a generic device placeholder for devices on * the bus that have no more specific driver for them (aka ugen). * BUS_PROBE_NOWILDCARD or lower means that the device isn't really bidding * for a device node, but accepts only devices that its parent has told it Modified: head/sys/sys/busdma_bufalloc.h ============================================================================== --- head/sys/sys/busdma_bufalloc.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/sys/busdma_bufalloc.h Sun Jan 15 18:00:45 2017 (r312235) @@ -71,7 +71,7 @@ typedef struct busdma_bufalloc *busdma_b * name appears in zone stats as 'dma name nnnnn' where 'dma' is fixed and * 'nnnnn' is the size of buffers in that zone. * - * If if the alloc/free function pointers are NULL, the regular uma internal + * If the alloc/free function pointers are NULL, the regular uma internal * allocators are used (I.E., you get "plain old kernel memory"). On a platform * with an exclusion zone that applies to all DMA operations, a custom allocator * could be used to ensure no buffer memory is ever allocated from that zone, @@ -116,4 +116,3 @@ void busdma_bufalloc_free_uncacheable(v uint8_t pflag); #endif /* _MACHINE_BUSDMA_BUFALLOC_H_ */ - Modified: head/sys/sys/devmap.h ============================================================================== --- head/sys/sys/devmap.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/sys/devmap.h Sun Jan 15 18:00:45 2017 (r312235) @@ -30,7 +30,7 @@ #define _SYS_DEVMAP_H_ #ifndef _KERNEL -#error "no user-servicable parts inside" +#error "no user-serviceable parts inside" #endif /* Modified: head/sys/sys/eventvar.h ============================================================================== --- head/sys/sys/eventvar.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/sys/eventvar.h Sun Jan 15 18:00:45 2017 (r312235) @@ -30,7 +30,7 @@ #define _SYS_EVENTVAR_H_ #ifndef _KERNEL -#error "no user-servicable parts inside" +#error "no user-serviceable parts inside" #endif #include Modified: head/sys/sys/gtaskqueue.h ============================================================================== --- head/sys/sys/gtaskqueue.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/sys/gtaskqueue.h Sun Jan 15 18:00:45 2017 (r312235) @@ -32,7 +32,7 @@ #include #ifndef _KERNEL -#error "no user-servicable parts inside" +#error "no user-serviceable parts inside" #endif struct gtaskqueue; Modified: head/sys/sys/ksem.h ============================================================================== --- head/sys/sys/ksem.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/sys/ksem.h Sun Jan 15 18:00:45 2017 (r312235) @@ -30,7 +30,7 @@ #define _POSIX4_KSEM_H_ #if !defined(_KERNEL) && !defined(_WANT_FILE) -#error "no user-servicable parts inside" +#error "no user-serviceable parts inside" #endif #include Modified: head/sys/sys/pipe.h ============================================================================== --- head/sys/sys/pipe.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/sys/pipe.h Sun Jan 15 18:00:45 2017 (r312235) @@ -25,7 +25,7 @@ #define _SYS_PIPE_H_ #ifndef _KERNEL -#error "no user-servicable parts inside" +#error "no user-serviceable parts inside" #endif /* Modified: head/sys/sys/sockopt.h ============================================================================== --- head/sys/sys/sockopt.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/sys/sockopt.h Sun Jan 15 18:00:45 2017 (r312235) @@ -34,7 +34,7 @@ #define _SYS_SOCKOPT_H_ #ifndef _KERNEL -#error "no user-servicable parts inside" +#error "no user-serviceable parts inside" #endif Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Sun Jan 15 17:54:01 2017 (r312234) +++ head/sys/sys/taskqueue.h Sun Jan 15 18:00:45 2017 (r312235) @@ -30,7 +30,7 @@ #define _SYS_TASKQUEUE_H_ #ifndef _KERNEL -#error "no user-servicable parts inside" +#error "no user-serviceable parts inside" #endif #include From owner-svn-src-all@freebsd.org Sun Jan 15 18:46:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED8B9CB1BAB; Sun, 15 Jan 2017 18:46:38 +0000 (UTC) (envelope-from adrian.chadd@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 7FA121F0A; Sun, 15 Jan 2017 18:46:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id d140so9191782wmd.2; Sun, 15 Jan 2017 10:46:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=26GazU3sJrMgoje46wSmt04HR2n8DIw4MTlAI9qOGHY=; b=oKnUUQshwhAeeoNa3CF+yPrsG4Clt+H+PXpFCJXydXUY8ZclIyvuyO/C7vJvkVD8Ue R2ZbVtiHyOXhE6F/fMqovYpNu0fVkqVSppTk4PcbwUMMVO99a7Hv9sdUhdGxOBOvQNp+ z4j3zQtqm+Xl+cuf87KqzDfc5a7vmXYMdsGeoSUB6dRzmmgjT0JTplgKv/vk+nN0NLHh yHG9oSjPKfADS7d36ZtGEGPqIi7SQoNv1I8D6f3hDTExIgplYkqK3aHQ3va/vhpQVRQK CoQTKMMuqHSt3bHhc+yCRKU+7ZOwWvftUfCW+EEKRPYxMjZnWM2P4rbebguyVcecVlCM PpKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=26GazU3sJrMgoje46wSmt04HR2n8DIw4MTlAI9qOGHY=; b=iS2oq2iVak7OtfTxPEhvD5dnDwKwQWaJc7Pg2JyaUxBryVdjNNsnQbxPDMQsVfgVWQ OoYt3slWOJfVhF7FSrJEgn1+pYZ/nbkPqcO8Y0Uof1cWzPrI3dTdWrFLXwGcK3IIwwTQ OdDLNAyEvEO0ukQ8BWGMGPXiXAtUo2gwF2Qffzmu+qdOnWpLaVqZszZrql/wnTfUqfpj Ca+Tvzcg4QQf441NxLd9lVLAecFeQGBq3CQqde2ojbPDeo8H+XBhDWlvDolGfeK0xRft 1Pr2QwXd0iF4GkeVZ2fUBwomW8aNHg/L6xzjpVfV3Si/KoJmhc/dxomU97SkuSLIRp74 1JmQ== X-Gm-Message-State: AIkVDXL+SlDvasu9XW2nvEHgeOUumzOHjStpG8nsDxAIb9oAIJyVzGhfNXfdjtbfu/TentVYWtE7E+w/Ga5RJA== X-Received: by 10.223.173.181 with SMTP id w50mr19541870wrc.177.1484505996905; Sun, 15 Jan 2017 10:46:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.82.162 with HTTP; Sun, 15 Jan 2017 10:46:35 -0800 (PST) In-Reply-To: <20170115144531.GB58505@zxy.spb.ru> References: <201701120022.v0C0MaHq053076@repo.freebsd.org> <20170113131948.P1465@besplex.bde.org> <20170114220629.GB18065@raichu> <1755552c-a5e2-848a-38e2-3bacfbecfb23@elischer.org> <20170115144531.GB58505@zxy.spb.ru> From: Adrian Chadd Date: Sun, 15 Jan 2017 10:46:35 -0800 Message-ID: Subject: Re: svn commit: r311952 - head/sys/ddb To: Slawa Olhovchenkov Cc: Julian Elischer , Mark Johnston , Bruce Evans , "svn-src-head@freebsd.org" , rang@acm.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: Sun, 15 Jan 2017 18:46:39 -0000 url? :) -a On 15 January 2017 at 06:45, Slawa Olhovchenkov wrote: > On Sun, Jan 15, 2017 at 01:07:58PM +0800, Julian Elischer wrote: > >> >> the old DEC machines had (from memory) ^O which dropped all pending >> output. >> Not so useful when there is 2MB of network buffers queued up to you, >> but very useful on >> and asr-33 teletype. > > Now it useful too, on serial console. > ^O processing be present years ago in FreeBSD, but removed at time of > tty code rewrite. As I know patch for restore exist, nobody > review/commit. > > From owner-svn-src-all@freebsd.org Sun Jan 15 19:49:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9C14CB1BE1; Sun, 15 Jan 2017 19:49:48 +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 9F92A19B0; Sun, 15 Jan 2017 19:49:48 +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 v0FJnl8e027171; Sun, 15 Jan 2017 19:49:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FJnl2h027169; Sun, 15 Jan 2017 19:49:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701151949.v0FJnl2h027169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 15 Jan 2017 19:49:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312236 - 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: Sun, 15 Jan 2017 19:49:49 -0000 Author: adrian Date: Sun Jan 15 19:49:47 2017 New Revision: 312236 URL: https://svnweb.freebsd.org/changeset/base/312236 Log: [net80211] add some more "is this XXX" macros for CTRL and DATA. There's already a macro for MGT. Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Sun Jan 15 18:00:45 2017 (r312235) +++ head/sys/net80211/ieee80211.h Sun Jan 15 19:49:47 2017 (r312236) @@ -165,6 +165,12 @@ struct ieee80211_qosframe_addr4 { #define IEEE80211_IS_MGMT(wh) \ (!! (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) \ == IEEE80211_FC0_TYPE_MGT)) +#define IEEE80211_IS_CTL(wh) \ + (!! (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) \ + == IEEE80211_FC0_TYPE_CTL)) +#define IEEE80211_IS_DATA(wh) \ + (!! (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) \ + == IEEE80211_FC0_TYPE_DATA)) #define IEEE80211_FC0_QOSDATA \ (IEEE80211_FC0_TYPE_DATA|IEEE80211_FC0_SUBTYPE_QOS|IEEE80211_FC0_VERSION_0) From owner-svn-src-all@freebsd.org Sun Jan 15 19:57:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A37B9CB1DAA for ; Sun, 15 Jan 2017 19:57:04 +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 3202C1E13 for ; Sun, 15 Jan 2017 19:57:03 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: c8b03494-db5c-11e6-9357-bffcd86bd944 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 c8b03494-db5c-11e6-9357-bffcd86bd944; Sun, 15 Jan 2017 19:57:04 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v0FJusio012884; Sun, 15 Jan 2017 12:56:54 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1484510213.86335.110.camel@freebsd.org> Subject: Re: svn commit: r312236 - head/sys/net80211 From: Ian Lepore To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 15 Jan 2017 12:56:53 -0700 In-Reply-To: <201701151949.v0FJnl2h027169@repo.freebsd.org> References: <201701151949.v0FJnl2h027169@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: Sun, 15 Jan 2017 19:57:04 -0000 On Sun, 2017-01-15 at 19:49 +0000, Adrian Chadd wrote: > Author: adrian > Date: Sun Jan 15 19:49:47 2017 > New Revision: 312236 > URL: https://svnweb.freebsd.org/changeset/base/312236 > > Log: >   [net80211] add some more "is this XXX" macros for CTRL and DATA. >    >   There's already a macro for MGT. > > Modified: >   head/sys/net80211/ieee80211.h > > Modified: head/sys/net80211/ieee80211.h > ===================================================================== > ========= > --- head/sys/net80211/ieee80211.h Sun Jan 15 18:00:45 2017 > (r312235) > +++ head/sys/net80211/ieee80211.h Sun Jan 15 19:49:47 2017 > (r312236) > @@ -165,6 +165,12 @@ struct ieee80211_qosframe_addr4 { >  #define IEEE80211_IS_MGMT(wh) > \ >   (!! (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) > \ >       == IEEE80211_FC0_TYPE_MGT)) > +#define IEEE80211_IS_CTL(wh) > \ > + (!! (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) > \ > +     == IEEE80211_FC0_TYPE_CTL)) > +#define IEEE80211_IS_DATA(wh) > \ > + (!! (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) > \ > +     == IEEE80211_FC0_TYPE_DATA)) >   >  #define IEEE80211_FC0_QOSDATA \ >   (IEEE80211_FC0_TYPE_DATA|IEEE80211_FC0_SUBTYPE_QOS|IEEE80211 > _FC0_VERSION_0) > What is the point of the !! in these macros?  The expressions already have boolean type (even in C++ where it matters) due to the ==.  Removing the !! would also make one level of parens redundant. -- Ian From owner-svn-src-all@freebsd.org Sun Jan 15 20:03:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75373CB1F8B; Sun, 15 Jan 2017 20:03:14 +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 46E33124D; Sun, 15 Jan 2017 20:03:14 +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 v0FK3D8Q035143; Sun, 15 Jan 2017 20:03:13 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FK3Dxh035142; Sun, 15 Jan 2017 20:03:13 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201701152003.v0FK3Dxh035142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 15 Jan 2017 20:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312237 - head/sys/boot/efi/loader 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, 15 Jan 2017 20:03:14 -0000 Author: tsoome Date: Sun Jan 15 20:03:13 2017 New Revision: 312237 URL: https://svnweb.freebsd.org/changeset/base/312237 Log: loader.efi: find_currdev() can leak memory The find_currdev() is using variable "copy" to store the reference to trimmed devpath pointer, if for some reason the efi_devpath_handle() fails, we will leak this copy. Also we can simplify the code there a bit. Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D9191 Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Sun Jan 15 19:49:47 2017 (r312236) +++ head/sys/boot/efi/loader/main.c Sun Jan 15 20:03:13 2017 (r312237) @@ -219,20 +219,19 @@ find_currdev(EFI_LOADED_IMAGE *img, stru if (h == NULL) break; - if (efi_handle_lookup(h, dev, unit, extra) == 0) { - if (copy != NULL) - free(copy); + free(copy); + copy = NULL; + + if (efi_handle_lookup(h, dev, unit, extra) == 0) return (0); - } - if (copy != NULL) - free(copy); devpath = efi_lookup_devpath(h); if (devpath != NULL) { copy = efi_devpath_trim(devpath); devpath = copy; } } + free(copy); /* Try to fallback on first device */ if (devsw[0] != NULL) { From owner-svn-src-all@freebsd.org Sun Jan 15 20:18:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7CCECB11ED; Sun, 15 Jan 2017 20:18:02 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B2BA17D4; Sun, 15 Jan 2017 20:18:02 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cSrFW-000Lec-JR; Sun, 15 Jan 2017 23:17:58 +0300 Date: Sun, 15 Jan 2017 23:17:58 +0300 From: Slawa Olhovchenkov To: Adrian Chadd Cc: Julian Elischer , Mark Johnston , Bruce Evans , "svn-src-head@freebsd.org" , rang@acm.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r311952 - head/sys/ddb Message-ID: <20170115201758.GA78888@zxy.spb.ru> References: <201701120022.v0C0MaHq053076@repo.freebsd.org> <20170113131948.P1465@besplex.bde.org> <20170114220629.GB18065@raichu> <1755552c-a5e2-848a-38e2-3bacfbecfb23@elischer.org> <20170115144531.GB58505@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 15 Jan 2017 20:18:03 -0000 On Sun, Jan 15, 2017 at 10:46:35AM -0800, Adrian Chadd wrote: > url? :) https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=184987 Assignee: Adrian Chadd > On 15 January 2017 at 06:45, Slawa Olhovchenkov wrote: > > On Sun, Jan 15, 2017 at 01:07:58PM +0800, Julian Elischer wrote: > > > >> > >> the old DEC machines had (from memory) ^O which dropped all pending > >> output. > >> Not so useful when there is 2MB of network buffers queued up to you, > >> but very useful on > >> and asr-33 teletype. > > > > Now it useful too, on serial console. > > ^O processing be present years ago in FreeBSD, but removed at time of > > tty code rewrite. As I know patch for restore exist, nobody > > review/commit. > > > > From owner-svn-src-all@freebsd.org Sun Jan 15 20:40:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BC55CB1C36; Sun, 15 Jan 2017 20:40:51 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 000F616FE; Sun, 15 Jan 2017 20:40:50 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id r126so134744006wmr.0; Sun, 15 Jan 2017 12:40:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CxAjPAY7cjwG1VejzWzdMmpEYxB/LviQyv/SqYAhTaY=; b=vJCvBrIUXm3S86PgvJ1MuD2/2dFopxidhQ5Hyp8+Ut2XyCF57mjsE2z0IajDElM6LS VfhZZJ0BrogQu+sgWRGpL1CsZpPCxaIUI7Bkevz9YzPxbsNweu+II1ifuDB4Jd4jEVby 3vGjeoLXi9ctQMxHF5HKOJSXc7bn/aRf6LMWPxzAj7pyNI3wwUAnuvcHr6pKi4tZlYQK bKK3OPFYq0WQ2/2Gv5CcFrzB/ybRnIqNHwfEHwq5umCggj37EH71s92QOwMvo9z4hoXG fit46zPt/lZ59QNCZ9+CDFYa/W2DFEvHrA2oSkLYaYzrt2/2p8XhxEov4d31L26Mg2KT 1AMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CxAjPAY7cjwG1VejzWzdMmpEYxB/LviQyv/SqYAhTaY=; b=H/Tp0oFU9uDCL+iFs00Exzj24r5z818fpfdJ2Y5sMCqJY8j6Q7yqkXX4kQzYjhagIC tuA7etXjg92jFERgayMFWdkUXKVLoVQ6gfnEdMMHqgLBbFkc/iq7w7Mn1POxEY96p0Fr 1rb+pHjW7cAOXLFzMjB/LfFwpDeNae3tplPd71XTJL4rSjFatkEmtSJ6w1EtJNi3PPQT vxLYbV1AGTKcmsvS47ZfV+VbifyxoNznhZklY6g9/HLa4GsiXxQsm5hNBRpFXMM3MrfM SuIxwp0o4XzkaTrmgtaiE2sNPTCKfJf00f7wqLwQmBXWQq7hELPqDrF+nhU9ZYGlixTx kvwA== X-Gm-Message-State: AIkVDXKrUrQhob73OjOKuoa9F+szbu94fApH1BshjoAGLC8vqyQNYFOSX8Yra1s26I+RlQmgKlRj5kUbxC3ThQ== X-Received: by 10.223.151.205 with SMTP id t13mr20328613wrb.9.1484512849584; Sun, 15 Jan 2017 12:40:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.82.162 with HTTP; Sun, 15 Jan 2017 12:40:48 -0800 (PST) In-Reply-To: <20170115201758.GA78888@zxy.spb.ru> References: <201701120022.v0C0MaHq053076@repo.freebsd.org> <20170113131948.P1465@besplex.bde.org> <20170114220629.GB18065@raichu> <1755552c-a5e2-848a-38e2-3bacfbecfb23@elischer.org> <20170115144531.GB58505@zxy.spb.ru> <20170115201758.GA78888@zxy.spb.ru> From: Adrian Chadd Date: Sun, 15 Jan 2017 12:40:48 -0800 Message-ID: Subject: Re: svn commit: r311952 - head/sys/ddb To: Slawa Olhovchenkov Cc: Julian Elischer , Mark Johnston , Bruce Evans , "svn-src-head@freebsd.org" , rang@acm.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: Sun, 15 Jan 2017 20:40:51 -0000 hah, i took this, then life got in the way. :) Bruce - what do you think of https://bz-attachments.freebsd.org/attachment.cgi?id=138881 ? -adrian From owner-svn-src-all@freebsd.org Sun Jan 15 20:43:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 656ECCB1E75; Sun, 15 Jan 2017 20:43:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (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 F047A1B43; Sun, 15 Jan 2017 20:43:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id c85so134238751wmi.1; Sun, 15 Jan 2017 12:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ChvI3ZiTHmrIPgWa/OnABRyTeaVccmmK7bLU4x8RBEE=; b=ju3XFoqi0PYRo5p91ax47ApvuzrqEp6dbknBTGGj3CW7RJWHA4YOHran9Z/TlUI0LX lA4Qu/IPMvtkChiirXpYN5WGu842Aa07fHa+BNqZVQn2WVlanAOUZuTbGoO2l6RRKLT4 taTIPJKEDMCShnO7qkLYbsFaerN1zt8plHchsdAZjOW1vD8FATMAs7XaM0ZaqtpOQQjH oilnyz59QHK9oN6scQB0erN9o5p7avMlfwmWasyYC1xNJzen0tVYu/L5tZQP3Ihvp02w zJ+XtZGPBrIXGQtzKG6iZIwBATQB4DCViUZBjUA2zyXQ4B70/bpIabL2IWsuaYr3uo1j zQ/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ChvI3ZiTHmrIPgWa/OnABRyTeaVccmmK7bLU4x8RBEE=; b=TySFTpI27fJzw+hr94+86nSzflYCszhdhn5T3DYePldg5KPA0BkEPi86Zr7sS8UHsa Cuv8/zWDeAT0RV/5wvldpPhef7RTyqoA61YZMCf9RA+KefF3hqVK3iihKSyJBNvQ27XI WJoNnthfUQt19d7t8sfWNJx3JnK9Ca+3Gk85Hjc+BKK+atRzQu5tRp3pqezcnXaG61pN 6MstutKpEbIov2a825/Qd3+zSViWcqnthjJ21qE0h/bf353yy/o+vGJqkCQWjBe89hTY rqqmAnb2qNt35/qIabXZ/IdeWyb7WDOWnwLNfK2N8l+0Zo52+gQ3bedQ2a8qmHY+dycy gN9g== X-Gm-Message-State: AIkVDXLHqTl8+zW4Q2uhG2GOMwPnmB8qOtBoOn9Gw6Y1S0JbBVHNzUPtepDP+o0KZDIaRj0gJ/2rJ7sxjhMycQ== X-Received: by 10.223.173.181 with SMTP id w50mr19768638wrc.177.1484512988460; Sun, 15 Jan 2017 12:43:08 -0800 (PST) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.194.82.162 with HTTP; Sun, 15 Jan 2017 12:43:07 -0800 (PST) In-Reply-To: <1484510213.86335.110.camel@freebsd.org> References: <201701151949.v0FJnl2h027169@repo.freebsd.org> <1484510213.86335.110.camel@freebsd.org> From: Adrian Chadd Date: Sun, 15 Jan 2017 12:43:07 -0800 X-Google-Sender-Auth: qbPgVMH4SM83S58-i7VNG5f-1ew Message-ID: Subject: Re: svn commit: r312236 - head/sys/net80211 To: Ian Lepore 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: Sun, 15 Jan 2017 20:43:11 -0000 On 15 January 2017 at 11:56, Ian Lepore wrote: > > What is the point of the !! in these macros? The expressions already > have boolean type (even in C++ where it matters) due to the ==. > Removing the !! would also make one level of parens redundant. It's just a habit i picked up from linux-land. That way it really is only 1 or 0, so things like debugging output and such make easier sense. It's also fixed a handful of bugs in the past (but I can't think of exact cases right now) - primarily where other code expected 1 or 0 (for things like shifts into protocol fields) and the macro returns 0 or ${LARGEVAL}. -adrian From owner-svn-src-all@freebsd.org Sun Jan 15 21:14:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4F19CB1A2D; Sun, 15 Jan 2017 21:14:02 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot0-x244.google.com (mail-ot0-x244.google.com [IPv6:2607:f8b0:4003:c0f::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 685741E69; Sun, 15 Jan 2017 21:14:02 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot0-x244.google.com with SMTP id 73so4957615otj.1; Sun, 15 Jan 2017 13:14:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DxBzT9WWl817vtYI1PR9lHedLQkm+UOza/rPMEs3yOU=; b=PSZ/TG5Kg0dJF7AVi7w/6bdnv6/sfQr/EjJqNZftlcxrqdN3Kk3/tstAHwZlBUqLe1 9CwEILiygy4je99vS+JAkeApscjOgJHufPVzsvZaLA34FuQojeAOj5mC2SFw0okvMORg 3Qm5NriM0rXMlISeqMJ0whpxTXgjums5w3bujGN89iAk090Lddr7OCfw5KkYoqdPhlQw /tWGmOWEKO/OAldfgb4jmefezqHeO6diBOphv2S5dq1cs/RXzE73e1ExAVjmoO1AxO6F AkUaKt5OcQhmwhSNE1zVlmhB2+hzOhwWHOJvYXckvlfeXjtuiq9d0HYqktRBxfjnbTJf PHsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DxBzT9WWl817vtYI1PR9lHedLQkm+UOza/rPMEs3yOU=; b=tRF4DICiX4MkGLa/FGRhMpAQNyuindCXcWrieMJOmCNXq+tfkJwWWvwAkYAdl0XxGY Hd1uLRaqp60RxkhF8Y9C+QDTe9OzZdV7ngO6KCihsakJNKJ0UotHkukRnIm055wxeT14 6qeBYwMI+ZOGbmIGeSIjHM0B/fZt7R3eqpEpMcLFEI5sJ/YpVzz6bb3d2V6QdQPkYmFM KI92cK104ioekvEJoa1VmE/n8cc8vEWdgHxUs0bdc4+N92Duj35mjdUG7DuE8tnYswqd i5iSzLKm9fP4P7vzZnMj75aSAxtQ32Fj0sQF9XnFZcjZtFxwQJtswUo8GrgHU8y01P0u pQlw== X-Gm-Message-State: AIkVDXLsueVpCSwUV4mvftmHSWG2GoKbYB2WO+ipaU8e0ZQ1eIIB2zstkaf/Do+KECzF+j2r3PcGFqhFa1Pc1w== X-Received: by 10.157.43.198 with SMTP id u64mr14028627ota.80.1484514841592; Sun, 15 Jan 2017 13:14:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.52.9 with HTTP; Sun, 15 Jan 2017 13:14:01 -0800 (PST) In-Reply-To: <201701151754.v0FHs14W081882@repo.freebsd.org> References: <201701151754.v0FHs14W081882@repo.freebsd.org> From: Benjamin Kaduk Date: Sun, 15 Jan 2017 15:14:01 -0600 Message-ID: Subject: Re: svn commit: r312234 - in head: sbin/camcontrol share/man/man4 share/man/man9 sys/arm/arm sys/arm/freescale/imx sys/arm/mv sys/cam sys/dev/bhnd sys/dev/fdt sys/dev/isp sys/dev/mmc sys/dev/mpt sys/de... To: "Conrad E. Meyer" 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: Sun, 15 Jan 2017 21:14:02 -0000 On Sun, Jan 15, 2017 at 11:54 AM, Conrad E. Meyer wrote: > Author: cem > Date: Sun Jan 15 17:54:01 2017 > New Revision: 312234 > URL: https://svnweb.freebsd.org/changeset/base/312234 > > Log: > "Buses" is the preferred plural of "bus" > > Replace archaic "busses" with modern form "buses." > > The link intending to support this assertion refers to the motor vehicle, which does not necessarily have the same usage as the hardware nexus. It would have been nice to see some discussion on -doc or similar before making a sweeping change like this, as I am not sure that the consensus of our team is for the "buses" spelling in this usage. -Ben > Intentionally excluded: > * Old/random drivers I didn't recognize > * Old hardware in general > * Use of "busses" in code as identifiers > > No functional change. > > http://grammarist.com/spelling/buses-busses/ > > PR: 216099 > Reported by: bltsrc at mail.ru > Sponsored by: Dell EMC Isilon > > From owner-svn-src-all@freebsd.org Sun Jan 15 22:10:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFC05CB1C49; Sun, 15 Jan 2017 22:10:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C79DB1583; Sun, 15 Jan 2017 22:10:33 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FMAWom084567; Sun, 15 Jan 2017 22:10:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FMAWad084564; Sun, 15 Jan 2017 22:10:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701152210.v0FMAWad084564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 15 Jan 2017 22:10: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: r312244 - stable/11/sys/dev/sdhci 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, 15 Jan 2017 22:10:34 -0000 Author: ian Date: Sun Jan 15 22:10:32 2017 New Revision: 312244 URL: https://svnweb.freebsd.org/changeset/base/312244 Log: MFC r308187, r311660, r311693, r311727, r311797: Toggle card insert/remove interrupt enable bits on events. Add a new sdhci interface method, get_card_present(). Now that the PRESENT_STATE register is only used for the inhibit bits loop in this function, sdhci_start_command(), eliminate the state variable and restructure the loop to read the register just once at the top of the loop. Add support for non-removable media, and a quirk to use polling to detect card insert/remove events on controllers that don't implement the insert and remove interrupts. Add sdhci_handle_card_present_locked() that can be called from the interrupt handler which already holds the mutex, and have sdhci_handle_card_present() be just a tiny wrapper that does the locking for external callers. Modified: stable/11/sys/dev/sdhci/sdhci.c stable/11/sys/dev/sdhci/sdhci.h stable/11/sys/dev/sdhci/sdhci_if.m Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.c Sun Jan 15 22:00:59 2017 (r312243) +++ stable/11/sys/dev/sdhci/sdhci.c Sun Jan 15 22:10:32 2017 (r312244) @@ -73,6 +73,7 @@ static void sdhci_set_clock(struct sdhci static void sdhci_start(struct sdhci_slot *slot); static void sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data); +static void sdhci_card_poll(void *); static void sdhci_card_task(void *, int); /* helper routines */ @@ -89,6 +90,9 @@ static void sdhci_card_task(void *, int) #define SDHCI_200_MAX_DIVIDER 256 #define SDHCI_300_MAX_DIVIDER 2046 +#define SDHCI_CARD_PRESENT_TICKS (hz / 5) +#define SDHCI_INSERT_DELAY_TICKS (hz / 2) + /* * Broadcom BCM577xx Controller Constants */ @@ -164,8 +168,7 @@ sdhci_reset(struct sdhci_slot *slot, uin int timeout; if (slot->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { - if (!(RD4(slot, SDHCI_PRESENT_STATE) & - SDHCI_CARD_PRESENT)) + if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot)) return; } @@ -230,10 +233,15 @@ sdhci_init(struct sdhci_slot *slot) slot->intmask = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT | SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX | SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT | - SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT | SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DMA_END | SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE | SDHCI_INT_ACMD12ERR; + + if (!(slot->quirks & SDHCI_QUIRK_POLL_CARD_PRESENT) && + !(slot->opt & SDHCI_NON_REMOVABLE)) { + slot->intmask |= SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT; + } + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -475,23 +483,17 @@ sdhci_transfer_pio(struct sdhci_slot *sl } } -static void -sdhci_card_delay(void *arg) -{ - struct sdhci_slot *slot = arg; - - taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task); -} - static void sdhci_card_task(void *arg, int pending) { struct sdhci_slot *slot = arg; SDHCI_LOCK(slot); - if (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT) { + if (SDHCI_GET_CARD_PRESENT(slot->bus, slot)) { if (slot->dev == NULL) { /* If card is present - attach mmc bus. */ + if (bootverbose || sdhci_debug) + slot_printf(slot, "Card inserted\n"); slot->dev = device_add_child(slot->bus, "mmc", -1); device_set_ivars(slot->dev, slot); SDHCI_UNLOCK(slot); @@ -501,6 +503,8 @@ sdhci_card_task(void *arg, int pending) } else { if (slot->dev != NULL) { /* If no card present - detach mmc bus. */ + if (bootverbose || sdhci_debug) + slot_printf(slot, "Card removed\n"); device_t d = slot->dev; slot->dev = NULL; SDHCI_UNLOCK(slot); @@ -510,6 +514,51 @@ sdhci_card_task(void *arg, int pending) } } +static void +sdhci_handle_card_present_locked(struct sdhci_slot *slot, bool is_present) +{ + bool was_present; + + /* + * If there was no card and now there is one, schedule the task to + * create the child device after a short delay. The delay is to + * debounce the card insert (sometimes the card detect pin stabilizes + * before the other pins have made good contact). + * + * If there was a card present and now it's gone, immediately schedule + * the task to delete the child device. No debouncing -- gone is gone, + * because once power is removed, a full card re-init is needed, and + * that happens by deleting and recreating the child device. + */ + was_present = slot->dev != NULL; + if (!was_present && is_present) { + taskqueue_enqueue_timeout(taskqueue_swi_giant, + &slot->card_delayed_task, -SDHCI_INSERT_DELAY_TICKS); + } else if (was_present && !is_present) { + taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task); + } +} + +void +sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present) +{ + + SDHCI_LOCK(slot); + sdhci_handle_card_present_locked(slot, is_present); + SDHCI_UNLOCK(slot); +} + +static void +sdhci_card_poll(void *arg) +{ + struct sdhci_slot *slot = arg; + + sdhci_handle_card_present(slot, + SDHCI_GET_CARD_PRESENT(slot->bus, slot)); + callout_reset(&slot->card_poll_callout, SDHCI_CARD_PRESENT_TICKS, + sdhci_card_poll, slot); +} + int sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) { @@ -653,9 +702,17 @@ sdhci_init_slot(device_t dev, struct sdh "timeout", CTLFLAG_RW, &slot->timeout, 0, "Maximum timeout for SDHCI transfers (in secs)"); TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot); - callout_init(&slot->card_callout, 1); + TIMEOUT_TASK_INIT(taskqueue_swi_giant, &slot->card_delayed_task, 0, + sdhci_card_task, slot); + callout_init(&slot->card_poll_callout, 1); callout_init_mtx(&slot->timeout_callout, &slot->mtx, 0); + if ((slot->quirks & SDHCI_QUIRK_POLL_CARD_PRESENT) && + !(slot->opt & SDHCI_NON_REMOVABLE)) { + callout_reset(&slot->card_poll_callout, + SDHCI_CARD_PRESENT_TICKS, sdhci_card_poll, slot); + } + return (0); } @@ -671,8 +728,9 @@ sdhci_cleanup_slot(struct sdhci_slot *sl device_t d; callout_drain(&slot->timeout_callout); - callout_drain(&slot->card_callout); + callout_drain(&slot->card_poll_callout); taskqueue_drain(taskqueue_swi_giant, &slot->card_task); + taskqueue_drain_timeout(taskqueue_swi_giant, &slot->card_delayed_task); SDHCI_LOCK(slot); d = slot->dev; @@ -718,6 +776,16 @@ sdhci_generic_min_freq(device_t brdev, s return (slot->max_clk / SDHCI_200_MAX_DIVIDER); } +bool +sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot) +{ + + if (slot->opt & SDHCI_NON_REMOVABLE) + return true; + + return (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT); +} + int sdhci_generic_update_ios(device_t brdev, device_t reqdev) { @@ -815,7 +883,7 @@ static void sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) { int flags, timeout; - uint32_t mask, state; + uint32_t mask; slot->curcmd = cmd; slot->cmd_done = 0; @@ -830,11 +898,9 @@ sdhci_start_command(struct sdhci_slot *s return; } - /* Read controller present state. */ - state = RD4(slot, SDHCI_PRESENT_STATE); /* Do not issue command if there is no card, clock or power. * Controller will not detect timeout without clock active. */ - if ((state & SDHCI_CARD_PRESENT) == 0 || + if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot) || slot->power == 0 || slot->clock == 0) { cmd->error = MMC_ERR_FAILED; @@ -860,7 +926,7 @@ sdhci_start_command(struct sdhci_slot *s * (It's usually more like 20-30ms in the real world.) */ timeout = 250; - while (state & mask) { + while (mask & RD4(slot, SDHCI_PRESENT_STATE)) { if (timeout == 0) { slot_printf(slot, "Controller never released " "inhibit bit(s).\n"); @@ -871,7 +937,6 @@ sdhci_start_command(struct sdhci_slot *s } timeout--; DELAY(1000); - state = RD4(slot, SDHCI_PRESENT_STATE); } /* Prepare command flags. */ @@ -1309,7 +1374,7 @@ sdhci_acmd_irq(struct sdhci_slot *slot) void sdhci_generic_intr(struct sdhci_slot *slot) { - uint32_t intmask; + uint32_t intmask, present; SDHCI_LOCK(slot); /* Read slot interrupt status. */ @@ -1323,22 +1388,16 @@ sdhci_generic_intr(struct sdhci_slot *sl /* Handle card presence interrupts. */ if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) { + present = (intmask & SDHCI_INT_CARD_INSERT) != 0; + slot->intmask &= + ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); + slot->intmask |= present ? SDHCI_INT_CARD_REMOVE : + SDHCI_INT_CARD_INSERT; + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); + WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); WR4(slot, SDHCI_INT_STATUS, intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)); - - if (intmask & SDHCI_INT_CARD_REMOVE) { - if (bootverbose || sdhci_debug) - slot_printf(slot, "Card removed\n"); - callout_stop(&slot->card_callout); - taskqueue_enqueue(taskqueue_swi_giant, - &slot->card_task); - } - if (intmask & SDHCI_INT_CARD_INSERT) { - if (bootverbose || sdhci_debug) - slot_printf(slot, "Card inserted\n"); - callout_reset(&slot->card_callout, hz / 2, - sdhci_card_delay, slot); - } + sdhci_handle_card_present_locked(slot, present); intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); } /* Handle command interrupts. */ Modified: stable/11/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.h Sun Jan 15 22:00:59 2017 (r312243) +++ stable/11/sys/dev/sdhci/sdhci.h Sun Jan 15 22:10:32 2017 (r312244) @@ -65,6 +65,8 @@ #define SDHCI_QUIRK_DONT_SET_HISPD_BIT (1<<15) /* Alternate clock source is required when supplying a 400 KHz clock. */ #define SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC (1<<16) +/* Card insert/remove interrupts don't work, polling required. */ +#define SDHCI_QUIRK_POLL_CARD_PRESENT (1<<17) /* * Controller registers @@ -273,8 +275,9 @@ struct sdhci_slot { device_t dev; /* Slot device */ u_char num; /* Slot number */ u_char opt; /* Slot options */ -#define SDHCI_HAVE_DMA 1 -#define SDHCI_PLATFORM_TRANSFER 2 +#define SDHCI_HAVE_DMA 0x01 +#define SDHCI_PLATFORM_TRANSFER 0x02 +#define SDHCI_NON_REMOVABLE 0x04 u_char version; int timeout; /* Transfer timeout */ uint32_t max_clk; /* Max possible freq */ @@ -284,7 +287,9 @@ struct sdhci_slot { u_char *dmamem; bus_addr_t paddr; /* DMA buffer address */ struct task card_task; /* Card presence check task */ - struct callout card_callout; /* Card insert delay callout */ + struct timeout_task + card_delayed_task;/* Card insert delayed task */ + struct callout card_poll_callout;/* Card present polling callout */ struct callout timeout_callout;/* Card command/data response timeout */ struct mmc_host host; /* Host parameters */ struct mmc_request *req; /* Current request */ @@ -322,5 +327,7 @@ int sdhci_generic_acquire_host(device_t int sdhci_generic_release_host(device_t brdev, device_t reqdev); void sdhci_generic_intr(struct sdhci_slot *slot); uint32_t sdhci_generic_min_freq(device_t brdev, struct sdhci_slot *slot); +bool sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot); +void sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present); #endif /* __SDHCI_H__ */ Modified: stable/11/sys/dev/sdhci/sdhci_if.m ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_if.m Sun Jan 15 22:00:59 2017 (r312243) +++ stable/11/sys/dev/sdhci/sdhci_if.m Sun Jan 15 22:10:32 2017 (r312244) @@ -152,3 +152,9 @@ METHOD uint32_t min_freq { device_t brdev; struct sdhci_slot *slot; } DEFAULT sdhci_generic_min_freq; + +METHOD bool get_card_present { + device_t brdev; + struct sdhci_slot *slot; +} DEFAULT sdhci_generic_get_card_present; + From owner-svn-src-all@freebsd.org Sun Jan 15 22:31:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E04F7CB1237; Sun, 15 Jan 2017 22:31:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 982AE12C2; Sun, 15 Jan 2017 22:31:00 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0FMUxUH093096; Sun, 15 Jan 2017 22:30:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0FMUxqG093092; Sun, 15 Jan 2017 22:30:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701152230.v0FMUxqG093092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 15 Jan 2017 22:30: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: r312245 - stable/10/sys/dev/sdhci 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, 15 Jan 2017 22:31:01 -0000 Author: ian Date: Sun Jan 15 22:30:59 2017 New Revision: 312245 URL: https://svnweb.freebsd.org/changeset/base/312245 Log: MFC r283263, r289359, r308187, r311660, r311693, r311727, r311797: Raise the SDHCI timeout to 10 seconds and add a sysctl to allow changing this value at runtime. Add support for the BCM57765 card reader. Toggle card insert/remove interrupt enable bits on events. Add a new sdhci interface method, get_card_present(). Now that the PRESENT_STATE register is only used for the inhibit bits loop in this function, sdhci_start_command(), eliminate the state variable and restructure the loop to read the register just once at the top of the loop. Add support for non-removable media, and a quirk to use polling to detect card insert/remove events on controllers that don't implement the insert and remove interrupts. Add sdhci_handle_card_present_locked() that can be called from the interrupt handler which already holds the mutex, and have sdhci_handle_card_present() be just a tiny wrapper that does the locking for external callers. Modified: stable/10/sys/dev/sdhci/sdhci.c stable/10/sys/dev/sdhci/sdhci.h stable/10/sys/dev/sdhci/sdhci_if.m stable/10/sys/dev/sdhci/sdhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.c Sun Jan 15 22:10:32 2017 (r312244) +++ stable/10/sys/dev/sdhci/sdhci.c Sun Jan 15 22:30:59 2017 (r312245) @@ -74,6 +74,7 @@ static void sdhci_set_clock(struct sdhci static void sdhci_start(struct sdhci_slot *slot); static void sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data); +static void sdhci_card_poll(void *); static void sdhci_card_task(void *, int); /* helper routines */ @@ -90,6 +91,22 @@ static void sdhci_card_task(void *, int) #define SDHCI_200_MAX_DIVIDER 256 #define SDHCI_300_MAX_DIVIDER 2046 +#define SDHCI_CARD_PRESENT_TICKS (hz / 5) +#define SDHCI_INSERT_DELAY_TICKS (hz / 2) + +/* + * Broadcom BCM577xx Controller Constants + */ +#define BCM577XX_DEFAULT_MAX_DIVIDER 256 /* Maximum divider supported by the default clock source. */ +#define BCM577XX_ALT_CLOCK_BASE 63000000 /* Alternative clock's base frequency. */ + +#define BCM577XX_HOST_CONTROL 0x198 +#define BCM577XX_CTRL_CLKSEL_MASK 0xFFFFCFFF +#define BCM577XX_CTRL_CLKSEL_SHIFT 12 +#define BCM577XX_CTRL_CLKSEL_DEFAULT 0x0 +#define BCM577XX_CTRL_CLKSEL_64MHZ 0x3 + + static void sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { @@ -152,8 +169,7 @@ sdhci_reset(struct sdhci_slot *slot, uin int timeout; if (slot->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) { - if (!(RD4(slot, SDHCI_PRESENT_STATE) & - SDHCI_CARD_PRESENT)) + if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot)) return; } @@ -218,10 +234,15 @@ sdhci_init(struct sdhci_slot *slot) slot->intmask = SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT | SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX | SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT | - SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT | SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DMA_END | SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE | SDHCI_INT_ACMD12ERR; + + if (!(slot->quirks & SDHCI_QUIRK_POLL_CARD_PRESENT) && + !(slot->opt & SDHCI_NON_REMOVABLE)) { + slot->intmask |= SDHCI_INT_CARD_REMOVE | SDHCI_INT_CARD_INSERT; + } + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -229,6 +250,8 @@ sdhci_init(struct sdhci_slot *slot) static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock) { + uint32_t clk_base; + uint32_t clk_sel; uint32_t res; uint16_t clk; uint16_t div; @@ -244,6 +267,22 @@ sdhci_set_clock(struct sdhci_slot *slot, /* If no clock requested - left it so. */ if (clock == 0) return; + + /* Determine the clock base frequency */ + clk_base = slot->max_clk; + if (slot->quirks & SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC) { + clk_sel = RD2(slot, BCM577XX_HOST_CONTROL) & BCM577XX_CTRL_CLKSEL_MASK; + + /* Select clock source appropriate for the requested frequency. */ + if ((clk_base / BCM577XX_DEFAULT_MAX_DIVIDER) > clock) { + clk_base = BCM577XX_ALT_CLOCK_BASE; + clk_sel |= (BCM577XX_CTRL_CLKSEL_64MHZ << BCM577XX_CTRL_CLKSEL_SHIFT); + } else { + clk_sel |= (BCM577XX_CTRL_CLKSEL_DEFAULT << BCM577XX_CTRL_CLKSEL_SHIFT); + } + + WR2(slot, BCM577XX_HOST_CONTROL, clk_sel); + } /* Recalculate timeout clock frequency based on the new sd clock. */ if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) @@ -251,7 +290,7 @@ sdhci_set_clock(struct sdhci_slot *slot, if (slot->version < SDHCI_SPEC_300) { /* Looking for highest freq <= clock. */ - res = slot->max_clk; + res = clk_base; for (div = 1; div < SDHCI_200_MAX_DIVIDER; div <<= 1) { if (res <= clock) break; @@ -262,11 +301,11 @@ sdhci_set_clock(struct sdhci_slot *slot, } else { /* Version 3.0 divisors are multiples of two up to 1023*2 */ - if (clock >= slot->max_clk) + if (clock >= clk_base) div = 0; else { for (div = 2; div < SDHCI_300_MAX_DIVIDER; div += 2) { - if ((slot->max_clk / div) <= clock) + if ((clk_base / div) <= clock) break; } } @@ -274,8 +313,8 @@ sdhci_set_clock(struct sdhci_slot *slot, } if (bootverbose || sdhci_debug) - slot_printf(slot, "Divider %d for freq %d (max %d)\n", - div, clock, slot->max_clk); + slot_printf(slot, "Divider %d for freq %d (base %d)\n", + div, clock, clk_base); /* Now we have got divider, set it. */ clk = (div & SDHCI_DIVIDER_MASK) << SDHCI_DIVIDER_SHIFT; @@ -445,23 +484,17 @@ sdhci_transfer_pio(struct sdhci_slot *sl } } -static void -sdhci_card_delay(void *arg) -{ - struct sdhci_slot *slot = arg; - - taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task); -} - static void sdhci_card_task(void *arg, int pending) { struct sdhci_slot *slot = arg; SDHCI_LOCK(slot); - if (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT) { + if (SDHCI_GET_CARD_PRESENT(slot->bus, slot)) { if (slot->dev == NULL) { /* If card is present - attach mmc bus. */ + if (bootverbose || sdhci_debug) + slot_printf(slot, "Card inserted\n"); slot->dev = device_add_child(slot->bus, "mmc", -1); device_set_ivars(slot->dev, slot); SDHCI_UNLOCK(slot); @@ -471,6 +504,8 @@ sdhci_card_task(void *arg, int pending) } else { if (slot->dev != NULL) { /* If no card present - detach mmc bus. */ + if (bootverbose || sdhci_debug) + slot_printf(slot, "Card removed\n"); device_t d = slot->dev; slot->dev = NULL; SDHCI_UNLOCK(slot); @@ -480,6 +515,51 @@ sdhci_card_task(void *arg, int pending) } } +static void +sdhci_handle_card_present_locked(struct sdhci_slot *slot, bool is_present) +{ + bool was_present; + + /* + * If there was no card and now there is one, schedule the task to + * create the child device after a short delay. The delay is to + * debounce the card insert (sometimes the card detect pin stabilizes + * before the other pins have made good contact). + * + * If there was a card present and now it's gone, immediately schedule + * the task to delete the child device. No debouncing -- gone is gone, + * because once power is removed, a full card re-init is needed, and + * that happens by deleting and recreating the child device. + */ + was_present = slot->dev != NULL; + if (!was_present && is_present) { + taskqueue_enqueue_timeout(taskqueue_swi_giant, + &slot->card_delayed_task, -SDHCI_INSERT_DELAY_TICKS); + } else if (was_present && !is_present) { + taskqueue_enqueue(taskqueue_swi_giant, &slot->card_task); + } +} + +void +sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present) +{ + + SDHCI_LOCK(slot); + sdhci_handle_card_present_locked(slot, is_present); + SDHCI_UNLOCK(slot); +} + +static void +sdhci_card_poll(void *arg) +{ + struct sdhci_slot *slot = arg; + + sdhci_handle_card_present(slot, + SDHCI_GET_CARD_PRESENT(slot->bus, slot)); + callout_reset(&slot->card_poll_callout, SDHCI_CARD_PRESENT_TICKS, + sdhci_card_poll, slot); +} + int sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) { @@ -616,10 +696,24 @@ sdhci_init_slot(device_t dev, struct sdh (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO"); sdhci_dumpregs(slot); } - + + slot->timeout = 10; + SYSCTL_ADD_INT(device_get_sysctl_ctx(slot->bus), + SYSCTL_CHILDREN(device_get_sysctl_tree(slot->bus)), OID_AUTO, + "timeout", CTLFLAG_RW, &slot->timeout, 0, + "Maximum timeout for SDHCI transfers (in secs)"); TASK_INIT(&slot->card_task, 0, sdhci_card_task, slot); - callout_init(&slot->card_callout, 1); + TIMEOUT_TASK_INIT(taskqueue_swi_giant, &slot->card_delayed_task, 0, + sdhci_card_task, slot); + callout_init(&slot->card_poll_callout, 1); callout_init_mtx(&slot->timeout_callout, &slot->mtx, 0); + + if ((slot->quirks & SDHCI_QUIRK_POLL_CARD_PRESENT) && + !(slot->opt & SDHCI_NON_REMOVABLE)) { + callout_reset(&slot->card_poll_callout, + SDHCI_CARD_PRESENT_TICKS, sdhci_card_poll, slot); + } + return (0); } @@ -635,8 +729,9 @@ sdhci_cleanup_slot(struct sdhci_slot *sl device_t d; callout_drain(&slot->timeout_callout); - callout_drain(&slot->card_callout); + callout_drain(&slot->card_poll_callout); taskqueue_drain(taskqueue_swi_giant, &slot->card_task); + taskqueue_drain_timeout(taskqueue_swi_giant, &slot->card_delayed_task); SDHCI_LOCK(slot); d = slot->dev; @@ -682,6 +777,16 @@ sdhci_generic_min_freq(device_t brdev, s return (slot->max_clk / SDHCI_200_MAX_DIVIDER); } +bool +sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot) +{ + + if (slot->opt & SDHCI_NON_REMOVABLE) + return true; + + return (RD4(slot, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT); +} + int sdhci_generic_update_ios(device_t brdev, device_t reqdev) { @@ -779,7 +884,7 @@ static void sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) { int flags, timeout; - uint32_t mask, state; + uint32_t mask; slot->curcmd = cmd; slot->cmd_done = 0; @@ -794,11 +899,9 @@ sdhci_start_command(struct sdhci_slot *s return; } - /* Read controller present state. */ - state = RD4(slot, SDHCI_PRESENT_STATE); /* Do not issue command if there is no card, clock or power. * Controller will not detect timeout without clock active. */ - if ((state & SDHCI_CARD_PRESENT) == 0 || + if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot) || slot->power == 0 || slot->clock == 0) { cmd->error = MMC_ERR_FAILED; @@ -824,7 +927,7 @@ sdhci_start_command(struct sdhci_slot *s * (It's usually more like 20-30ms in the real world.) */ timeout = 250; - while (state & mask) { + while (mask & RD4(slot, SDHCI_PRESENT_STATE)) { if (timeout == 0) { slot_printf(slot, "Controller never released " "inhibit bit(s).\n"); @@ -835,7 +938,6 @@ sdhci_start_command(struct sdhci_slot *s } timeout--; DELAY(1000); - state = RD4(slot, SDHCI_PRESENT_STATE); } /* Prepare command flags. */ @@ -873,7 +975,8 @@ sdhci_start_command(struct sdhci_slot *s /* Start command. */ WR2(slot, SDHCI_COMMAND_FLAGS, (cmd->opcode << 8) | (flags & 0xff)); /* Start timeout callout. */ - callout_reset(&slot->timeout_callout, 2*hz, sdhci_timeout, slot); + callout_reset(&slot->timeout_callout, slot->timeout * hz, + sdhci_timeout, slot); } static void @@ -1272,7 +1375,7 @@ sdhci_acmd_irq(struct sdhci_slot *slot) void sdhci_generic_intr(struct sdhci_slot *slot) { - uint32_t intmask; + uint32_t intmask, present; SDHCI_LOCK(slot); /* Read slot interrupt status. */ @@ -1286,22 +1389,16 @@ sdhci_generic_intr(struct sdhci_slot *sl /* Handle card presence interrupts. */ if (intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)) { + present = (intmask & SDHCI_INT_CARD_INSERT) != 0; + slot->intmask &= + ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); + slot->intmask |= present ? SDHCI_INT_CARD_REMOVE : + SDHCI_INT_CARD_INSERT; + WR4(slot, SDHCI_INT_ENABLE, slot->intmask); + WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); WR4(slot, SDHCI_INT_STATUS, intmask & (SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE)); - - if (intmask & SDHCI_INT_CARD_REMOVE) { - if (bootverbose || sdhci_debug) - slot_printf(slot, "Card removed\n"); - callout_stop(&slot->card_callout); - taskqueue_enqueue(taskqueue_swi_giant, - &slot->card_task); - } - if (intmask & SDHCI_INT_CARD_INSERT) { - if (bootverbose || sdhci_debug) - slot_printf(slot, "Card inserted\n"); - callout_reset(&slot->card_callout, hz / 2, - sdhci_card_delay, slot); - } + sdhci_handle_card_present_locked(slot, present); intmask &= ~(SDHCI_INT_CARD_INSERT | SDHCI_INT_CARD_REMOVE); } /* Handle command interrupts. */ Modified: stable/10/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.h Sun Jan 15 22:10:32 2017 (r312244) +++ stable/10/sys/dev/sdhci/sdhci.h Sun Jan 15 22:30:59 2017 (r312245) @@ -63,6 +63,10 @@ #define SDHCI_QUIRK_WAITFOR_RESET_ASSERTED (1<<14) /* Leave controller in standard mode when putting card in HS mode. */ #define SDHCI_QUIRK_DONT_SET_HISPD_BIT (1<<15) +/* Alternate clock source is required when supplying a 400 KHz clock. */ +#define SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC (1<<16) +/* Card insert/remove interrupts don't work, polling required. */ +#define SDHCI_QUIRK_POLL_CARD_PRESENT (1<<17) /* * Controller registers @@ -268,9 +272,11 @@ struct sdhci_slot { device_t dev; /* Slot device */ u_char num; /* Slot number */ u_char opt; /* Slot options */ -#define SDHCI_HAVE_DMA 1 -#define SDHCI_PLATFORM_TRANSFER 2 +#define SDHCI_HAVE_DMA 0x01 +#define SDHCI_PLATFORM_TRANSFER 0x02 +#define SDHCI_NON_REMOVABLE 0x04 u_char version; + int timeout; /* Transfer timeout */ uint32_t max_clk; /* Max possible freq */ uint32_t timeout_clk; /* Timeout freq */ bus_dma_tag_t dmatag; @@ -278,7 +284,9 @@ struct sdhci_slot { u_char *dmamem; bus_addr_t paddr; /* DMA buffer address */ struct task card_task; /* Card presence check task */ - struct callout card_callout; /* Card insert delay callout */ + struct timeout_task + card_delayed_task;/* Card insert delayed task */ + struct callout card_poll_callout;/* Card present polling callout */ struct callout timeout_callout;/* Card command/data response timeout */ struct mmc_host host; /* Host parameters */ struct mmc_request *req; /* Current request */ @@ -316,5 +324,7 @@ int sdhci_generic_acquire_host(device_t int sdhci_generic_release_host(device_t brdev, device_t reqdev); void sdhci_generic_intr(struct sdhci_slot *slot); uint32_t sdhci_generic_min_freq(device_t brdev, struct sdhci_slot *slot); +bool sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot); +void sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present); #endif /* __SDHCI_H__ */ Modified: stable/10/sys/dev/sdhci/sdhci_if.m ============================================================================== --- stable/10/sys/dev/sdhci/sdhci_if.m Sun Jan 15 22:10:32 2017 (r312244) +++ stable/10/sys/dev/sdhci/sdhci_if.m Sun Jan 15 22:30:59 2017 (r312245) @@ -152,3 +152,9 @@ METHOD uint32_t min_freq { device_t brdev; struct sdhci_slot *slot; } DEFAULT sdhci_generic_min_freq; + +METHOD bool get_card_present { + device_t brdev; + struct sdhci_slot *slot; +} DEFAULT sdhci_generic_get_card_present; + Modified: stable/10/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci_pci.c Sun Jan 15 22:10:32 2017 (r312244) +++ stable/10/sys/dev/sdhci/sdhci_pci.c Sun Jan 15 22:30:59 2017 (r312245) @@ -105,6 +105,8 @@ static const struct sdhci_device { { 0x2381197B, 0xffff, "JMicron JMB38X SD", SDHCI_QUIRK_32BIT_DMA_SIZE | SDHCI_QUIRK_RESET_AFTER_REQUEST }, + { 0x16bc14e4, 0xffff, "Broadcom BCM577xx SDXC/MMC Card Reader", + SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC }, { 0, 0xffff, NULL, 0 } }; @@ -335,6 +337,8 @@ sdhci_pci_attach(device_t dev) device_printf(dev, "Can't allocate memory for slot %d\n", i); continue; } + + slot->quirks = sc->quirks; if (sdhci_init_slot(dev, slot, i) != 0) continue; From owner-svn-src-all@freebsd.org Mon Jan 16 00:35:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 082E8CAF825; Mon, 16 Jan 2017 00:35: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 CDF381A20; Mon, 16 Jan 2017 00:35: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 v0G0ZYFp046020; Mon, 16 Jan 2017 00:35:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G0ZYKL046019; Mon, 16 Jan 2017 00:35:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701160035.v0G0ZYKL046019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Jan 2017 00:35:34 +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: r312246 - stable/11/lib/libprocstat 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, 16 Jan 2017 00:35:35 -0000 Author: kib Date: Mon Jan 16 00:35:33 2017 New Revision: 312246 URL: https://svnweb.freebsd.org/changeset/base/312246 Log: MFC r311780: Use tab for indent. Modified: stable/11/lib/libprocstat/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libprocstat/Makefile ============================================================================== --- stable/11/lib/libprocstat/Makefile Sun Jan 15 22:30:59 2017 (r312245) +++ stable/11/lib/libprocstat/Makefile Mon Jan 16 00:35:33 2017 (r312246) @@ -9,7 +9,7 @@ SRCS= cd9660.c \ common_kvm.c \ core.c \ libprocstat.c \ - msdosfs.c \ + msdosfs.c \ smbfs.c \ udf.c From owner-svn-src-all@freebsd.org Mon Jan 16 00:37:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86B77CAF902; Mon, 16 Jan 2017 00:37:27 +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 568711BC5; Mon, 16 Jan 2017 00:37:27 +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 v0G0bQQm046133; Mon, 16 Jan 2017 00:37:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G0bQb7046132; Mon, 16 Jan 2017 00:37:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701160037.v0G0bQb7046132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Jan 2017 00:37: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: r312247 - stable/11/lib/libprocstat 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, 16 Jan 2017 00:37:27 -0000 Author: kib Date: Mon Jan 16 00:37:26 2017 New Revision: 312247 URL: https://svnweb.freebsd.org/changeset/base/312247 Log: MFC r311781: Use standard Versions.def for libprocstat. Deleted: stable/11/lib/libprocstat/Versions.def Modified: stable/11/lib/libprocstat/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libprocstat/Makefile ============================================================================== --- stable/11/lib/libprocstat/Makefile Mon Jan 16 00:35:33 2017 (r312246) +++ stable/11/lib/libprocstat/Makefile Mon Jan 16 00:37:26 2017 (r312247) @@ -13,7 +13,7 @@ SRCS= cd9660.c \ smbfs.c \ udf.c -VERSION_DEF= ${.CURDIR}/Versions.def +VERSION_DEF= ${LIBCSRCDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map INCS= libprocstat.h From owner-svn-src-all@freebsd.org Mon Jan 16 00:43:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87D75CAFB84; Mon, 16 Jan 2017 00:43:58 +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 3E1111FF9; Mon, 16 Jan 2017 00:43:58 +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 v0G0hvk8050004; Mon, 16 Jan 2017 00:43:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G0hvHT050003; Mon, 16 Jan 2017 00:43:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701160043.v0G0hvHT050003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Jan 2017 00:43:57 +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: r312248 - stable/11/sys/fs/pseudofs 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, 16 Jan 2017 00:43:58 -0000 Author: kib Date: Mon Jan 16 00:43:57 2017 New Revision: 312248 URL: https://svnweb.freebsd.org/changeset/base/312248 Log: MFC r311815: Forcibly remove the cached items from pseudofs vncache on module unload. Modified: stable/11/sys/fs/pseudofs/pseudofs_vncache.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/pseudofs/pseudofs_vncache.c ============================================================================== --- stable/11/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan 16 00:37:26 2017 (r312247) +++ stable/11/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan 16 00:43:57 2017 (r312248) @@ -51,6 +51,7 @@ static struct mtx pfs_vncache_mutex; static struct pfs_vdata *pfs_vncache; static eventhandler_tag pfs_exit_tag; static void pfs_exit(void *arg, struct proc *p); +static void pfs_purge_locked(struct pfs_node *pn, bool force); static SYSCTL_NODE(_vfs_pfs, OID_AUTO, vncache, CTLFLAG_RW, 0, "pseudofs vnode cache"); @@ -97,6 +98,9 @@ pfs_vncache_unload(void) { EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag); + mtx_lock(&pfs_vncache_mutex); + pfs_purge_locked(NULL, true); + mtx_unlock(&pfs_vncache_mutex); KASSERT(pfs_vncache_entries == 0, ("%d vncache entries remaining", pfs_vncache_entries)); mtx_destroy(&pfs_vncache_mutex); @@ -272,7 +276,7 @@ pfs_vncache_free(struct vnode *vp) * used to implement the cache. */ static void -pfs_purge_locked(struct pfs_node *pn) +pfs_purge_locked(struct pfs_node *pn, bool force) { struct pfs_vdata *pvd; struct vnode *vnp; @@ -280,7 +284,8 @@ pfs_purge_locked(struct pfs_node *pn) mtx_assert(&pfs_vncache_mutex, MA_OWNED); pvd = pfs_vncache; while (pvd != NULL) { - if (pvd->pvd_dead || (pn != NULL && pvd->pvd_pn == pn)) { + if (force || pvd->pvd_dead || + (pn != NULL && pvd->pvd_pn == pn)) { vnp = pvd->pvd_vnode; vhold(vnp); mtx_unlock(&pfs_vncache_mutex); @@ -301,7 +306,7 @@ pfs_purge(struct pfs_node *pn) { mtx_lock(&pfs_vncache_mutex); - pfs_purge_locked(pn); + pfs_purge_locked(pn, false); mtx_unlock(&pfs_vncache_mutex); } @@ -321,6 +326,6 @@ pfs_exit(void *arg, struct proc *p) if (pvd->pvd_pid == p->p_pid) dead = pvd->pvd_dead = 1; if (dead) - pfs_purge_locked(NULL); + pfs_purge_locked(NULL, false); mtx_unlock(&pfs_vncache_mutex); } From owner-svn-src-all@freebsd.org Mon Jan 16 01:38:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8554CB1F9E; Mon, 16 Jan 2017 01:38:35 +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 C289E16E4; Mon, 16 Jan 2017 01:38:35 +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 v0G1cYO6070302; Mon, 16 Jan 2017 01:38:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G1cYM5070301; Mon, 16 Jan 2017 01:38:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701160138.v0G1cYM5070301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 16 Jan 2017 01:38:34 +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: r312249 - stable/11/sys/conf 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, 16 Jan 2017 01:38:36 -0000 Author: emaste Date: Mon Jan 16 01:38:34 2017 New Revision: 312249 URL: https://svnweb.freebsd.org/changeset/base/312249 Log: newvers.sh: add options to eliminate kernel build metadata MFC r310112, r310114, r310273, r310279 r310112: newvers.sh: add option to eliminate kernel build metadata Build metadata (username, hostname, etc.) prevents the FreeBSD kernel from building reproducibly. Add an option to disable inclusion of that metadata but retain the release information and SVN/git VCS details. See https://reproducible-builds.org/ for additional background. r310114: newvers.sh: correct typo in comment r310273: newvers.sh: add -R option to include metadata only for unmodified src tree r310279: newvers.sh: consider as modified SVN mixed revision and other cases The newvers -R option is intended to include build metadata (e.g. user, host, time) if the build is from an unmodified VCS tree. For subversion it considered a trailing 'M' as an indication of a modified tree, and any other version string as modified. Also include mixed revision checkouts (e.g. 123:126), switched (123S) and partial (123P) working copies as modified: the revision number is insufficient to uniquely determine which source was used for the build. Modified: stable/11/sys/conf/newvers.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Mon Jan 16 00:43:57 2017 (r312248) +++ stable/11/sys/conf/newvers.sh Mon Jan 16 01:38:34 2017 (r312249) @@ -30,6 +30,18 @@ # @(#)newvers.sh 8.1 (Berkeley) 4/20/94 # $FreeBSD$ +# Command line options: +# +# -r Reproducible build. Do not embed directory names, user +# names, time stamps or other dynamic information into +# the output file. This is intended to allow two builds +# done at different times and even by different people on +# different hosts to produce identical output. +# +# -R Reproducible build if the tree represents an unmodified +# checkout from a version control system. Metadata is +# included if the tree is modified. + TYPE="FreeBSD" REVISION="11.0" BRANCH="STABLE" @@ -163,8 +175,16 @@ fi if [ -n "$svnversion" ] ; then svn=`cd ${SYSDIR} && $svnversion 2>/dev/null` case "$svn" in - [0-9]*) svn=" r${svn}" ;; - *) unset svn ;; + [0-9]*[MSP]|*:*) + svn=" r${svn}" + modified=true + ;; + [0-9]*) + svn=" r${svn}" + ;; + *) + unset svn + ;; esac fi @@ -196,6 +216,7 @@ if [ -n "$git_cmd" ] ; then if $git_cmd --work-tree=${SYSDIR}/.. diff-index \ --name-only HEAD | read dummy; then git="${git}-dirty" + modified=true fi fi @@ -208,7 +229,10 @@ if [ -n "$p4_cmd" ] ; then p4opened=`cd ${SYSDIR} && $p4_cmd opened ./... 2>&1` case "$p4opened" in File*) ;; - //*) p4version="${p4version}+edit" ;; + //*) + p4version="${p4version}+edit" + modified=true + ;; esac ;; *) unset p4version ;; @@ -227,10 +251,32 @@ if [ -n "$hg_cmd" ] ; then fi fi +include_metadata=true +while getopts rR opt; do + case "$opt" in + r) + include_metadata= + ;; + R) + if [ -z "${modified}" ]; then + include_metadata= + fi + esac +done +shift $((OPTIND - 1)) + +if [ -z "${include_metadata}" ]; then + VERINFO="${VERSION} ${svn}${git}${hg}${p4version}" + VERSTR="${VERINFO}\\n" +else + VERINFO="${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}" + VERSTR="${VERINFO}\\n ${u}@${h}:${d}\\n" +fi + cat << EOF > vers.c $COPYRIGHT -#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}" -#define VERSTR "${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}\\n ${u}@${h}:${d}\\n" +#define SCCSSTR "@(#)${VERINFO}" +#define VERSTR "${VERSTR}" #define RELSTR "${RELEASE}" char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; From owner-svn-src-all@freebsd.org Mon Jan 16 02:00:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5746FCB267D; Mon, 16 Jan 2017 02:00:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id E2E5E1F7D; Mon, 16 Jan 2017 02:00:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 4FD2A3C5EE3; Mon, 16 Jan 2017 13:00:02 +1100 (AEDT) Date: Mon, 16 Jan 2017 13:00:01 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Slawa Olhovchenkov cc: Julian Elischer , Mark Johnston , Bruce Evans , svn-src-head@freebsd.org, rang@acm.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r311952 - head/sys/ddb In-Reply-To: <20170115144531.GB58505@zxy.spb.ru> Message-ID: <20170116122019.E1170@besplex.bde.org> References: <201701120022.v0C0MaHq053076@repo.freebsd.org> <20170113131948.P1465@besplex.bde.org> <20170114220629.GB18065@raichu> <1755552c-a5e2-848a-38e2-3bacfbecfb23@elischer.org> <20170115144531.GB58505@zxy.spb.ru> 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=H7qr+6Qi c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=usmHoXVVML-mfzcKIW0A: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: Mon, 16 Jan 2017 02:00:06 -0000 On Sun, 15 Jan 2017, Slawa Olhovchenkov wrote: > On Sun, Jan 15, 2017 at 01:07:58PM +0800, Julian Elischer wrote: > >> >> the old DEC machines had (from memory) ^O which dropped all pending >> output. >> Not so useful when there is 2MB of network buffers queued up to you, >> but very useful on >> and asr-33 teletype. > > Now it useful too, on serial console. > ^O processing be present years ago in FreeBSD, but removed at time of > tty code rewrite. As I know patch for restore exist, nobody > review/commit. Urk. I have fixes for hundreds of things broken in the rewrite, but didn't notice this one. The only fix I have near here is a partial one for funky quoting of control characters according to ECHOK and ECHOKE. ECHOK is a POSIX feature and ECHOKE is a BSD feature. The man page still docoments the old behaviour. Grepping for CCEQ (and its renaming to the worse name CMP_FLAG in the rewrite) shows that the only other control character with lost support is VDSUSP. Zgrepping for VDISCARD and VDSUSP in /usr/share/man shows the following bugs: - VDISCARD and VDSUSP are listed but not described in any useful way in termios(4) - VDSUSP (and dsusp) is listed but not described in any useful way in stty(1) - VDISCARD (and discard) are not mentioned in stty(1). However, 'stty discard c' works, and stty's display of the discard character works. stty's displays exactly the special characters that used to work. - VDISCARD and VDSUSP are otherwise undocumented. - FLUSHO in termios(4) and flusho in stty(1) are listed and described, but their close connection with VDISCARD is not mentioned (except stty says "being discarded"). FLUSHO is mostly an internal flag. In the working version, It is normally toggled by VDISCARD but is cleared by other actions. It can also be controlled by an ioctl, and stty supports the ioctl. But settings by stty are rarely useful since it is normally cleared by other The patch in the PR doesn't handle the other actions right. actions which stty can't control. Partial fixes for ECHOKE and nearby things: X Index: tty_ttydisc.c X =================================================================== X --- tty_ttydisc.c (revision 312117) X +++ tty_ttydisc.c (working copy) X @@ -798,6 +842,16 @@ X } X } else { X /* Don't print spaces. */ X + /* X + * XXX broken if VERASE is disabled. Can get here X + * then if ECHO is off and: X + * - for VERASE2 if that is not disabled X + * - for the buggy ECHOK/ECHOKE cases X + * - perhaps in other cases. X + * This routine is too generic. X + * X + * XXX the logic is not just non-printing of spaces. X + */ X ttydisc_echo(tp, tp->t_termios.c_cc[VERASE], 0); X } X } X @@ -993,7 +1049,30 @@ X ttydisc_rubchar(tp); X return (0); X } else if (CMP_CC(VKILL, c)) { X +#if 0 X + /* X + * XXX broken. This doesn't even look at ECHOK or X + * ECHOKE (nothing does now), and it doesn't produce X + * the documented behaviour of ECHOK. ECHOK exists X + * to be a non-erasing version of ECHOKE that uses X + * fewer terminal capabilities. ECHOPRT is also X + * broken (never even looked at). X + */ X while (ttydisc_rubchar(tp) == 0); X +#else X + if (CMP_FLAG(l, ECHOKE)) { X + /* XXX too hard to fix. */ X + while (ttydisc_rubchar(tp) == 0) X + ; X + } else { X + ttydisc_echo_force(tp, c, 0); X + if (CMP_FLAG(l, ECHOK)) X + ttydisc_echo_force(tp, '\n', 0); X + while (ttyinq_peekchar(&tp->t_inq, &c, X + "e) == 0) X + ttyinq_unputchar(&tp->t_inq); X + } X +#endif X return (0); X } else if (CMP_FLAG(l, IEXTEN)) { X if (CMP_CC(VWERASE, c)) { X @@ -1021,12 +1100,13 @@ X X parmrk: X if (CMP_FLAG(i, PARMRK)) { X - /* Prepend 0xff 0x00 0x.. */ X + /* Prepend 0xff 0x00. */ X ob[2] = c; X ol = 3; X quote = 1; X } else { X - ob[0] = c; X + /* Kill the character for read(). Keep it in c for echoing. */ X + ob[0] = '\0'; X ol = 1; X } X Bruce From owner-svn-src-all@freebsd.org Mon Jan 16 03:03:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9ADE1CB161D; Mon, 16 Jan 2017 03:03:48 +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 7560B12E4; Mon, 16 Jan 2017 03:03:48 +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 v0G33lUx007102; Mon, 16 Jan 2017 03:03:47 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G33lJV007097; Mon, 16 Jan 2017 03:03:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201701160303.v0G33lJV007097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 16 Jan 2017 03:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312250 - in head: share/man/man4 sys/dev/alc 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: Mon, 16 Jan 2017 03:03:48 -0000 Author: sephe Date: Mon Jan 16 03:03:47 2017 New Revision: 312250 URL: https://svnweb.freebsd.org/changeset/base/312250 Log: alc: Add Killer E2500 support Reviewed by: jhb, yongari MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D9058 Modified: head/share/man/man4/alc.4 head/sys/dev/alc/if_alc.c head/sys/dev/alc/if_alcreg.h head/sys/dev/pci/pci.c Modified: head/share/man/man4/alc.4 ============================================================================== --- head/share/man/man4/alc.4 Mon Jan 16 01:38:34 2017 (r312249) +++ head/share/man/man4/alc.4 Mon Jan 16 03:03:47 2017 (r312250) @@ -124,6 +124,8 @@ Atheros AR8172 PCI Express Fast Ethernet Killer E2200 Gigabit Ethernet controller .It Killer E2400 Gigabit Ethernet controller +.It +Killer E2500 Gigabit Ethernet controller .El .Sh LOADER TUNABLES Tunables can be set at the Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Mon Jan 16 01:38:34 2017 (r312249) +++ head/sys/dev/alc/if_alc.c Mon Jan 16 03:03:47 2017 (r312250) @@ -123,6 +123,8 @@ static struct alc_ident alc_ident_table[ "Killer E2200 Gigabit Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2400, 9 * 1024, "Killer E2400 Gigabit Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2500, 9 * 1024, + "Killer E2500 Gigabit Ethernet" }, { 0, 0, 0, NULL} }; @@ -1083,6 +1085,7 @@ alc_phy_down(struct alc_softc *sc) case DEVICEID_ATHEROS_AR8161: case DEVICEID_ATHEROS_E2200: case DEVICEID_ATHEROS_E2400: + case DEVICEID_ATHEROS_E2500: case DEVICEID_ATHEROS_AR8162: case DEVICEID_ATHEROS_AR8171: case DEVICEID_ATHEROS_AR8172: @@ -1402,6 +1405,7 @@ alc_attach(device_t dev) switch (sc->alc_ident->deviceid) { case DEVICEID_ATHEROS_E2200: case DEVICEID_ATHEROS_E2400: + case DEVICEID_ATHEROS_E2500: sc->alc_flags |= ALC_FLAG_E2X00; /* FALLTHROUGH */ case DEVICEID_ATHEROS_AR8161: @@ -1480,7 +1484,8 @@ alc_attach(device_t dev) if (alc_dma_burst[sc->alc_dma_wr_burst] > 1024) sc->alc_dma_wr_burst = 3; /* - * Force maximum payload size to 128 bytes for E2200/E2400. + * Force maximum payload size to 128 bytes for + * E2200/E2400/E2500. * Otherwise it triggers DMA write error. */ if ((sc->alc_flags & ALC_FLAG_E2X00) != 0) Modified: head/sys/dev/alc/if_alcreg.h ============================================================================== --- head/sys/dev/alc/if_alcreg.h Mon Jan 16 01:38:34 2017 (r312249) +++ head/sys/dev/alc/if_alcreg.h Mon Jan 16 03:03:47 2017 (r312250) @@ -50,6 +50,7 @@ #define DEVICEID_ATHEROS_AR8172 0x10A0 #define DEVICEID_ATHEROS_E2200 0xE091 #define DEVICEID_ATHEROS_E2400 0xE0A1 +#define DEVICEID_ATHEROS_E2500 0xE0B1 #define ATHEROS_AR8152_B_V10 0xC0 #define ATHEROS_AR8152_B_V11 0xC1 Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Jan 16 01:38:34 2017 (r312249) +++ head/sys/dev/pci/pci.c Mon Jan 16 03:03:47 2017 (r312250) @@ -281,13 +281,14 @@ static const struct pci_quirk pci_quirks { 0x43851002, PCI_QUIRK_UNMAP_REG, 0x14, 0 }, /* - * Atheros AR8161/AR8162/E2200/E2400 Ethernet controllers have a - * bug that MSI interrupt does not assert if PCIM_CMD_INTxDIS bit + * Atheros AR8161/AR8162/E2200/E2400/E2500 Ethernet controllers have + * a bug that MSI interrupt does not assert if PCIM_CMD_INTxDIS bit * of the command register is set. */ { 0x10911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0xE0911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0xE0A11969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, + { 0xE0B11969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0x10901969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* From owner-svn-src-all@freebsd.org Mon Jan 16 03:11:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FB68CB1929; Mon, 16 Jan 2017 03:11:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C11B1A63; Mon, 16 Jan 2017 03:11:31 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0G3BURX008829; Mon, 16 Jan 2017 03:11:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G3BUAu008828; Mon, 16 Jan 2017 03:11:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701160311.v0G3BUAu008828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 16 Jan 2017 03:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312251 - 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: Mon, 16 Jan 2017 03:11:31 -0000 Author: ian Date: Mon Jan 16 03:11:30 2017 New Revision: 312251 URL: https://svnweb.freebsd.org/changeset/base/312251 Log: Remove a bit of armv6 support that didn't get deleted when this file was split from trap.c into trap-v4.c and trap-v6.c. Modified: head/sys/arm/arm/trap-v4.c Modified: head/sys/arm/arm/trap-v4.c ============================================================================== --- head/sys/arm/arm/trap-v4.c Mon Jan 16 03:03:47 2017 (r312250) +++ head/sys/arm/arm/trap-v4.c Mon Jan 16 03:11:30 2017 (r312251) @@ -139,11 +139,7 @@ static const struct data_abort data_abor {dab_align, "Alignment Fault 3"}, {dab_buserr, "External Linefetch Abort (S)"}, {NULL, "Translation Fault (S)"}, -#if (ARM_MMU_V6 + ARM_MMU_V7) != 0 - {NULL, "Translation Flag Fault"}, -#else {dab_buserr, "External Linefetch Abort (P)"}, -#endif {NULL, "Translation Fault (P)"}, {dab_buserr, "External Non-Linefetch Abort (S)"}, {NULL, "Domain Fault (S)"}, From owner-svn-src-all@freebsd.org Mon Jan 16 03:48:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAE91C650FB; Mon, 16 Jan 2017 03:48:53 +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 524771A25; Mon, 16 Jan 2017 03:48:53 +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 v0G3mqfJ023360; Mon, 16 Jan 2017 03:48:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G3mqul023357; Mon, 16 Jan 2017 03:48:52 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701160348.v0G3mqul023357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 Jan 2017 03:48: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: r312252 - stable/11/lib/libkvm 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, 16 Jan 2017 03:48:53 -0000 Author: pfg Date: Mon Jan 16 03:48:52 2017 New Revision: 312252 URL: https://svnweb.freebsd.org/changeset/base/312252 Log: MFC r311101: libkvm - extend a bit the swap statistics field. Change ksw_used and ksw_total to unsigned, which increases the maximum total swap that can be displayed properly from ~8TB to ~16TB. Obtained from: DragonflyBSD (ecc2e461) Modified: stable/11/lib/libkvm/kvm.h stable/11/lib/libkvm/kvm_getswapinfo.3 stable/11/lib/libkvm/kvm_getswapinfo.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libkvm/kvm.h ============================================================================== --- stable/11/lib/libkvm/kvm.h Mon Jan 16 03:11:30 2017 (r312251) +++ stable/11/lib/libkvm/kvm.h Mon Jan 16 03:48:52 2017 (r312252) @@ -66,11 +66,11 @@ struct proc; struct kvm_swap { char ksw_devname[32]; - int ksw_used; - int ksw_total; + u_int ksw_used; + u_int ksw_total; int ksw_flags; - int ksw_reserved1; - int ksw_reserved2; + u_int ksw_reserved1; + u_int ksw_reserved2; }; #define SWIF_DEV_PREFIX 0x0002 Modified: stable/11/lib/libkvm/kvm_getswapinfo.3 ============================================================================== --- stable/11/lib/libkvm/kvm_getswapinfo.3 Mon Jan 16 03:11:30 2017 (r312251) +++ stable/11/lib/libkvm/kvm_getswapinfo.3 Mon Jan 16 03:48:52 2017 (r312252) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 1999 +.Dd January 2, 2017 .Dt KVM_SWAPINFO 3 .Os .Sh NAME @@ -78,9 +78,9 @@ This structure contains the following fi .It .Va char ksw_devname[] ; .It -.Va int ksw_total ; +.Va u_int ksw_total ; .It -.Va int ksw_used ; +.Va u_int ksw_used ; .It .Va int ksw_flags ; .El Modified: stable/11/lib/libkvm/kvm_getswapinfo.c ============================================================================== --- stable/11/lib/libkvm/kvm_getswapinfo.c Mon Jan 16 03:11:30 2017 (r312251) +++ stable/11/lib/libkvm/kvm_getswapinfo.c Mon Jan 16 03:48:52 2017 (r312252) @@ -112,7 +112,8 @@ int kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int i, ttl; + int i; + swblk_t ttl; TAILQ_HEAD(, swdevt) swtailq; struct swdevt *sp, swinfo; struct kvm_swap tot; @@ -163,7 +164,8 @@ int kvm_getswapinfo_sysctl(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int ti, ttl; + int ti; + swblk_t ttl; size_t mibi, len; int soid[SWI_MAXMIB]; struct xswdev xsd; From owner-svn-src-all@freebsd.org Mon Jan 16 03:52:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55F25C65377; Mon, 16 Jan 2017 03:52:22 +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 026151E79; Mon, 16 Jan 2017 03:52:21 +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 v0G3qLID026506; Mon, 16 Jan 2017 03:52:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G3qK8m026503; Mon, 16 Jan 2017 03:52:20 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701160352.v0G3qK8m026503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 16 Jan 2017 03:52:20 +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: r312253 - stable/10/lib/libkvm 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, 16 Jan 2017 03:52:22 -0000 Author: pfg Date: Mon Jan 16 03:52:20 2017 New Revision: 312253 URL: https://svnweb.freebsd.org/changeset/base/312253 Log: MFC r311101: libkvm - extend a bit the swap statistics field. Change ksw_used and ksw_total to unsigned, which increases the maximum total swap that can be displayed properly from ~8TB to ~16TB. Obtained from: DragonflyBSD (ecc2e461) Modified: stable/10/lib/libkvm/kvm.h stable/10/lib/libkvm/kvm_getswapinfo.3 stable/10/lib/libkvm/kvm_getswapinfo.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libkvm/kvm.h ============================================================================== --- stable/10/lib/libkvm/kvm.h Mon Jan 16 03:48:52 2017 (r312252) +++ stable/10/lib/libkvm/kvm.h Mon Jan 16 03:52:20 2017 (r312253) @@ -58,11 +58,11 @@ struct proc; struct kvm_swap { char ksw_devname[32]; - int ksw_used; - int ksw_total; + u_int ksw_used; + u_int ksw_total; int ksw_flags; - int ksw_reserved1; - int ksw_reserved2; + u_int ksw_reserved1; + u_int ksw_reserved2; }; #define SWIF_DEV_PREFIX 0x0002 Modified: stable/10/lib/libkvm/kvm_getswapinfo.3 ============================================================================== --- stable/10/lib/libkvm/kvm_getswapinfo.3 Mon Jan 16 03:48:52 2017 (r312252) +++ stable/10/lib/libkvm/kvm_getswapinfo.3 Mon Jan 16 03:52:20 2017 (r312253) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 1999 +.Dd January 2, 2017 .Dt KVM_SWAPINFO 3 .Os .Sh NAME @@ -78,9 +78,9 @@ This structure contains the following fi .It .Va char ksw_devname[] ; .It -.Va int ksw_total ; +.Va u_int ksw_total ; .It -.Va int ksw_used ; +.Va u_int ksw_used ; .It .Va int ksw_flags ; .El Modified: stable/10/lib/libkvm/kvm_getswapinfo.c ============================================================================== --- stable/10/lib/libkvm/kvm_getswapinfo.c Mon Jan 16 03:48:52 2017 (r312252) +++ stable/10/lib/libkvm/kvm_getswapinfo.c Mon Jan 16 03:52:20 2017 (r312253) @@ -112,7 +112,8 @@ int kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int i, ttl; + int i; + swblk_t ttl; TAILQ_HEAD(, swdevt) swtailq; struct swdevt *sp, swinfo; struct kvm_swap tot; @@ -157,7 +158,8 @@ int kvm_getswapinfo_sysctl(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) { - int ti, ttl; + int ti; + swblk_t ttl; size_t mibi, len; int soid[SWI_MAXMIB]; struct xswdev xsd; From owner-svn-src-all@freebsd.org Mon Jan 16 03:53:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF9E1C65425; Mon, 16 Jan 2017 03:53:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 99246100A; Mon, 16 Jan 2017 03:53:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 7B7DA3C4644; Mon, 16 Jan 2017 14:53:26 +1100 (AEDT) Date: Mon, 16 Jan 2017 14:53:26 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Adrian Chadd cc: Slawa Olhovchenkov , Julian Elischer , Mark Johnston , Bruce Evans , "svn-src-head@freebsd.org" , rang@acm.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r311952 - head/sys/ddb In-Reply-To: Message-ID: <20170116130020.B1170@besplex.bde.org> References: <201701120022.v0C0MaHq053076@repo.freebsd.org> <20170113131948.P1465@besplex.bde.org> <20170114220629.GB18065@raichu> <1755552c-a5e2-848a-38e2-3bacfbecfb23@elischer.org> <20170115144531.GB58505@zxy.spb.ru> <20170115201758.GA78888@zxy.spb.ru> 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=H7qr+6Qi c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=XH5kUvO47jxvWokLP7IA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 16 Jan 2017 03:53:30 -0000 On Sun, 15 Jan 2017, Adrian Chadd wrote: > hah, i took this, then life got in the way. :) > > Bruce - what do you think of > https://bz-attachments.freebsd.org/attachment.cgi?id=138881 ? Also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=184987 . I think it is hard to read and review since it is not in the mail. After fetching it and quoting it: X diff -r 91820d9948e0 -r 13f40d577646 sys/kern/tty_ttydisc.c X --- a/sys/kern/tty_ttydisc.c Fri Feb 22 09:45:32 2013 +0100 X +++ b/sys/kern/tty_ttydisc.c Tue Dec 17 23:03:17 2013 +0100 X @@ -448,6 +448,9 @@ X if (tp->t_flags & TF_ZOMBIE) X return (EIO); X X + if (tp->t_termios.c_lflag & FLUSHO) X + return (0); X + This seems to be far too simple. As pointed out in the PR thread, it is missing at least the clearing of uio_resid. (BTW, returns for TF_ZOMBIE and IO_NDELAY tend to have the opposite problem. The tend to reduce uio_resid to count i/o that they have not done. They should just return an error like the above return for TF_ZOMBIE does. Upper layers are supposed to translate this error to success if any i/o has been done. Upper layers often get this wrong, and my fixes currently do too much compensation in lower layers.) The old tty driver has squillions of FLUSHO checks for output not involving uio. Mostly for echo of input. However, any input (and other operations?) normally turns of FLUSHO, so this is hard to see. To see if this works compatibly now, try typing 111^O2. ^O should be echoed as ^O^R followed by reprinting the line according to the implicit VREPRINT (^R). This should cancel FLUSHO, so the 2 is just echoed on the new line. However ^O instead of 2 should just cancel FLUSHO. So ^O^O should be equivalent to ^R except it prints ^O before ^R. It is wrong for FLUSHO to have any effect except in modes where VDISCARD has an effect. VDISCARD seems to be conditional on precisely !EXTPROC && IEXTEN. Its inactivity in other modes should be implemented by forcing it off on certain mode changes. The old tty driver forces it off in squillions of places, perhaps including all mode changes for simplicity. There would be a problem if stty(1) could actually set it, since then invalid settings like "raw flusho" would be allowed. Clearing it after all mode changes would prevent stty actually setting it. X /* X * We don't need to check whether the process is the foreground X * process group or if we have a carrier. This is already done X @@ -881,6 +884,14 @@ X X /* Special control characters that are implementation dependent. */ X if (CMP_FLAG(l, IEXTEN)) { X + /* Discard (^O) */ Style bug. This comment is missing a "." and does less than echo the code. The code doesn't hard-code VDISCARD as ^O, and it is unclear whether the comment applies to the previous or the next line (except it is further from echoing the previous line). X + if (CMP_CC(VDISCARD, c)) { X + if (!(tp->t_termios.c_lflag & FLUSHO)) Style bug. This file elsewhere always uses the funky style of explicit comparison of (sets of ) flags with 0. X + ttyoutq_write_nofrag(&tp->t_outq, "^O", 2); This also hard-codes ^O. The old driver echos the actual discard character using ttyecho(c, tp). I don't know if the funky rules for quoting control characters apply in this case, but ttyecho() has to be quite complicated to handle general cases. X + tp->t_termios.c_lflag ^= FLUSHO; The old driver adds an implicit VREPRINT char here if the input queue is nonempty. This usually results in echoing ^O^R and reprinting the line. X + return(0); X + } X + Otherwise, the action here is identical with the old driver. X /* Accept the next character as literal. */ X if (CMP_CC(VLNEXT, c)) { X if (CMP_FLAG(l, ECHO)) { The old driver needs 23 lines mentioning FLUSHO to keep it mostly clear. These are: - 3 in compat code (still there) - 3 here - 1 clear whenever restarting output at the end of interrupt input (most cases interrupt input) - 4 checks in ttyoutput() which is used manly for echoing. 1 at the beginning would be simpler, but the checks are more or less before each putc() and there are many inconsistences for counting characters and the column position from the complications - 1 clear in ttioctl() in 1 case of turning 1 type of flow control back on. Buggy, since FLUSHO should not be affected by flow control except by the xon char being treated as an ordinary char for canceling VDISCARD. - 1 clear in ttioctl() for the same flow control done by TIOCSTART - 1 check for ordinary writes as in this patch - 2 in comments - 2 more checks in the loop for ordinary writes. Some checks are necessary, but these are misplaced. FLUSHO can change underneath when we unlock to do the i/o, so it must be re-checked when we wake up. It is not checked in quite the right places in the old code, but at least the main check is placed at the top of the loop so it mostly works. In the patch, the check is outside of the loop, so it is never checked after waking up. - 1 clear at the start of ttyrub() - 1 set and 1 clear in ttyrub() for TAB processing - 1 clear in ttyecho() related to the TAB processing - 1 other case. So the main missing details are: - clear FLUSHO for almost any input - check FLUSHO in echo processing? (should the new input clear the flag before the echo?) - missing uio handling for writing - missing race handling for writing - clear FLUSHO for most ioctls more than the old code did. Clear it at least when changing the mode to one where VDISCARD doesn't apply. Bruce From owner-svn-src-all@freebsd.org Mon Jan 16 05:30:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B4CECB1D15; Mon, 16 Jan 2017 05:30:11 +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 7CBC514F2; Mon, 16 Jan 2017 05:30:11 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-228-247.lns20.per1.internode.on.net [121.45.228.247]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v0G5TUCh023918 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 15 Jan 2017 21:29:33 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r311952 - head/sys/ddb To: Bruce Evans , Adrian Chadd References: <201701120022.v0C0MaHq053076@repo.freebsd.org> <20170113131948.P1465@besplex.bde.org> <20170114220629.GB18065@raichu> <1755552c-a5e2-848a-38e2-3bacfbecfb23@elischer.org> <20170115144531.GB58505@zxy.spb.ru> <20170115201758.GA78888@zxy.spb.ru> <20170116130020.B1170@besplex.bde.org> Cc: Slawa Olhovchenkov , Julian Elischer , Mark Johnston , "svn-src-head@freebsd.org" , rang@acm.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" From: Julian Elischer Message-ID: <9810b254-7d68-cb93-3766-9d943afae632@freebsd.org> Date: Mon, 16 Jan 2017 13:29:24 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170116130020.B1170@besplex.bde.org> 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: Mon, 16 Jan 2017 05:30:11 -0000 On 16/01/2017 11:53 AM, Bruce Evans wrote: > On Sun, 15 Jan 2017, Adrian Chadd wrote: > >> hah, i took this, then life got in the way. :) >> >> Bruce - what do you think of >> https://bz-attachments.freebsd.org/attachment.cgi?id=138881 ? > > Also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=184987 . > > I think it is hard to read and review since it is not in the mail. > After fetching it and quoting it: review it in the review page and just send a link in the email.. that's what it's for. > > X diff -r 91820d9948e0 -r 13f40d577646 sys/kern/tty_ttydisc.c > X --- a/sys/kern/tty_ttydisc.c Fri Feb 22 09:45:32 2013 +0100 > X +++ b/sys/kern/tty_ttydisc.c Tue Dec 17 23:03:17 2013 +0100 > X @@ -448,6 +448,9 @@ > X if (tp->t_flags & TF_ZOMBIE) > X return (EIO); > X X + if (tp->t_termios.c_lflag & FLUSHO) > X + return (0); > X + > > This seems to be far too simple. As pointed out in the PR thread, it > is missing at least the clearing of uio_resid. > > (BTW, returns for TF_ZOMBIE and IO_NDELAY tend to have the opposite > problem. The tend to reduce uio_resid to count i/o that they have > not done. They should just return an error like the above return > for TF_ZOMBIE does. Upper layers are supposed to translate this > error to success if any i/o has been done. Upper layers often get > this wrong, and my fixes currently do too much compensation in lower > layers.) > > The old tty driver has squillions of FLUSHO checks for output not > involving > uio. Mostly for echo of input. However, any input (and other > operations?) > normally turns of FLUSHO, so this is hard to see. > > To see if this works compatibly now, try typing 111^O2. ^O should be > echoed as ^O^R followed by reprinting the line according to the > implicit > VREPRINT (^R). This should cancel FLUSHO, so the 2 is just echoed on > the new line. However ^O instead of 2 should just cancel FLUSHO. So > ^O^O should be equivalent to ^R except it prints ^O before ^R. > > It is wrong for FLUSHO to have any effect except in modes where > VDISCARD > has an effect. VDISCARD seems to be conditional on precisely > !EXTPROC && IEXTEN. Its inactivity in other modes should be > implemented > by forcing it off on certain mode changes. The old tty driver > forces it > off in squillions of places, perhaps including all mode changes for > simplicity. There would be a problem if stty(1) could actually set it, > since then invalid settings like "raw flusho" would be allowed. > Clearing > it after all mode changes would prevent stty actually setting it. > > > X /* > X * We don't need to check whether the process is the foreground > X * process group or if we have a carrier. This is already done > X @@ -881,6 +884,14 @@ > X X /* Special control characters that are implementation > dependent. */ > X if (CMP_FLAG(l, IEXTEN)) { > X + /* Discard (^O) */ > > Style bug. This comment is missing a "." and does less than echo > the code. > The code doesn't hard-code VDISCARD as ^O, and it is unclear whether > the > comment applies to the previous or the next line (except it is further > from echoing the previous line). > > X + if (CMP_CC(VDISCARD, c)) { > X + if (!(tp->t_termios.c_lflag & FLUSHO)) > > Style bug. This file elsewhere always uses the funky style of explicit > comparison of (sets of ) flags with 0. > > X + ttyoutq_write_nofrag(&tp->t_outq, "^O", 2); > > This also hard-codes ^O. The old driver echos the actual discard > character > using ttyecho(c, tp). I don't know if the funky rules for quoting > control > characters apply in this case, but ttyecho() has to be quite > complicated to > handle general cases. > > X + tp->t_termios.c_lflag ^= FLUSHO; > > The old driver adds an implicit VREPRINT char here if the input > queue is > nonempty. This usually results in echoing ^O^R and reprinting the > line. > > X + return(0); > X + } > X + > > Otherwise, the action here is identical with the old driver. > > X /* Accept the next character as literal. */ > X if (CMP_CC(VLNEXT, c)) { > X if (CMP_FLAG(l, ECHO)) { > > The old driver needs 23 lines mentioning FLUSHO to keep it mostly > clear. > These are: > - 3 in compat code (still there) > - 3 here > - 1 clear whenever restarting output at the end of interrupt input > (most > cases interrupt input) > - 4 checks in ttyoutput() which is used manly for echoing. 1 at the > beginning would be simpler, but the checks are more or less before > each putc() and there are many inconsistences for counting characters > and the column position from the complications > - 1 clear in ttioctl() in 1 case of turning 1 type of flow control > back on. > Buggy, since FLUSHO should not be affected by flow control except > by the > xon char being treated as an ordinary char for canceling VDISCARD. > - 1 clear in ttioctl() for the same flow control done by TIOCSTART > - 1 check for ordinary writes as in this patch > - 2 in comments > - 2 more checks in the loop for ordinary writes. Some checks are > necessary, > but these are misplaced. FLUSHO can change underneath when we > unlock to > do the i/o, so it must be re-checked when we wake up. It is not > checked > in quite the right places in the old code, but at least the main > check > is placed at the top of the loop so it mostly works. In the > patch, the > check is outside of the loop, so it is never checked after waking up. > - 1 clear at the start of ttyrub() > - 1 set and 1 clear in ttyrub() for TAB processing > - 1 clear in ttyecho() related to the TAB processing > - 1 other case. > > So the main missing details are: > - clear FLUSHO for almost any input > - check FLUSHO in echo processing? (should the new input clear the flag > before the echo?) > - missing uio handling for writing > - missing race handling for writing > - clear FLUSHO for most ioctls more than the old code did. Clear it at > least when changing the mode to one where VDISCARD doesn't apply. > > Bruce > From owner-svn-src-all@freebsd.org Mon Jan 16 06:51:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C003CB11E6; Mon, 16 Jan 2017 06:51:59 +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 DC62A1658; Mon, 16 Jan 2017 06:51:58 +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 v0G6pwD6099019; Mon, 16 Jan 2017 06:51:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6pvfn099017; Mon, 16 Jan 2017 06:51:57 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160651.v0G6pvfn099017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:51:57 +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: r312254 - stable/11/contrib/bsnmp/snmpd 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, 16 Jan 2017 06:51:59 -0000 Author: ngie Date: Mon Jan 16 06:51:57 2017 New Revision: 312254 URL: https://svnweb.freebsd.org/changeset/base/312254 Log: MFC r311759,r311760: r311759: Add a REVISION section to track changes for the FOKUS-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at r311760: Add a REVISION section to track changes for the BEGEMOT-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at Modified: stable/11/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt stable/11/contrib/bsnmp/snmpd/FOKUS-MIB.txt Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt ============================================================================== --- stable/11/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt Mon Jan 16 03:52:20 2017 (r312253) +++ stable/11/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt Mon Jan 16 06:51:57 2017 (r312254) @@ -54,6 +54,9 @@ begemot MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The root of the Begemot subtree of the fokus tree." + REVISION "200201300000Z" + DESCRIPTION + "Initial revision." ::= { fokus 1 } END Modified: stable/11/contrib/bsnmp/snmpd/FOKUS-MIB.txt ============================================================================== --- stable/11/contrib/bsnmp/snmpd/FOKUS-MIB.txt Mon Jan 16 03:52:20 2017 (r312253) +++ stable/11/contrib/bsnmp/snmpd/FOKUS-MIB.txt Mon Jan 16 06:51:57 2017 (r312254) @@ -52,6 +52,9 @@ fokus MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The root of the Fokus enterprises tree." + REVISION "200202050000Z" + DESCRIPTION + "Initial revision." ::= { enterprises 12325 } END From owner-svn-src-all@freebsd.org Mon Jan 16 06:53:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CFB1CB1408; Mon, 16 Jan 2017 06:53:03 +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 6C6581A4E; Mon, 16 Jan 2017 06:53:03 +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 v0G6r2qA099276; Mon, 16 Jan 2017 06:53:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6r29a099273; Mon, 16 Jan 2017 06:53:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160653.v0G6r29a099273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:53:02 +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: r312255 - stable/10/contrib/bsnmp/snmpd 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, 16 Jan 2017 06:53:03 -0000 Author: ngie Date: Mon Jan 16 06:53:02 2017 New Revision: 312255 URL: https://svnweb.freebsd.org/changeset/base/312255 Log: MFC r311759,r311760: r311759: Add a REVISION section to track changes for the FOKUS-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at r311760: Add a REVISION section to track changes for the BEGEMOT-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at Modified: stable/10/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt stable/10/contrib/bsnmp/snmpd/FOKUS-MIB.txt Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt ============================================================================== --- stable/10/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt Mon Jan 16 06:51:57 2017 (r312254) +++ stable/10/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt Mon Jan 16 06:53:02 2017 (r312255) @@ -54,6 +54,9 @@ begemot MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The root of the Begemot subtree of the fokus tree." + REVISION "200201300000Z" + DESCRIPTION + "Initial revision." ::= { fokus 1 } END Modified: stable/10/contrib/bsnmp/snmpd/FOKUS-MIB.txt ============================================================================== --- stable/10/contrib/bsnmp/snmpd/FOKUS-MIB.txt Mon Jan 16 06:51:57 2017 (r312254) +++ stable/10/contrib/bsnmp/snmpd/FOKUS-MIB.txt Mon Jan 16 06:53:02 2017 (r312255) @@ -52,6 +52,9 @@ fokus MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The root of the Fokus enterprises tree." + REVISION "200202050000Z" + DESCRIPTION + "Initial revision." ::= { enterprises 12325 } END From owner-svn-src-all@freebsd.org Mon Jan 16 06:54:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A260CB14BD; Mon, 16 Jan 2017 06:54:00 +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 B2F8E1BD9; Mon, 16 Jan 2017 06:53:59 +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 v0G6rw6D099421; Mon, 16 Jan 2017 06:53:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6rwud099419; Mon, 16 Jan 2017 06:53:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160653.v0G6rwud099419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:53:58 +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: r312256 - in stable/11/usr.sbin/bsnmpd/modules: snmp_hostres snmp_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: Mon, 16 Jan 2017 06:54:00 -0000 Author: ngie Date: Mon Jan 16 06:53:58 2017 New Revision: 312256 URL: https://svnweb.freebsd.org/changeset/base/312256 Log: MFC r311741,r311761: r311741: Add a REVISION section to track changes for the hostres module There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at r311761: Add a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file This change also documents the modification harti made to a handful of objects in r122758 (the max OCTET STRING width was increased from 15 to 31 octets) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt stable/11/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Mon Jan 16 06:53:02 2017 (r312255) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Mon Jan 16 06:53:58 2017 (r312256) @@ -54,6 +54,9 @@ begemotHostres MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for additional HOST-RESOURCES data." + REVISION "200601030000Z" + DESCRIPTION + "Initial revision." ::= { begemot 202 } begemotHostresObjects OBJECT IDENTIFIER ::= { begemotHostres 1 } Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Mon Jan 16 06:53:02 2017 (r312255) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Mon Jan 16 06:53:58 2017 (r312256) @@ -59,6 +59,19 @@ begemotNg MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for the NetGraph access module for SNMP." + REVISION "200311140000Z" + DESCRIPTION + "The maximum width of the following OCTET STRINGs was increased + from 15 to 31: + + - NgTypeName + - NgNodeName + - NgNodeNameOrEmpty + - NgHookName + " + REVISION "200201310000Z" + DESCRIPTION + "Initial revision." ::= { begemot 2 } begemotNgObjects OBJECT IDENTIFIER ::= { begemotNg 1 } From owner-svn-src-all@freebsd.org Mon Jan 16 06:54:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF9ACCB150C; Mon, 16 Jan 2017 06:54:08 +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 881AC1C37; Mon, 16 Jan 2017 06:54:08 +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 v0G6s7OX099476; Mon, 16 Jan 2017 06:54:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6s7CI099474; Mon, 16 Jan 2017 06:54:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160654.v0G6s7CI099474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:54:07 +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: r312257 - in stable/10/usr.sbin/bsnmpd/modules: snmp_hostres snmp_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: Mon, 16 Jan 2017 06:54:08 -0000 Author: ngie Date: Mon Jan 16 06:54:07 2017 New Revision: 312257 URL: https://svnweb.freebsd.org/changeset/base/312257 Log: MFC r311741,r311761: r311741: Add a REVISION section to track changes for the hostres module There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at r311761: Add a REVISION section to track changes for the BEGEMOT-NETGRAPH MIB file This change also documents the modification harti made to a handful of objects in r122758 (the max OCTET STRING width was increased from 15 to 31 octets) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt stable/10/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Mon Jan 16 06:53:58 2017 (r312256) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt Mon Jan 16 06:54:07 2017 (r312257) @@ -54,6 +54,9 @@ begemotHostres MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for additional HOST-RESOURCES data." + REVISION "200601030000Z" + DESCRIPTION + "Initial revision." ::= { begemot 202 } begemotHostresObjects OBJECT IDENTIFIER ::= { begemotHostres 1 } Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Mon Jan 16 06:53:58 2017 (r312256) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_netgraph/BEGEMOT-NETGRAPH.txt Mon Jan 16 06:54:07 2017 (r312257) @@ -59,6 +59,19 @@ begemotNg MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for the NetGraph access module for SNMP." + REVISION "200311140000Z" + DESCRIPTION + "The maximum width of the following OCTET STRINGs was increased + from 15 to 31: + + - NgTypeName + - NgNodeName + - NgNodeNameOrEmpty + - NgHookName + " + REVISION "200201310000Z" + DESCRIPTION + "Initial revision." ::= { begemot 2 } begemotNgObjects OBJECT IDENTIFIER ::= { begemotNg 1 } From owner-svn-src-all@freebsd.org Mon Jan 16 06:55:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D9E0CB15C7; Mon, 16 Jan 2017 06:55:12 +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 6C1E01EA0; Mon, 16 Jan 2017 06:55:12 +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 v0G6tBhZ099621; Mon, 16 Jan 2017 06:55:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6tBba099620; Mon, 16 Jan 2017 06:55:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160655.v0G6tBba099620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:55: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: r312258 - stable/11/usr.sbin/bsnmpd/modules/snmp_atm 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, 16 Jan 2017 06:55:12 -0000 Author: ngie Date: Mon Jan 16 06:55:11 2017 New Revision: 312258 URL: https://svnweb.freebsd.org/changeset/base/312258 Log: MFC r311758: Add a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Mon Jan 16 06:54:07 2017 (r312257) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Mon Jan 16 06:55:11 2017 (r312258) @@ -56,7 +56,9 @@ begemotAtmFreeBSDGroup MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The FreeBSD specific Begemot MIB for ATM interfaces." - + REVISION "200408060000Z" + DESCRIPTION + "Initial revision." ::= { begemotAtmSysGroup 1 } -- Netgraph From owner-svn-src-all@freebsd.org Mon Jan 16 06:55:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCE89CB1609; Mon, 16 Jan 2017 06:55:20 +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 9673C1EFE; Mon, 16 Jan 2017 06:55:20 +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 v0G6tJXP099671; Mon, 16 Jan 2017 06:55:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6tJag099670; Mon, 16 Jan 2017 06:55:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160655.v0G6tJag099670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:55: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: r312259 - stable/10/usr.sbin/bsnmpd/modules/snmp_atm 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, 16 Jan 2017 06:55:21 -0000 Author: ngie Date: Mon Jan 16 06:55:19 2017 New Revision: 312259 URL: https://svnweb.freebsd.org/changeset/base/312259 Log: MFC r311758: Add a REVISION section to track changes for the BEGEMOT-ATM-FREEBSD-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Mon Jan 16 06:55:11 2017 (r312258) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt Mon Jan 16 06:55:19 2017 (r312259) @@ -56,7 +56,9 @@ begemotAtmFreeBSDGroup MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The FreeBSD specific Begemot MIB for ATM interfaces." - + REVISION "200408060000Z" + DESCRIPTION + "Initial revision." ::= { begemotAtmSysGroup 1 } -- Netgraph From owner-svn-src-all@freebsd.org Mon Jan 16 06:56:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79C78CB1709; Mon, 16 Jan 2017 06:56:03 +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 49CCF1161; Mon, 16 Jan 2017 06:56:03 +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 v0G6u2u4099784; Mon, 16 Jan 2017 06:56:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6u2sw099783; Mon, 16 Jan 2017 06:56:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160656.v0G6u2sw099783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:56: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: r312260 - stable/11/contrib/bsnmp/snmp_mibII 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, 16 Jan 2017 06:56:03 -0000 Author: ngie Date: Mon Jan 16 06:56:02 2017 New Revision: 312260 URL: https://svnweb.freebsd.org/changeset/base/312260 Log: MFC r311742: Add a REVISION section to track changes for the BEGEMOT-IP-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at Modified: stable/11/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt ============================================================================== --- stable/11/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Mon Jan 16 06:55:19 2017 (r312259) +++ stable/11/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Mon Jan 16 06:56:02 2017 (r312260) @@ -54,6 +54,9 @@ begemotIp MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for IP stuff that is not in the official IP MIBs." + REVISION "200602130000Z" + DESCRIPTION + "Initial revision." ::= { begemot 3 } begemotIpObjects OBJECT IDENTIFIER ::= { begemotIp 1 } From owner-svn-src-all@freebsd.org Mon Jan 16 06:56:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5317ACB1767; Mon, 16 Jan 2017 06:56: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 1F7C611F9; Mon, 16 Jan 2017 06:56: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 v0G6uCle099834; Mon, 16 Jan 2017 06:56:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6uCfX099833; Mon, 16 Jan 2017 06:56:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160656.v0G6uCfX099833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:56: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: r312261 - stable/10/contrib/bsnmp/snmp_mibII 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, 16 Jan 2017 06:56:13 -0000 Author: ngie Date: Mon Jan 16 06:56:12 2017 New Revision: 312261 URL: https://svnweb.freebsd.org/changeset/base/312261 Log: MFC r311742: Add a REVISION section to track changes for the BEGEMOT-IP-MIB MIB file There haven't been any changes to the MIB definition, so the REVISION remains static at the version it was imported at Modified: stable/10/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt ============================================================================== --- stable/10/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Mon Jan 16 06:56:02 2017 (r312260) +++ stable/10/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt Mon Jan 16 06:56:12 2017 (r312261) @@ -54,6 +54,9 @@ begemotIp MODULE-IDENTITY E-mail: harti@freebsd.org" DESCRIPTION "The MIB for IP stuff that is not in the official IP MIBs." + REVISION "200602130000Z" + DESCRIPTION + "Initial revision." ::= { begemot 3 } begemotIpObjects OBJECT IDENTIFIER ::= { begemotIp 1 } From owner-svn-src-all@freebsd.org Mon Jan 16 06:57:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D735CB1829; Mon, 16 Jan 2017 06:57:54 +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 E66BC14B8; Mon, 16 Jan 2017 06:57:53 +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 v0G6vrc5099969; Mon, 16 Jan 2017 06:57:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6vrIN099967; Mon, 16 Jan 2017 06:57:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160657.v0G6vrIN099967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:57: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: r312262 - in stable/11/usr.sbin/bsnmpd/modules: snmp_hostres snmp_mibII 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, 16 Jan 2017 06:57:54 -0000 Author: ngie Date: Mon Jan 16 06:57:52 2017 New Revision: 312262 URL: https://svnweb.freebsd.org/changeset/base/312262 Log: MFC r311740: Improve the smilint target in the hostres and mibII modules - Mark the smilint target .PHONY so it's always executed when requested - Leverage .PATH for BMIBS instead of spelling the path out longhand for them Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 16 06:56:12 2017 (r312261) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 16 06:57:52 2017 (r312262) @@ -76,6 +76,7 @@ LIBADD= kvm devinfo m geom memstat printcap.pico: printcap.c ${CC} ${PICFLAG} -DPIC ${CFLAGS:C/^-W.*//} -c ${.IMPSRC} -o ${.TARGET} -smilint: +smilint: .PHONY +smilint: ${BMIBS} env SMIPATH=.:/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership BEGEMOT-HOSTRES-MIB + smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Mon Jan 16 06:56:12 2017 (r312261) +++ stable/11/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Mon Jan 16 06:57:52 2017 (r312262) @@ -22,6 +22,7 @@ BMIBS= BEGEMOT-IP-MIB.txt BEGEMOT-MIB2-M .include -smilint: +smilint: .PHONY +smilint: ${BMIBS} env SMIPATH=/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership ${BMIBS:C/^/${CONTRIB}\/snmp_mibII\//} + smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} From owner-svn-src-all@freebsd.org Mon Jan 16 06:58:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B66BCB18C3; Mon, 16 Jan 2017 06:58: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 1E7F11640; Mon, 16 Jan 2017 06:58: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 v0G6wHxZ000131; Mon, 16 Jan 2017 06:58:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G6wHkY000129; Mon, 16 Jan 2017 06:58:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160658.v0G6wHkY000129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 06:58: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: r312263 - in stable/10/usr.sbin/bsnmpd/modules: snmp_hostres snmp_mibII 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, 16 Jan 2017 06:58:18 -0000 Author: ngie Date: Mon Jan 16 06:58:16 2017 New Revision: 312263 URL: https://svnweb.freebsd.org/changeset/base/312263 Log: MFC r311740: Improve the smilint target in the hostres and mibII modules - Mark the smilint target .PHONY so it's always executed when requested - Leverage .PATH for BMIBS instead of spelling the path out longhand for them Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 16 06:57:52 2017 (r312262) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Mon Jan 16 06:58:16 2017 (r312263) @@ -77,6 +77,7 @@ LDADD= -lkvm -ldevinfo -lm -lgeom -lmems printcap.So: printcap.c ${CC} ${PICFLAG} -DPIC ${CFLAGS:C/^-W.*//} -c ${.IMPSRC} -o ${.TARGET} -smilint: +smilint: .PHONY +smilint: ${BMIBS} env SMIPATH=.:/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership BEGEMOT-HOSTRES-MIB + smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Mon Jan 16 06:57:52 2017 (r312262) +++ stable/10/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Mon Jan 16 06:58:16 2017 (r312263) @@ -22,6 +22,7 @@ BMIBS= BEGEMOT-IP-MIB.txt BEGEMOT-MIB2-M .include -smilint: +smilint: .PHONY +smilint: ${BMIBS} env SMIPATH=/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership ${BMIBS:C/^/${CONTRIB}\/snmp_mibII\//} + smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} From owner-svn-src-all@freebsd.org Mon Jan 16 07:03:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8E16CB1B6F; Mon, 16 Jan 2017 07:03: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 C5C7A1B55; Mon, 16 Jan 2017 07:03: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 v0G73YY0004142; Mon, 16 Jan 2017 07:03:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G73XSk004137; Mon, 16 Jan 2017 07:03:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160703.v0G73XSk004137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:03: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: r312264 - stable/11/contrib/bsnmp/snmpd 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, 16 Jan 2017 07:03:35 -0000 Author: ngie Date: Mon Jan 16 07:03:33 2017 New Revision: 312264 URL: https://svnweb.freebsd.org/changeset/base/312264 Log: MFC r310655: Fix bsnmpd sending/receiving with multi-homed configurations or INADDR_ANY used as the listening address in snmpd_input(..) Stash the IPv4 address of the receiver via the recv(..) callback and use it in the send(..) callback for the transport by specifying IP_SENDSRCADDR for the control message type. Add sendmsg logic to the UDP transport's send(..) callback and use the respective send(..) callback for the transport instead of calling sendto in snmpd_input(..). Obtained from: Isilon OneFS (^/onefs/branches/BR_8_0_0_DEV@r507595) Modified: stable/11/contrib/bsnmp/snmpd/main.c stable/11/contrib/bsnmp/snmpd/snmpd.h stable/11/contrib/bsnmp/snmpd/trans_lsock.c stable/11/contrib/bsnmp/snmpd/trans_udp.c stable/11/contrib/bsnmp/snmpd/trans_udp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/main.c Mon Jan 16 06:58:16 2017 (r312263) +++ stable/11/contrib/bsnmp/snmpd/main.c Mon Jan 16 07:03:33 2017 (r312264) @@ -1040,10 +1040,8 @@ snmpd_input(struct port_input *pi, struc #ifdef USE_TCPWRAPPERS char client[16]; #endif - struct msghdr msg; - struct iovec iov[1]; - ret = tport->transport->vtab->recv(pi); + ret = tport->transport->vtab->recv(tport, pi); if (ret == -1) return (-1); @@ -1186,21 +1184,15 @@ snmpd_input(struct port_input *pi, struc sndbuf, &sndlen, "SNMP", ierr, vi, NULL); if (ferr == SNMPD_INPUT_OK) { - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_flags = 0; - iov[0].iov_base = sndbuf; - iov[0].iov_len = sndlen; - - slen = sendmsg(pi->fd, &msg, 0); + slen = tport->transport->vtab->send(tport, sndbuf, sndlen, + pi->peer, pi->peerlen); if (slen == -1) - syslog(LOG_ERR, "sendmsg: %m"); + syslog(LOG_ERR, "send*: %m"); else if ((size_t)slen != sndlen) - syslog(LOG_ERR, "sendmsg: short write %zu/%zu", - sndlen, (size_t)slen); + syslog(LOG_ERR, "send*: short write %zu/%zu", sndlen, + (size_t)slen); } + snmp_pdu_free(&pdu); free(sndbuf); snmp_input_consume(pi); Modified: stable/11/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- stable/11/contrib/bsnmp/snmpd/snmpd.h Mon Jan 16 06:58:16 2017 (r312263) +++ stable/11/contrib/bsnmp/snmpd/snmpd.h Mon Jan 16 07:03:33 2017 (r312264) @@ -193,7 +193,7 @@ struct transport_def { ssize_t (*send)(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); - ssize_t (*recv)(struct port_input *); + ssize_t (*recv)(struct tport *, struct port_input *); }; struct transport { struct asn_oid index; /* transport table index */ Modified: stable/11/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 16 06:58:16 2017 (r312263) +++ stable/11/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 16 07:03:33 2017 (r312264) @@ -59,7 +59,7 @@ static void lsock_close_port(struct tpor static int lsock_init_port(struct tport *); static ssize_t lsock_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); -static ssize_t lsock_recv(struct port_input *); +static ssize_t lsock_recv(struct tport *, struct port_input *); /* exported */ const struct transport_def lsock_trans = { @@ -439,7 +439,7 @@ check_priv_stream(struct port_input *pi) * Receive something */ static ssize_t -lsock_recv(struct port_input *pi) +lsock_recv(struct tport *tp __unused, struct port_input *pi) { struct msghdr msg; struct iovec iov[1]; Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 06:58:16 2017 (r312263) +++ stable/11/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 07:03:33 2017 (r312264) @@ -55,7 +55,7 @@ static void udp_close_port(struct tport static int udp_init_port(struct tport *); static ssize_t udp_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); -static ssize_t udp_recv(struct port_input *); +static ssize_t udp_recv(struct tport *, struct port_input *); /* exported */ const struct transport_def udp_trans = { @@ -217,8 +217,30 @@ udp_send(struct tport *tp, const u_char const struct sockaddr *addr, size_t addrlen) { struct udp_port *p = (struct udp_port *)tp; + struct cmsghdr *cmsg; + struct in_addr *src_addr; + struct msghdr msg; + char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; + struct iovec iov; - return (sendto(p->input.fd, buf, len, 0, addr, addrlen)); + iov.iov_base = __DECONST(void*, buf); + iov.iov_len = len; + + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_name = __DECONST(void *, addr); + msg.msg_namelen = addrlen; + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_IP; + cmsg->cmsg_type = IP_SENDSRCADDR; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + src_addr = (struct in_addr *)(void*)CMSG_DATA(cmsg); + memcpy(src_addr, &p->recv_addr, sizeof(struct in_addr)); + + return (sendmsg(p->input.fd, &msg, 0)); } static void @@ -309,8 +331,9 @@ recv_dgram(struct port_input *pi, struct * Receive something */ static ssize_t -udp_recv(struct port_input *pi) +udp_recv(struct tport *tp, struct port_input *pi) { + struct udp_port *p = (struct udp_port *)tp; struct in_addr *laddr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; @@ -330,6 +353,8 @@ udp_recv(struct port_input *pi) ret = recv_dgram(pi, laddr); + memcpy(&p->recv_addr, laddr, sizeof(struct in_addr)); + if (laddr->s_addr == INADDR_ANY) { msg.msg_control = NULL; msg.msg_controllen = 0; Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.h ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_udp.h Mon Jan 16 06:58:16 2017 (r312263) +++ stable/11/contrib/bsnmp/snmpd/trans_udp.h Mon Jan 16 07:03:33 2017 (r312264) @@ -39,6 +39,7 @@ struct udp_port { struct port_input input; /* common input stuff */ struct sockaddr_in ret; /* the return address */ + struct in_addr recv_addr; /* the address the request was sent to */ }; /* argument for open call */ From owner-svn-src-all@freebsd.org Mon Jan 16 07:04:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7A10CB1C07; Mon, 16 Jan 2017 07:04: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 847F91CE0; Mon, 16 Jan 2017 07:04: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 v0G748rf004212; Mon, 16 Jan 2017 07:04:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G748xd004207; Mon, 16 Jan 2017 07:04:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160704.v0G748xd004207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:04: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: r312265 - stable/10/contrib/bsnmp/snmpd 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, 16 Jan 2017 07:04:09 -0000 Author: ngie Date: Mon Jan 16 07:04:08 2017 New Revision: 312265 URL: https://svnweb.freebsd.org/changeset/base/312265 Log: MFC r310655: Fix bsnmpd sending/receiving with multi-homed configurations or INADDR_ANY used as the listening address in snmpd_input(..) Stash the IPv4 address of the receiver via the recv(..) callback and use it in the send(..) callback for the transport by specifying IP_SENDSRCADDR for the control message type. Add sendmsg logic to the UDP transport's send(..) callback and use the respective send(..) callback for the transport instead of calling sendto in snmpd_input(..). Obtained from: Isilon OneFS (^/onefs/branches/BR_8_0_0_DEV@r507595) Modified: stable/10/contrib/bsnmp/snmpd/main.c stable/10/contrib/bsnmp/snmpd/snmpd.h stable/10/contrib/bsnmp/snmpd/trans_lsock.c stable/10/contrib/bsnmp/snmpd/trans_udp.c stable/10/contrib/bsnmp/snmpd/trans_udp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/main.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/main.c Mon Jan 16 07:03:33 2017 (r312264) +++ stable/10/contrib/bsnmp/snmpd/main.c Mon Jan 16 07:04:08 2017 (r312265) @@ -1040,10 +1040,8 @@ snmpd_input(struct port_input *pi, struc #ifdef USE_TCPWRAPPERS char client[16]; #endif - struct msghdr msg; - struct iovec iov[1]; - ret = tport->transport->vtab->recv(pi); + ret = tport->transport->vtab->recv(tport, pi); if (ret == -1) return (-1); @@ -1186,21 +1184,15 @@ snmpd_input(struct port_input *pi, struc sndbuf, &sndlen, "SNMP", ierr, vi, NULL); if (ferr == SNMPD_INPUT_OK) { - msg.msg_name = pi->peer; - msg.msg_namelen = pi->peerlen; - msg.msg_iov = iov; - msg.msg_iovlen = 1; - msg.msg_flags = 0; - iov[0].iov_base = sndbuf; - iov[0].iov_len = sndlen; - - slen = sendmsg(pi->fd, &msg, 0); + slen = tport->transport->vtab->send(tport, sndbuf, sndlen, + pi->peer, pi->peerlen); if (slen == -1) - syslog(LOG_ERR, "sendmsg: %m"); + syslog(LOG_ERR, "send*: %m"); else if ((size_t)slen != sndlen) - syslog(LOG_ERR, "sendmsg: short write %zu/%zu", - sndlen, (size_t)slen); + syslog(LOG_ERR, "send*: short write %zu/%zu", sndlen, + (size_t)slen); } + snmp_pdu_free(&pdu); free(sndbuf); snmp_input_consume(pi); Modified: stable/10/contrib/bsnmp/snmpd/snmpd.h ============================================================================== --- stable/10/contrib/bsnmp/snmpd/snmpd.h Mon Jan 16 07:03:33 2017 (r312264) +++ stable/10/contrib/bsnmp/snmpd/snmpd.h Mon Jan 16 07:04:08 2017 (r312265) @@ -193,7 +193,7 @@ struct transport_def { ssize_t (*send)(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); - ssize_t (*recv)(struct port_input *); + ssize_t (*recv)(struct tport *, struct port_input *); }; struct transport { struct asn_oid index; /* transport table index */ Modified: stable/10/contrib/bsnmp/snmpd/trans_lsock.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 16 07:03:33 2017 (r312264) +++ stable/10/contrib/bsnmp/snmpd/trans_lsock.c Mon Jan 16 07:04:08 2017 (r312265) @@ -59,7 +59,7 @@ static void lsock_close_port(struct tpor static int lsock_init_port(struct tport *); static ssize_t lsock_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); -static ssize_t lsock_recv(struct port_input *); +static ssize_t lsock_recv(struct tport *, struct port_input *); /* exported */ const struct transport_def lsock_trans = { @@ -439,7 +439,7 @@ check_priv_stream(struct port_input *pi) * Receive something */ static ssize_t -lsock_recv(struct port_input *pi) +lsock_recv(struct tport *tp __unused, struct port_input *pi) { struct msghdr msg; struct iovec iov[1]; Modified: stable/10/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 07:03:33 2017 (r312264) +++ stable/10/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 07:04:08 2017 (r312265) @@ -55,7 +55,7 @@ static void udp_close_port(struct tport static int udp_init_port(struct tport *); static ssize_t udp_send(struct tport *, const u_char *, size_t, const struct sockaddr *, size_t); -static ssize_t udp_recv(struct port_input *); +static ssize_t udp_recv(struct tport *, struct port_input *); /* exported */ const struct transport_def udp_trans = { @@ -217,8 +217,30 @@ udp_send(struct tport *tp, const u_char const struct sockaddr *addr, size_t addrlen) { struct udp_port *p = (struct udp_port *)tp; + struct cmsghdr *cmsg; + struct in_addr *src_addr; + struct msghdr msg; + char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; + struct iovec iov; - return (sendto(p->input.fd, buf, len, 0, addr, addrlen)); + iov.iov_base = __DECONST(void*, buf); + iov.iov_len = len; + + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_name = __DECONST(void *, addr); + msg.msg_namelen = addrlen; + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_IP; + cmsg->cmsg_type = IP_SENDSRCADDR; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + src_addr = (struct in_addr *)(void*)CMSG_DATA(cmsg); + memcpy(src_addr, &p->recv_addr, sizeof(struct in_addr)); + + return (sendmsg(p->input.fd, &msg, 0)); } static void @@ -309,8 +331,9 @@ recv_dgram(struct port_input *pi, struct * Receive something */ static ssize_t -udp_recv(struct port_input *pi) +udp_recv(struct tport *tp, struct port_input *pi) { + struct udp_port *p = (struct udp_port *)tp; struct in_addr *laddr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; @@ -330,6 +353,8 @@ udp_recv(struct port_input *pi) ret = recv_dgram(pi, laddr); + memcpy(&p->recv_addr, laddr, sizeof(struct in_addr)); + if (laddr->s_addr == INADDR_ANY) { msg.msg_control = NULL; msg.msg_controllen = 0; Modified: stable/10/contrib/bsnmp/snmpd/trans_udp.h ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_udp.h Mon Jan 16 07:03:33 2017 (r312264) +++ stable/10/contrib/bsnmp/snmpd/trans_udp.h Mon Jan 16 07:04:08 2017 (r312265) @@ -39,6 +39,7 @@ struct udp_port { struct port_input input; /* common input stuff */ struct sockaddr_in ret; /* the return address */ + struct in_addr recv_addr; /* the address the request was sent to */ }; /* argument for open call */ From owner-svn-src-all@freebsd.org Mon Jan 16 07:07:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 981E8CB1CFD; Mon, 16 Jan 2017 07:07:46 +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 673C11E91; Mon, 16 Jan 2017 07:07:46 +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 v0G77je3004484; Mon, 16 Jan 2017 07:07:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G77jpj004483; Mon, 16 Jan 2017 07:07:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160707.v0G77jpj004483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:07: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: r312266 - stable/10/contrib/bsnmp/snmpd 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, 16 Jan 2017 07:07:46 -0000 Author: ngie Date: Mon Jan 16 07:07:45 2017 New Revision: 312266 URL: https://svnweb.freebsd.org/changeset/base/312266 Log: MFC r310656,r311221: r310656: style(9): sort alignment in udp_recv(..) r311221: Initialize msg.msg_flags to 0 This mutes a valid coverity warning about it being uninitialized when passed in to sendmsg(2). CID: 1368202 Modified: stable/10/contrib/bsnmp/snmpd/trans_udp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 07:04:08 2017 (r312265) +++ stable/10/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 07:07:45 2017 (r312266) @@ -226,6 +226,7 @@ udp_send(struct tport *tp, const u_char iov.iov_base = __DECONST(void*, buf); iov.iov_len = len; + msg.msg_flags = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_name = __DECONST(void *, addr); @@ -334,10 +335,10 @@ static ssize_t udp_recv(struct tport *tp, struct port_input *pi) { struct udp_port *p = (struct udp_port *)tp; + struct cmsghdr *cmsgp; struct in_addr *laddr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - struct cmsghdr *cmsgp; ssize_t ret; memset(cbuf, 0, sizeof(cbuf)); From owner-svn-src-all@freebsd.org Mon Jan 16 07:08:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8FC6CB1D89; Mon, 16 Jan 2017 07:08: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 A63211011; Mon, 16 Jan 2017 07:08: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 v0G786Sj004549; Mon, 16 Jan 2017 07:08:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G786Io004548; Mon, 16 Jan 2017 07:08:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160708.v0G786Io004548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:08: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: r312267 - stable/11/contrib/bsnmp/snmpd 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, 16 Jan 2017 07:08:08 -0000 Author: ngie Date: Mon Jan 16 07:08:06 2017 New Revision: 312267 URL: https://svnweb.freebsd.org/changeset/base/312267 Log: MFC r310656,r311221: r310656: style(9): sort alignment in udp_recv(..) r311221: Initialize msg.msg_flags to 0 This mutes a valid coverity warning about it being uninitialized when passed in to sendmsg(2). CID: 1368202 Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 07:07:45 2017 (r312266) +++ stable/11/contrib/bsnmp/snmpd/trans_udp.c Mon Jan 16 07:08:06 2017 (r312267) @@ -226,6 +226,7 @@ udp_send(struct tport *tp, const u_char iov.iov_base = __DECONST(void*, buf); iov.iov_len = len; + msg.msg_flags = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_name = __DECONST(void *, addr); @@ -334,10 +335,10 @@ static ssize_t udp_recv(struct tport *tp, struct port_input *pi) { struct udp_port *p = (struct udp_port *)tp; + struct cmsghdr *cmsgp; struct in_addr *laddr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - struct cmsghdr *cmsgp; ssize_t ret; memset(cbuf, 0, sizeof(cbuf)); From owner-svn-src-all@freebsd.org Mon Jan 16 07:10:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0FC1CB1E6C; Mon, 16 Jan 2017 07:10:43 +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 8D80C1237; Mon, 16 Jan 2017 07:10:43 +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 v0G7Agvj004734; Mon, 16 Jan 2017 07:10:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7Ag5i004730; Mon, 16 Jan 2017 07:10:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160710.v0G7Ag5i004730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:10:42 +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: r312268 - in stable/11: . secure/lib/libssh secure/usr.bin/ssh secure/usr.sbin/sshd 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, 16 Jan 2017 07:10:43 -0000 Author: ngie Date: Mon Jan 16 07:10:42 2017 New Revision: 312268 URL: https://svnweb.freebsd.org/changeset/base/312268 Log: MFC r311140: Only bake krb5_config.h support in to ssh(3), etc if both MK_GSSAPI and MK_KERBEROS_SUPPORT != no This fixes the odd case where someone specified MK_GSSAPI=no and MK_KERBEROS_SUPPORT=yes (which admittedly, probably doesn't make sense, but the build system doesn't prevent this case today, and it didn't when I filed the bug back in 2011 either). PR: 159745 Modified: stable/11/Makefile.inc1 stable/11/secure/lib/libssh/Makefile stable/11/secure/usr.bin/ssh/Makefile stable/11/secure/usr.sbin/sshd/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Mon Jan 16 07:08:06 2017 (r312267) +++ stable/11/Makefile.inc1 Mon Jan 16 07:10:42 2017 (r312268) @@ -2099,7 +2099,7 @@ secure/lib/libssh__L: lib/libz__L secure .if ${MK_LDNS} != "no" secure/lib/libssh__L: lib/libldns__L .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \ kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \ lib/libmd__L kerberos5/lib/libroken__L Modified: stable/11/secure/lib/libssh/Makefile ============================================================================== --- stable/11/secure/lib/libssh/Makefile Mon Jan 16 07:08:06 2017 (r312267) +++ stable/11/secure/lib/libssh/Makefile Mon Jan 16 07:10:42 2017 (r312268) @@ -46,7 +46,7 @@ LIBADD+= ldns CFLAGS+= -I${SSHDIR} -include ssh_namespace.h SRCS+= ssh_namespace.h -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h .endif Modified: stable/11/secure/usr.bin/ssh/Makefile ============================================================================== --- stable/11/secure/usr.bin/ssh/Makefile Mon Jan 16 07:08:06 2017 (r312267) +++ stable/11/secure/usr.bin/ssh/Makefile Mon Jan 16 07:10:42 2017 (r312268) @@ -23,7 +23,7 @@ LIBADD= ssh CFLAGS+= -DHAVE_LDNS=1 .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h LIBADD+= gssapi Modified: stable/11/secure/usr.sbin/sshd/Makefile ============================================================================== --- stable/11/secure/usr.sbin/sshd/Makefile Mon Jan 16 07:08:06 2017 (r312267) +++ stable/11/secure/usr.sbin/sshd/Makefile Mon Jan 16 07:10:42 2017 (r312268) @@ -47,7 +47,7 @@ LIBADD+= blacklist LDFLAGS+=-L${LIBBLACKLISTDIR} .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h LIBADD+= gssapi_krb5 gssapi krb5 From owner-svn-src-all@freebsd.org Mon Jan 16 07:10:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E716CB1E9F; Mon, 16 Jan 2017 07:10:47 +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 4FDF1125E; Mon, 16 Jan 2017 07:10:47 +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 v0G7AkY5004799; Mon, 16 Jan 2017 07:10:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7AkpA004795; Mon, 16 Jan 2017 07:10:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160710.v0G7AkpA004795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:10: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: r312269 - in stable/10: . secure/lib/libssh secure/usr.bin/ssh secure/usr.sbin/sshd 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, 16 Jan 2017 07:10:47 -0000 Author: ngie Date: Mon Jan 16 07:10:45 2017 New Revision: 312269 URL: https://svnweb.freebsd.org/changeset/base/312269 Log: MFC r311140: Only bake krb5_config.h support in to ssh(3), etc if both MK_GSSAPI and MK_KERBEROS_SUPPORT != no This fixes the odd case where someone specified MK_GSSAPI=no and MK_KERBEROS_SUPPORT=yes (which admittedly, probably doesn't make sense, but the build system doesn't prevent this case today, and it didn't when I filed the bug back in 2011 either). PR: 159745 Modified: stable/10/Makefile.inc1 stable/10/secure/lib/libssh/Makefile stable/10/secure/usr.bin/ssh/Makefile stable/10/secure/usr.sbin/sshd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Mon Jan 16 07:10:42 2017 (r312268) +++ stable/10/Makefile.inc1 Mon Jan 16 07:10:45 2017 (r312269) @@ -1770,7 +1770,7 @@ secure/lib/libssh__L: lib/libz__L secure .if ${MK_LDNS} != "no" secure/lib/libssh__L: lib/libldns__L .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \ kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \ lib/libmd__L kerberos5/lib/libroken__L Modified: stable/10/secure/lib/libssh/Makefile ============================================================================== --- stable/10/secure/lib/libssh/Makefile Mon Jan 16 07:10:42 2017 (r312268) +++ stable/10/secure/lib/libssh/Makefile Mon Jan 16 07:10:45 2017 (r312269) @@ -47,7 +47,7 @@ USEPRIVATELIB+= ldns CFLAGS+= -I${SSHDIR} -include ssh_namespace.h SRCS+= ssh_namespace.h -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h DPADD+= ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBCOM_ERR} ${LIBMD} ${LIBROKEN} Modified: stable/10/secure/usr.bin/ssh/Makefile ============================================================================== --- stable/10/secure/usr.bin/ssh/Makefile Mon Jan 16 07:10:42 2017 (r312268) +++ stable/10/secure/usr.bin/ssh/Makefile Mon Jan 16 07:10:45 2017 (r312269) @@ -27,7 +27,7 @@ LDADD+= -lldns USEPRIVATELIB+= ldns .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h DPADD+= ${LIBGSSAPI} Modified: stable/10/secure/usr.sbin/sshd/Makefile ============================================================================== --- stable/10/secure/usr.sbin/sshd/Makefile Mon Jan 16 07:10:42 2017 (r312268) +++ stable/10/secure/usr.sbin/sshd/Makefile Mon Jan 16 07:10:45 2017 (r312269) @@ -42,7 +42,7 @@ DPADD+= ${LIBBSM} LDADD+= -lbsm .endif -.if ${MK_KERBEROS_SUPPORT} != "no" +.if ${MK_GSSAPI} != "no" && ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h DPADD+= ${LIBGSSAPI_KRB5} ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBASN1} \ From owner-svn-src-all@freebsd.org Mon Jan 16 07:11:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AB08CB1F65; Mon, 16 Jan 2017 07:11:38 +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 5CF63174E; Mon, 16 Jan 2017 07:11:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0G7Bb7G005674; Mon, 16 Jan 2017 07:11:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7Bbj3005673; Mon, 16 Jan 2017 07:11:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160711.v0G7Bbj3005673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:11: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: r312270 - stable/10/usr.sbin/fstyp/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: Mon, 16 Jan 2017 07:11:38 -0000 Author: ngie Date: Mon Jan 16 07:11:37 2017 New Revision: 312270 URL: https://svnweb.freebsd.org/changeset/base/312270 Log: MFC r312009: Add license preamble for r286964; credit to asomers While here, clean up trailing whitespace Modified: stable/10/usr.sbin/fstyp/tests/fstyp_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/fstyp/tests/fstyp_test.sh ============================================================================== --- stable/10/usr.sbin/fstyp/tests/fstyp_test.sh Mon Jan 16 07:10:45 2017 (r312269) +++ stable/10/usr.sbin/fstyp/tests/fstyp_test.sh Mon Jan 16 07:11:37 2017 (r312270) @@ -1,3 +1,29 @@ +#!/bin/sh +# +# Copyright (c) 2015 Alan Somers +# 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$ atf_test_case cd9660 @@ -9,7 +35,7 @@ cd9660_body() { atf_check -s exit:0 -o ignore makefs -t cd9660 -Z -s 64m cd9660.img dir atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img atf_check -s exit:0 -o inline:"cd9660\n" fstyp -l cd9660.img -} +} atf_test_case cd9660_label cd9660_label_head() { @@ -21,7 +47,7 @@ cd9660_label_body() { atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img # Note: cd9660 labels are always upper case atf_check -s exit:0 -o inline:"cd9660 FOO\n" fstyp -l cd9660.img -} +} atf_test_case dir dir_head() { @@ -177,7 +203,7 @@ ufs2_label_body() { atf_check -s exit:0 mkdir dir atf_check -s exit:0 -o ignore makefs -o version=2,label="foo" -Z -s 64m ufs.img dir atf_check -s exit:0 -o inline:"ufs foo\n" fstyp -l ufs.img -} +} atf_test_case ufs_on_device cleanup ufs_on_device_head() { From owner-svn-src-all@freebsd.org Mon Jan 16 07:11:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA4FCB1FCE; Mon, 16 Jan 2017 07:11:48 +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 689DC1819; Mon, 16 Jan 2017 07:11:48 +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 v0G7Blsd005724; Mon, 16 Jan 2017 07:11:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7Bli4005723; Mon, 16 Jan 2017 07:11:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160711.v0G7Bli4005723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:11: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: r312271 - stable/11/usr.sbin/fstyp/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: Mon, 16 Jan 2017 07:11:48 -0000 Author: ngie Date: Mon Jan 16 07:11:47 2017 New Revision: 312271 URL: https://svnweb.freebsd.org/changeset/base/312271 Log: MFC r312009: Add license preamble for r286964; credit to asomers While here, clean up trailing whitespace Modified: stable/11/usr.sbin/fstyp/tests/fstyp_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/fstyp/tests/fstyp_test.sh ============================================================================== --- stable/11/usr.sbin/fstyp/tests/fstyp_test.sh Mon Jan 16 07:11:37 2017 (r312270) +++ stable/11/usr.sbin/fstyp/tests/fstyp_test.sh Mon Jan 16 07:11:47 2017 (r312271) @@ -1,3 +1,29 @@ +#!/bin/sh +# +# Copyright (c) 2015 Alan Somers +# 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$ atf_test_case cd9660 @@ -9,7 +35,7 @@ cd9660_body() { atf_check -s exit:0 -o ignore makefs -t cd9660 -Z -s 64m cd9660.img dir atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img atf_check -s exit:0 -o inline:"cd9660\n" fstyp -l cd9660.img -} +} atf_test_case cd9660_label cd9660_label_head() { @@ -21,7 +47,7 @@ cd9660_label_body() { atf_check -s exit:0 -o inline:"cd9660\n" fstyp cd9660.img # Note: cd9660 labels are always upper case atf_check -s exit:0 -o inline:"cd9660 FOO\n" fstyp -l cd9660.img -} +} atf_test_case dir dir_head() { @@ -177,7 +203,7 @@ ufs2_label_body() { atf_check -s exit:0 mkdir dir atf_check -s exit:0 -o ignore makefs -o version=2,label="foo" -Z -s 64m ufs.img dir atf_check -s exit:0 -o inline:"ufs foo\n" fstyp -l ufs.img -} +} atf_test_case ufs_on_device cleanup ufs_on_device_head() { From owner-svn-src-all@freebsd.org Mon Jan 16 07:15:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FD27CB215D; Mon, 16 Jan 2017 07:15: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 E30ED1AE6; Mon, 16 Jan 2017 07:15:15 +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 v0G7FFGG008852; Mon, 16 Jan 2017 07:15:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7FFLd008851; Mon, 16 Jan 2017 07:15:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160715.v0G7FFLd008851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:15: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: r312272 - stable/11/share/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: Mon, 16 Jan 2017 07:15:16 -0000 Author: ngie Date: Mon Jan 16 07:15:14 2017 New Revision: 312272 URL: https://svnweb.freebsd.org/changeset/base/312272 Log: MFC r311133: Move the "MK_* options..." section before the "... MK_*_SUPPORT..." section For the case that someone set WITHOUT_GSSAPI=, now WITHOUT_KERBEROS_SUPPORT will be properly set. This will likely fix the issue for the default case noted in the PR I filed back in 2011. I am trying to fix the less obvious case documented in the PR still. PR: 159745 Modified: stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Mon Jan 16 07:11:47 2017 (r312271) +++ stable/11/share/mk/src.opts.mk Mon Jan 16 07:15:14 2017 (r312272) @@ -375,6 +375,21 @@ MK_CLANG_FULL:= no .endif # +# MK_* options whose default value depends on another option. +# +.for vv in \ + GSSAPI/KERBEROS \ + MAN_UTILS/MAN +.if defined(WITH_${vv:H}) +MK_${vv:H}:= yes +.elif defined(WITHOUT_${vv:H}) +MK_${vv:H}:= no +.else +MK_${vv:H}:= ${MK_${vv:T}} +.endif +.endfor + +# # Set defaults for the MK_*_SUPPORT variables. # @@ -401,21 +416,6 @@ MK_${var}_SUPPORT:= yes .endif .endfor -# -# MK_* options whose default value depends on another option. -# -.for vv in \ - GSSAPI/KERBEROS \ - MAN_UTILS/MAN -.if defined(WITH_${vv:H}) -MK_${vv:H}:= yes -.elif defined(WITHOUT_${vv:H}) -MK_${vv:H}:= no -.else -MK_${vv:H}:= ${MK_${vv:T}} -.endif -.endfor - .if !${COMPILER_FEATURES:Mc++11} MK_LLDB:= no .endif From owner-svn-src-all@freebsd.org Mon Jan 16 07:17:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 847D7CB21E7; Mon, 16 Jan 2017 07:17:44 +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 53A481C78; Mon, 16 Jan 2017 07:17:44 +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 v0G7Hh5T008979; Mon, 16 Jan 2017 07:17:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G7HhiQ008978; Mon, 16 Jan 2017 07:17:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701160717.v0G7HhiQ008978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 07:17:43 +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: r312273 - stable/10/share/mk 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, 16 Jan 2017 07:17:44 -0000 Author: ngie Date: Mon Jan 16 07:17:43 2017 New Revision: 312273 URL: https://svnweb.freebsd.org/changeset/base/312273 Log: MFC r312009: Add license preamble for r286964; credit to asomers While here, clean up trailing whitespace Modified: stable/10/share/mk/bsd.own.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.own.mk ============================================================================== --- stable/10/share/mk/bsd.own.mk Mon Jan 16 07:15:14 2017 (r312272) +++ stable/10/share/mk/bsd.own.mk Mon Jan 16 07:17:43 2017 (r312273) @@ -602,6 +602,24 @@ MK_TESTS:= no # # +# MK_* options whose default value depends on another option. +# +.for vv in \ + GSSAPI/KERBEROS \ + MAN_UTILS/MAN +.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) +.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. +.endif +.if defined(WITH_${vv:H}) +MK_${vv:H}:= yes +.elif defined(WITHOUT_${vv:H}) +MK_${vv:H}:= no +.else +MK_${vv:H}:= ${MK_${vv:T}} +.endif +.endfor + +# # MK_*_SUPPORT options which default to "yes" unless their corresponding # MK_* variable is set to "no". # @@ -627,24 +645,6 @@ MK_${var}_SUPPORT:= yes .endfor # -# MK_* options whose default value depends on another option. -# -.for vv in \ - GSSAPI/KERBEROS \ - MAN_UTILS/MAN -.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) -.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. -.endif -.if defined(WITH_${vv:H}) -MK_${vv:H}:= yes -.elif defined(WITHOUT_${vv:H}) -MK_${vv:H}:= no -.else -MK_${vv:H}:= ${MK_${vv:T}} -.endif -.endfor - -# # MK_* options that default to "yes" if the compiler is a C++11 compiler. # .include From owner-svn-src-all@freebsd.org Mon Jan 16 08:25:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A8C6CB112D; Mon, 16 Jan 2017 08:25:35 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 175BC1E4B; Mon, 16 Jan 2017 08:25:35 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0G8PYKb036830; Mon, 16 Jan 2017 08:25:34 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G8PYL4036827; Mon, 16 Jan 2017 08:25:34 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201701160825.v0G8PYL4036827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Mon, 16 Jan 2017 08:25:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312277 - in head/sys: kern 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: Mon, 16 Jan 2017 08:25:35 -0000 Author: hiren Date: Mon Jan 16 08:25:33 2017 New Revision: 312277 URL: https://svnweb.freebsd.org/changeset/base/312277 Log: Add kevent EVFILT_EMPTY for notification when a client has received all data i.e. everything outstanding has been acked. Reviewed by: bz, gnn (previous version) MFC after: 3 days Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D9150 Modified: head/sys/kern/kern_event.c head/sys/kern/uipc_socket.c head/sys/sys/event.h Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Mon Jan 16 07:41:39 2017 (r312276) +++ head/sys/kern/kern_event.c Mon Jan 16 08:25:33 2017 (r312277) @@ -344,6 +344,7 @@ static struct { { &null_filtops }, /* EVFILT_LIO */ { &user_filtops, 1 }, /* EVFILT_USER */ { &null_filtops }, /* EVFILT_SENDFILE */ + { &file_filtops, 1 }, /* EVFILT_EMPTY */ }; /* Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Jan 16 07:41:39 2017 (r312276) +++ head/sys/kern/uipc_socket.c Mon Jan 16 08:25:33 2017 (r312277) @@ -161,6 +161,7 @@ static void filt_sowdetach(struct knote static int filt_sowrite(struct knote *kn, long hint); static int filt_solisten(struct knote *kn, long hint); static int inline hhook_run_socket(struct socket *so, void *hctx, int32_t h_id); +static int filt_soempty(struct knote *kn, long hint); fo_kqfilter_t soo_kqfilter; static struct filterops solisten_filtops = { @@ -178,6 +179,11 @@ static struct filterops sowrite_filtops .f_detach = filt_sowdetach, .f_event = filt_sowrite, }; +static struct filterops soempty_filtops = { + .f_isfd = 1, + .f_detach = filt_sowdetach, + .f_event = filt_soempty, +}; so_gen_t so_gencnt; /* generation count for sockets */ @@ -3083,6 +3089,10 @@ soo_kqfilter(struct file *fp, struct kno kn->kn_fop = &sowrite_filtops; sb = &so->so_snd; break; + case EVFILT_EMPTY: + kn->kn_fop = &soempty_filtops; + sb = &so->so_snd; + break; default: return (EINVAL); } @@ -3344,6 +3354,21 @@ filt_sowrite(struct knote *kn, long hint return (kn->kn_data >= so->so_snd.sb_lowat); } +static int +filt_soempty(struct knote *kn, long hint) +{ + struct socket *so; + + so = kn->kn_fp->f_data; + SOCKBUF_LOCK_ASSERT(&so->so_snd); + kn->kn_data = sbused(&so->so_snd); + + if (kn->kn_data == 0) + return (1); + else + return (0); +} + /*ARGSUSED*/ static int filt_solisten(struct knote *kn, long hint) Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Mon Jan 16 07:41:39 2017 (r312276) +++ head/sys/sys/event.h Mon Jan 16 08:25:33 2017 (r312277) @@ -43,7 +43,8 @@ #define EVFILT_LIO (-10) /* attached to lio requests */ #define EVFILT_USER (-11) /* User events */ #define EVFILT_SENDFILE (-12) /* attached to sendfile requests */ -#define EVFILT_SYSCOUNT 12 +#define EVFILT_EMPTY (-13) /* empty send socket buf */ +#define EVFILT_SYSCOUNT 13 #define EV_SET(kevp_, a, b, c, d, e, f) do { \ struct kevent *kevp = (kevp_); \ From owner-svn-src-all@freebsd.org Mon Jan 16 09:12:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02C8FCB253C; Mon, 16 Jan 2017 09:12:42 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C588E15E8; Mon, 16 Jan 2017 09:12:41 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0G9CeHN057115; Mon, 16 Jan 2017 09:12:40 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G9Cexp057114; Mon, 16 Jan 2017 09:12:40 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201701160912.v0G9Cexp057114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 16 Jan 2017 09:12: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: r312278 - stable/10/usr.bin/netstat 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, 16 Jan 2017 09:12:42 -0000 Author: smh Date: Mon Jan 16 09:12:40 2017 New Revision: 312278 URL: https://svnweb.freebsd.org/changeset/base/312278 Log: MFC r311769: Fix rstat: symbol not in namelist from netstat Sponsored by: Multiplay Modified: stable/10/usr.bin/netstat/main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/netstat/main.c ============================================================================== --- stable/10/usr.bin/netstat/main.c Mon Jan 16 08:25:33 2017 (r312277) +++ stable/10/usr.bin/netstat/main.c Mon Jan 16 09:12:40 2017 (r312278) @@ -535,6 +535,9 @@ main(int argc, char *argv[]) if (xflag && Tflag) errx(1, "-x and -T are incompatible, pick one."); + /* Load all necessary kvm symbols */ + kresolve_list(nl); + if (Bflag) { if (!live) usage(); @@ -603,9 +606,6 @@ main(int argc, char *argv[]) exit(0); } - /* Load all necessary kvm symbols */ - kresolve_list(nl); - if (tp) { printproto(tp, tp->pr_name); exit(0); From owner-svn-src-all@freebsd.org Mon Jan 16 09:16:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8878CB25DB; Mon, 16 Jan 2017 09:16:12 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97CE41797; Mon, 16 Jan 2017 09:16:12 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0G9GBXB057289; Mon, 16 Jan 2017 09:16:11 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0G9GB94057288; Mon, 16 Jan 2017 09:16:11 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201701160916.v0G9GB94057288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 16 Jan 2017 09:16: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: r312279 - stable/11/usr.bin/netstat 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, 16 Jan 2017 09:16:12 -0000 Author: smh Date: Mon Jan 16 09:16:11 2017 New Revision: 312279 URL: https://svnweb.freebsd.org/changeset/base/312279 Log: MFC r311769: Fix rstat: symbol not in namelist from netstat Sponsored by: Multiplay Modified: stable/11/usr.bin/netstat/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/netstat/main.c ============================================================================== --- stable/11/usr.bin/netstat/main.c Mon Jan 16 09:12:40 2017 (r312278) +++ stable/11/usr.bin/netstat/main.c Mon Jan 16 09:16:11 2017 (r312279) @@ -427,6 +427,9 @@ main(int argc, char *argv[]) if (xflag && Tflag) xo_errx(1, "-x and -T are incompatible, pick one."); + /* Load all necessary kvm symbols */ + kresolve_list(nl); + if (Bflag) { if (!live) usage(); @@ -507,9 +510,6 @@ main(int argc, char *argv[]) exit(0); } - /* Load all necessary kvm symbols */ - kresolve_list(nl); - if (tp) { xo_open_container("statistics"); printproto(tp, tp->pr_name, &first); From owner-svn-src-all@freebsd.org Mon Jan 16 09:39:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8977CB2E5B; Mon, 16 Jan 2017 09:39:46 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qt0-x22e.google.com (mail-qt0-x22e.google.com [IPv6:2607:f8b0:400d:c0d::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 983B713CA; Mon, 16 Jan 2017 09:39:46 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by mail-qt0-x22e.google.com with SMTP id x49so98972684qtc.2; Mon, 16 Jan 2017 01:39:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cfm56PFUNAM12mnRTmJQmQ9/89bvI9IjDXdyh5su2Ok=; b=ITFPfpCwSPzBe5iZ5dQpfMORzIKWOruK2vA0KAj6OAykgdcDSa6M7gexFf9a9goxaj m9CzV2fRpgQiqzJ59GnRFlhPdcvqOAVYraDhek/zZRfAUhC50/u0VDPI/yQRnLtZ9Yve YZUA9vl81dgc9qhHrtsAExUOaRb6t7erlWoOQcP6/oZ8LB4GcN2CodoTd+YLP0e4nj3i cYoeoGOcnZ07Gza5hKEVwUp07xX5mWMFSbWwQFDZ8Pinwa6+d/EVC221XXURS3Cpk/uG EB+23UgbxQlHsVrM0y4SmULAM1U9dGIEN/RE7NutE7ZzT7SXE/5T58MLIRrPDQkP7O7k UvMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cfm56PFUNAM12mnRTmJQmQ9/89bvI9IjDXdyh5su2Ok=; b=ZSyct13DgUbYBzTytqEnKw/dsLtVSnz69XXcjOsmUmgKN6xP+oip/IPrhGhWwBKMCH wqPXrWv9/hfZYgOlhQUU7Rf2AI2jMiT9Ar4sbN8g5/do3+SESmOG+FPkwOJSOOg7mHIM yKVB/4MdYGZnFxVcKp9psX4q9Dpn9ewwd43zi2stv31Wjdz1O9O9WTieV44apyYTMx0b v4EVxXT2Y6iVjqjoaX3xIZ1mPAmNKwWzKOACfgrx20E6hjH8QaSUx2qskpLEnxJyKddi eS9qeHFsutcuzRAY8gAHhQ8PmC2QdWNTjEi57LtY3fZejOD+TBP0/XZAz5XNg0cAMv9+ aKbQ== X-Gm-Message-State: AIkVDXJIngGeU7Ow2gubRIm37/rgcV06NtY8wZLjkEv9TfY5r0KGMAaA5CfXGj9tYiBV+TCJiXCNMCDNwhGapQ== X-Received: by 10.200.37.85 with SMTP id 21mr31305509qtn.238.1484559585654; Mon, 16 Jan 2017 01:39:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.150.188 with HTTP; Mon, 16 Jan 2017 01:39:45 -0800 (PST) In-Reply-To: <201701160825.v0G8PYL4036827@repo.freebsd.org> References: <201701160825.v0G8PYL4036827@repo.freebsd.org> From: Sergey Kandaurov Date: Mon, 16 Jan 2017 12:39:45 +0300 Message-ID: Subject: Re: svn commit: r312277 - in head/sys: kern sys To: Hiren Panchasara 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, 16 Jan 2017 09:39:46 -0000 On 16 January 2017 at 11:25, Hiren Panchasara wrote: > Author: hiren > Date: Mon Jan 16 08:25:33 2017 > New Revision: 312277 > URL: https://svnweb.freebsd.org/changeset/base/312277 > > Log: > Add kevent EVFILT_EMPTY for notification when a client has received all > data > i.e. everything outstanding has been acked. > > Reviewed by: bz, gnn (previous version) > MFC after: 3 days > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D9150 > > Modified: > head/sys/kern/kern_event.c > head/sys/kern/uipc_socket.c > head/sys/sys/event.h > > Hello. Is kqueue(2) man page update planned? -- wbr, pluknet From owner-svn-src-all@freebsd.org Mon Jan 16 12:05:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCED3CB0BD5; Mon, 16 Jan 2017 12:05:01 +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 8CCC2108E; Mon, 16 Jan 2017 12:05:01 +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 v0GC50xm026884; Mon, 16 Jan 2017 12:05:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GC50ch026883; Mon, 16 Jan 2017 12:05:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701161205.v0GC50ch026883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Jan 2017 12:05:00 +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: r312284 - stable/10/lib/libprocstat 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, 16 Jan 2017 12:05:01 -0000 Author: kib Date: Mon Jan 16 12:05:00 2017 New Revision: 312284 URL: https://svnweb.freebsd.org/changeset/base/312284 Log: MFC r311780: Use tab for indent. Modified: stable/10/lib/libprocstat/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libprocstat/Makefile ============================================================================== --- stable/10/lib/libprocstat/Makefile Mon Jan 16 11:40:53 2017 (r312283) +++ stable/10/lib/libprocstat/Makefile Mon Jan 16 12:05:00 2017 (r312284) @@ -8,7 +8,7 @@ SRCS= cd9660.c \ common_kvm.c \ core.c \ libprocstat.c \ - msdosfs.c \ + msdosfs.c \ smbfs.c \ udf.c From owner-svn-src-all@freebsd.org Mon Jan 16 12:13:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B6F1CB0FE8; Mon, 16 Jan 2017 12:13:50 +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 2D2971736; Mon, 16 Jan 2017 12:13:50 +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 v0GCDnS3030855; Mon, 16 Jan 2017 12:13:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GCDnGI030854; Mon, 16 Jan 2017 12:13:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701161213.v0GCDnGI030854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Jan 2017 12:13:49 +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: r312285 - stable/10/lib/libprocstat 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, 16 Jan 2017 12:13:50 -0000 Author: kib Date: Mon Jan 16 12:13:49 2017 New Revision: 312285 URL: https://svnweb.freebsd.org/changeset/base/312285 Log: MFC r311781: Use standard Versions.def for libprocstat. Deleted: stable/10/lib/libprocstat/Versions.def Modified: stable/10/lib/libprocstat/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libprocstat/Makefile ============================================================================== --- stable/10/lib/libprocstat/Makefile Mon Jan 16 12:05:00 2017 (r312284) +++ stable/10/lib/libprocstat/Makefile Mon Jan 16 12:13:49 2017 (r312285) @@ -12,7 +12,7 @@ SRCS= cd9660.c \ smbfs.c \ udf.c -VERSION_DEF= ${.CURDIR}/Versions.def +VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map INCS= libprocstat.h From owner-svn-src-all@freebsd.org Mon Jan 16 12:17:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DD1FCB11A6; Mon, 16 Jan 2017 12:17:37 +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 DAE601993; Mon, 16 Jan 2017 12:17:36 +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 v0GCHaux031033; Mon, 16 Jan 2017 12:17:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GCHatu031032; Mon, 16 Jan 2017 12:17:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701161217.v0GCHatu031032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 16 Jan 2017 12:17:36 +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: r312286 - stable/10/sys/fs/pseudofs 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, 16 Jan 2017 12:17:37 -0000 Author: kib Date: Mon Jan 16 12:17:35 2017 New Revision: 312286 URL: https://svnweb.freebsd.org/changeset/base/312286 Log: MFC r311815: Forcibly remove the cached items from pseudofs vncache on module unload. Modified: stable/10/sys/fs/pseudofs/pseudofs_vncache.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/pseudofs/pseudofs_vncache.c ============================================================================== --- stable/10/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan 16 12:13:49 2017 (r312285) +++ stable/10/sys/fs/pseudofs/pseudofs_vncache.c Mon Jan 16 12:17:35 2017 (r312286) @@ -51,6 +51,7 @@ static struct mtx pfs_vncache_mutex; static struct pfs_vdata *pfs_vncache; static eventhandler_tag pfs_exit_tag; static void pfs_exit(void *arg, struct proc *p); +static void pfs_purge_locked(struct pfs_node *pn, bool force); static SYSCTL_NODE(_vfs_pfs, OID_AUTO, vncache, CTLFLAG_RW, 0, "pseudofs vnode cache"); @@ -97,6 +98,9 @@ pfs_vncache_unload(void) { EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag); + mtx_lock(&pfs_vncache_mutex); + pfs_purge_locked(NULL, true); + mtx_unlock(&pfs_vncache_mutex); KASSERT(pfs_vncache_entries == 0, ("%d vncache entries remaining", pfs_vncache_entries)); mtx_destroy(&pfs_vncache_mutex); @@ -272,7 +276,7 @@ pfs_vncache_free(struct vnode *vp) * used to implement the cache. */ static void -pfs_purge_locked(struct pfs_node *pn) +pfs_purge_locked(struct pfs_node *pn, bool force) { struct pfs_vdata *pvd; struct vnode *vnp; @@ -280,7 +284,8 @@ pfs_purge_locked(struct pfs_node *pn) mtx_assert(&pfs_vncache_mutex, MA_OWNED); pvd = pfs_vncache; while (pvd != NULL) { - if (pvd->pvd_dead || (pn != NULL && pvd->pvd_pn == pn)) { + if (force || pvd->pvd_dead || + (pn != NULL && pvd->pvd_pn == pn)) { vnp = pvd->pvd_vnode; vhold(vnp); mtx_unlock(&pfs_vncache_mutex); @@ -301,7 +306,7 @@ pfs_purge(struct pfs_node *pn) { mtx_lock(&pfs_vncache_mutex); - pfs_purge_locked(pn); + pfs_purge_locked(pn, false); mtx_unlock(&pfs_vncache_mutex); } @@ -321,6 +326,6 @@ pfs_exit(void *arg, struct proc *p) if (pvd->pvd_pid == p->p_pid) dead = pvd->pvd_dead = 1; if (dead) - pfs_purge_locked(NULL); + pfs_purge_locked(NULL, false); mtx_unlock(&pfs_vncache_mutex); } From owner-svn-src-all@freebsd.org Mon Jan 16 14:49:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D2CACB2109; Mon, 16 Jan 2017 14:49:30 +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 3535A15E5; Mon, 16 Jan 2017 14:49:30 +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 v0GEnTmt093548; Mon, 16 Jan 2017 14:49:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GEnTTN093545; Mon, 16 Jan 2017 14:49:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701161449.v0GEnTTN093545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 16 Jan 2017 14:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312288 - head/libexec/rtld-elf/amd64 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, 16 Jan 2017 14:49:30 -0000 Author: emaste Date: Mon Jan 16 14:49:29 2017 New Revision: 312288 URL: https://svnweb.freebsd.org/changeset/base/312288 Log: rtld: do not rely on a populated GOT on amd64 On rela architectures GNU BFD ld and gold store the relocation addend in GOT entries (in addition to the relocation's r_addend field). rtld previously relied on this to access its own _DYNAMIC symbol in order to apply its own relocations. However, recording addends in the GOT is not specified by the ABI, and some versions of LLVM's LLD linker leave the GOT uninitialized on rela architectures. BFD ld does not populate the GOT on sparc64, and sparc64 rtld has a machine-dependent rtld_dynamic_addr() function that returns the _DYNAMIC address. Use the same approach on amd64, obtaining the %rip- relative _DYNAMIC address following a suggestion from Rafael Espíndola. Architectures other than amd64 should be addressed in future work. PR: 214972 Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9180 Modified: head/libexec/rtld-elf/amd64/rtld_machdep.h head/libexec/rtld-elf/amd64/rtld_start.S Modified: head/libexec/rtld-elf/amd64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/amd64/rtld_machdep.h Mon Jan 16 14:31:17 2017 (r312287) +++ head/libexec/rtld-elf/amd64/rtld_machdep.h Mon Jan 16 14:49:29 2017 (r312288) @@ -35,8 +35,8 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ -#define rtld_dynamic(obj) \ - ((const Elf_Dyn *)((obj)->relocbase + (Elf_Addr)&_DYNAMIC)) +Elf_Dyn *rtld_dynamic_addr(void); +#define rtld_dynamic(obj) rtld_dynamic_addr() /* Fixup the jump slot at "where" to transfer control to "target". */ static inline Elf_Addr Modified: head/libexec/rtld-elf/amd64/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/amd64/rtld_start.S Mon Jan 16 14:31:17 2017 (r312287) +++ head/libexec/rtld-elf/amd64/rtld_start.S Mon Jan 16 14:49:29 2017 (r312288) @@ -156,4 +156,16 @@ _rtld_bind_start: .cfi_endproc .size _rtld_bind_start, . - _rtld_bind_start + .align 4 + .globl rtld_dynamic_addr + .type rtld_dynamic_addr,@function +rtld_dynamic_addr: + .cfi_startproc + .weak _DYNAMIC + .hidden _DYNAMIC + lea _DYNAMIC(%rip),%rax + ret + .cfi_endproc + .size rtld_dynamic_addr, . - rtld_dynamic_addr + .section .note.GNU-stack,"",%progbits From owner-svn-src-all@freebsd.org Mon Jan 16 15:23:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E06CBCB2BC9; Mon, 16 Jan 2017 15:23:56 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7BA2163A; Mon, 16 Jan 2017 15:23:56 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GFNtnW011528; Mon, 16 Jan 2017 15:23:55 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GFNtku011527; Mon, 16 Jan 2017 15:23:55 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201701161523.v0GFNtku011527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Mon, 16 Jan 2017 15:23:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312289 - head/sys/dev/spibus 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, 16 Jan 2017 15:23:57 -0000 Author: mizhka Date: Mon Jan 16 15:23:55 2017 New Revision: 312289 URL: https://svnweb.freebsd.org/changeset/base/312289 Log: [spibus] small code refactoring Merge 3 sequential printf calls into one. Reported by: rpokala Reviewed by: rpokala, adrian Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D8795 Modified: head/sys/dev/spibus/spibus.c Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Mon Jan 16 14:49:29 2017 (r312288) +++ head/sys/dev/spibus/spibus.c Mon Jan 16 15:23:55 2017 (r312289) @@ -116,9 +116,8 @@ spibus_probe_nomatch(device_t bus, devic { struct spibus_ivar *devi = SPIBUS_IVAR(child); - device_printf(bus, ""); - printf(" at cs %d", devi->cs); - printf(" mode %d\n", devi->mode); + device_printf(bus, " at cs %d mode %d\n", devi->cs, + devi->mode); return; } From owner-svn-src-all@freebsd.org Mon Jan 16 15:36:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 344FBCB20A4; Mon, 16 Jan 2017 15:36:38 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 113FE102E; Mon, 16 Jan 2017 15:36:38 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GFabbf016246; Mon, 16 Jan 2017 15:36:37 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GFabfY016244; Mon, 16 Jan 2017 15:36:37 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201701161536.v0GFabfY016244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Mon, 16 Jan 2017 15:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312290 - in head/sys: conf dev/gpio 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, 16 Jan 2017 15:36:38 -0000 Author: mizhka Date: Mon Jan 16 15:36:36 2017 New Revision: 312290 URL: https://svnweb.freebsd.org/changeset/base/312290 Log: [gpioths] new driver for temperature/humidity sensor DHT11 This patch adds driver for temperature/humidity sensor connected via GPIO. To compile it into kernel add "device gpioths". To activate driver, use hints (.at and .pins) for gpiobus. As result it will provide temperature & humidity values via sysctl. DHT11 is cheap & popular temperature/humidity sensor used via GPIO on ARM or MIPS devices like Raspberry Pi or Onion Omega. Reviewed by: adrian Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D9185 Added: head/sys/dev/gpio/gpioths.c (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Jan 16 15:23:55 2017 (r312289) +++ head/sys/conf/files Mon Jan 16 15:36:36 2017 (r312290) @@ -1714,6 +1714,7 @@ dev/gpio/gpioled_fdt.c optional gpioled dev/gpio/gpiopower.c optional gpiopower fdt dev/gpio/gpioregulator.c optional gpioregulator fdt ext_resources dev/gpio/gpiospi.c optional gpiospi +dev/gpio/gpioths.c optional gpioths dev/gpio/gpio_if.m optional gpio dev/gpio/gpiobus_if.m optional gpio dev/gpio/gpiopps.c optional gpiopps Added: head/sys/dev/gpio/gpioths.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/gpioths.c Mon Jan 16 15:36:36 2017 (r312290) @@ -0,0 +1,405 @@ +/*- + * Copyright (c) 2016 Michael Zhilin + * 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 +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "gpiobus_if.h" + +/* + * GPIOTHS - Temp/Humidity sensor over GPIO, e.g. DHT11/DHT22 + * This is driver for Temperature & Humidity sensor which provides digital + * output over single-wire protocol from embedded 8-bit microcontroller. + * + * Temp/Humidity sensor can't be discovered automatically, please specify hints + * as part of loader or kernel configuration: + * hint.gpioths.0.at="gpiobus0" + * hint.gpioths.0.pins= + */ + +#define GPIOTHS_POLLTIME 5 /* in seconds */ + +#define GPIOTHS_DHT_STARTCYCLE 20000 /* 20ms = 20000us */ +#define GPIOTHS_DHT_TIMEOUT 1000 /* 1ms = 1000us */ +#define GPIOTHS_DHT_CYCLES 41 +#define GPIOTHS_DHT_ONEBYTEMASK 0xFF +#define GPIOTHS_DHT_TEMP_SHIFT 8 +#define GPIOTHS_DHT_HUM_SHIFT 24 + +struct gpioths_softc { + device_t dev; + int temp; + int hum; + int fails; + struct sysctl_oid *temp_oid; + struct sysctl_oid *hum_oid; + struct sysctl_oid *fails_oid; + struct callout callout; +}; + +static devclass_t gpioths_devclass; + +/* Prototypes */ +static int gpioths_probe(device_t dev); +static int gpioths_attach(device_t dev); +static int gpioths_detach(device_t dev); +static void gpioths_poll(void *arg); +static int gpioths_temp_sysctl(SYSCTL_HANDLER_ARGS); +static int gpioths_hum_sysctl(SYSCTL_HANDLER_ARGS); +static int gpioths_fails_sysctl(SYSCTL_HANDLER_ARGS); + +/* DHT-specific methods */ +static int gpioths_dht_initread(device_t bus, device_t dev); +static int gpioths_dht_readbytes(device_t bus, device_t dev); +static int gpioths_dht_timeuntil(device_t bus, device_t dev, + uint32_t lev, uint32_t *time); + +/* Implementation */ +static int +gpioths_probe(device_t dev) +{ + device_set_desc(dev, "Temperature and Humidity Sensor over GPIO"); + return (0); +} + +static int +gpioths_dht_timeuntil(device_t bus, device_t dev, uint32_t lev, uint32_t *time) +{ + uint32_t cur_level; + int i; + + for (i = 0; i < GPIOTHS_DHT_TIMEOUT; i++) { + GPIOBUS_PIN_GET(bus, dev, 0, &cur_level); + if (cur_level == lev) { + if (time != NULL) + *time = i; + return (0); + } + DELAY(1); + } + + /* Timeout */ + return (ETIMEDOUT); +} + +static int +gpioths_dht_initread(device_t bus, device_t dev) +{ + int err; + + err = GPIOBUS_PIN_SETFLAGS(bus, dev, 0, GPIO_PIN_OUTPUT); + if (err != 0) { + device_printf(dev, "err(GPIOBUS_PIN_SETFLAGS, OUT) = %d\n", err); + return (err); + } + DELAY(1); + + err = GPIOBUS_PIN_SET(bus, dev, 0, GPIO_PIN_LOW); + if (err != 0) { + device_printf(dev, "err(GPIOBUS_PIN_SET, LOW) = %d\n", err); + return (err); + } + + /* + * According to specifications we need to wait no more than 18ms + * to start data transfer + */ + DELAY(GPIOTHS_DHT_STARTCYCLE); + err = GPIOBUS_PIN_SET(bus, dev, 0, GPIO_PIN_HIGH); + if (err != 0) { + device_printf(dev, "err(GPIOBUS_PIN_SET, HIGH) = %d\n", err); + return (err); + } + + DELAY(1); + err = GPIOBUS_PIN_SETFLAGS(bus, dev, 0, GPIO_PIN_INPUT) ; + if (err != 0) { + device_printf(dev, "err(GPIOBUS_PIN_SETFLAGS, IN) = %d\n", err); + return (err); + } + + DELAY(1); + return (0); +} + +static int +gpioths_dht_readbytes(device_t bus, device_t dev) +{ + struct gpioths_softc *sc; + uint32_t calibrations[GPIOTHS_DHT_CYCLES]; + uint32_t intervals[GPIOTHS_DHT_CYCLES]; + uint32_t err, avglen, value; + uint8_t crc, calc; + int i, offset, size; + + sc = device_get_softc(dev); + + err = gpioths_dht_initread(bus,dev); + if (err) { + device_printf(dev, "gpioths_dht_initread error = %d\n", err); + goto error; + } + + err = gpioths_dht_timeuntil(bus, dev, GPIO_PIN_LOW, NULL); + if (err) { + device_printf(dev, "err(START) = %d\n", err); + goto error; + } + + /* reading - 41 cycles */ + for (i = 0; i < GPIOTHS_DHT_CYCLES; i++) { + err = gpioths_dht_timeuntil(bus, dev, GPIO_PIN_HIGH, + &calibrations[i]); + if (err) { + device_printf(dev, "err(CAL, %d) = %d\n", i, err); + goto error; + } + err = gpioths_dht_timeuntil(bus, dev, GPIO_PIN_LOW, + &intervals[i]); + if (err) { + device_printf(dev, "err(INTERVAL, %d) = %d\n", i, err); + goto error; + } + } + + err = GPIOBUS_PIN_SETFLAGS(bus, dev, 0, GPIO_PIN_OUTPUT); + if (err != 0) { + device_printf(dev, "err(FINAL_SETFLAGS, OUT) = %d\n", err); + goto error; + } + DELAY(1); + + /* Calculate average data calibration cycle length */ + avglen = 0; + for (i = 1; i < GPIOTHS_DHT_CYCLES; i++) + avglen += calibrations[i]; + + avglen = avglen / (GPIOTHS_DHT_CYCLES - 1); + + /* Calculate data */ + value = 0; + offset = 1; + size = sizeof(value) * 8; + for (i = offset; i < size + offset; i++) { + value <<= 1; + if (intervals[i] > avglen) + value += 1; + } + + /* Calculate CRC */ + crc = 0; + offset = sizeof(value) * 8 + 1; + size = sizeof(crc) * 8; + for (i = offset; i < size + offset; i++) { + crc <<= 1; + if (intervals[i] > avglen) + crc += 1; + } + + calc = 0; + for (i = 0; i < sizeof(value); i++) + calc += (value >> (8*i)) & GPIOTHS_DHT_ONEBYTEMASK; + +#ifdef GPIOTHS_DEBUG + /* Debug bits */ + for (i = 0; i < GPIOTHS_DHT_CYCLES; i++) + device_printf(dev, "%d: %d %d\n", i, calibrations[i], + intervals[i]); + + device_printf(dev, "len=%d, data=%x, crc=%x/%x\n", avglen, value, crc, + calc); +#endif /* GPIOTHS_DEBUG */ + + /* CRC check */ + if (calc != crc) { + err = -1; + goto error; + } + + sc->fails = 0; + sc->temp = (value >> GPIOTHS_DHT_TEMP_SHIFT) & GPIOTHS_DHT_ONEBYTEMASK; + sc->hum = (value >> GPIOTHS_DHT_HUM_SHIFT) & GPIOTHS_DHT_ONEBYTEMASK; + +#ifdef GPIOTHS_DEBUG + /* Debug bits */ + device_printf(dev, "fails=%d, temp=%d, hum=%d\n", sc->fails, + sc->temp, sc->hum); +#endif /* GPIOTHS_DEBUG */ + + return (0); +error: + sc->fails++; + return (err); +} + +static void +gpioths_poll(void *arg) +{ + struct gpioths_softc *sc; + device_t dev; + + dev = (device_t)arg; + sc = device_get_softc(dev); + + gpioths_dht_readbytes(device_get_parent(dev), dev); + callout_schedule(&sc->callout, GPIOTHS_POLLTIME * hz); +} + +static int +gpioths_temp_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct gpioths_softc *sc; + int value; + + sc = (struct gpioths_softc*)arg1; + value = sc->temp; + + return (sysctl_handle_int(oidp, &value, 0, req)); +} + +static int +gpioths_hum_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct gpioths_softc *sc; + int value; + + sc = (struct gpioths_softc*)arg1; + value = sc->hum; + + return (sysctl_handle_int(oidp, &value, 0, req)); +} + + +static int +gpioths_fails_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct gpioths_softc *sc; + int value; + + sc = (struct gpioths_softc*)arg1; + value = sc->fails; + + return (sysctl_handle_int(oidp, &value, 0, req)); +} + +static int +gpioths_attach(device_t dev) +{ + struct gpioths_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + + sc = device_get_softc(dev); + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + + sc->dev = dev; + + callout_init(&sc->callout, 1); + callout_reset(&sc->callout, GPIOTHS_POLLTIME * hz, gpioths_poll, dev); + + sc->temp_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "temperature", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + gpioths_temp_sysctl, "I", "temperature(C)"); + + sc->hum_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "humidity", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + gpioths_hum_sysctl, "I", "humidity(%)"); + + sc->fails_oid = SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "fails", CTLTYPE_INT | CTLFLAG_RD, sc, 0, + gpioths_fails_sysctl, "I", "fails since last successful read"); + + return (0); +} + +static int +gpioths_detach(device_t dev) +{ + + return (0); +} + +/* DDB bits */ +#include "opt_ddb.h" +#ifdef DDB +#include +#include +#include + +static struct command_table db_gpioths_table = LIST_HEAD_INITIALIZER(db_t4_table); +_DB_SET(_show, gpioths, NULL, db_show_table, 0, &db_gpioths_table); + +DB_FUNC(read, db_show_gpiothsread, db_gpioths_table, CS_OWN, NULL) +{ + device_t dev; + int t; + int init; + + init = 0; + t = db_read_token(); + if (t == tIDENT) { + dev = device_lookup_by_name(db_tok_string); + init = 1; + } + + db_skip_to_eol(); + + if (init) + db_printf("read: 0x%x\n", + gpioths_dht_readbytes(dev, device_get_parent(dev))); + else + db_printf("usage: show gpioths read \n"); + +return; +} +#endif /* DDB */ + +/* Driver bits */ +static device_method_t gpioths_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, gpioths_probe), + DEVMETHOD(device_attach, gpioths_attach), + DEVMETHOD(device_detach, gpioths_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(gpioths, gpioths_driver, gpioths_methods, sizeof(struct gpioths_softc)); +DRIVER_MODULE(gpioths, gpiobus, gpioths_driver, gpioths_devclass, 0, 0); From owner-svn-src-all@freebsd.org Mon Jan 16 16:19:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09418CB221B; Mon, 16 Jan 2017 16:19:58 +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 9B4161C67; Mon, 16 Jan 2017 16:19:57 +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 v0GGJuSk033025; Mon, 16 Jan 2017 16:19:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GGJtrQ033013; Mon, 16 Jan 2017 16:19:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701161619.v0GGJtrQ033013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 16 Jan 2017 16:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312291 - in head/sys/cam: ctl 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: Mon, 16 Jan 2017 16:19:58 -0000 Author: mav Date: Mon Jan 16 16:19:55 2017 New Revision: 312291 URL: https://svnweb.freebsd.org/changeset/base/312291 Log: Make CTL frontends report kern_data_resid for under-/overruns. It seems like kern_data_resid was never really implemented. This change finally does it. Now frontends update this field while transferring data, while CTL/backends getting it can more flexibly handle the result. At this point behavior should not change significantly, still reporting errors on write overrun, but that may be changed later, if we decide so. CAM target frontend still does not properly handle overruns due to CAM API limitations. We may need to add some fields to struct ccb_accept_tio to pass information about initiator requested transfer size(s). MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c head/sys/cam/ctl/ctl_error.c head/sys/cam/ctl/ctl_error.h head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/ctl_frontend_ioctl.c head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_tpc.c head/sys/cam/ctl/ctl_tpc_local.c head/sys/cam/ctl/scsi_ctl.c head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Mon Jan 16 15:36:36 2017 (r312290) +++ head/sys/cam/ctl/ctl.c Mon Jan 16 16:19:55 2017 (r312291) @@ -5053,18 +5053,13 @@ ctl_config_move_done(union ctl_io *io) if ((io->io_hdr.port_status != 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { - /* - * For hardware error sense keys, the sense key - * specific value is defined to be a retry count, - * but we use it to pass back an internal FETD - * error code. XXX KDM Hopefully the FETD is only - * using 16 bits for an error code, since that's - * all the space we have in the sks field. - */ - ctl_set_internal_failure(&io->scsiio, - /*sks_valid*/ 1, - /*retry_count*/ - io->io_hdr.port_status); + ctl_set_internal_failure(&io->scsiio, /*sks_valid*/ 1, + /*retry_count*/ io->io_hdr.port_status); + } else if (io->scsiio.kern_data_resid != 0 && + (io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { + ctl_set_invalid_field_ciu(&io->scsiio); } if (ctl_debug & CTL_DEBUG_CDB_DATA) @@ -5462,7 +5457,6 @@ ctl_format(struct ctl_scsiio *ctsio) ctsio->kern_data_ptr = malloc(length, M_CTL, M_WAITOK); ctsio->kern_data_len = length; ctsio->kern_total_len = length; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -5588,7 +5582,6 @@ ctl_read_buffer(struct ctl_scsiio *ctsio } ctsio->kern_data_len = len; ctsio->kern_total_len = len; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctl_set_success(ctsio); @@ -5634,7 +5627,6 @@ ctl_write_buffer(struct ctl_scsiio *ctsi ctsio->kern_data_ptr = lun->write_buffer + buffer_offset; ctsio->kern_data_len = len; ctsio->kern_total_len = len; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -5742,7 +5734,6 @@ ctl_write_same(struct ctl_scsiio *ctsio) ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK); ctsio->kern_data_len = len; ctsio->kern_total_len = len; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -5788,7 +5779,6 @@ ctl_unmap(struct ctl_scsiio *ctsio) ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK); ctsio->kern_data_len = len; ctsio->kern_total_len = len; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -6278,7 +6268,6 @@ ctl_mode_select(struct ctl_scsiio *ctsio ctsio->kern_data_ptr = malloc(param_len, M_CTL, M_WAITOK); ctsio->kern_data_len = param_len; ctsio->kern_total_len = param_len; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -6508,7 +6497,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; if (total_len < alloc_len) { ctsio->residual = alloc_len - total_len; @@ -6861,7 +6849,6 @@ ctl_log_sense(struct ctl_scsiio *ctsio) ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; if (total_len < alloc_len) { ctsio->residual = alloc_len - total_len; @@ -6929,7 +6916,6 @@ ctl_read_capacity(struct ctl_scsiio *cts ctsio->residual = 0; ctsio->kern_data_len = sizeof(*data); ctsio->kern_total_len = sizeof(*data); - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -6995,7 +6981,6 @@ ctl_read_capacity_16(struct ctl_scsiio * ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -7050,7 +7035,6 @@ ctl_get_lba_status(struct ctl_scsiio *ct ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -7112,7 +7096,6 @@ ctl_read_defect(struct ctl_scsiio *ctsio ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -7211,7 +7194,6 @@ ctl_report_tagret_port_groups(struct ctl ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; if (ext) { @@ -7412,7 +7394,6 @@ ctl_report_supported_opcodes(struct ctl_ ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; switch (cdb->options & RSO_OPTIONS_MASK) { @@ -7526,7 +7507,6 @@ ctl_report_supported_tmf(struct ctl_scsi ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; data = (struct scsi_report_supported_tmf_ext_data *)ctsio->kern_data_ptr; @@ -7574,7 +7554,6 @@ ctl_report_timestamp(struct ctl_scsiio * ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; data = (struct scsi_report_timestamp_data *)ctsio->kern_data_ptr; @@ -7647,7 +7626,6 @@ retry: ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -8225,7 +8203,6 @@ ctl_persistent_reserve_out(struct ctl_sc ctsio->kern_data_ptr = malloc(param_len, M_CTL, M_WAITOK); ctsio->kern_data_len = param_len; ctsio->kern_total_len = param_len; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -9207,7 +9184,6 @@ ctl_report_luns(struct ctl_scsiio *ctsio ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -9270,7 +9246,6 @@ ctl_request_sense(struct ctl_scsiio *cts ctsio->kern_data_len = cdb->length; ctsio->kern_total_len = cdb->length; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -9409,7 +9384,6 @@ ctl_inquiry_evpd_supported(struct ctl_sc ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -9478,7 +9452,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -9537,7 +9510,6 @@ ctl_inquiry_evpd_eid(struct ctl_scsiio * ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -9613,7 +9585,6 @@ ctl_inquiry_evpd_mpp(struct ctl_scsiio * ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -9678,7 +9649,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -9807,7 +9777,6 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -9883,7 +9852,6 @@ ctl_inquiry_evpd_block_limits(struct ctl ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -9959,7 +9927,6 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -10016,7 +9983,6 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -10151,7 +10117,6 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); inq_ptr = (struct scsi_inquiry_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; if (data_len < alloc_len) { @@ -10379,7 +10344,6 @@ ctl_get_config(struct ctl_scsiio *ctsio) sizeof(struct scsi_get_config_feature) + 4; ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; hdr = (struct scsi_get_config_header *)ctsio->kern_data_ptr; @@ -10585,7 +10549,6 @@ ctl_get_event_status(struct ctl_scsiio * data_len = sizeof(struct scsi_get_event_status_header); ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; if (data_len < alloc_len) { @@ -10623,7 +10586,6 @@ ctl_mechanism_status(struct ctl_scsiio * data_len = sizeof(struct scsi_mechanism_status_header); ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; if (data_len < alloc_len) { @@ -10683,7 +10645,6 @@ ctl_read_toc(struct ctl_scsiio *ctsio) data_len += sizeof(struct scsi_read_toc_type01_descr); ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; if (data_len < alloc_len) { @@ -12585,6 +12546,9 @@ ctl_datamove(union ctl_io *io) CTL_DEBUG_PRINT(("ctl_datamove\n")); + /* No data transferred yet. Frontend must update this when done. */ + io->scsiio.kern_data_resid = io->scsiio.kern_data_len; + #ifdef CTL_TIME_IO if ((time_uptime - io->io_hdr.start_time) > ctl_time_io_secs) { char str[256]; Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Mon Jan 16 15:36:36 2017 (r312290) +++ head/sys/cam/ctl/ctl_backend_block.c Mon Jan 16 16:19:55 2017 (r312291) @@ -419,6 +419,16 @@ ctl_be_block_move_done(union ctl_io *io) */ if (io->io_hdr.flags & CTL_FLAG_ABORT) { ; + } else if ((io->io_hdr.port_status != 0) && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { + ctl_set_internal_failure(&io->scsiio, /*sks_valid*/ 1, + /*retry_count*/ io->io_hdr.port_status); + } else if (io->scsiio.kern_data_resid != 0 && + (io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { + ctl_set_invalid_field_ciu(&io->scsiio); } else if ((io->io_hdr.port_status == 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { lbalen = ARGS(beio->io); @@ -428,21 +438,6 @@ ctl_be_block_move_done(union ctl_io *io) /* We have two data blocks ready for comparison. */ ctl_be_block_compare(io); } - } else if ((io->io_hdr.port_status != 0) && - ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || - (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { - /* - * For hardware error sense keys, the sense key - * specific value is defined to be a retry count, - * but we use it to pass back an internal FETD - * error code. XXX KDM Hopefully the FETD is only - * using 16 bits for an error code, since that's - * all the space we have in the sks field. - */ - ctl_set_internal_failure(&io->scsiio, - /*sks_valid*/ 1, - /*retry_count*/ - io->io_hdr.port_status); } /* @@ -1634,7 +1629,6 @@ ctl_be_block_dispatch(struct ctl_be_bloc else io->scsiio.kern_data_ptr = (uint8_t *)beio->sg_segs; io->scsiio.kern_data_len = beio->io_len; - io->scsiio.kern_data_resid = 0; io->scsiio.kern_sg_entries = beio->num_segs; io->io_hdr.flags |= CTL_FLAG_ALLOCATED; Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Mon Jan 16 15:36:36 2017 (r312290) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Mon Jan 16 16:19:55 2017 (r312291) @@ -231,6 +231,16 @@ ctl_backend_ramdisk_move_done(union ctl_ io->scsiio.kern_rel_offset += io->scsiio.kern_data_len; if (io->io_hdr.flags & CTL_FLAG_ABORT) { ; + } else if (io->io_hdr.port_status != 0 && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { + ctl_set_internal_failure(&io->scsiio, /*sks_valid*/ 1, + /*retry_count*/ io->io_hdr.port_status); + } else if (io->scsiio.kern_data_resid != 0 && + (io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT && + ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || + (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { + ctl_set_invalid_field_ciu(&io->scsiio); } else if ((io->io_hdr.port_status == 0) && ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE)) { if (io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer > 0) { @@ -243,21 +253,6 @@ ctl_backend_ramdisk_move_done(union ctl_ return (0); } ctl_set_success(&io->scsiio); - } else if ((io->io_hdr.port_status != 0) && - ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_STATUS_NONE || - (io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS)) { - /* - * For hardware error sense keys, the sense key - * specific value is defined to be a retry count, - * but we use it to pass back an internal FETD - * error code. XXX KDM Hopefully the FETD is only - * using 16 bits for an error code, since that's - * all the space we have in the sks field. - */ - ctl_set_internal_failure(&io->scsiio, - /*sks_valid*/ 1, - /*retry_count*/ - io->io_hdr.port_status); } ctl_data_submit_done(io); return(0); @@ -318,7 +313,6 @@ ctl_backend_ramdisk_continue(union ctl_i #endif /* CTL_RAMDISK_PAGES */ io->scsiio.be_move_done = ctl_backend_ramdisk_move_done; - io->scsiio.kern_data_resid = 0; io->scsiio.kern_data_len = len_filled; io->scsiio.kern_sg_entries = sg_filled; io->io_hdr.flags |= CTL_FLAG_ALLOCATED; Modified: head/sys/cam/ctl/ctl_error.c ============================================================================== --- head/sys/cam/ctl/ctl_error.c Mon Jan 16 15:36:36 2017 (r312290) +++ head/sys/cam/ctl/ctl_error.c Mon Jan 16 16:19:55 2017 (r312291) @@ -641,6 +641,18 @@ ctl_set_invalid_field(struct ctl_scsiio /*data*/ sks, SSD_ELEM_NONE); } +void +ctl_set_invalid_field_ciu(struct ctl_scsiio *ctsio) +{ + + /* "Invalid field in command information unit" */ + ctl_set_sense(ctsio, + /*current_error*/ 1, + /*sense_key*/ SSD_KEY_ABORTED_COMMAND, + /*ascq*/ 0x0E, + /*ascq*/ 0x03, + SSD_ELEM_NONE); +} void ctl_set_invalid_opcode(struct ctl_scsiio *ctsio) Modified: head/sys/cam/ctl/ctl_error.h ============================================================================== --- head/sys/cam/ctl/ctl_error.h Mon Jan 16 15:36:36 2017 (r312290) +++ head/sys/cam/ctl/ctl_error.h Mon Jan 16 16:19:55 2017 (r312291) @@ -66,6 +66,7 @@ void ctl_set_overlapped_cmd(struct ctl_s void ctl_set_overlapped_tag(struct ctl_scsiio *ctsio, uint8_t tag); void ctl_set_invalid_field(struct ctl_scsiio *ctsio, int sks_valid, int command, int field, int bit_valid, int bit); +void ctl_set_invalid_field_ciu(struct ctl_scsiio *ctsio); void ctl_set_invalid_opcode(struct ctl_scsiio *ctsio); void ctl_set_param_len_error(struct ctl_scsiio *ctsio); void ctl_set_already_locked(struct ctl_scsiio *ctsio); Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Jan 16 15:36:36 2017 (r312290) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Jan 16 16:19:55 2017 (r312291) @@ -300,7 +300,7 @@ cfcs_datamove(union ctl_io *io) struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; int cam_sg_count, ctl_sg_count, cam_sg_start; int cam_sg_offset; - int len_to_copy, len_copied; + int len_to_copy; int ctl_watermark, cam_watermark; int i, j; @@ -365,7 +365,6 @@ cfcs_datamove(union ctl_io *io) ctl_watermark = 0; cam_watermark = cam_sg_offset; - len_copied = 0; for (i = cam_sg_start, j = 0; i < cam_sg_count && j < ctl_sg_count;) { uint8_t *cam_ptr, *ctl_ptr; @@ -387,9 +386,6 @@ cfcs_datamove(union ctl_io *io) ctl_ptr = (uint8_t *)ctl_sglist[j].addr; ctl_ptr = ctl_ptr + ctl_watermark; - ctl_watermark += len_to_copy; - cam_watermark += len_to_copy; - if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) { CTL_DEBUG_PRINT(("%s: copying %d bytes to CAM\n", @@ -405,30 +401,22 @@ cfcs_datamove(union ctl_io *io) bcopy(cam_ptr, ctl_ptr, len_to_copy); } - len_copied += len_to_copy; + io->scsiio.ext_data_filled += len_to_copy; + io->scsiio.kern_data_resid -= len_to_copy; + cam_watermark += len_to_copy; if (cam_sglist[i].ds_len == cam_watermark) { i++; cam_watermark = 0; } + ctl_watermark += len_to_copy; if (ctl_sglist[j].len == ctl_watermark) { j++; ctl_watermark = 0; } } - io->scsiio.ext_data_filled += len_copied; - - /* - * Report write underflow as error, since CTL and backends don't - * really support it. - */ - if ((io->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT && - j < ctl_sg_count) { - io->io_hdr.port_status = 43; - } else - if ((io->io_hdr.status & CTL_STATUS_MASK) == CTL_SUCCESS) { io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = NULL; io->io_hdr.flags |= CTL_FLAG_STATUS_SENT; Modified: head/sys/cam/ctl/ctl_frontend_ioctl.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_ioctl.c Mon Jan 16 15:36:36 2017 (r312290) +++ head/sys/cam/ctl/ctl_frontend_ioctl.c Mon Jan 16 16:19:55 2017 (r312291) @@ -138,7 +138,7 @@ ctl_ioctl_do_datamove(struct ctl_scsiio struct ctl_sg_entry ext_entry, kern_entry; int ext_sglen, ext_sg_entries, kern_sg_entries; int ext_sg_start, ext_offset; - int len_to_copy, len_copied; + int len_to_copy; int kern_watermark, ext_watermark; int ext_sglist_malloced; int i, j; @@ -150,7 +150,8 @@ ctl_ioctl_do_datamove(struct ctl_scsiio */ if (ctsio->io_hdr.flags & CTL_FLAG_NO_DATAMOVE) { ext_sglist_malloced = 0; - ctsio->ext_data_filled = ctsio->ext_data_len; + ctsio->ext_data_filled += ctsio->kern_data_len; + ctsio->kern_data_resid = 0; goto bailout; } @@ -204,7 +205,6 @@ ctl_ioctl_do_datamove(struct ctl_scsiio kern_watermark = 0; ext_watermark = ext_offset; - len_copied = 0; for (i = ext_sg_start, j = 0; i < ext_sg_entries && j < kern_sg_entries;) { uint8_t *ext_ptr, *kern_ptr; @@ -226,9 +226,6 @@ ctl_ioctl_do_datamove(struct ctl_scsiio kern_ptr = (uint8_t *)kern_sglist[j].addr; kern_ptr = kern_ptr + kern_watermark; - kern_watermark += len_to_copy; - ext_watermark += len_to_copy; - if ((ctsio->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) { CTL_DEBUG_PRINT(("ctl_ioctl_do_datamove: copying %d " @@ -250,21 +247,22 @@ ctl_ioctl_do_datamove(struct ctl_scsiio } } - len_copied += len_to_copy; + ctsio->ext_data_filled += len_to_copy; + ctsio->kern_data_resid -= len_to_copy; + ext_watermark += len_to_copy; if (ext_sglist[i].len == ext_watermark) { i++; ext_watermark = 0; } + kern_watermark += len_to_copy; if (kern_sglist[j].len == kern_watermark) { j++; kern_watermark = 0; } } - ctsio->ext_data_filled += len_copied; - CTL_DEBUG_PRINT(("ctl_ioctl_do_datamove: ext_sg_entries: %d, " "kern_sg_entries: %d\n", ext_sg_entries, kern_sg_entries)); @@ -272,15 +270,6 @@ ctl_ioctl_do_datamove(struct ctl_scsiio "kern_data_len = %d\n", ctsio->ext_data_len, ctsio->kern_data_len)); - /* - * Report write underflow as error, since CTL and backends don't - * really support it. - */ - if ((ctsio->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_OUT && - j < kern_sg_entries) { - ctsio->io_hdr.port_status = 43; - } - bailout: if (ext_sglist_malloced != 0) free(ext_sglist, M_CTL); Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Mon Jan 16 15:36:36 2017 (r312290) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Mon Jan 16 16:19:55 2017 (r312291) @@ -769,6 +769,7 @@ cfiscsi_handle_data_segment(struct icl_p cdw->cdw_sg_len -= copy_len; off += copy_len; io->scsiio.ext_data_filled += copy_len; + io->scsiio.kern_data_resid -= copy_len; if (cdw->cdw_sg_len == 0) { /* @@ -2514,6 +2515,7 @@ cfiscsi_datamove_in(union ctl_io *io) } sg_addr += len; sg_len -= len; + io->scsiio.kern_data_resid -= len; KASSERT(buffer_offset + response->ip_data_len <= expected_len, ("buffer_offset %zd + ip_data_len %zd > expected_len %zd", @@ -2599,7 +2601,7 @@ cfiscsi_datamove_out(union ctl_io *io) struct iscsi_bhs_r2t *bhsr2t; struct cfiscsi_data_wait *cdw; struct ctl_sg_entry ctl_sg_entry, *ctl_sglist; - uint32_t expected_len, r2t_off, r2t_len; + uint32_t expected_len, datamove_len, r2t_off, r2t_len; uint32_t target_transfer_tag; bool done; @@ -2618,16 +2620,15 @@ cfiscsi_datamove_out(union ctl_io *io) PDU_TOTAL_TRANSFER_LEN(request) = io->scsiio.kern_total_len; /* - * Report write underflow as error since CTL and backends don't - * really support it, and SCSI does not tell how to do it right. + * Complete write underflow. Not a single byte to read. Return. */ expected_len = ntohl(bhssc->bhssc_expected_data_transfer_length); - if (io->scsiio.kern_rel_offset + io->scsiio.kern_data_len > - expected_len) { - io->scsiio.io_hdr.port_status = 43; + if (io->scsiio.kern_rel_offset > expected_len) { io->scsiio.be_move_done(io); return; } + datamove_len = MIN(io->scsiio.kern_data_len, + expected_len - io->scsiio.kern_rel_offset); target_transfer_tag = atomic_fetchadd_32(&cs->cs_target_transfer_tag, 1); @@ -2650,7 +2651,7 @@ cfiscsi_datamove_out(union ctl_io *io) cdw->cdw_ctl_io = io; cdw->cdw_target_transfer_tag = target_transfer_tag; cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag; - cdw->cdw_r2t_end = io->scsiio.kern_data_len; + cdw->cdw_r2t_end = datamove_len; cdw->cdw_datasn = 0; /* Set initial data pointer for the CDW respecting ext_data_filled. */ @@ -2659,7 +2660,7 @@ cfiscsi_datamove_out(union ctl_io *io) } else { ctl_sglist = &ctl_sg_entry; ctl_sglist->addr = io->scsiio.kern_data_ptr; - ctl_sglist->len = io->scsiio.kern_data_len; + ctl_sglist->len = datamove_len; } cdw->cdw_sg_index = 0; cdw->cdw_sg_addr = ctl_sglist[cdw->cdw_sg_index].addr; @@ -2690,7 +2691,7 @@ cfiscsi_datamove_out(union ctl_io *io) } r2t_off = io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled; - r2t_len = MIN(io->scsiio.kern_data_len - io->scsiio.ext_data_filled, + r2t_len = MIN(datamove_len - io->scsiio.ext_data_filled, cs->cs_max_burst_length); cdw->cdw_r2t_end = io->scsiio.ext_data_filled + r2t_len; Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Mon Jan 16 15:36:36 2017 (r312290) +++ head/sys/cam/ctl/ctl_tpc.c Mon Jan 16 16:19:55 2017 (r312291) @@ -293,7 +293,6 @@ ctl_inquiry_evpd_tpc(struct ctl_scsiio * ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; @@ -470,7 +469,6 @@ ctl_receive_copy_operating_parameters(st ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; data = (struct scsi_receive_copy_operating_parameters_data *)ctsio->kern_data_ptr; @@ -568,7 +566,6 @@ ctl_receive_copy_status_lid1(struct ctl_ ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; data = (struct scsi_receive_copy_status_lid1_data *)ctsio->kern_data_ptr; @@ -646,7 +643,6 @@ ctl_receive_copy_failure_details(struct ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; data = (struct scsi_receive_copy_failure_details_data *)ctsio->kern_data_ptr; @@ -718,7 +714,6 @@ ctl_receive_copy_status_lid4(struct ctl_ ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; data = (struct scsi_receive_copy_status_lid4_data *)ctsio->kern_data_ptr; @@ -1730,7 +1725,6 @@ ctl_extended_copy_lid1(struct ctl_scsiio ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK); ctsio->kern_data_len = len; ctsio->kern_total_len = len; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -1885,7 +1879,6 @@ ctl_extended_copy_lid4(struct ctl_scsiio ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK); ctsio->kern_data_len = len; ctsio->kern_total_len = len; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -2083,7 +2076,6 @@ ctl_populate_token(struct ctl_scsiio *ct ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK); ctsio->kern_data_len = len; ctsio->kern_total_len = len; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -2247,7 +2239,6 @@ ctl_write_using_token(struct ctl_scsiio ctsio->kern_data_ptr = malloc(len, M_CTL, M_WAITOK); ctsio->kern_data_len = len; ctsio->kern_total_len = len; - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -2423,7 +2414,6 @@ ctl_receive_rod_token_information(struct ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; data = (struct scsi_receive_copy_status_lid4_data *)ctsio->kern_data_ptr; @@ -2504,7 +2494,6 @@ ctl_report_all_rod_tokens(struct ctl_scs ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; data = (struct scsi_report_all_rod_tokens_data *)ctsio->kern_data_ptr; Modified: head/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc_local.c Mon Jan 16 15:36:36 2017 (r312290) +++ head/sys/cam/ctl/ctl_tpc_local.c Mon Jan 16 16:19:55 2017 (r312291) @@ -137,7 +137,7 @@ tpcl_datamove(union ctl_io *io) struct ctl_sg_entry ext_entry, kern_entry; int ext_sg_entries, kern_sg_entries; int ext_sg_start, ext_offset; - int len_to_copy, len_copied; + int len_to_copy; int kern_watermark, ext_watermark; struct ctl_scsiio *ctsio; int i, j; @@ -196,7 +196,6 @@ tpcl_datamove(union ctl_io *io) kern_watermark = 0; ext_watermark = ext_offset; - len_copied = 0; for (i = ext_sg_start, j = 0; i < ext_sg_entries && j < kern_sg_entries;) { uint8_t *ext_ptr, *kern_ptr; @@ -218,9 +217,6 @@ tpcl_datamove(union ctl_io *io) kern_ptr = (uint8_t *)kern_sglist[j].addr; kern_ptr = kern_ptr + kern_watermark; - kern_watermark += len_to_copy; - ext_watermark += len_to_copy; - if ((ctsio->io_hdr.flags & CTL_FLAG_DATA_MASK) == CTL_FLAG_DATA_IN) { CTL_DEBUG_PRINT(("%s: copying %d bytes to user\n", @@ -236,27 +232,27 @@ tpcl_datamove(union ctl_io *io) memcpy(kern_ptr, ext_ptr, len_to_copy); } - len_copied += len_to_copy; + ctsio->ext_data_filled += len_to_copy; + ctsio->kern_data_resid -= len_to_copy; + ext_watermark += len_to_copy; if (ext_sglist[i].len == ext_watermark) { i++; ext_watermark = 0; } + kern_watermark += len_to_copy; if (kern_sglist[j].len == kern_watermark) { j++; kern_watermark = 0; } } - ctsio->ext_data_filled += len_copied; - CTL_DEBUG_PRINT(("%s: ext_sg_entries: %d, kern_sg_entries: %d\n", __func__, ext_sg_entries, kern_sg_entries)); CTL_DEBUG_PRINT(("%s: ext_data_len = %d, kern_data_len = %d\n", __func__, ctsio->ext_data_len, ctsio->kern_data_len)); - /* XXX KDM set residual?? */ bailout: io->scsiio.be_move_done(io); } Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Mon Jan 16 15:36:36 2017 (r312290) +++ head/sys/cam/ctl/scsi_ctl.c Mon Jan 16 16:19:55 2017 (r312291) @@ -721,15 +721,18 @@ ctlfedata(struct ctlfe_lun_softc *softc, idx = cmd_info->cur_transfer_index; off = cmd_info->cur_transfer_off; cmd_info->flags &= ~CTLFE_CMD_PIECEWISE; - if (io->scsiio.kern_sg_entries == 0) { - /* No S/G list. */ + if (io->scsiio.kern_sg_entries == 0) { /* No S/G list. */ + + /* One time shift for SRR offset. */ + off += io->scsiio.ext_data_filled; + io->scsiio.ext_data_filled = 0; + *data_ptr = io->scsiio.kern_data_ptr + off; if (io->scsiio.kern_data_len - off <= bus_softc->maxio) { *dxfer_len = io->scsiio.kern_data_len - off; } else { *dxfer_len = bus_softc->maxio; - cmd_info->cur_transfer_index = -1; - cmd_info->cur_transfer_off = bus_softc->maxio; + cmd_info->cur_transfer_off += bus_softc->maxio; cmd_info->flags |= CTLFE_CMD_PIECEWISE; } *sglist_cnt = 0; @@ -738,9 +741,18 @@ ctlfedata(struct ctlfe_lun_softc *softc, *flags |= CAM_DATA_PADDR; else *flags |= CAM_DATA_VADDR; - } else { - /* S/G list with physical or virtual pointers. */ + } else { /* S/G list with physical or virtual pointers. */ ctl_sglist = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; + + /* One time shift for SRR offset. */ + while (io->scsiio.ext_data_filled >= ctl_sglist[idx].len - off) { + io->scsiio.ext_data_filled -= ctl_sglist[idx].len - off; + idx++; + off = 0; + } + off += io->scsiio.ext_data_filled; + io->scsiio.ext_data_filled = 0; + cam_sglist = cmd_info->cam_sglist; *dxfer_len = 0; for (i = 0; i < io->scsiio.kern_sg_entries - idx; i++) { @@ -818,18 +830,8 @@ ctlfestart(struct cam_periph *periph, un /* * Datamove call, we need to setup the S/G list. */ - scsi_status = 0; - csio->cdb_len = atio->cdb_len; ctlfedata(softc, io, &flags, &data_ptr, &dxfer_len, &csio->sglist_cnt); - io->scsiio.ext_data_filled += dxfer_len; - if (io->scsiio.ext_data_filled > io->scsiio.kern_total_len) { - xpt_print(periph->path, "%s: tag 0x%04x " - "fill len %u > total %u\n", - __func__, io->scsiio.tag_num, - io->scsiio.ext_data_filled, - io->scsiio.kern_total_len); - } } else { /* * We're done, send status back. @@ -891,8 +893,8 @@ ctlfestart(struct cam_periph *periph, un data_ptr = NULL; dxfer_len = 0; csio->sglist_cnt = 0; - scsi_status = 0; } + scsi_status = 0; if ((io->io_hdr.flags & CTL_FLAG_STATUS_QUEUED) && (cmd_info->flags & CTLFE_CMD_PIECEWISE) == 0 && ((io->io_hdr.flags & CTL_FLAG_DMA_QUEUED) == 0 || @@ -1246,13 +1248,36 @@ ctlfedone(struct cam_periph *periph, uni | (done_ccb->csio.msg_ptr[6]); } + /* + * If we have an SRR and we're still sending data, we + * should be able to adjust offsets and cycle again. + * It is possible only if offset is from this datamove. + */ + if (srr && (io->io_hdr.flags & CTL_FLAG_DMA_INPROG) && + srr_off >= io->scsiio.kern_rel_offset && + srr_off < io->scsiio.kern_rel_offset + + io->scsiio.kern_data_len) { + io->scsiio.kern_data_resid = + io->scsiio.kern_rel_offset + + io->scsiio.kern_data_len - srr_off; + io->scsiio.ext_data_filled = srr_off; + io->scsiio.io_hdr.status = CTL_STATUS_NONE; + io->io_hdr.flags |= CTL_FLAG_DMA_QUEUED; + softc->ccbs_freed++; + xpt_release_ccb(done_ccb); + TAILQ_INSERT_HEAD(&softc->work_queue, &atio->ccb_h, + periph_links.tqe); + xpt_schedule(periph, /*priority*/ 1); + break; + } + + /* + * If status was being sent, the back end data is now history. + * Hack it up and resubmit a new command with the CDB adjusted. + * If the SIM does the right thing, all of the resid math + * should work. + */ if (srr && (io->io_hdr.flags & CTL_FLAG_DMA_INPROG) == 0) { - /* - * If status was being sent, the back end data is now - * history. Hack it up and resubmit a new command with - * the CDB adjusted. If the SIM does the right thing, - * all of the resid math should work. - */ softc->ccbs_freed++; xpt_release_ccb(done_ccb); if (ctlfe_adjust_cdb(atio, srr_off) == 0) { @@ -1262,22 +1287,6 @@ ctlfedone(struct cam_periph *periph, uni /* * Fall through to doom.... */ - } else if (srr) { - /* - * If we have an srr and we're still sending data, we - * should be able to adjust offsets and cycle again. - */ - io->scsiio.kern_rel_offset = - io->scsiio.ext_data_filled = srr_off; - io->scsiio.ext_data_len = io->scsiio.kern_total_len - - io->scsiio.kern_rel_offset; - softc->ccbs_freed++; - io->scsiio.io_hdr.status = CTL_STATUS_NONE; - xpt_release_ccb(done_ccb); - TAILQ_INSERT_HEAD(&softc->work_queue, &atio->ccb_h, - periph_links.tqe); - xpt_schedule(periph, /*priority*/ 1); - break; } if ((done_ccb->ccb_h.flags & CAM_SEND_STATUS) && @@ -1320,16 +1329,6 @@ ctlfedone(struct cam_periph *periph, uni io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG; - io->scsiio.ext_data_len += csio->dxfer_len; - if (io->scsiio.ext_data_len > - io->scsiio.kern_total_len) { - xpt_print(periph->path, "%s: tag 0x%04x " - "done len %u > total %u sent %u\n", - __func__, io->scsiio.tag_num, - io->scsiio.ext_data_len, - io->scsiio.kern_total_len, - io->scsiio.ext_data_filled); - } /* * Translate CAM status to CTL status. Success * does not change the overall, ctl_io status. In @@ -1339,6 +1338,7 @@ ctlfedone(struct cam_periph *periph, uni */ switch (done_ccb->ccb_h.status & CAM_STATUS_MASK) { case CAM_REQ_CMP: + io->scsiio.kern_data_resid -= csio->dxfer_len; io->io_hdr.port_status = 0; break; default: @@ -1368,7 +1368,6 @@ ctlfedone(struct cam_periph *periph, uni if ((cmd_info->flags & CTLFE_CMD_PIECEWISE) && (io->io_hdr.port_status == 0)) { ccb_flags flags; - uint8_t scsi_status; uint8_t *data_ptr; uint32_t dxfer_len; @@ -1379,8 +1378,6 @@ ctlfedone(struct cam_periph *periph, uni ctlfedata(softc, io, &flags, &data_ptr, &dxfer_len, &csio->sglist_cnt); - scsi_status = 0; - if (((flags & CAM_SEND_STATUS) == 0) && (dxfer_len == 0)) { printf("%s: tag %04x no status or " @@ -1400,7 +1397,7 @@ ctlfedone(struct cam_periph *periph, uni MSG_SIMPLE_Q_TAG : 0, atio->tag_id, atio->init_id, - scsi_status, + 0, /*data_ptr*/ data_ptr, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 16 16:44:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2B92CB2F29; Mon, 16 Jan 2017 16:44:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6630B10F9; Mon, 16 Jan 2017 16:44:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GGiE2o045308; Mon, 16 Jan 2017 16:44:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GGiDcU045297; Mon, 16 Jan 2017 16:44:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701161644.v0GGiDcU045297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 16 Jan 2017 16:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312292 - in head/sys/arm: arm 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, 16 Jan 2017 16:44:15 -0000 Author: ian Date: Mon Jan 16 16:44:13 2017 New Revision: 312292 URL: https://svnweb.freebsd.org/changeset/base/312292 Log: Remove arm's cpuconf.h, and references to it, after moving a few lines from it into pmap-v4.h where they are used. Other than those few lines of support for different MMU types, nothing in cpuconf.h has been used in our code for quite a while. The file existed to set up a variety of symbols to describe the architecture. Over the past few years we have converted all of our source to use the new architecture symbols standardized by ARM Inc, and predefined by both clang and gcc. PR: 216104 Deleted: head/sys/arm/include/cpuconf.h Modified: head/sys/arm/arm/bus_space_asm_generic.S head/sys/arm/arm/cpufunc.c head/sys/arm/arm/identcpu-v4.c head/sys/arm/arm/locore-v4.S head/sys/arm/arm/locore-v6.S head/sys/arm/include/atomic.h head/sys/arm/include/cpufunc.h head/sys/arm/include/pcpu.h head/sys/arm/include/pmap-v4.h Modified: head/sys/arm/arm/bus_space_asm_generic.S ============================================================================== --- head/sys/arm/arm/bus_space_asm_generic.S Mon Jan 16 16:19:55 2017 (r312291) +++ head/sys/arm/arm/bus_space_asm_generic.S Mon Jan 16 16:44:13 2017 (r312292) @@ -36,7 +36,6 @@ */ #include -#include __FBSDID("$FreeBSD$"); /* Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Mon Jan 16 16:19:55 2017 (r312291) +++ head/sys/arm/arm/cpufunc.c Mon Jan 16 16:44:13 2017 (r312292) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #if defined(CPU_XSCALE_81342) Modified: head/sys/arm/arm/identcpu-v4.c ============================================================================== --- head/sys/arm/arm/identcpu-v4.c Mon Jan 16 16:19:55 2017 (r312291) +++ head/sys/arm/arm/identcpu-v4.c Mon Jan 16 16:44:13 2017 (r312292) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include char machine[] = "arm"; Modified: head/sys/arm/arm/locore-v4.S ============================================================================== --- head/sys/arm/arm/locore-v4.S Mon Jan 16 16:19:55 2017 (r312291) +++ head/sys/arm/arm/locore-v4.S Mon Jan 16 16:44:13 2017 (r312292) @@ -37,7 +37,6 @@ #include #include #include -#include #include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/arm/locore-v6.S ============================================================================== --- head/sys/arm/arm/locore-v6.S Mon Jan 16 16:19:55 2017 (r312291) +++ head/sys/arm/arm/locore-v6.S Mon Jan 16 16:44:13 2017 (r312292) @@ -34,7 +34,6 @@ #include #include #include -#include #include __FBSDID("$FreeBSD$"); Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Mon Jan 16 16:19:55 2017 (r312291) +++ head/sys/arm/include/atomic.h Mon Jan 16 16:44:13 2017 (r312292) @@ -44,8 +44,6 @@ #ifndef _KERNEL #include -#else -#include #endif #if __ARM_ARCH >= 6 Modified: head/sys/arm/include/cpufunc.h ============================================================================== --- head/sys/arm/include/cpufunc.h Mon Jan 16 16:19:55 2017 (r312291) +++ head/sys/arm/include/cpufunc.h Mon Jan 16 16:44:13 2017 (r312292) @@ -48,7 +48,6 @@ #include #include -#include static __inline void breakpoint(void) Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Mon Jan 16 16:19:55 2017 (r312291) +++ head/sys/arm/include/pcpu.h Mon Jan 16 16:44:13 2017 (r312292) @@ -32,8 +32,6 @@ #ifdef _KERNEL -#include - #define ALT_STACK_SIZE 128 struct vmspace; Modified: head/sys/arm/include/pmap-v4.h ============================================================================== --- head/sys/arm/include/pmap-v4.h Mon Jan 16 16:19:55 2017 (r312291) +++ head/sys/arm/include/pmap-v4.h Mon Jan 16 16:44:13 2017 (r312292) @@ -51,7 +51,30 @@ #define _MACHINE_PMAP_V4_H_ #include -#include + +/* + * Define the MMU types we support based on the cpu types. While the code has + * some theoretical support for multiple MMU types in a single kernel, there are + * no actual working configurations that use that feature. + */ +#if (defined(CPU_ARM9) || defined(CPU_ARM9E) || defined(CPU_FA526)) +#define ARM_MMU_GENERIC 1 +#else +#define ARM_MMU_GENERIC 0 +#endif + +#if (defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ + defined(CPU_XSCALE_81342)) +#define ARM_MMU_XSCALE 1 +#else +#define ARM_MMU_XSCALE 0 +#endif + +#define ARM_NMMUS (ARM_MMU_GENERIC + ARM_MMU_XSCALE) +#if ARM_NMMUS == 0 && !defined(KLD_MODULE) && defined(_KERNEL) +#error ARM_NMMUS is 0 +#endif + /* * Pte related macros */ From owner-svn-src-all@freebsd.org Mon Jan 16 16:58:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CF21CAF914; Mon, 16 Jan 2017 16:58:14 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 297CF1064; Mon, 16 Jan 2017 16:58:14 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GGwDNl050068; Mon, 16 Jan 2017 16:58:13 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GGwD0Z050066; Mon, 16 Jan 2017 16:58:13 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701161658.v0GGwD0Z050066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 16 Jan 2017 16:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312293 - in head/sys: kern 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: Mon, 16 Jan 2017 16:58:14 -0000 Author: sbruno Date: Mon Jan 16 16:58:12 2017 New Revision: 312293 URL: https://svnweb.freebsd.org/changeset/base/312293 Log: Change startup order for the no EARLY_AP_STARTUP case to initialize gtaskqueue bits at SI_SUB_INIT_IF instead of waiting until SI_SUB_SMP which is far too late. Add an assertion in taskqgroup_attach() to catch startup initialization failures in the future. Reported by: kib bde Modified: head/sys/kern/subr_gtaskqueue.c head/sys/sys/gtaskqueue.h Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Mon Jan 16 16:44:13 2017 (r312292) +++ head/sys/kern/subr_gtaskqueue.c Mon Jan 16 16:58:12 2017 (r312293) @@ -646,6 +646,7 @@ taskqgroup_attach(struct taskqgroup *qgr qid = taskqgroup_find(qgroup, uniq); qgroup->tqg_queue[qid].tgc_cnt++; LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); + MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL); gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; if (irq != -1 && (smp_started || mp_ncpus == 1)) { gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu; Modified: head/sys/sys/gtaskqueue.h ============================================================================== --- head/sys/sys/gtaskqueue.h Mon Jan 16 16:44:13 2017 (r312292) +++ head/sys/sys/gtaskqueue.h Mon Jan 16 16:58:12 2017 (r312293) @@ -115,7 +115,7 @@ taskqgroup_adjust_##name(void *arg) taskqgroup_adjust(qgroup_##name, (cnt), (stride)); \ } \ \ -SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY, \ +SYSINIT(taskqgroup_adj_##name, SI_SUB_INIT_IF, SI_ORDER_ANY, \ taskqgroup_adjust_##name, NULL); \ \ struct __hack From owner-svn-src-all@freebsd.org Mon Jan 16 17:25:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58B18CB1707; Mon, 16 Jan 2017 17:25: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 25AB51614; Mon, 16 Jan 2017 17:25: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 v0GHPoxQ063056; Mon, 16 Jan 2017 17:25:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GHPn19063043; Mon, 16 Jan 2017 17:25:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701161725.v0GHPn19063043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 16 Jan 2017 17:25:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312294 - in vendor/NetBSD/tests/dist: lib/libc/ssp lib/libc/sys lib/libpthread net/carp 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: Mon, 16 Jan 2017 17:25:51 -0000 Author: ngie Date: Mon Jan 16 17:25:48 2017 New Revision: 312294 URL: https://svnweb.freebsd.org/changeset/base/312294 Log: Sync from NetBSD again to pick up more test fixes/enhancements pushed upstream Added: vendor/NetBSD/tests/dist/net/carp/t_basic.sh (contents, props changed) Deleted: vendor/NetBSD/tests/dist/net/carp/t_basic.c Modified: vendor/NetBSD/tests/dist/lib/libc/ssp/h_memset.c vendor/NetBSD/tests/dist/lib/libc/ssp/h_read.c vendor/NetBSD/tests/dist/lib/libc/sys/t_mmap.c vendor/NetBSD/tests/dist/lib/libc/sys/t_timer_create.c vendor/NetBSD/tests/dist/lib/libpthread/t_condwait.c vendor/NetBSD/tests/dist/lib/libpthread/t_detach.c vendor/NetBSD/tests/dist/lib/libpthread/t_fork.c vendor/NetBSD/tests/dist/lib/libpthread/t_fpu.c vendor/NetBSD/tests/dist/lib/libpthread/t_mutex.c vendor/NetBSD/tests/dist/lib/libpthread/t_sem.c vendor/NetBSD/tests/dist/lib/libpthread/t_swapcontext.c Modified: vendor/NetBSD/tests/dist/lib/libc/ssp/h_memset.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/ssp/h_memset.c Mon Jan 16 16:58:12 2017 (r312293) +++ vendor/NetBSD/tests/dist/lib/libc/ssp/h_memset.c Mon Jan 16 17:25:48 2017 (r312294) @@ -1,4 +1,4 @@ -/* $NetBSD: h_memset.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */ +/* $NetBSD: h_memset.c,v 1.2 2017/01/16 16:34:24 christos Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: h_memset.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $"); +__RCSID("$NetBSD: h_memset.c,v 1.2 2017/01/16 16:34:24 christos Exp $"); #include #include @@ -41,5 +41,5 @@ main(int argc, char *argv[]) char b[10]; size_t len = atoi(argv[1]); (void)memset(b, 0, len); - return 0; + return b[0]; /* keeps optimizer from zapping the call to memset() */ } Modified: vendor/NetBSD/tests/dist/lib/libc/ssp/h_read.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/ssp/h_read.c Mon Jan 16 16:58:12 2017 (r312293) +++ vendor/NetBSD/tests/dist/lib/libc/ssp/h_read.c Mon Jan 16 17:25:48 2017 (r312294) @@ -1,4 +1,4 @@ -/* $NetBSD: h_read.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $ */ +/* $NetBSD: h_read.c,v 1.2 2017/01/16 16:35:57 christos Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,9 +29,11 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: h_read.c,v 1.1 2010/12/27 02:04:19 pgoyette Exp $"); +__RCSID("$NetBSD: h_read.c,v 1.2 2017/01/16 16:35:57 christos Exp $"); #include +#include +#include #include #include #include @@ -40,8 +42,13 @@ int main(int argc, char *argv[]) { char b[MAXPATHLEN]; + int fd, n; size_t len = atoi(argv[1]); - (void)read(0, b, len); + + if ((fd = open(_PATH_DEVZERO, O_RDONLY)) == -1) + abort(); + if ((n = read(fd, b, len)) == -1) + abort(); (void)printf("%s\n", b); - return 0; + return (0); } Modified: vendor/NetBSD/tests/dist/lib/libc/sys/t_mmap.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/sys/t_mmap.c Mon Jan 16 16:58:12 2017 (r312293) +++ vendor/NetBSD/tests/dist/lib/libc/sys/t_mmap.c Mon Jan 16 17:25:48 2017 (r312294) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mmap.c,v 1.11 2017/01/13 20:43:11 christos Exp $ */ +/* $NetBSD: t_mmap.c,v 1.12 2017/01/16 16:31:05 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -55,9 +55,10 @@ * SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_mmap.c,v 1.11 2017/01/13 20:43:11 christos Exp $"); +__RCSID("$NetBSD: t_mmap.c,v 1.12 2017/01/16 16:31:05 christos Exp $"); #include +#include #include #include #include @@ -73,7 +74,6 @@ __RCSID("$NetBSD: t_mmap.c,v 1.11 2017/0 #include #include #include -#include static long page = 0; static char path[] = "mmap"; Modified: vendor/NetBSD/tests/dist/lib/libc/sys/t_timer_create.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libc/sys/t_timer_create.c Mon Jan 16 16:58:12 2017 (r312293) +++ vendor/NetBSD/tests/dist/lib/libc/sys/t_timer_create.c Mon Jan 16 17:25:48 2017 (r312294) @@ -1,4 +1,4 @@ -/* $NetBSD: t_timer_create.c,v 1.4 2012/03/18 07:00:52 jruoho Exp $ */ +/* $NetBSD: t_timer_create.c,v 1.5 2017/01/16 16:32:13 christos Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ static timer_t t; static bool fail = true; static void -timer_signal_handler(int signo, siginfo_t *si, void *osi) +timer_signal_handler(int signo, siginfo_t *si, void *osi __unused) { timer_t *tp; Modified: vendor/NetBSD/tests/dist/lib/libpthread/t_condwait.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libpthread/t_condwait.c Mon Jan 16 16:58:12 2017 (r312293) +++ vendor/NetBSD/tests/dist/lib/libpthread/t_condwait.c Mon Jan 16 17:25:48 2017 (r312294) @@ -1,4 +1,4 @@ -/* $NetBSD: t_condwait.c,v 1.4 2013/04/12 17:18:11 christos Exp $ */ +/* $NetBSD: t_condwait.c,v 1.5 2017/01/16 16:29:19 christos Exp $ */ /* * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -26,8 +26,9 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_condwait.c,v 1.4 2013/04/12 17:18:11 christos Exp $"); +__RCSID("$NetBSD: t_condwait.c,v 1.5 2017/01/16 16:29:19 christos Exp $"); +#include #include #include #include @@ -40,6 +41,8 @@ __RCSID("$NetBSD: t_condwait.c,v 1.4 201 #include "isqemu.h" +#include "h_common.h" + #define WAITTIME 2 /* Timeout wait secound */ static const int debug = 1; @@ -56,8 +59,8 @@ run(void *param) clck = *(clockid_t *)param; - pthread_condattr_init(&attr); - pthread_condattr_setclock(&attr, clck); /* MONOTONIC or MONOTONIC */ + PTHREAD_REQUIRE(pthread_condattr_init(&attr)); + PTHREAD_REQUIRE(pthread_condattr_setclock(&attr, clck)); pthread_cond_init(&cond, &attr); ATF_REQUIRE_EQ((ret = pthread_mutex_lock(&m)), 0); Modified: vendor/NetBSD/tests/dist/lib/libpthread/t_detach.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libpthread/t_detach.c Mon Jan 16 16:58:12 2017 (r312293) +++ vendor/NetBSD/tests/dist/lib/libpthread/t_detach.c Mon Jan 16 17:25:48 2017 (r312294) @@ -1,4 +1,4 @@ -/* $NetBSD: t_detach.c,v 1.1 2011/03/24 13:52:04 jruoho Exp $ */ +/* $NetBSD: t_detach.c,v 1.2 2017/01/16 16:29:54 christos Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -29,10 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_detach.c,v 1.1 2011/03/24 13:52:04 jruoho Exp $"); +__RCSID("$NetBSD: t_detach.c,v 1.2 2017/01/16 16:29:54 christos Exp $"); -#include #include +#include +#include #include @@ -43,6 +44,7 @@ static void *func(void *); static void * func(void *arg) { + sleep(2); return NULL; } @@ -72,14 +74,17 @@ ATF_TC_BODY(pthread_detach, tc) */ PTHREAD_REQUIRE(pthread_detach(t)); + sleep(1); rv = pthread_join(t, NULL); ATF_REQUIRE(rv == EINVAL); + sleep(3); + /* * As usual, ESRCH should follow if * we try to detach an invalid thread. */ - rv = pthread_cancel(NULL); + rv = pthread_cancel(t); ATF_REQUIRE(rv == ESRCH); } Modified: vendor/NetBSD/tests/dist/lib/libpthread/t_fork.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libpthread/t_fork.c Mon Jan 16 16:58:12 2017 (r312293) +++ vendor/NetBSD/tests/dist/lib/libpthread/t_fork.c Mon Jan 16 17:25:48 2017 (r312294) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fork.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $ */ +/* $NetBSD: t_fork.c,v 1.2 2017/01/16 16:28:27 christos Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_fork.c,v 1.1 2010/07/16 15:42:53 jmmv Exp $"); +__RCSID("$NetBSD: t_fork.c,v 1.2 2017/01/16 16:28:27 christos Exp $"); /* * Written by Love Hörnquist Åstrand , March 2003. @@ -61,7 +61,7 @@ print_pid(void *arg) thread_survived = 1; if (parent != getpid()) { - exit(1); + _exit(1); } return NULL; } @@ -95,7 +95,7 @@ ATF_TC_BODY(fork, tc) ATF_REQUIRE_EQ_MSG(WEXITSTATUS(status), 0, "thread survived in child"); } else { sleep(5); - exit(thread_survived ? 1 : 0); + _exit(thread_survived ? 1 : 0); } } Modified: vendor/NetBSD/tests/dist/lib/libpthread/t_fpu.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libpthread/t_fpu.c Mon Jan 16 16:58:12 2017 (r312293) +++ vendor/NetBSD/tests/dist/lib/libpthread/t_fpu.c Mon Jan 16 17:25:48 2017 (r312294) @@ -1,4 +1,4 @@ -/* $NetBSD: t_fpu.c,v 1.2 2013/01/27 14:47:37 mbalmer Exp $ */ +/* $NetBSD: t_fpu.c,v 1.3 2017/01/16 16:27:43 christos Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_fpu.c,v 1.2 2013/01/27 14:47:37 mbalmer Exp $"); +__RCSID("$NetBSD: t_fpu.c,v 1.3 2017/01/16 16:27:43 christos Exp $"); /* * This is adapted from part of csw/cstest of the MPD implementation by @@ -49,10 +49,12 @@ __RCSID("$NetBSD: t_fpu.c,v 1.2 2013/01/ * . */ +#include #include #include #include #include +#include #include #include @@ -77,14 +79,16 @@ stir(void *p) for (;;) { x = sin ((y = cos (x + y + .4)) - (z = cos (x + z + .6))); - PTHREAD_REQUIRE(sched_yield()); + ATF_REQUIRE_MSG(sched_yield() == 0, + "sched_yield failed: %s", strerror(errno)); } } static double mul3(double x, double y, double z) { - PTHREAD_REQUIRE(sched_yield()); + ATF_REQUIRE_MSG(sched_yield() == 0, + "sched_yield failed: %s", strerror(errno)); return x * y * z; } @@ -114,7 +118,7 @@ bar(void *p) static void recurse(void) { pthread_t s2; - pthread_create(&s2, 0, bar, 0); + PTHREAD_REQUIRE(pthread_create(&s2, 0, bar, 0)); sleep(20); /* XXX must be long enough for our slowest machine */ } @@ -134,7 +138,7 @@ ATF_TC_BODY(fpu, tc) PTHREAD_REQUIRE(pthread_mutex_init(&recursion_depth_lock, 0)); - pthread_create(&s5, 0, stir, stirseed); + PTHREAD_REQUIRE(pthread_create(&s5, 0, stir, stirseed)); recurse(); atf_tc_fail("exiting from main"); Modified: vendor/NetBSD/tests/dist/lib/libpthread/t_mutex.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libpthread/t_mutex.c Mon Jan 16 16:58:12 2017 (r312293) +++ vendor/NetBSD/tests/dist/lib/libpthread/t_mutex.c Mon Jan 16 17:25:48 2017 (r312294) @@ -1,4 +1,4 @@ -/* $NetBSD: t_mutex.c,v 1.14 2016/10/31 23:51:20 christos Exp $ */ +/* $NetBSD: t_mutex.c,v 1.15 2017/01/16 16:23:41 christos Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,8 +29,10 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_mutex.c,v 1.14 2016/10/31 23:51:20 christos Exp $"); +__RCSID("$NetBSD: t_mutex.c,v 1.15 2017/01/16 16:23:41 christos Exp $"); +#include /* For timespecadd */ +#include /* For UINT16_MAX */ #include #include #include @@ -570,9 +572,16 @@ ATF_TC_BODY(mutexattr2, tc) int min_prio = sched_get_priority_min(SCHED_FIFO); for (int i = min_prio; i <= max_prio; i++) { int prioceiling; + int protocol; + + PTHREAD_REQUIRE(pthread_mutexattr_getprotocol(&mattr, + &protocol)); + + printf("priority: %d\nprotocol: %d\n", i, protocol); PTHREAD_REQUIRE(pthread_mutexattr_setprioceiling(&mattr, i)); PTHREAD_REQUIRE(pthread_mutexattr_getprioceiling(&mattr, &prioceiling)); + printf("prioceiling: %d\n", prioceiling); ATF_REQUIRE_EQ(i, prioceiling); } } Modified: vendor/NetBSD/tests/dist/lib/libpthread/t_sem.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libpthread/t_sem.c Mon Jan 16 16:58:12 2017 (r312293) +++ vendor/NetBSD/tests/dist/lib/libpthread/t_sem.c Mon Jan 16 17:25:48 2017 (r312294) @@ -1,4 +1,4 @@ -/* $NetBSD: t_sem.c,v 1.8 2014/11/04 00:20:19 justin Exp $ */ +/* $NetBSD: t_sem.c,v 1.9 2017/01/16 16:22:22 christos Exp $ */ /* * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. @@ -86,8 +86,9 @@ #include __COPYRIGHT("@(#) Copyright (c) 2008, 2010\ The NetBSD Foundation, inc. All rights reserved."); -__RCSID("$NetBSD: t_sem.c,v 1.8 2014/11/04 00:20:19 justin Exp $"); +__RCSID("$NetBSD: t_sem.c,v 1.9 2017/01/16 16:22:22 christos Exp $"); +#include #include #include #include Modified: vendor/NetBSD/tests/dist/lib/libpthread/t_swapcontext.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libpthread/t_swapcontext.c Mon Jan 16 16:58:12 2017 (r312293) +++ vendor/NetBSD/tests/dist/lib/libpthread/t_swapcontext.c Mon Jan 16 17:25:48 2017 (r312294) @@ -1,4 +1,4 @@ -/* $NetBSD: t_swapcontext.c,v 1.2 2014/08/25 16:31:15 bouyer Exp $ */ +/* $NetBSD: t_swapcontext.c,v 1.3 2017/01/16 16:27:06 christos Exp $ */ /* * Copyright (c) 2012 Emmanuel Dreyfus. All rights reserved. @@ -28,10 +28,13 @@ #include __RCSID("$NetBSD"); +#include +#include #include -#include #include #include +#include +#include #include @@ -77,7 +80,8 @@ threadfunc(void *arg) oself = (void *)pthread_self(); printf("before swapcontext self = %p\n", oself); - PTHREAD_REQUIRE(swapcontext(&octx, &nctx)); + ATF_REQUIRE_MSG(swapcontext(&octx, &nctx) != -1, "swapcontext failed: %s", + strerror(errno)); /* NOTREACHED */ return NULL; @@ -99,7 +103,8 @@ ATF_TC_BODY(swapcontext1, tc) printf("Testing if swapcontext() alters pthread_self()\n"); - PTHREAD_REQUIRE(getcontext(&nctx)); + ATF_REQUIRE_MSG(getcontext(&nctx) != -1, "getcontext failed: %s", + strerror(errno)); PTHREAD_REQUIRE(pthread_create(&thread, NULL, threadfunc, NULL)); PTHREAD_REQUIRE(pthread_join(thread, NULL)); } Added: vendor/NetBSD/tests/dist/net/carp/t_basic.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/NetBSD/tests/dist/net/carp/t_basic.sh Mon Jan 16 17:25:48 2017 (r312294) @@ -0,0 +1,165 @@ +# $NetBSD: t_basic.sh,v 1.1 2017/01/16 08:18:11 ozaki-r Exp $ +# +# Copyright (c) 2017 Internet Initiative Japan 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. +# + +SOCK_CLIENT=unix://carp_client +SOCK_MASTER=unix://carp_master +SOCK_BACKUP=unix://carp_backup +BUS=bus_carp +IP_CLIENT=10.1.1.240 +IP_MASTER=10.1.1.1 +IP_BACKUP=10.1.1.2 +IP_CARP=10.1.1.100 +TIMEOUT=3 + +atf_test_case carp_handover cleanup + +carp_handover_head() +{ + + atf_set "descr" "Tests for CARP handover" + atf_set "require.progs" "rump_server" +} + +setup_carp() +{ + local sock=$1 + local master=$2 + local carpif= ip= advskew= + + if $master; then + carpif=carp0 + ip=$IP_MASTER + advskew=0 + else + carpif=carp1 + ip=$IP_BACKUP + advskew=200 + fi + + export RUMP_SERVER=$sock + atf_check -s exit:0 rump.ifconfig $carpif create + atf_check -s exit:0 rump.ifconfig shmif0 $ip/24 up + atf_check -s exit:0 rump.ifconfig $carpif \ + vhid 175 advskew $advskew advbase 1 pass s3cret \ + $IP_CARP netmask 255.255.255.0 + atf_check -s exit:0 rump.ifconfig -w 10 +} + +wait_handover() +{ + local i=0 + + export RUMP_SERVER=$SOCK_CLIENT + + while [ $i -ne 5 ]; do + $DEBUG && echo "Trying ping $IP_CARP" + rump.ping -n -w 1 -c 1 $IP_CARP >/dev/null + if [ $? = 0 ]; then + $DEBUG && echo "Passed ping $IP_CARP" + break; + fi + $DEBUG && echo "Failed ping $IP_CARP" + i=$((i + 1)) + done + + if [ $i -eq 5 ]; then + atf_fail "Failed to failover (5 sec)" + fi +} + +carp_handover_body() +{ + + rump_server_start $SOCK_CLIENT + rump_server_start $SOCK_MASTER + rump_server_start $SOCK_BACKUP + + rump_server_add_iface $SOCK_CLIENT shmif0 $BUS + rump_server_add_iface $SOCK_MASTER shmif0 $BUS + rump_server_add_iface $SOCK_BACKUP shmif0 $BUS + + setup_carp $SOCK_MASTER true + setup_carp $SOCK_BACKUP false + + export RUMP_SERVER=$SOCK_CLIENT + atf_check -s exit:0 rump.ifconfig shmif0 $IP_CLIENT/24 up + atf_check -s exit:0 rump.ifconfig -w 10 + + # Check that the primary addresses are up + atf_check -s exit:0 -o ignore \ + rump.ping -n -w $TIMEOUT -c 1 $IP_MASTER + atf_check -s exit:0 -o ignore \ + rump.ping -n -w $TIMEOUT -c 1 $IP_BACKUP + + # Give carp a while to croak + sleep 4 + + # Check state + export RUMP_SERVER=$SOCK_MASTER + $DEBUG && rump.ifconfig + atf_check -s exit:0 -o match:'carp: MASTER carpdev shmif0' \ + rump.ifconfig carp0 + export RUMP_SERVER=$SOCK_BACKUP + $DEBUG && rump.ifconfig + atf_check -s exit:0 -o match:'carp: BACKUP carpdev shmif0' \ + rump.ifconfig carp1 + export RUMP_SERVER=$SOCK_CLIENT + + # Check that the shared IP works + atf_check -s exit:0 -o ignore \ + rump.ping -n -w $TIMEOUT -c 1 $IP_CARP + + # KILLING SPREE + env RUMP_SERVER=$SOCK_MASTER rump.halt + sleep 1 + + # Check that primary is now dead + atf_check -s not-exit:0 -o ignore \ + rump.ping -n -w $TIMEOUT -c 1 $IP_MASTER + + # Do it in installments. carp will cluck meanwhile + wait_handover + + # Check state + export RUMP_SERVER=$SOCK_BACKUP + $DEBUG && rump.ifconfig + atf_check -s exit:0 -o match:'carp: MASTER carpdev shmif0' \ + rump.ifconfig carp1 +} + +carp_handover_cleanup() +{ + + $DEBUG && dump + cleanup +} + +atf_init_test_cases() +{ + + atf_add_test_case carp_handover +} From owner-svn-src-all@freebsd.org Mon Jan 16 17:34:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D68BCCB1930; Mon, 16 Jan 2017 17:34:18 +0000 (UTC) (envelope-from hiren@freebsd.org) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id C5CA91AF4; Mon, 16 Jan 2017 17:34:17 +0000 (UTC) (envelope-from hiren@freebsd.org) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id F35A917661; Mon, 16 Jan 2017 09:28:17 -0800 (PST) Date: Mon, 16 Jan 2017 09:28:17 -0800 From: Hiren Panchasara To: Sergey Kandaurov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312277 - in head/sys: kern sys Message-ID: <20170116172817.GC86256@strugglingcoder.info> References: <201701160825.v0G8PYL4036827@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="L6iaP+gRLNZHKoI4" Content-Disposition: inline In-Reply-To: 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: Mon, 16 Jan 2017 17:34:19 -0000 --L6iaP+gRLNZHKoI4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 01/16/17 at 12:39P, Sergey Kandaurov wrote: > On 16 January 2017 at 11:25, Hiren Panchasara wrote: >=20 > > Author: hiren > > Date: Mon Jan 16 08:25:33 2017 > > New Revision: 312277 > > URL: https://svnweb.freebsd.org/changeset/base/312277 > > > > Log: > > Add kevent EVFILT_EMPTY for notification when a client has received a= ll > > data > > i.e. everything outstanding has been acked. > > > > Reviewed by: bz, gnn (previous version) > > MFC after: 3 days > > Sponsored by: Limelight Networks > > Differential Revision: https://reviews.freebsd.org/D9150 > > > > Modified: > > head/sys/kern/kern_event.c > > head/sys/kern/uipc_socket.c > > head/sys/sys/event.h > > > > > Hello. >=20 > Is kqueue(2) man page update planned? Thanks for the reminder, I'll do it. Cheers, Hiren --L6iaP+gRLNZHKoI4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJYfQKxXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lY1kIAJrTvXKoqxs8+OuxHVP3sA+4 qnB5h4kSuJHwoUplVQPpwT86CWwCGtQmEZUh2sAcS7CCllpGX+G1WmUhjr+BZCih /Llr2dclzqu8EqzNXdI+fQLoTkab5OyPKgWFlvrDVj8WOJPD5AizBeIGK6r22BYh U+M9cF2GxYaLaZIBEMacmGUMtCJzKkarQBZ1SQEX+/nGGHtT+P502+NxI1KEVNhp PZtPKaBKp+9Eof4c5efGNF06LMh4FPCerJnZMaxMspfh1eR6khWamj/Cq9/fjKv/ 3yJl348cq+7n+gHOGtraQQ/mqbw1YLGB2/Nc6rjf2v4XNx9XKS41Sp680BnzGcg= =N/Ud -----END PGP SIGNATURE----- --L6iaP+gRLNZHKoI4-- From owner-svn-src-all@freebsd.org Mon Jan 16 17:46:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 518FECB20E8; Mon, 16 Jan 2017 17:46:41 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE77D164B; Mon, 16 Jan 2017 17:46:40 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GHkeYu071541; Mon, 16 Jan 2017 17:46:40 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GHkcPX071529; Mon, 16 Jan 2017 17:46:38 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201701161746.v0GHkcPX071529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 16 Jan 2017 17:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg 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, 16 Jan 2017 17:46:41 -0000 Author: sobomax Date: Mon Jan 16 17:46:38 2017 New Revision: 312296 URL: https://svnweb.freebsd.org/changeset/base/312296 Log: Add a new socket option SO_TS_CLOCK to pick from several different clock sources to return timestamps when SO_TIMESTAMP is enabled. Two additional clock sources are: o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME); o nanosecond resolution monotonic clock (equivalent of CLOCK_MONOTONIC). In addition to this, this option provides unified interface to get bintime (equivalent of using SO_BINTIME), except it also supported with IPv6 where SO_BINTIME has never been supported. The long term plan is to depreciate SO_BINTIME and move everything to using SO_TS_CLOCK. Idea for this enhancement has been briefly discussed on the Net session during dev summit in Ottawa last June and the general input was positive. This change is believed to benefit network benchmarks/profiling as well as other scenarios where precise time of arrival measurement is necessary. There are two regression test cases as part of this commit: one extends unix domain test code (unix_cmsg) to test new SCM_XXX types and another one implementis totally new test case which exchanges UDP packets between two processes using both conventional methods (i.e. calling clock_gettime(2) before recv(2) and after send(2)), as well as using setsockopt()+recv() in receive path. The resulting delays are checked for sanity for all supported clock types. Reviewed by: adrian, gnn Differential Revision: https://reviews.freebsd.org/D9171 Added: head/tools/regression/sockets/udp_pingpong/ head/tools/regression/sockets/udp_pingpong/Makefile (contents, props changed) head/tools/regression/sockets/udp_pingpong/udp_pingpong.c (contents, props changed) Modified: head/lib/libc/sys/getsockopt.2 head/sys/kern/uipc_socket.c head/sys/kern/uipc_usrreq.c head/sys/netinet/ip_input.c head/sys/netinet6/ip6_input.c head/sys/sys/socket.h head/sys/sys/socketvar.h head/tools/regression/sockets/unix_cmsg/Makefile head/tools/regression/sockets/unix_cmsg/unix_cmsg.c Modified: head/lib/libc/sys/getsockopt.2 ============================================================================== --- head/lib/libc/sys/getsockopt.2 Mon Jan 16 17:43:43 2017 (r312295) +++ head/lib/libc/sys/getsockopt.2 Mon Jan 16 17:46:38 2017 (r312296) @@ -187,6 +187,7 @@ The following options are recognized in .It Dv SO_LISTENQLEN Ta "get complete queue length of the socket (get only)" .It Dv SO_LISTENINCQLEN Ta "get incomplete queue length of the socket (get only)" .It Dv SO_USER_COOKIE Ta "set the 'so_user_cookie' value for the socket (uint32_t, set only)" +.It Dv SO_TS_CLOCK Ta "set specific format of timestamp returned by SO_TIMESTAMP" .El .Pp .Dv SO_DEBUG @@ -435,7 +436,7 @@ for .Dv SO_BINTIME . The .Vt cmsghdr -fields have the following values for TIMESTAMP: +fields have the following values for TIMESTAMP by default: .Bd -literal cmsg_len = CMSG_LEN(sizeof(struct timeval)); cmsg_level = SOL_SOCKET; @@ -450,6 +451,24 @@ and for cmsg_type = SCM_BINTIME; .Ed .Pp +Additional timestamp types are available by following +.Dv SO_TIMESTAMP +with +.Dv SO_TS_CLOCK , +which requests specific timestamp format to be returned instead of +.Dv SCM_TIMESTAMP when +.Dv SO_TIMESTAMP is enabled. +The following +.Dv SO_TS_CLOCK +values are recognized in +.Fx : +.Bl -column SO_TS_CLOCK -offset indent +.It Dv SO_TS_REALTIME_MICRO Ta "realtime (SCM_TIMESTAMP, struct timeval), default" +.It Dv SO_TS_BINTIME Ta "realtime (SCM_BINTIME, struct bintime)" +.It Dv SO_TS_REALTIME Ta "realtime (SCM_REALTIME, struct timespec)" +.It Dv SO_TS_MONOTONIC Ta "monotonic time (SCM_MONOTONIC, struct timespec)" +.El +.Pp .Dv SO_ACCEPTCONN , .Dv SO_TYPE , .Dv SO_PROTOCOL Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Jan 16 17:43:43 2017 (r312295) +++ head/sys/kern/uipc_socket.c Mon Jan 16 17:46:38 2017 (r312296) @@ -2687,6 +2687,18 @@ sosetopt(struct socket *so, struct socko #endif break; + case SO_TS_CLOCK: + error = sooptcopyin(sopt, &optval, sizeof optval, + sizeof optval); + if (error) + goto bad; + if (optval < 0 || optval > SO_TS_CLOCK_MAX) { + error = EINVAL; + goto bad; + } + so->so_ts_clock = optval; + break; + default: if (V_socket_hhh[HHOOK_SOCKET_OPT]->hhh_nhooks > 0) error = hhook_run_socket(so, sopt, @@ -2874,6 +2886,10 @@ integer: optval = so->so_incqlen; goto integer; + case SO_TS_CLOCK: + optval = so->so_ts_clock; + goto integer; + default: if (V_socket_hhh[HHOOK_SOCKET_OPT]->hhh_nhooks > 0) error = hhook_run_socket(so, sopt, Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Mon Jan 16 17:43:43 2017 (r312295) +++ head/sys/kern/uipc_usrreq.c Mon Jan 16 17:46:38 2017 (r312296) @@ -1899,6 +1899,7 @@ unp_internalize(struct mbuf **controlp, struct filedescent *fde, **fdep, *fdev; struct file *fp; struct timeval *tv; + struct timespec *ts; int i, *fdp; void *data; socklen_t clen = control->m_len, datalen; @@ -2019,6 +2020,30 @@ unp_internalize(struct mbuf **controlp, bintime(bt); break; + case SCM_REALTIME: + *controlp = sbcreatecontrol(NULL, sizeof(*ts), + SCM_REALTIME, SOL_SOCKET); + if (*controlp == NULL) { + error = ENOBUFS; + goto out; + } + ts = (struct timespec *) + CMSG_DATA(mtod(*controlp, struct cmsghdr *)); + nanotime(ts); + break; + + case SCM_MONOTONIC: + *controlp = sbcreatecontrol(NULL, sizeof(*ts), + SCM_MONOTONIC, SOL_SOCKET); + if (*controlp == NULL) { + error = ENOBUFS; + goto out; + } + ts = (struct timespec *) + CMSG_DATA(mtod(*controlp, struct cmsghdr *)); + nanouptime(ts); + break; + default: error = EINVAL; goto out; Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Mon Jan 16 17:43:43 2017 (r312295) +++ head/sys/netinet/ip_input.c Mon Jan 16 17:46:38 2017 (r312296) @@ -1157,30 +1157,48 @@ ip_forward(struct mbuf *m, int srcrt) icmp_error(mcopy, type, code, dest.s_addr, mtu); } +#define CHECK_SO_CT(sp, ct) \ + (((sp->so_options & SO_TIMESTAMP) && (sp->so_ts_clock == ct)) ? 1 : 0) + void ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip, struct mbuf *m) { - if (inp->inp_socket->so_options & (SO_BINTIME | SO_TIMESTAMP)) { + if ((inp->inp_socket->so_options & SO_BINTIME) || + CHECK_SO_CT(inp->inp_socket, SO_TS_BINTIME)) { struct bintime bt; bintime(&bt); - if (inp->inp_socket->so_options & SO_BINTIME) { - *mp = sbcreatecontrol((caddr_t)&bt, sizeof(bt), - SCM_BINTIME, SOL_SOCKET); - if (*mp) - mp = &(*mp)->m_next; - } - if (inp->inp_socket->so_options & SO_TIMESTAMP) { - struct timeval tv; + *mp = sbcreatecontrol((caddr_t)&bt, sizeof(bt), + SCM_BINTIME, SOL_SOCKET); + if (*mp) + mp = &(*mp)->m_next; + } + if (CHECK_SO_CT(inp->inp_socket, SO_TS_REALTIME_MICRO)) { + struct timeval tv; - bintime2timeval(&bt, &tv); - *mp = sbcreatecontrol((caddr_t)&tv, sizeof(tv), - SCM_TIMESTAMP, SOL_SOCKET); - if (*mp) - mp = &(*mp)->m_next; - } + microtime(&tv); + *mp = sbcreatecontrol((caddr_t)&tv, sizeof(tv), + SCM_TIMESTAMP, SOL_SOCKET); + if (*mp) + mp = &(*mp)->m_next; + } else if (CHECK_SO_CT(inp->inp_socket, SO_TS_REALTIME)) { + struct timespec ts; + + nanotime(&ts); + *mp = sbcreatecontrol((caddr_t)&ts, sizeof(ts), + SCM_REALTIME, SOL_SOCKET); + if (*mp) + mp = &(*mp)->m_next; + } else if (CHECK_SO_CT(inp->inp_socket, SO_TS_MONOTONIC)) { + struct timespec ts; + + nanouptime(&ts); + *mp = sbcreatecontrol((caddr_t)&ts, sizeof(ts), + SCM_MONOTONIC, SOL_SOCKET); + if (*mp) + mp = &(*mp)->m_next; } if (inp->inp_flags & INP_RECVDSTADDR) { *mp = sbcreatecontrol((caddr_t)&ip->ip_dst, Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Mon Jan 16 17:43:43 2017 (r312295) +++ head/sys/netinet6/ip6_input.c Mon Jan 16 17:46:38 2017 (r312296) @@ -1226,13 +1226,48 @@ ip6_savecontrol_v4(struct inpcb *inp, st #ifdef SO_TIMESTAMP if ((inp->inp_socket->so_options & SO_TIMESTAMP) != 0) { - struct timeval tv; + union { + struct timeval tv; + struct bintime bt; + struct timespec ts; + } t; + + switch (inp->inp_socket->so_ts_clock) { + case SO_TS_REALTIME_MICRO: + microtime(&t.tv); + *mp = sbcreatecontrol((caddr_t) &t.tv, sizeof(t.tv), + SCM_TIMESTAMP, SOL_SOCKET); + if (*mp) + mp = &(*mp)->m_next; + break; - microtime(&tv); - *mp = sbcreatecontrol((caddr_t) &tv, sizeof(tv), - SCM_TIMESTAMP, SOL_SOCKET); - if (*mp) - mp = &(*mp)->m_next; + case SO_TS_BINTIME: + bintime(&t.bt); + *mp = sbcreatecontrol((caddr_t)&t.bt, sizeof(t.bt), + SCM_BINTIME, SOL_SOCKET); + if (*mp) + mp = &(*mp)->m_next; + break; + + case SO_TS_REALTIME: + nanotime(&t.ts); + *mp = sbcreatecontrol((caddr_t)&t.ts, sizeof(t.ts), + SCM_REALTIME, SOL_SOCKET); + if (*mp) + mp = &(*mp)->m_next; + break; + + case SO_TS_MONOTONIC: + nanouptime(&t.ts); + *mp = sbcreatecontrol((caddr_t)&t.ts, sizeof(t.ts), + SCM_MONOTONIC, SOL_SOCKET); + if (*mp) + mp = &(*mp)->m_next; + break; + + default: + panic("unknown (corrupted) so_ts_clock"); + } } #endif Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Mon Jan 16 17:43:43 2017 (r312295) +++ head/sys/sys/socket.h Mon Jan 16 17:46:38 2017 (r312296) @@ -158,6 +158,16 @@ typedef __uintptr_t uintptr_t; #define SO_USER_COOKIE 0x1015 /* user cookie (dummynet etc.) */ #define SO_PROTOCOL 0x1016 /* get socket protocol (Linux name) */ #define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */ +#define SO_TS_CLOCK 0x1017 /* clock type used for SO_TIMESTAMP */ +#endif + +#if __BSD_VISIBLE +#define SO_TS_REALTIME_MICRO 0 /* microsecond resolution, realtime */ +#define SO_TS_BINTIME 1 /* sub-nanosecond resolution, realtime */ +#define SO_TS_REALTIME 2 /* nanosecond resolution, realtime */ +#define SO_TS_MONOTONIC 3 /* nanosecond resolution, monotonic */ +#define SO_TS_DEFAULT SO_TS_REALTIME_MICRO +#define SO_TS_CLOCK_MAX SO_TS_MONOTONIC #endif /* @@ -534,6 +544,8 @@ struct sockcred { #define SCM_TIMESTAMP 0x02 /* timestamp (struct timeval) */ #define SCM_CREDS 0x03 /* process creds (struct cmsgcred) */ #define SCM_BINTIME 0x04 /* timestamp (struct bintime) */ +#define SCM_REALTIME 0x05 /* timestamp (struct timespec) */ +#define SCM_MONOTONIC 0x06 /* timestamp (struct timespec) */ #endif #if __BSD_VISIBLE Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Mon Jan 16 17:43:43 2017 (r312295) +++ head/sys/sys/socketvar.h Mon Jan 16 17:46:38 2017 (r312296) @@ -127,6 +127,8 @@ struct socket { int so_fibnum; /* routing domain for this socket */ uint32_t so_user_cookie; + int so_ts_clock; /* type of the clock used for timestamps */ + void *so_pspare[2]; /* packet pacing / general use */ int so_ispare[2]; /* packet pacing / general use */ }; Added: head/tools/regression/sockets/udp_pingpong/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/udp_pingpong/Makefile Mon Jan 16 17:46:38 2017 (r312296) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= udp_pingpong +MAN= +WARNS?= 6 + +.include Added: head/tools/regression/sockets/udp_pingpong/udp_pingpong.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/sockets/udp_pingpong/udp_pingpong.c Mon Jan 16 17:46:38 2017 (r312296) @@ -0,0 +1,651 @@ +/*- + * Copyright (c) 2017 Maksym Sobolyev + * 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. + */ + +/* + * The test that setups two processes A and B and make A sending + * B UDP packet(s) and B send it back. The time of sending is recorded + * in the payload and time of the arrival is either determined by + * reading clock after recv() completes or using kernel-supplied + * via recvmsg(). End-to-end time t(A->B->A) is then calculated + * and compared against time for both t(A->B) + t(B->A) to make + * sure it makes sense. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define NPKTS 1000 +#define PKT_SIZE 128 +/* Timeout to receive pong on the side A, 100ms */ +#define SRECV_TIMEOUT (1 * 100) +/* + * Timeout to receive ping on the side B. 4x as large as on the side A, + * so that in the case of packet loss the side A will have a chance to + * realize that and send few more before B bails out. + */ +#define RRECV_TIMEOUT (SRECV_TIMEOUT * 4) +#define MIN_NRECV ((NPKTS * 99) / 100) /* 99% */ + +//#define SIMULATE_PLOSS + +struct trip_ts { + struct timespec sent; + struct timespec recvd; +}; + +struct test_pkt { + int pnum; + struct trip_ts tss[2]; + int lost; + unsigned char data[PKT_SIZE]; +}; + +struct test_ctx { + const char *name; + int fds[2]; + struct pollfd pfds[2]; + union { + struct sockaddr_in v4; + struct sockaddr_in6 v6; + } sin[2]; + struct test_pkt test_pkts[NPKTS]; + int nsent; + int nrecvd; + clockid_t clock; + int use_recvmsg; + int ts_type; +}; + +struct rtt { + struct timespec a2b; + struct timespec b2a; + struct timespec e2e; + struct timespec a2b_b2a; +}; + +#define SEC(x) ((x)->tv_sec) +#define NSEC(x) ((x)->tv_nsec) +#define NSEC_MAX 1000000000L +#define NSEC_IN_USEC 1000L + +#define timespecsub2(r, v, u) \ + do { \ + SEC(r) = SEC(v) - SEC(u); \ + NSEC(r) = NSEC(v) - NSEC(u); \ + if (NSEC(r) < 0 && (SEC(r) > 0 || NSEC(r) <= -NSEC_MAX)) { \ + SEC(r)--; \ + NSEC(r) += NSEC_MAX; \ + } \ + } while (0); + +#define timespecadd2(r, v, u) \ + do { \ + SEC(r) = SEC(v) + SEC(u); \ + NSEC(r) = NSEC(v) + NSEC(u); \ + if (NSEC(r) >= NSEC_MAX) { \ + SEC(r)++; \ + NSEC(r) -= NSEC_MAX; \ + } \ + } while (0); + +#define timespeccmp(t, c, u) \ + ((SEC(t) == SEC(u)) ? \ + (NSEC(t) c NSEC(u)) : \ + (SEC(t) c SEC(u))) + +#define timeval2timespec(tv, ts) \ + do { \ + SEC(ts) = (tv)->tv_sec; \ + NSEC(ts) = (tv)->tv_usec * NSEC_IN_USEC; \ + } while (0); + +static const struct timespec zero_ts; +/* 0.01s, should be more than enough for the loopback communication */ +static const struct timespec max_ts = {.tv_nsec = (NSEC_MAX / 100)}; + +enum ts_types {TT_TIMESTAMP = -2, TT_BINTIME = -1, + TT_REALTIME_MICRO = SO_TS_REALTIME_MICRO, TT_TS_BINTIME = SO_TS_BINTIME, + TT_REALTIME = SO_TS_REALTIME, TT_MONOTONIC = SO_TS_MONOTONIC}; + +static clockid_t +get_clock_type(struct test_ctx *tcp) +{ + switch (tcp->ts_type) { + case TT_TIMESTAMP: + case TT_BINTIME: + case TT_REALTIME_MICRO: + case TT_TS_BINTIME: + case TT_REALTIME: + return (CLOCK_REALTIME); + + case TT_MONOTONIC: + return (CLOCK_MONOTONIC); + } + abort(); +} + +static int +get_scm_type(struct test_ctx *tcp) +{ + switch (tcp->ts_type) { + case TT_TIMESTAMP: + case TT_REALTIME_MICRO: + return (SCM_TIMESTAMP); + + case TT_BINTIME: + case TT_TS_BINTIME: + return (SCM_BINTIME); + + case TT_REALTIME: + return (SCM_REALTIME); + + case TT_MONOTONIC: + return (SCM_MONOTONIC); + } + abort(); +} + +static size_t +get_scm_size(struct test_ctx *tcp) +{ + switch (tcp->ts_type) { + case TT_TIMESTAMP: + case TT_REALTIME_MICRO: + return (sizeof(struct timeval)); + + case TT_BINTIME: + case TT_TS_BINTIME: + return (sizeof(struct bintime)); + + case TT_REALTIME: + case TT_MONOTONIC: + return (sizeof(struct timespec)); + } + abort(); +} + +static void +setup_ts_sockopt(struct test_ctx *tcp, int fd) +{ + int rval, oname1, oname2, sval1, sval2; + + oname1 = SO_TIMESTAMP; + oname2 = -1; + sval2 = -1; + + switch (tcp->ts_type) { + case TT_REALTIME_MICRO: + case TT_TS_BINTIME: + case TT_REALTIME: + case TT_MONOTONIC: + oname2 = SO_TS_CLOCK; + sval2 = tcp->ts_type; + break; + + case TT_TIMESTAMP: + break; + + case TT_BINTIME: + oname1 = SO_BINTIME; + break; + + default: + abort(); + } + + sval1 = 1; + rval = setsockopt(fd, SOL_SOCKET, oname1, &sval1, + sizeof(sval1)); + if (rval != 0) { + err(1, "%s: setup_udp: setsockopt(%d, %d, 1)", tcp->name, + fd, oname1); + } + if (oname2 == -1) + return; + rval = setsockopt(fd, SOL_SOCKET, oname2, &sval2, + sizeof(sval2)); + if (rval != 0) { + err(1, "%s: setup_udp: setsockopt(%d, %d, %d)", + tcp->name, fd, oname2, sval2); + } +} + + +static void +setup_udp(struct test_ctx *tcp) +{ + int i; + socklen_t sin_len, af_len; + + af_len = sizeof(tcp->sin[0].v4); + for (i = 0; i < 2; i++) { + tcp->sin[i].v4.sin_len = af_len; + tcp->sin[i].v4.sin_family = AF_INET; + tcp->sin[i].v4.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + tcp->fds[i] = socket(PF_INET, SOCK_DGRAM, 0); + if (tcp->fds[i] < 0) + err(1, "%s: setup_udp: socket", tcp->name); + if (bind(tcp->fds[i], (struct sockaddr *)&tcp->sin[i], af_len) < 0) + err(1, "%s: setup_udp: bind(%s, %d)", tcp->name, + inet_ntoa(tcp->sin[i].v4.sin_addr), 0); + sin_len = af_len; + if (getsockname(tcp->fds[i], (struct sockaddr *)&tcp->sin[i], &sin_len) < 0) + err(1, "%s: setup_udp: getsockname(%d)", tcp->name, tcp->fds[i]); + if (tcp->use_recvmsg != 0) { + setup_ts_sockopt(tcp, tcp->fds[i]); + } + + tcp->pfds[i].fd = tcp->fds[i]; + tcp->pfds[i].events = POLLIN; + } + + if (connect(tcp->fds[0], (struct sockaddr *)&tcp->sin[1], af_len) < 0) + err(1, "%s: setup_udp: connect(%s, %d)", tcp->name, + inet_ntoa(tcp->sin[1].v4.sin_addr), ntohs(tcp->sin[1].v4.sin_port)); + if (connect(tcp->fds[1], (struct sockaddr *)&tcp->sin[0], af_len) < 0) + err(1, "%s: setup_udp: connect(%s, %d)", tcp->name, + inet_ntoa(tcp->sin[0].v4.sin_addr), ntohs(tcp->sin[0].v4.sin_port)); +} + +static char * +inet_ntoa6(const void *sin6_addr) +{ + static char straddr[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, sin6_addr, straddr, sizeof(straddr)); + return (straddr); +} + +static void +setup_udp6(struct test_ctx *tcp) +{ + int i; + socklen_t sin_len, af_len; + + af_len = sizeof(tcp->sin[0].v6); + for (i = 0; i < 2; i++) { + tcp->sin[i].v6.sin6_len = af_len; + tcp->sin[i].v6.sin6_family = AF_INET6; + tcp->sin[i].v6.sin6_addr = in6addr_loopback; + tcp->fds[i] = socket(PF_INET6, SOCK_DGRAM, 0); + if (tcp->fds[i] < 0) + err(1, "%s: setup_udp: socket", tcp->name); + if (bind(tcp->fds[i], (struct sockaddr *)&tcp->sin[i], af_len) < 0) + err(1, "%s: setup_udp: bind(%s, %d)", tcp->name, + inet_ntoa6(&tcp->sin[i].v6.sin6_addr), 0); + sin_len = af_len; + if (getsockname(tcp->fds[i], (struct sockaddr *)&tcp->sin[i], &sin_len) < 0) + err(1, "%s: setup_udp: getsockname(%d)", tcp->name, tcp->fds[i]); + if (tcp->use_recvmsg != 0) { + setup_ts_sockopt(tcp, tcp->fds[i]); + } + + tcp->pfds[i].fd = tcp->fds[i]; + tcp->pfds[i].events = POLLIN; + } + + if (connect(tcp->fds[0], (struct sockaddr *)&tcp->sin[1], af_len) < 0) + err(1, "%s: setup_udp: connect(%s, %d)", tcp->name, + inet_ntoa6(&tcp->sin[1].v6.sin6_addr), + ntohs(tcp->sin[1].v6.sin6_port)); + if (connect(tcp->fds[1], (struct sockaddr *)&tcp->sin[0], af_len) < 0) + err(1, "%s: setup_udp: connect(%s, %d)", tcp->name, + inet_ntoa6(&tcp->sin[0].v6.sin6_addr), + ntohs(tcp->sin[0].v6.sin6_port)); +} + +static void +teardown_udp(struct test_ctx *tcp) +{ + + close(tcp->fds[0]); + close(tcp->fds[1]); +} + +static void +send_pkt(struct test_ctx *tcp, int pnum, int fdidx, const char *face) +{ + ssize_t r; + size_t slen; + + slen = sizeof(tcp->test_pkts[pnum]); + clock_gettime(get_clock_type(tcp), &tcp->test_pkts[pnum].tss[fdidx].sent); + r = send(tcp->fds[fdidx], &tcp->test_pkts[pnum], slen, 0); + if (r < 0) { + err(1, "%s: %s: send(%d)", tcp->name, face, tcp->fds[fdidx]); + } + if (r < (ssize_t)slen) { + errx(1, "%s: %s: send(%d): short send", tcp->name, face, + tcp->fds[fdidx]); + } + tcp->nsent += 1; +} + +#define PDATA(tcp, i) ((tcp)->test_pkts[(i)].data) + +static void +hdr_extract_ts(struct test_ctx *tcp, struct msghdr *mhp, struct timespec *tp) +{ + int scm_type; + size_t scm_size; + union { + struct timespec ts; + struct bintime bt; + struct timeval tv; + } tdata; + struct cmsghdr *cmsg; + + scm_type = get_scm_type(tcp); + scm_size = get_scm_size(tcp); + for (cmsg = CMSG_FIRSTHDR(mhp); cmsg != NULL; + cmsg = CMSG_NXTHDR(mhp, cmsg)) { + if ((cmsg->cmsg_level == SOL_SOCKET) && + (cmsg->cmsg_type == scm_type)) { + memcpy(&tdata, CMSG_DATA(cmsg), scm_size); + break; + } + } + if (cmsg == NULL) { + abort(); + } + switch (tcp->ts_type) { + case TT_REALTIME: + case TT_MONOTONIC: + *tp = tdata.ts; + break; + + case TT_TIMESTAMP: + case TT_REALTIME_MICRO: + timeval2timespec(&tdata.tv, tp); + break; + + case TT_BINTIME: + case TT_TS_BINTIME: + bintime2timespec(&tdata.bt, tp); + break; + + default: + abort(); + } +} + +static void +recv_pkt_recvmsg(struct test_ctx *tcp, int fdidx, const char *face, void *buf, + size_t rlen, struct timespec *tp) +{ + /* We use a union to make sure hdr is aligned */ + union { + struct cmsghdr hdr; + unsigned char buf[CMSG_SPACE(1024)]; + } cmsgbuf; + struct msghdr msg; + struct iovec iov; + ssize_t rval; + + memset(&msg, '\0', sizeof(msg)); + iov.iov_base = buf; + iov.iov_len = rlen; + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_control = cmsgbuf.buf; + msg.msg_controllen = sizeof(cmsgbuf.buf); + + rval = recvmsg(tcp->fds[fdidx], &msg, 0); + if (rval < 0) { + err(1, "%s: %s: recvmsg(%d)", tcp->name, face, tcp->fds[fdidx]); + } + if (rval < (ssize_t)rlen) { + errx(1, "%s: %s: recvmsg(%d): short recv", tcp->name, face, + tcp->fds[fdidx]); + } + + hdr_extract_ts(tcp, &msg, tp); +} + +static void +recv_pkt_recv(struct test_ctx *tcp, int fdidx, const char *face, void *buf, + size_t rlen, struct timespec *tp) +{ + ssize_t rval; + + rval = recv(tcp->fds[fdidx], buf, rlen, 0); + clock_gettime(get_clock_type(tcp), tp); + if (rval < 0) { + err(1, "%s: %s: recv(%d)", tcp->name, face, tcp->fds[fdidx]); + } + if (rval < (ssize_t)rlen) { + errx(1, "%s: %s: recv(%d): short recv", tcp->name, face, + tcp->fds[fdidx]); + } +} + +static int +recv_pkt(struct test_ctx *tcp, int fdidx, const char *face, int tout) +{ + int pr; + struct test_pkt recv_buf; + size_t rlen; + + pr = poll(&tcp->pfds[fdidx], 1, tout); + if (pr < 0) { + err(1, "%s: %s: poll(%d)", tcp->name, face, tcp->fds[fdidx]); + } + if (pr == 0) { + return (-1); + } + if(tcp->pfds[fdidx].revents != POLLIN) { + errx(1, "%s: %s: poll(%d): unexpected result", tcp->name, face, + tcp->fds[fdidx]); + } + rlen = sizeof(recv_buf); + if (tcp->use_recvmsg == 0) { + recv_pkt_recv(tcp, fdidx, face, &recv_buf, rlen, + &recv_buf.tss[fdidx].recvd); + } else { + recv_pkt_recvmsg(tcp, fdidx, face, &recv_buf, rlen, + &recv_buf.tss[fdidx].recvd); + } + if (recv_buf.pnum < 0 || recv_buf.pnum >= NPKTS || + memcmp(recv_buf.data, PDATA(tcp, recv_buf.pnum), PKT_SIZE) != 0) { + errx(1, "%s: %s: recv(%d): corrupted data, packet %d", tcp->name, + face, tcp->fds[fdidx], recv_buf.pnum); + } + tcp->nrecvd += 1; + memcpy(tcp->test_pkts[recv_buf.pnum].tss, recv_buf.tss, + sizeof(recv_buf.tss)); + tcp->test_pkts[recv_buf.pnum].lost = 0; + return (recv_buf.pnum); +} + +static void +test_server(struct test_ctx *tcp) +{ + int i, j; + + for (i = 0; i < NPKTS; i++) { + send_pkt(tcp, i, 0, __FUNCTION__); + j = recv_pkt(tcp, 0, __FUNCTION__, SRECV_TIMEOUT); + if (j < 0) { + warnx("packet %d is lost", i); + /* timeout */ + continue; + } + } +} + +static void +test_client(struct test_ctx *tcp) +{ + int i, j; + + for (i = 0; i < NPKTS; i++) { + j = recv_pkt(tcp, 1, __FUNCTION__, RRECV_TIMEOUT); + if (j < 0) { + /* timeout */ + return; + } +#if defined(SIMULATE_PLOSS) + if ((i % 99) == 0) { + warnx("dropping packet %d", i); + continue; + } +#endif + send_pkt(tcp, j, 1, __FUNCTION__); + } +} + +static void +calc_rtt(struct test_pkt *tpp, struct rtt *rttp) +{ + + timespecsub2(&rttp->a2b, &tpp->tss[1].recvd, &tpp->tss[0].sent); + timespecsub2(&rttp->b2a, &tpp->tss[0].recvd, &tpp->tss[1].sent); + timespecadd2(&rttp->a2b_b2a, &rttp->a2b, &rttp->b2a); + timespecsub2(&rttp->e2e, &tpp->tss[0].recvd, &tpp->tss[0].sent); +} + +static void +test_run(int ts_type, int use_ipv6, int use_recvmsg, const char *name) +{ + struct test_ctx test_ctx; + pid_t pid, cpid; + int i, j, status; + + printf("Testing %s via %s: ", name, (use_ipv6 == 0) ? "IPv4" : "IPv6"); + fflush(stdout); + bzero(&test_ctx, sizeof(test_ctx)); + test_ctx.name = name; + test_ctx.use_recvmsg = use_recvmsg; + test_ctx.ts_type = ts_type; + if (use_ipv6 == 0) { + setup_udp(&test_ctx); + } else { + setup_udp6(&test_ctx); + } + for (i = 0; i < NPKTS; i++) { + test_ctx.test_pkts[i].pnum = i; + test_ctx.test_pkts[i].lost = 1; + for (j = 0; j < PKT_SIZE; j++) { + test_ctx.test_pkts[i].data[j] = (unsigned char)random(); + } + } + cpid = fork(); + if (cpid < 0) { + err(1, "%s: fork()", test_ctx.name); + } + if (cpid == 0) { + test_client(&test_ctx); + exit(0); + } + test_server(&test_ctx); + pid = waitpid(cpid, &status, 0); + if (pid == (pid_t)-1) { + err(1, "%s: waitpid(%d)", test_ctx.name, cpid); + } + + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) != EXIT_SUCCESS) { + errx(1, "client exit status is %d", + WEXITSTATUS(status)); + } + } else { + if (WIFSIGNALED(status)) + errx(1, "abnormal termination of client, signal %d%s", + WTERMSIG(status), WCOREDUMP(status) ? + " (core file generated)" : ""); + else + errx(1, "termination of client, unknown status"); + } + if (test_ctx.nrecvd < MIN_NRECV) { + errx(1, "packet loss is too high %d received out of %d, min %d", + test_ctx.nrecvd, test_ctx.nsent, MIN_NRECV); + } + for (i = 0; i < NPKTS; i++) { + struct rtt rtt; + if (test_ctx.test_pkts[i].lost != 0) { + continue; + } + calc_rtt(&test_ctx.test_pkts[i], &rtt); + if (!timespeccmp(&rtt.e2e, >, &rtt.a2b_b2a)) + errx(1, "end-to-end trip time is too small"); + if (!timespeccmp(&rtt.e2e, <, &max_ts)) + errx(1, "end-to-end trip time is too large"); + if (!timespeccmp(&rtt.a2b, >, &zero_ts)) + errx(1, "A2B trip time is not positive"); + if (!timespeccmp(&rtt.b2a, >, &zero_ts)) + errx(1, "B2A trip time is not positive"); + } + teardown_udp(&test_ctx); +} + +int +main(void) +{ + int i; + + srandomdev(); + + for (i = 0; i < 2; i++) { + test_run(0, i, 0, "send()/recv()"); + printf("OK\n"); + test_run(TT_TIMESTAMP, i, 1, + "send()/recvmsg(), setsockopt(SO_TIMESTAMP, 1)"); + printf("OK\n"); + if (i == 0) { + test_run(TT_BINTIME, i, 1, + "send()/recvmsg(), setsockopt(SO_BINTIME, 1)"); + printf("OK\n"); + } + test_run(TT_REALTIME_MICRO, i, 1, + "send()/recvmsg(), setsockopt(SO_TS_CLOCK, SO_TS_REALTIME_MICRO)"); + printf("OK\n"); + test_run(TT_TS_BINTIME, i, 1, + "send()/recvmsg(), setsockopt(SO_TS_CLOCK, SO_TS_BINTIME)"); + printf("OK\n"); + test_run(TT_REALTIME, i, 1, + "send()/recvmsg(), setsockopt(SO_TS_CLOCK, SO_TS_REALTIME)"); + printf("OK\n"); + test_run(TT_MONOTONIC, i, 1, + "send()/recvmsg(), setsockopt(SO_TS_CLOCK, SO_TS_MONOTONIC)"); + printf("OK\n"); + } + exit(0); +} Modified: head/tools/regression/sockets/unix_cmsg/Makefile ============================================================================== --- head/tools/regression/sockets/unix_cmsg/Makefile Mon Jan 16 17:43:43 2017 (r312295) +++ head/tools/regression/sockets/unix_cmsg/Makefile Mon Jan 16 17:46:38 2017 (r312296) @@ -16,8 +16,14 @@ REXP_bintime= 's|%%TTYPE%%|bintime|g ; s REXP_timeval= 's|%%TTYPE%%|timeval|g ; s|%%DTYPE%%|timeval|g ; \ s|%%SCM_TTYPE%%|SCM_TIMESTAMP|g ; \ s|%%MAJ_MEMB%%|tv_sec|g ; s|%%MIN_MEMB%%|tv_usec|g' +REXP_timespec_real= 's|%%TTYPE%%|timespec_real|g ; s|%%DTYPE%%|timespec|g ; \ + s|%%SCM_TTYPE%%|SCM_REALTIME|g ; \ + s|%%MAJ_MEMB%%|tv_sec|g ; s|%%MIN_MEMB%%|tv_nsec|g' +REXP_timespec_mono= 's|%%TTYPE%%|timespec_mono|g ; s|%%DTYPE%%|timespec|g ; \ + s|%%SCM_TTYPE%%|SCM_MONOTONIC|g ; \ + s|%%MAJ_MEMB%%|tv_sec|g ; s|%%MIN_MEMB%%|tv_nsec|g' -.for ttype in bintime timeval +.for ttype in bintime timeval timespec_real timespec_mono AUTOSRCS+= t_${ttype}.h t_${ttype}.c t_${ttype}.o: t_${ttype}.c t_${ttype}.h Modified: head/tools/regression/sockets/unix_cmsg/unix_cmsg.c ============================================================================== --- head/tools/regression/sockets/unix_cmsg/unix_cmsg.c Mon Jan 16 17:43:43 2017 (r312295) +++ head/tools/regression/sockets/unix_cmsg/unix_cmsg.c Mon Jan 16 17:46:38 2017 (r312296) @@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$"); #include "t_sockcred.h" #include "t_cmsgcred_sockcred.h" #include "t_cmsg_len.h" +#include "t_timespec_real.h" +#include "t_timespec_mono.h" /* * There are tables with tests descriptions and pointers to test @@ -117,7 +119,19 @@ static const struct test_func test_strea { .func = t_peercred, .desc = "Check LOCAL_PEERCRED socket option" + }, +#if defined(SCM_REALTIME) + { + .func = t_timespec_real, + .desc = "Sending, receiving realtime" + }, +#endif +#if defined(SCM_MONOTONIC) + { + .func = t_timespec_mono, + .desc = "Sending, receiving monotonic time (uptime)" } +#endif }; #define TEST_STREAM_TBL_SIZE \ @@ -152,6 +166,18 @@ static const struct test_func test_dgram { .func = t_cmsg_len, .desc = "Check cmsghdr.cmsg_len" + }, +#endif +#if defined(SCM_REALTIME) + { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jan 16 19:01:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D18DCB2E19; Mon, 16 Jan 2017 19:01:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F2491D3A; Mon, 16 Jan 2017 19:01:42 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GJ1f0j003098; Mon, 16 Jan 2017 19:01:41 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GJ1fIs003097; Mon, 16 Jan 2017 19:01:41 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701161901.v0GJ1fIs003097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 16 Jan 2017 19:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312305 - 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: Mon, 16 Jan 2017 19:01:42 -0000 Author: sbruno Date: Mon Jan 16 19:01:41 2017 New Revision: 312305 URL: https://svnweb.freebsd.org/changeset/base/312305 Log: Remove Assert that seems to be hit in various configurations during normal operations. Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Mon Jan 16 18:52:05 2017 (r312304) +++ head/sys/kern/subr_gtaskqueue.c Mon Jan 16 19:01:41 2017 (r312305) @@ -646,7 +646,6 @@ taskqgroup_attach(struct taskqgroup *qgr qid = taskqgroup_find(qgroup, uniq); qgroup->tqg_queue[qid].tgc_cnt++; LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); - MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL); gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq; if (irq != -1 && (smp_started || mp_ncpus == 1)) { gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu; From owner-svn-src-all@freebsd.org Mon Jan 16 19:03:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEE75CB2032; Mon, 16 Jan 2017 19:03:11 +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 9C6A91076; Mon, 16 Jan 2017 19:03:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id f144so14581046pfa.2; Mon, 16 Jan 2017 11:03:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=RfOwlQYAYCWctTLfXwchAr/Tw4RKW76uUSaDa82uKu8=; b=HLwYAETtGAvbROogKfDWWZyFWrdCmaWidHGPOBHBpSq8vYdMvYeV0BqfewgW+/OEGl xW8ARygGc3h+Y0melf365nTAN1WOV65XHZjG2hA7HDS5DVVwfjEIJ2Vuc9RVte4TISbS p1WD9RyvzvWfUIwdm+vhU8cD2Nr21JxqUOMGCb8OVdOkcOZrXOsb29oAbklac8Zf/FlE 175B7PAg2LACck/cBHkpCSAeLGaXbk+KjSaJF1xmDLcaw8F8P+Hoth8hCZmnZ2FjRvm3 CTv4H/8ZNoVH6KTKLU0cdAW4NUVhFFk3jhbHfhOKnSZSpwpjg4fgIFU1ydbhy5oB5/1N aTVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=RfOwlQYAYCWctTLfXwchAr/Tw4RKW76uUSaDa82uKu8=; b=ATmngPHoubmPHojgmFui1GTsYP7kfOCy8r4UtdU4dTYXpUjhkbfixfTSfIA3E7P+su JrTWFG5mbwHR5wCuvo9snsJEnWVicAThV5mz6T4D7ZSe3tf0KdtTnouXGhOZMFcRC2WB oMXl3FLKKVvyuTv3jPQlfkO7pV7F57x1qSrrIYWWoe4qXCVETCBMIoHGS96J00pVM7V/ IvGTXUrOnFq4epTvYHFGiYL+WoS5l7VK/JHMdjWG+7IwO8C6tI12XoDPEHXM7Ntug5wX 6vrhvwmIntk0k0SCAKt08NNlBsaibzbw2GP8EyJeSH4IVjFOmFj5+zx3Cks6qoQazfDx /hgg== X-Gm-Message-State: AIkVDXIX3WZzMWc+URTEep2ZABO1SaMhphI9N3e0w5WbcEo1/lbOH2TGQDQTVyIPY2B/MA== X-Received: by 10.84.136.34 with SMTP id 31mr45885753plk.52.1484593391003; Mon, 16 Jan 2017 11:03:11 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id z66sm25569649pfd.49.2017.01.16.11.03.10 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 11:03:10 -0800 (PST) Subject: Re: svn commit: r312305 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_70179366-E7BD-4DFB-808D-E9D4407D0C43"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701161901.v0GJ1fIs003097@repo.freebsd.org> Date: Mon, 16 Jan 2017 11:03:09 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201701161901.v0GJ1fIs003097@repo.freebsd.org> To: Sean Bruno 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, 16 Jan 2017 19:03:11 -0000 --Apple-Mail=_70179366-E7BD-4DFB-808D-E9D4407D0C43 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 16, 2017, at 11:01, Sean Bruno wrote: >=20 > Author: sbruno > Date: Mon Jan 16 19:01:41 2017 > New Revision: 312305 > URL: https://svnweb.freebsd.org/changeset/base/312305 >=20 > Log: > Remove Assert that seems to be hit in various configurations during > normal operations. Do you have any links/references/reporters to note=E2=80=A6? Thanks! -Ngie --Apple-Mail=_70179366-E7BD-4DFB-808D-E9D4407D0C43 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 iQIcBAEBCgAGBQJYfRjtAAoJEPWDqSZpMIYVCvQQAII2u50xpX1pODpQ3cTOVSDe t/Rl6VDDY5eYnR3CX8VrAiCZ+9naIeDl6Je7xPkhQjyWNLk4PGjru4h714GQtxmp g/xwKGlsJTlCkE3+1p2BrCIEi3cuc3c9JM/ZR1pIbnDCj3da2NFqzNXN3YBQHxTN X+S7GMQYg7exyvBNJYqKo6WBGcdhomPfqJcK7IuNtwQMU3iyRVff40GRvijDJJUW h85/jyQB1Hk4U0H0nhZS0ldRVQB2DHwvYtx2Q7H3DQurk58UQMEeiNsTYcY7HhnG VSGMlmvHAe9HhXtsAKfRQKKjUgA3HIvWQBuV5ers5MJ1vBGZ4NC4/mDfN+bwyYDZ TUAQcGWht9j2Ihow9NjMXHJi/gN7V3YNn4AaiKu8KJnY1tj3HY00/m7tYgrR0Wsu CDZNKS2sz+BVTY0XY3OYkC3C/kTBPn7LV77vML+oAIvjS15zsjmZQzasRxSN0VdG X9/RLBOMyiZNNZs/UO9copXo5BrT5tWX3ltlP9ook6eIvDbkqa/xn54p+VyqVx/m QDcnKdJ7jicTCzv3FUNFsQpV3fT3PgFRM6ZULsZeyeTxrAu208XcxSjmcrg+Sy/8 5NaMnGpmmlE/bW0W9DfCTIPIzL84JTU0YlI8bNrKh3Z3WYU1byBQe9vsYs5bj7Aa koKHqVGUVtfDdlbUakVt =DS8Q -----END PGP SIGNATURE----- --Apple-Mail=_70179366-E7BD-4DFB-808D-E9D4407D0C43-- From owner-svn-src-all@freebsd.org Mon Jan 16 19:35:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66A08CB3040; Mon, 16 Jan 2017 19:35:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28E521C0E; Mon, 16 Jan 2017 19:35:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0GJZJEp018226; Mon, 16 Jan 2017 19:35:19 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GJZJLQ018225; Mon, 16 Jan 2017 19:35:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201701161935.v0GJZJLQ018225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 16 Jan 2017 19:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312307 - head/sys/netinet6 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, 16 Jan 2017 19:35:20 -0000 Author: markj Date: Mon Jan 16 19:35:19 2017 New Revision: 312307 URL: https://svnweb.freebsd.org/changeset/base/312307 Log: Improve some of the sysctl descriptions added in r299827. Submitted by: Marie Helene Kvello-Aune (original version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5336 Modified: head/sys/netinet6/in6_proto.c Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Mon Jan 16 19:04:57 2017 (r312306) +++ head/sys/netinet6/in6_proto.c Mon Jan 16 19:35:19 2017 (r312307) @@ -507,19 +507,21 @@ sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARG SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_forwarding), 0, - "Enable IPv6 forwarding between interfaces"); + "Enable forwarding of IPv6 packets between interfaces"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_SENDREDIRECTS, redirect, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_sendredirects), 0, - "Send a redirect message when forwarding back to a source link"); + "Send ICMPv6 redirects for unforwardable IPv6 packets"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM, hlim, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_defhlim), 0, - "Default hop limit"); + "Default hop limit to use for outgoing IPv6 packets"); SYSCTL_VNET_PCPUSTAT(_net_inet6_ip6, IPV6CTL_STATS, stats, struct ip6stat, ip6stat, "IP6 statistics (struct ip6stat, netinet6/ip6_var.h)"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_maxfragpackets), 0, - "Maximum allowed number of outstanding fragmented IPv6 packets"); + "Default maximum number of outstanding fragmented IPv6 packets. " + "A value of 0 means no fragmented packets will be accepted, while a " + "a value of -1 means no limit"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_accept_rtadv), 0, "Default value of per-interface flag for accepting ICMPv6 RA messages"); @@ -541,7 +543,8 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_LOG_I "Frequency in seconds at which to log IPv6 forwarding errors"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT, hdrnestlimit, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_hdrnestlimit), 0, - "Maximum allowed number of nested protocol headers"); + "Default maximum number of IPv6 extension headers permitted on " + "incoming IPv6 packets, 0 for no artificial limit"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DAD_COUNT, dad_count, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_dad_count), 0, "Number of ICMPv6 NS messages sent during duplicate address detection"); @@ -550,7 +553,8 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_ "Provide an IPv6 flowlabel in outbound packets"); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFMCASTHLIM, defmcasthlim, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip6_defmcasthlim), 0, - "Default hop limit for multicast packets"); + "Default hop limit for IPv6 multicast packets originating from this " + "node"); SYSCTL_STRING(_net_inet6_ip6, IPV6CTL_KAME_VERSION, kame_version, CTLFLAG_RD, __KAME_VERSION, 0, "KAME version string"); From owner-svn-src-all@freebsd.org Mon Jan 16 20:24:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E846CB3D7C; Mon, 16 Jan 2017 20:24:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F335B1B03; Mon, 16 Jan 2017 20:24:12 +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 1B7D510A7B9; Mon, 16 Jan 2017 15:24:12 -0500 (EST) From: John Baldwin To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312205 - in head/sys: kern net Date: Mon, 16 Jan 2017 10:47:14 -0800 Message-ID: <30935285.ropjfVExpa@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201701150050.v0F0oAU8055428@repo.freebsd.org> References: <201701150050.v0F0oAU8055428@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 16 Jan 2017 15:24:12 -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: Mon, 16 Jan 2017 20:24:13 -0000 On Sunday, January 15, 2017 12:50:10 AM Sean Bruno wrote: > Author: sbruno > Date: Sun Jan 15 00:50:10 2017 > New Revision: 312205 > URL: https://svnweb.freebsd.org/changeset/base/312205 > > Log: > Fix hangs in a uniprocessor configuration (qemu, virtualbox, real hw). > > sys/net/iflib.c: > Add ctx to filter_info and don't skpi interrupt early on unless we're on an > SMP system On an SMP system with EARLY_AP_STARTUP (default on x86) this code should never see smp_started as false anyway, so these checks should likely just be conditional on EARLY_AP_STARTUP (since that option will eventually go away). -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jan 16 20:34:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48811CB2665; Mon, 16 Jan 2017 20:34:43 +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 1A9C716F7; Mon, 16 Jan 2017 20:34:43 +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 v0GKYgKX042516; Mon, 16 Jan 2017 20:34:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GKYgV2042515; Mon, 16 Jan 2017 20:34:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701162034.v0GKYgV2042515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 16 Jan 2017 20:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312311 - 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: Mon, 16 Jan 2017 20:34:43 -0000 Author: emaste Date: Mon Jan 16 20:34:42 2017 New Revision: 312311 URL: https://svnweb.freebsd.org/changeset/base/312311 Log: disambiguate msleep KASSERT diagnostics Previously "panic: msleep" could happen for a few different reasons. Break the KASSERTs out into individual cases to identify the failing condition. Found during the investigation that resulted in r308288. Reviewed by: kib, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8604 Modified: head/sys/kern/kern_synch.c Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Mon Jan 16 20:29:28 2017 (r312310) +++ head/sys/kern/kern_synch.c Mon Jan 16 20:34:42 2017 (r312311) @@ -152,8 +152,8 @@ _sleep(void *ident, struct lock_object * "Sleeping on \"%s\"", wmesg); KASSERT(sbt != 0 || mtx_owned(&Giant) || lock != NULL, ("sleeping without a lock")); - KASSERT(p != NULL, ("msleep1")); - KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep")); + KASSERT(ident != NULL, ("_sleep: NULL ident")); + KASSERT(TD_IS_RUNNING(td), ("_sleep: curthread not running")); if (priority & PDROP) KASSERT(lock != NULL && lock != &Giant.lock_object, ("PDROP requires a non-Giant lock")); @@ -247,8 +247,8 @@ msleep_spin_sbt(void *ident, struct mtx td = curthread; p = td->td_proc; KASSERT(mtx != NULL, ("sleeping without a mutex")); - KASSERT(p != NULL, ("msleep1")); - KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep")); + KASSERT(ident != NULL, ("msleep_spin_sbt: NULL ident")); + KASSERT(TD_IS_RUNNING(td), ("msleep_spin_sbt: curthread not running")); if (SCHEDULER_STOPPED()) return (0); From owner-svn-src-all@freebsd.org Mon Jan 16 20:57:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 202DDCB2EE0; Mon, 16 Jan 2017 20:57:03 +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 F18491636; Mon, 16 Jan 2017 20:57:02 +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 v0GKv25x050977; Mon, 16 Jan 2017 20:57:02 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0GKv20I050975; Mon, 16 Jan 2017 20:57:02 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201701162057.v0GKv20I050975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 16 Jan 2017 20:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312314 - in head/sys/boot/efi: include libefi 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, 16 Jan 2017 20:57:03 -0000 Author: tsoome Date: Mon Jan 16 20:57:01 2017 New Revision: 312314 URL: https://svnweb.freebsd.org/changeset/base/312314 Log: loader: move device path definitions to include/efidevp.h No functional change, only moving uuid and protocol bits to include/efidevp.h Reviewed by: imp, jhb Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D9192 Modified: head/sys/boot/efi/include/efidevp.h head/sys/boot/efi/libefi/devpath.c Modified: head/sys/boot/efi/include/efidevp.h ============================================================================== --- head/sys/boot/efi/include/efidevp.h Mon Jan 16 20:46:40 2017 (r312313) +++ head/sys/boot/efi/include/efidevp.h Mon Jan 16 20:57:01 2017 (r312314) @@ -73,8 +73,6 @@ typedef struct _EFI_DEVICE_PATH { (a)->Length[1] = 0; \ } - - /* * */ @@ -424,5 +422,33 @@ typedef union { } EFI_DEV_PATH_PTR; +#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \ + { 0xbc62157e, 0x3e33, 0x4fec, { 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } } + +#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \ + { 0x8b843e20, 0x8132, 0x4852, { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } } + +INTERFACE_DECL(_EFI_DEVICE_PATH_PROTOCOL); + +typedef +CHAR16* +(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) ( + IN struct _EFI_DEVICE_PATH *This, + IN BOOLEAN DisplayOnly, + IN BOOLEAN AllowShortCuts + ); + +typedef +CHAR16* +(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) ( + IN struct _EFI_DEVICE_PATH *This, + IN BOOLEAN DisplayOnly, + IN BOOLEAN AllowShortCuts + ); + +typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL { + EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText; + EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText; +} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL; #endif Modified: head/sys/boot/efi/libefi/devpath.c ============================================================================== --- head/sys/boot/efi/libefi/devpath.c Mon Jan 16 20:46:40 2017 (r312313) +++ head/sys/boot/efi/libefi/devpath.c Mon Jan 16 20:57:01 2017 (r312314) @@ -30,36 +30,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* XXX: This belongs in an efifoo.h header. */ -#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \ - { 0xbc62157e, 0x3e33, 0x4fec, { 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } } - -#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \ - { 0x8b843e20, 0x8132, 0x4852, { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } } - -INTERFACE_DECL(_EFI_DEVICE_PATH_PROTOCOL); - -typedef -CHAR16* -(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_NODE) ( - IN struct _EFI_DEVICE_PATH *This, - IN BOOLEAN DisplayOnly, - IN BOOLEAN AllowShortCuts - ); - -typedef -CHAR16* -(EFIAPI *EFI_DEVICE_PATH_TO_TEXT_PATH) ( - IN struct _EFI_DEVICE_PATH *This, - IN BOOLEAN DisplayOnly, - IN BOOLEAN AllowShortCuts - ); - -typedef struct _EFI_DEVICE_PATH_TO_TEXT_PROTOCOL { - EFI_DEVICE_PATH_TO_TEXT_NODE ConvertDeviceNodeToText; - EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText; -} EFI_DEVICE_PATH_TO_TEXT_PROTOCOL; - static EFI_GUID ImageDevicePathGUID = EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID; static EFI_GUID DevicePathGUID = DEVICE_PATH_PROTOCOL; From owner-svn-src-all@freebsd.org Tue Jan 17 00:35:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D182ECB3AD7; Tue, 17 Jan 2017 00:35:26 +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 94D14176A; Tue, 17 Jan 2017 00:35:26 +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 v0H0ZPgj042317; Tue, 17 Jan 2017 00:35:25 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H0ZNUu042297; Tue, 17 Jan 2017 00:35:23 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701170035.v0H0ZNUu042297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 17 Jan 2017 00:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312315 - in head/sys/dev/rtwn: . pci rtl8188e rtl8188e/usb rtl8192c rtl8192c/pci rtl8192c/usb rtl8812a rtl8812a/usb rtl8821a/usb 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: Tue, 17 Jan 2017 00:35:26 -0000 Author: avos Date: Tue Jan 17 00:35:23 2017 New Revision: 312315 URL: https://svnweb.freebsd.org/changeset/base/312315 Log: rtwn: export more stats to net80211 Setup more ieee80211_rx_stats fields for received frames: - pktflags: * IEEE80211_RX_F_FAIL_FCSCRC; * IEEE80211_RX_F_AMPDU; * IEEE80211_RX_F_AMPDU_MORE; * IEEE80211_RX_F_SHORTGI; - rate flags (CCK, OFDM, HT); - width; - phytype; - rate; - rx_tsf; - rssi; - nf; - ieee, freq (RTL8188EU only, when ht40 support is disabled). Tested with: - RTL8188CE, RTL8188EU, RTL8821AU (STA / AP modes, i386) - (by kevlo) RTL8188EU and RTL8812AU (amd64) Reviewed by: adrian (previous version), kevlo Differential Revision: https://reviews.freebsd.org/D9021 Modified: head/sys/dev/rtwn/if_rtwn.c head/sys/dev/rtwn/if_rtwn_rx.c head/sys/dev/rtwn/if_rtwn_rx.h head/sys/dev/rtwn/if_rtwnvar.h head/sys/dev/rtwn/pci/rtwn_pci_rx.c head/sys/dev/rtwn/rtl8188e/r88e.h head/sys/dev/rtwn/rtl8188e/r88e_rx.c head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c head/sys/dev/rtwn/rtl8192c/r92c.h head/sys/dev/rtwn/rtl8192c/r92c_reg.h head/sys/dev/rtwn/rtl8192c/r92c_rx.c head/sys/dev/rtwn/rtl8192c/r92c_rx_desc.h head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c head/sys/dev/rtwn/rtl8812a/r12a.h head/sys/dev/rtwn/rtl8812a/r12a_rx.c head/sys/dev/rtwn/rtl8812a/r12a_rx_desc.h head/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c head/sys/dev/rtwn/usb/rtwn_usb_rx.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/if_rtwn.c Tue Jan 17 00:35:23 2017 (r312315) @@ -1999,6 +1999,7 @@ rtwn_stop(struct rtwn_softc *sc) sc->fwver = 0; sc->thcal_temp = 0; sc->cur_bcnq_id = RTWN_VAP_ID_INVALID; + bzero(&sc->last_physt, sizeof(sc->last_physt)); #ifdef D4054 ieee80211_tx_watchdog_stop(&sc->sc_ic); Modified: head/sys/dev/rtwn/if_rtwn_rx.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn_rx.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/if_rtwn_rx.c Tue Jan 17 00:35:23 2017 (r312315) @@ -117,18 +117,19 @@ rtwn_set_basicrates(struct rtwn_softc *s } static void -rtwn_update_avgrssi(struct rtwn_softc *sc, struct rtwn_node *un, int rate) +rtwn_update_avgrssi(struct rtwn_softc *sc, struct rtwn_node *un, int8_t rssi, + int is_cck) { int pwdb; /* Convert antenna signal to percentage. */ - if (un->last_rssi <= -100 || un->last_rssi >= 20) + if (rssi <= -100 || rssi >= 20) pwdb = 0; - else if (un->last_rssi >= 0) + else if (rssi >= 0) pwdb = 100; else - pwdb = 100 + un->last_rssi; - if (RTWN_RATE_IS_CCK(rate)) { + pwdb = 100 + rssi; + if (is_cck) { /* CCK gain is smaller than OFDM/MCS gain. */ pwdb += 6; if (pwdb > 100) @@ -155,11 +156,11 @@ rtwn_update_avgrssi(struct rtwn_softc *s } static int8_t -rtwn_get_rssi(struct rtwn_softc *sc, int rate, void *physt) +rtwn_get_rssi(struct rtwn_softc *sc, void *physt, int is_cck) { int8_t rssi; - if (RTWN_RATE_IS_CCK(rate)) + if (is_cck) rssi = rtwn_get_rssi_cck(sc, physt); else /* OFDM/HT. */ rssi = rtwn_get_rssi_ofdm(sc, physt); @@ -188,81 +189,133 @@ rtwn_get_tsf(struct rtwn_softc *sc, uint *buf += rtwn_get_tsf_low(sc, id); } +static uint64_t +rtwn_extend_rx_tsf(struct rtwn_softc *sc, const struct r92c_rx_stat *stat) +{ + uint64_t tsft; + uint32_t rxdw3, tsfl, tsfl_curr; + int id; + + rxdw3 = le32toh(stat->rxdw3); + tsfl = le32toh(stat->tsf_low); + id = MS(rxdw3, R92C_RXDW3_BSSID_FIT); + + switch (id) { + case 1: + case 2: + id >>= 1; + tsfl_curr = rtwn_get_tsf_low(sc, id); + break; + default: + { + uint32_t tsfl0, tsfl1; + + tsfl0 = rtwn_get_tsf_low(sc, 0); + tsfl1 = rtwn_get_tsf_low(sc, 1); + + if (abs(tsfl0 - tsfl) < abs(tsfl1 - tsfl)) { + id = 0; + tsfl_curr = tsfl0; + } else { + id = 1; + tsfl_curr = tsfl1; + } + break; + } + } + + tsft = rtwn_get_tsf_high(sc, id); + if (tsfl > tsfl_curr && tsfl > 0xffff0000) + tsft--; + tsft <<= 32; + tsft += tsfl; + + return (tsft); +} + struct ieee80211_node * -rtwn_rx_common(struct rtwn_softc *sc, struct mbuf *m, void *desc, - int8_t *rssi) +rtwn_rx_common(struct rtwn_softc *sc, struct mbuf *m, void *desc) { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; struct ieee80211_frame_min *wh; + struct ieee80211_rx_stats rxs; struct rtwn_node *un; struct r92c_rx_stat *stat; - uint32_t rxdw0, rxdw3; - int cipher, infosz, pktlen, rate, shift; + void *physt; + uint32_t rxdw0; + int8_t rssi; + int cipher, infosz, is_cck, pktlen, shift; stat = desc; rxdw0 = le32toh(stat->rxdw0); - rxdw3 = le32toh(stat->rxdw3); cipher = MS(rxdw0, R92C_RXDW0_CIPHER); infosz = MS(rxdw0, R92C_RXDW0_INFOSZ) * 8; pktlen = MS(rxdw0, R92C_RXDW0_PKTLEN); shift = MS(rxdw0, R92C_RXDW0_SHIFT); - rate = MS(rxdw3, R92C_RXDW3_RATE); wh = (struct ieee80211_frame_min *)(mtodo(m, shift + infosz)); if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) && cipher != R92C_CAM_ALGO_NONE) m->m_flags |= M_WEP; - if (pktlen >= sizeof(*wh)) + if (pktlen >= sizeof(*wh)) { ni = ieee80211_find_rxnode(ic, wh); - else + if (ni != NULL && (ni->ni_flags & IEEE80211_NODE_HT)) + m->m_flags |= M_AMPDU; + } else ni = NULL; un = RTWN_NODE(ni); - /* Get RSSI from PHY status descriptor if present. */ - if (infosz != 0 && (rxdw0 & R92C_RXDW0_PHYST)) { - *rssi = rtwn_get_rssi(sc, rate, mtod(m, void *)); - RTWN_DPRINTF(sc, RTWN_DEBUG_RSSI, "%s: rssi %d, ridx %d\n", - __func__, *rssi, rate); - - sc->last_rssi = *rssi; - if (un != NULL) { - un->last_rssi = *rssi; + if (infosz != 0 && (rxdw0 & R92C_RXDW0_PHYST)) + physt = (void *)mtodo(m, shift); + else + physt = (un != NULL) ? &un->last_physt : &sc->last_physt; - /* Update our average RSSI. */ - rtwn_update_avgrssi(sc, un, rate); - } - } else - *rssi = (un != NULL) ? un->last_rssi : sc->last_rssi; + bzero(&rxs, sizeof(rxs)); + rtwn_get_rx_stats(sc, &rxs, desc, physt); + if (rxs.c_pktflags & IEEE80211_RX_F_AMPDU) { + /* Next MPDU will come without PHY info. */ + memcpy(&sc->last_physt, physt, sizeof(sc->last_physt)); + if (un != NULL) + memcpy(&un->last_physt, physt, sizeof(sc->last_physt)); + } + + /* Add some common bits. */ + /* NB: should not happen. */ + if (rxdw0 & R92C_RXDW0_CRCERR) + rxs.c_pktflags |= IEEE80211_RX_F_FAIL_FCSCRC; + + rxs.r_flags |= IEEE80211_R_TSF_START; /* XXX undocumented */ + rxs.r_flags |= IEEE80211_R_TSF64; + rxs.c_rx_tsf = rtwn_extend_rx_tsf(sc, stat); + + /* Get RSSI from PHY status descriptor. */ + is_cck = (rxs.c_pktflags & IEEE80211_RX_F_CCK) != 0; + rssi = rtwn_get_rssi(sc, physt, is_cck); + + /* XXX TODO: we really need a rate-to-string method */ + RTWN_DPRINTF(sc, RTWN_DEBUG_RSSI, "%s: rssi %d, rate %d\n", + __func__, rssi, rxs.c_rate); + if (un != NULL && infosz != 0 && (rxdw0 & R92C_RXDW0_PHYST)) { + /* Update our average RSSI. */ + rtwn_update_avgrssi(sc, un, rssi, is_cck); + } + + rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI; + rxs.c_nf = RTWN_NOISE_FLOOR; + rxs.c_rssi = rssi - rxs.c_nf; + (void) ieee80211_add_rx_params(m, &rxs); if (ieee80211_radiotap_active(ic)) { struct rtwn_rx_radiotap_header *tap = &sc->sc_rxtap; - int id = RTWN_VAP_ID_INVALID; - - if (ni != NULL) - id = RTWN_VAP(ni->ni_vap)->id; - if (id == RTWN_VAP_ID_INVALID) - id = 0; tap->wr_flags = rtwn_rx_radiotap_flags(sc, desc); - tap->wr_tsft = rtwn_get_tsf_high(sc, id); - if (le32toh(stat->tsf_low) > rtwn_get_tsf_low(sc, id)) - tap->wr_tsft--; - tap->wr_tsft = (uint64_t)htole32(tap->wr_tsft) << 32; - tap->wr_tsft += stat->tsf_low; - - /* XXX 20/40? */ - - /* Map HW rate index to 802.11 rate. */ - if (rate < RTWN_RIDX_MCS(0)) - tap->wr_rate = ridx2rate[rate]; - else /* MCS0~15. */ - tap->wr_rate = IEEE80211_RATE_MCS | (rate - 12); - - tap->wr_dbm_antsignal = *rssi; - tap->wr_dbm_antnoise = RTWN_NOISE_FLOOR; + tap->wr_tsft = htole64(rxs.c_rx_tsf); + tap->wr_rate = rxs.c_rate; + tap->wr_dbm_antsignal = rssi; + tap->wr_dbm_antnoise = rxs.c_nf; } /* Drop PHY descriptor. */ Modified: head/sys/dev/rtwn/if_rtwn_rx.h ============================================================================== --- head/sys/dev/rtwn/if_rtwn_rx.h Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/if_rtwn_rx.h Tue Jan 17 00:35:23 2017 (r312315) @@ -26,7 +26,7 @@ void rtwn_get_rates(struct rtwn_softc *, const struct ieee80211_htrateset *, uint32_t *, int *, int); void rtwn_set_basicrates(struct rtwn_softc *, uint32_t); struct ieee80211_node * rtwn_rx_common(struct rtwn_softc *, struct mbuf *, - void *, int8_t *); + void *); void rtwn_adhoc_recv_mgmt(struct ieee80211_node *, struct mbuf *, int, const struct ieee80211_rx_stats *, int, int); void rtwn_set_multi(struct rtwn_softc *); Modified: head/sys/dev/rtwn/if_rtwnvar.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnvar.h Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/if_rtwnvar.h Tue Jan 17 00:35:23 2017 (r312315) @@ -76,6 +76,12 @@ struct rtwn_tx_buf { uint8_t txd[RTWN_TX_DESC_SIZE]; } __attribute__((aligned(4))); +#define RTWN_PHY_STATUS_SIZE 32 +struct rtwn_tx_phystat { + uint32_t phydw[RTWN_PHY_STATUS_SIZE / sizeof(uint32_t)]; +}; + + struct rtwn_softc; union sec_param { @@ -95,7 +101,8 @@ struct rtwn_cmdq { struct rtwn_node { struct ieee80211_node ni; /* must be the first */ int id; - int8_t last_rssi; + + struct rtwn_tx_phystat last_physt; int avg_pwdb; }; #define RTWN_NODE(ni) ((struct rtwn_node *)(ni)) @@ -195,7 +202,7 @@ struct rtwn_softc { const char *name; int sc_ant; - int8_t last_rssi; + struct rtwn_tx_phystat last_physt; uint8_t thcal_temp; int cur_bcnq_id; @@ -336,6 +343,9 @@ struct rtwn_softc { struct ieee80211vap *, int); void (*sc_set_rssi)(struct rtwn_softc *); #endif + void (*sc_get_rx_stats)(struct rtwn_softc *, + struct ieee80211_rx_stats *, const void *, + const void *); int8_t (*sc_get_rssi_cck)(struct rtwn_softc *, void *); int8_t (*sc_get_rssi_ofdm)(struct rtwn_softc *, void *); int (*sc_classify_intr)(struct rtwn_softc *, void *, int); @@ -478,6 +488,8 @@ void rtwn_suspend(struct rtwn_softc *); (((_sc)->sc_parse_rom)((_sc), (_rom))) #define rtwn_set_led(_sc, _led, _on) \ (((_sc)->sc_set_led)((_sc), (_led), (_on))) +#define rtwn_get_rx_stats(_sc, _rxs, _desc, _physt) \ + (((_sc)->sc_get_rx_stats((_sc), (_rxs), (_desc), (_physt)))) #define rtwn_get_rssi_cck(_sc, _physt) \ (((_sc)->sc_get_rssi_cck)((_sc), (_physt))) #define rtwn_get_rssi_ofdm(_sc, _physt) \ Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_rx.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/pci/rtwn_pci_rx.c Tue Jan 17 00:35:23 2017 (r312315) @@ -95,7 +95,6 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, struct ieee80211_node *ni; uint32_t rxdw0; struct mbuf *m, *m1; - int8_t rssi = 0, nf; int infosz, pktlen, shift, error; /* Dump Rx descriptor. */ @@ -162,12 +161,11 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, rx_data->m = m1; m->m_pkthdr.len = m->m_len = pktlen + infosz + shift; - nf = RTWN_NOISE_FLOOR; - ni = rtwn_rx_common(sc, m, rx_desc, &rssi); + ni = rtwn_rx_common(sc, m, rx_desc); RTWN_DPRINTF(sc, RTWN_DEBUG_RECV, - "%s: Rx frame len %d, infosz %d, shift %d, rssi %d\n", - __func__, pktlen, infosz, shift, rssi); + "%s: Rx frame len %d, infosz %d, shift %d\n", + __func__, pktlen, infosz, shift); /* Update RX descriptor. */ rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, MJUMPAGESIZE, @@ -176,11 +174,11 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, /* Send the frame to the 802.11 layer. */ RTWN_UNLOCK(sc); if (ni != NULL) { - (void)ieee80211_input(ni, m, rssi - nf, nf); + (void)ieee80211_input_mimo(ni, m); /* Node is no longer needed. */ ieee80211_free_node(ni); } else - (void)ieee80211_input_all(ic, m, rssi - nf, nf); + (void)ieee80211_input_mimo_all(ic, m); RTWN_LOCK(sc); Modified: head/sys/dev/rtwn/rtl8188e/r88e.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e.h Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8188e/r88e.h Tue Jan 17 00:35:23 2017 (r312315) @@ -85,6 +85,8 @@ void r88e_ratectl_tx_complete(struct rtw void r88e_handle_c2h_report(struct rtwn_softc *, uint8_t *, int); int8_t r88e_get_rssi_cck(struct rtwn_softc *, void *); int8_t r88e_get_rssi_ofdm(struct rtwn_softc *, void *); +void r88e_get_rx_stats(struct rtwn_softc *, struct ieee80211_rx_stats *, + const void *, const void *); /* r88e_tx.c */ void r88e_tx_enable_ampdu(void *, int); Modified: head/sys/dev/rtwn/rtl8188e/r88e_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_rx.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8188e/r88e_rx.c Tue Jan 17 00:35:23 2017 (r312315) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -209,3 +210,19 @@ r88e_get_rssi_ofdm(struct rtwn_softc *sc return (rssi); } + +void +r88e_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, + const void *desc, const void *physt_ptr) +{ + const struct r88e_rx_phystat *physt = physt_ptr; + + r92c_get_rx_stats(sc, rxs, desc, physt_ptr); + + if (!sc->sc_ht40) { /* XXX center channel */ + rxs->r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs->c_ieee = le16toh(physt->chan); + rxs->c_freq = ieee80211_ieee2mhz(rxs->c_ieee, + IEEE80211_CHAN_2GHZ); + } +} Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Tue Jan 17 00:35:23 2017 (r312315) @@ -127,6 +127,7 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->sc_dump_tx_desc = r92cu_dump_tx_desc; sc->sc_tx_radiotap_flags = r92c_tx_radiotap_flags; sc->sc_rx_radiotap_flags = r92c_rx_radiotap_flags; + sc->sc_get_rx_stats = r88e_get_rx_stats; sc->sc_get_rssi_cck = r88e_get_rssi_cck; sc->sc_get_rssi_ofdm = r88e_get_rssi_ofdm; sc->sc_classify_intr = r88eu_classify_intr; Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Tue Jan 17 00:35:23 2017 (r312315) @@ -172,6 +172,7 @@ r92ce_attach(struct rtwn_pci_softc *pc) sc->sc_dump_tx_desc = r92ce_dump_tx_desc; sc->sc_tx_radiotap_flags = r92c_tx_radiotap_flags; sc->sc_rx_radiotap_flags = r92c_rx_radiotap_flags; + sc->sc_get_rx_stats = r92c_get_rx_stats; sc->sc_get_rssi_cck = r92c_get_rssi_cck; sc->sc_get_rssi_ofdm = r92c_get_rssi_ofdm; sc->sc_classify_intr = r92ce_classify_intr; Modified: head/sys/dev/rtwn/rtl8192c/r92c.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c.h Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8192c/r92c.h Tue Jan 17 00:35:23 2017 (r312315) @@ -99,6 +99,8 @@ void r92c_parse_rom(struct rtwn_softc *, int8_t r92c_get_rssi_cck(struct rtwn_softc *, void *); int8_t r92c_get_rssi_ofdm(struct rtwn_softc *, void *); uint8_t r92c_rx_radiotap_flags(const void *); +void r92c_get_rx_stats(struct rtwn_softc *, struct ieee80211_rx_stats *, + const void *, const void *); /* r92c_tx.c */ void r92c_tx_enable_ampdu(void *, int); Modified: head/sys/dev/rtwn/rtl8192c/r92c_reg.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_reg.h Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8192c/r92c_reg.h Tue Jan 17 00:35:23 2017 (r312315) @@ -420,6 +420,7 @@ #define R92C_PBP_1024 4 /* Bits for R92C_TRXDMA_CTRL. */ +#define R92C_TRXDMA_CTRL_RX_SHIFT_EN 0x0002 #define R92C_TRXDMA_CTRL_RXDMA_AGG_EN 0x0004 #define R92C_TRXDMA_CTRL_TXDMA_VOQ_MAP_M 0x0030 #define R92C_TRXDMA_CTRL_TXDMA_VOQ_MAP_S 4 @@ -593,7 +594,8 @@ #define R92C_RCR_APPFCS 0x80000000 /* Bits for R92C_RX_DRVINFO_SZ. */ -#define R92C_RX_DRVINFO_SZ_DEF 4 /* XXX other values will not work */ +/* XXX other values will not work */ +#define R92C_RX_DRVINFO_SZ_DEF ((RTWN_PHY_STATUS_SIZE) / 8) /* Bits for R92C_WMAC_TRXPTCL_CTL. */ #define R92C_WMAC_TRXPTCL_SHPRE 0x00020000 Modified: head/sys/dev/rtwn/rtl8192c/r92c_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_rx.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8192c/r92c_rx.c Tue Jan 17 00:35:23 2017 (r312315) @@ -100,3 +100,47 @@ r92c_rx_radiotap_flags(const void *buf) flags = IEEE80211_RADIOTAP_F_SHORTGI; return (flags); } + +void +r92c_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, + const void *desc, const void *physt_ptr) +{ + const struct r92c_rx_stat *stat = desc; + uint32_t rxdw1, rxdw3; + uint8_t rate; + + rxdw1 = le32toh(stat->rxdw1); + rxdw3 = le32toh(stat->rxdw3); + rate = MS(rxdw3, R92C_RXDW3_RATE); + + if (rxdw1 & R92C_RXDW1_AMPDU) + rxs->c_pktflags |= IEEE80211_RX_F_AMPDU; + else if (rxdw1 & R92C_RXDW1_AMPDU_MORE) + rxs->c_pktflags |= IEEE80211_RX_F_AMPDU_MORE; + if ((rxdw3 & R92C_RXDW3_SPLCP) && rate >= RTWN_RIDX_MCS(0)) + rxs->c_pktflags |= IEEE80211_RX_F_SHORTGI; + + if (rxdw3 & R92C_RXDW3_HT40) + rxs->c_width = IEEE80211_RX_FW_40MHZ; + else + rxs->c_width = IEEE80211_RX_FW_20MHZ; + + if (RTWN_RATE_IS_CCK(rate)) + rxs->c_phytype = IEEE80211_RX_FP_11B; + else if (rate < RTWN_RIDX_MCS(0)) + rxs->c_phytype = IEEE80211_RX_FP_11G; + else + rxs->c_phytype = IEEE80211_RX_FP_11NG; + + /* Map HW rate index to 802.11 rate. */ + if (rate < RTWN_RIDX_MCS(0)) { + rxs->c_rate = ridx2rate[rate]; + if (RTWN_RATE_IS_CCK(rate)) + rxs->c_pktflags |= IEEE80211_RX_F_CCK; + else + rxs->c_pktflags |= IEEE80211_RX_F_OFDM; + } else { /* MCS0~15. */ + rxs->c_rate = IEEE80211_RATE_MCS | (rate - 12); + rxs->c_pktflags |= IEEE80211_RX_F_HT; + } +} Modified: head/sys/dev/rtwn/rtl8192c/r92c_rx_desc.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_rx_desc.h Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8192c/r92c_rx_desc.h Tue Jan 17 00:35:23 2017 (r312315) @@ -45,6 +45,9 @@ struct r92c_rx_stat { uint32_t rxdw1; #define R92C_RXDW1_MACID_M 0x0000001f #define R92C_RXDW1_MACID_S 0 +#define R92C_RXDW1_AMSDU 0x00002000 +#define R92C_RXDW1_AMPDU_MORE 0x00004000 +#define R92C_RXDW1_AMPDU 0x00008000 #define R92C_RXDW1_MC 0x40000000 #define R92C_RXDW1_BC 0x80000000 @@ -56,6 +59,8 @@ struct r92c_rx_stat { #define R92C_RXDW3_SPLCP 0x00000100 #define R92C_RXDW3_HT40 0x00000200 #define R92C_RXDW3_HTC 0x00000400 +#define R92C_RXDW3_BSSID_FIT_M 0x00003000 +#define R92C_RXDW3_BSSID_FIT_S 12 uint32_t rxdw4; uint32_t tsf_low; Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Tue Jan 17 00:35:23 2017 (r312315) @@ -165,6 +165,7 @@ r92cu_attach(struct rtwn_usb_softc *uc) sc->sc_dump_tx_desc = r92cu_dump_tx_desc; sc->sc_tx_radiotap_flags = r92c_tx_radiotap_flags; sc->sc_rx_radiotap_flags = r92c_rx_radiotap_flags; + sc->sc_get_rx_stats = r92c_get_rx_stats; sc->sc_get_rssi_cck = r92c_get_rssi_cck; sc->sc_get_rssi_ofdm = r92c_get_rssi_ofdm; sc->sc_classify_intr = r92cu_classify_intr; Modified: head/sys/dev/rtwn/rtl8812a/r12a.h ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a.h Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8812a/r12a.h Tue Jan 17 00:35:23 2017 (r312315) @@ -128,6 +128,8 @@ void r12a_ratectl_tx_complete(struct rtw void r12a_handle_c2h_report(struct rtwn_softc *, uint8_t *, int); int r12a_check_frame_checksum(struct rtwn_softc *, struct mbuf *); uint8_t r12a_rx_radiotap_flags(const void *); +void r12a_get_rx_stats(struct rtwn_softc *, struct ieee80211_rx_stats *, + const void *, const void *); /* r12a_tx.c */ void r12a_fill_tx_desc(struct rtwn_softc *, struct ieee80211_node *, Modified: head/sys/dev/rtwn/rtl8812a/r12a_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_rx.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8812a/r12a_rx.c Tue Jan 17 00:35:23 2017 (r312315) @@ -229,10 +229,97 @@ r12a_rx_radiotap_flags(const void *buf) if (!(stat->rxdw4 & htole32(R12A_RXDW4_SPLCP))) return (0); - rate = MS(le32toh(stat->rxdw3), R92C_RXDW3_RATE); + rate = MS(le32toh(stat->rxdw3), R12A_RXDW3_RATE); if (RTWN_RATE_IS_CCK(rate)) flags = IEEE80211_RADIOTAP_F_SHORTPRE; else flags = IEEE80211_RADIOTAP_F_SHORTGI; return (flags); } + +void +r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80211_rx_stats *rxs, + const void *desc, const void *physt_ptr) +{ + const struct r92c_rx_stat *stat = desc; + const struct r12a_rx_phystat *physt = physt_ptr; + uint32_t rxdw0, rxdw1, rxdw3, rxdw4; + uint8_t rate; + + rxdw0 = le32toh(stat->rxdw0); + rxdw1 = le32toh(stat->rxdw1); + rxdw3 = le32toh(stat->rxdw3); + rxdw4 = le32toh(stat->rxdw4); + rate = MS(rxdw3, R12A_RXDW3_RATE); + + /* TODO: STBC, LDPC */ + if (rxdw1 & R12A_RXDW1_AMPDU) { + if (rxdw0 & R92C_RXDW0_PHYST) + rxs->c_pktflags |= IEEE80211_RX_F_AMPDU; + else + rxs->c_pktflags |= IEEE80211_RX_F_AMPDU_MORE; + } + + if ((rxdw4 & R12A_RXDW4_SPLCP) && rate >= RTWN_RIDX_MCS(0)) + rxs->c_pktflags |= IEEE80211_RX_F_SHORTGI; + + switch (MS(rxdw4, R12A_RXDW4_BW)) { + case R12A_RXDW4_BW20: + rxs->c_width = IEEE80211_RX_FW_20MHZ; + break; + case R12A_RXDW4_BW40: + rxs->c_width = IEEE80211_RX_FW_40MHZ; + break; + case R12A_RXDW4_BW80: + rxs->c_width = IEEE80211_RX_FW_80MHZ; + break; + default: + break; + } + + if (RTWN_RATE_IS_CCK(rate)) + rxs->c_phytype = IEEE80211_RX_FP_11B; + else { + int is5ghz; + + /* XXX magic */ + /* XXX check with RTL8812AU */ + is5ghz = (physt->cfosho[2] != 0x01); + + if (rate < RTWN_RIDX_MCS(0)) { + if (is5ghz) + rxs->c_phytype = IEEE80211_RX_FP_11A; + else + rxs->c_phytype = IEEE80211_RX_FP_11G; + } else { + if (is5ghz) + rxs->c_phytype = IEEE80211_RX_FP_11NA; + else + rxs->c_phytype = IEEE80211_RX_FP_11NG; + } + } + + /* Map HW rate index to 802.11 rate. */ + if (rate < RTWN_RIDX_MCS(0)) { + rxs->c_rate = ridx2rate[rate]; + if (RTWN_RATE_IS_CCK(rate)) + rxs->c_pktflags |= IEEE80211_RX_F_CCK; + else + rxs->c_pktflags |= IEEE80211_RX_F_OFDM; + } else { /* MCS0~15. */ + /* TODO: VHT rates */ + rxs->c_rate = IEEE80211_RATE_MCS | (rate - 12); + rxs->c_pktflags |= IEEE80211_RX_F_HT; + } + + /* + * XXX always zero for RTL8821AU + * (vendor driver does not check this field) + */ +#if 0 + rxs->r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; + rxs->c_ieee = MS(le16toh(physt->phyw1), R12A_PHYW1_CHAN); + rxs->c_freq = ieee80211_ieee2mhz(rxs->c_ieee, + (rxs->c_ieee < 36) ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ); +#endif +} Modified: head/sys/dev/rtwn/rtl8812a/r12a_rx_desc.h ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_rx_desc.h Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8812a/r12a_rx_desc.h Tue Jan 17 00:35:23 2017 (r312315) @@ -34,18 +34,26 @@ /* Rx MAC descriptor defines (chip-specific). */ /* Rx dword 1 */ #define R12A_RXDW1_AMSDU 0x00002000 +#define R12A_RXDW1_AMPDU 0x00008000 #define R12A_RXDW1_CKSUM_ERR 0x00100000 #define R12A_RXDW1_IPV6 0x00200000 #define R12A_RXDW1_UDP 0x00400000 #define R12A_RXDW1_CKSUM 0x00800000 /* Rx dword 2 */ #define R12A_RXDW2_RPT_C2H 0x10000000 +/* Rx dword 3 */ +#define R12A_RXDW3_RATE_M 0x0000007f +#define R12A_RXDW3_RATE_S 0 /* Rx dword 4 */ #define R12A_RXDW4_SPLCP 0x00000001 #define R12A_RXDW4_LDPC 0x00000002 #define R12A_RXDW4_STBC 0x00000004 #define R12A_RXDW4_BW_M 0x00000030 #define R12A_RXDW4_BW_S 4 +#define R12A_RXDW4_BW20 0 +#define R12A_RXDW4_BW40 1 +#define R12A_RXDW4_BW80 2 +#define R12A_RXDW4_BW160 3 /* Rx PHY descriptor. */ struct r12a_rx_phystat { Modified: head/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c Tue Jan 17 00:35:23 2017 (r312315) @@ -190,6 +190,7 @@ r12au_attach(struct rtwn_usb_softc *uc) sc->sc_dump_tx_desc = r12au_dump_tx_desc; sc->sc_tx_radiotap_flags = r12a_tx_radiotap_flags; sc->sc_rx_radiotap_flags = r12a_rx_radiotap_flags; + sc->sc_get_rx_stats = r12a_get_rx_stats; sc->sc_get_rssi_cck = r88e_get_rssi_cck; sc->sc_get_rssi_ofdm = r88e_get_rssi_ofdm; sc->sc_classify_intr = r12au_classify_intr; Modified: head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c Tue Jan 17 00:35:23 2017 (r312315) @@ -182,6 +182,7 @@ r21au_attach(struct rtwn_usb_softc *uc) sc->sc_dump_tx_desc = r12au_dump_tx_desc; sc->sc_tx_radiotap_flags = r12a_tx_radiotap_flags; sc->sc_rx_radiotap_flags = r12a_rx_radiotap_flags; + sc->sc_get_rx_stats = r12a_get_rx_stats; sc->sc_get_rssi_cck = r21a_get_rssi_cck; sc->sc_get_rssi_ofdm = r88e_get_rssi_ofdm; sc->sc_classify_intr = r12au_classify_intr; Modified: head/sys/dev/rtwn/usb/rtwn_usb_rx.c ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_rx.c Mon Jan 16 20:57:01 2017 (r312314) +++ head/sys/dev/rtwn/usb/rtwn_usb_rx.c Tue Jan 17 00:35:23 2017 (r312315) @@ -236,7 +236,7 @@ rtwn_report_intr(struct rtwn_usb_softc * } static struct ieee80211_node * -rtwn_rx_frame(struct rtwn_softc *sc, struct mbuf *m, int8_t *rssi) +rtwn_rx_frame(struct rtwn_softc *sc, struct mbuf *m) { struct r92c_rx_stat stat; @@ -244,7 +244,7 @@ rtwn_rx_frame(struct rtwn_softc *sc, str m_copydata(m, 0, sizeof(struct r92c_rx_stat), (caddr_t)&stat); m_adj(m, sizeof(struct r92c_rx_stat)); - return (rtwn_rx_common(sc, m, &stat, rssi)); + return (rtwn_rx_common(sc, m, &stat)); } void @@ -256,7 +256,6 @@ rtwn_bulk_rx_callback(struct usb_xfer *x struct ieee80211_node *ni; struct mbuf *m = NULL, *next; struct rtwn_data *data; - int8_t nf, rssi; RTWN_ASSERT_LOCKED(sc); @@ -291,19 +290,15 @@ tr_setup: next = m->m_next; m->m_next = NULL; - ni = rtwn_rx_frame(sc, m, &rssi); + ni = rtwn_rx_frame(sc, m); RTWN_UNLOCK(sc); - nf = RTWN_NOISE_FLOOR; if (ni != NULL) { - if (ni->ni_flags & IEEE80211_NODE_HT) - m->m_flags |= M_AMPDU; - (void)ieee80211_input(ni, m, rssi - nf, nf); + (void)ieee80211_input_mimo(ni, m); ieee80211_free_node(ni); } else { - (void)ieee80211_input_all(ic, m, - rssi - nf, nf); + (void)ieee80211_input_mimo_all(ic, m); } RTWN_LOCK(sc); m = next; From owner-svn-src-all@freebsd.org Tue Jan 17 00:39:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CC08CB3C46; Tue, 17 Jan 2017 00:39:10 +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 4ED5B1A0E; Tue, 17 Jan 2017 00:39:10 +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 v0H0d9rT042502; Tue, 17 Jan 2017 00:39:09 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H0d9PA042501; Tue, 17 Jan 2017 00:39:09 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201701170039.v0H0d9PA042501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 17 Jan 2017 00:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312316 - head/sys/arm/xilinx 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, 17 Jan 2017 00:39:10 -0000 Author: gonzo Date: Tue Jan 17 00:39:09 2017 New Revision: 312316 URL: https://svnweb.freebsd.org/changeset/base/312316 Log: [zynq] Fix panic on USB PHY initialization failure The Zedboard has a hardware bug where initialization of the USB PHY occasionally fails on boot-up. Fix regression in -CURRENT when kernel panics on such occasion. 11-RELEASE branch works fine PR: 215862 Submitted by: Thomas Skibo Modified: head/sys/arm/xilinx/zy7_ehci.c Modified: head/sys/arm/xilinx/zy7_ehci.c ============================================================================== --- head/sys/arm/xilinx/zy7_ehci.c Tue Jan 17 00:35:23 2017 (r312315) +++ head/sys/arm/xilinx/zy7_ehci.c Tue Jan 17 00:39:09 2017 (r312316) @@ -325,13 +325,10 @@ zy7_ehci_detach(device_t dev) /* during module unload there are lots of children leftover */ device_delete_children(dev); - sc->sc_flags &= ~EHCI_SCFLG_DONEINIT; - - if (sc->sc_irq_res && sc->sc_intr_hdl) - /* call ehci_detach() after ehci_init() called after - * successful bus_setup_intr(). - */ + if ((sc->sc_flags & EHCI_SCFLG_DONEINIT) != 0) { ehci_detach(sc); + sc->sc_flags &= ~EHCI_SCFLG_DONEINIT; + } if (sc->sc_irq_res) { if (sc->sc_intr_hdl != NULL) From owner-svn-src-all@freebsd.org Tue Jan 17 00:48:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9994CB3F71; Tue, 17 Jan 2017 00:48:03 +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 A9F1B1ECE; Tue, 17 Jan 2017 00:48:03 +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 v0H0m2wB046404; Tue, 17 Jan 2017 00:48:02 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H0m2Vv046403; Tue, 17 Jan 2017 00:48:02 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701170048.v0H0m2Vv046403@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 17 Jan 2017 00:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312317 - 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, 17 Jan 2017 00:48:04 -0000 Author: avos Date: Tue Jan 17 00:48:02 2017 New Revision: 312317 URL: https://svnweb.freebsd.org/changeset/base/312317 Log: Add sys/dev/rtwn/rtl8821a/usb/r21au_dfs.c into sys/conf/files Reported by: adrian Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Jan 17 00:39:09 2017 (r312316) +++ head/sys/conf/files Tue Jan 17 00:48:02 2017 (r312317) @@ -2716,6 +2716,7 @@ dev/rtwn/rtl8821a/r21a_led.c optional rt dev/rtwn/rtl8821a/r21a_rom.c optional rtwn dev/rtwn/rtl8821a/r21a_rx.c optional rtwn dev/rtwn/rtl8821a/usb/r21au_attach.c optional rtwn_usb +dev/rtwn/rtl8821a/usb/r21au_dfs.c optional rtwn_usb dev/rtwn/rtl8821a/usb/r21au_init.c optional rtwn_usb rtwn-rtl8188eufw.c optional rtwn-rtl8188eufw | rtwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8188eufw.fw:rtwn-rtl8188eufw:111 -mrtwn-rtl8188eufw -c${.TARGET}" \ From owner-svn-src-all@freebsd.org Tue Jan 17 01:02:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E805CB13F7; Tue, 17 Jan 2017 01:02:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 21F771820; Tue, 17 Jan 2017 01:02:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id DC0BFD6720E; Tue, 17 Jan 2017 12:02:50 +1100 (AEDT) Date: Tue, 17 Jan 2017 12:02:49 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312205 - in head/sys: kern net In-Reply-To: <30935285.ropjfVExpa@ralph.baldwin.cx> Message-ID: <20170117113927.E1043@besplex.bde.org> References: <201701150050.v0F0oAU8055428@repo.freebsd.org> <30935285.ropjfVExpa@ralph.baldwin.cx> 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=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=sYOr5FrkeuhcdU5QBEUA: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: Tue, 17 Jan 2017 01:02:59 -0000 On Mon, 16 Jan 2017, John Baldwin wrote: > On Sunday, January 15, 2017 12:50:10 AM Sean Bruno wrote: >> ... >> Log: >> Fix hangs in a uniprocessor configuration (qemu, virtualbox, real hw). >> >> sys/net/iflib.c: >> Add ctx to filter_info and don't skpi interrupt early on unless we're on an >> SMP system > > On an SMP system with EARLY_AP_STARTUP (default on x86) this code should > never see smp_started as false anyway, so these checks should likely just > be conditional on EARLY_AP_STARTUP (since that option will eventually go > away). Ifdefs on EARLY_AP_STARTUP give strange results for the UP case (at least for SMP with 1 CPU). First, the ifdef in sys/kernel.h moves SI_SUB_SMP from late to early, although the CPU initialization order has not changed when there is only 1 CPU. Then everything that uses SI_SUB_SMP is reordered, and bugs in the new order show up even in the UP case. sys/gtaskqueue.h uses a complicated combination of EARLY_AP_STARTUP and SI_SUB ifdefs to try to get the order right. I think the last commit to it helps for the UP case but harms for the SMP case (both for the !EARLY_AP_STARTUP case). Its code is simpler for the EARLY_AP_STARTUP case. In the !EARLY_AP_STARTUP case, it has to split up the initialization to delay calculations depending on the number of CPUs until after SMP has started. The last commit to it seems to have turned the split into nonsense by removing the delay. But in the UP case, the split is not really necessary and removing the delay should help. EARLY_AP_STARTUP works badly here. It doesn't give a much faster startup for the early part of the boot. Then it gives a much slower boot by hanging for almost a minute waiting for USB or something. Starting all the CPUs early also unimproves debugging by interleaving the boot messages a bit. I use colorized console messages (with the color indexed by the CPU). This makes interleaved messages quite readable and gives interesting patterns when multiple CPUs are running. Bruce From owner-svn-src-all@freebsd.org Tue Jan 17 01:29:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6260CB2759; Tue, 17 Jan 2017 01:29:05 +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 90A6518DF; Tue, 17 Jan 2017 01:29:05 +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 v0H1T4gZ062900; Tue, 17 Jan 2017 01:29:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1T3oj062885; Tue, 17 Jan 2017 01:29:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701170129.v0H1T3oj062885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 17 Jan 2017 01:29: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: r312318 - in stable/11/sys/boot: common efi/loader i386/loader mips/beri/loader ofw/common pc98/loader powerpc/kboot powerpc/ps3 sparc64/loader uboot/common userboot/userboot 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, 17 Jan 2017 01:29:05 -0000 Author: emaste Date: Tue Jan 17 01:29:03 2017 New Revision: 312318 URL: https://svnweb.freebsd.org/changeset/base/312318 Log: MFC r310225: Reduce boot loader version string duplication Instead of repeating "%s, Revision %s" "(%s %s)" in each loader, just create the full version string in vers.c Modified: stable/11/sys/boot/common/interp_forth.c stable/11/sys/boot/common/newvers.sh stable/11/sys/boot/efi/loader/main.c stable/11/sys/boot/i386/loader/main.c stable/11/sys/boot/mips/beri/loader/loader.h stable/11/sys/boot/mips/beri/loader/main.c stable/11/sys/boot/ofw/common/main.c stable/11/sys/boot/pc98/loader/main.c stable/11/sys/boot/powerpc/kboot/main.c stable/11/sys/boot/powerpc/ps3/main.c stable/11/sys/boot/sparc64/loader/main.c stable/11/sys/boot/uboot/common/main.c stable/11/sys/boot/userboot/userboot/main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/common/interp_forth.c ============================================================================== --- stable/11/sys/boot/common/interp_forth.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/common/interp_forth.c Tue Jan 17 01:29:03 2017 (r312318) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "ficl.h" -extern char bootprog_rev[]; +extern unsigned bootprog_rev; /* #define BFORTH_DEBUG */ @@ -278,8 +278,7 @@ bf_init(const char *rc) /* Export some version numbers so that code can detect the loader/host version */ ficlSetEnv(bf_sys, "FreeBSD_version", __FreeBSD_version); - ficlSetEnv(bf_sys, "loader_version", - (bootprog_rev[0] - '0') * 10 + (bootprog_rev[2] - '0')); + ficlSetEnv(bf_sys, "loader_version", bootprog_rev); pInterp = ficlLookup(bf_sys, "interpret"); Modified: stable/11/sys/boot/common/newvers.sh ============================================================================== --- stable/11/sys/boot/common/newvers.sh Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/common/newvers.sh Tue Jan 17 01:29:03 2017 (r312318) @@ -40,8 +40,6 @@ u=${USER-root} h=${HOSTNAME-`hostname`} #r=`head -n 6 $1 | tail -n 1 | awk -F: ' { print $1 } '` r=`awk -F: ' /^[0-9]\.[0-9]+:/ { print $1; exit }' $1` -echo "char bootprog_name[] = \"FreeBSD/${3} ${2}\";" > $tempfile -echo "char bootprog_rev[] = \"${r}\";" >> $tempfile -echo "char bootprog_date[] = \"${t}\";" >> $tempfile -echo "char bootprog_maker[] = \"${u}@${h}\";" >> $tempfile +echo "char bootprog_info[] = \"FreeBSD/${3} ${2}, Revision ${r}\\n(${t} ${u}@${h})\\n\";" > $tempfile +echo "unsigned bootprog_rev = ${r%%.*}${r##*.};" >> $tempfile mv $tempfile vers.c Modified: stable/11/sys/boot/efi/loader/main.c ============================================================================== --- stable/11/sys/boot/efi/loader/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/efi/loader/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -50,10 +50,7 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; struct arch_switch archsw; /* MI/MD interface boundary */ @@ -387,9 +384,7 @@ main(int argc, CHAR16 *argv[]) printf("EFI Firmware: %S (rev %d.%02d)\n", ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); /* * Disable the watchdog timer. By default the boot manager sets Modified: stable/11/sys/boot/i386/loader/main.c ============================================================================== --- stable/11/sys/boot/i386/loader/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/i386/loader/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -77,7 +77,7 @@ static void i386_zfs_probe(void); #endif /* from vers.c */ -extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; +extern char bootprog_info[]; /* XXX debugging */ extern char end[]; @@ -215,9 +215,7 @@ main(void) /* detect PCI BIOS for future reference */ biospci_detect(); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); extract_currdev(); /* set $currdev and $loaddev */ setenv("LINES", "24", 1); /* optional */ Modified: stable/11/sys/boot/mips/beri/loader/loader.h ============================================================================== --- stable/11/sys/boot/mips/beri/loader/loader.h Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/mips/beri/loader/loader.h Tue Jan 17 01:29:03 2017 (r312318) @@ -58,7 +58,6 @@ extern struct bootinfo boot2_bootinfo; int md_load64(char *args, vm_offset_t *modulep); /* vers.c */ -extern char bootprog_name[], bootprog_rev[]; -extern char bootprog_date[], bootprog_maker[]; +extern char bootprog_info[]; #endif /* !_BOOT_LOADER_H_ */ Modified: stable/11/sys/boot/mips/beri/loader/main.c ============================================================================== --- stable/11/sys/boot/mips/beri/loader/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/mips/beri/loader/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -144,9 +144,7 @@ main(int argc, char *argv[], char *envv[ } extract_currdev(bootinfop); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); #if 0 printf("bootpath=\"%s\"\n", bootpath); #endif Modified: stable/11/sys/boot/ofw/common/main.c ============================================================================== --- stable/11/sys/boot/ofw/common/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/ofw/common/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -36,10 +36,7 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; /* MI/MD interface boundary */ extern char end[]; -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; u_int32_t acells, scells; @@ -127,9 +124,7 @@ main(int (*openfirm)(void *)) if (devsw[i]->dv_init != NULL) (devsw[i]->dv_init)(); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); printf("Memory: %lldKB\n", memsize() / 1024); OF_getprop(chosen, "bootpath", bootpath, 64); Modified: stable/11/sys/boot/pc98/loader/main.c ============================================================================== --- stable/11/sys/boot/pc98/loader/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/pc98/loader/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -66,7 +66,7 @@ static void isa_outb(int port, int valu void exit(int code); /* from vers.c */ -extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; +extern char bootprog_info[]; /* XXX debugging */ extern char end[]; @@ -186,9 +186,7 @@ main(void) initial_bootinfo->bi_extmem = bios_extmem / 1024; } - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); extract_currdev(); /* set $currdev and $loaddev */ setenv("LINES", "24", 1); /* optional */ Modified: stable/11/sys/boot/powerpc/kboot/main.c ============================================================================== --- stable/11/sys/boot/powerpc/kboot/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/powerpc/kboot/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -38,10 +38,7 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; extern void *_end; -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; int kboot_getdev(void **vdev, const char *devspec, const char **path); ssize_t kboot_copyin(const void *src, vm_offset_t dest, const size_t len); @@ -119,9 +116,7 @@ main(int argc, const char **argv) archsw.arch_autoload = kboot_autoload; archsw.arch_loadaddr = kboot_loadaddr; - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); setenv("currdev", bootdev, 1); setenv("loaddev", bootdev, 1); Modified: stable/11/sys/boot/powerpc/ps3/main.c ============================================================================== --- stable/11/sys/boot/powerpc/ps3/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/powerpc/ps3/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -41,10 +41,7 @@ __FBSDID("$FreeBSD$"); struct arch_switch archsw; extern void *_end; -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; int ps3_getdev(void **vdev, const char *devspec, const char **path); ssize_t ps3_copyin(const void *src, vm_offset_t dest, const size_t len); @@ -133,9 +130,7 @@ main(void) archsw.arch_readin = ps3_readin; archsw.arch_autoload = ps3_autoload; - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); printf("Memory: %lldKB\n", maxmem / 1024); env_setenv("currdev", EV_VOLATILE, ps3_fmtdev(&currdev), Modified: stable/11/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/11/sys/boot/sparc64/loader/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/sparc64/loader/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "dev_net.h" -extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[]; +extern char bootprog_info[]; enum { HEAPVA = 0x800000, @@ -891,9 +891,7 @@ main(int (*openfirm)(void *)) env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset, env_nounset); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); printf("bootpath=\"%s\"\n", bootpath); /* Give control to the machine independent loader code. */ Modified: stable/11/sys/boot/uboot/common/main.c ============================================================================== --- stable/11/sys/boot/uboot/common/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/uboot/common/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -62,10 +62,7 @@ struct device_type { }; extern char end[]; -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; extern unsigned char _etext[]; extern unsigned char _edata[]; @@ -431,9 +428,7 @@ main(int argc, char **argv) cons_probe(); printf("Compatible U-Boot API signature found @%p\n", sig); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); printf("\n"); dump_sig(sig); Modified: stable/11/sys/boot/userboot/userboot/main.c ============================================================================== --- stable/11/sys/boot/userboot/userboot/main.c Tue Jan 17 00:48:02 2017 (r312317) +++ stable/11/sys/boot/userboot/userboot/main.c Tue Jan 17 01:29:03 2017 (r312318) @@ -51,10 +51,7 @@ static int userboot_zfs_found; struct loader_callbacks *callbacks; void *callbacks_arg; -extern char bootprog_name[]; -extern char bootprog_rev[]; -extern char bootprog_date[]; -extern char bootprog_maker[]; +extern char bootprog_info[]; static jmp_buf jb; struct arch_switch archsw; /* MI/MD interface boundary */ @@ -101,9 +98,7 @@ loader_main(struct loader_callbacks *cb, */ cons_probe(); - printf("\n"); - printf("%s, Revision %s\n", bootprog_name, bootprog_rev); - printf("(%s, %s)\n", bootprog_maker, bootprog_date); + printf("\n%s", bootprog_info); #if 0 printf("Memory: %ld k\n", memsize() / 1024); #endif From owner-svn-src-all@freebsd.org Tue Jan 17 01:52:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 514E3CB392C; Tue, 17 Jan 2017 01:52:59 +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 20A7F19CB; Tue, 17 Jan 2017 01:52:59 +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 v0H1qwMZ074687; Tue, 17 Jan 2017 01:52:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1qwsL074686; Tue, 17 Jan 2017 01:52:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170152.v0H1qwsL074686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:52:58 +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: r312319 - 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, 17 Jan 2017 01:52:59 -0000 Author: ngie Date: Tue Jan 17 01:52:58 2017 New Revision: 312319 URL: https://svnweb.freebsd.org/changeset/base/312319 Log: MFC r312112: Fix -Wunused on gcc 4.9 (x was set but not used) Modified: stable/11/sys/kern/subr_unit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_unit.c ============================================================================== --- stable/11/sys/kern/subr_unit.c Tue Jan 17 01:29:03 2017 (r312318) +++ stable/11/sys/kern/subr_unit.c Tue Jan 17 01:52:58 2017 (r312319) @@ -986,7 +986,7 @@ main(int argc, char **argv) long count = 10000; /* Number of unrs to test */ long reps = 1, m; int ch; - u_int i, x, j; + u_int i, j; verbose = false; @@ -999,7 +999,7 @@ main(int argc, char **argv) usage(argv); exit(2); } - + break; case 'v': verbose = true; @@ -1026,7 +1026,6 @@ main(int argc, char **argv) printf("sizeof(struct unrb) %zu\n", sizeof(struct unrb)); printf("sizeof(struct unrhdr) %zu\n", sizeof(struct unrhdr)); printf("NBITS %lu\n", (unsigned long)NBITS); - x = 1; for (m = 0; m < count * reps; m++) { j = random(); i = (j >> 1) % count; From owner-svn-src-all@freebsd.org Tue Jan 17 01:54:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3E9DCB39AA; Tue, 17 Jan 2017 01:54:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 787CE1B32; Tue, 17 Jan 2017 01:54:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 454D1D45F9C; Tue, 17 Jan 2017 12:54:08 +1100 (AEDT) Date: Tue, 17 Jan 2017 12:54:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sean Bruno cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312293 - in head/sys: kern sys In-Reply-To: <201701161658.v0GGwD0Z050066@repo.freebsd.org> Message-ID: <20170117120313.K1043@besplex.bde.org> References: <201701161658.v0GGwD0Z050066@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=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=_hRaNZH9cyDBuD_93R8A:9 a=V7xSkV4eWzfH1oLK:21 a=wwmg7bA4uAeZwAJW:21 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: Tue, 17 Jan 2017 01:54:17 -0000 On Mon, 16 Jan 2017, Sean Bruno wrote: > Log: > Change startup order for the no EARLY_AP_STARTUP case to initialize > gtaskqueue bits at SI_SUB_INIT_IF instead of waiting until SI_SUB_SMP > which is far too late. > > Add an assertion in taskqgroup_attach() to catch startup initialization > failures in the future. > > Reported by: kib bde I don't see how this can work. The purpose of the EARLY_AP_STARTUP ifdef is to split up the initialization so that part of it is much later in the !EARLY_AP_STARTUP case. The second part was too late to work, except possibly in the UP case where the split isn't needed. This commit turns the split into almost a non-split and does the second part too early to work. Also, I don't see how dynamic management of CPUs can work. The adjustment function was delayed so that it can see the correct number of CPUs. I think this number can change dynamically later still, but the adjustment is static so it doesn't run again. > Modified: head/sys/kern/subr_gtaskqueue.c > ============================================================================== > --- head/sys/kern/subr_gtaskqueue.c Mon Jan 16 16:44:13 2017 (r312292) > +++ head/sys/kern/subr_gtaskqueue.c Mon Jan 16 16:58:12 2017 (r312293) > @@ -646,6 +646,7 @@ taskqgroup_attach(struct taskqgroup *qgr > qid = taskqgroup_find(qgroup, uniq); > qgroup->tqg_queue[qid].tgc_cnt++; > LIST_INSERT_HEAD(&qgroup->tqg_queue[qid].tgc_tasks, gtask, gt_list); > + MPASS(qgroup->tqg_queue[qid].tgc_taskq != NULL); This was removed in the next commit. Failure to run the adjustment function early enough to work (or at all) results in this assertion failing. I don't see how the pointer can become non-null later if this assertion fails, so this shouldn't be removed. > Modified: head/sys/sys/gtaskqueue.h > ============================================================================== > --- head/sys/sys/gtaskqueue.h Mon Jan 16 16:44:13 2017 (r312292) > +++ head/sys/sys/gtaskqueue.h Mon Jan 16 16:58:12 2017 (r312293) > @@ -115,7 +115,7 @@ taskqgroup_adjust_##name(void *arg) > taskqgroup_adjust(qgroup_##name, (cnt), (stride)); \ > } \ > \ > -SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY, \ > +SYSINIT(taskqgroup_adj_##name, SI_SUB_INIT_IF, SI_ORDER_ANY, \ > taskqgroup_adjust_##name, NULL); \ > \ > struct __hack Note that in the EARLY_AP_STARTUP case, this operation is done sequentially at SI_SUB_INIT_IF:SI_ORDER_FIRST in the taskgroup_define* method. In the !EARLY_AP_STARTUP case, the order was significantly different, but now it is just: taskqgroup_define_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, taskqgroup_adj_##name, SI_SUB_INIT_IF, SI_ORDER_ANY, (or even the reverse, if ANY really means "any", but according to its comment it means "last". It is last numerically, and I think it really is last). So split is almost null -- only a few other SI_SUB_INIT_IF's can run before the last one, and the APs are never started before this. The ifdef is still on EARLY_AP_STARTUP, so makes no sense now. Testing shows that this works as predicted: with !EARLY_AP_STARTUP: - UP case now works (because taskqgroup_adj_##name now runs early enough to work) - SMP case still gives null pointer panic (because taskqgroup_adj_##name now runs too early to work (cnt = 1, stride = 1, smp_started = 0, mp_ncpus = 8). After this commit, smp_started is always 0 at attach time for obvious reasons, but this only causes _taskqgroup_adj_##name to do nothing in the SMP case (mp_ncpus != 1). Bruce From owner-svn-src-all@freebsd.org Tue Jan 17 01:55:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7516BCB3A42; Tue, 17 Jan 2017 01:55:06 +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 412491CDB; Tue, 17 Jan 2017 01:55:06 +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 v0H1t5WW074894; Tue, 17 Jan 2017 01:55:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1t5US074893; Tue, 17 Jan 2017 01:55:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170155.v0H1t5US074893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:55: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: r312320 - stable/10/tests/sys/kern/execve 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: Tue, 17 Jan 2017 01:55:06 -0000 Author: ngie Date: Tue Jan 17 01:55:05 2017 New Revision: 312320 URL: https://svnweb.freebsd.org/changeset/base/312320 Log: MFC r312118,r312121: r312118: Fix -Wformat issue with zero-length format string passed to err(3) Tested with: clang, gcc 4.2.1, gcc 4.9 r312121: Follow up to r312118 State that execve failed instead of just printing out the program name and strerror(errno) via err(3). Modified: stable/10/tests/sys/kern/execve/execve_helper.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/kern/execve/execve_helper.c ============================================================================== --- stable/10/tests/sys/kern/execve/execve_helper.c Tue Jan 17 01:52:58 2017 (r312319) +++ stable/10/tests/sys/kern/execve/execve_helper.c Tue Jan 17 01:55:05 2017 (r312320) @@ -50,5 +50,5 @@ main(int argc, char **argv) } execve(argv[1], &argv[1], NULL); - err(1, ""); + err(1, "execve failed"); } From owner-svn-src-all@freebsd.org Tue Jan 17 01:55:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 657E8CB3AB7; Tue, 17 Jan 2017 01:55:15 +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 372E11D54; Tue, 17 Jan 2017 01:55:15 +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 v0H1tEs5074944; Tue, 17 Jan 2017 01:55:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1tEhb074943; Tue, 17 Jan 2017 01:55:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170155.v0H1tEhb074943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:55: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: r312321 - stable/11/tests/sys/kern/execve 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, 17 Jan 2017 01:55:15 -0000 Author: ngie Date: Tue Jan 17 01:55:14 2017 New Revision: 312321 URL: https://svnweb.freebsd.org/changeset/base/312321 Log: MFC r312118,r312121: r312118: Fix -Wformat issue with zero-length format string passed to err(3) Tested with: clang, gcc 4.2.1, gcc 4.9 r312121: Follow up to r312118 State that execve failed instead of just printing out the program name and strerror(errno) via err(3). Modified: stable/11/tests/sys/kern/execve/execve_helper.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/kern/execve/execve_helper.c ============================================================================== --- stable/11/tests/sys/kern/execve/execve_helper.c Tue Jan 17 01:55:05 2017 (r312320) +++ stable/11/tests/sys/kern/execve/execve_helper.c Tue Jan 17 01:55:14 2017 (r312321) @@ -50,5 +50,5 @@ main(int argc, char **argv) } execve(argv[1], &argv[1], NULL); - err(1, ""); + err(1, "execve failed"); } From owner-svn-src-all@freebsd.org Tue Jan 17 01:56:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4470CB3C83; Tue, 17 Jan 2017 01:56: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 9131A107A; Tue, 17 Jan 2017 01:56: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 v0H1uiMi075083; Tue, 17 Jan 2017 01:56:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1uiRs075082; Tue, 17 Jan 2017 01:56:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170156.v0H1uiRs075082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:56: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: r312322 - stable/11/tests/sys/file 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, 17 Jan 2017 01:56:45 -0000 Author: ngie Date: Tue Jan 17 01:56:44 2017 New Revision: 312322 URL: https://svnweb.freebsd.org/changeset/base/312322 Log: MFC r312111: Remove unused vars to fix -Wunused issues Modified: stable/11/tests/sys/file/ftruncate_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/file/ftruncate_test.c ============================================================================== --- stable/11/tests/sys/file/ftruncate_test.c Tue Jan 17 01:55:14 2017 (r312321) +++ stable/11/tests/sys/file/ftruncate_test.c Tue Jan 17 01:56:44 2017 (r312322) @@ -57,7 +57,7 @@ static off_t lengths[] = {0, 1, 2, 3, 4, static int lengths_count = sizeof(lengths) / sizeof(off_t); int -main(int argc, char *argv[]) +main(void) { int error, fd, fds[2], i, read_only_fd; char path[PATH_MAX]; From owner-svn-src-all@freebsd.org Tue Jan 17 01:56:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C793CB3CC8; Tue, 17 Jan 2017 01:56: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 DDE2E10A5; Tue, 17 Jan 2017 01:56: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 v0H1unc2075132; Tue, 17 Jan 2017 01:56:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1unBL075131; Tue, 17 Jan 2017 01:56:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170156.v0H1unBL075131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:56:49 +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: r312323 - stable/10/tests/sys/file 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: Tue, 17 Jan 2017 01:56:51 -0000 Author: ngie Date: Tue Jan 17 01:56:49 2017 New Revision: 312323 URL: https://svnweb.freebsd.org/changeset/base/312323 Log: MFC r312111: Remove unused vars to fix -Wunused issues Modified: stable/10/tests/sys/file/ftruncate_test.c Directory Properties: stable/10/ (props changed) Modified: stable/10/tests/sys/file/ftruncate_test.c ============================================================================== --- stable/10/tests/sys/file/ftruncate_test.c Tue Jan 17 01:56:44 2017 (r312322) +++ stable/10/tests/sys/file/ftruncate_test.c Tue Jan 17 01:56:49 2017 (r312323) @@ -57,7 +57,7 @@ static off_t lengths[] = {0, 1, 2, 3, 4, static int lengths_count = sizeof(lengths) / sizeof(off_t); int -main(int argc, char *argv[]) +main(void) { int error, fd, fds[2], i, read_only_fd; char path[PATH_MAX]; From owner-svn-src-all@freebsd.org Tue Jan 17 01:57:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3F34CB3D53; Tue, 17 Jan 2017 01:57:43 +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 690D91340; Tue, 17 Jan 2017 01:57:43 +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 v0H1vgpk075227; Tue, 17 Jan 2017 01:57:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1vgOu075226; Tue, 17 Jan 2017 01:57:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170157.v0H1vgOu075226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:57: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: r312324 - stable/10/contrib/netbsd-tests/fs/nfs/nfsservice/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: Tue, 17 Jan 2017 01:57:43 -0000 Author: ngie Date: Tue Jan 17 01:57:42 2017 New Revision: 312324 URL: https://svnweb.freebsd.org/changeset/base/312324 Log: MFC r312122: Remove contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind This should have been pruned in r305358 Deleted: stable/10/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/ Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@freebsd.org Tue Jan 17 01:58:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7AC6CB3E25; Tue, 17 Jan 2017 01:58: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 7DB3E155F; Tue, 17 Jan 2017 01:58: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 v0H1woYx075357; Tue, 17 Jan 2017 01:58:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1wo9Y075356; Tue, 17 Jan 2017 01:58:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170158.v0H1wo9Y075356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:58: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: r312325 - 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: Tue, 17 Jan 2017 01:58:51 -0000 Author: ngie Date: Tue Jan 17 01:58:50 2017 New Revision: 312325 URL: https://svnweb.freebsd.org/changeset/base/312325 Log: MFC r312113: Clean up trailing whitespace Modified: stable/10/sys/kern/subr_unit.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_unit.c ============================================================================== --- stable/10/sys/kern/subr_unit.c Tue Jan 17 01:57:42 2017 (r312324) +++ stable/10/sys/kern/subr_unit.c Tue Jan 17 01:58:50 2017 (r312325) @@ -192,7 +192,7 @@ CTASSERT(sizeof(struct unr) == sizeof(st * Consistency check function. * * Checks the internal consistency as well as we can. - * + * * Called at all boundaries of this API. */ static void @@ -220,7 +220,7 @@ check_unrhdr(struct unrhdr *uh, int line ("UNR inconsistency: busy %u found %u (line %d)\n", ub->busy, w, line)); y += w; - } else if (up->ptr != NULL) + } else if (up->ptr != NULL) y += up->len; } KASSERT (y == uh->busy, @@ -355,7 +355,7 @@ is_bitmap(struct unrhdr *uh, struct unr /* * Look for sequence of items which can be combined into a bitmap, if * multiple are present, take the one which saves most memory. - * + * * Return (1) if a sequence was found to indicate that another call * might be able to do more. Return (0) if we found no suitable sequence. * @@ -582,7 +582,7 @@ alloc_unrl(struct unrhdr *uh) } /* - * We can always allocate from the first list element, so if we have + * We can always allocate from the first list element, so if we have * nothing on the list, we must have run out of unit numbers. */ if (up == NULL) @@ -797,7 +797,7 @@ free_unrl(struct unrhdr *uh, u_int item, /* Handle bitmap items */ if (is_bitmap(uh, up)) { ub = up->ptr; - + KASSERT(bit_test(ub->map, item) != 0, ("UNR: Freeing free item %d (bitmap)\n", item)); bit_clear(ub->map, item); @@ -900,7 +900,7 @@ print_unr(struct unrhdr *uh, struct unr for (x = 0; x < up->len; x++) { if (bit_test(ub->map, x)) printf("#"); - else + else printf(" "); } printf("]\n"); From owner-svn-src-all@freebsd.org Tue Jan 17 01:59:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0C6FCB3E60; Tue, 17 Jan 2017 01:59:00 +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 685A815CF; Tue, 17 Jan 2017 01:59: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 v0H1wxBg075406; Tue, 17 Jan 2017 01:58:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1wxlc075405; Tue, 17 Jan 2017 01:58:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170158.v0H1wxlc075405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:58: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: r312326 - stable/11/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind 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, 17 Jan 2017 01:59:00 -0000 Author: ngie Date: Tue Jan 17 01:58:59 2017 New Revision: 312326 URL: https://svnweb.freebsd.org/changeset/base/312326 Log: MFC r312122: Remove contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind This should have been pruned in r305358 Deleted: stable/11/contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind/ Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Tue Jan 17 01:59:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D0EDCB3F25; Tue, 17 Jan 2017 01:59:43 +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 4F7B71848; Tue, 17 Jan 2017 01:59:43 +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 v0H1xgQn075511; Tue, 17 Jan 2017 01:59:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H1xgfb075510; Tue, 17 Jan 2017 01:59:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170159.v0H1xgfb075510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 01:59:42 +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: r312327 - 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, 17 Jan 2017 01:59:43 -0000 Author: ngie Date: Tue Jan 17 01:59:42 2017 New Revision: 312327 URL: https://svnweb.freebsd.org/changeset/base/312327 Log: MFC r312113: Clean up trailing whitespace Modified: stable/11/sys/kern/subr_unit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_unit.c ============================================================================== --- stable/11/sys/kern/subr_unit.c Tue Jan 17 01:58:59 2017 (r312326) +++ stable/11/sys/kern/subr_unit.c Tue Jan 17 01:59:42 2017 (r312327) @@ -216,7 +216,7 @@ ub_full(struct unrb *ub, int len) * Consistency check function. * * Checks the internal consistency as well as we can. - * + * * Called at all boundaries of this API. */ static void @@ -240,7 +240,7 @@ check_unrhdr(struct unrhdr *uh, int line w = 0; bit_count(ub->map, 0, up->len, &w); y += w; - } else if (up->ptr != NULL) + } else if (up->ptr != NULL) y += up->len; } KASSERT (y == uh->busy, @@ -375,7 +375,7 @@ is_bitmap(struct unrhdr *uh, struct unr /* * Look for sequence of items which can be combined into a bitmap, if * multiple are present, take the one which saves most memory. - * + * * Return (1) if a sequence was found to indicate that another call * might be able to do more. Return (0) if we found no suitable sequence. * @@ -591,7 +591,7 @@ alloc_unrl(struct unrhdr *uh) } /* - * We can always allocate from the first list element, so if we have + * We can always allocate from the first list element, so if we have * nothing on the list, we must have run out of unit numbers. */ if (up == NULL) @@ -803,7 +803,7 @@ free_unrl(struct unrhdr *uh, u_int item, /* Handle bitmap items */ if (is_bitmap(uh, up)) { ub = up->ptr; - + KASSERT(bit_test(ub->map, item) != 0, ("UNR: Freeing free item %d (bitmap)\n", item)); bit_clear(ub->map, item); @@ -909,7 +909,7 @@ print_unr(struct unrhdr *uh, struct unr for (x = 0; x < up->len; x++) { if (bit_test(ub->map, x)) printf("#"); - else + else printf(" "); } printf("]\n"); From owner-svn-src-all@freebsd.org Tue Jan 17 03:38:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E5F8CB3415; Tue, 17 Jan 2017 03:38: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 04485125B; Tue, 17 Jan 2017 03:38: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 v0H3coSY017068; Tue, 17 Jan 2017 03:38:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H3coqg017066; Tue, 17 Jan 2017 03:38:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170338.v0H3coqg017066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 03:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312328 - 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: Tue, 17 Jan 2017 03:38:51 -0000 Author: ngie Date: Tue Jan 17 03:38:49 2017 New Revision: 312328 URL: https://svnweb.freebsd.org/changeset/base/312328 Log: Add a make target (smilint) for running smilint tool against BMIBS Running smilint against MIB definitions is useful in finding functional problems with MIB definitions/descriptions. This is inspired by the smilint targets defined in usr.sbin/bsnmpd/modules/{snmp_hostres,snmp_mibII}/Makefile Document all of the variables that are involved in running the smilint target, as well as all of the prerequisites to running it. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9099 Modified: head/share/mk/bsd.README head/share/mk/bsd.snmpmod.mk Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Tue Jan 17 01:59:42 2017 (r312327) +++ head/share/mk/bsd.README Tue Jan 17 03:38:49 2017 (r312328) @@ -418,7 +418,15 @@ tree. bsd.snmpmod.mk leverages bsd.lib.mk for building MIB modules and bsd.files.mk for installing MIB description and definition files. -It has no additional targets. +It implements the following additional targets: + + smilint: + execute smilint on the MIBs defined by BMIBS. + + The net-mgmt/libsmi package must be installed before + executing this target. The net-mgmt/net-snmp package + should be installed as well to reduce false positives + from smilint. It sets/uses the following variables: @@ -444,8 +452,19 @@ EXTRAMIBSYMS Extra MIB definition files See ${MOD}_oid.h for more details. +LOCALBASE The package root where smilint and the net-snmp + definitions can be found + MOD The bsnmpd module name. +SMILINT smilint binary to use with the smilint make target. + +SMILINT_FLAGS flags to pass to smilint. + +SMIPATH A colon-separated directory path where MIBs definitions + can be found. See "SMIPATH" in smi_config for more + details. + XSYM MIB names to extract symbols for. See ${MOD}_oid.h for more details. Modified: head/share/mk/bsd.snmpmod.mk ============================================================================== --- head/share/mk/bsd.snmpmod.mk Tue Jan 17 01:59:42 2017 (r312327) +++ head/share/mk/bsd.snmpmod.mk Tue Jan 17 03:38:49 2017 (r312328) @@ -25,4 +25,18 @@ FILESGROUPS+= BMIBS BMIBSDIR?= ${SHAREDIR}/snmp/mibs .endif +.if !target(smilint) && !empty(BMIBS) +LOCALBASE?= /usr/local + +SMILINT?= ${LOCALBASE}/bin/smilint + +SMIPATH?= ${BMIBSDIR}:${LOCALBASE}/share/snmp/mibs + +SMILINT_FLAGS?= -c /dev/null -l6 -i group-membership + +smilint: ${BMIBS} + SMIPATH=${SMIPATH} ${SMILINT} ${SMILINT_FLAGS} ${.ALLSRC} +.endif +smilint: .PHONY + .include From owner-svn-src-all@freebsd.org Tue Jan 17 03:41:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 803D4CB3649; Tue, 17 Jan 2017 03:41: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 5202B15E0; Tue, 17 Jan 2017 03:41: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 v0H3fNNd019966; Tue, 17 Jan 2017 03:41:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H3fN6U019964; Tue, 17 Jan 2017 03:41:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170341.v0H3fN6U019964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 03:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312329 - in head/usr.sbin/bsnmpd/modules: snmp_hostres snmp_mibII 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, 17 Jan 2017 03:41:24 -0000 Author: ngie Date: Tue Jan 17 03:41:23 2017 New Revision: 312329 URL: https://svnweb.freebsd.org/changeset/base/312329 Log: Remove ad hoc smilint targets made standard in bsd.snmpmod.mk in r312328 MFC after: 1 week X-MFC with: r312328 Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Modified: head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Tue Jan 17 03:38:49 2017 (r312328) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile Tue Jan 17 03:41:23 2017 (r312329) @@ -75,8 +75,3 @@ LIBADD= kvm devinfo m geom memstat printcap.pico: printcap.c ${CC} ${PICFLAG} -DPIC ${CFLAGS:C/^-W.*//} -c ${.IMPSRC} -o ${.TARGET} - -smilint: .PHONY -smilint: ${BMIBS} - env SMIPATH=.:/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} Modified: head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Tue Jan 17 03:38:49 2017 (r312328) +++ head/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile Tue Jan 17 03:41:23 2017 (r312329) @@ -21,8 +21,3 @@ INCS= snmp_${MOD}.h BMIBS= BEGEMOT-IP-MIB.txt BEGEMOT-MIB2-MIB.txt .include - -smilint: .PHONY -smilint: ${BMIBS} - env SMIPATH=/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \ - smilint -c /dev/null -l6 -i group-membership ${.ALLSRC} From owner-svn-src-all@freebsd.org Tue Jan 17 03:44:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5895DCB389C; Tue, 17 Jan 2017 03:44:46 +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 27E0F19F9; Tue, 17 Jan 2017 03:44:46 +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 v0H3ijZS020869; Tue, 17 Jan 2017 03:44:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H3ijS2020868; Tue, 17 Jan 2017 03:44:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170344.v0H3ijS2020868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 03:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312330 - head/usr.sbin/bsnmpd/modules 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, 17 Jan 2017 03:44:46 -0000 Author: ngie Date: Tue Jan 17 03:44:45 2017 New Revision: 312330 URL: https://svnweb.freebsd.org/changeset/base/312330 Log: Add smilint target to subdir targets so "make smilint" here will run the smilint target in subdirs While here, convert a path that's .CURDIR relative to SRCTOP MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/bsnmpd/modules/Makefile Modified: head/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/Makefile Tue Jan 17 03:41:23 2017 (r312329) +++ head/usr.sbin/bsnmpd/modules/Makefile Tue Jan 17 03:44:45 2017 (r312330) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../../contrib/bsnmp/snmpd +.PATH: ${SRCTOP}/contrib/bsnmp/snmpd .if ${MK_ATM} != "no" _snmp_atm= snmp_atm @@ -36,4 +36,6 @@ SUBDIR+=snmp_wlan INCS= snmpmod.h INCSDIR= ${INCLUDEDIR}/bsnmp +SUBDIR_TARGETS+= smilint + .include From owner-svn-src-all@freebsd.org Tue Jan 17 03:52:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EFA0CB3DDC; Tue, 17 Jan 2017 03:52:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FA0C10A7; Tue, 17 Jan 2017 03:52:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0H3qvBB025189; Tue, 17 Jan 2017 03:52:57 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H3qvNJ025187; Tue, 17 Jan 2017 03:52:57 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201701170352.v0H3qvNJ025187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 17 Jan 2017 03:52:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312331 - head/contrib/bsnmp/snmpd 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, 17 Jan 2017 03:52:58 -0000 Author: glebius Date: Tue Jan 17 03:52:57 2017 New Revision: 312331 URL: https://svnweb.freebsd.org/changeset/base/312331 Log: Fix regression from r310655, which broke operation of bsnmpd if it is bound to a non-wildcard address. As documented in ip(4), doing sendmsg(2) with IP_SENDSRCADDR on a socket that is bound to non-wildcard address is completely different to using this control message on a wildcard one. A fix is to add a bool to mark whether we did setsockopt(IP_RECVDSTADDR) on the socket, and use IP_SENDSRCADDR control message only if we did. While here, garbage collect absolutely useless udp_recv() function that establishes some structures on stack to never use them later. Modified: head/contrib/bsnmp/snmpd/trans_udp.c head/contrib/bsnmp/snmpd/trans_udp.h Modified: head/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- head/contrib/bsnmp/snmpd/trans_udp.c Tue Jan 17 03:44:45 2017 (r312330) +++ head/contrib/bsnmp/snmpd/trans_udp.c Tue Jan 17 03:52:57 2017 (r312331) @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -119,13 +120,15 @@ udp_init_port(struct tport *tp) addr.sin_port = htons(p->port); addr.sin_family = AF_INET; addr.sin_len = sizeof(addr); - if (addr.sin_addr.s_addr == INADDR_ANY && - setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, - sizeof(on)) == -1) { - syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); - close(p->input.fd); - p->input.fd = -1; - return (SNMP_ERR_GENERR); + if (addr.sin_addr.s_addr == INADDR_ANY) { + if (setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, + sizeof(on)) == -1) { + syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); + close(p->input.fd); + p->input.fd = -1; + return (SNMP_ERR_GENERR); + } + p->recvdstaddr = true; } if (bind(p->input.fd, (struct sockaddr *)&addr, sizeof(addr))) { if (errno == EADDRNOTAVAIL) { @@ -218,7 +221,6 @@ udp_send(struct tport *tp, const u_char { struct udp_port *p = (struct udp_port *)tp; struct cmsghdr *cmsg; - struct in_addr *src_addr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; struct iovec iov; @@ -231,15 +233,20 @@ udp_send(struct tport *tp, const u_char msg.msg_iovlen = 1; msg.msg_name = __DECONST(void *, addr); msg.msg_namelen = addrlen; - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - cmsg = CMSG_FIRSTHDR(&msg); - cmsg->cmsg_level = IPPROTO_IP; - cmsg->cmsg_type = IP_SENDSRCADDR; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - src_addr = (struct in_addr *)(void*)CMSG_DATA(cmsg); - memcpy(src_addr, &p->recv_addr, sizeof(struct in_addr)); + if (p->recvdstaddr) { + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_IP; + cmsg->cmsg_type = IP_SENDSRCADDR; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + memcpy(CMSG_DATA(cmsg), &p->dstaddr, sizeof(struct in_addr)); + } else { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } return (sendmsg(p->input.fd, &msg, 0)); } @@ -260,11 +267,12 @@ check_priv_dgram(struct port_input *pi, * Each receive should return one datagram. */ static ssize_t -recv_dgram(struct port_input *pi, struct in_addr *laddr) +udp_recv(struct tport *tp, struct port_input *pi) { u_char embuf[1000]; char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + CMSG_SPACE(sizeof(struct in_addr))]; + struct udp_port *p = (struct udp_port *)tp; struct msghdr msg; struct iovec iov[1]; ssize_t len; @@ -316,7 +324,8 @@ recv_dgram(struct port_input *pi, struct cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_RECVDSTADDR) - memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); + memcpy(&p->dstaddr, CMSG_DATA(cmsg), + sizeof(struct in_addr)); if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDS) cred = (struct sockcred *)CMSG_DATA(cmsg); @@ -329,42 +338,6 @@ recv_dgram(struct port_input *pi, struct } /* - * Receive something - */ -static ssize_t -udp_recv(struct tport *tp, struct port_input *pi) -{ - struct udp_port *p = (struct udp_port *)tp; - struct cmsghdr *cmsgp; - struct in_addr *laddr; - struct msghdr msg; - char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - ssize_t ret; - - memset(cbuf, 0, sizeof(cbuf)); - - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - - cmsgp = CMSG_FIRSTHDR(&msg); - cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - cmsgp->cmsg_level = IPPROTO_IP; - cmsgp->cmsg_type = IP_SENDSRCADDR; - laddr = (struct in_addr *)CMSG_DATA(cmsgp); - - ret = recv_dgram(pi, laddr); - - memcpy(&p->recv_addr, laddr, sizeof(struct in_addr)); - - if (laddr->s_addr == INADDR_ANY) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } - - return (ret); -} - -/* * Port table */ int Modified: head/contrib/bsnmp/snmpd/trans_udp.h ============================================================================== --- head/contrib/bsnmp/snmpd/trans_udp.h Tue Jan 17 03:44:45 2017 (r312330) +++ head/contrib/bsnmp/snmpd/trans_udp.h Tue Jan 17 03:52:57 2017 (r312331) @@ -39,7 +39,9 @@ struct udp_port { struct port_input input; /* common input stuff */ struct sockaddr_in ret; /* the return address */ - struct in_addr recv_addr; /* the address the request was sent to */ + + bool recvdstaddr; /* IP_RECVDSTADDR is on */ + struct in_addr dstaddr; /* address the request was sent to */ }; /* argument for open call */ From owner-svn-src-all@freebsd.org Tue Jan 17 03:57:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCC26CB307E; Tue, 17 Jan 2017 03:57:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::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 89EE613A2; Tue, 17 Jan 2017 03:57:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id 75so6834426pgf.3; Mon, 16 Jan 2017 19:57:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=fTjMo6ItsIoDuoOXxs5bAGC7achJEJ9OklVeMI0ejOA=; b=rO5fc0kE2kEiH7nQILAZWSF58dR0EC8pRCB58tNShz6/Uwal3+Pj911mOi1R7qqR9D ITrdLB1yberKp/aDHBIkYtKnadlVKY2VHtd9Tz7aDyocGF4+YM2Md53YCW92CLzRkBf/ qwSJzAQzrQ6DRj5RWWpo7UNiK4jEMhiRMF4u2emwC6KYKGGaQ+7hQvSzuf2t/1xPvLGR WcAJwpAZQ8KYPc0b3SbAwQ1haiPnFCjArgXelgHV/uURqJkeL9oDYwuMO7ZXmeINBB8t VJJBCKT3zHdCk9R+yi3giOp2Tz4BKDQF6qjjgiwoV7yBxXv3IRImlXRYyOLPAMYsV/be z8gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=fTjMo6ItsIoDuoOXxs5bAGC7achJEJ9OklVeMI0ejOA=; b=Zn3j+3RlRnD845OZg4KG625R+nodNsGp4Hukgb3dpyK2e+jU4+qDNXju4g2Q4cGQJF w1B2Ri5Z96VL05eVA/cl/SlOBHOij6VXM6vd4u37nBBbKZMq+L0R4UkHnq5x+1mH/kaZ Rw67kp8caWPWudNV3jQSvf1I878SgoN2h5tQ44aGbIed/t5+UvfQ+Ys2Dk6i2JFrrD/c YPF6DzznvhX+tZT1bUMTtfowRSL55vRXz7jIl1Fp/QJsNgKTmNYTVSYALMcFpXpGB72h ZUzTV2zJIxQh+urnfFsbiiXDuXmdx6OvM12GQmUyJ6fDmccYY+5xkKw5pucNgsSwsuEK qSVg== X-Gm-Message-State: AIkVDXLzLzeG2qkfTuYQHYQmLtLdjC9zkZOENE6jtpwAy02ZFn4y5JLpyKAiBsI/qI5B1Q== X-Received: by 10.99.47.199 with SMTP id v190mr16673073pgv.26.1484625471988; Mon, 16 Jan 2017 19:57:51 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id s17sm51286122pgo.27.2017.01.16.19.57.51 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 19:57:51 -0800 (PST) Subject: Re: svn commit: r312331 - head/contrib/bsnmp/snmpd Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_91EC0E32-A2C3-46FD-9560-48973F51C376"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701170352.v0H3qvNJ025187@repo.freebsd.org> Date: Mon, 16 Jan 2017 19:57:50 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <2C5D1730-6F2F-4D57-B977-420B0CFA81B1@gmail.com> References: <201701170352.v0H3qvNJ025187@repo.freebsd.org> To: Gleb Smirnoff 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: Tue, 17 Jan 2017 03:57:52 -0000 --Apple-Mail=_91EC0E32-A2C3-46FD-9560-48973F51C376 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 16, 2017, at 19:52, Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Tue Jan 17 03:52:57 2017 > New Revision: 312331 > URL: https://svnweb.freebsd.org/changeset/base/312331 >=20 > Log: > Fix regression from r310655, which broke operation of bsnmpd if it is = bound > to a non-wildcard address. As documented in ip(4), doing sendmsg(2) = with > IP_SENDSRCADDR on a socket that is bound to non-wildcard address is > completely different to using this control message on a wildcard one. >=20 > A fix is to add a bool to mark whether we did = setsockopt(IP_RECVDSTADDR) > on the socket, and use IP_SENDSRCADDR control message only if we did. >=20 > While here, garbage collect absolutely useless udp_recv() function = that > establishes some structures on stack to never use them later. I wasn=E2=80=99t aware of that =E2=80=94 thank you for fixing my = mistake (and I=E2=80=99ll add you to the next set of CRs here). udp_recv(..) was meant to provide a layer for doing the = necessary bits for IPv6.. I guess I=E2=80=99ll have to adjust (and hope = that the team doing it internally =E2=80=9Cgets it right=E2=80=9D). Cheers, -Ngie --Apple-Mail=_91EC0E32-A2C3-46FD-9560-48973F51C376 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 iQIcBAEBCgAGBQJYfZY+AAoJEPWDqSZpMIYVjSoQALZ4adbErShz4VYpa0wjF61Q krmDlBndAAKp3n6bfTCqfh+Yw+nhXhjjLffe40igpgr1y+EMfJktstkreNiGreXV ZO3G55b0iP7MpsQHfgTFDRKzuRP0yfkqin8w/5N4KMVxpZ7oPjC6DGKDfbFxTmc3 I1CftNo1SW9szQFgYw6ScPY+eZ8ECnrwUOnPUdC/IBH50N01amQeS44n1ZPGa2Ds ZpHC2R0XDGEtTQblmmOuFDVG/fKfCAyk5rrZVcv6d7J7ADivYgnYU/NnT6Low7l8 c2+J3TaBC7OuLOwPdJFGRYR6urWWLMDiMTEXFVoIRbotljqA8tPHsqbEB6mUt1AT GFhwQ10Nzf5y6635LX1P18wuKyFmiN/fdvWakKosvbM4k+DXxJJvjP4FhrOpgO/h +7UQ/MJiYcgK6MMAjM/KCyKlU4bZJz8O+3r0sPfZiC2VpQQvFH5FYUeSxTzHU7gf AZN7Tz6DjjNjHKDXgkWdz9bZZ9LsG61E7IuiEn6dI+oLoDBJi8SJz+rXuiNfshHm JUVzgpYmfZZh5HX5McW13PlPwlni9jKBebmPqpGYQOMaEskBFxaccT95vsam/QDi mQ850BvORbAK1jTSYnaJXtP9CdFODBgWS9OiNyYxPc4ZTDbLajfvjXISe4VjIZ9d ZT1c9EjvAl+2alk7k2a+ =cAcQ -----END PGP SIGNATURE----- --Apple-Mail=_91EC0E32-A2C3-46FD-9560-48973F51C376-- From owner-svn-src-all@freebsd.org Tue Jan 17 03:58:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A6B8CB3181; Tue, 17 Jan 2017 03:58:38 +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 29D6A15CE; Tue, 17 Jan 2017 03:58:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0H3wbiI025471; Tue, 17 Jan 2017 03:58:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H3wb12025470; Tue, 17 Jan 2017 03:58:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701170358.v0H3wb12025470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 03:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312332 - head/lib/libc/regex/grot 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, 17 Jan 2017 03:58:38 -0000 Author: ngie Date: Tue Jan 17 03:58:37 2017 New Revision: 312332 URL: https://svnweb.freebsd.org/changeset/base/312332 Log: Use SRCTOP where possible and use :H to manipulate .CURDIR to get rid of unnecessarily long relative path .PATH values with make MFC after: 1 days Sponsored by: Dell EMC Isilon Modified: head/lib/libc/regex/grot/Makefile Modified: head/lib/libc/regex/grot/Makefile ============================================================================== --- head/lib/libc/regex/grot/Makefile Tue Jan 17 03:52:57 2017 (r312331) +++ head/lib/libc/regex/grot/Makefile Tue Jan 17 03:58:37 2017 (r312332) @@ -5,7 +5,7 @@ # Do not take -DPOSIX_MISTAKE out. REGCFLAGS isn't important to you (it's # for my use in some special contexts). -PATHS= ${.CURDIR}/.. ${.CURDIR}/../../locale ${.CURDIR}/../../../../include +PATHS= ${.CURDIR:H} ${.CURDIR:H:H}/locale ${SRCTOP}/include .PATH: ${PATHS} CFLAGS+= -static -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) From owner-svn-src-all@freebsd.org Tue Jan 17 04:00:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6AB9CB329A; Tue, 17 Jan 2017 04:00:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CB921179A; Tue, 17 Jan 2017 04:00:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v0H409mH044827 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Jan 2017 20:00:09 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v0H409XA044826; Mon, 16 Jan 2017 20:00:09 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 16 Jan 2017 20:00:09 -0800 From: Gleb Smirnoff To: ngie@FreeBSD.org, Thor Steingrimsson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312331 - head/contrib/bsnmp/snmpd Message-ID: <20170117040009.GT2611@FreeBSD.org> References: <201701170352.v0H3qvNJ025187@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701170352.v0H3qvNJ025187@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jan 2017 04:00:17 -0000 Hi, Ngie! Please notice this regression when doing MFCs. Notice, that I'm fixing this problem for a second time. See r240734. Please add this to a regression suite. Also, there is another regression in r310586, which actually isn't your fault. Before r310586 in snmpd_input() there was stack variable struct msghdr msg, which wasn't properly initialized. However, before r310586 stack usage of descendants of snmpd_input() have hidden the problem. After r310586, sendmsg() would fail since msg will have garbage in msg.msg_control and msg.msg_controllen. Basicly, between r310586 and r310655 doesn't work at all. And with r310655 it is working again on 0.0.0.0 and doesn't work on any specific address. So, if you plan to do MFC r310586 separately from further revisions, you need to add 2 lines to snmpd_input() with this MFC: Index: main.c =================================================================== --- main.c (revision 310586) +++ main.c (working copy) @@ -1192,6 +1192,8 @@ snmpd_input(struct port_input *pi, struct tport *t msg.msg_iov = iov; msg.msg_iovlen = 1; msg.msg_flags = 0; + msg.msg_control = NULL; + msg.msg_controllen = 0; iov[0].iov_base = sndbuf; iov[0].iov_len = sndlen; On Tue, Jan 17, 2017 at 03:52:57AM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Tue Jan 17 03:52:57 2017 T> New Revision: 312331 T> URL: https://svnweb.freebsd.org/changeset/base/312331 T> T> Log: T> Fix regression from r310655, which broke operation of bsnmpd if it is bound T> to a non-wildcard address. As documented in ip(4), doing sendmsg(2) with T> IP_SENDSRCADDR on a socket that is bound to non-wildcard address is T> completely different to using this control message on a wildcard one. T> T> A fix is to add a bool to mark whether we did setsockopt(IP_RECVDSTADDR) T> on the socket, and use IP_SENDSRCADDR control message only if we did. T> T> While here, garbage collect absolutely useless udp_recv() function that T> establishes some structures on stack to never use them later. T> T> Modified: T> head/contrib/bsnmp/snmpd/trans_udp.c T> head/contrib/bsnmp/snmpd/trans_udp.h T> T> Modified: head/contrib/bsnmp/snmpd/trans_udp.c T> ============================================================================== T> --- head/contrib/bsnmp/snmpd/trans_udp.c Tue Jan 17 03:44:45 2017 (r312330) T> +++ head/contrib/bsnmp/snmpd/trans_udp.c Tue Jan 17 03:52:57 2017 (r312331) T> @@ -34,6 +34,7 @@ T> #include T> #include T> T> +#include T> #include T> #include T> #include T> @@ -119,13 +120,15 @@ udp_init_port(struct tport *tp) T> addr.sin_port = htons(p->port); T> addr.sin_family = AF_INET; T> addr.sin_len = sizeof(addr); T> - if (addr.sin_addr.s_addr == INADDR_ANY && T> - setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, T> - sizeof(on)) == -1) { T> - syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); T> - close(p->input.fd); T> - p->input.fd = -1; T> - return (SNMP_ERR_GENERR); T> + if (addr.sin_addr.s_addr == INADDR_ANY) { T> + if (setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, T> + sizeof(on)) == -1) { T> + syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); T> + close(p->input.fd); T> + p->input.fd = -1; T> + return (SNMP_ERR_GENERR); T> + } T> + p->recvdstaddr = true; T> } T> if (bind(p->input.fd, (struct sockaddr *)&addr, sizeof(addr))) { T> if (errno == EADDRNOTAVAIL) { T> @@ -218,7 +221,6 @@ udp_send(struct tport *tp, const u_char T> { T> struct udp_port *p = (struct udp_port *)tp; T> struct cmsghdr *cmsg; T> - struct in_addr *src_addr; T> struct msghdr msg; T> char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; T> struct iovec iov; T> @@ -231,15 +233,20 @@ udp_send(struct tport *tp, const u_char T> msg.msg_iovlen = 1; T> msg.msg_name = __DECONST(void *, addr); T> msg.msg_namelen = addrlen; T> - msg.msg_control = cbuf; T> - msg.msg_controllen = sizeof(cbuf); T> T> - cmsg = CMSG_FIRSTHDR(&msg); T> - cmsg->cmsg_level = IPPROTO_IP; T> - cmsg->cmsg_type = IP_SENDSRCADDR; T> - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); T> - src_addr = (struct in_addr *)(void*)CMSG_DATA(cmsg); T> - memcpy(src_addr, &p->recv_addr, sizeof(struct in_addr)); T> + if (p->recvdstaddr) { T> + msg.msg_control = cbuf; T> + msg.msg_controllen = sizeof(cbuf); T> + T> + cmsg = CMSG_FIRSTHDR(&msg); T> + cmsg->cmsg_level = IPPROTO_IP; T> + cmsg->cmsg_type = IP_SENDSRCADDR; T> + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); T> + memcpy(CMSG_DATA(cmsg), &p->dstaddr, sizeof(struct in_addr)); T> + } else { T> + msg.msg_control = NULL; T> + msg.msg_controllen = 0; T> + } T> T> return (sendmsg(p->input.fd, &msg, 0)); T> } T> @@ -260,11 +267,12 @@ check_priv_dgram(struct port_input *pi, T> * Each receive should return one datagram. T> */ T> static ssize_t T> -recv_dgram(struct port_input *pi, struct in_addr *laddr) T> +udp_recv(struct tport *tp, struct port_input *pi) T> { T> u_char embuf[1000]; T> char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + T> CMSG_SPACE(sizeof(struct in_addr))]; T> + struct udp_port *p = (struct udp_port *)tp; T> struct msghdr msg; T> struct iovec iov[1]; T> ssize_t len; T> @@ -316,7 +324,8 @@ recv_dgram(struct port_input *pi, struct T> cmsg = CMSG_NXTHDR(&msg, cmsg)) { T> if (cmsg->cmsg_level == IPPROTO_IP && T> cmsg->cmsg_type == IP_RECVDSTADDR) T> - memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); T> + memcpy(&p->dstaddr, CMSG_DATA(cmsg), T> + sizeof(struct in_addr)); T> if (cmsg->cmsg_level == SOL_SOCKET && T> cmsg->cmsg_type == SCM_CREDS) T> cred = (struct sockcred *)CMSG_DATA(cmsg); T> @@ -329,42 +338,6 @@ recv_dgram(struct port_input *pi, struct T> } T> T> /* T> - * Receive something T> - */ T> -static ssize_t T> -udp_recv(struct tport *tp, struct port_input *pi) T> -{ T> - struct udp_port *p = (struct udp_port *)tp; T> - struct cmsghdr *cmsgp; T> - struct in_addr *laddr; T> - struct msghdr msg; T> - char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; T> - ssize_t ret; T> - T> - memset(cbuf, 0, sizeof(cbuf)); T> - T> - msg.msg_control = cbuf; T> - msg.msg_controllen = sizeof(cbuf); T> - T> - cmsgp = CMSG_FIRSTHDR(&msg); T> - cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); T> - cmsgp->cmsg_level = IPPROTO_IP; T> - cmsgp->cmsg_type = IP_SENDSRCADDR; T> - laddr = (struct in_addr *)CMSG_DATA(cmsgp); T> - T> - ret = recv_dgram(pi, laddr); T> - T> - memcpy(&p->recv_addr, laddr, sizeof(struct in_addr)); T> - T> - if (laddr->s_addr == INADDR_ANY) { T> - msg.msg_control = NULL; T> - msg.msg_controllen = 0; T> - } T> - T> - return (ret); T> -} T> - T> -/* T> * Port table T> */ T> int T> T> Modified: head/contrib/bsnmp/snmpd/trans_udp.h T> ============================================================================== T> --- head/contrib/bsnmp/snmpd/trans_udp.h Tue Jan 17 03:44:45 2017 (r312330) T> +++ head/contrib/bsnmp/snmpd/trans_udp.h Tue Jan 17 03:52:57 2017 (r312331) T> @@ -39,7 +39,9 @@ struct udp_port { T> struct port_input input; /* common input stuff */ T> T> struct sockaddr_in ret; /* the return address */ T> - struct in_addr recv_addr; /* the address the request was sent to */ T> + T> + bool recvdstaddr; /* IP_RECVDSTADDR is on */ T> + struct in_addr dstaddr; /* address the request was sent to */ T> }; T> T> /* argument for open call */ T> _______________________________________________ T> svn-src-all@freebsd.org mailing list T> https://lists.freebsd.org/mailman/listinfo/svn-src-all T> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Tue Jan 17 05:37:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D80ABCB3FCE; Tue, 17 Jan 2017 05:37:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C49601BE9; Tue, 17 Jan 2017 05:37:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v0H5bnGN045462 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Jan 2017 21:37:49 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v0H5bn4n045461; Mon, 16 Jan 2017 21:37:49 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 16 Jan 2017 21:37:49 -0800 From: Gleb Smirnoff To: Josh Paetzel Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r310847 - head/sys/netinet Message-ID: <20170117053749.GV2611@FreeBSD.org> References: <201612301846.uBUIkLu9035070@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201612301846.uBUIkLu9035070@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jan 2017 05:37:50 -0000 Josh, if you don't mind, here is some review inlined down below. On Fri, Dec 30, 2016 at 06:46:21PM +0000, Josh Paetzel wrote: J> Author: jpaetzel J> Date: Fri Dec 30 18:46:21 2016 J> New Revision: 310847 J> URL: https://svnweb.freebsd.org/changeset/base/310847 J> J> Log: J> Harden CARP against network loops. J> J> If there is a loop in the network a CARP that is in MASTER state will see it's J> own broadcasts, which will then cause it to assume BACKUP state. When it J> assumes BACKUP it will stop sending advertisements. In that state it will no J> longer see advertisements and will assume MASTER... J> J> We can't catch all the cases where we are seeing our own CARP broadcast, but J> we can catch the obvious case. J> J> Submitted by: torek J> Obtained from: FreeNAS J> MFC after: 2 weeks J> Sponsored by: iXsystems J> J> Modified: J> head/sys/netinet/ip_carp.c J> J> Modified: head/sys/netinet/ip_carp.c J> ============================================================================== J> --- head/sys/netinet/ip_carp.c Fri Dec 30 18:23:58 2016 (r310846) J> +++ head/sys/netinet/ip_carp.c Fri Dec 30 18:46:21 2016 (r310847) J> @@ -581,27 +581,90 @@ carp6_input(struct mbuf **mp, int *offp, J> } J> #endif /* INET6 */ J> J> +/* J> + * This routine should not be necessary at all, but some switches J> + * (VMWare ESX vswitches) can echo our own packets back at us, J> + * and we must ignore them or they will cause us to drop out of J> + * MASTER mode. J> + * J> + * We cannot catch all cases of network loops. Instead, what we J> + * do here is catch any packet that arrives with a carp header J> + * with a VHID of 0, that comes from an address that is our own. J> + * These packets are by definition "from us" (even if they are from J> + * a misconfigured host that is pretending to be us). I failed to find in the patch a place where we generate packets with VHID 0, we only check for them. Can you please explain how this loop detection works? J> + * The VHID test is outside this mini-function. J> + */ J> +static int J> +carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af) J> +{ J> + struct ip *ip4; J> + struct in_addr in4; J> + struct ip6_hdr *ip6; J> + struct in6_addr in6; J> + J> + switch (af) { J> + case AF_INET: J> + ip4 = mtod(m, struct ip *); J> + in4 = ifatoia(ifa)->ia_addr.sin_addr; J> + return (in4.s_addr == ip4->ip_src.s_addr); J> + J> + case AF_INET6: J> + ip6 = mtod(m, struct ip6_hdr *); J> + in6 = ifatoia6(ifa)->ia_addr.sin6_addr; J> + return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0); J> + J> + default: /* how did this happen? */ J> + break; This must be panic(). J> + } J> + return (0); J> +} J> + J> static void J> carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) J> { J> struct ifnet *ifp = m->m_pkthdr.rcvif; J> - struct ifaddr *ifa; J> + struct ifaddr *ifa, *match; J> struct carp_softc *sc; J> uint64_t tmp_counter; J> struct timeval sc_tv, ch_tv; J> + int error; J> J> - /* verify that the VHID is valid on the receiving interface */ J> + /* J> + * Verify that the VHID is valid on the receiving interface. J> + * J> + * There should be just one match. If there are none J> + * the VHID is not valid and we drop the packet. If J> + * there are multiple VHID matches, take just the first J> + * one, for compatibility with previous code. While we're J> + * scanning, check for obvious loops in the network topology J> + * (these should never happen, and as noted above, we may J> + * miss real loops; this is just a double-check). J> + */ J> IF_ADDR_RLOCK(ifp); J> - IFNET_FOREACH_IFA(ifp, ifa) J> - if (ifa->ifa_addr->sa_family == af && J> - ifa->ifa_carp->sc_vhid == ch->carp_vhid) { J> - ifa_ref(ifa); J> - break; J> - } J> + error = 0; J> + match = NULL; J> + IFNET_FOREACH_IFA(ifp, ifa) { J> + if (match == NULL && ifa->ifa_carp != NULL && J> + ifa->ifa_addr->sa_family == af && J> + ifa->ifa_carp->sc_vhid == ch->carp_vhid) J> + match = ifa; J> + if (ch->carp_vhid == 0 && carp_source_is_self(m, ifa, af)) J> + error = ELOOP; J> + } J> + ifa = error ? NULL : match; J> + if (ifa != NULL) J> + ifa_ref(ifa); J> IF_ADDR_RUNLOCK(ifp); J> J> if (ifa == NULL) { J> - CARPSTATS_INC(carps_badvhid); J> + if (error == ELOOP) { J> + CARP_DEBUG("dropping looped packet on interface %s\n", J> + ifp->if_xname); J> + CARPSTATS_INC(carps_badif); /* ??? */ J> + } else { J> + CARPSTATS_INC(carps_badvhid); J> + } J> m_freem(m); J> return; J> } J> @@ -787,12 +850,41 @@ carp_send_ad_error(struct carp_softc *sc J> } J> } J> J> +/* J> + * Pick the best ifaddr on the given ifp for sending CARP J> + * advertisements. J> + * J> + * "Best" here is defined by ifa_preferred(). This function is much J> + * much like ifaof_ifpforaddr() except that we just use ifa_preferred(). J> + * J> + * (This could be simplified to return the actual address, except that J> + * it has a different format in AF_INET and AF_INET6.) J> + */ J> +static struct ifaddr * J> +carp_best_ifa(int af, struct ifnet *ifp) J> +{ J> + struct ifaddr *ifa, *best; J> + J> + if (af >= AF_MAX) J> + return (NULL); This must be: KASSERT(af == AF_INET || af == AF_INET6, (... J> + best = NULL; J> + IF_ADDR_RLOCK(ifp); J> + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { J> + if (ifa->ifa_addr->sa_family == af && J> + (best == NULL || ifa_preferred(best, ifa))) J> + best = ifa; J> + } J> + IF_ADDR_RUNLOCK(ifp); J> + if (best != NULL) J> + ifa_ref(best); ifa_ref() should happen inside IF_ADDR_RLOCK(). J> + return (best); J> +} J> + J> static void J> carp_send_ad_locked(struct carp_softc *sc) J> { J> struct carp_header ch; J> struct timeval tv; J> - struct sockaddr sa; J> struct ifaddr *ifa; J> struct carp_header *ch_ptr; J> struct mbuf *m; J> @@ -841,9 +933,7 @@ carp_send_ad_locked(struct carp_softc *s J> ip->ip_sum = 0; J> ip_fillid(ip); J> J> - bzero(&sa, sizeof(sa)); J> - sa.sa_family = AF_INET; J> - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); J> + ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); J> if (ifa != NULL) { J> ip->ip_src.s_addr = J> ifatoia(ifa)->ia_addr.sin_addr.s_addr; J> @@ -887,11 +977,9 @@ carp_send_ad_locked(struct carp_softc *s J> ip6->ip6_vfc |= IPV6_VERSION; J> ip6->ip6_hlim = CARP_DFLTTL; J> ip6->ip6_nxt = IPPROTO_CARP; J> - bzero(&sa, sizeof(sa)); J> J> /* set the source address */ J> - sa.sa_family = AF_INET6; J> - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); J> + ifa = carp_best_ifa(AF_INET6, sc->sc_carpdev); J> if (ifa != NULL) { J> bcopy(IFA_IN6(ifa), &ip6->ip6_src, J> sizeof(struct in6_addr)); J> _______________________________________________ J> svn-src-all@freebsd.org mailing list J> https://lists.freebsd.org/mailman/listinfo/svn-src-all J> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Tue Jan 17 05:47:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9223CCB42C8; Tue, 17 Jan 2017 05:47: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 33B9510BD; Tue, 17 Jan 2017 05:47: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 v0H5l9jW069245; Tue, 17 Jan 2017 05:47:09 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H5l6sJ069212; Tue, 17 Jan 2017 05:47:06 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701170547.v0H5l6sJ069212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 17 Jan 2017 05:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312333 - in vendor/zlib/dist: . contrib/delphi contrib/dotzlib/DotZLib contrib/infback9 contrib/minizip contrib/pascal contrib/vstudio contrib/vstudio/vc10 contrib/vstudio/vc11 contrib... 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, 17 Jan 2017 05:47:10 -0000 Author: delphij Date: Tue Jan 17 05:47:05 2017 New Revision: 312333 URL: https://svnweb.freebsd.org/changeset/base/312333 Log: Vendor import of zlib 1.2.11. Deleted: vendor/zlib/dist/contrib/vstudio/vc14/miniunz.vcxproj.user vendor/zlib/dist/contrib/vstudio/vc14/minizip.vcxproj.user vendor/zlib/dist/contrib/vstudio/vc14/testzlib.vcxproj.user vendor/zlib/dist/contrib/vstudio/vc14/testzlibdll.vcxproj.user vendor/zlib/dist/contrib/vstudio/vc14/zlibstat.vcxproj.user vendor/zlib/dist/contrib/vstudio/vc14/zlibvc.vcxproj.user Modified: vendor/zlib/dist/CMakeLists.txt vendor/zlib/dist/ChangeLog vendor/zlib/dist/Makefile.in vendor/zlib/dist/README vendor/zlib/dist/contrib/delphi/ZLib.pas vendor/zlib/dist/contrib/dotzlib/DotZLib/UnitTests.cs vendor/zlib/dist/contrib/infback9/inftree9.c vendor/zlib/dist/contrib/minizip/configure.ac vendor/zlib/dist/contrib/pascal/zlibpas.pas vendor/zlib/dist/contrib/vstudio/readme.txt vendor/zlib/dist/contrib/vstudio/vc10/zlib.rc vendor/zlib/dist/contrib/vstudio/vc11/zlib.rc vendor/zlib/dist/contrib/vstudio/vc12/zlib.rc vendor/zlib/dist/contrib/vstudio/vc14/zlib.rc vendor/zlib/dist/contrib/vstudio/vc9/zlib.rc vendor/zlib/dist/deflate.c vendor/zlib/dist/gzlib.c vendor/zlib/dist/gzwrite.c vendor/zlib/dist/inffast.c vendor/zlib/dist/inftrees.c vendor/zlib/dist/os400/README400 vendor/zlib/dist/os400/make.sh vendor/zlib/dist/os400/zlib.inc vendor/zlib/dist/qnx/package.qpg vendor/zlib/dist/treebuild.xml vendor/zlib/dist/trees.c vendor/zlib/dist/win32/Makefile.msc vendor/zlib/dist/win32/README-WIN32.txt vendor/zlib/dist/win32/VisualC.txt vendor/zlib/dist/win32/zlib1.rc vendor/zlib/dist/zlib.3 vendor/zlib/dist/zlib.3.pdf vendor/zlib/dist/zlib.h vendor/zlib/dist/zutil.c Modified: vendor/zlib/dist/CMakeLists.txt ============================================================================== --- vendor/zlib/dist/CMakeLists.txt Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/CMakeLists.txt Tue Jan 17 05:47:05 2017 (r312333) @@ -3,7 +3,7 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON project(zlib C) -set(VERSION "1.2.10") +set(VERSION "1.2.11") option(ASM686 "Enable building i686 assembly implementation") option(AMD64 "Enable building amd64 assembly implementation") Modified: vendor/zlib/dist/ChangeLog ============================================================================== --- vendor/zlib/dist/ChangeLog Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/ChangeLog Tue Jan 17 05:47:05 2017 (r312333) @@ -1,6 +1,10 @@ ChangeLog file for zlib +Changes in 1.2.11 (15 Jan 2017) +- Fix deflate stored bug when pulling last block from window +- Permit immediate deflateParams changes before any deflate input + Changes in 1.2.10 (2 Jan 2017) - Avoid warnings on snprintf() return value - Fix bug in deflate_stored() for zero-length input Modified: vendor/zlib/dist/Makefile.in ============================================================================== --- vendor/zlib/dist/Makefile.in Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/Makefile.in Tue Jan 17 05:47:05 2017 (r312333) @@ -1,5 +1,5 @@ # Makefile for zlib -# Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler +# Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler # For conditions of distribution and use, see copyright notice in zlib.h # To compile and test, type: @@ -32,7 +32,7 @@ CPP=$(CC) -E STATICLIB=libz.a SHAREDLIB=libz.so -SHAREDLIBV=libz.so.1.2.10 +SHAREDLIBV=libz.so.1.2.11 SHAREDLIBM=libz.so.1 LIBS=$(STATICLIB) $(SHAREDLIBV) Modified: vendor/zlib/dist/README ============================================================================== --- vendor/zlib/dist/README Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/README Tue Jan 17 05:47:05 2017 (r312333) @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.10 is a general purpose data compression library. All the code is +zlib 1.2.11 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ Mark Nelson wrote an ar issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.10 are documented in the file ChangeLog. +The changes made in version 1.2.11 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . Modified: vendor/zlib/dist/contrib/delphi/ZLib.pas ============================================================================== --- vendor/zlib/dist/contrib/delphi/ZLib.pas Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/contrib/delphi/ZLib.pas Tue Jan 17 05:47:05 2017 (r312333) @@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBu const OutBuf: Pointer; BufSize: Integer); const - zlib_version = '1.2.10'; + zlib_version = '1.2.11'; type EZlibError = class(Exception); Modified: vendor/zlib/dist/contrib/dotzlib/DotZLib/UnitTests.cs ============================================================================== --- vendor/zlib/dist/contrib/dotzlib/DotZLib/UnitTests.cs Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/contrib/dotzlib/DotZLib/UnitTests.cs Tue Jan 17 05:47:05 2017 (r312333) @@ -156,7 +156,7 @@ namespace DotZLibTests public void Info_Version() { Info info = new Info(); - Assert.AreEqual("1.2.10", Info.Version); + Assert.AreEqual("1.2.11", Info.Version); Assert.AreEqual(32, info.SizeOfUInt); Assert.AreEqual(32, info.SizeOfULong); Assert.AreEqual(32, info.SizeOfPointer); Modified: vendor/zlib/dist/contrib/infback9/inftree9.c ============================================================================== --- vendor/zlib/dist/contrib/infback9/inftree9.c Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/contrib/infback9/inftree9.c Tue Jan 17 05:47:05 2017 (r312333) @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate9_copyright[] = - " inflate9 1.2.10 Copyright 1995-2017 Mark Adler "; + " inflate9 1.2.11 Copyright 1995-2017 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -64,7 +64,7 @@ unsigned short FAR *work; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, - 133, 133, 133, 133, 144, 192, 202}; + 133, 133, 133, 133, 144, 77, 202}; static const unsigned short dbase[32] = { /* Distance codes 0..31 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, Modified: vendor/zlib/dist/contrib/minizip/configure.ac ============================================================================== --- vendor/zlib/dist/contrib/minizip/configure.ac Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/contrib/minizip/configure.ac Tue Jan 17 05:47:05 2017 (r312333) @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_INIT([minizip], [1.2.10], [bugzilla.redhat.com]) +AC_INIT([minizip], [1.2.11], [bugzilla.redhat.com]) AC_CONFIG_SRCDIR([minizip.c]) AM_INIT_AUTOMAKE([foreign]) LT_INIT Modified: vendor/zlib/dist/contrib/pascal/zlibpas.pas ============================================================================== --- vendor/zlib/dist/contrib/pascal/zlibpas.pas Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/contrib/pascal/zlibpas.pas Tue Jan 17 05:47:05 2017 (r312333) @@ -10,7 +10,7 @@ unit zlibpas; interface const - ZLIB_VERSION = '1.2.10'; + ZLIB_VERSION = '1.2.11'; ZLIB_VERNUM = $12a0; type Modified: vendor/zlib/dist/contrib/vstudio/readme.txt ============================================================================== --- vendor/zlib/dist/contrib/vstudio/readme.txt Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/contrib/vstudio/readme.txt Tue Jan 17 05:47:05 2017 (r312333) @@ -1,4 +1,4 @@ -Building instructions for the DLL versions of Zlib 1.2.10 +Building instructions for the DLL versions of Zlib 1.2.11 ======================================================== This directory contains projects that build zlib and minizip using Modified: vendor/zlib/dist/contrib/vstudio/vc10/zlib.rc ============================================================================== --- vendor/zlib/dist/contrib/vstudio/vc10/zlib.rc Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/contrib/vstudio/vc10/zlib.rc Tue Jan 17 05:47:05 2017 (r312333) @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 10, 0 - PRODUCTVERSION 1, 2, 10, 0 + FILEVERSION 1, 2, 11, 0 + PRODUCTVERSION 1, 2, 11, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.10\0" + VALUE "FileVersion", "1.2.11\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" Modified: vendor/zlib/dist/contrib/vstudio/vc11/zlib.rc ============================================================================== --- vendor/zlib/dist/contrib/vstudio/vc11/zlib.rc Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/contrib/vstudio/vc11/zlib.rc Tue Jan 17 05:47:05 2017 (r312333) @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 10, 0 - PRODUCTVERSION 1, 2, 10, 0 + FILEVERSION 1, 2, 11, 0 + PRODUCTVERSION 1, 2, 11, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.10\0" + VALUE "FileVersion", "1.2.11\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" Modified: vendor/zlib/dist/contrib/vstudio/vc12/zlib.rc ============================================================================== --- vendor/zlib/dist/contrib/vstudio/vc12/zlib.rc Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/contrib/vstudio/vc12/zlib.rc Tue Jan 17 05:47:05 2017 (r312333) @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 10, 0 - PRODUCTVERSION 1, 2, 10, 0 + FILEVERSION 1, 2, 11, 0 + PRODUCTVERSION 1, 2, 11, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.10\0" + VALUE "FileVersion", "1.2.11\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" Modified: vendor/zlib/dist/contrib/vstudio/vc14/zlib.rc ============================================================================== --- vendor/zlib/dist/contrib/vstudio/vc14/zlib.rc Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/contrib/vstudio/vc14/zlib.rc Tue Jan 17 05:47:05 2017 (r312333) @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 10, 0 - PRODUCTVERSION 1, 2, 10, 0 + FILEVERSION 1, 2, 11, 0 + PRODUCTVERSION 1, 2, 11, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.10\0" + VALUE "FileVersion", "1.2.11\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" Modified: vendor/zlib/dist/contrib/vstudio/vc9/zlib.rc ============================================================================== --- vendor/zlib/dist/contrib/vstudio/vc9/zlib.rc Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/contrib/vstudio/vc9/zlib.rc Tue Jan 17 05:47:05 2017 (r312333) @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1, 2, 10, 0 - PRODUCTVERSION 1, 2, 10, 0 + FILEVERSION 1, 2, 11, 0 + PRODUCTVERSION 1, 2, 11, 0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.10\0" + VALUE "FileVersion", "1.2.11\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlibwapi.dll\0" VALUE "ProductName", "ZLib.DLL\0" Modified: vendor/zlib/dist/deflate.c ============================================================================== --- vendor/zlib/dist/deflate.c Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/deflate.c Tue Jan 17 05:47:05 2017 (r312333) @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.10 Copyright 1995-2017 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -586,7 +586,8 @@ int ZEXPORT deflateParams(strm, level, s } func = configuration_table[s->level].func; - if ((strategy != s->strategy || func != configuration_table[level].func)) { + if ((strategy != s->strategy || func != configuration_table[level].func) && + s->high_water) { /* Flush the last buffer: */ int err = deflate(strm, Z_BLOCK); if (err == Z_STREAM_ERROR) @@ -1671,8 +1672,6 @@ local block_state deflate_stored(s, flus len = left + s->strm->avail_in; /* limit len to the input */ if (len > have) len = have; /* limit len to the output */ - if (left > len) - left = len; /* limit window pull to len */ /* If the stored block would be less than min_block in length, or if * unable to copy all of the available input when flushing, then try @@ -1681,13 +1680,13 @@ local block_state deflate_stored(s, flus */ if (len < min_block && ((len == 0 && flush != Z_FINISH) || flush == Z_NO_FLUSH || - len - left != s->strm->avail_in)) + len != left + s->strm->avail_in)) break; /* Make a dummy stored block in pending to get the header bytes, * including any pending bits. This also updates the debugging counts. */ - last = flush == Z_FINISH && len - left == s->strm->avail_in ? 1 : 0; + last = flush == Z_FINISH && len == left + s->strm->avail_in ? 1 : 0; _tr_stored_block(s, (char *)0, 0L, last); /* Replace the lengths in the dummy stored block with len. */ @@ -1699,14 +1698,16 @@ local block_state deflate_stored(s, flus /* Write the stored block header bytes. */ flush_pending(s->strm); - /* Update debugging counts for the data about to be copied. */ #ifdef ZLIB_DEBUG + /* Update debugging counts for the data about to be copied. */ s->compressed_len += len << 3; s->bits_sent += len << 3; #endif /* Copy uncompressed bytes from the window to next_out. */ if (left) { + if (left > len) + left = len; zmemcpy(s->strm->next_out, s->window + s->block_start, left); s->strm->next_out += left; s->strm->avail_out -= left; @@ -1756,6 +1757,8 @@ local block_state deflate_stored(s, flus s->block_start = s->strstart; s->insert += MIN(used, s->w_size - s->insert); } + if (s->high_water < s->strstart) + s->high_water = s->strstart; /* If the last block was written to next_out, then done. */ if (last) @@ -1783,6 +1786,8 @@ local block_state deflate_stored(s, flus read_buf(s->strm, s->window + s->strstart, have); s->strstart += have; } + if (s->high_water < s->strstart) + s->high_water = s->strstart; /* There was not enough avail_out to write a complete worthy or flushed * stored block to next_out. Write a stored block to pending instead, if we Modified: vendor/zlib/dist/gzlib.c ============================================================================== --- vendor/zlib/dist/gzlib.c Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/gzlib.c Tue Jan 17 05:47:05 2017 (r312333) @@ -1,5 +1,5 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004, 2010, 2011, 2012, 2013, 2016 Mark Adler + * Copyright (C) 2004-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ Modified: vendor/zlib/dist/gzwrite.c ============================================================================== --- vendor/zlib/dist/gzwrite.c Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/gzwrite.c Tue Jan 17 05:47:05 2017 (r312333) @@ -1,5 +1,5 @@ /* gzwrite.c -- zlib functions for writing gzip files - * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler + * Copyright (C) 2004-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ Modified: vendor/zlib/dist/inffast.c ============================================================================== --- vendor/zlib/dist/inffast.c Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/inffast.c Tue Jan 17 05:47:05 2017 (r312333) @@ -1,5 +1,5 @@ /* inffast.c -- fast decoding - * Copyright (C) 1995-2008, 2010, 2013, 2016 Mark Adler + * Copyright (C) 1995-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ Modified: vendor/zlib/dist/inftrees.c ============================================================================== --- vendor/zlib/dist/inftrees.c Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/inftrees.c Tue Jan 17 05:47:05 2017 (r312333) @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.10 Copyright 1995-2017 Mark Adler "; + " inflate 1.2.11 Copyright 1995-2017 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -62,7 +62,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 192, 202}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 77, 202}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, Modified: vendor/zlib/dist/os400/README400 ============================================================================== --- vendor/zlib/dist/os400/README400 Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/os400/README400 Tue Jan 17 05:47:05 2017 (r312333) @@ -1,4 +1,4 @@ - ZLIB version 1.2.10 for OS/400 installation instructions + ZLIB version 1.2.11 for OS/400 installation instructions 1) Download and unpack the zlib tarball to some IFS directory. (i.e.: /path/to/the/zlib/ifs/source/directory) Modified: vendor/zlib/dist/os400/make.sh ============================================================================== --- vendor/zlib/dist/os400/make.sh Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/os400/make.sh Tue Jan 17 05:47:05 2017 (r312333) @@ -260,7 +260,7 @@ fi echo '#pragma comment(user, "ZLIB version '"${VERSION}"'")' > os400.c echo '#pragma comment(user, __DATE__)' >> os400.c echo '#pragma comment(user, __TIME__)' >> os400.c -echo '#pragma comment(copyright, "Copyright (C) 1995-2016 Jean-Loup Gailly, Mark Adler. OS/400 version by P. Monnerat.")' >> os400.c +echo '#pragma comment(copyright, "Copyright (C) 1995-2017 Jean-Loup Gailly, Mark Adler. OS/400 version by P. Monnerat.")' >> os400.c make_module OS400 os400.c LINK= # No need to rebuild service program yet. MODULES= Modified: vendor/zlib/dist/os400/zlib.inc ============================================================================== --- vendor/zlib/dist/os400/zlib.inc Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/os400/zlib.inc Tue Jan 17 05:47:05 2017 (r312333) @@ -1,7 +1,7 @@ * ZLIB.INC - Interface to the general purpose compression library * * ILE RPG400 version by Patrick Monnerat, DATASPHERE. - * Version 1.2.10 + * Version 1.2.11 * * * WARNING: @@ -22,12 +22,12 @@ * * Versioning information. * - D ZLIB_VERSION C '1.2.10' + D ZLIB_VERSION C '1.2.11' D ZLIB_VERNUM C X'12a0' D ZLIB_VER_MAJOR C 1 D ZLIB_VER_MINOR C 2 D ZLIB_VER_REVISION... - D C 10 + D C 11 D ZLIB_VER_SUBREVISION... D C 0 * Modified: vendor/zlib/dist/qnx/package.qpg ============================================================================== --- vendor/zlib/dist/qnx/package.qpg Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/qnx/package.qpg Tue Jan 17 05:47:05 2017 (r312333) @@ -25,10 +25,10 @@ - - - - + + + + @@ -63,7 +63,7 @@ - 1.2.10 + 1.2.11 Medium Stable Modified: vendor/zlib/dist/treebuild.xml ============================================================================== --- vendor/zlib/dist/treebuild.xml Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/treebuild.xml Tue Jan 17 05:47:05 2017 (r312333) @@ -1,6 +1,6 @@ - - + + zip compression library Modified: vendor/zlib/dist/trees.c ============================================================================== --- vendor/zlib/dist/trees.c Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/trees.c Tue Jan 17 05:47:05 2017 (r312333) @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2016 Jean-loup Gailly + * Copyright (C) 1995-2017 Jean-loup Gailly * detect_data_type() function provided freely by Cosmin Truta, 2006 * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -906,7 +906,7 @@ void ZLIB_INTERNAL _tr_align(s) /* =========================================================================== * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. + * trees or store, and write out the encoded block. */ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) deflate_state *s; Modified: vendor/zlib/dist/win32/Makefile.msc ============================================================================== --- vendor/zlib/dist/win32/Makefile.msc Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/win32/Makefile.msc Tue Jan 17 05:47:05 2017 (r312333) @@ -1,5 +1,5 @@ # Makefile for zlib using Microsoft (Visual) C -# zlib is copyright (C) 1995-2006 Jean-loup Gailly and Mark Adler +# zlib is copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler # # Usage: # nmake -f win32/Makefile.msc (standard build) Modified: vendor/zlib/dist/win32/README-WIN32.txt ============================================================================== --- vendor/zlib/dist/win32/README-WIN32.txt Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/win32/README-WIN32.txt Tue Jan 17 05:47:05 2017 (r312333) @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.10 is a general purpose data compression library. All the code is +zlib 1.2.11 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) @@ -22,7 +22,7 @@ before asking for help. Manifest: -The package zlib-1.2.10-win32-x86.zip will contain the following files: +The package zlib-1.2.11-win32-x86.zip will contain the following files: README-WIN32.txt This document ChangeLog Changes since previous zlib packages @@ -72,7 +72,7 @@ are too numerous to cite here. Copyright notice: - (C) 1995-2012 Jean-loup Gailly and Mark Adler + (C) 1995-2017 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages Modified: vendor/zlib/dist/win32/VisualC.txt ============================================================================== --- vendor/zlib/dist/win32/VisualC.txt Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/win32/VisualC.txt Tue Jan 17 05:47:05 2017 (r312333) @@ -1,3 +1,3 @@ To build zlib using the Microsoft Visual C++ environment, -use the appropriate project from the projects/ directory. +use the appropriate project from the contrib/vstudio/ directory. Modified: vendor/zlib/dist/win32/zlib1.rc ============================================================================== --- vendor/zlib/dist/win32/zlib1.rc Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/win32/zlib1.rc Tue Jan 17 05:47:05 2017 (r312333) @@ -26,7 +26,7 @@ BEGIN VALUE "FileDescription", "zlib data compression library\0" VALUE "FileVersion", ZLIB_VERSION "\0" VALUE "InternalName", "zlib1.dll\0" - VALUE "LegalCopyright", "(C) 1995-2013 Jean-loup Gailly & Mark Adler\0" + VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0" VALUE "OriginalFilename", "zlib1.dll\0" VALUE "ProductName", "zlib\0" VALUE "ProductVersion", ZLIB_VERSION "\0" Modified: vendor/zlib/dist/zlib.3 ============================================================================== --- vendor/zlib/dist/zlib.3 Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/zlib.3 Tue Jan 17 05:47:05 2017 (r312333) @@ -1,4 +1,4 @@ -.TH ZLIB 3 "2 Jan 2017" +.TH ZLIB 3 "15 Jan 2017" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -105,7 +105,7 @@ before asking for help. Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS AND LICENSE -Version 1.2.10 +Version 1.2.11 .LP Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler .LP Modified: vendor/zlib/dist/zlib.3.pdf ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/zlib/dist/zlib.h ============================================================================== --- vendor/zlib/dist/zlib.h Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/zlib.h Tue Jan 17 05:47:05 2017 (r312333) @@ -1,5 +1,5 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.10, January 2nd, 2017 + version 1.2.11, January 15th, 2017 Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.10" -#define ZLIB_VERNUM 0x12a0 +#define ZLIB_VERSION "1.2.11" +#define ZLIB_VERNUM 0x12b0 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 10 +#define ZLIB_VER_REVISION 11 #define ZLIB_VER_SUBREVISION 0 /* @@ -712,10 +712,11 @@ ZEXTERN int ZEXPORT deflateParams OF((z_ used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression approach (which is a function of the level) or the - strategy is changed, then the input available so far is compressed with the - old level and strategy using deflate(strm, Z_BLOCK). There are three - approaches for the compression levels 0, 1..3, and 4..9 respectively. The - new level and strategy will take effect at the next call of deflate(). + strategy is changed, and if any input has been consumed in a previous + deflate() call, then the input available so far is compressed with the old + level and strategy using deflate(strm, Z_BLOCK). There are three approaches + for the compression levels 0, 1..3, and 4..9 respectively. The new level + and strategy will take effect at the next call of deflate(). If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does not have enough output space to complete, then the parameter change will not Modified: vendor/zlib/dist/zutil.c ============================================================================== --- vendor/zlib/dist/zutil.c Tue Jan 17 03:58:37 2017 (r312332) +++ vendor/zlib/dist/zutil.c Tue Jan 17 05:47:05 2017 (r312333) @@ -1,5 +1,5 @@ /* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-2005, 2010, 2011, 2012, 2016 Jean-loup Gailly + * Copyright (C) 1995-2017 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ From owner-svn-src-all@freebsd.org Tue Jan 17 05:47:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F354CB432B; Tue, 17 Jan 2017 05:47:55 +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 263861225; Tue, 17 Jan 2017 05:47:55 +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 v0H5lsCR069319; Tue, 17 Jan 2017 05:47:54 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H5lsGw069318; Tue, 17 Jan 2017 05:47:54 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701170547.v0H5lsGw069318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 17 Jan 2017 05:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312334 - vendor/zlib/1.2.11 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, 17 Jan 2017 05:47:55 -0000 Author: delphij Date: Tue Jan 17 05:47:54 2017 New Revision: 312334 URL: https://svnweb.freebsd.org/changeset/base/312334 Log: Tag zlib 1.2.11. Added: vendor/zlib/1.2.11/ - copied from r312333, vendor/zlib/dist/ From owner-svn-src-all@freebsd.org Tue Jan 17 05:55:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48F3DCB45A7; Tue, 17 Jan 2017 05:55:50 +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 1B86916F7; Tue, 17 Jan 2017 05:55:50 +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 v0H5tnRa073373; Tue, 17 Jan 2017 05:55:49 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H5tmLv073362; Tue, 17 Jan 2017 05:55:48 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701170555.v0H5tmLv073362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 17 Jan 2017 05:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312335 - head/contrib/zlib 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, 17 Jan 2017 05:55:50 -0000 Author: delphij Date: Tue Jan 17 05:55:47 2017 New Revision: 312335 URL: https://svnweb.freebsd.org/changeset/base/312335 Log: MFV r312333: zlib 1.2.11. MFC after: 1 month Modified: head/contrib/zlib/ChangeLog head/contrib/zlib/README head/contrib/zlib/deflate.c head/contrib/zlib/gzlib.c head/contrib/zlib/gzwrite.c head/contrib/zlib/inffast.c head/contrib/zlib/inftrees.c head/contrib/zlib/trees.c head/contrib/zlib/zlib.3 head/contrib/zlib/zlib.h head/contrib/zlib/zutil.c Directory Properties: head/contrib/zlib/ (props changed) Modified: head/contrib/zlib/ChangeLog ============================================================================== --- head/contrib/zlib/ChangeLog Tue Jan 17 05:47:54 2017 (r312334) +++ head/contrib/zlib/ChangeLog Tue Jan 17 05:55:47 2017 (r312335) @@ -1,6 +1,10 @@ ChangeLog file for zlib +Changes in 1.2.11 (15 Jan 2017) +- Fix deflate stored bug when pulling last block from window +- Permit immediate deflateParams changes before any deflate input + Changes in 1.2.10 (2 Jan 2017) - Avoid warnings on snprintf() return value - Fix bug in deflate_stored() for zero-length input Modified: head/contrib/zlib/README ============================================================================== --- head/contrib/zlib/README Tue Jan 17 05:47:54 2017 (r312334) +++ head/contrib/zlib/README Tue Jan 17 05:55:47 2017 (r312335) @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.10 is a general purpose data compression library. All the code is +zlib 1.2.11 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ Mark Nelson wrote an ar issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.10 are documented in the file ChangeLog. +The changes made in version 1.2.11 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . Modified: head/contrib/zlib/deflate.c ============================================================================== --- head/contrib/zlib/deflate.c Tue Jan 17 05:47:54 2017 (r312334) +++ head/contrib/zlib/deflate.c Tue Jan 17 05:55:47 2017 (r312335) @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.10 Copyright 1995-2017 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -586,7 +586,8 @@ int ZEXPORT deflateParams(strm, level, s } func = configuration_table[s->level].func; - if ((strategy != s->strategy || func != configuration_table[level].func)) { + if ((strategy != s->strategy || func != configuration_table[level].func) && + s->high_water) { /* Flush the last buffer: */ int err = deflate(strm, Z_BLOCK); if (err == Z_STREAM_ERROR) @@ -1671,8 +1672,6 @@ local block_state deflate_stored(s, flus len = left + s->strm->avail_in; /* limit len to the input */ if (len > have) len = have; /* limit len to the output */ - if (left > len) - left = len; /* limit window pull to len */ /* If the stored block would be less than min_block in length, or if * unable to copy all of the available input when flushing, then try @@ -1681,13 +1680,13 @@ local block_state deflate_stored(s, flus */ if (len < min_block && ((len == 0 && flush != Z_FINISH) || flush == Z_NO_FLUSH || - len - left != s->strm->avail_in)) + len != left + s->strm->avail_in)) break; /* Make a dummy stored block in pending to get the header bytes, * including any pending bits. This also updates the debugging counts. */ - last = flush == Z_FINISH && len - left == s->strm->avail_in ? 1 : 0; + last = flush == Z_FINISH && len == left + s->strm->avail_in ? 1 : 0; _tr_stored_block(s, (char *)0, 0L, last); /* Replace the lengths in the dummy stored block with len. */ @@ -1699,14 +1698,16 @@ local block_state deflate_stored(s, flus /* Write the stored block header bytes. */ flush_pending(s->strm); - /* Update debugging counts for the data about to be copied. */ #ifdef ZLIB_DEBUG + /* Update debugging counts for the data about to be copied. */ s->compressed_len += len << 3; s->bits_sent += len << 3; #endif /* Copy uncompressed bytes from the window to next_out. */ if (left) { + if (left > len) + left = len; zmemcpy(s->strm->next_out, s->window + s->block_start, left); s->strm->next_out += left; s->strm->avail_out -= left; @@ -1756,6 +1757,8 @@ local block_state deflate_stored(s, flus s->block_start = s->strstart; s->insert += MIN(used, s->w_size - s->insert); } + if (s->high_water < s->strstart) + s->high_water = s->strstart; /* If the last block was written to next_out, then done. */ if (last) @@ -1783,6 +1786,8 @@ local block_state deflate_stored(s, flus read_buf(s->strm, s->window + s->strstart, have); s->strstart += have; } + if (s->high_water < s->strstart) + s->high_water = s->strstart; /* There was not enough avail_out to write a complete worthy or flushed * stored block to next_out. Write a stored block to pending instead, if we Modified: head/contrib/zlib/gzlib.c ============================================================================== --- head/contrib/zlib/gzlib.c Tue Jan 17 05:47:54 2017 (r312334) +++ head/contrib/zlib/gzlib.c Tue Jan 17 05:55:47 2017 (r312335) @@ -1,5 +1,5 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004, 2010, 2011, 2012, 2013, 2016 Mark Adler + * Copyright (C) 2004-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ Modified: head/contrib/zlib/gzwrite.c ============================================================================== --- head/contrib/zlib/gzwrite.c Tue Jan 17 05:47:54 2017 (r312334) +++ head/contrib/zlib/gzwrite.c Tue Jan 17 05:55:47 2017 (r312335) @@ -1,5 +1,5 @@ /* gzwrite.c -- zlib functions for writing gzip files - * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler + * Copyright (C) 2004-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ Modified: head/contrib/zlib/inffast.c ============================================================================== --- head/contrib/zlib/inffast.c Tue Jan 17 05:47:54 2017 (r312334) +++ head/contrib/zlib/inffast.c Tue Jan 17 05:55:47 2017 (r312335) @@ -1,5 +1,5 @@ /* inffast.c -- fast decoding - * Copyright (C) 1995-2008, 2010, 2013, 2016 Mark Adler + * Copyright (C) 1995-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ Modified: head/contrib/zlib/inftrees.c ============================================================================== --- head/contrib/zlib/inftrees.c Tue Jan 17 05:47:54 2017 (r312334) +++ head/contrib/zlib/inftrees.c Tue Jan 17 05:55:47 2017 (r312335) @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.10 Copyright 1995-2017 Mark Adler "; + " inflate 1.2.11 Copyright 1995-2017 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -62,7 +62,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 192, 202}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 77, 202}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, Modified: head/contrib/zlib/trees.c ============================================================================== --- head/contrib/zlib/trees.c Tue Jan 17 05:47:54 2017 (r312334) +++ head/contrib/zlib/trees.c Tue Jan 17 05:55:47 2017 (r312335) @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2016 Jean-loup Gailly + * Copyright (C) 1995-2017 Jean-loup Gailly * detect_data_type() function provided freely by Cosmin Truta, 2006 * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -906,7 +906,7 @@ void ZLIB_INTERNAL _tr_align(s) /* =========================================================================== * Determine the best encoding for the current block: dynamic trees, static - * trees or store, and output the encoded block to the zip file. + * trees or store, and write out the encoded block. */ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) deflate_state *s; Modified: head/contrib/zlib/zlib.3 ============================================================================== --- head/contrib/zlib/zlib.3 Tue Jan 17 05:47:54 2017 (r312334) +++ head/contrib/zlib/zlib.3 Tue Jan 17 05:55:47 2017 (r312335) @@ -1,4 +1,4 @@ -.TH ZLIB 3 "2 Jan 2017" +.TH ZLIB 3 "15 Jan 2017" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -105,7 +105,7 @@ before asking for help. Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS AND LICENSE -Version 1.2.10 +Version 1.2.11 .LP Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler .LP Modified: head/contrib/zlib/zlib.h ============================================================================== --- head/contrib/zlib/zlib.h Tue Jan 17 05:47:54 2017 (r312334) +++ head/contrib/zlib/zlib.h Tue Jan 17 05:55:47 2017 (r312335) @@ -1,5 +1,5 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.10, January 2nd, 2017 + version 1.2.11, January 15th, 2017 Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.10" -#define ZLIB_VERNUM 0x12a0 +#define ZLIB_VERSION "1.2.11" +#define ZLIB_VERNUM 0x12b0 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 10 +#define ZLIB_VER_REVISION 11 #define ZLIB_VER_SUBREVISION 0 /* @@ -712,10 +712,11 @@ ZEXTERN int ZEXPORT deflateParams OF((z_ used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression approach (which is a function of the level) or the - strategy is changed, then the input available so far is compressed with the - old level and strategy using deflate(strm, Z_BLOCK). There are three - approaches for the compression levels 0, 1..3, and 4..9 respectively. The - new level and strategy will take effect at the next call of deflate(). + strategy is changed, and if any input has been consumed in a previous + deflate() call, then the input available so far is compressed with the old + level and strategy using deflate(strm, Z_BLOCK). There are three approaches + for the compression levels 0, 1..3, and 4..9 respectively. The new level + and strategy will take effect at the next call of deflate(). If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does not have enough output space to complete, then the parameter change will not Modified: head/contrib/zlib/zutil.c ============================================================================== --- head/contrib/zlib/zutil.c Tue Jan 17 05:47:54 2017 (r312334) +++ head/contrib/zlib/zutil.c Tue Jan 17 05:55:47 2017 (r312335) @@ -1,5 +1,5 @@ /* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-2005, 2010, 2011, 2012, 2016 Jean-loup Gailly + * Copyright (C) 1995-2017 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ From owner-svn-src-all@freebsd.org Tue Jan 17 06:52:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C465CB3342; Tue, 17 Jan 2017 06:52:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 211CF1113; Tue, 17 Jan 2017 06:52:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v0H6qVJp046022 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 16 Jan 2017 22:52:31 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v0H6qVHR046021; Mon, 16 Jan 2017 22:52:31 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 16 Jan 2017 22:52:31 -0800 From: Gleb Smirnoff To: Maxim Sobolev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg Message-ID: <20170117065231.GW2611@FreeBSD.org> References: <201701161746.v0GHkcPX071529@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701161746.v0GHkcPX071529@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jan 2017 06:52:33 -0000 Hi! On Mon, Jan 16, 2017 at 05:46:38PM +0000, Maxim Sobolev wrote: M> Author: sobomax M> Date: Mon Jan 16 17:46:38 2017 M> New Revision: 312296 M> URL: https://svnweb.freebsd.org/changeset/base/312296 M> M> Log: M> Add a new socket option SO_TS_CLOCK to pick from several different clock M> sources to return timestamps when SO_TIMESTAMP is enabled. Two additional M> clock sources are: M> M> o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME); M> o nanosecond resolution monotonic clock (equivalent of CLOCK_MONOTONIC). M> M> In addition to this, this option provides unified interface to get bintime M> (equivalent of using SO_BINTIME), except it also supported with IPv6 where M> SO_BINTIME has never been supported. The long term plan is to depreciate M> SO_BINTIME and move everything to using SO_TS_CLOCK. M> M> Idea for this enhancement has been briefly discussed on the Net session M> during dev summit in Ottawa last June and the general input was positive. M> M> This change is believed to benefit network benchmarks/profiling as well M> as other scenarios where precise time of arrival measurement is necessary. M> M> There are two regression test cases as part of this commit: one extends unix M> domain test code (unix_cmsg) to test new SCM_XXX types and another one M> implementis totally new test case which exchanges UDP packets between two M> processes using both conventional methods (i.e. calling clock_gettime(2) M> before recv(2) and after send(2)), as well as using setsockopt()+recv() in M> receive path. The resulting delays are checked for sanity for all supported M> clock types. M> M> Reviewed by: adrian, gnn M> Differential Revision: https://reviews.freebsd.org/D9171 Is it possible to declare possible values as a enum and make so_ts_clock fields of that enum type? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Tue Jan 17 07:11:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55D98CB385B; Tue, 17 Jan 2017 07:11:48 +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 09D511848; Tue, 17 Jan 2017 07:11:47 +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 v0H7BlVR004610; Tue, 17 Jan 2017 07:11:47 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H7BlGf004606; Tue, 17 Jan 2017 07:11:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201701170711.v0H7BlGf004606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 17 Jan 2017 07:11: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: r312336 - in stable/11: share/colldef share/ctypedef share/monetdef share/msgdef share/numericdef tools/tools/locale/etc tools/tools/locale/etc/final-maps 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, 17 Jan 2017 07:11:48 -0000 Author: bapt Date: Tue Jan 17 07:11:46 2017 New Revision: 312336 URL: https://svnweb.freebsd.org/changeset/base/312336 Log: MFC r310201: Update locales cldr to v30.0.3 and unicode to 9.0.0 Relnotes: yes Added: stable/11/share/colldef/fr_CA.UTF-8.src - copied unchanged from r310201, head/share/colldef/fr_CA.UTF-8.src stable/11/share/colldef/ja_JP.eucJP.src - copied unchanged from r310201, head/share/colldef/ja_JP.eucJP.src stable/11/share/colldef/nn_NO.ISO8859-1.src - copied unchanged from r310201, head/share/colldef/nn_NO.ISO8859-1.src stable/11/share/colldef/nn_NO.ISO8859-15.src - copied unchanged from r310201, head/share/colldef/nn_NO.ISO8859-15.src stable/11/share/colldef/nn_NO.UTF-8.src - copied unchanged from r310201, head/share/colldef/nn_NO.UTF-8.src stable/11/share/colldef/sr_RS.ISO8859-2.src - copied unchanged from r310201, head/share/colldef/sr_RS.ISO8859-2.src stable/11/share/colldef/sr_RS.ISO8859-5.src - copied unchanged from r310201, head/share/colldef/sr_RS.ISO8859-5.src stable/11/share/colldef/sr_RS.UTF-8.src - copied unchanged from r310201, head/share/colldef/sr_RS.UTF-8.src stable/11/share/colldef/sr_RS.UTF-8@latin.src - copied unchanged from r310201, head/share/colldef/sr_RS.UTF-8@latin.src stable/11/share/colldef/zh_CN.GB18030.src - copied unchanged from r310201, head/share/colldef/zh_CN.GB18030.src stable/11/share/colldef/zh_CN.GBK.src - copied unchanged from r310201, head/share/colldef/zh_CN.GBK.src stable/11/share/colldef/zh_TW.Big5.src - copied unchanged from r310201, head/share/colldef/zh_TW.Big5.src stable/11/share/ctypedef/ja_JP.eucJP.src - copied unchanged from r310201, head/share/ctypedef/ja_JP.eucJP.src stable/11/share/ctypedef/zh_CN.eucCN.src - copied unchanged from r310201, head/share/ctypedef/zh_CN.eucCN.src stable/11/share/monetdef/nl_BE.UTF-8.src - copied unchanged from r310201, head/share/monetdef/nl_BE.UTF-8.src stable/11/tools/tools/locale/etc/final-maps/map.CP949 - copied unchanged from r310201, head/tools/tools/locale/etc/final-maps/map.CP949 Deleted: stable/11/share/colldef/hr_HR.UTF-8.src stable/11/share/colldef/nb_NO.UTF-8.src stable/11/share/ctypedef/ja_JP.SJIS.src stable/11/share/ctypedef/zh_CN.GB18030.src stable/11/share/monetdef/be_BY.CP1251.src stable/11/share/monetdef/lv_LV.ISO8859-13.src stable/11/share/monetdef/lv_LV.UTF-8.src stable/11/share/monetdef/ru_RU.CP1251.src stable/11/share/msgdef/he_IL.UTF-8.src stable/11/share/numericdef/hy_AM.UTF-8.src Modified: stable/11/share/colldef/Makefile stable/11/share/colldef/af_ZA.UTF-8.src stable/11/share/colldef/am_ET.UTF-8.src stable/11/share/colldef/ar_SA.UTF-8.src stable/11/share/colldef/be_BY.UTF-8.src stable/11/share/colldef/ca_AD.UTF-8.src stable/11/share/colldef/cs_CZ.ISO8859-2.src stable/11/share/colldef/cs_CZ.UTF-8.src stable/11/share/colldef/da_DK.ISO8859-1.src stable/11/share/colldef/da_DK.ISO8859-15.src stable/11/share/colldef/da_DK.UTF-8.src stable/11/share/colldef/el_GR.UTF-8.src stable/11/share/colldef/en_US.UTF-8.src stable/11/share/colldef/es_MX.UTF-8.src stable/11/share/colldef/et_EE.UTF-8.src stable/11/share/colldef/fi_FI.UTF-8.src stable/11/share/colldef/he_IL.UTF-8.src stable/11/share/colldef/hi_IN.UTF-8.src stable/11/share/colldef/hr_HR.ISO8859-2.src stable/11/share/colldef/hu_HU.ISO8859-2.src stable/11/share/colldef/hu_HU.UTF-8.src stable/11/share/colldef/hy_AM.UTF-8.src stable/11/share/colldef/is_IS.UTF-8.src stable/11/share/colldef/ja_JP.UTF-8.src stable/11/share/colldef/kk_KZ.UTF-8.src stable/11/share/colldef/ko_KR.UTF-8.src stable/11/share/colldef/lt_LT.UTF-8.src stable/11/share/colldef/lv_LV.UTF-8.src stable/11/share/colldef/nb_NO.ISO8859-1.src stable/11/share/colldef/nb_NO.ISO8859-15.src stable/11/share/colldef/pl_PL.UTF-8.src stable/11/share/colldef/ro_RO.UTF-8.src stable/11/share/colldef/ru_RU.UTF-8.src stable/11/share/colldef/se_NO.UTF-8.src stable/11/share/colldef/sk_SK.ISO8859-2.src stable/11/share/colldef/sk_SK.UTF-8.src stable/11/share/colldef/sl_SI.UTF-8.src stable/11/share/colldef/sv_SE.UTF-8.src stable/11/share/colldef/tr_TR.UTF-8.src stable/11/share/colldef/uk_UA.UTF-8.src stable/11/share/colldef/zh_CN.GB2312.src stable/11/share/colldef/zh_CN.UTF-8.src stable/11/share/colldef/zh_CN.eucCN.src stable/11/share/colldef/zh_TW.UTF-8.src stable/11/share/ctypedef/Makefile stable/11/share/ctypedef/be_BY.CP1131.src stable/11/share/ctypedef/ca_IT.ISO8859-1.src stable/11/share/ctypedef/en_US.ISO8859-1.src stable/11/share/ctypedef/en_US.UTF-8.src stable/11/share/ctypedef/hi_IN.ISCII-DEV.src stable/11/share/ctypedef/uk_UA.CP1251.src stable/11/share/monetdef/Makefile stable/11/share/monetdef/ar_AE.UTF-8.src stable/11/share/monetdef/ar_EG.UTF-8.src stable/11/share/monetdef/ar_JO.UTF-8.src stable/11/share/monetdef/ar_QA.UTF-8.src stable/11/share/monetdef/ar_SA.UTF-8.src stable/11/share/monetdef/be_BY.CP1131.src stable/11/share/monetdef/be_BY.ISO8859-5.src stable/11/share/monetdef/be_BY.UTF-8.src stable/11/share/monetdef/bg_BG.CP1251.src stable/11/share/monetdef/bg_BG.UTF-8.src stable/11/share/monetdef/es_AR.UTF-8.src stable/11/share/monetdef/es_CR.UTF-8.src stable/11/share/monetdef/hu_HU.ISO8859-2.src stable/11/share/monetdef/hu_HU.UTF-8.src stable/11/share/monetdef/hy_AM.ARMSCII-8.src stable/11/share/monetdef/hy_AM.UTF-8.src stable/11/share/monetdef/ru_RU.CP866.src stable/11/share/monetdef/ru_RU.ISO8859-5.src stable/11/share/monetdef/ru_RU.KOI8-R.src stable/11/share/monetdef/ru_RU.UTF-8.src stable/11/share/monetdef/sl_SI.UTF-8.src stable/11/share/monetdef/tr_TR.ISO8859-9.src stable/11/share/monetdef/tr_TR.UTF-8.src stable/11/share/monetdef/zh_CN.GB2312.src stable/11/share/monetdef/zh_CN.GBK.src stable/11/share/monetdef/zh_CN.UTF-8.src stable/11/share/monetdef/zh_CN.eucCN.src stable/11/share/monetdef/zh_TW.Big5.src stable/11/share/monetdef/zh_TW.UTF-8.src stable/11/share/msgdef/Makefile stable/11/share/msgdef/ja_JP.SJIS.src stable/11/share/msgdef/ja_JP.UTF-8.src stable/11/share/msgdef/ja_JP.eucJP.src stable/11/share/msgdef/tr_TR.ISO8859-9.src stable/11/share/msgdef/tr_TR.UTF-8.src stable/11/share/numericdef/Makefile stable/11/tools/tools/locale/etc/common.UTF-8.src (contents, props changed) stable/11/tools/tools/locale/etc/final-maps/map.GB2312 stable/11/tools/tools/locale/etc/final-maps/map.UTF-8 (contents, props changed) Directory Properties: stable/11/ (props changed) Modified: stable/11/share/colldef/Makefile ============================================================================== --- stable/11/share/colldef/Makefile Tue Jan 17 05:55:47 2017 (r312335) +++ stable/11/share/colldef/Makefile Tue Jan 17 07:11:46 2017 (r312336) @@ -23,9 +23,9 @@ LOCALES+= en_US.UTF-8 LOCALES+= es_MX.UTF-8 LOCALES+= et_EE.UTF-8 LOCALES+= fi_FI.UTF-8 +LOCALES+= fr_CA.UTF-8 LOCALES+= he_IL.UTF-8 LOCALES+= hi_IN.UTF-8 -LOCALES+= hr_HR.UTF-8 LOCALES+= hu_HU.UTF-8 LOCALES+= hy_AM.UTF-8 LOCALES+= is_IS.UTF-8 @@ -34,13 +34,15 @@ LOCALES+= kk_KZ.UTF-8 LOCALES+= ko_KR.UTF-8 LOCALES+= lt_LT.UTF-8 LOCALES+= lv_LV.UTF-8 -LOCALES+= nb_NO.UTF-8 +LOCALES+= nn_NO.UTF-8 LOCALES+= pl_PL.UTF-8 LOCALES+= ro_RO.UTF-8 LOCALES+= ru_RU.UTF-8 LOCALES+= se_NO.UTF-8 LOCALES+= sk_SK.UTF-8 LOCALES+= sl_SI.UTF-8 +LOCALES+= sr_RS.UTF-8 +LOCALES+= sr_RS.UTF-8@latin LOCALES+= sv_SE.UTF-8 LOCALES+= tr_TR.UTF-8 LOCALES+= uk_UA.UTF-8 @@ -52,7 +54,6 @@ LOCALES_MAPPED+= af_ZA.UTF-8 af_ZA.ISO88 LOCALES_MAPPED+= be_BY.UTF-8 be_BY.ISO8859-5 LOCALES_MAPPED+= be_BY.UTF-8 be_BY.CP1251 LOCALES_MAPPED+= be_BY.UTF-8 be_BY.CP1131 -LOCALES_MAPPED+= ru_RU.UTF-8 sr_RS.ISO8859-5 LOCALES_MAPPED+= ru_RU.UTF-8 ru_RU.KOI8-R LOCALES_MAPPED+= ru_RU.UTF-8 ru_RU.ISO8859-5 LOCALES_MAPPED+= ru_RU.UTF-8 ru_RU.CP866 @@ -66,13 +67,9 @@ LOCALES_MAPPED+= ca_AD.UTF-8 ca_ES.ISO88 LOCALES_MAPPED+= ca_AD.UTF-8 ca_ES.ISO8859-1 LOCALES_MAPPED+= ca_AD.UTF-8 ca_AD.ISO8859-15 LOCALES_MAPPED+= ca_AD.UTF-8 ca_AD.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 sr_RS.UTF-8@latin -LOCALES_MAPPED+= en_US.UTF-8 sr_RS.ISO8859-2 LOCALES_MAPPED+= en_US.UTF-8 pt_PT.ISO8859-15 LOCALES_MAPPED+= en_US.UTF-8 pt_PT.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 pt_BR.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 nn_NO.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 nn_NO.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 nl_NL.ISO8859-15 LOCALES_MAPPED+= en_US.UTF-8 nl_NL.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 nl_BE.ISO8859-15 @@ -85,8 +82,6 @@ LOCALES_MAPPED+= en_US.UTF-8 fr_FR.ISO88 LOCALES_MAPPED+= en_US.UTF-8 fr_FR.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 fr_CH.ISO8859-15 LOCALES_MAPPED+= en_US.UTF-8 fr_CH.ISO8859-1 -LOCALES_MAPPED+= en_US.UTF-8 fr_CA.ISO8859-15 -LOCALES_MAPPED+= en_US.UTF-8 fr_CA.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 fr_BE.ISO8859-15 LOCALES_MAPPED+= en_US.UTF-8 fr_BE.ISO8859-1 LOCALES_MAPPED+= en_US.UTF-8 eu_ES.ISO8859-15 @@ -128,12 +123,14 @@ LOCALES_MAPPED+= et_EE.UTF-8 et_EE.ISO88 LOCALES_MAPPED+= et_EE.UTF-8 et_EE.ISO8859-1 LOCALES_MAPPED+= fi_FI.UTF-8 fi_FI.ISO8859-15 LOCALES_MAPPED+= fi_FI.UTF-8 fi_FI.ISO8859-1 +LOCALES_MAPPED+= fr_CA.UTF-8 fr_CA.ISO8859-15 +LOCALES_MAPPED+= fr_CA.UTF-8 fr_CA.ISO8859-1 LOCALES_MAPPED+= hi_IN.UTF-8 hi_IN.ISCII-DEV +LOCALES_MAPPED+= sr_RS.UTF-8@latin hr_HR.UTF-8 LOCALES_MAPPED+= hy_AM.UTF-8 hy_AM.ARMSCII-8 LOCALES_MAPPED+= is_IS.UTF-8 is_IS.ISO8859-15 LOCALES_MAPPED+= is_IS.UTF-8 is_IS.ISO8859-1 LOCALES_MAPPED+= ja_JP.UTF-8 ja_JP.SJIS -LOCALES_MAPPED+= ja_JP.UTF-8 ja_JP.eucJP LOCALES_MAPPED+= ko_KR.UTF-8 ko_KR.eucKR LOCALES_MAPPED+= lt_LT.UTF-8 lt_LT.ISO8859-13 LOCALES_MAPPED+= lv_LV.UTF-8 lv_LV.ISO8859-13 @@ -148,9 +145,6 @@ LOCALES_MAPPED+= tr_TR.UTF-8 tr_TR.ISO88 LOCALES_MAPPED+= uk_UA.UTF-8 uk_UA.KOI8-U LOCALES_MAPPED+= uk_UA.UTF-8 uk_UA.ISO8859-5 LOCALES_MAPPED+= uk_UA.UTF-8 uk_UA.CP1251 -LOCALES_MAPPED+= zh_CN.UTF-8 zh_CN.GBK -LOCALES_MAPPED+= zh_CN.UTF-8 zh_CN.GB18030 -LOCALES_MAPPED+= zh_TW.UTF-8 zh_TW.Big5 LOCALES+= cs_CZ.ISO8859-2 LOCALES+= da_DK.ISO8859-1 @@ -160,8 +154,16 @@ LOCALES+= hu_HU.ISO8859-2 LOCALES+= nb_NO.ISO8859-1 LOCALES+= nb_NO.ISO8859-15 LOCALES+= sk_SK.ISO8859-2 +LOCALES+= sr_RS.ISO8859-2 +LOCALES+= sr_RS.ISO8859-5 LOCALES+= zh_CN.GB2312 LOCALES+= zh_CN.eucCN +LOCALES+= zh_TW.Big5 +LOCALES+= zh_CN.GB18030 +LOCALES+= zh_CN.GBK +LOCALES+= ja_JP.eucJP +LOCALES+= nn_NO.ISO8859-15 +LOCALES+= nn_NO.ISO8859-1 SAME+= ar_SA.UTF-8 ar_QA.UTF-8 @@ -169,7 +171,6 @@ SAME+= ar_SA.UTF-8 ar_MA.UTF-8 SAME+= ar_SA.UTF-8 ar_JO.UTF-8 SAME+= ar_SA.UTF-8 ar_EG.UTF-8 SAME+= ar_SA.UTF-8 ar_AE.UTF-8 -SAME+= ru_RU.UTF-8 sr_RS.UTF-8 SAME+= ru_RU.UTF-8 mn_MN.UTF-8 SAME+= ru_RU.UTF-8 bg_BG.UTF-8 SAME+= ca_AD.UTF-8 ca_IT.UTF-8 @@ -177,14 +178,12 @@ SAME+= ca_AD.UTF-8 ca_FR.UTF-8 SAME+= ca_AD.UTF-8 ca_ES.UTF-8 SAME+= en_US.UTF-8 pt_PT.UTF-8 SAME+= en_US.UTF-8 pt_BR.UTF-8 -SAME+= en_US.UTF-8 nn_NO.UTF-8 SAME+= en_US.UTF-8 nl_NL.UTF-8 SAME+= en_US.UTF-8 nl_BE.UTF-8 SAME+= en_US.UTF-8 it_IT.UTF-8 SAME+= en_US.UTF-8 it_CH.UTF-8 SAME+= en_US.UTF-8 fr_FR.UTF-8 SAME+= en_US.UTF-8 fr_CH.UTF-8 -SAME+= en_US.UTF-8 fr_CA.UTF-8 SAME+= en_US.UTF-8 fr_BE.UTF-8 SAME+= en_US.UTF-8 eu_ES.UTF-8 SAME+= en_US.UTF-8 en_ZA.UTF-8 @@ -202,6 +201,7 @@ SAME+= en_US.UTF-8 de_AT.UTF-8 SAME+= es_MX.UTF-8 es_ES.UTF-8 SAME+= es_MX.UTF-8 es_CR.UTF-8 SAME+= es_MX.UTF-8 es_AR.UTF-8 +SAME+= nn_NO.UTF-8 nb_NO.UTF-8 SAME+= se_NO.UTF-8 se_FI.UTF-8 SAME+= sv_SE.UTF-8 sv_FI.UTF-8 SAME+= zh_TW.UTF-8 zh_HK.UTF-8 Modified: stable/11/share/colldef/af_ZA.UTF-8.src ============================================================================== --- stable/11/share/colldef/af_ZA.UTF-8.src Tue Jan 17 05:55:47 2017 (r312335) +++ stable/11/share/colldef/af_ZA.UTF-8.src Tue Jan 17 07:11:46 2017 (r312336) @@ -42,7 +42,6 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol collating-symbol collating-symbol collating-symbol @@ -76,36 +75,36 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -139,6 +138,7 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -312,6 +312,8 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -471,14 +473,14 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol collating-symbol collating-symbol collating-symbol @@ -489,6 +491,10 @@ collating-symbol collating-symbol collating-symbol collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol order_start forward;forward;forward;forward @@ -526,7 +532,6 @@ order_start forward;forward;forward;forw - @@ -560,36 +565,36 @@ order_start forward;forward;forward;forw - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -623,6 +628,7 @@ order_start forward;forward;forward;forw + @@ -796,6 +802,8 @@ order_start forward;forward;forward;forw + + @@ -955,14 +963,14 @@ order_start forward;forward;forward;forw - - - + + + + + - - @@ -973,6 +981,10 @@ order_start forward;forward;forward;forw + + + + * assignment of characters to weights @@ -1018,36 +1030,36 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1147,7 +1159,7 @@ order_start forward;forward;forward;forw "";"";""; "";"";""; "";"";""; - "";"";""; + "";"";""; ;;; ;;; ;;; @@ -1193,6 +1205,8 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1528,7 +1542,8 @@ order_start forward;forward;forward;forw "";"";""; ;;; ;;; - ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1558,7 +1573,8 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; - ;;; + ;;; + ;;; ;;; ;;; ;;; @@ -1621,8 +1637,8 @@ order_start forward;forward;forward;forw ;"";""; ;"";""; ;"";""; - ;"";""; - ;"";""; + ;"";""; + ;"";""; "";"";""; "";"";""; "";"";""; @@ -1846,23 +1862,26 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;;

;;;

;;;

;;;

@@ -2252,6 +2271,7 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; + ;;; ;;; ;;; ;;; @@ -2344,52 +2364,56 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; UNDEFINED IGNORE;IGNORE;IGNORE;... order_end Modified: stable/11/share/colldef/am_ET.UTF-8.src ============================================================================== --- stable/11/share/colldef/am_ET.UTF-8.src Tue Jan 17 05:55:47 2017 (r312335) +++ stable/11/share/colldef/am_ET.UTF-8.src Tue Jan 17 07:11:46 2017 (r312336) @@ -13,13 +13,13 @@ LC_COLLATE collating-symbol collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol -collating-symbol collating-symbol -collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -46,51 +46,51 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol -collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -176,20 +176,20 @@ collating-symbol collating-symbol collating-symbol collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol -collating-symbol collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol collating-symbol collating-symbol collating-symbol @@ -351,13 +351,13 @@ order_start forward;forward;forward;forw - - + + + - - + @@ -384,51 +384,51 @@ order_start forward;forward;forward;forw - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - + - - - - - - - - - - + + + + + + + + + + @@ -514,20 +514,20 @@ order_start forward;forward;forward;forw - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -712,9 +712,9 @@ order_start forward;forward;forward;forw IGNORE;IGNORE;IGNORE; IGNORE;IGNORE;IGNORE; IGNORE;IGNORE;IGNORE; - IGNORE;"";""; - IGNORE;"";""; - IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; + IGNORE;"";""; ;;; ;;; ;;; @@ -736,23 +736,23 @@ order_start forward;forward;forward;forw ;;; ;;; ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; + ;;; ;;; ;;; "";;""; @@ -765,24 +765,24 @@ order_start forward;forward;forward;forw "";;""; "";;""; "";;""; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; - ;;; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 17 07:43:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E5ECCB4469; Tue, 17 Jan 2017 07:43:38 +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 1CC2119F9; Tue, 17 Jan 2017 07:43:38 +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 v0H7hbPI017559; Tue, 17 Jan 2017 07:43:37 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H7hbo7017558; Tue, 17 Jan 2017 07:43:37 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701170743.v0H7hbo7017558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 17 Jan 2017 07:43: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: r312337 - 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: Tue, 17 Jan 2017 07:43:38 -0000 Author: np Date: Tue Jan 17 07:43:37 2017 New Revision: 312337 URL: https://svnweb.freebsd.org/changeset/base/312337 Log: Fix mismerge in r312117. This is a direct commit to stable/10. Modified: stable/10/sys/dev/cxgbe/tom/t4_ddp.c Modified: stable/10/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_ddp.c Tue Jan 17 07:11:46 2017 (r312336) +++ stable/10/sys/dev/cxgbe/tom/t4_ddp.c Tue Jan 17 07:43:37 2017 (r312337) @@ -394,7 +394,6 @@ handle_ddp_data(struct toepcb *toep, __b /* receive buffer autosize */ MPASS(toep->vnet == so->so_vnet); CURVNET_SET(toep->vnet); - SOCKBUF_LOCK(sb); if (sb->sb_flags & SB_AUTOSIZE && V_tcp_do_autorcvbuf && sb->sb_hiwat < V_tcp_autorcvbuf_max && From owner-svn-src-all@freebsd.org Tue Jan 17 08:15:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50C09CB36F8; Tue, 17 Jan 2017 08:15:12 +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 2B47A1CD0; Tue, 17 Jan 2017 08:15:12 +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 v0H8FBaI029736; Tue, 17 Jan 2017 08:15:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0H8FAA2029731; Tue, 17 Jan 2017 08:15:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701170815.v0H8FAA2029731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 17 Jan 2017 08:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312338 - in head: share/man/man4 sys/dev/sound/usb sys/dev/usb sys/dev/usb/quirk 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, 17 Jan 2017 08:15:12 -0000 Author: hselasky Date: Tue Jan 17 08:15:10 2017 New Revision: 312338 URL: https://svnweb.freebsd.org/changeset/base/312338 Log: Add USB audio support for S/PDIF output with C-Media CM6206 devices. Submitted by: Julien Nadeau PR: 216131 MFC after: 1 week Modified: head/share/man/man4/usb_quirk.4 head/sys/dev/sound/usb/uaudio.c head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/quirk/usb_quirk.h head/sys/dev/usb/usbdevs Modified: head/share/man/man4/usb_quirk.4 ============================================================================== --- head/share/man/man4/usb_quirk.4 Tue Jan 17 07:43:37 2017 (r312337) +++ head/share/man/man4/usb_quirk.4 Tue Jan 17 08:15:10 2017 (r312338) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 4, 2016 +.Dd January 17, 2017 .Dt USB_QUIRK 4 .Os .Sh NAME @@ -52,6 +52,10 @@ input is async despite claim of adaptive do not adjust for fractional samples .It UQ_AU_NO_XU audio device has broken extension unit +.It UQ_AU_VENDOR_CLASS +audio device uses vendor class to identify itself +.It UQ_AU_SET_SPDIF_CM6206 +audio device needs special programming to enable S/PDIF audio output .It UQ_BAD_ADC bad audio spec version number .It UQ_BAD_AUDIO Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Tue Jan 17 07:43:37 2017 (r312337) +++ head/sys/dev/sound/usb/uaudio.c Tue Jan 17 08:15:10 2017 (r312338) @@ -337,6 +337,11 @@ struct uaudio_hid { uint8_t mute_id; }; +#define UAUDIO_SPDIF_OUT 0x01 /* Enable S/PDIF output */ +#define UAUDIO_SPDIF_OUT_48K 0x02 /* Out sample rate = 48K */ +#define UAUDIO_SPDIF_OUT_96K 0x04 /* Out sample rate = 96K */ +#define UAUDIO_SPDIF_IN_MIX 0x10 /* Input mix enable */ + struct uaudio_softc { struct sbuf sc_sndstat; struct sndcard_func sc_sndcard_func; @@ -354,6 +359,7 @@ struct uaudio_softc { struct usb_xfer *sc_mixer_xfer[1]; struct uaudio_mixer_node *sc_mixer_root; struct uaudio_mixer_node *sc_mixer_curr; + int (*sc_set_spdif_fn) (struct uaudio_softc *, int); uint32_t sc_mix_info; uint32_t sc_recsrc_info; @@ -885,6 +891,46 @@ uaudio_probe(device_t dev) return (ENXIO); } +/* + * Set Cmedia CM6206 S/PDIF settings + * Source: CM6206 Datasheet v2.3. + */ +static int +uaudio_set_spdif_cm6206(struct uaudio_softc *sc, int flags) +{ + uint8_t cmd[2][4] = { + {0x20, 0x20, 0x00, 0}, + {0x20, 0x30, 0x02, 1} + }; + int i; + + if (flags & UAUDIO_SPDIF_OUT) + cmd[1][1] = 0x00; + else + cmd[1][1] = 0x02; + + if (flags & UAUDIO_SPDIF_OUT_96K) + cmd[0][1] = 0x60; /* 96K: 3'b110 */ + + if (flags & UAUDIO_SPDIF_IN_MIX) + cmd[1][1] = 0x03; /* SPDIFMIX */ + + for (i = 0; i < 2; i++) { + if (usbd_req_set_report(sc->sc_udev, NULL, + cmd[i], sizeof(cmd[0]), + sc->sc_mixer_iface_index, UHID_OUTPUT_REPORT, 0) != 0) { + return (ENXIO); + } + } + return (0); +} + +static int +uaudio_set_spdif_dummy(struct uaudio_softc *sc, int flags) +{ + return (0); +} + static int uaudio_attach(device_t dev) { @@ -919,6 +965,12 @@ uaudio_attach(device_t dev) if (usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS)) sc->sc_uq_au_vendor_class = 1; + /* set S/PDIF function */ + if (usb_test_quirk(uaa, UQ_AU_SET_SPDIF_CM6206)) + sc->sc_set_spdif_fn = uaudio_set_spdif_cm6206; + else + sc->sc_set_spdif_fn = uaudio_set_spdif_dummy; + umidi_init(dev); device_set_usb_desc(dev); @@ -1055,6 +1107,11 @@ uaudio_attach(device_t dev) /* reload all mixer settings */ uaudio_mixer_reload_all(sc); + /* enable S/PDIF output, if any */ + if (sc->sc_set_spdif_fn(sc, + UAUDIO_SPDIF_OUT | UAUDIO_SPDIF_OUT_48K) != 0) { + device_printf(dev, "Failed to enable S/PDIF at 48K\n"); + } return (0); /* success */ detach: @@ -1139,6 +1196,9 @@ uaudio_detach_sub(device_t dev) struct uaudio_softc *sc = device_get_softc(device_get_parent(dev)); int error = 0; + /* disable S/PDIF output, if any */ + (void) sc->sc_set_spdif_fn(sc, 0); + repeat: if (sc->sc_pcm_registered) { error = pcm_unregister(dev); Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Tue Jan 17 07:43:37 2017 (r312337) +++ head/sys/dev/usb/quirk/usb_quirk.c Tue Jan 17 08:15:10 2017 (r312338) @@ -519,6 +519,7 @@ static struct usb_quirk_entry usb_quirks /* Non-standard USB AUDIO devices */ USB_QUIRK(MAUDIO, FASTTRACKULTRA, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(MAUDIO, FASTTRACKULTRA8R, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), + USB_QUIRK(CMEDIA, CM6206, 0x0000, 0xffff, UQ_AU_SET_SPDIF_CM6206), /* * Quirks for manufacturers which USB devices does not respond @@ -605,6 +606,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_AU_VENDOR_CLASS] = "UQ_AU_VENDOR_CLASS", [UQ_SINGLE_CMD_MIDI] = "UQ_SINGLE_CMD_MIDI", [UQ_MSC_DYMO_EJECT] = "UQ_MSC_DYMO_EJECT", + [UQ_AU_SET_SPDIF_CM6206] = "UQ_AU_SET_SPDIF_CM6206", }; /*------------------------------------------------------------------------* Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Tue Jan 17 07:43:37 2017 (r312337) +++ head/sys/dev/usb/quirk/usb_quirk.h Tue Jan 17 08:15:10 2017 (r312338) @@ -109,6 +109,7 @@ enum { UQ_AU_VENDOR_CLASS, /* audio device uses vendor and not audio class */ UQ_SINGLE_CMD_MIDI, /* at most one command per USB packet */ UQ_MSC_DYMO_EJECT, /* ejects Dymo MSC device */ + UQ_AU_SET_SPDIF_CM6206, /* enable S/PDIF audio output */ USB_QUIRK_MAX }; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jan 17 07:43:37 2017 (r312337) +++ head/sys/dev/usb/usbdevs Tue Jan 17 08:15:10 2017 (r312338) @@ -1443,6 +1443,9 @@ product CLIPSAL 5000CT2 0x0304 5000CT2 product CLIPSAL C5000CT2 0x0305 C5000CT2 C-Bus Touch Screen product CLIPSAL L51xx 0x0401 L51xx C-Bus Dimmer +/* C-Media products */ +product CMEDIA CM6206 0x0102 CM106 compatible sound device + /* CMOTECH products */ product CMOTECH CNU510 0x5141 CDMA Technologies USB modem product CMOTECH CNU550 0x5543 CDMA 2000 1xRTT/1xEVDO USB modem From owner-svn-src-all@freebsd.org Tue Jan 17 09:56:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6DD5CB0F8B; Tue, 17 Jan 2017 09:56:10 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AC6A1558; Tue, 17 Jan 2017 09:56:10 +0000 (UTC) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v0H9u2ku071088; Tue, 17 Jan 2017 01:56:03 -0800 (PST) (envelope-from freebsd-rwg@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd-rwg@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v0H9tvtj071087; Tue, 17 Jan 2017 01:55:57 -0800 (PST) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <201701170955.v0H9tvtj071087@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r312322 - stable/11/tests/sys/file In-Reply-To: <201701170156.v0H1uiRs075082@repo.freebsd.org> To: Ngie Cooper Date: Tue, 17 Jan 2017 01:55:57 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jan 2017 09:56:10 -0000 > Author: ngie > Date: Tue Jan 17 01:56:44 2017 > New Revision: 312322 > URL: https://svnweb.freebsd.org/changeset/base/312322 > > Log: > MFC r312111: > > Remove unused vars to fix -Wunused issues The actual mistake here is that these are unused, a main() should do at least a check on argc to see if the correct number of args has been passed, and print a usage() if it has not: freebsd-rwg {105}% pwd /A/freebsd-rwg freebsd-rwg {106}% pwd foo usage: pwd [-LP] > Modified: > stable/11/tests/sys/file/ftruncate_test.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/tests/sys/file/ftruncate_test.c > ============================================================================== > --- stable/11/tests/sys/file/ftruncate_test.c Tue Jan 17 01:55:14 2017 (r312321) > +++ stable/11/tests/sys/file/ftruncate_test.c Tue Jan 17 01:56:44 2017 (r312322) > @@ -57,7 +57,7 @@ static off_t lengths[] = {0, 1, 2, 3, 4, > static int lengths_count = sizeof(lengths) / sizeof(off_t); > > int > -main(int argc, char *argv[]) > +main(void) > { > int error, fd, fds[2], i, read_only_fd; > char path[PATH_MAX]; > _______________________________________________ > svn-src-stable-11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11 > To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe@freebsd.org" > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jan 17 10:32:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71176CB2CE8; Tue, 17 Jan 2017 10:32:28 +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 3E39619FF; Tue, 17 Jan 2017 10:32:28 +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 v0HAWRth087076; Tue, 17 Jan 2017 10:32:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HAWRGm087075; Tue, 17 Jan 2017 10:32:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701171032.v0HAWRGm087075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 Jan 2017 10:32:27 +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: r312339 - stable/11/libexec/rtld-elf 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, 17 Jan 2017 10:32:28 -0000 Author: kib Date: Tue Jan 17 10:32:27 2017 New Revision: 312339 URL: https://svnweb.freebsd.org/changeset/base/312339 Log: MFC r311879: Use ANSI C definitions, update comment. Modified: stable/11/libexec/rtld-elf/rtld_lock.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld_lock.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld_lock.c Tue Jan 17 08:15:10 2017 (r312338) +++ stable/11/libexec/rtld-elf/rtld_lock.c Tue Jan 17 10:32:27 2017 (r312339) @@ -38,8 +38,8 @@ * In this algorithm the lock is a single word. Its low-order bit is * set when a writer holds the lock. The remaining high-order bits * contain a count of readers desiring the lock. The algorithm requires - * atomic "compare_and_store" and "add" operations, which we implement - * using assembly language sequences in "rtld_start.S". + * atomic "compare_and_store" and "add" operations, which we take + * from machine/atomic.h. */ #include @@ -67,7 +67,7 @@ static sigset_t fullsigmask, oldsigmask; static int thread_flag; static void * -def_lock_create() +def_lock_create(void) { void *base; char *p; @@ -269,7 +269,7 @@ lock_restart_for_upgrade(RtldLockState * } void -lockdflt_init() +lockdflt_init(void) { int i; From owner-svn-src-all@freebsd.org Tue Jan 17 10:34:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A018CB2EDE; Tue, 17 Jan 2017 10:34:32 +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 393911BCC; Tue, 17 Jan 2017 10:34:32 +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 v0HAYVEG087215; Tue, 17 Jan 2017 10:34:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HAYVdD087214; Tue, 17 Jan 2017 10:34:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701171034.v0HAYVdD087214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 17 Jan 2017 10:34:31 +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: r312340 - stable/10/libexec/rtld-elf 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: Tue, 17 Jan 2017 10:34:32 -0000 Author: kib Date: Tue Jan 17 10:34:31 2017 New Revision: 312340 URL: https://svnweb.freebsd.org/changeset/base/312340 Log: MFC r311879: Use ANSI C definitions, update comment. Modified: stable/10/libexec/rtld-elf/rtld_lock.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld_lock.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld_lock.c Tue Jan 17 10:32:27 2017 (r312339) +++ stable/10/libexec/rtld-elf/rtld_lock.c Tue Jan 17 10:34:31 2017 (r312340) @@ -38,8 +38,8 @@ * In this algorithm the lock is a single word. Its low-order bit is * set when a writer holds the lock. The remaining high-order bits * contain a count of readers desiring the lock. The algorithm requires - * atomic "compare_and_store" and "add" operations, which we implement - * using assembly language sequences in "rtld_start.S". + * atomic "compare_and_store" and "add" operations, which we take + * from machine/atomic.h. */ #include @@ -67,7 +67,7 @@ static sigset_t fullsigmask, oldsigmask; static int thread_flag; static void * -def_lock_create() +def_lock_create(void) { void *base; char *p; @@ -269,7 +269,7 @@ lock_restart_for_upgrade(RtldLockState * } void -lockdflt_init() +lockdflt_init(void) { int i; From owner-svn-src-all@freebsd.org Tue Jan 17 10:50:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1945CB37A2; Tue, 17 Jan 2017 10:50:29 +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 6D9551382; Tue, 17 Jan 2017 10:50:29 +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 v0HAoSJx091486; Tue, 17 Jan 2017 10:50:28 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HAoSln091485; Tue, 17 Jan 2017 10:50:28 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201701171050.v0HAoSln091485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 17 Jan 2017 10:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312341 - head/sys/netpfil/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, 17 Jan 2017 10:50:29 -0000 Author: ae Date: Tue Jan 17 10:50:28 2017 New Revision: 312341 URL: https://svnweb.freebsd.org/changeset/base/312341 Log: Initialize IPFW static rules rmlock with RM_RECURSE flag. This lock was replaced from rwlock in r272840. But unlike rwlock, rmlock doesn't allow recursion on rm_rlock(), so at this time fix this with RM_RECURSE flag. Later we need to change ipfw to avoid such recursions. PR: 216171 Reported by: Eugene Grosbein MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw_private.h Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Tue Jan 17 10:34:31 2017 (r312340) +++ head/sys/netpfil/ipfw/ip_fw_private.h Tue Jan 17 10:50:28 2017 (r312341) @@ -414,7 +414,7 @@ struct ipfw_ifc { #define IPFW_PF_RUNLOCK(p) IPFW_RUNLOCK(p) #else /* FreeBSD */ #define IPFW_LOCK_INIT(_chain) do { \ - rm_init(&(_chain)->rwmtx, "IPFW static rules"); \ + rm_init_flags(&(_chain)->rwmtx, "IPFW static rules", RM_RECURSE); \ rw_init(&(_chain)->uh_lock, "IPFW UH lock"); \ } while (0) From owner-svn-src-all@freebsd.org Tue Jan 17 07:38:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A372CCB4212; Tue, 17 Jan 2017 07:38:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 6495615BD; Tue, 17 Jan 2017 07:38:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id CC8E81A0BE2; Tue, 17 Jan 2017 18:38:12 +1100 (AEDT) Date: Tue, 17 Jan 2017 18:38:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Julian Elischer cc: Bruce Evans , Adrian Chadd , Slawa Olhovchenkov , Julian Elischer , Mark Johnston , "svn-src-head@freebsd.org" , rang@acm.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r311952 - head/sys/ddb In-Reply-To: <9810b254-7d68-cb93-3766-9d943afae632@freebsd.org> Message-ID: <20170117183424.G841@besplex.bde.org> References: <201701120022.v0C0MaHq053076@repo.freebsd.org> <20170113131948.P1465@besplex.bde.org> <20170114220629.GB18065@raichu> <1755552c-a5e2-848a-38e2-3bacfbecfb23@elischer.org> <20170115144531.GB58505@zxy.spb.ru> <20170115201758.GA78888@zxy.spb.ru> <20170116130020.B1170@besplex.bde.org> <9810b254-7d68-cb93-3766-9d943afae632@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=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=8fH027HRg59UKfw-vY0A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-Mailman-Approved-At: Tue, 17 Jan 2017 13:09:56 +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: Tue, 17 Jan 2017 07:38:23 -0000 On Mon, 16 Jan 2017, Julian Elischer wrote: > On 16/01/2017 11:53 AM, Bruce Evans wrote: >> On Sun, 15 Jan 2017, Adrian Chadd wrote: >> >>> hah, i took this, then life got in the way. :) >>> >>> Bruce - what do you think of >>> https://bz-attachments.freebsd.org/attachment.cgi?id=138881 ? >> >> Also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=184987 . >> >> I think it is hard to read and review since it is not in the mail. >> After fetching it and quoting it: > > review it in the review page and just send a link in the email.. that's what > it's for. That's what is hard to read and harder to review. Bruce From owner-svn-src-all@freebsd.org Tue Jan 17 14:13:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13F31CB469A; Tue, 17 Jan 2017 14:13:16 +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 C473B138B; Tue, 17 Jan 2017 14:13:15 +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 v0HEDEnv077884; Tue, 17 Jan 2017 14:13:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HEDEnt077883; Tue, 17 Jan 2017 14:13:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701171413.v0HEDEnt077883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 17 Jan 2017 14:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312343 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jan 2017 14:13:16 -0000 Author: mav Date: Tue Jan 17 14:13:14 2017 New Revision: 312343 URL: https://svnweb.freebsd.org/changeset/base/312343 Log: Improve error message on duplicate iSCSI port. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jan 17 12:43:55 2017 (r312342) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jan 17 14:13:14 2017 (r312343) @@ -2084,7 +2084,8 @@ cfiscsi_ioctl_port_create(struct ctl_req if (ct->ct_state == CFISCSI_TARGET_STATE_ACTIVE) { req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), - "target \"%s\" already exists", target); + "target \"%s\" for portal group tag %u already exists", + target, tag); cfiscsi_target_release(ct); ctl_free_opts(&opts); return; From owner-svn-src-all@freebsd.org Tue Jan 17 14:22:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35017CB49F3 for ; Tue, 17 Jan 2017 14:22:55 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (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 096171ADA for ; Tue, 17 Jan 2017 14:22:54 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io0-x22d.google.com with SMTP id j13so115358848iod.3 for ; Tue, 17 Jan 2017 06:22:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=F5bqUhKfYcseFeT8jPIunj8slYvC1pm5IzmK01Y3HhA=; b=rcOBDvWfHIlOAAUN6Nb1sO+b1WQL3isVEus7fye6zgcWJeadigAEgQ0eEioLNjQZzh W3+7Ds+m7K4bisMruzU6RfA/JnRx29xW5kinE/ZWWYxoj6b7+6TCgVIJrPpsdbV2mkar aUzp+ikuabtrS5lXW619bO7Advfs6Rst/hy2E/RePe9fFkLcqFn56W5i7qOsyd8ZKcnB Lb39cjW9yyCCuSc0atLdA/F1X/ZME0wql6s8BOMGw/SXs0QlDEejPWw+MIcDksKrot4v eVP/O5vF06v/gie6sNwLKwlsF2C5MXmcLIowZmYZBMa645oEzOMm12EnV6O1/PSSsdS0 d6Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=F5bqUhKfYcseFeT8jPIunj8slYvC1pm5IzmK01Y3HhA=; b=oIO/JgmD8UKQ/1U2CECQiNUuEuUaJXLHFQvWx1U/gFSVgumDhlzyvjGuMNjpCXSOnq 5g9PQ/sRosaf43jl7v/DyYCarrYaz00XSPVp/P/pLSl6+mDE4Es9qmeRcbZjBEKcO3e/ B2wP3Ej7Sob+EP0vhNGsO01ANR0Y1syiv0pAZQaK3CpeTtsLO3IKjZracMUZ0H32K0v9 5sHKoYzokdMRrDJbX1nr/D6OoVmodUvH9JEG5FxWupYe9WeMQaQlwj0K/A+CkOvN9hU1 UHbI18PUQf+X72mIZDCT82A8/Wa7REqaI46EPfnoKetbQV1kf0vo+QYHyjSq3wRgO+fr JBxA== X-Gm-Message-State: AIkVDXJW0FS3wiBkOux4Ns8o3qiRqxm9lTAoFXbHjTvLffFHrHxNup9OtPsZM54CMHZbFe21KQlMV0BrmDDQX90Y X-Received: by 10.107.184.6 with SMTP id i6mr37508287iof.153.1484662974272; Tue, 17 Jan 2017 06:22:54 -0800 (PST) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.160.66 with HTTP; Tue, 17 Jan 2017 06:22:53 -0800 (PST) In-Reply-To: <20170117065231.GW2611@FreeBSD.org> References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> From: Maxim Sobolev Date: Tue, 17 Jan 2017 06:22:53 -0800 X-Google-Sender-Auth: eG0Psl0ChHwBdhiGI_3tmY5fjmA Message-ID: Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Gleb Smirnoff 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: Tue, 17 Jan 2017 14:22:55 -0000 Of course it's possible. Do you guys want me to amend that patch? -Max On Mon, Jan 16, 2017 at 10:52 PM, Gleb Smirnoff wrote: > Hi! > > On Mon, Jan 16, 2017 at 05:46:38PM +0000, Maxim Sobolev wrote: > M> Author: sobomax > M> Date: Mon Jan 16 17:46:38 2017 > M> New Revision: 312296 > M> URL: https://svnweb.freebsd.org/changeset/base/312296 > M> > M> Log: > M> Add a new socket option SO_TS_CLOCK to pick from several different > clock > M> sources to return timestamps when SO_TIMESTAMP is enabled. Two > additional > M> clock sources are: > M> > M> o nanosecond resolution realtime clock (equivalent of CLOCK_REALTIME); > M> o nanosecond resolution monotonic clock (equivalent of > CLOCK_MONOTONIC). > M> > M> In addition to this, this option provides unified interface to get > bintime > M> (equivalent of using SO_BINTIME), except it also supported with IPv6 > where > M> SO_BINTIME has never been supported. The long term plan is to > depreciate > M> SO_BINTIME and move everything to using SO_TS_CLOCK. > M> > M> Idea for this enhancement has been briefly discussed on the Net > session > M> during dev summit in Ottawa last June and the general input was > positive. > M> > M> This change is believed to benefit network benchmarks/profiling as > well > M> as other scenarios where precise time of arrival measurement is > necessary. > M> > M> There are two regression test cases as part of this commit: one > extends unix > M> domain test code (unix_cmsg) to test new SCM_XXX types and another one > M> implementis totally new test case which exchanges UDP packets between > two > M> processes using both conventional methods (i.e. calling > clock_gettime(2) > M> before recv(2) and after send(2)), as well as using > setsockopt()+recv() in > M> receive path. The resulting delays are checked for sanity for all > supported > M> clock types. > M> > M> Reviewed by: adrian, gnn > M> Differential Revision: https://reviews.freebsd.org/D9171 > > Is it possible to declare possible values as a enum and make so_ts_clock > fields of that enum type? > > -- > Totus tuus, Glebius. > > From owner-svn-src-all@freebsd.org Tue Jan 17 14:52:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAA4CCB34B1; Tue, 17 Jan 2017 14:52:49 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CF6E1E5D; Tue, 17 Jan 2017 14:52:49 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0HEqmXU094559; Tue, 17 Jan 2017 14:52:48 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HEqm4m094557; Tue, 17 Jan 2017 14:52:48 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701171452.v0HEqm4m094557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 17 Jan 2017 14:52:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312344 - in head/sys/cam: ata 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, 17 Jan 2017 14:52:49 -0000 Author: sbruno Date: Tue Jan 17 14:52:48 2017 New Revision: 312344 URL: https://svnweb.freebsd.org/changeset/base/312344 Log: Add 4k quirk for Micron 5100 and Intel S3610 SSDs Submitted by: Jason Wolfe MFH: 1 week Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D9209 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Jan 17 14:13:14 2017 (r312343) +++ head/sys/cam/ata/ata_da.c Tue Jan 17 14:52:48 2017 (r312344) @@ -513,6 +513,14 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Intel S3610 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2BX*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * Intel X25-M Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ @@ -569,6 +577,14 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Micron 5100 SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "Micron 5100 MTFDDAK*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * OCZ Agility 2 SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Jan 17 14:13:14 2017 (r312343) +++ head/sys/cam/scsi/scsi_da.c Tue Jan 17 14:52:48 2017 (r312344) @@ -829,6 +829,11 @@ static struct da_quirk_entry da_quirk_ta /*quirks*/DA_Q_4K }, { + /* Micron Advanced Format (4k) drives */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Micron 5100 MTFDDAK*", "*" }, + /*quirks*/DA_Q_4K + }, + { /* Samsung Advanced Format (4k) drives */ { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "SAMSUNG HD155UI*", "*" }, /*quirks*/DA_Q_4K @@ -1151,6 +1156,14 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * Intel S3610 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "INTEL SSDSC2BX*", "*" }, + /*quirks*/DA_Q_4K + }, + { + /* * Intel X25-M Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned */ From owner-svn-src-all@freebsd.org Tue Jan 17 16:40:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A131CCB468C for ; Tue, 17 Jan 2017 16:40:51 +0000 (UTC) (envelope-from sobomax@sippysoft.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 73A631AA2 for ; Tue, 17 Jan 2017 16:40:51 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io0-x22c.google.com with SMTP id j18so118890213ioe.2 for ; Tue, 17 Jan 2017 08:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Q5ky+WNdWyhSR+BjYSVnVgMQgQyy5hlpmYS1BqUh1xk=; b=HEjGCjCRrkvHsbHYdRvqlygAbAFWxZ0+WWPjMZl7uwiKCX0Hi8MJd8ZYWzxS0hPwZF ev3sEDKFD8a77ayo/gFdh4dyBkA/jct1U65WfLZfp0AvtZu/z+Mt63Oaj3T2+bFJVw+w YUdAtPhpLTRAN+dGHDCi22KPAEPz1rd97Tya9UZGcEaFbSM6dAaSRwEtK14W/uhiE1DU 1OIZBe/OKXnIMpW44uWeIyrbGsLYucCP6LcbPeNlaJcfVejVpvp7h/GkB38f1o0KpWhy q38sowcUxznlx4E7SdIaZ5/bKMpfVky1ub9nYTlsb93K179Vg2/p/zmz6vLr6aUCBwls wFCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Q5ky+WNdWyhSR+BjYSVnVgMQgQyy5hlpmYS1BqUh1xk=; b=UzH+GdH7EOF3Vi+8Zmv+6pJqiYO7nBcU08sHnY1Rvhl/FeLCR1M5pkuFSRMZ0QwciR 3KHL0xRHfa8DcHzZ323l8pSOwmkgaTu8iZ8PnLJBtlDWmy5YSj4BCQQD3MVqrxB88euB GL35BOCxkQl/KqqM9rFyuhAVjccvXPvbY0KkFDF8AbXn5+sMvVZlG6QTaqrZFVY4/pVU tDKfCTxOV8USw1QcksC34nAhh4cpt5HWyh2iU4ZVmwJ3irfSc3S8nMS7BhWXemXfaAXF A71HTGVG3GDXSGyt5hJFQ+ODk+NxzO8rt+l1sVHi2BlRvPsIzs5bEaJqFgRdhCq1xZ3O QL0g== X-Gm-Message-State: AIkVDXJfGvQV6v4LTAQ/R/Qd7dZF8xcifp8Z4I75QQnlrqblojKOyzjLHDv9KQXp5qdvwxxwtsSEsDU/hboVWiCX X-Received: by 10.107.184.6 with SMTP id i6mr38217985iof.153.1484671250649; Tue, 17 Jan 2017 08:40:50 -0800 (PST) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.160.66 with HTTP; Tue, 17 Jan 2017 08:40:50 -0800 (PST) In-Reply-To: References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> From: Maxim Sobolev Date: Tue, 17 Jan 2017 08:40:50 -0800 X-Google-Sender-Auth: cVU9_SClQLh6pZfI_AA_47r1Xz0 Message-ID: Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Gleb Smirnoff 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: Tue, 17 Jan 2017 16:40:51 -0000 That being said, is there any other socket option value in there implemented as enum? I don't see anything obvious, so that I am curious if it would stick out as an odd one in there. What do you think? -Max On Tue, Jan 17, 2017 at 6:22 AM, Maxim Sobolev wrote: > Of course it's possible. Do you guys want me to amend that patch? > > -Max > > On Mon, Jan 16, 2017 at 10:52 PM, Gleb Smirnoff > wrote: > >> Hi! >> >> On Mon, Jan 16, 2017 at 05:46:38PM +0000, Maxim Sobolev wrote: >> M> Author: sobomax >> M> Date: Mon Jan 16 17:46:38 2017 >> M> New Revision: 312296 >> M> URL: https://svnweb.freebsd.org/changeset/base/312296 >> M> >> M> Log: >> M> Add a new socket option SO_TS_CLOCK to pick from several different >> clock >> M> sources to return timestamps when SO_TIMESTAMP is enabled. Two >> additional >> M> clock sources are: >> M> >> M> o nanosecond resolution realtime clock (equivalent of >> CLOCK_REALTIME); >> M> o nanosecond resolution monotonic clock (equivalent of >> CLOCK_MONOTONIC). >> M> >> M> In addition to this, this option provides unified interface to get >> bintime >> M> (equivalent of using SO_BINTIME), except it also supported with IPv6 >> where >> M> SO_BINTIME has never been supported. The long term plan is to >> depreciate >> M> SO_BINTIME and move everything to using SO_TS_CLOCK. >> M> >> M> Idea for this enhancement has been briefly discussed on the Net >> session >> M> during dev summit in Ottawa last June and the general input was >> positive. >> M> >> M> This change is believed to benefit network benchmarks/profiling as >> well >> M> as other scenarios where precise time of arrival measurement is >> necessary. >> M> >> M> There are two regression test cases as part of this commit: one >> extends unix >> M> domain test code (unix_cmsg) to test new SCM_XXX types and another >> one >> M> implementis totally new test case which exchanges UDP packets >> between two >> M> processes using both conventional methods (i.e. calling >> clock_gettime(2) >> M> before recv(2) and after send(2)), as well as using >> setsockopt()+recv() in >> M> receive path. The resulting delays are checked for sanity for all >> supported >> M> clock types. >> M> >> M> Reviewed by: adrian, gnn >> M> Differential Revision: https://reviews.freebsd.org/D9171 >> >> Is it possible to declare possible values as a enum and make so_ts_clock >> fields of that enum type? >> >> -- >> Totus tuus, Glebius. >> >> > From owner-svn-src-all@freebsd.org Tue Jan 17 16:57:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC79FCB4295 for ; Tue, 17 Jan 2017 16:57:57 +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 4AA171963 for ; Tue, 17 Jan 2017 16:57:56 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 15440b64-dcd6-11e6-9357-bffcd86bd944 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 15440b64-dcd6-11e6-9357-bffcd86bd944; Tue, 17 Jan 2017 16:57:53 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v0HGvgnA017712; Tue, 17 Jan 2017 09:57:42 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1484672262.86335.163.camel@freebsd.org> Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg From: Ian Lepore To: Maxim Sobolev , Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 17 Jan 2017 09:57:42 -0700 In-Reply-To: References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@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: Tue, 17 Jan 2017 16:57:57 -0000 In my experience, enums are a superior way to define integer constants (compared to #define), but they are pure poison as variable types in APIs and structures because their size is a compiler implementation choice. -- Ian On Tue, 2017-01-17 at 08:40 -0800, Maxim Sobolev wrote: > That being said, is there any other socket option value in there > implemented as enum? I don't see anything obvious, so that I am > curious if > it would stick out as an odd one in there. What do you think? > > -Max > > On Tue, Jan 17, 2017 at 6:22 AM, Maxim Sobolev > wrote: > > > > > Of course it's possible. Do you guys want me to amend that patch? > > > > -Max > > > > On Mon, Jan 16, 2017 at 10:52 PM, Gleb Smirnoff > g> > > wrote: > > > > > > > >   Hi! > > > > > > On Mon, Jan 16, 2017 at 05:46:38PM +0000, Maxim Sobolev wrote: > > > M> Author: sobomax > > > M> Date: Mon Jan 16 17:46:38 2017 > > > M> New Revision: 312296 > > > M> URL: https://svnweb.freebsd.org/changeset/base/312296 > > > M> > > > M> Log: > > > M>   Add a new socket option SO_TS_CLOCK to pick from several > > > different > > > clock > > > M>   sources to return timestamps when SO_TIMESTAMP is enabled. > > > Two > > > additional > > > M>   clock sources are: > > > M> > > > M>   o nanosecond resolution realtime clock (equivalent of > > > CLOCK_REALTIME); > > > M>   o nanosecond resolution monotonic clock (equivalent of > > > CLOCK_MONOTONIC). > > > M> > > > M>   In addition to this, this option provides unified interface > > > to get > > > bintime > > > M>   (equivalent of using SO_BINTIME), except it also supported > > > with IPv6 > > > where > > > M>   SO_BINTIME has never been supported. The long term plan is > > > to > > > depreciate > > > M>   SO_BINTIME and move everything to using SO_TS_CLOCK. > > > M> > > > M>   Idea for this enhancement has been briefly discussed on the > > > Net > > > session > > > M>   during dev summit in Ottawa last June and the general input > > > was > > > positive. > > > M> > > > M>   This change is believed to benefit network > > > benchmarks/profiling as > > > well > > > M>   as other scenarios where precise time of arrival measurement > > > is > > > necessary. > > > M> > > > M>   There are two regression test cases as part of this commit: > > > one > > > extends unix > > > M>   domain test code (unix_cmsg) to test new SCM_XXX types and > > > another > > > one > > > M>   implementis totally new test case which exchanges UDP > > > packets > > > between two > > > M>   processes using both conventional methods (i.e. calling > > > clock_gettime(2) > > > M>   before recv(2) and after send(2)), as well as using > > > setsockopt()+recv() in > > > M>   receive path. The resulting delays are checked for sanity > > > for all > > > supported > > > M>   clock types. > > > M> > > > M>   Reviewed by:    adrian, gnn > > > M>   Differential Revision:  https://reviews.freebsd.org/D9171 > > > > > > Is it possible to declare possible values as a enum and make > > > so_ts_clock > > > fields of that enum type? > > > > > > -- > > > Totus tuus, Glebius. > > > > > > From owner-svn-src-all@freebsd.org Tue Jan 17 17:32:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 898C5CB4089; Tue, 17 Jan 2017 17:32:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 646F5156E; Tue, 17 Jan 2017 17:32:42 +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 8307610A7DB; Tue, 17 Jan 2017 12:32:41 -0500 (EST) From: John Baldwin To: Bruce Evans Cc: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312205 - in head/sys: kern net Date: Tue, 17 Jan 2017 07:04:03 -0800 Message-ID: <2068311.SHO1HLFUnD@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20170117113927.E1043@besplex.bde.org> References: <201701150050.v0F0oAU8055428@repo.freebsd.org> <30935285.ropjfVExpa@ralph.baldwin.cx> <20170117113927.E1043@besplex.bde.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 17 Jan 2017 12:32:41 -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: Tue, 17 Jan 2017 17:32:42 -0000 On Tuesday, January 17, 2017 12:02:49 PM Bruce Evans wrote: > On Mon, 16 Jan 2017, John Baldwin wrote: > > > On Sunday, January 15, 2017 12:50:10 AM Sean Bruno wrote: > >> ... > >> Log: > >> Fix hangs in a uniprocessor configuration (qemu, virtualbox, real hw). > >> > >> sys/net/iflib.c: > >> Add ctx to filter_info and don't skpi interrupt early on unless we're on an > >> SMP system > > > > On an SMP system with EARLY_AP_STARTUP (default on x86) this code should > > never see smp_started as false anyway, so these checks should likely just > > be conditional on EARLY_AP_STARTUP (since that option will eventually go > > away). > > Ifdefs on EARLY_AP_STARTUP give strange results for the UP case (at least > for SMP with 1 CPU). First, the ifdef in sys/kernel.h moves SI_SUB_SMP > from late to early, although the CPU initialization order has not changed > when there is only 1 CPU. Then everything that uses SI_SUB_SMP is > reordered, and bugs in the new order show up even in the UP case. Most of the things that used to use SI_SUB_SMP no longer do (there is now a SI_SUB_LAST that many of those things use). > sys/gtaskqueue.h uses a complicated combination of EARLY_AP_STARTUP and > SI_SUB ifdefs to try to get the order right. I think the last commit to > it helps for the UP case but harms for the SMP case (both for the > !EARLY_AP_STARTUP case). Its code is simpler for the EARLY_AP_STARTUP > case. In the !EARLY_AP_STARTUP case, it has to split up the initialization > to delay calculations depending on the number of CPUs until after SMP > has started. The last commit to it seems to have turned the split into > nonsense by removing the delay. But in the UP case, the split is not > really necessary and removing the delay should help. > > EARLY_AP_STARTUP works badly here. It doesn't give a much faster startup > for the early part of the boot. Then it gives a much slower boot by > hanging for almost a minute waiting for USB or something. Starting all > the CPUs early also unimproves debugging by interleaving the boot messages > a bit. I use colorized console messages (with the color indexed by the > CPU). This makes interleaved messages quite readable and gives interesting > patterns when multiple CPUs are running. The interleaving I am aware of is from USB which starts its own kthreads during attach directly rather than using config_intrhook like other drivers which do bus exploration later in boot (e.g. all the SCSI devices). I tried to describe this to Hans but will probably just come up with a patch to change USB to use config_intrhook which might help. -- John Baldwin From owner-svn-src-all@freebsd.org Tue Jan 17 17:39:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFFCFCB4630; Tue, 17 Jan 2017 17:39:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B56E1F37; Tue, 17 Jan 2017 17:39:48 +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 AAF531FE025; Tue, 17 Jan 2017 18:39:30 +0100 (CET) Subject: Re: svn commit: r312205 - in head/sys: kern net To: John Baldwin , Bruce Evans References: <201701150050.v0F0oAU8055428@repo.freebsd.org> <30935285.ropjfVExpa@ralph.baldwin.cx> <20170117113927.E1043@besplex.bde.org> <2068311.SHO1HLFUnD@ralph.baldwin.cx> Cc: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <3981459d-c3ea-30ae-75d9-e4258817a427@selasky.org> Date: Tue, 17 Jan 2017 18:39:13 +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: <2068311.SHO1HLFUnD@ralph.baldwin.cx> 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: Tue, 17 Jan 2017 17:39:48 -0000 On 01/17/17 16:04, John Baldwin wrote: > Then it gives a much slower boot by >> hanging for almost a minute waiting for USB or something. Hi, This might be related to a bug in the timer init which I've observed too. Can you show output from: vmstat -i When the booting is slow? --HPS From owner-svn-src-all@freebsd.org Tue Jan 17 17:41:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A96F9CB4827; Tue, 17 Jan 2017 17:41:15 +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 7927E1173; Tue, 17 Jan 2017 17:41:15 +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 v0HHfE92062418; Tue, 17 Jan 2017 17:41:14 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HHfEZZ062417; Tue, 17 Jan 2017 17:41:14 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701171741.v0HHfEZZ062417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 17 Jan 2017 17:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312346 - head/sys/dev/sdhci 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, 17 Jan 2017 17:41:15 -0000 Author: loos Date: Tue Jan 17 17:41:14 2017 New Revision: 312346 URL: https://svnweb.freebsd.org/changeset/base/312346 Log: Set the the wp_disabled flag when asked to. While here, add the missing new line. MFC after: 3 days Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/sdhci/sdhci_fdt_gpio.c Modified: head/sys/dev/sdhci/sdhci_fdt_gpio.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt_gpio.c Tue Jan 17 16:20:21 2017 (r312345) +++ head/sys/dev/sdhci/sdhci_fdt_gpio.c Tue Jan 17 17:41:14 2017 (r312346) @@ -90,7 +90,7 @@ cd_setup(struct sdhci_fdt_gpio *gpio, ph gpio->slot->opt |= SDHCI_NON_REMOVABLE; gpio->cd_disabled = true; if (bootverbose) - device_printf(dev, "Non-removable media"); + device_printf(dev, "Non-removable media\n"); return; } @@ -177,8 +177,12 @@ wp_setup(struct sdhci_fdt_gpio *gpio, ph dev = gpio->dev; - if (OF_hasprop(node, "wp-disable")) + if (OF_hasprop(node, "wp-disable")) { + gpio->wp_disabled = true; + if (bootverbose) + device_printf(dev, "Write protect disabled\n"); return; + } if (gpio_pin_get_by_ofw_property(dev, node, "wp-gpios", &gpio->wp_pin)) return; From owner-svn-src-all@freebsd.org Tue Jan 17 17:48:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38A57CB4ADC; Tue, 17 Jan 2017 17:48:05 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot0-x235.google.com (mail-ot0-x235.google.com [IPv6:2607:f8b0:4003:c0f::235]) (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 EE82C18D3; Tue, 17 Jan 2017 17:48:04 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot0-x235.google.com with SMTP id f9so67637794otd.1; Tue, 17 Jan 2017 09:48:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=3GMi3WWM1kA5FJzq4UGkGp6R7BIf8z4u6m7pUev/h6g=; b=sPtGl2X7OWnIb2yirrpvDreNQrcP3bswxPip8VhaQsJkiFa0DEadaPO6mQAuigDofh eXmrpqONbnSvVxqmpGs5pCqMXFK5uyN13iK9fkAndzWAEXRq48Yos6UT20E1AlShOnIq 7rROhDqbvz0Rbumxot1BCJm/UkckrkHzLFjFbgERcW8AkVxdIZq1Tpu3fnmictJfAjw1 0KKeFEpMnkv93seMYkXtrVgFMBWtZAf1JW25Z1+T1tMd7JwYUsJRZ80rSi+kes0mPax2 rcJJkVUiGi7YvYxnF5cBc4jhAbFCcsD4QADuG81mtCaVFHEDT1YaNBwNmWlaJwcnJGsj QfCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=3GMi3WWM1kA5FJzq4UGkGp6R7BIf8z4u6m7pUev/h6g=; b=Ysma85BPByH9Z+kEwk1pMB5j/pVTfPUZnFRQS4hYIHXa+NwddN7HQ5kxyFFkKO4YtW S7YGVO0OdsUnwwsyq4w+kOiCrv2GTA1dHwd7+g+hsw5bfbRaz4myz7B+JjgNxn6WA1pi cmYYZ0D0nshHP2UKNG6yYkl5Khr3Q4+BbY5JjxG/WfKcYRIbTOKjlQaWYfWL2IJ3OYuD B0ELXGHgY7HHx/KkVnyOBxVLSEz38jquS8RGs3nCjEk/9Qu/Yoq+zB0HHktDkE0/hTjN cIqEAA5YKHBrPAzKJs3HzTzAKS2rL9QZqkx0pLLXGWZZ812+4eX6U7HxEUTE6HiQT5D/ Kwqw== X-Gm-Message-State: AIkVDXI+St3zlWJQ/8/Hzdb+iC+w2Mvpdeteor6EIUlJ9bz5OKmMTvSQd4S+tXqaoiqKc5xZ3I+Q5Hd8TuNVeA== X-Received: by 10.157.61.244 with SMTP id l107mr19550798otc.122.1484675284226; Tue, 17 Jan 2017 09:48:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.52.9 with HTTP; Tue, 17 Jan 2017 09:48:03 -0800 (PST) In-Reply-To: <1484672262.86335.163.camel@freebsd.org> References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> <1484672262.86335.163.camel@freebsd.org> From: Benjamin Kaduk Date: Tue, 17 Jan 2017 11:48:03 -0600 Message-ID: Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Ian Lepore Cc: Maxim Sobolev , Gleb Smirnoff , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@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: Tue, 17 Jan 2017 17:48:05 -0000 On Tue, Jan 17, 2017 at 10:57 AM, Ian Lepore wrote: > In my experience, enums are a superior way to define integer constants > (compared to #define), but they are pure poison as variable types in > APIs and structures because their size is a compiler implementation > choice. > Well, to some extent. For example, the amd64 sysV ABI says that enum types are signed fourbyte, with a footnote that "C++ and some implementations of C permit enums larger than an int. The underlying type is bumped to an unsigned int, long int or unsigned long int, in that order." -Ben From owner-svn-src-all@freebsd.org Tue Jan 17 18:04:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8297CB4537; Tue, 17 Jan 2017 18:04:14 +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 87ABF1687; Tue, 17 Jan 2017 18:04:14 +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 v0HI4DbH073942; Tue, 17 Jan 2017 18:04:13 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HI4D6G073941; Tue, 17 Jan 2017 18:04:13 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701171804.v0HI4D6G073941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Tue, 17 Jan 2017 18:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312347 - head/sys/boot/fdt/dts/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: Tue, 17 Jan 2017 18:04:14 -0000 Author: loos Date: Tue Jan 17 18:04:13 2017 New Revision: 312347 URL: https://svnweb.freebsd.org/changeset/base/312347 Log: The write-protect is not wired on uFW, disable it to allow writes to SD card. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/boot/fdt/dts/arm/ufw.dts Modified: head/sys/boot/fdt/dts/arm/ufw.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/ufw.dts Tue Jan 17 17:41:14 2017 (r312346) +++ head/sys/boot/fdt/dts/arm/ufw.dts Tue Jan 17 18:04:13 2017 (r312347) @@ -278,6 +278,7 @@ pinctrl-0 = <&mmc1_pins>; bus-width = <4>; non-removable; + wp-disable; status = "okay"; }; From owner-svn-src-all@freebsd.org Tue Jan 17 18:32:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B149CB306A; Tue, 17 Jan 2017 18:32:49 +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 28A0F1D2C; Tue, 17 Jan 2017 18:32:49 +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 v0HIWmSK086484; Tue, 17 Jan 2017 18:32:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HIWmjM086481; Tue, 17 Jan 2017 18:32:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701171832.v0HIWmjM086481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 17 Jan 2017 18:32:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312348 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jan 2017 18:32:49 -0000 Author: mav Date: Tue Jan 17 18:32:47 2017 New Revision: 312348 URL: https://svnweb.freebsd.org/changeset/base/312348 Log: Remove writing 'residual' field of struct ctl_scsiio. This field has no practical use and never readed. Initiators already receive respective residual size from frontends. Removed field had different semantics, which looks useless, and was never passed through by any frontend. While there, fix kern_data_resid field support in case of HA, missed in r312291. MFC after: 13 days Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_io.h head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Jan 17 18:04:13 2017 (r312347) +++ head/sys/cam/ctl/ctl.c Tue Jan 17 18:32:47 2017 (r312348) @@ -696,8 +696,6 @@ ctl_ha_done(union ctl_io *io) msg.scsi.tag_num = io->scsiio.tag_num; msg.scsi.tag_type = io->scsiio.tag_type; msg.scsi.sense_len = io->scsiio.sense_len; - msg.scsi.sense_residual = io->scsiio.sense_residual; - msg.scsi.residual = io->scsiio.residual; memcpy(&msg.scsi.sense_data, &io->scsiio.sense_data, io->scsiio.sense_len); ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg, @@ -725,8 +723,6 @@ ctl_isc_handler_finish_xfer(struct ctl_s ctsio->io_hdr.status = msg_info->hdr.status; ctsio->scsi_status = msg_info->scsi.scsi_status; ctsio->sense_len = msg_info->scsi.sense_len; - ctsio->sense_residual = msg_info->scsi.sense_residual; - ctsio->residual = msg_info->scsi.residual; memcpy(&ctsio->sense_data, &msg_info->scsi.sense_data, msg_info->scsi.sense_len); ctl_enqueue_isc((union ctl_io *)ctsio); @@ -1495,13 +1491,12 @@ ctl_isc_event_handler(ctl_ha_channel cha io->io_hdr.msg_type = CTL_MSG_DATAMOVE_DONE; io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG; io->io_hdr.flags |= CTL_FLAG_IO_ACTIVE; - io->io_hdr.port_status = msg->scsi.fetd_status; - io->scsiio.residual = msg->scsi.residual; + io->io_hdr.port_status = msg->scsi.port_status; + io->scsiio.kern_data_resid = msg->scsi.kern_data_resid; if (msg->hdr.status != CTL_STATUS_NONE) { io->io_hdr.status = msg->hdr.status; io->scsiio.scsi_status = msg->scsi.scsi_status; io->scsiio.sense_len = msg->scsi.sense_len; - io->scsiio.sense_residual =msg->scsi.sense_residual; memcpy(&io->scsiio.sense_data, &msg->scsi.sense_data, msg->scsi.sense_len); @@ -6498,15 +6493,8 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; switch (ctsio->cdb[0]) { case MODE_SENSE_6: { @@ -6850,15 +6838,8 @@ ctl_log_sense(struct ctl_scsiio *ctsio) ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; header = (struct scsi_log_header *)ctsio->kern_data_ptr; header->page = page_index->page_code; @@ -6913,7 +6894,6 @@ ctl_read_capacity(struct ctl_scsiio *cts ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data *)ctsio->kern_data_ptr; - ctsio->residual = 0; ctsio->kern_data_len = sizeof(*data); ctsio->kern_total_len = sizeof(*data); ctsio->kern_rel_offset = 0; @@ -6971,18 +6951,10 @@ ctl_read_capacity_16(struct ctl_scsiio * ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data_long *)ctsio->kern_data_ptr; - - if (sizeof(*data) < alloc_len) { - ctsio->residual = alloc_len - sizeof(*data); - ctsio->kern_data_len = sizeof(*data); - ctsio->kern_total_len = sizeof(*data); - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(sizeof(*data), alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; scsi_u64to8b(lun->be_lun->maxlba, data->addr); /* XXX KDM this may not be 512 bytes... */ @@ -7025,18 +6997,10 @@ ctl_get_lba_status(struct ctl_scsiio *ct total_len = sizeof(*data) + sizeof(data->descr[0]); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_get_lba_status_data *)ctsio->kern_data_ptr; - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* Fill dummy data in case backend can't tell anything. */ scsi_ulto4b(4 + sizeof(data->descr[0]), data->length); @@ -7087,17 +7051,10 @@ ctl_read_defect(struct ctl_scsiio *ctsio } ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; if (ctsio->cdb[0] == READ_DEFECT_DATA_10) { data10 = (struct scsi_read_defect_data_hdr_10 *) @@ -7182,19 +7139,10 @@ ctl_report_tagret_port_groups(struct ctl alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); - ctsio->kern_sg_entries = 0; - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; if (ext) { rtg_ext_ptr = (struct scsi_target_group_data_extended *) @@ -7382,19 +7330,10 @@ ctl_report_supported_opcodes(struct ctl_ alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); - ctsio->kern_sg_entries = 0; - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; switch (cdb->options & RSO_OPTIONS_MASK) { case RSO_OPTIONS_ALL: @@ -7495,19 +7434,10 @@ ctl_report_supported_tmf(struct ctl_scsi alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); - ctsio->kern_sg_entries = 0; - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; data = (struct scsi_report_supported_tmf_ext_data *)ctsio->kern_data_ptr; data->byte1 |= RST_ATS | RST_ATSS | RST_CTSS | RST_LURS | RST_QTS | @@ -7542,19 +7472,10 @@ ctl_report_timestamp(struct ctl_scsiio * alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); - ctsio->kern_sg_entries = 0; - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; data = (struct scsi_report_timestamp_data *)ctsio->kern_data_ptr; scsi_ulto2b(sizeof(*data) - 2, data->length); @@ -7615,19 +7536,10 @@ retry: mtx_unlock(&lun->lun_lock); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } - ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; mtx_lock(&lun->lun_lock); switch (cdb->action) { @@ -9174,18 +9086,10 @@ ctl_report_luns(struct ctl_scsiio *ctsio */ lun_datalen = sizeof(*lun_data) + (num_filled * sizeof(struct scsi_report_luns_lundata)); - - if (lun_datalen < alloc_len) { - ctsio->residual = alloc_len - lun_datalen; - ctsio->kern_data_len = lun_datalen; - ctsio->kern_total_len = lun_datalen; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(lun_datalen, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* * We set this to the actual data length, regardless of how much @@ -9236,19 +9140,16 @@ ctl_request_sense(struct ctl_scsiio *cts ctsio->kern_data_ptr = malloc(sizeof(*sense_ptr), M_CTL, M_WAITOK); sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; + ctsio->kern_rel_offset = 0; /* * struct scsi_sense_data, which is currently set to 256 bytes, is * larger than the largest allowed value for the length field in the * REQUEST SENSE CDB, which is 252 bytes as of SPC-4. */ - ctsio->residual = 0; ctsio->kern_data_len = cdb->length; ctsio->kern_total_len = cdb->length; - ctsio->kern_rel_offset = 0; - ctsio->kern_sg_entries = 0; - /* * If we don't have a LUN, we don't have any pending sense. */ @@ -9373,19 +9274,10 @@ ctl_inquiry_evpd_supported(struct ctl_sc SCSI_EVPD_NUM_SUPPORTED_PAGES; ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO); pages = (struct scsi_vpd_supported_pages *)ctsio->kern_data_ptr; - ctsio->kern_sg_entries = 0; - - if (sup_page_size < alloc_len) { - ctsio->residual = alloc_len - sup_page_size; - ctsio->kern_data_len = sup_page_size; - ctsio->kern_total_len = sup_page_size; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(sup_page_size, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* * The control device is always connected. The disk device, on the @@ -9443,17 +9335,10 @@ ctl_inquiry_evpd_serial(struct ctl_scsii data_len = 4 + CTL_SN_LEN; ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); sn_ptr = (struct scsi_vpd_unit_serial_number *)ctsio->kern_data_ptr; - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* * The control device is always connected. The disk device, on the @@ -9500,18 +9385,9 @@ ctl_inquiry_evpd_eid(struct ctl_scsiio * ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); eid_ptr = (struct scsi_vpd_extended_inquiry_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; - - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; - ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* * The control device is always connected. The disk device, on the @@ -9574,19 +9450,10 @@ ctl_inquiry_evpd_mpp(struct ctl_scsiio * ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); mpp_ptr = (struct scsi_vpd_mode_page_policy *)ctsio->kern_data_ptr; - ctsio->kern_sg_entries = 0; - - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* * The control device is always connected. The disk device, on the @@ -9639,18 +9506,10 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); devid_ptr = (struct scsi_vpd_device_id *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; - - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* * The control device is always connected. The disk device, on the @@ -9767,18 +9626,10 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); sp = (struct scsi_vpd_scsi_ports *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; - - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* * The control device is always connected. The disk device, on the @@ -9842,18 +9693,10 @@ ctl_inquiry_evpd_block_limits(struct ctl ctsio->kern_data_ptr = malloc(sizeof(*bl_ptr), M_CTL, M_WAITOK | M_ZERO); bl_ptr = (struct scsi_vpd_block_limits *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; - - if (sizeof(*bl_ptr) < alloc_len) { - ctsio->residual = alloc_len - sizeof(*bl_ptr); - ctsio->kern_data_len = sizeof(*bl_ptr); - ctsio->kern_total_len = sizeof(*bl_ptr); - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(sizeof(*bl_ptr), alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* * The control device is always connected. The disk device, on the @@ -9917,18 +9760,9 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * ctsio->kern_data_ptr = malloc(sizeof(*bdc_ptr), M_CTL, M_WAITOK | M_ZERO); bdc_ptr = (struct scsi_vpd_block_device_characteristics *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; - - if (sizeof(*bdc_ptr) < alloc_len) { - ctsio->residual = alloc_len - sizeof(*bdc_ptr); - ctsio->kern_data_len = sizeof(*bdc_ptr); - ctsio->kern_total_len = sizeof(*bdc_ptr); - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; - ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(sizeof(*bdc_ptr), alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* * The control device is always connected. The disk device, on the @@ -9973,18 +9807,9 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * ctsio->kern_data_ptr = malloc(sizeof(*lbp_ptr), M_CTL, M_WAITOK | M_ZERO); lbp_ptr = (struct scsi_vpd_logical_block_prov *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; - - if (sizeof(*lbp_ptr) < alloc_len) { - ctsio->residual = alloc_len - sizeof(*lbp_ptr); - ctsio->kern_data_len = sizeof(*lbp_ptr); - ctsio->kern_total_len = sizeof(*lbp_ptr); - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; - ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(sizeof(*lbp_ptr), alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* * The control device is always connected. The disk device, on the @@ -10118,16 +9943,8 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio inq_ptr = (struct scsi_inquiry_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; if (lun != NULL) { if ((lun->flags & CTL_LUN_PRIMARY_SC) || @@ -10511,15 +10328,8 @@ done: data_len = (uint8_t *)feature - (uint8_t *)hdr; } scsi_ulto4b(data_len - 4, hdr->data_length); - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; ctl_set_success(ctsio); ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; @@ -10550,16 +10360,8 @@ ctl_get_event_status(struct ctl_scsiio * ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; hdr = (struct scsi_get_event_status_header *)ctsio->kern_data_ptr; scsi_ulto2b(0, hdr->descr_length); @@ -10587,16 +10389,8 @@ ctl_mechanism_status(struct ctl_scsiio * ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; hdr = (struct scsi_mechanism_status_header *)ctsio->kern_data_ptr; hdr->state1 = 0x00; @@ -10646,16 +10440,8 @@ ctl_read_toc(struct ctl_scsiio *ctsio) ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; ctsio->kern_rel_offset = 0; - - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; hdr = (struct scsi_read_toc_hdr *)ctsio->kern_data_ptr; if (format == 0) { @@ -12647,15 +12433,14 @@ ctl_send_datamove_done(union ctl_io *io, msg.hdr.serializing_sc = io->io_hdr.serializing_sc; msg.hdr.nexus = io->io_hdr.nexus; msg.hdr.status = io->io_hdr.status; + msg.scsi.kern_data_resid = io->scsiio.kern_data_resid; msg.scsi.tag_num = io->scsiio.tag_num; msg.scsi.tag_type = io->scsiio.tag_type; msg.scsi.scsi_status = io->scsiio.scsi_status; memcpy(&msg.scsi.sense_data, &io->scsiio.sense_data, io->scsiio.sense_len); msg.scsi.sense_len = io->scsiio.sense_len; - msg.scsi.sense_residual = io->scsiio.sense_residual; - msg.scsi.fetd_status = io->io_hdr.port_status; - msg.scsi.residual = io->scsiio.residual; + msg.scsi.port_status = io->io_hdr.port_status; io->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE; if (io->io_hdr.flags & CTL_FLAG_FAILOVER) { ctl_failover_io(io, /*have_lock*/ have_lock); Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Tue Jan 17 18:04:13 2017 (r312347) +++ head/sys/cam/ctl/ctl_io.h Tue Jan 17 18:32:47 2017 (r312348) @@ -320,7 +320,7 @@ struct ctl_scsiio { uint8_t sense_len; /* Returned sense length */ uint8_t scsi_status; /* SCSI status byte */ uint8_t sense_residual; /* Unused. */ - uint32_t residual; /* data residual length */ + uint32_t residual; /* Unused */ uint32_t tag_num; /* tag number */ ctl_tag_type tag_type; /* simple, ordered, head of queue,etc.*/ uint8_t cdb_len; /* CDB length */ @@ -373,7 +373,7 @@ struct ctl_taskio { /* * HA link messages. */ -#define CTL_HA_VERSION 2 +#define CTL_HA_VERSION 3 /* * Used for CTL_MSG_LOGIN. @@ -469,7 +469,8 @@ struct ctl_ha_msg_dt { }; /* - * Used for CTL_MSG_SERIALIZE, CTL_MSG_FINISH_IO, CTL_MSG_BAD_JUJU. + * Used for CTL_MSG_SERIALIZE, CTL_MSG_FINISH_IO, CTL_MSG_BAD_JUJU, + * and CTL_MSG_DATAMOVE_DONE. */ struct ctl_ha_msg_scsi { struct ctl_ha_msg_hdr hdr; @@ -479,10 +480,9 @@ struct ctl_ha_msg_scsi { uint8_t cdb_len; /* CDB length */ uint8_t scsi_status; /* SCSI status byte */ uint8_t sense_len; /* Returned sense length */ - uint8_t sense_residual; /* sense residual length */ - uint32_t residual; /* data residual length */ - uint32_t fetd_status; /* trans status, set by FETD, + uint32_t port_status; /* trans status, set by FETD, 0 = good*/ + uint32_t kern_data_resid; /* for DATAMOVE_DONE */ struct scsi_sense_data sense_data; /* sense data */ }; Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Tue Jan 17 18:04:13 2017 (r312347) +++ head/sys/cam/ctl/ctl_tpc.c Tue Jan 17 18:32:47 2017 (r312348) @@ -282,19 +282,10 @@ ctl_inquiry_evpd_tpc(struct ctl_scsiio * ctsio->kern_data_ptr = malloc(data_len, M_CTL, M_WAITOK | M_ZERO); tpc_ptr = (struct scsi_vpd_tpc *)ctsio->kern_data_ptr; - ctsio->kern_sg_entries = 0; - - if (data_len < alloc_len) { - ctsio->residual = alloc_len - data_len; - ctsio->kern_data_len = data_len; - ctsio->kern_total_len = data_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; + ctsio->kern_data_len = min(data_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; /* * The control device is always connected. The disk device, on the @@ -457,19 +448,10 @@ ctl_receive_copy_operating_parameters(st alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); - ctsio->kern_sg_entries = 0; - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; data = (struct scsi_receive_copy_operating_parameters_data *)ctsio->kern_data_ptr; scsi_ulto4b(sizeof(*data) - 4 + 4, data->length); @@ -554,19 +536,10 @@ ctl_receive_copy_status_lid1(struct ctl_ alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); - ctsio->kern_sg_entries = 0; - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; data = (struct scsi_receive_copy_status_lid1_data *)ctsio->kern_data_ptr; scsi_ulto4b(sizeof(*data) - 4, data->available_data); @@ -631,19 +604,10 @@ ctl_receive_copy_failure_details(struct alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); - ctsio->kern_sg_entries = 0; - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; data = (struct scsi_receive_copy_failure_details_data *)ctsio->kern_data_ptr; if (list_copy.completed && (list_copy.error || list_copy.abort)) { @@ -702,19 +666,10 @@ ctl_receive_copy_status_lid4(struct ctl_ alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); - ctsio->kern_sg_entries = 0; - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; data = (struct scsi_receive_copy_status_lid4_data *)ctsio->kern_data_ptr; scsi_ulto4b(sizeof(*data) - 4 + list_copy.sense_len, @@ -2402,19 +2357,10 @@ ctl_receive_rod_token_information(struct alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); - ctsio->kern_sg_entries = 0; - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; data = (struct scsi_receive_copy_status_lid4_data *)ctsio->kern_data_ptr; scsi_ulto4b(sizeof(*data) - 4 + list_copy.sense_len + @@ -2482,19 +2428,10 @@ ctl_report_all_rod_tokens(struct ctl_scs alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); - ctsio->kern_sg_entries = 0; - - if (total_len < alloc_len) { - ctsio->residual = alloc_len - total_len; - ctsio->kern_data_len = total_len; - ctsio->kern_total_len = total_len; - } else { - ctsio->residual = 0; - ctsio->kern_data_len = alloc_len; - ctsio->kern_total_len = alloc_len; - } ctsio->kern_rel_offset = 0; + ctsio->kern_data_len = min(total_len, alloc_len); + ctsio->kern_total_len = ctsio->kern_data_len; data = (struct scsi_report_all_rod_tokens_data *)ctsio->kern_data_ptr; i = 0; From owner-svn-src-all@freebsd.org Tue Jan 17 19:19:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ED8ECB3E7D; Tue, 17 Jan 2017 19:19:31 +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 D2A5914E8; Tue, 17 Jan 2017 19:19:30 +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 v0HJJTJc002910; Tue, 17 Jan 2017 19:19:29 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HJJTe9002907; Tue, 17 Jan 2017 19:19:29 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201701171919.v0HJJTe9002907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 17 Jan 2017 19:19:29 +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: r312349 - in stable/11/sys/boot/efi: . loader/arch/arm 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, 17 Jan 2017 19:19:31 -0000 Author: gonzo Date: Tue Jan 17 19:19:29 2017 New Revision: 312349 URL: https://svnweb.freebsd.org/changeset/base/312349 Log: MFC r311888, r311890-r311891 r311888: [efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start __bss_end should not be included in .bss zeroing code. Otherwise first 4 bytes of the section that follows .bss (in loader's case it's .sdata) are overwritten by zero. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D9108 r311890: [efi] Fix .rel.data.* being erroneously merged into .data on ARM Fix section pattern code to exclude .rel.data.* sections from being merged into .data. Otherwise relocations in those sections are lost in final binary Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D9108 r311891: [efi] Build EFI bits with -fPIC on ARM clang 3.9.0 without -fPIC generates absolute jump table for switch/case statement which trips boot1.efi and loader.efi on ARM platform. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D9108 Modified: stable/11/sys/boot/efi/Makefile.inc stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm stable/11/sys/boot/efi/loader/arch/arm/start.S Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/efi/Makefile.inc ============================================================================== --- stable/11/sys/boot/efi/Makefile.inc Tue Jan 17 18:32:47 2017 (r312348) +++ stable/11/sys/boot/efi/Makefile.inc Tue Jan 17 19:19:29 2017 (r312349) @@ -22,4 +22,8 @@ CFLAGS+= -mno-aes CFLAGS+= -fshort-wchar .endif +.if ${MACHINE_CPUARCH} == "arm" +CFLAGS+= -fPIC +.endif + .include "../Makefile.inc" Modified: stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm ============================================================================== --- stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm Tue Jan 17 18:32:47 2017 (r312348) +++ stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm Tue Jan 17 19:19:29 2017 (r312349) @@ -18,7 +18,7 @@ SECTIONS . = ALIGN(16); .data : { - *(.data *.data.*) + *(.data .data.*) *(.gnu.linkonce.d*) *(.rodata) *(.rodata.*) Modified: stable/11/sys/boot/efi/loader/arch/arm/start.S ============================================================================== --- stable/11/sys/boot/efi/loader/arch/arm/start.S Tue Jan 17 18:32:47 2017 (r312348) +++ stable/11/sys/boot/efi/loader/arch/arm/start.S Tue Jan 17 19:19:29 2017 (r312349) @@ -161,7 +161,7 @@ _start: mov r2, #0 1: cmp r0, r1 - bgt 2f + bge 2f str r2, [r0], #4 b 1b 2: From owner-svn-src-all@freebsd.org Tue Jan 17 19:37:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8C49CB4717; Tue, 17 Jan 2017 19:37:35 +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 BB34B149D; Tue, 17 Jan 2017 19:37:35 +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 A81F656483; Tue, 17 Jan 2017 13:37:28 -0600 (CST) Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Benjamin Kaduk , Ian Lepore References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> <1484672262.86335.163.camel@freebsd.org> Cc: Maxim Sobolev , Gleb Smirnoff , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" From: Eric van Gyzen Message-ID: Date: Tue, 17 Jan 2017 13:37:27 -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: 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: Tue, 17 Jan 2017 19:37:36 -0000 On 01/17/2017 11:48, Benjamin Kaduk wrote: > On Tue, Jan 17, 2017 at 10:57 AM, Ian Lepore > wrote: > > In my experience, enums are a superior way to define integer constants > (compared to #define), but they are pure poison as variable types in > APIs and structures because their size is a compiler implementation > choice. > > > Well, to some extent. For example, the amd64 sysV ABI says that enum > types are signed fourbyte, with a footnote that "C++ and some > implementations of C permit enums larger than an int. The underlying > type is bumped to an unsigned int, long int or unsigned long int, in > that order." And in C++11 and later, you can specify the exact type: enum color #if defined(__cplusplus) && __cplusplus >= 201103L : int #endif { blue, ... Eric From owner-svn-src-all@freebsd.org Tue Jan 17 20:31:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81435CB40EC; Tue, 17 Jan 2017 20:31:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 0AC561A61; Tue, 17 Jan 2017 20:31:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA03181; Tue, 17 Jan 2017 22:31:30 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1cTaPh-000PJF-Ju; Tue, 17 Jan 2017 22:31:29 +0200 Subject: Re: svn commit: r312236 - head/sys/net80211 To: Adrian Chadd , Ian Lepore References: <201701151949.v0FJnl2h027169@repo.freebsd.org> <1484510213.86335.110.camel@freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Andriy Gapon Message-ID: <0c2cb416-9d33-3d50-95be-c84154c11797@FreeBSD.org> Date: Tue, 17 Jan 2017 22:30:07 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: 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: Tue, 17 Jan 2017 20:31:42 -0000 On 15/01/2017 22:43, Adrian Chadd wrote: > On 15 January 2017 at 11:56, Ian Lepore wrote: > >> >> What is the point of the !! in these macros? The expressions already >> have boolean type (even in C++ where it matters) due to the ==. >> Removing the !! would also make one level of parens redundant. > > It's just a habit i picked up from linux-land. That way it really is > only 1 or 0, so things like debugging output and such make easier > sense. Well, that habit is useful when applied to results of bit-wise operations. It does nothing but obfuscating the code when applied to results of logical operations. Which is the case here. And even with the bit-wise operation we have a FreeBSD idiom of comparing the result with zero using != 0. More verbose, but also more stylish. > It's also fixed a handful of bugs in the past (but I can't think of > exact cases right now) - primarily where other code expected 1 or 0 > (for things like shifts into protocol fields) and the macro returns 0 > or ${LARGEVAL}. -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Jan 17 21:12:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA15DCB4D12; Tue, 17 Jan 2017 21:12:22 +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 7948311FF; Tue, 17 Jan 2017 21:12:22 +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 v0HLCLTT051100; Tue, 17 Jan 2017 21:12:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HLCLEb051099; Tue, 17 Jan 2017 21:12:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201701172112.v0HLCLEb051099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 17 Jan 2017 21:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312350 - 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, 17 Jan 2017 21:12:22 -0000 Author: bdrewery Date: Tue Jan 17 21:12:21 2017 New Revision: 312350 URL: https://svnweb.freebsd.org/changeset/base/312350 Log: Don't compute MPATH during install. This saves time when building over NFS. Nothing should be building during this phase anyhow. Sponsored by: Dell EMC Isilon Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Jan 17 19:19:29 2017 (r312349) +++ head/sys/conf/kern.pre.mk Tue Jan 17 21:12:21 2017 (r312350) @@ -192,7 +192,7 @@ SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symb SYSTEM_DEP+= ${LDSCRIPT} # Calculate path for .m files early, if needed. -.if !defined(NO_MODULES) && !defined(__MPATH) +.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) __MPATH!=find ${S:tA}/ -name \*_if.m .endif From owner-svn-src-all@freebsd.org Tue Jan 17 21:27:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3011CB5491; Tue, 17 Jan 2017 21:27:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A66C1BE9; Tue, 17 Jan 2017 21:27:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v0HLREnW052299 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 17 Jan 2017 13:27:14 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v0HLRE6M052298; Tue, 17 Jan 2017 13:27:14 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 17 Jan 2017 13:27:14 -0800 From: Gleb Smirnoff To: Maxim Sobolev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg Message-ID: <20170117212713.GZ2611@FreeBSD.org> References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 17 Jan 2017 21:27:15 -0000 On Tue, Jan 17, 2017 at 08:40:50AM -0800, Maxim Sobolev wrote: M> That being said, is there any other socket option value in there M> implemented as enum? I don't see anything obvious, so that I am curious if M> it would stick out as an odd one in there. What do you think? Simply because 30 years ago the language didn't allow that, and later additions mimiced the older sockopts. We need to break this loop :) -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Tue Jan 17 21:34:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 283FECB5890 for ; Tue, 17 Jan 2017 21:34:35 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (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 E235014AE for ; Tue, 17 Jan 2017 21:34:34 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-it0-x22f.google.com with SMTP id k200so15135530itb.1 for ; Tue, 17 Jan 2017 13:34:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=an+zzmbcc4NXJ9RHhd0Ukxlry+sRFIqg43GVtGpsrB4=; b=EUHDXzq+QXeQXwvd7DU37umFMQ7pLodka1UVrrN8F4/rzRJ4su/eics8W9009V1Bpv PheT/ACQDDDPwIDXPxXQguGz/zSsVMPDv5rhIDw0nuCnEE4oSLkzLodMA5fEi0kka/jn D1ekiO6CbAVyGxFZtDd48nXXzy2xnPrFfWe2Um8lcCol2Q4x3F/hCBUVQqbq7TrByv0e qBM7qUjrqWrY8gUbYt/nD0vu7ojzH4QphoY9h7UKQrqYdAlH59H8j96HlIBGawzzGwyY 9NKGpQn+U6+8UqbeVBXDButVlsfRd5g5kPtyKmhNpwgM+6cPEIVVNn91GYc/otuUjY3r JT5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=an+zzmbcc4NXJ9RHhd0Ukxlry+sRFIqg43GVtGpsrB4=; b=SVFvz1NpTkpjEluMXSJ5rfGgf/DBZpVp0RfhgijHB0y9XZ3kieViB4PgnfLrmDpEj4 htD0Pd9heiXfi/YN9HFwlXuDS4wmwQGz1N/pqGfcp3jnpiUiQFA7d4Npultzw5bInrE7 2ZGeTG+GVuLFnjEEUpixEMpP0vWuixAZDQPQEAHn2/X6Q5ugHkLjphQTD0c12tcvydev YQ9eycv7cuwdu97yEliS4b1oIYC6YGqxcM/WelCPagcw7XvbnrE94r0/2cbQw2vg4f41 n6mIhn7GpcGa2S3s1Zxh7Ekxpg1eJBydA+FJh4JfTGSJ1ZxfhC7cyozF842AY1K2nTfo mn2Q== X-Gm-Message-State: AIkVDXLlbSmC0WnsExDqVN6UmeJ17Q0MrnILL0HULDc6SAZFk0VH+Kee/7xK9pokWL8UQ8XD13V3EFkI4KBZqHDO X-Received: by 10.36.13.195 with SMTP id 186mr23031794itx.22.1484688874169; Tue, 17 Jan 2017 13:34:34 -0800 (PST) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.160.66 with HTTP; Tue, 17 Jan 2017 13:34:33 -0800 (PST) In-Reply-To: <20170117212713.GZ2611@FreeBSD.org> References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> <20170117212713.GZ2611@FreeBSD.org> From: Maxim Sobolev Date: Tue, 17 Jan 2017 13:34:33 -0800 X-Google-Sender-Auth: bh6V8wlG4fGk3t-ngmI9rsF18TM Message-ID: Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Gleb Smirnoff 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: Tue, 17 Jan 2017 21:34:35 -0000 Well as other pointed out there are some concerns with using enums from C++ and ABI prospective. So it looks to me that there is no general consensus on that direction. -Max On Tue, Jan 17, 2017 at 1:27 PM, Gleb Smirnoff wrote: > On Tue, Jan 17, 2017 at 08:40:50AM -0800, Maxim Sobolev wrote: > M> That being said, is there any other socket option value in there > M> implemented as enum? I don't see anything obvious, so that I am curious > if > M> it would stick out as an odd one in there. What do you think? > > Simply because 30 years ago the language didn't allow that, and later > additions mimiced the older sockopts. We need to break this loop :) > > -- > Totus tuus, Glebius. > > From owner-svn-src-all@freebsd.org Tue Jan 17 22:01:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 594A8CB42CC; Tue, 17 Jan 2017 22:01:34 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 286CE1A7E; Tue, 17 Jan 2017 22:01:34 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0HM1XFc068151; Tue, 17 Jan 2017 22:01:33 GMT (envelope-from lifanov@FreeBSD.org) Received: (from lifanov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HM1XfW068150; Tue, 17 Jan 2017 22:01:33 GMT (envelope-from lifanov@FreeBSD.org) Message-Id: <201701172201.v0HM1XfW068150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lifanov set sender to lifanov@FreeBSD.org using -f From: Nikolai Lifanov Date: Tue, 17 Jan 2017 22:01: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: r312351 - stable/11/sys/dev/kbd 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, 17 Jan 2017 22:01:34 -0000 Author: lifanov (ports committer) Date: Tue Jan 17 22:01:33 2017 New Revision: 312351 URL: https://svnweb.freebsd.org/changeset/base/312351 Log: MFC r311650 Restore priority value for OGIO_KEYMAP PR: 206678 Submitted by: ecturt@gmail.com Reviewed by: cem Approved by: cem, matthew (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5095 Modified: stable/11/sys/dev/kbd/kbd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/kbd/kbd.c ============================================================================== --- stable/11/sys/dev/kbd/kbd.c Tue Jan 17 21:12:21 2017 (r312350) +++ stable/11/sys/dev/kbd/kbd.c Tue Jan 17 22:01:33 2017 (r312351) @@ -884,7 +884,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo omapp->key[i].spcl = mapp->key[i].spcl; omapp->key[i].flgs = mapp->key[i].flgs; } - return (0); + break; case PIO_KEYMAP: /* set keyboard translation table */ case OPIO_KEYMAP: /* set keyboard translation table (compat) */ #ifndef KBD_DISABLE_KEYMAP_LOAD From owner-svn-src-all@freebsd.org Tue Jan 17 22:02:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A98C0CB44B8; Tue, 17 Jan 2017 22:02:23 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78AA41CB1; Tue, 17 Jan 2017 22:02:23 +0000 (UTC) (envelope-from lifanov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0HM2M6S071241; Tue, 17 Jan 2017 22:02:22 GMT (envelope-from lifanov@FreeBSD.org) Received: (from lifanov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HM2MMj071240; Tue, 17 Jan 2017 22:02:22 GMT (envelope-from lifanov@FreeBSD.org) Message-Id: <201701172202.v0HM2MMj071240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lifanov set sender to lifanov@FreeBSD.org using -f From: Nikolai Lifanov Date: Tue, 17 Jan 2017 22:02:22 +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: r312352 - stable/10/sys/dev/kbd 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: Tue, 17 Jan 2017 22:02:23 -0000 Author: lifanov (ports committer) Date: Tue Jan 17 22:02:22 2017 New Revision: 312352 URL: https://svnweb.freebsd.org/changeset/base/312352 Log: MFC r311650 Restore priority value for OGIO_KEYMAP PR: 206678 Submitted by: ecturt@gmail.com Reviewed by: cem Approved by: cem, matthew (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5095 Modified: stable/10/sys/dev/kbd/kbd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/kbd/kbd.c ============================================================================== --- stable/10/sys/dev/kbd/kbd.c Tue Jan 17 22:01:33 2017 (r312351) +++ stable/10/sys/dev/kbd/kbd.c Tue Jan 17 22:02:22 2017 (r312352) @@ -884,7 +884,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo omapp->key[i].spcl = mapp->key[i].spcl; omapp->key[i].flgs = mapp->key[i].flgs; } - return (0); + break; case PIO_KEYMAP: /* set keyboard translation table */ case OPIO_KEYMAP: /* set keyboard translation table (compat) */ #ifndef KBD_DISABLE_KEYMAP_LOAD From owner-svn-src-all@freebsd.org Tue Jan 17 22:03:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0197FCB456F; Tue, 17 Jan 2017 22:03:10 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2F571E37; Tue, 17 Jan 2017 22:03:09 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0HM38kU071333; Tue, 17 Jan 2017 22:03:08 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HM38bC071327; Tue, 17 Jan 2017 22:03:08 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201701172203.v0HM38bC071327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 17 Jan 2017 22:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312353 - head/sys/contrib/cloudabi 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, 17 Jan 2017 22:03:10 -0000 Author: ed Date: Tue Jan 17 22:03:08 2017 New Revision: 312353 URL: https://svnweb.freebsd.org/changeset/base/312353 Log: Sync in the latest CloudABI generated source files. Languages like C++17 and Go provide direct support for slice types: pointer/length pairs. The CloudABI generator now has more complete for this, meaning that for the C binding, pointer/length pairs now use an automatic naming scheme of ${name} and ${name}_len. Apart from this change and some reformatting, the ABI definitions are identical. Binary compatibility is preserved entirely. Modified: head/sys/contrib/cloudabi/cloudabi32_types.h head/sys/contrib/cloudabi/cloudabi64_types.h head/sys/contrib/cloudabi/cloudabi_types_common.h head/sys/contrib/cloudabi/syscalls32.master head/sys/contrib/cloudabi/syscalls64.master Modified: head/sys/contrib/cloudabi/cloudabi32_types.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi32_types.h Tue Jan 17 22:02:22 2017 (r312352) +++ head/sys/contrib/cloudabi/cloudabi32_types.h Tue Jan 17 22:03:08 2017 (r312353) @@ -44,11 +44,11 @@ _Static_assert(sizeof(cloudabi32_auxv_t) _Static_assert(_Alignof(cloudabi32_auxv_t) == 4, "Incorrect layout"); typedef struct { - _Alignas(4) uint32_t iov_base; - _Alignas(4) uint32_t iov_len; + _Alignas(4) uint32_t buf; + _Alignas(4) uint32_t buf_len; } cloudabi32_ciovec_t; -_Static_assert(offsetof(cloudabi32_ciovec_t, iov_base) == 0, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_ciovec_t, iov_len) == 4, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_ciovec_t, buf) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_ciovec_t, buf_len) == 4, "Incorrect layout"); _Static_assert(sizeof(cloudabi32_ciovec_t) == 8, "Incorrect layout"); _Static_assert(_Alignof(cloudabi32_ciovec_t) == 4, "Incorrect layout"); @@ -94,11 +94,11 @@ _Static_assert(sizeof(cloudabi32_event_t _Static_assert(_Alignof(cloudabi32_event_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(4) uint32_t iov_base; - _Alignas(4) uint32_t iov_len; + _Alignas(4) uint32_t buf; + _Alignas(4) uint32_t buf_len; } cloudabi32_iovec_t; -_Static_assert(offsetof(cloudabi32_iovec_t, iov_base) == 0, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_iovec_t, iov_len) == 4, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_iovec_t, buf) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_iovec_t, buf_len) == 4, "Incorrect layout"); _Static_assert(sizeof(cloudabi32_iovec_t) == 8, "Incorrect layout"); _Static_assert(_Alignof(cloudabi32_iovec_t) == 4, "Incorrect layout"); @@ -106,30 +106,30 @@ typedef void cloudabi32_processentry_t(u typedef struct { _Alignas(4) uint32_t ri_data; - _Alignas(4) uint32_t ri_datalen; + _Alignas(4) uint32_t ri_data_len; _Alignas(4) uint32_t ri_fds; - _Alignas(4) uint32_t ri_fdslen; + _Alignas(4) uint32_t ri_fds_len; _Alignas(2) cloudabi_msgflags_t ri_flags; } cloudabi32_recv_in_t; _Static_assert(offsetof(cloudabi32_recv_in_t, ri_data) == 0, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_recv_in_t, ri_datalen) == 4, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_recv_in_t, ri_data_len) == 4, "Incorrect layout"); _Static_assert(offsetof(cloudabi32_recv_in_t, ri_fds) == 8, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_recv_in_t, ri_fdslen) == 12, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_recv_in_t, ri_fds_len) == 12, "Incorrect layout"); _Static_assert(offsetof(cloudabi32_recv_in_t, ri_flags) == 16, "Incorrect layout"); _Static_assert(sizeof(cloudabi32_recv_in_t) == 20, "Incorrect layout"); _Static_assert(_Alignof(cloudabi32_recv_in_t) == 4, "Incorrect layout"); typedef struct { _Alignas(4) uint32_t si_data; - _Alignas(4) uint32_t si_datalen; + _Alignas(4) uint32_t si_data_len; _Alignas(4) uint32_t si_fds; - _Alignas(4) uint32_t si_fdslen; + _Alignas(4) uint32_t si_fds_len; _Alignas(2) cloudabi_msgflags_t si_flags; } cloudabi32_send_in_t; _Static_assert(offsetof(cloudabi32_send_in_t, si_data) == 0, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_send_in_t, si_datalen) == 4, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_send_in_t, si_data_len) == 4, "Incorrect layout"); _Static_assert(offsetof(cloudabi32_send_in_t, si_fds) == 8, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_send_in_t, si_fdslen) == 12, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_send_in_t, si_fds_len) == 12, "Incorrect layout"); _Static_assert(offsetof(cloudabi32_send_in_t, si_flags) == 16, "Incorrect layout"); _Static_assert(sizeof(cloudabi32_send_in_t) == 20, "Incorrect layout"); _Static_assert(_Alignof(cloudabi32_send_in_t) == 4, "Incorrect layout"); @@ -219,12 +219,12 @@ _Static_assert(_Alignof(cloudabi32_recv_ typedef struct { _Alignas(4) uint32_t entry_point; _Alignas(4) uint32_t stack; - _Alignas(4) uint32_t stack_size; + _Alignas(4) uint32_t stack_len; _Alignas(4) uint32_t argument; } cloudabi32_threadattr_t; _Static_assert(offsetof(cloudabi32_threadattr_t, entry_point) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi32_threadattr_t, stack) == 4, "Incorrect layout"); -_Static_assert(offsetof(cloudabi32_threadattr_t, stack_size) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi32_threadattr_t, stack_len) == 8, "Incorrect layout"); _Static_assert(offsetof(cloudabi32_threadattr_t, argument) == 12, "Incorrect layout"); _Static_assert(sizeof(cloudabi32_threadattr_t) == 16, "Incorrect layout"); _Static_assert(_Alignof(cloudabi32_threadattr_t) == 4, "Incorrect layout"); Modified: head/sys/contrib/cloudabi/cloudabi64_types.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi64_types.h Tue Jan 17 22:02:22 2017 (r312352) +++ head/sys/contrib/cloudabi/cloudabi64_types.h Tue Jan 17 22:03:08 2017 (r312353) @@ -44,12 +44,11 @@ _Static_assert(sizeof(cloudabi64_auxv_t) _Static_assert(_Alignof(cloudabi64_auxv_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) uint64_t iov_base; - _Alignas(8) uint64_t iov_len; + _Alignas(8) uint64_t buf; + _Alignas(8) uint64_t buf_len; } cloudabi64_ciovec_t; -_Static_assert(offsetof(cloudabi64_ciovec_t, iov_base) == 0, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_ciovec_t, iov_len) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_ciovec_t, buf) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_ciovec_t, buf_len) == 8, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_ciovec_t) == 16, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_ciovec_t) == 8, "Incorrect layout"); @@ -82,33 +81,24 @@ typedef struct { _Static_assert(offsetof(cloudabi64_event_t, userdata) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi64_event_t, error) == 8, "Incorrect layout"); _Static_assert(offsetof(cloudabi64_event_t, type) == 10, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24, - "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_event_t) == 32, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_event_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) uint64_t iov_base; - _Alignas(8) uint64_t iov_len; + _Alignas(8) uint64_t buf; + _Alignas(8) uint64_t buf_len; } cloudabi64_iovec_t; -_Static_assert(offsetof(cloudabi64_iovec_t, iov_base) == 0, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_iovec_t, iov_len) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_iovec_t, buf) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_iovec_t, buf_len) == 8, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_iovec_t) == 16, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_iovec_t) == 8, "Incorrect layout"); @@ -116,47 +106,38 @@ typedef void cloudabi64_processentry_t(u typedef struct { _Alignas(8) uint64_t ri_data; - _Alignas(8) uint64_t ri_datalen; + _Alignas(8) uint64_t ri_data_len; _Alignas(8) uint64_t ri_fds; - _Alignas(8) uint64_t ri_fdslen; + _Alignas(8) uint64_t ri_fds_len; _Alignas(2) cloudabi_msgflags_t ri_flags; } cloudabi64_recv_in_t; -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_datalen) == 8, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fdslen) == 24, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32, - "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data_len) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds_len) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_recv_in_t) == 40, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_recv_in_t) == 8, "Incorrect layout"); typedef struct { _Alignas(8) uint64_t si_data; - _Alignas(8) uint64_t si_datalen; + _Alignas(8) uint64_t si_data_len; _Alignas(8) uint64_t si_fds; - _Alignas(8) uint64_t si_fdslen; + _Alignas(8) uint64_t si_fds_len; _Alignas(2) cloudabi_msgflags_t si_flags; } cloudabi64_send_in_t; -_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_datalen) == 8, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_fds) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_fdslen) == 24, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_flags) == 32, - "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_data_len) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_fds) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_fds_len) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_flags) == 32, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_send_in_t) == 40, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_send_in_t) == 8, "Incorrect layout"); -typedef struct { _Alignas(8) uint64_t so_datalen; } cloudabi64_send_out_t; -_Static_assert(offsetof(cloudabi64_send_out_t, so_datalen) == 0, - "Incorrect layout"); +typedef struct { + _Alignas(8) uint64_t so_datalen; +} cloudabi64_send_out_t; +_Static_assert(offsetof(cloudabi64_send_out_t, so_datalen) == 0, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_send_out_t) == 8, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_send_out_t) == 8, "Incorrect layout"); @@ -191,44 +172,29 @@ typedef struct { } proc_terminate; }; } cloudabi64_subscription_t; -_Static_assert(offsetof(cloudabi64_subscription_t, userdata) == 0, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, flags) == 8, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, type) == 10, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, clock.identifier) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, clock.clock_id) == 24, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, clock.timeout) == 32, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, clock.precision) == 40, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, clock.flags) == 48, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock) == 24, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar_scope) == 32, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock_scope) == 33, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.fd) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.flags) == 20, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock_scope) == 24, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_subscription_t, proc_terminate.fd) == 16, - "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, userdata) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, flags) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, type) == 10, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, clock.identifier) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, clock.clock_id) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, clock.timeout) == 32, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, clock.precision) == 40, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, clock.flags) == 48, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, condvar.condvar_scope) == 32, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, condvar.lock_scope) == 33, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.fd) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, fd_readwrite.flags) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, lock.lock_scope) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_subscription_t, proc_terminate.fd) == 16, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_subscription_t) == 56, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_subscription_t) == 8, "Incorrect layout"); -typedef struct { _Alignas(8) uint64_t parent; } cloudabi64_tcb_t; +typedef struct { + _Alignas(8) uint64_t parent; +} cloudabi64_tcb_t; _Static_assert(offsetof(cloudabi64_tcb_t, parent) == 0, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_tcb_t) == 8, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_tcb_t) == 8, "Incorrect layout"); @@ -242,33 +208,24 @@ typedef struct { _Alignas(2) cloudabi_sockaddr_t ro_peername; _Alignas(2) cloudabi_msgflags_t ro_flags; } cloudabi64_recv_out_t; -_Static_assert(offsetof(cloudabi64_recv_out_t, ro_datalen) == 0, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_out_t, ro_fdslen) == 8, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_out_t, ro_sockname) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_out_t, ro_peername) == 36, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_out_t, ro_flags) == 56, - "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_out_t, ro_datalen) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_out_t, ro_fdslen) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_out_t, ro_sockname) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_out_t, ro_peername) == 36, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_out_t, ro_flags) == 56, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_recv_out_t) == 64, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_recv_out_t) == 8, "Incorrect layout"); typedef struct { _Alignas(8) uint64_t entry_point; _Alignas(8) uint64_t stack; - _Alignas(8) uint64_t stack_size; + _Alignas(8) uint64_t stack_len; _Alignas(8) uint64_t argument; } cloudabi64_threadattr_t; -_Static_assert(offsetof(cloudabi64_threadattr_t, entry_point) == 0, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_threadattr_t, stack) == 8, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_threadattr_t, stack_size) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_threadattr_t, argument) == 24, - "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_threadattr_t, entry_point) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_threadattr_t, stack) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_threadattr_t, stack_len) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_threadattr_t, argument) == 24, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_threadattr_t) == 32, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_threadattr_t) == 8, "Incorrect layout"); Modified: head/sys/contrib/cloudabi/cloudabi_types_common.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi_types_common.h Tue Jan 17 22:02:22 2017 (r312352) +++ head/sys/contrib/cloudabi/cloudabi_types_common.h Tue Jan 17 22:03:08 2017 (r312353) @@ -38,34 +38,34 @@ #endif typedef uint8_t cloudabi_advice_t; -#define CLOUDABI_ADVICE_DONTNEED 1 -#define CLOUDABI_ADVICE_NOREUSE 2 -#define CLOUDABI_ADVICE_NORMAL 3 -#define CLOUDABI_ADVICE_RANDOM 4 +#define CLOUDABI_ADVICE_DONTNEED 1 +#define CLOUDABI_ADVICE_NOREUSE 2 +#define CLOUDABI_ADVICE_NORMAL 3 +#define CLOUDABI_ADVICE_RANDOM 4 #define CLOUDABI_ADVICE_SEQUENTIAL 5 -#define CLOUDABI_ADVICE_WILLNEED 6 +#define CLOUDABI_ADVICE_WILLNEED 6 typedef uint32_t cloudabi_auxtype_t; -#define CLOUDABI_AT_ARGDATA 256 -#define CLOUDABI_AT_ARGDATALEN 257 -#define CLOUDABI_AT_BASE 7 -#define CLOUDABI_AT_CANARY 258 -#define CLOUDABI_AT_CANARYLEN 259 -#define CLOUDABI_AT_NCPUS 260 -#define CLOUDABI_AT_NULL 0 -#define CLOUDABI_AT_PAGESZ 6 -#define CLOUDABI_AT_PHDR 3 -#define CLOUDABI_AT_PHNUM 4 +#define CLOUDABI_AT_ARGDATA 256 +#define CLOUDABI_AT_ARGDATALEN 257 +#define CLOUDABI_AT_BASE 7 +#define CLOUDABI_AT_CANARY 258 +#define CLOUDABI_AT_CANARYLEN 259 +#define CLOUDABI_AT_NCPUS 260 +#define CLOUDABI_AT_NULL 0 +#define CLOUDABI_AT_PAGESZ 6 +#define CLOUDABI_AT_PHDR 3 +#define CLOUDABI_AT_PHNUM 4 #define CLOUDABI_AT_SYSINFO_EHDR 262 -#define CLOUDABI_AT_TID 261 +#define CLOUDABI_AT_TID 261 typedef uint32_t cloudabi_backlog_t; typedef uint32_t cloudabi_clockid_t; -#define CLOUDABI_CLOCK_MONOTONIC 1 +#define CLOUDABI_CLOCK_MONOTONIC 1 #define CLOUDABI_CLOCK_PROCESS_CPUTIME_ID 2 -#define CLOUDABI_CLOCK_REALTIME 3 -#define CLOUDABI_CLOCK_THREAD_CPUTIME_ID 4 +#define CLOUDABI_CLOCK_REALTIME 3 +#define CLOUDABI_CLOCK_THREAD_CPUTIME_ID 4 typedef uint32_t cloudabi_condvar_t; #define CLOUDABI_CONDVAR_HAS_NO_WAITERS 0 @@ -76,110 +76,110 @@ typedef uint64_t cloudabi_dircookie_t; #define CLOUDABI_DIRCOOKIE_START 0 typedef uint16_t cloudabi_errno_t; -#define CLOUDABI_E2BIG 1 -#define CLOUDABI_EACCES 2 -#define CLOUDABI_EADDRINUSE 3 -#define CLOUDABI_EADDRNOTAVAIL 4 -#define CLOUDABI_EAFNOSUPPORT 5 -#define CLOUDABI_EAGAIN 6 -#define CLOUDABI_EALREADY 7 -#define CLOUDABI_EBADF 8 -#define CLOUDABI_EBADMSG 9 -#define CLOUDABI_EBUSY 10 -#define CLOUDABI_ECANCELED 11 -#define CLOUDABI_ECHILD 12 -#define CLOUDABI_ECONNABORTED 13 -#define CLOUDABI_ECONNREFUSED 14 -#define CLOUDABI_ECONNRESET 15 -#define CLOUDABI_EDEADLK 16 -#define CLOUDABI_EDESTADDRREQ 17 -#define CLOUDABI_EDOM 18 -#define CLOUDABI_EDQUOT 19 -#define CLOUDABI_EEXIST 20 -#define CLOUDABI_EFAULT 21 -#define CLOUDABI_EFBIG 22 -#define CLOUDABI_EHOSTUNREACH 23 -#define CLOUDABI_EIDRM 24 -#define CLOUDABI_EILSEQ 25 -#define CLOUDABI_EINPROGRESS 26 -#define CLOUDABI_EINTR 27 -#define CLOUDABI_EINVAL 28 -#define CLOUDABI_EIO 29 -#define CLOUDABI_EISCONN 30 -#define CLOUDABI_EISDIR 31 -#define CLOUDABI_ELOOP 32 -#define CLOUDABI_EMFILE 33 -#define CLOUDABI_EMLINK 34 -#define CLOUDABI_EMSGSIZE 35 -#define CLOUDABI_EMULTIHOP 36 -#define CLOUDABI_ENAMETOOLONG 37 -#define CLOUDABI_ENETDOWN 38 -#define CLOUDABI_ENETRESET 39 -#define CLOUDABI_ENETUNREACH 40 -#define CLOUDABI_ENFILE 41 -#define CLOUDABI_ENOBUFS 42 -#define CLOUDABI_ENODEV 43 -#define CLOUDABI_ENOENT 44 -#define CLOUDABI_ENOEXEC 45 -#define CLOUDABI_ENOLCK 46 -#define CLOUDABI_ENOLINK 47 -#define CLOUDABI_ENOMEM 48 -#define CLOUDABI_ENOMSG 49 -#define CLOUDABI_ENOPROTOOPT 50 -#define CLOUDABI_ENOSPC 51 -#define CLOUDABI_ENOSYS 52 -#define CLOUDABI_ENOTCONN 53 -#define CLOUDABI_ENOTDIR 54 -#define CLOUDABI_ENOTEMPTY 55 +#define CLOUDABI_E2BIG 1 +#define CLOUDABI_EACCES 2 +#define CLOUDABI_EADDRINUSE 3 +#define CLOUDABI_EADDRNOTAVAIL 4 +#define CLOUDABI_EAFNOSUPPORT 5 +#define CLOUDABI_EAGAIN 6 +#define CLOUDABI_EALREADY 7 +#define CLOUDABI_EBADF 8 +#define CLOUDABI_EBADMSG 9 +#define CLOUDABI_EBUSY 10 +#define CLOUDABI_ECANCELED 11 +#define CLOUDABI_ECHILD 12 +#define CLOUDABI_ECONNABORTED 13 +#define CLOUDABI_ECONNREFUSED 14 +#define CLOUDABI_ECONNRESET 15 +#define CLOUDABI_EDEADLK 16 +#define CLOUDABI_EDESTADDRREQ 17 +#define CLOUDABI_EDOM 18 +#define CLOUDABI_EDQUOT 19 +#define CLOUDABI_EEXIST 20 +#define CLOUDABI_EFAULT 21 +#define CLOUDABI_EFBIG 22 +#define CLOUDABI_EHOSTUNREACH 23 +#define CLOUDABI_EIDRM 24 +#define CLOUDABI_EILSEQ 25 +#define CLOUDABI_EINPROGRESS 26 +#define CLOUDABI_EINTR 27 +#define CLOUDABI_EINVAL 28 +#define CLOUDABI_EIO 29 +#define CLOUDABI_EISCONN 30 +#define CLOUDABI_EISDIR 31 +#define CLOUDABI_ELOOP 32 +#define CLOUDABI_EMFILE 33 +#define CLOUDABI_EMLINK 34 +#define CLOUDABI_EMSGSIZE 35 +#define CLOUDABI_EMULTIHOP 36 +#define CLOUDABI_ENAMETOOLONG 37 +#define CLOUDABI_ENETDOWN 38 +#define CLOUDABI_ENETRESET 39 +#define CLOUDABI_ENETUNREACH 40 +#define CLOUDABI_ENFILE 41 +#define CLOUDABI_ENOBUFS 42 +#define CLOUDABI_ENODEV 43 +#define CLOUDABI_ENOENT 44 +#define CLOUDABI_ENOEXEC 45 +#define CLOUDABI_ENOLCK 46 +#define CLOUDABI_ENOLINK 47 +#define CLOUDABI_ENOMEM 48 +#define CLOUDABI_ENOMSG 49 +#define CLOUDABI_ENOPROTOOPT 50 +#define CLOUDABI_ENOSPC 51 +#define CLOUDABI_ENOSYS 52 +#define CLOUDABI_ENOTCONN 53 +#define CLOUDABI_ENOTDIR 54 +#define CLOUDABI_ENOTEMPTY 55 #define CLOUDABI_ENOTRECOVERABLE 56 -#define CLOUDABI_ENOTSOCK 57 -#define CLOUDABI_ENOTSUP 58 -#define CLOUDABI_ENOTTY 59 -#define CLOUDABI_ENXIO 60 -#define CLOUDABI_EOVERFLOW 61 -#define CLOUDABI_EOWNERDEAD 62 -#define CLOUDABI_EPERM 63 -#define CLOUDABI_EPIPE 64 -#define CLOUDABI_EPROTO 65 +#define CLOUDABI_ENOTSOCK 57 +#define CLOUDABI_ENOTSUP 58 +#define CLOUDABI_ENOTTY 59 +#define CLOUDABI_ENXIO 60 +#define CLOUDABI_EOVERFLOW 61 +#define CLOUDABI_EOWNERDEAD 62 +#define CLOUDABI_EPERM 63 +#define CLOUDABI_EPIPE 64 +#define CLOUDABI_EPROTO 65 #define CLOUDABI_EPROTONOSUPPORT 66 -#define CLOUDABI_EPROTOTYPE 67 -#define CLOUDABI_ERANGE 68 -#define CLOUDABI_EROFS 69 -#define CLOUDABI_ESPIPE 70 -#define CLOUDABI_ESRCH 71 -#define CLOUDABI_ESTALE 72 -#define CLOUDABI_ETIMEDOUT 73 -#define CLOUDABI_ETXTBSY 74 -#define CLOUDABI_EXDEV 75 -#define CLOUDABI_ENOTCAPABLE 76 +#define CLOUDABI_EPROTOTYPE 67 +#define CLOUDABI_ERANGE 68 +#define CLOUDABI_EROFS 69 +#define CLOUDABI_ESPIPE 70 +#define CLOUDABI_ESRCH 71 +#define CLOUDABI_ESTALE 72 +#define CLOUDABI_ETIMEDOUT 73 +#define CLOUDABI_ETXTBSY 74 +#define CLOUDABI_EXDEV 75 +#define CLOUDABI_ENOTCAPABLE 76 typedef uint16_t cloudabi_eventrwflags_t; #define CLOUDABI_EVENT_FD_READWRITE_HANGUP 0x0001 typedef uint8_t cloudabi_eventtype_t; -#define CLOUDABI_EVENTTYPE_CLOCK 1 -#define CLOUDABI_EVENTTYPE_CONDVAR 2 -#define CLOUDABI_EVENTTYPE_FD_READ 3 -#define CLOUDABI_EVENTTYPE_FD_WRITE 4 -#define CLOUDABI_EVENTTYPE_LOCK_RDLOCK 5 -#define CLOUDABI_EVENTTYPE_LOCK_WRLOCK 6 +#define CLOUDABI_EVENTTYPE_CLOCK 1 +#define CLOUDABI_EVENTTYPE_CONDVAR 2 +#define CLOUDABI_EVENTTYPE_FD_READ 3 +#define CLOUDABI_EVENTTYPE_FD_WRITE 4 +#define CLOUDABI_EVENTTYPE_LOCK_RDLOCK 5 +#define CLOUDABI_EVENTTYPE_LOCK_WRLOCK 6 #define CLOUDABI_EVENTTYPE_PROC_TERMINATE 7 typedef uint32_t cloudabi_exitcode_t; typedef uint32_t cloudabi_fd_t; #define CLOUDABI_PROCESS_CHILD 0xffffffff -#define CLOUDABI_MAP_ANON_FD 0xffffffff +#define CLOUDABI_MAP_ANON_FD 0xffffffff typedef uint16_t cloudabi_fdflags_t; -#define CLOUDABI_FDFLAG_APPEND 0x0001 -#define CLOUDABI_FDFLAG_DSYNC 0x0002 +#define CLOUDABI_FDFLAG_APPEND 0x0001 +#define CLOUDABI_FDFLAG_DSYNC 0x0002 #define CLOUDABI_FDFLAG_NONBLOCK 0x0004 -#define CLOUDABI_FDFLAG_RSYNC 0x0008 -#define CLOUDABI_FDFLAG_SYNC 0x0010 +#define CLOUDABI_FDFLAG_RSYNC 0x0008 +#define CLOUDABI_FDFLAG_SYNC 0x0010 typedef uint16_t cloudabi_fdsflags_t; -#define CLOUDABI_FDSTAT_FLAGS 0x0001 +#define CLOUDABI_FDSTAT_FLAGS 0x0001 #define CLOUDABI_FDSTAT_RIGHTS 0x0002 typedef int64_t cloudabi_filedelta_t; @@ -187,155 +187,155 @@ typedef int64_t cloudabi_filedelta_t; typedef uint64_t cloudabi_filesize_t; typedef uint8_t cloudabi_filetype_t; -#define CLOUDABI_FILETYPE_UNKNOWN 0 -#define CLOUDABI_FILETYPE_BLOCK_DEVICE 16 -#define CLOUDABI_FILETYPE_CHARACTER_DEVICE 17 -#define CLOUDABI_FILETYPE_DIRECTORY 32 -#define CLOUDABI_FILETYPE_FIFO 48 -#define CLOUDABI_FILETYPE_POLL 64 -#define CLOUDABI_FILETYPE_PROCESS 80 -#define CLOUDABI_FILETYPE_REGULAR_FILE 96 -#define CLOUDABI_FILETYPE_SHARED_MEMORY 112 -#define CLOUDABI_FILETYPE_SOCKET_DGRAM 128 +#define CLOUDABI_FILETYPE_UNKNOWN 0 +#define CLOUDABI_FILETYPE_BLOCK_DEVICE 16 +#define CLOUDABI_FILETYPE_CHARACTER_DEVICE 17 +#define CLOUDABI_FILETYPE_DIRECTORY 32 +#define CLOUDABI_FILETYPE_FIFO 48 +#define CLOUDABI_FILETYPE_POLL 64 +#define CLOUDABI_FILETYPE_PROCESS 80 +#define CLOUDABI_FILETYPE_REGULAR_FILE 96 +#define CLOUDABI_FILETYPE_SHARED_MEMORY 112 +#define CLOUDABI_FILETYPE_SOCKET_DGRAM 128 #define CLOUDABI_FILETYPE_SOCKET_SEQPACKET 129 -#define CLOUDABI_FILETYPE_SOCKET_STREAM 130 -#define CLOUDABI_FILETYPE_SYMBOLIC_LINK 144 +#define CLOUDABI_FILETYPE_SOCKET_STREAM 130 +#define CLOUDABI_FILETYPE_SYMBOLIC_LINK 144 typedef uint16_t cloudabi_fsflags_t; -#define CLOUDABI_FILESTAT_ATIM 0x0001 +#define CLOUDABI_FILESTAT_ATIM 0x0001 #define CLOUDABI_FILESTAT_ATIM_NOW 0x0002 -#define CLOUDABI_FILESTAT_MTIM 0x0004 +#define CLOUDABI_FILESTAT_MTIM 0x0004 #define CLOUDABI_FILESTAT_MTIM_NOW 0x0008 -#define CLOUDABI_FILESTAT_SIZE 0x0010 +#define CLOUDABI_FILESTAT_SIZE 0x0010 typedef uint64_t cloudabi_inode_t; typedef uint32_t cloudabi_linkcount_t; typedef uint32_t cloudabi_lock_t; -#define CLOUDABI_LOCK_UNLOCKED 0x00000000 -#define CLOUDABI_LOCK_WRLOCKED 0x40000000 +#define CLOUDABI_LOCK_UNLOCKED 0x00000000 +#define CLOUDABI_LOCK_WRLOCKED 0x40000000 #define CLOUDABI_LOCK_KERNEL_MANAGED 0x80000000 -#define CLOUDABI_LOCK_BOGUS 0x80000000 +#define CLOUDABI_LOCK_BOGUS 0x80000000 typedef uint32_t cloudabi_lookupflags_t; #define CLOUDABI_LOOKUP_SYMLINK_FOLLOW 0x00000001 typedef uint8_t cloudabi_mflags_t; -#define CLOUDABI_MAP_ANON 0x01 -#define CLOUDABI_MAP_FIXED 0x02 +#define CLOUDABI_MAP_ANON 0x01 +#define CLOUDABI_MAP_FIXED 0x02 #define CLOUDABI_MAP_PRIVATE 0x04 -#define CLOUDABI_MAP_SHARED 0x08 +#define CLOUDABI_MAP_SHARED 0x08 typedef uint8_t cloudabi_mprot_t; -#define CLOUDABI_PROT_EXEC 0x01 +#define CLOUDABI_PROT_EXEC 0x01 #define CLOUDABI_PROT_WRITE 0x02 -#define CLOUDABI_PROT_READ 0x04 +#define CLOUDABI_PROT_READ 0x04 typedef uint8_t cloudabi_msflags_t; -#define CLOUDABI_MS_ASYNC 0x01 +#define CLOUDABI_MS_ASYNC 0x01 #define CLOUDABI_MS_INVALIDATE 0x02 -#define CLOUDABI_MS_SYNC 0x04 +#define CLOUDABI_MS_SYNC 0x04 typedef uint16_t cloudabi_msgflags_t; -#define CLOUDABI_MSG_CTRUNC 0x0001 -#define CLOUDABI_MSG_EOR 0x0002 -#define CLOUDABI_MSG_PEEK 0x0004 -#define CLOUDABI_MSG_TRUNC 0x0008 +#define CLOUDABI_MSG_CTRUNC 0x0001 +#define CLOUDABI_MSG_EOR 0x0002 +#define CLOUDABI_MSG_PEEK 0x0004 +#define CLOUDABI_MSG_TRUNC 0x0008 #define CLOUDABI_MSG_WAITALL 0x0010 typedef uint32_t cloudabi_nthreads_t; typedef uint16_t cloudabi_oflags_t; -#define CLOUDABI_O_CREAT 0x0001 +#define CLOUDABI_O_CREAT 0x0001 #define CLOUDABI_O_DIRECTORY 0x0002 -#define CLOUDABI_O_EXCL 0x0004 -#define CLOUDABI_O_TRUNC 0x0008 +#define CLOUDABI_O_EXCL 0x0004 +#define CLOUDABI_O_TRUNC 0x0008 typedef uint64_t cloudabi_rights_t; -#define CLOUDABI_RIGHT_FD_DATASYNC 0x0000000000000001 -#define CLOUDABI_RIGHT_FD_READ 0x0000000000000002 -#define CLOUDABI_RIGHT_FD_SEEK 0x0000000000000004 -#define CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS 0x0000000000000008 -#define CLOUDABI_RIGHT_FD_SYNC 0x0000000000000010 -#define CLOUDABI_RIGHT_FD_TELL 0x0000000000000020 -#define CLOUDABI_RIGHT_FD_WRITE 0x0000000000000040 -#define CLOUDABI_RIGHT_FILE_ADVISE 0x0000000000000080 -#define CLOUDABI_RIGHT_FILE_ALLOCATE 0x0000000000000100 -#define CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY 0x0000000000000200 -#define CLOUDABI_RIGHT_FILE_CREATE_FILE 0x0000000000000400 -#define CLOUDABI_RIGHT_FILE_CREATE_FIFO 0x0000000000000800 -#define CLOUDABI_RIGHT_FILE_LINK_SOURCE 0x0000000000001000 -#define CLOUDABI_RIGHT_FILE_LINK_TARGET 0x0000000000002000 -#define CLOUDABI_RIGHT_FILE_OPEN 0x0000000000004000 -#define CLOUDABI_RIGHT_FILE_READDIR 0x0000000000008000 -#define CLOUDABI_RIGHT_FILE_READLINK 0x0000000000010000 -#define CLOUDABI_RIGHT_FILE_RENAME_SOURCE 0x0000000000020000 -#define CLOUDABI_RIGHT_FILE_RENAME_TARGET 0x0000000000040000 -#define CLOUDABI_RIGHT_FILE_STAT_FGET 0x0000000000080000 -#define CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE 0x0000000000100000 -#define CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES 0x0000000000200000 -#define CLOUDABI_RIGHT_FILE_STAT_GET 0x0000000000400000 -#define CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES 0x0000000000800000 -#define CLOUDABI_RIGHT_FILE_SYMLINK 0x0000000001000000 -#define CLOUDABI_RIGHT_FILE_UNLINK 0x0000000002000000 -#define CLOUDABI_RIGHT_MEM_MAP 0x0000000004000000 -#define CLOUDABI_RIGHT_MEM_MAP_EXEC 0x0000000008000000 -#define CLOUDABI_RIGHT_POLL_FD_READWRITE 0x0000000010000000 -#define CLOUDABI_RIGHT_POLL_MODIFY 0x0000000020000000 -#define CLOUDABI_RIGHT_POLL_PROC_TERMINATE 0x0000000040000000 -#define CLOUDABI_RIGHT_POLL_WAIT 0x0000000080000000 -#define CLOUDABI_RIGHT_PROC_EXEC 0x0000000100000000 -#define CLOUDABI_RIGHT_SOCK_ACCEPT 0x0000000200000000 -#define CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY 0x0000000400000000 -#define CLOUDABI_RIGHT_SOCK_BIND_SOCKET 0x0000000800000000 +#define CLOUDABI_RIGHT_FD_DATASYNC 0x0000000000000001 +#define CLOUDABI_RIGHT_FD_READ 0x0000000000000002 +#define CLOUDABI_RIGHT_FD_SEEK 0x0000000000000004 +#define CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS 0x0000000000000008 +#define CLOUDABI_RIGHT_FD_SYNC 0x0000000000000010 +#define CLOUDABI_RIGHT_FD_TELL 0x0000000000000020 +#define CLOUDABI_RIGHT_FD_WRITE 0x0000000000000040 +#define CLOUDABI_RIGHT_FILE_ADVISE 0x0000000000000080 +#define CLOUDABI_RIGHT_FILE_ALLOCATE 0x0000000000000100 +#define CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY 0x0000000000000200 +#define CLOUDABI_RIGHT_FILE_CREATE_FILE 0x0000000000000400 +#define CLOUDABI_RIGHT_FILE_CREATE_FIFO 0x0000000000000800 +#define CLOUDABI_RIGHT_FILE_LINK_SOURCE 0x0000000000001000 +#define CLOUDABI_RIGHT_FILE_LINK_TARGET 0x0000000000002000 +#define CLOUDABI_RIGHT_FILE_OPEN 0x0000000000004000 +#define CLOUDABI_RIGHT_FILE_READDIR 0x0000000000008000 +#define CLOUDABI_RIGHT_FILE_READLINK 0x0000000000010000 +#define CLOUDABI_RIGHT_FILE_RENAME_SOURCE 0x0000000000020000 +#define CLOUDABI_RIGHT_FILE_RENAME_TARGET 0x0000000000040000 +#define CLOUDABI_RIGHT_FILE_STAT_FGET 0x0000000000080000 +#define CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE 0x0000000000100000 +#define CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES 0x0000000000200000 +#define CLOUDABI_RIGHT_FILE_STAT_GET 0x0000000000400000 +#define CLOUDABI_RIGHT_FILE_STAT_PUT_TIMES 0x0000000000800000 +#define CLOUDABI_RIGHT_FILE_SYMLINK 0x0000000001000000 +#define CLOUDABI_RIGHT_FILE_UNLINK 0x0000000002000000 +#define CLOUDABI_RIGHT_MEM_MAP 0x0000000004000000 +#define CLOUDABI_RIGHT_MEM_MAP_EXEC 0x0000000008000000 +#define CLOUDABI_RIGHT_POLL_FD_READWRITE 0x0000000010000000 +#define CLOUDABI_RIGHT_POLL_MODIFY 0x0000000020000000 +#define CLOUDABI_RIGHT_POLL_PROC_TERMINATE 0x0000000040000000 +#define CLOUDABI_RIGHT_POLL_WAIT 0x0000000080000000 +#define CLOUDABI_RIGHT_PROC_EXEC 0x0000000100000000 +#define CLOUDABI_RIGHT_SOCK_ACCEPT 0x0000000200000000 +#define CLOUDABI_RIGHT_SOCK_BIND_DIRECTORY 0x0000000400000000 +#define CLOUDABI_RIGHT_SOCK_BIND_SOCKET 0x0000000800000000 #define CLOUDABI_RIGHT_SOCK_CONNECT_DIRECTORY 0x0000001000000000 -#define CLOUDABI_RIGHT_SOCK_CONNECT_SOCKET 0x0000002000000000 -#define CLOUDABI_RIGHT_SOCK_LISTEN 0x0000004000000000 -#define CLOUDABI_RIGHT_SOCK_SHUTDOWN 0x0000008000000000 -#define CLOUDABI_RIGHT_SOCK_STAT_GET 0x0000010000000000 +#define CLOUDABI_RIGHT_SOCK_CONNECT_SOCKET 0x0000002000000000 +#define CLOUDABI_RIGHT_SOCK_LISTEN 0x0000004000000000 +#define CLOUDABI_RIGHT_SOCK_SHUTDOWN 0x0000008000000000 +#define CLOUDABI_RIGHT_SOCK_STAT_GET 0x0000010000000000 typedef uint8_t cloudabi_sa_family_t; #define CLOUDABI_AF_UNSPEC 0 -#define CLOUDABI_AF_INET 1 -#define CLOUDABI_AF_INET6 2 -#define CLOUDABI_AF_UNIX 3 +#define CLOUDABI_AF_INET 1 +#define CLOUDABI_AF_INET6 2 +#define CLOUDABI_AF_UNIX 3 typedef uint8_t cloudabi_scope_t; #define CLOUDABI_SCOPE_PRIVATE 4 -#define CLOUDABI_SCOPE_SHARED 8 +#define CLOUDABI_SCOPE_SHARED 8 typedef uint8_t cloudabi_sdflags_t; #define CLOUDABI_SHUT_RD 0x01 #define CLOUDABI_SHUT_WR 0x02 typedef uint8_t cloudabi_signal_t; -#define CLOUDABI_SIGABRT 1 -#define CLOUDABI_SIGALRM 2 -#define CLOUDABI_SIGBUS 3 -#define CLOUDABI_SIGCHLD 4 -#define CLOUDABI_SIGCONT 5 -#define CLOUDABI_SIGFPE 6 -#define CLOUDABI_SIGHUP 7 -#define CLOUDABI_SIGILL 8 -#define CLOUDABI_SIGINT 9 -#define CLOUDABI_SIGKILL 10 -#define CLOUDABI_SIGPIPE 11 -#define CLOUDABI_SIGQUIT 12 -#define CLOUDABI_SIGSEGV 13 -#define CLOUDABI_SIGSTOP 14 -#define CLOUDABI_SIGSYS 15 -#define CLOUDABI_SIGTERM 16 -#define CLOUDABI_SIGTRAP 17 -#define CLOUDABI_SIGTSTP 18 -#define CLOUDABI_SIGTTIN 19 -#define CLOUDABI_SIGTTOU 20 -#define CLOUDABI_SIGURG 21 -#define CLOUDABI_SIGUSR1 22 -#define CLOUDABI_SIGUSR2 23 +#define CLOUDABI_SIGABRT 1 +#define CLOUDABI_SIGALRM 2 +#define CLOUDABI_SIGBUS 3 +#define CLOUDABI_SIGCHLD 4 +#define CLOUDABI_SIGCONT 5 +#define CLOUDABI_SIGFPE 6 +#define CLOUDABI_SIGHUP 7 +#define CLOUDABI_SIGILL 8 +#define CLOUDABI_SIGINT 9 +#define CLOUDABI_SIGKILL 10 +#define CLOUDABI_SIGPIPE 11 +#define CLOUDABI_SIGQUIT 12 +#define CLOUDABI_SIGSEGV 13 +#define CLOUDABI_SIGSTOP 14 +#define CLOUDABI_SIGSYS 15 +#define CLOUDABI_SIGTERM 16 +#define CLOUDABI_SIGTRAP 17 +#define CLOUDABI_SIGTSTP 18 +#define CLOUDABI_SIGTTIN 19 +#define CLOUDABI_SIGTTOU 20 +#define CLOUDABI_SIGURG 21 +#define CLOUDABI_SIGUSR1 22 +#define CLOUDABI_SIGUSR2 23 #define CLOUDABI_SIGVTALRM 24 -#define CLOUDABI_SIGXCPU 25 -#define CLOUDABI_SIGXFSZ 26 +#define CLOUDABI_SIGXCPU 25 +#define CLOUDABI_SIGXFSZ 26 typedef uint8_t cloudabi_ssflags_t; #define CLOUDABI_SOCKSTAT_CLEAR_ERROR 0x01 @@ -347,11 +347,11 @@ typedef uint16_t cloudabi_subclockflags_ #define CLOUDABI_SUBSCRIPTION_CLOCK_ABSTIME 0x0001 typedef uint16_t cloudabi_subflags_t; -#define CLOUDABI_SUBSCRIPTION_ADD 0x0001 -#define CLOUDABI_SUBSCRIPTION_CLEAR 0x0002 -#define CLOUDABI_SUBSCRIPTION_DELETE 0x0004 +#define CLOUDABI_SUBSCRIPTION_ADD 0x0001 +#define CLOUDABI_SUBSCRIPTION_CLEAR 0x0002 +#define CLOUDABI_SUBSCRIPTION_DELETE 0x0004 #define CLOUDABI_SUBSCRIPTION_DISABLE 0x0008 -#define CLOUDABI_SUBSCRIPTION_ENABLE 0x0010 +#define CLOUDABI_SUBSCRIPTION_ENABLE 0x0010 #define CLOUDABI_SUBSCRIPTION_ONESHOT 0x0020 typedef uint16_t cloudabi_subrwflags_t; @@ -390,13 +390,10 @@ typedef struct { _Alignas(8) cloudabi_rights_t fs_rights_base; _Alignas(8) cloudabi_rights_t fs_rights_inheriting; } cloudabi_fdstat_t; -_Static_assert(offsetof(cloudabi_fdstat_t, fs_filetype) == 0, - "Incorrect layout"); +_Static_assert(offsetof(cloudabi_fdstat_t, fs_filetype) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi_fdstat_t, fs_flags) == 2, "Incorrect layout"); -_Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_base) == 8, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_inheriting) == 16, - "Incorrect layout"); +_Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_base) == 8, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_fdstat_t, fs_rights_inheriting) == 16, "Incorrect layout"); _Static_assert(sizeof(cloudabi_fdstat_t) == 24, "Incorrect layout"); _Static_assert(_Alignof(cloudabi_fdstat_t) == 8, "Incorrect layout"); @@ -412,18 +409,12 @@ typedef struct { } cloudabi_filestat_t; _Static_assert(offsetof(cloudabi_filestat_t, st_dev) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi_filestat_t, st_ino) == 8, "Incorrect layout"); -_Static_assert(offsetof(cloudabi_filestat_t, st_filetype) == 16, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_filestat_t, st_nlink) == 20, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_filestat_t, st_size) == 24, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_filestat_t, st_atim) == 32, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_filestat_t, st_mtim) == 40, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_filestat_t, st_ctim) == 48, - "Incorrect layout"); +_Static_assert(offsetof(cloudabi_filestat_t, st_filetype) == 16, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_filestat_t, st_nlink) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_filestat_t, st_size) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_filestat_t, st_atim) == 32, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_filestat_t, st_mtim) == 40, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_filestat_t, st_ctim) == 48, "Incorrect layout"); _Static_assert(sizeof(cloudabi_filestat_t) == 56, "Incorrect layout"); _Static_assert(_Alignof(cloudabi_filestat_t) == 8, "Incorrect layout"); @@ -449,16 +440,11 @@ typedef struct { } sa_inet6; }; } cloudabi_sockaddr_t; -_Static_assert(offsetof(cloudabi_sockaddr_t, sa_family) == 0, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.addr) == 2, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.port) == 6, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.addr) == 2, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.port) == 18, - "Incorrect layout"); +_Static_assert(offsetof(cloudabi_sockaddr_t, sa_family) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.addr) == 2, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.port) == 6, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.addr) == 2, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.port) == 18, "Incorrect layout"); _Static_assert(sizeof(cloudabi_sockaddr_t) == 20, "Incorrect layout"); _Static_assert(_Alignof(cloudabi_sockaddr_t) == 2, "Incorrect layout"); @@ -468,14 +454,10 @@ typedef struct { _Alignas(2) cloudabi_errno_t ss_error; _Alignas(4) cloudabi_sstate_t ss_state; } cloudabi_sockstat_t; -_Static_assert(offsetof(cloudabi_sockstat_t, ss_sockname) == 0, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_sockstat_t, ss_peername) == 20, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_sockstat_t, ss_error) == 40, - "Incorrect layout"); -_Static_assert(offsetof(cloudabi_sockstat_t, ss_state) == 44, - "Incorrect layout"); +_Static_assert(offsetof(cloudabi_sockstat_t, ss_sockname) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_sockstat_t, ss_peername) == 20, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_sockstat_t, ss_error) == 40, "Incorrect layout"); +_Static_assert(offsetof(cloudabi_sockstat_t, ss_state) == 44, "Incorrect layout"); _Static_assert(sizeof(cloudabi_sockstat_t) == 48, "Incorrect layout"); _Static_assert(_Alignof(cloudabi_sockstat_t) == 4, "Incorrect layout"); Modified: head/sys/contrib/cloudabi/syscalls32.master ============================================================================== --- head/sys/contrib/cloudabi/syscalls32.master Tue Jan 17 22:02:22 2017 (r312352) +++ head/sys/contrib/cloudabi/syscalls32.master Tue Jan 17 22:03:08 2017 (r312353) @@ -65,20 +65,20 @@ 8 AUE_NULL STD { size_t cloudabi32_sys_fd_pread( \ cloudabi_fd_t fd, \ - const cloudabi32_iovec_t *iov, \ - size_t iovcnt, \ + const cloudabi32_iovec_t *iovs, \ + size_t iovs_len, \ cloudabi_filesize_t offset); } 9 AUE_NULL STD { size_t cloudabi32_sys_fd_pwrite( \ cloudabi_fd_t fd, \ - const cloudabi32_ciovec_t *iov, \ - size_t iovcnt, \ + const cloudabi32_ciovec_t *iovs, \ + size_t iovs_len, \ cloudabi_filesize_t offset); } 10 AUE_NULL STD { size_t cloudabi32_sys_fd_read( \ cloudabi_fd_t fd, \ - const cloudabi32_iovec_t *iov, \ - size_t iovcnt); } + const cloudabi32_iovec_t *iovs, \ + size_t iovs_len); } 11 AUE_NULL STD { void cloudabi_sys_fd_replace( \ cloudabi_fd_t from, \ @@ -104,8 +104,8 @@ 16 AUE_NULL STD { size_t cloudabi32_sys_fd_write( \ cloudabi_fd_t fd, \ - const cloudabi32_ciovec_t *iov, \ - size_t iovcnt); } + const cloudabi32_ciovec_t *iovs, \ + size_t iovs_len); } 17 AUE_NULL STD { void cloudabi_sys_file_advise( \ cloudabi_fd_t fd, \ @@ -121,44 +121,44 @@ 19 AUE_NULL STD { void cloudabi_sys_file_create( \ cloudabi_fd_t fd, \ const char *path, \ - size_t pathlen, \ + size_t path_len, \ cloudabi_filetype_t type); } 20 AUE_NULL STD { void cloudabi_sys_file_link( \ cloudabi_lookup_t fd1, \ const char *path1, \ - size_t path1len, \ + size_t path1_len, \ cloudabi_fd_t fd2, \ const char *path2, \ - size_t path2len); } + size_t path2_len); } 21 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_file_open( \ cloudabi_lookup_t dirfd, \ const char *path, \ - size_t pathlen, \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 17 22:05:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4995FCB462D; Tue, 17 Jan 2017 22:05:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E17C81012; Tue, 17 Jan 2017 22:05:03 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0HM53Bx071453; Tue, 17 Jan 2017 22:05:03 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HM52XK071442; Tue, 17 Jan 2017 22:05:02 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201701172205.v0HM52XK071442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 17 Jan 2017 22:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312354 - in head/sys/compat: cloudabi32 cloudabi64 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, 17 Jan 2017 22:05:04 -0000 Author: ed Date: Tue Jan 17 22:05:01 2017 New Revision: 312354 URL: https://svnweb.freebsd.org/changeset/base/312354 Log: Regenerate sources based on the system call tables. Modified: head/sys/compat/cloudabi32/cloudabi32_proto.h head/sys/compat/cloudabi32/cloudabi32_syscall.h head/sys/compat/cloudabi32/cloudabi32_syscalls.c head/sys/compat/cloudabi32/cloudabi32_sysent.c head/sys/compat/cloudabi32/cloudabi32_systrace_args.c head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Modified: head/sys/compat/cloudabi32/cloudabi32_proto.h ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_proto.h Tue Jan 17 22:03:08 2017 (r312353) +++ head/sys/compat/cloudabi32/cloudabi32_proto.h Tue Jan 17 22:05:01 2017 (r312354) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 312353 2017-01-17 22:03:08Z ed */ #ifndef _CLOUDABI32_SYSPROTO_H_ @@ -63,20 +63,20 @@ struct cloudabi_sys_fd_dup_args { }; struct cloudabi32_sys_fd_pread_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char iov_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iov; char iov_r_[PADR_(const cloudabi32_iovec_t *)]; - char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; + char iovs_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_iovec_t *)]; + char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi32_sys_fd_pwrite_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char iov_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iov; char iov_r_[PADR_(const cloudabi32_ciovec_t *)]; - char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; + char iovs_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_ciovec_t *)]; + char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi32_sys_fd_read_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char iov_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iov; char iov_r_[PADR_(const cloudabi32_iovec_t *)]; - char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; + char iovs_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_iovec_t *)]; + char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_fd_replace_args { char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)]; @@ -101,8 +101,8 @@ struct cloudabi_sys_fd_sync_args { }; struct cloudabi32_sys_fd_write_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char iov_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iov; char iov_r_[PADR_(const cloudabi32_ciovec_t *)]; - char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; + char iovs_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi32_ciovec_t *)]; + char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_advise_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; @@ -118,44 +118,44 @@ struct cloudabi_sys_file_allocate_args { struct cloudabi_sys_file_create_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)]; }; struct cloudabi_sys_file_link_args { char fd1_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd1; char fd1_r_[PADR_(cloudabi_lookup_t)]; char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; - char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)]; + char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)]; char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; - char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)]; + char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_open_args { char dirfd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t dirfd; char dirfd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char oflags_l_[PADL_(cloudabi_oflags_t)]; cloudabi_oflags_t oflags; char oflags_r_[PADR_(cloudabi_oflags_t)]; char fds_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * fds; char fds_r_[PADR_(const cloudabi_fdstat_t *)]; }; struct cloudabi_sys_file_readdir_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; - char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; + char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; char cookie_l_[PADL_(cloudabi_dircookie_t)]; cloudabi_dircookie_t cookie; char cookie_r_[PADR_(cloudabi_dircookie_t)]; }; struct cloudabi_sys_file_readlink_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; + char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_rename_args { - char oldfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t oldfd; char oldfd_r_[PADR_(cloudabi_fd_t)]; - char old_l_[PADL_(const char *)]; const char * old; char old_r_[PADR_(const char *)]; - char oldlen_l_[PADL_(size_t)]; size_t oldlen; char oldlen_r_[PADR_(size_t)]; - char newfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t newfd; char newfd_r_[PADR_(cloudabi_fd_t)]; - char new_l_[PADL_(const char *)]; const char * new; char new_r_[PADR_(const char *)]; - char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)]; + char fd1_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd1; char fd1_r_[PADR_(cloudabi_fd_t)]; + char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; + char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; + char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)]; + char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; + char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_stat_fget_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; @@ -169,27 +169,27 @@ struct cloudabi_sys_file_stat_fput_args struct cloudabi_sys_file_stat_get_args { char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)]; }; struct cloudabi_sys_file_stat_put_args { char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)]; char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)]; }; struct cloudabi_sys_file_symlink_args { char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; - char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)]; + char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; - char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)]; + char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_unlink_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char flags_l_[PADL_(cloudabi_ulflags_t)]; cloudabi_ulflags_t flags; char flags_r_[PADR_(cloudabi_ulflags_t)]; }; struct cloudabi_sys_lock_unlock_args { @@ -197,13 +197,13 @@ struct cloudabi_sys_lock_unlock_args { char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; }; struct cloudabi_sys_mem_advise_args { - char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)]; }; struct cloudabi_sys_mem_lock_args { - char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_mem_map_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; @@ -214,22 +214,22 @@ struct cloudabi_sys_mem_map_args { char off_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t off; char off_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi_sys_mem_protect_args { - char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)]; }; struct cloudabi_sys_mem_sync_args { - char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char flags_l_[PADL_(cloudabi_msflags_t)]; cloudabi_msflags_t flags; char flags_r_[PADR_(cloudabi_msflags_t)]; }; struct cloudabi_sys_mem_unlock_args { - char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_mem_unmap_args { - char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; }; struct cloudabi32_sys_poll_args { char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)]; @@ -239,17 +239,17 @@ struct cloudabi32_sys_poll_args { struct cloudabi32_sys_poll_fd_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)]; - char nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)]; + char in_len_l_[PADL_(size_t)]; size_t in_len; char in_len_r_[PADR_(size_t)]; char out_l_[PADL_(cloudabi32_event_t *)]; cloudabi32_event_t * out; char out_r_[PADR_(cloudabi32_event_t *)]; - char nout_l_[PADL_(size_t)]; size_t nout; char nout_r_[PADR_(size_t)]; + char out_len_l_[PADL_(size_t)]; size_t out_len; char out_len_r_[PADR_(size_t)]; char timeout_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi32_subscription_t *)]; }; struct cloudabi_sys_proc_exec_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)]; - char datalen_l_[PADL_(size_t)]; size_t datalen; char datalen_r_[PADR_(size_t)]; + char data_len_l_[PADL_(size_t)]; size_t data_len; char data_len_r_[PADR_(size_t)]; char fds_l_[PADL_(const cloudabi_fd_t *)]; const cloudabi_fd_t * fds; char fds_r_[PADR_(const cloudabi_fd_t *)]; - char fdslen_l_[PADL_(size_t)]; size_t fdslen; char fdslen_r_[PADR_(size_t)]; + char fds_len_l_[PADL_(size_t)]; size_t fds_len; char fds_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_proc_exit_args { char rval_l_[PADL_(cloudabi_exitcode_t)]; cloudabi_exitcode_t rval; char rval_r_[PADR_(cloudabi_exitcode_t)]; @@ -262,7 +262,7 @@ struct cloudabi_sys_proc_raise_args { }; struct cloudabi_sys_random_get_args { char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; - char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; + char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_sock_accept_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; @@ -272,13 +272,13 @@ struct cloudabi_sys_sock_bind_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_sock_connect_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_sock_listen_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; Modified: head/sys/compat/cloudabi32/cloudabi32_syscall.h ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscall.h Tue Jan 17 22:03:08 2017 (r312353) +++ head/sys/compat/cloudabi32/cloudabi32_syscall.h Tue Jan 17 22:05:01 2017 (r312354) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 312353 2017-01-17 22:03:08Z ed */ #define CLOUDABI32_SYS_cloudabi_sys_clock_res_get 0 Modified: head/sys/compat/cloudabi32/cloudabi32_syscalls.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_syscalls.c Tue Jan 17 22:03:08 2017 (r312353) +++ head/sys/compat/cloudabi32/cloudabi32_syscalls.c Tue Jan 17 22:05:01 2017 (r312354) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 312353 2017-01-17 22:03:08Z ed */ const char *cloudabi32_syscallnames[] = { Modified: head/sys/compat/cloudabi32/cloudabi32_sysent.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_sysent.c Tue Jan 17 22:03:08 2017 (r312353) +++ head/sys/compat/cloudabi32/cloudabi32_sysent.c Tue Jan 17 22:05:01 2017 (r312354) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 312353 2017-01-17 22:03:08Z ed */ #include Modified: head/sys/compat/cloudabi32/cloudabi32_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Tue Jan 17 22:03:08 2017 (r312353) +++ head/sys/compat/cloudabi32/cloudabi32_systrace_args.c Tue Jan 17 22:05:01 2017 (r312354) @@ -74,8 +74,8 @@ systrace_args(int sysnum, void *params, case 8: { struct cloudabi32_sys_fd_pread_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->iov; /* const cloudabi32_iovec_t * */ - uarg[2] = p->iovcnt; /* size_t */ + uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_iovec_t * */ + uarg[2] = p->iovs_len; /* size_t */ iarg[3] = p->offset; /* cloudabi_filesize_t */ *n_args = 4; break; @@ -84,8 +84,8 @@ systrace_args(int sysnum, void *params, case 9: { struct cloudabi32_sys_fd_pwrite_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->iov; /* const cloudabi32_ciovec_t * */ - uarg[2] = p->iovcnt; /* size_t */ + uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_ciovec_t * */ + uarg[2] = p->iovs_len; /* size_t */ iarg[3] = p->offset; /* cloudabi_filesize_t */ *n_args = 4; break; @@ -94,8 +94,8 @@ systrace_args(int sysnum, void *params, case 10: { struct cloudabi32_sys_fd_read_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->iov; /* const cloudabi32_iovec_t * */ - uarg[2] = p->iovcnt; /* size_t */ + uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_iovec_t * */ + uarg[2] = p->iovs_len; /* size_t */ *n_args = 3; break; } @@ -144,8 +144,8 @@ systrace_args(int sysnum, void *params, case 16: { struct cloudabi32_sys_fd_write_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->iov; /* const cloudabi32_ciovec_t * */ - uarg[2] = p->iovcnt; /* size_t */ + uarg[1] = (intptr_t) p->iovs; /* const cloudabi32_ciovec_t * */ + uarg[2] = p->iovs_len; /* size_t */ *n_args = 3; break; } @@ -173,7 +173,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_create_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ iarg[3] = p->type; /* cloudabi_filetype_t */ *n_args = 4; break; @@ -183,10 +183,10 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_link_args *p = params; iarg[0] = p->fd1; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path1; /* const char * */ - uarg[2] = p->path1len; /* size_t */ + uarg[2] = p->path1_len; /* size_t */ iarg[3] = p->fd2; /* cloudabi_fd_t */ uarg[4] = (intptr_t) p->path2; /* const char * */ - uarg[5] = p->path2len; /* size_t */ + uarg[5] = p->path2_len; /* size_t */ *n_args = 6; break; } @@ -195,7 +195,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_open_args *p = params; iarg[0] = p->dirfd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ iarg[3] = p->oflags; /* cloudabi_oflags_t */ uarg[4] = (intptr_t) p->fds; /* const cloudabi_fdstat_t * */ *n_args = 5; @@ -206,7 +206,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_readdir_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* void * */ - uarg[2] = p->nbyte; /* size_t */ + uarg[2] = p->buf_len; /* size_t */ iarg[3] = p->cookie; /* cloudabi_dircookie_t */ *n_args = 4; break; @@ -216,21 +216,21 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_readlink_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* char * */ - uarg[4] = p->bufsize; /* size_t */ + uarg[4] = p->buf_len; /* size_t */ *n_args = 5; break; } /* cloudabi_sys_file_rename */ case 24: { struct cloudabi_sys_file_rename_args *p = params; - iarg[0] = p->oldfd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->old; /* const char * */ - uarg[2] = p->oldlen; /* size_t */ - iarg[3] = p->newfd; /* cloudabi_fd_t */ - uarg[4] = (intptr_t) p->new; /* const char * */ - uarg[5] = p->newlen; /* size_t */ + iarg[0] = p->fd1; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->path1; /* const char * */ + uarg[2] = p->path1_len; /* size_t */ + iarg[3] = p->fd2; /* cloudabi_fd_t */ + uarg[4] = (intptr_t) p->path2; /* const char * */ + uarg[5] = p->path2_len; /* size_t */ *n_args = 6; break; } @@ -256,7 +256,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_stat_get_args *p = params; iarg[0] = p->fd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* cloudabi_filestat_t * */ *n_args = 4; break; @@ -266,7 +266,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_stat_put_args *p = params; iarg[0] = p->fd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* const cloudabi_filestat_t * */ iarg[4] = p->flags; /* cloudabi_fsflags_t */ *n_args = 5; @@ -276,10 +276,10 @@ systrace_args(int sysnum, void *params, case 29: { struct cloudabi_sys_file_symlink_args *p = params; uarg[0] = (intptr_t) p->path1; /* const char * */ - uarg[1] = p->path1len; /* size_t */ + uarg[1] = p->path1_len; /* size_t */ iarg[2] = p->fd; /* cloudabi_fd_t */ uarg[3] = (intptr_t) p->path2; /* const char * */ - uarg[4] = p->path2len; /* size_t */ + uarg[4] = p->path2_len; /* size_t */ *n_args = 5; break; } @@ -288,7 +288,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_unlink_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ iarg[3] = p->flags; /* cloudabi_ulflags_t */ *n_args = 4; break; @@ -304,8 +304,8 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_mem_advise */ case 32: { struct cloudabi_sys_mem_advise_args *p = params; - uarg[0] = (intptr_t) p->addr; /* void * */ - uarg[1] = p->len; /* size_t */ + uarg[0] = (intptr_t) p->mapping; /* void * */ + uarg[1] = p->mapping_len; /* size_t */ iarg[2] = p->advice; /* cloudabi_advice_t */ *n_args = 3; break; @@ -313,8 +313,8 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_mem_lock */ case 33: { struct cloudabi_sys_mem_lock_args *p = params; - uarg[0] = (intptr_t) p->addr; /* const void * */ - uarg[1] = p->len; /* size_t */ + uarg[0] = (intptr_t) p->mapping; /* const void * */ + uarg[1] = p->mapping_len; /* size_t */ *n_args = 2; break; } @@ -333,8 +333,8 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_mem_protect */ case 35: { struct cloudabi_sys_mem_protect_args *p = params; - uarg[0] = (intptr_t) p->addr; /* void * */ - uarg[1] = p->len; /* size_t */ + uarg[0] = (intptr_t) p->mapping; /* void * */ + uarg[1] = p->mapping_len; /* size_t */ iarg[2] = p->prot; /* cloudabi_mprot_t */ *n_args = 3; break; @@ -342,8 +342,8 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_mem_sync */ case 36: { struct cloudabi_sys_mem_sync_args *p = params; - uarg[0] = (intptr_t) p->addr; /* void * */ - uarg[1] = p->len; /* size_t */ + uarg[0] = (intptr_t) p->mapping; /* void * */ + uarg[1] = p->mapping_len; /* size_t */ iarg[2] = p->flags; /* cloudabi_msflags_t */ *n_args = 3; break; @@ -351,16 +351,16 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_mem_unlock */ case 37: { struct cloudabi_sys_mem_unlock_args *p = params; - uarg[0] = (intptr_t) p->addr; /* const void * */ - uarg[1] = p->len; /* size_t */ + uarg[0] = (intptr_t) p->mapping; /* const void * */ + uarg[1] = p->mapping_len; /* size_t */ *n_args = 2; break; } /* cloudabi_sys_mem_unmap */ case 38: { struct cloudabi_sys_mem_unmap_args *p = params; - uarg[0] = (intptr_t) p->addr; /* void * */ - uarg[1] = p->len; /* size_t */ + uarg[0] = (intptr_t) p->mapping; /* void * */ + uarg[1] = p->mapping_len; /* size_t */ *n_args = 2; break; } @@ -378,9 +378,9 @@ systrace_args(int sysnum, void *params, struct cloudabi32_sys_poll_fd_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi32_subscription_t * */ - uarg[2] = p->nin; /* size_t */ + uarg[2] = p->in_len; /* size_t */ uarg[3] = (intptr_t) p->out; /* cloudabi32_event_t * */ - uarg[4] = p->nout; /* size_t */ + uarg[4] = p->out_len; /* size_t */ uarg[5] = (intptr_t) p->timeout; /* const cloudabi32_subscription_t * */ *n_args = 6; break; @@ -390,9 +390,9 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_proc_exec_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->data; /* const void * */ - uarg[2] = p->datalen; /* size_t */ + uarg[2] = p->data_len; /* size_t */ uarg[3] = (intptr_t) p->fds; /* const cloudabi_fd_t * */ - uarg[4] = p->fdslen; /* size_t */ + uarg[4] = p->fds_len; /* size_t */ *n_args = 5; break; } @@ -419,7 +419,7 @@ systrace_args(int sysnum, void *params, case 45: { struct cloudabi_sys_random_get_args *p = params; uarg[0] = (intptr_t) p->buf; /* void * */ - uarg[1] = p->nbyte; /* size_t */ + uarg[1] = p->buf_len; /* size_t */ *n_args = 2; break; } @@ -437,7 +437,7 @@ systrace_args(int sysnum, void *params, iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->fd; /* cloudabi_fd_t */ uarg[2] = (intptr_t) p->path; /* const char * */ - uarg[3] = p->pathlen; /* size_t */ + uarg[3] = p->path_len; /* size_t */ *n_args = 4; break; } @@ -447,7 +447,7 @@ systrace_args(int sysnum, void *params, iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->fd; /* cloudabi_fd_t */ uarg[2] = (intptr_t) p->path; /* const char * */ - uarg[3] = p->pathlen; /* size_t */ + uarg[3] = p->path_len; /* size_t */ *n_args = 4; break; } Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Tue Jan 17 22:03:08 2017 (r312353) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Tue Jan 17 22:05:01 2017 (r312354) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 312353 2017-01-17 22:03:08Z ed */ #ifndef _CLOUDABI64_SYSPROTO_H_ @@ -63,20 +63,20 @@ struct cloudabi_sys_fd_dup_args { }; struct cloudabi64_sys_fd_pread_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char iov_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iov; char iov_r_[PADR_(const cloudabi64_iovec_t *)]; - char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; + char iovs_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_iovec_t *)]; + char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi64_sys_fd_pwrite_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char iov_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iov; char iov_r_[PADR_(const cloudabi64_ciovec_t *)]; - char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; + char iovs_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_ciovec_t *)]; + char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi64_sys_fd_read_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char iov_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iov; char iov_r_[PADR_(const cloudabi64_iovec_t *)]; - char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; + char iovs_l_[PADL_(const cloudabi64_iovec_t *)]; const cloudabi64_iovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_iovec_t *)]; + char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_fd_replace_args { char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)]; @@ -101,8 +101,8 @@ struct cloudabi_sys_fd_sync_args { }; struct cloudabi64_sys_fd_write_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char iov_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iov; char iov_r_[PADR_(const cloudabi64_ciovec_t *)]; - char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)]; + char iovs_l_[PADL_(const cloudabi64_ciovec_t *)]; const cloudabi64_ciovec_t * iovs; char iovs_r_[PADR_(const cloudabi64_ciovec_t *)]; + char iovs_len_l_[PADL_(size_t)]; size_t iovs_len; char iovs_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_advise_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; @@ -118,44 +118,44 @@ struct cloudabi_sys_file_allocate_args { struct cloudabi_sys_file_create_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)]; }; struct cloudabi_sys_file_link_args { char fd1_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd1; char fd1_r_[PADR_(cloudabi_lookup_t)]; char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; - char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)]; + char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)]; char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; - char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)]; + char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_open_args { char dirfd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t dirfd; char dirfd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char oflags_l_[PADL_(cloudabi_oflags_t)]; cloudabi_oflags_t oflags; char oflags_r_[PADR_(cloudabi_oflags_t)]; char fds_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * fds; char fds_r_[PADR_(const cloudabi_fdstat_t *)]; }; struct cloudabi_sys_file_readdir_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; - char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; + char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; char cookie_l_[PADL_(cloudabi_dircookie_t)]; cloudabi_dircookie_t cookie; char cookie_r_[PADR_(cloudabi_dircookie_t)]; }; struct cloudabi_sys_file_readlink_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; - char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; + char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_rename_args { - char oldfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t oldfd; char oldfd_r_[PADR_(cloudabi_fd_t)]; - char old_l_[PADL_(const char *)]; const char * old; char old_r_[PADR_(const char *)]; - char oldlen_l_[PADL_(size_t)]; size_t oldlen; char oldlen_r_[PADR_(size_t)]; - char newfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t newfd; char newfd_r_[PADR_(cloudabi_fd_t)]; - char new_l_[PADL_(const char *)]; const char * new; char new_r_[PADR_(const char *)]; - char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)]; + char fd1_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd1; char fd1_r_[PADR_(cloudabi_fd_t)]; + char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; + char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; + char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)]; + char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; + char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_stat_fget_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; @@ -169,27 +169,27 @@ struct cloudabi_sys_file_stat_fput_args struct cloudabi_sys_file_stat_get_args { char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)]; }; struct cloudabi_sys_file_stat_put_args { char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)]; char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)]; }; struct cloudabi_sys_file_symlink_args { char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)]; - char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)]; + char path1_len_l_[PADL_(size_t)]; size_t path1_len; char path1_len_r_[PADR_(size_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)]; - char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)]; + char path2_len_l_[PADL_(size_t)]; size_t path2_len; char path2_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_file_unlink_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; char flags_l_[PADL_(cloudabi_ulflags_t)]; cloudabi_ulflags_t flags; char flags_r_[PADR_(cloudabi_ulflags_t)]; }; struct cloudabi_sys_lock_unlock_args { @@ -197,13 +197,13 @@ struct cloudabi_sys_lock_unlock_args { char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; }; struct cloudabi_sys_mem_advise_args { - char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)]; }; struct cloudabi_sys_mem_lock_args { - char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_mem_map_args { char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; @@ -214,22 +214,22 @@ struct cloudabi_sys_mem_map_args { char off_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t off; char off_r_[PADR_(cloudabi_filesize_t)]; }; struct cloudabi_sys_mem_protect_args { - char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)]; }; struct cloudabi_sys_mem_sync_args { - char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; char flags_l_[PADL_(cloudabi_msflags_t)]; cloudabi_msflags_t flags; char flags_r_[PADR_(cloudabi_msflags_t)]; }; struct cloudabi_sys_mem_unlock_args { - char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_mem_unmap_args { - char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)]; - char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)]; + char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)]; + char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)]; }; struct cloudabi64_sys_poll_args { char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; @@ -239,17 +239,17 @@ struct cloudabi64_sys_poll_args { struct cloudabi64_sys_poll_fd_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; - char nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)]; + char in_len_l_[PADL_(size_t)]; size_t in_len; char in_len_r_[PADR_(size_t)]; char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; - char nout_l_[PADL_(size_t)]; size_t nout; char nout_r_[PADR_(size_t)]; + char out_len_l_[PADL_(size_t)]; size_t out_len; char out_len_r_[PADR_(size_t)]; char timeout_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi64_subscription_t *)]; }; struct cloudabi_sys_proc_exec_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)]; - char datalen_l_[PADL_(size_t)]; size_t datalen; char datalen_r_[PADR_(size_t)]; + char data_len_l_[PADL_(size_t)]; size_t data_len; char data_len_r_[PADR_(size_t)]; char fds_l_[PADL_(const cloudabi_fd_t *)]; const cloudabi_fd_t * fds; char fds_r_[PADR_(const cloudabi_fd_t *)]; - char fdslen_l_[PADL_(size_t)]; size_t fdslen; char fdslen_r_[PADR_(size_t)]; + char fds_len_l_[PADL_(size_t)]; size_t fds_len; char fds_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_proc_exit_args { char rval_l_[PADL_(cloudabi_exitcode_t)]; cloudabi_exitcode_t rval; char rval_r_[PADR_(cloudabi_exitcode_t)]; @@ -262,7 +262,7 @@ struct cloudabi_sys_proc_raise_args { }; struct cloudabi_sys_random_get_args { char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)]; - char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)]; + char buf_len_l_[PADL_(size_t)]; size_t buf_len; char buf_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_sock_accept_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; @@ -272,13 +272,13 @@ struct cloudabi_sys_sock_bind_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_sock_connect_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)]; - char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)]; + char path_len_l_[PADL_(size_t)]; size_t path_len; char path_len_r_[PADR_(size_t)]; }; struct cloudabi_sys_sock_listen_args { char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)]; Modified: head/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h Tue Jan 17 22:03:08 2017 (r312353) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Tue Jan 17 22:05:01 2017 (r312354) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 312353 2017-01-17 22:03:08Z ed */ #define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0 Modified: head/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c Tue Jan 17 22:03:08 2017 (r312353) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Tue Jan 17 22:05:01 2017 (r312354) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 312353 2017-01-17 22:03:08Z ed */ const char *cloudabi64_syscallnames[] = { Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Tue Jan 17 22:03:08 2017 (r312353) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Tue Jan 17 22:05:01 2017 (r312354) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 312353 2017-01-17 22:03:08Z ed */ #include Modified: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Tue Jan 17 22:03:08 2017 (r312353) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Tue Jan 17 22:05:01 2017 (r312354) @@ -74,8 +74,8 @@ systrace_args(int sysnum, void *params, case 8: { struct cloudabi64_sys_fd_pread_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->iov; /* const cloudabi64_iovec_t * */ - uarg[2] = p->iovcnt; /* size_t */ + uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_iovec_t * */ + uarg[2] = p->iovs_len; /* size_t */ iarg[3] = p->offset; /* cloudabi_filesize_t */ *n_args = 4; break; @@ -84,8 +84,8 @@ systrace_args(int sysnum, void *params, case 9: { struct cloudabi64_sys_fd_pwrite_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->iov; /* const cloudabi64_ciovec_t * */ - uarg[2] = p->iovcnt; /* size_t */ + uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_ciovec_t * */ + uarg[2] = p->iovs_len; /* size_t */ iarg[3] = p->offset; /* cloudabi_filesize_t */ *n_args = 4; break; @@ -94,8 +94,8 @@ systrace_args(int sysnum, void *params, case 10: { struct cloudabi64_sys_fd_read_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->iov; /* const cloudabi64_iovec_t * */ - uarg[2] = p->iovcnt; /* size_t */ + uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_iovec_t * */ + uarg[2] = p->iovs_len; /* size_t */ *n_args = 3; break; } @@ -144,8 +144,8 @@ systrace_args(int sysnum, void *params, case 16: { struct cloudabi64_sys_fd_write_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->iov; /* const cloudabi64_ciovec_t * */ - uarg[2] = p->iovcnt; /* size_t */ + uarg[1] = (intptr_t) p->iovs; /* const cloudabi64_ciovec_t * */ + uarg[2] = p->iovs_len; /* size_t */ *n_args = 3; break; } @@ -173,7 +173,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_create_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ iarg[3] = p->type; /* cloudabi_filetype_t */ *n_args = 4; break; @@ -183,10 +183,10 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_link_args *p = params; iarg[0] = p->fd1; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path1; /* const char * */ - uarg[2] = p->path1len; /* size_t */ + uarg[2] = p->path1_len; /* size_t */ iarg[3] = p->fd2; /* cloudabi_fd_t */ uarg[4] = (intptr_t) p->path2; /* const char * */ - uarg[5] = p->path2len; /* size_t */ + uarg[5] = p->path2_len; /* size_t */ *n_args = 6; break; } @@ -195,7 +195,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_open_args *p = params; iarg[0] = p->dirfd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ iarg[3] = p->oflags; /* cloudabi_oflags_t */ uarg[4] = (intptr_t) p->fds; /* const cloudabi_fdstat_t * */ *n_args = 5; @@ -206,7 +206,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_readdir_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* void * */ - uarg[2] = p->nbyte; /* size_t */ + uarg[2] = p->buf_len; /* size_t */ iarg[3] = p->cookie; /* cloudabi_dircookie_t */ *n_args = 4; break; @@ -216,21 +216,21 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_readlink_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* char * */ - uarg[4] = p->bufsize; /* size_t */ + uarg[4] = p->buf_len; /* size_t */ *n_args = 5; break; } /* cloudabi_sys_file_rename */ case 24: { struct cloudabi_sys_file_rename_args *p = params; - iarg[0] = p->oldfd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->old; /* const char * */ - uarg[2] = p->oldlen; /* size_t */ - iarg[3] = p->newfd; /* cloudabi_fd_t */ - uarg[4] = (intptr_t) p->new; /* const char * */ - uarg[5] = p->newlen; /* size_t */ + iarg[0] = p->fd1; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->path1; /* const char * */ + uarg[2] = p->path1_len; /* size_t */ + iarg[3] = p->fd2; /* cloudabi_fd_t */ + uarg[4] = (intptr_t) p->path2; /* const char * */ + uarg[5] = p->path2_len; /* size_t */ *n_args = 6; break; } @@ -256,7 +256,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_stat_get_args *p = params; iarg[0] = p->fd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* cloudabi_filestat_t * */ *n_args = 4; break; @@ -266,7 +266,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_stat_put_args *p = params; iarg[0] = p->fd; /* cloudabi_lookup_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ uarg[3] = (intptr_t) p->buf; /* const cloudabi_filestat_t * */ iarg[4] = p->flags; /* cloudabi_fsflags_t */ *n_args = 5; @@ -276,10 +276,10 @@ systrace_args(int sysnum, void *params, case 29: { struct cloudabi_sys_file_symlink_args *p = params; uarg[0] = (intptr_t) p->path1; /* const char * */ - uarg[1] = p->path1len; /* size_t */ + uarg[1] = p->path1_len; /* size_t */ iarg[2] = p->fd; /* cloudabi_fd_t */ uarg[3] = (intptr_t) p->path2; /* const char * */ - uarg[4] = p->path2len; /* size_t */ + uarg[4] = p->path2_len; /* size_t */ *n_args = 5; break; } @@ -288,7 +288,7 @@ systrace_args(int sysnum, void *params, struct cloudabi_sys_file_unlink_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->path; /* const char * */ - uarg[2] = p->pathlen; /* size_t */ + uarg[2] = p->path_len; /* size_t */ iarg[3] = p->flags; /* cloudabi_ulflags_t */ *n_args = 4; break; @@ -304,8 +304,8 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_mem_advise */ case 32: { struct cloudabi_sys_mem_advise_args *p = params; - uarg[0] = (intptr_t) p->addr; /* void * */ - uarg[1] = p->len; /* size_t */ + uarg[0] = (intptr_t) p->mapping; /* void * */ + uarg[1] = p->mapping_len; /* size_t */ iarg[2] = p->advice; /* cloudabi_advice_t */ *n_args = 3; break; @@ -313,8 +313,8 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_mem_lock */ case 33: { struct cloudabi_sys_mem_lock_args *p = params; - uarg[0] = (intptr_t) p->addr; /* const void * */ - uarg[1] = p->len; /* size_t */ + uarg[0] = (intptr_t) p->mapping; /* const void * */ + uarg[1] = p->mapping_len; /* size_t */ *n_args = 2; break; } @@ -333,8 +333,8 @@ systrace_args(int sysnum, void *params, /* cloudabi_sys_mem_protect */ case 35: { struct cloudabi_sys_mem_protect_args *p = params; - uarg[0] = (intptr_t) p->addr; /* void * */ - uarg[1] = p->len; /* size_t */ + uarg[0] = (intptr_t) p->mapping; /* void * */ + uarg[1] = p->mapping_len; /* size_t */ iarg[2] = p->prot; /* cloudabi_mprot_t */ *n_args = 3; break; @@ -342,8 +342,8 @@ systrace_args(int sysnum, void *params, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Jan 17 22:05:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B741CB46D8; Tue, 17 Jan 2017 22:05:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDA2511FE; Tue, 17 Jan 2017 22:05:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0HM5sVA071534; Tue, 17 Jan 2017 22:05:54 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HM5qA8071516; Tue, 17 Jan 2017 22:05:52 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201701172205.v0HM5qA8071516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 17 Jan 2017 22:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312355 - in head/sys: amd64/cloudabi32 amd64/cloudabi64 arm/cloudabi32 arm64/cloudabi64 compat/cloudabi compat/cloudabi32 compat/cloudabi64 i386/cloudabi32 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, 17 Jan 2017 22:05:55 -0000 Author: ed Date: Tue Jan 17 22:05:52 2017 New Revision: 312355 URL: https://svnweb.freebsd.org/changeset/base/312355 Log: Catch up with changes to structure member names. Pointer/length pairs are now always named ${name} and ${name}_len. Modified: head/sys/amd64/cloudabi32/cloudabi32_sysvec.c head/sys/amd64/cloudabi64/cloudabi64_sysvec.c head/sys/arm/cloudabi32/cloudabi32_sysvec.c head/sys/arm64/cloudabi64/cloudabi64_sysvec.c head/sys/compat/cloudabi/cloudabi_file.c head/sys/compat/cloudabi/cloudabi_mem.c head/sys/compat/cloudabi/cloudabi_proc.c head/sys/compat/cloudabi/cloudabi_random.c head/sys/compat/cloudabi/cloudabi_sock.c head/sys/compat/cloudabi32/cloudabi32_fd.c head/sys/compat/cloudabi32/cloudabi32_poll.c head/sys/compat/cloudabi32/cloudabi32_sock.c head/sys/compat/cloudabi32/cloudabi32_thread.c head/sys/compat/cloudabi64/cloudabi64_fd.c head/sys/compat/cloudabi64/cloudabi64_poll.c head/sys/compat/cloudabi64/cloudabi64_sock.c head/sys/compat/cloudabi64/cloudabi64_thread.c head/sys/i386/cloudabi32/cloudabi32_sysvec.c Modified: head/sys/amd64/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi32/cloudabi32_sysvec.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/amd64/cloudabi32/cloudabi32_sysvec.c Tue Jan 17 22:05:52 2017 (r312355) @@ -181,7 +181,7 @@ cloudabi32_thread_setregs(struct thread /* Perform standard register initialization. */ stack.ss_sp = TO_PTR(attr->stack); - stack.ss_size = attr->stack_size - sizeof(args); + stack.ss_size = attr->stack_len - sizeof(args); cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack); /* Modified: head/sys/amd64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/amd64/cloudabi64/cloudabi64_sysvec.c Tue Jan 17 22:05:52 2017 (r312355) @@ -164,7 +164,7 @@ cloudabi64_thread_setregs(struct thread * from the top of the stack to store a single element array, * containing a pointer to the TCB. %fs base will point to this. */ - tcbptr = rounddown(attr->stack + attr->stack_size - sizeof(tcbptr), + tcbptr = rounddown(attr->stack + attr->stack_len - sizeof(tcbptr), _Alignof(tcbptr)); error = copyout(&tcb, (void *)tcbptr, sizeof(tcb)); if (error != 0) Modified: head/sys/arm/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/arm/cloudabi32/cloudabi32_sysvec.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/arm/cloudabi32/cloudabi32_sysvec.c Tue Jan 17 22:05:52 2017 (r312355) @@ -148,7 +148,7 @@ cloudabi32_thread_setregs(struct thread /* Perform standard register initialization. */ stack.ss_sp = TO_PTR(attr->stack); - stack.ss_size = attr->stack_size; + stack.ss_size = attr->stack_len; cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack); /* Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Tue Jan 17 22:05:52 2017 (r312355) @@ -140,7 +140,7 @@ cloudabi64_thread_setregs(struct thread /* Perform standard register initialization. */ stack.ss_sp = TO_PTR(attr->stack); - stack.ss_size = attr->stack_size; + stack.ss_size = attr->stack_len; cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack); /* Modified: head/sys/compat/cloudabi/cloudabi_file.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_file.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi/cloudabi_file.c Tue Jan 17 22:05:52 2017 (r312355) @@ -146,7 +146,7 @@ cloudabi_sys_file_create(struct thread * char *path; int error; - error = copyin_path(uap->path, uap->pathlen, &path); + error = copyin_path(uap->path, uap->path_len, &path); if (error != 0) return (error); @@ -177,10 +177,10 @@ cloudabi_sys_file_link(struct thread *td char *path1, *path2; int error; - error = copyin_path(uap->path1, uap->path1len, &path1); + error = copyin_path(uap->path1, uap->path1_len, &path1); if (error != 0) return (error); - error = copyin_path(uap->path2, uap->path2len, &path2); + error = copyin_path(uap->path2, uap->path2_len, &path2); if (error != 0) { cloudabi_freestr(path1); return (error); @@ -261,7 +261,7 @@ cloudabi_sys_file_open(struct thread *td fp->f_flag = fflags & FMASK; /* Open path. */ - error = copyin_path(uap->path, uap->pathlen, &path); + error = copyin_path(uap->path, uap->path_len, &path); if (error != 0) { fdrop(fp, td); return (error); @@ -380,7 +380,7 @@ cloudabi_sys_file_readdir(struct thread { struct iovec iov = { .iov_base = uap->buf, - .iov_len = uap->nbyte + .iov_len = uap->buf_len }; struct uio uio = { .uio_iov = &iov, @@ -494,7 +494,7 @@ done: return (error); /* Return number of bytes copied to userspace. */ - td->td_retval[0] = uap->nbyte - uio.uio_resid; + td->td_retval[0] = uap->buf_len - uio.uio_resid; return (0); } @@ -505,12 +505,12 @@ cloudabi_sys_file_readlink(struct thread char *path; int error; - error = copyin_path(uap->path, uap->pathlen, &path); + error = copyin_path(uap->path, uap->path_len, &path); if (error != 0) return (error); error = kern_readlinkat(td, uap->fd, path, UIO_SYSSPACE, - uap->buf, UIO_USERSPACE, uap->bufsize); + uap->buf, UIO_USERSPACE, uap->buf_len); cloudabi_freestr(path); return (error); } @@ -522,16 +522,16 @@ cloudabi_sys_file_rename(struct thread * char *old, *new; int error; - error = copyin_path(uap->old, uap->oldlen, &old); + error = copyin_path(uap->path1, uap->path1_len, &old); if (error != 0) return (error); - error = copyin_path(uap->new, uap->newlen, &new); + error = copyin_path(uap->path2, uap->path2_len, &new); if (error != 0) { cloudabi_freestr(old); return (error); } - error = kern_renameat(td, uap->oldfd, old, uap->newfd, new, + error = kern_renameat(td, uap->fd1, old, uap->fd2, new, UIO_SYSSPACE); cloudabi_freestr(old); cloudabi_freestr(new); @@ -653,7 +653,7 @@ cloudabi_sys_file_stat_get(struct thread char *path; int error; - error = copyin_path(uap->path, uap->pathlen, &path); + error = copyin_path(uap->path, uap->path_len, &path); if (error != 0) return (error); @@ -707,7 +707,7 @@ cloudabi_sys_file_stat_put(struct thread error = copyin(uap->buf, &fs, sizeof(fs)); if (error != 0) return (error); - error = copyin_path(uap->path, uap->pathlen, &path); + error = copyin_path(uap->path, uap->path_len, &path); if (error != 0) return (error); @@ -726,10 +726,10 @@ cloudabi_sys_file_symlink(struct thread char *path1, *path2; int error; - error = copyin_path(uap->path1, uap->path1len, &path1); + error = copyin_path(uap->path1, uap->path1_len, &path1); if (error != 0) return (error); - error = copyin_path(uap->path2, uap->path2len, &path2); + error = copyin_path(uap->path2, uap->path2_len, &path2); if (error != 0) { cloudabi_freestr(path1); return (error); @@ -748,7 +748,7 @@ cloudabi_sys_file_unlink(struct thread * char *path; int error; - error = copyin_path(uap->path, uap->pathlen, &path); + error = copyin_path(uap->path, uap->path_len, &path); if (error != 0) return (error); Modified: head/sys/compat/cloudabi/cloudabi_mem.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_mem.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi/cloudabi_mem.c Tue Jan 17 22:05:52 2017 (r312355) @@ -63,8 +63,8 @@ cloudabi_sys_mem_advise(struct thread *t struct cloudabi_sys_mem_advise_args *uap) { struct madvise_args madvise_args = { - .addr = uap->addr, - .len = uap->len + .addr = uap->mapping, + .len = uap->mapping_len }; switch (uap->advice) { @@ -94,8 +94,8 @@ int cloudabi_sys_mem_lock(struct thread *td, struct cloudabi_sys_mem_lock_args *uap) { struct mlock_args mlock_args = { - .addr = uap->addr, - .len = uap->len + .addr = uap->mapping, + .len = uap->mapping_len }; return (sys_mlock(td, &mlock_args)); @@ -135,8 +135,8 @@ cloudabi_sys_mem_protect(struct thread * struct cloudabi_sys_mem_protect_args *uap) { struct mprotect_args mprotect_args = { - .addr = uap->addr, - .len = uap->len, + .addr = uap->mapping, + .len = uap->mapping_len, }; int error; @@ -152,8 +152,8 @@ int cloudabi_sys_mem_sync(struct thread *td, struct cloudabi_sys_mem_sync_args *uap) { struct msync_args msync_args = { - .addr = uap->addr, - .len = uap->len, + .addr = uap->mapping, + .len = uap->mapping_len, }; /* Convert flags. */ @@ -178,8 +178,8 @@ cloudabi_sys_mem_unlock(struct thread *t struct cloudabi_sys_mem_unlock_args *uap) { struct munlock_args munlock_args = { - .addr = uap->addr, - .len = uap->len + .addr = uap->mapping, + .len = uap->mapping_len }; return (sys_munlock(td, &munlock_args)); @@ -190,8 +190,8 @@ cloudabi_sys_mem_unmap(struct thread *td struct cloudabi_sys_mem_unmap_args *uap) { struct munmap_args munmap_args = { - .addr = uap->addr, - .len = uap->len + .addr = uap->mapping, + .len = uap->mapping_len }; return (sys_munmap(td, &munmap_args)); Modified: head/sys/compat/cloudabi/cloudabi_proc.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_proc.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi/cloudabi_proc.c Tue Jan 17 22:05:52 2017 (r312355) @@ -53,8 +53,8 @@ cloudabi_sys_proc_exec(struct thread *td error = pre_execve(td, &oldvmspace); if (error != 0) return (error); - error = exec_copyin_data_fds(td, &args, uap->data, uap->datalen, - uap->fds, uap->fdslen); + error = exec_copyin_data_fds(td, &args, uap->data, uap->data_len, + uap->fds, uap->fds_len); if (error == 0) { args.fd = uap->fd; error = kern_execve(td, &args, NULL); Modified: head/sys/compat/cloudabi/cloudabi_random.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_random.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi/cloudabi_random.c Tue Jan 17 22:05:52 2017 (r312355) @@ -38,7 +38,7 @@ cloudabi_sys_random_get(struct thread *t { struct iovec iov = { .iov_base = uap->buf, - .iov_len = uap->nbyte + .iov_len = uap->buf_len }; struct uio uio = { .uio_iov = &iov, Modified: head/sys/compat/cloudabi/cloudabi_sock.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_sock.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi/cloudabi_sock.c Tue Jan 17 22:05:52 2017 (r312355) @@ -141,7 +141,7 @@ cloudabi_sys_sock_bind(struct thread *td struct sockaddr_un sun; int error; - error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun); + error = copyin_sockaddr_un(uap->path, uap->path_len, &sun); if (error != 0) return (error); return (kern_bindat(td, uap->fd, uap->sock, (struct sockaddr *)&sun)); @@ -154,7 +154,7 @@ cloudabi_sys_sock_connect(struct thread struct sockaddr_un sun; int error; - error = copyin_sockaddr_un(uap->path, uap->pathlen, &sun); + error = copyin_sockaddr_un(uap->path, uap->path_len, &sun); if (error != 0) return (error); return (kern_connectat(td, uap->fd, uap->sock, Modified: head/sys/compat/cloudabi32/cloudabi32_fd.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_fd.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi32/cloudabi32_fd.c Tue Jan 17 22:05:52 2017 (r312355) @@ -71,8 +71,8 @@ cloudabi32_copyinuio(const cloudabi32_io free(uio, M_IOV); return (error); } - iov[i].iov_base = TO_PTR(iovobj.iov_base); - iov[i].iov_len = iovobj.iov_len; + iov[i].iov_base = TO_PTR(iovobj.buf); + iov[i].iov_len = iovobj.buf_len; if (iov[i].iov_len > INT32_MAX - uio->uio_resid) { free(uio, M_IOV); return (EINVAL); @@ -91,7 +91,7 @@ cloudabi32_sys_fd_pread(struct thread *t struct uio *uio; int error; - error = cloudabi32_copyinuio(uap->iov, uap->iovcnt, &uio); + error = cloudabi32_copyinuio(uap->iovs, uap->iovs_len, &uio); if (error != 0) return (error); error = kern_preadv(td, uap->fd, uio, uap->offset); @@ -106,7 +106,7 @@ cloudabi32_sys_fd_pwrite(struct thread * struct uio *uio; int error; - error = cloudabi32_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); + error = cloudabi32_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio); if (error != 0) return (error); error = kern_pwritev(td, uap->fd, uio, uap->offset); @@ -121,7 +121,7 @@ cloudabi32_sys_fd_read(struct thread *td struct uio *uio; int error; - error = cloudabi32_copyinuio(uap->iov, uap->iovcnt, &uio); + error = cloudabi32_copyinuio(uap->iovs, uap->iovs_len, &uio); if (error != 0) return (error); error = kern_readv(td, uap->fd, uio); @@ -136,7 +136,7 @@ cloudabi32_sys_fd_write(struct thread *t struct uio *uio; int error; - error = cloudabi32_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); + error = cloudabi32_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio); if (error != 0) return (error); error = kern_writev(td, uap->fd, uio); Modified: head/sys/compat/cloudabi32/cloudabi32_poll.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_poll.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi32/cloudabi32_poll.c Tue Jan 17 22:05:52 2017 (r312355) @@ -398,11 +398,11 @@ cloudabi32_sys_poll_fd(struct thread *td return (EINVAL); timeout.tv_sec = subtimo.clock.timeout / 1000000000; timeout.tv_nsec = subtimo.clock.timeout % 1000000000; - return (kern_kevent(td, uap->fd, uap->nin, uap->nout, ©ops, - &timeout)); + return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len, + ©ops, &timeout)); } else { /* Poll without a timeout. */ - return (kern_kevent(td, uap->fd, uap->nin, uap->nout, ©ops, - NULL)); + return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len, + ©ops, NULL)); } } Modified: head/sys/compat/cloudabi32/cloudabi32_sock.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_sock.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi32/cloudabi32_sock.c Tue Jan 17 22:05:52 2017 (r312355) @@ -62,9 +62,9 @@ cloudabi32_sys_sock_recv(struct thread * return (error); /* Convert results in cloudabi_recv_in_t to struct msghdr. */ - if (ri.ri_datalen > UIO_MAXIOV) + if (ri.ri_data_len > UIO_MAXIOV) return (EINVAL); - msghdr.msg_iovlen = ri.ri_datalen; + msghdr.msg_iovlen = ri.ri_data_len; msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec), M_SOCKET, M_WAITOK); user_iov = TO_PTR(ri.ri_data); @@ -74,8 +74,8 @@ cloudabi32_sys_sock_recv(struct thread * free(msghdr.msg_iov, M_SOCKET); return (error); } - msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base); - msghdr.msg_iov[i].iov_len = iovobj.iov_len; + msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf); + msghdr.msg_iov[i].iov_len = iovobj.buf_len; } msghdr.msg_name = &ss; msghdr.msg_namelen = sizeof(ss); @@ -115,9 +115,9 @@ cloudabi32_sys_sock_send(struct thread * return (error); /* Convert results in cloudabi_send_in_t to struct msghdr. */ - if (si.si_datalen > UIO_MAXIOV) + if (si.si_data_len > UIO_MAXIOV) return (EINVAL); - msghdr.msg_iovlen = si.si_datalen; + msghdr.msg_iovlen = si.si_data_len; msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec), M_SOCKET, M_WAITOK); user_iov = TO_PTR(si.si_data); @@ -127,8 +127,8 @@ cloudabi32_sys_sock_send(struct thread * free(msghdr.msg_iov, M_SOCKET); return (error); } - msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base); - msghdr.msg_iov[i].iov_len = iovobj.iov_len; + msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf); + msghdr.msg_iov[i].iov_len = iovobj.buf_len; } flags = MSG_NOSIGNAL; Modified: head/sys/compat/cloudabi32/cloudabi32_thread.c ============================================================================== --- head/sys/compat/cloudabi32/cloudabi32_thread.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi32/cloudabi32_thread.c Tue Jan 17 22:05:52 2017 (r312355) @@ -65,9 +65,9 @@ cloudabi32_sys_thread_create(struct thre return (error); /* Remove some space on the top of the stack for the TCB. */ - args.tcb = rounddown(args.attr.stack + args.attr.stack_size - + args.tcb = rounddown(args.attr.stack + args.attr.stack_len - sizeof(cloudabi32_tcb_t), _Alignof(cloudabi32_tcb_t)); - args.attr.stack_size = args.tcb - args.attr.stack; + args.attr.stack_len = args.tcb - args.attr.stack; error = thread_create(td, NULL, initialize_thread, &args); if (error != 0) Modified: head/sys/compat/cloudabi64/cloudabi64_fd.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_fd.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi64/cloudabi64_fd.c Tue Jan 17 22:05:52 2017 (r312355) @@ -71,8 +71,8 @@ cloudabi64_copyinuio(const cloudabi64_io free(uio, M_IOV); return (error); } - iov[i].iov_base = TO_PTR(iovobj.iov_base); - iov[i].iov_len = iovobj.iov_len; + iov[i].iov_base = TO_PTR(iovobj.buf); + iov[i].iov_len = iovobj.buf_len; if (iov[i].iov_len > INT64_MAX - uio->uio_resid) { free(uio, M_IOV); return (EINVAL); @@ -91,7 +91,7 @@ cloudabi64_sys_fd_pread(struct thread *t struct uio *uio; int error; - error = cloudabi64_copyinuio(uap->iov, uap->iovcnt, &uio); + error = cloudabi64_copyinuio(uap->iovs, uap->iovs_len, &uio); if (error != 0) return (error); error = kern_preadv(td, uap->fd, uio, uap->offset); @@ -106,7 +106,7 @@ cloudabi64_sys_fd_pwrite(struct thread * struct uio *uio; int error; - error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); + error = cloudabi64_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio); if (error != 0) return (error); error = kern_pwritev(td, uap->fd, uio, uap->offset); @@ -121,7 +121,7 @@ cloudabi64_sys_fd_read(struct thread *td struct uio *uio; int error; - error = cloudabi64_copyinuio(uap->iov, uap->iovcnt, &uio); + error = cloudabi64_copyinuio(uap->iovs, uap->iovs_len, &uio); if (error != 0) return (error); error = kern_readv(td, uap->fd, uio); @@ -136,7 +136,7 @@ cloudabi64_sys_fd_write(struct thread *t struct uio *uio; int error; - error = cloudabi64_copyinuio(TO_PTR(uap->iov), uap->iovcnt, &uio); + error = cloudabi64_copyinuio(TO_PTR(uap->iovs), uap->iovs_len, &uio); if (error != 0) return (error); error = kern_writev(td, uap->fd, uio); Modified: head/sys/compat/cloudabi64/cloudabi64_poll.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_poll.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi64/cloudabi64_poll.c Tue Jan 17 22:05:52 2017 (r312355) @@ -398,11 +398,11 @@ cloudabi64_sys_poll_fd(struct thread *td return (EINVAL); timeout.tv_sec = subtimo.clock.timeout / 1000000000; timeout.tv_nsec = subtimo.clock.timeout % 1000000000; - return (kern_kevent(td, uap->fd, uap->nin, uap->nout, ©ops, - &timeout)); + return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len, + ©ops, &timeout)); } else { /* Poll without a timeout. */ - return (kern_kevent(td, uap->fd, uap->nin, uap->nout, ©ops, - NULL)); + return (kern_kevent(td, uap->fd, uap->in_len, uap->out_len, + ©ops, NULL)); } } Modified: head/sys/compat/cloudabi64/cloudabi64_sock.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sock.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi64/cloudabi64_sock.c Tue Jan 17 22:05:52 2017 (r312355) @@ -62,9 +62,9 @@ cloudabi64_sys_sock_recv(struct thread * return (error); /* Convert results in cloudabi_recv_in_t to struct msghdr. */ - if (ri.ri_datalen > UIO_MAXIOV) + if (ri.ri_data_len > UIO_MAXIOV) return (EINVAL); - msghdr.msg_iovlen = ri.ri_datalen; + msghdr.msg_iovlen = ri.ri_data_len; msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec), M_SOCKET, M_WAITOK); user_iov = TO_PTR(ri.ri_data); @@ -74,8 +74,8 @@ cloudabi64_sys_sock_recv(struct thread * free(msghdr.msg_iov, M_SOCKET); return (error); } - msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base); - msghdr.msg_iov[i].iov_len = iovobj.iov_len; + msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf); + msghdr.msg_iov[i].iov_len = iovobj.buf_len; } msghdr.msg_name = &ss; msghdr.msg_namelen = sizeof(ss); @@ -115,9 +115,9 @@ cloudabi64_sys_sock_send(struct thread * return (error); /* Convert results in cloudabi_send_in_t to struct msghdr. */ - if (si.si_datalen > UIO_MAXIOV) + if (si.si_data_len > UIO_MAXIOV) return (EINVAL); - msghdr.msg_iovlen = si.si_datalen; + msghdr.msg_iovlen = si.si_data_len; msghdr.msg_iov = malloc(msghdr.msg_iovlen * sizeof(struct iovec), M_SOCKET, M_WAITOK); user_iov = TO_PTR(si.si_data); @@ -127,8 +127,8 @@ cloudabi64_sys_sock_send(struct thread * free(msghdr.msg_iov, M_SOCKET); return (error); } - msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.iov_base); - msghdr.msg_iov[i].iov_len = iovobj.iov_len; + msghdr.msg_iov[i].iov_base = TO_PTR(iovobj.buf); + msghdr.msg_iov[i].iov_len = iovobj.buf_len; } flags = MSG_NOSIGNAL; Modified: head/sys/compat/cloudabi64/cloudabi64_thread.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_thread.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/compat/cloudabi64/cloudabi64_thread.c Tue Jan 17 22:05:52 2017 (r312355) @@ -65,9 +65,9 @@ cloudabi64_sys_thread_create(struct thre return (error); /* Remove some space on the top of the stack for the TCB. */ - args.tcb = rounddown(args.attr.stack + args.attr.stack_size - + args.tcb = rounddown(args.attr.stack + args.attr.stack_len - sizeof(cloudabi64_tcb_t), _Alignof(cloudabi64_tcb_t)); - args.attr.stack_size = args.tcb - args.attr.stack; + args.attr.stack_len = args.tcb - args.attr.stack; error = thread_create(td, NULL, initialize_thread, &args); if (error != 0) Modified: head/sys/i386/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/i386/cloudabi32/cloudabi32_sysvec.c Tue Jan 17 22:05:01 2017 (r312354) +++ head/sys/i386/cloudabi32/cloudabi32_sysvec.c Tue Jan 17 22:05:52 2017 (r312355) @@ -156,7 +156,7 @@ cloudabi32_thread_setregs(struct thread /* Perform standard register initialization. */ stack.ss_sp = TO_PTR(attr->stack); - stack.ss_size = attr->stack_size - sizeof(args); + stack.ss_size = attr->stack_len - sizeof(args); cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack); /* From owner-svn-src-all@freebsd.org Tue Jan 17 23:21:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B39E9CB55F1; Tue, 17 Jan 2017 23:21:21 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) (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 50E4C17C6; Tue, 17 Jan 2017 23:21:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f54.google.com with SMTP id c85so221928646wmi.1; Tue, 17 Jan 2017 15:21:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=DOGI3p3DSfSm6K3d5h9gx6IJmAjShAu/m1BUFfJLIoE=; b=XaMNXtY+dMcFc5el/soAho+UPNwUNVoBkACZ6lkhGo9suSRQwPZxVny7aq+te9+YBA fJR5OtV74/yVu9aUL/Uukn6Qdfpaav1jFsNWANHfr2uxT7O7lZF/vv3ocnh/XB/d6OOR 4bkY9Py4EhlH8iQnljSC7ZzFCo23EGcj7sFq67y2/XC+2cSPwxEnr8+2SHnLbNoTBMfK xKDXdlMk/yb7xmS1LDvMtfhRRROU14otWb9R/jJ4cnyKgncuMVLbDSVxiVAZt3rV8RkY W+e6PaFDMgYTXYngsqX9VEPrGY5VohyWn1j2ukuY3safVGcjlH6sW6P8ingEwhFXYgXz biNA== X-Gm-Message-State: AIkVDXIlHjPRtOzolHW2W2PLTvcdpoJItdI75EkH5elc9Y8uNDXRyA576FIjb/yxXinukg== X-Received: by 10.223.134.151 with SMTP id 23mr159011wrx.0.1484695279036; Tue, 17 Jan 2017 15:21:19 -0800 (PST) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com. [74.125.82.44]) by smtp.gmail.com with ESMTPSA id 204sm40555516wmj.7.2017.01.17.15.21.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2017 15:21:18 -0800 (PST) Received: by mail-wm0-f44.google.com with SMTP id r144so247567754wme.1; Tue, 17 Jan 2017 15:21:18 -0800 (PST) X-Received: by 10.223.174.183 with SMTP id y52mr144595wrc.112.1484695278766; Tue, 17 Jan 2017 15:21:18 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.29.72 with HTTP; Tue, 17 Jan 2017 15:21:18 -0800 (PST) In-Reply-To: References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> <20170117212713.GZ2611@FreeBSD.org> From: Conrad Meyer Date: Tue, 17 Jan 2017 15:21:18 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Maxim Sobolev 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: Tue, 17 Jan 2017 23:21:21 -0000 Ian's potential objection has been met by Ben Kaduk and Eric van Gyzen's responses. It seems like an enum is just fine. And I agree with Gleb that it is preferable. Conrad On Tue, Jan 17, 2017 at 1:34 PM, Maxim Sobolev wrote: > Well as other pointed out there are some concerns with using enums from C++ > and ABI prospective. So it looks to me that there is no general consensus on > that direction. > > -Max > > On Tue, Jan 17, 2017 at 1:27 PM, Gleb Smirnoff wrote: >> >> On Tue, Jan 17, 2017 at 08:40:50AM -0800, Maxim Sobolev wrote: >> M> That being said, is there any other socket option value in there >> M> implemented as enum? I don't see anything obvious, so that I am curious >> if >> M> it would stick out as an odd one in there. What do you think? >> >> Simply because 30 years ago the language didn't allow that, and later >> additions mimiced the older sockopts. We need to break this loop :) >> >> -- >> Totus tuus, Glebius. >> > From owner-svn-src-all@freebsd.org Tue Jan 17 23:47:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3909CB5406; Tue, 17 Jan 2017 23:47:38 +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 B2C1C1A85; Tue, 17 Jan 2017 23:47:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0HNlbQc011650; Tue, 17 Jan 2017 23:47:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HNlbLp011649; Tue, 17 Jan 2017 23:47:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701172347.v0HNlbLp011649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 23:47: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: r312356 - stable/11/sys/modules/cam 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, 17 Jan 2017 23:47:39 -0000 Author: ngie Date: Tue Jan 17 23:47:37 2017 New Revision: 312356 URL: https://svnweb.freebsd.org/changeset/base/312356 Log: MFC r303166: r303166 (by imp): Add opt_ddb.h. Modified: stable/11/sys/modules/cam/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/cam/Makefile ============================================================================== --- stable/11/sys/modules/cam/Makefile Tue Jan 17 22:05:52 2017 (r312355) +++ stable/11/sys/modules/cam/Makefile Tue Jan 17 23:47:37 2017 (r312356) @@ -14,6 +14,7 @@ SRCS+= opt_cd.h SRCS+= opt_pt.h SRCS+= opt_sa.h SRCS+= opt_ses.h +SRCS+= opt_ddb.h SRCS+= device_if.h bus_if.h vnode_if.h SRCS+= cam.c SRCS+= cam_compat.c From owner-svn-src-all@freebsd.org Tue Jan 17 23:52:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 231CDCB56FC for ; Tue, 17 Jan 2017 23:52:37 +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 AAE4A1FF1 for ; Tue, 17 Jan 2017 23:52:35 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 04a44090-dd10-11e6-9357-bffcd86bd944 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 04a44090-dd10-11e6-9357-bffcd86bd944; Tue, 17 Jan 2017 23:52:36 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v0HNqPxi018516; Tue, 17 Jan 2017 16:52:25 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1484697145.86335.183.camel@freebsd.org> Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg From: Ian Lepore To: cem@freebsd.org, Maxim Sobolev Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 17 Jan 2017 16:52:25 -0700 In-Reply-To: References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> <20170117212713.GZ2611@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: Tue, 17 Jan 2017 23:52:37 -0000 I actually don't agree that it's all good, but I also don't have the time to prove it's not (or prove myself wrong, which could certainly be the case). -- Ian On Tue, 2017-01-17 at 15:21 -0800, Conrad Meyer wrote: > Ian's potential objection has been met by Ben Kaduk and Eric van > Gyzen's responses.  It seems like an enum is just fine.  And I agree > with Gleb that it is preferable. > > Conrad > > On Tue, Jan 17, 2017 at 1:34 PM, Maxim Sobolev > wrote: > > > > Well as other pointed out there are some concerns with using enums > > from C++ > > and ABI prospective. So it looks to me that there is no general > > consensus on > > that direction. > > > > -Max > > > > On Tue, Jan 17, 2017 at 1:27 PM, Gleb Smirnoff > > wrote: > > > > > > > > > On Tue, Jan 17, 2017 at 08:40:50AM -0800, Maxim Sobolev wrote: > > > M> That being said, is there any other socket option value in > > > there > > > M> implemented as enum? I don't see anything obvious, so that I > > > am curious > > > if > > > M> it would stick out as an odd one in there. What do you think? > > > > > > Simply because 30 years ago the language didn't allow that, and > > > later > > > additions mimiced the older sockopts. We need to break this loop > > > :) > > > > > > -- > > > Totus tuus, Glebius. > > > From owner-svn-src-all@freebsd.org Tue Jan 17 23:55:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CE3BCB577E; Tue, 17 Jan 2017 23:55:11 +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 5B9AC11C2; Tue, 17 Jan 2017 23:55:11 +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 v0HNtAHV015523; Tue, 17 Jan 2017 23:55:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0HNtA4H015522; Tue, 17 Jan 2017 23:55:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701172355.v0HNtA4H015522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 17 Jan 2017 23:55: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: r312357 - in stable/10/sys: cam/scsi modules/cam 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: Tue, 17 Jan 2017 23:55:11 -0000 Author: ngie Date: Tue Jan 17 23:55:10 2017 New Revision: 312357 URL: https://svnweb.freebsd.org/changeset/base/312357 Log: MFC r299864,r303166: r299864 (by markj): opt_kdtrace.h is not needed for SDT probes as of r258541. r303166 (by imp): Add opt_ddb.h. Modified: stable/10/sys/cam/scsi/scsi_pass.c stable/10/sys/modules/cam/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_pass.c Tue Jan 17 23:47:37 2017 (r312356) +++ stable/10/sys/cam/scsi/scsi_pass.c Tue Jan 17 23:55:10 2017 (r312357) @@ -28,8 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_kdtrace.h" - #include #include #include Modified: stable/10/sys/modules/cam/Makefile ============================================================================== --- stable/10/sys/modules/cam/Makefile Tue Jan 17 23:47:37 2017 (r312356) +++ stable/10/sys/modules/cam/Makefile Tue Jan 17 23:55:10 2017 (r312357) @@ -14,6 +14,7 @@ SRCS+= opt_cd.h SRCS+= opt_pt.h SRCS+= opt_sa.h SRCS+= opt_ses.h +SRCS+= opt_ddb.h SRCS+= device_if.h bus_if.h vnode_if.h SRCS+= cam.c SRCS+= cam_compat.c From owner-svn-src-all@freebsd.org Tue Jan 17 23:57:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D66B9CB5A98; Tue, 17 Jan 2017 23:57:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::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 A3636147B; Tue, 17 Jan 2017 23:57:37 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id 194so9138874pgd.0; Tue, 17 Jan 2017 15:57:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=PrUvL/T62pNn/HMk/Aua3pnYb8/rBjh+FiFdotY8tNA=; b=Krq0DXBlGIFOjR1zTeBvlbPzb90wTLimN9A6B0xBXFjZ27/Iiq1mKWWHou9mUwuEyJ yOnaEqSt0dpY6JqdfDNhQFwuyUCKlz7cPNSFIgTD0zx+qCwdd3uJ9Dt6wYjr+obtwAUg OEFAHjHkfi+y08up+Tg0/5MpyrdHWVw23ck3y49cd52QkWlq60bcak44SnwY6caKxF4M 8O5azBEew82/A19TWyF369G5jqHyTziUmhxYtpz9xvzAqXHc87RtgIhnOb393b6p2HSk rDSevzVqdM52s4VEXfwiwroo9e6GssWW2HDE97swBiQ1R+rF/0wQ3x+tMp7FUp2niILl shMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=PrUvL/T62pNn/HMk/Aua3pnYb8/rBjh+FiFdotY8tNA=; b=c89au/koGQm6gBMRoRW48ikERC3vHm1qIZRIaTJotQSLS6qimBBFD/TTshIFcobIx2 tvezimd3U9J3SDiQ4AL+YNDzymHC8hgerue+S5JVqtjXF8FjxTPEi1NPtMC//KegOw9F enTyFWTtiM1igAvIfaBsTo12U/B5pNCK2839bXE+4L1ysdG5/uN+iFdLRKS6UMI2gkxq rGYz04YZXFSqc9V8qRfqfkdAtwf/GMxdIPV/LUcg7bzRKPE21Zv5Fz4aAcAmyq3aMYlJ 8jbaxoQC/KFsYn9atfNgHeiulpiUSkjddPP7kkYyLiNtJu+U222owJqhruJxkIBZbYBI CfeA== X-Gm-Message-State: AIkVDXJe2+QuCgeBWcFtX3+cbe7lQJapc0/vOwxhwJb6+dSZ+PIkksJeKivXzFKQ9Tc/vQ== X-Received: by 10.84.130.5 with SMTP id 5mr457432plc.69.1484697456778; Tue, 17 Jan 2017 15:57:36 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id b1sm8802845pfa.28.2017.01.17.15.57.35 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 15:57:36 -0800 (PST) Subject: Re: svn commit: r312356 - stable/11/sys/modules/cam Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_748667B6-FEAC-4487-8CA6-FAB8C97F6C22"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701172347.v0HNlbLp011649@repo.freebsd.org> Date: Tue, 17 Jan 2017 15:57:34 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org, ports@grosbein.net Message-Id: References: <201701172347.v0HNlbLp011649@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: Tue, 17 Jan 2017 23:57:37 -0000 --Apple-Mail=_748667B6-FEAC-4487-8CA6-FAB8C97F6C22 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jan 17, 2017, at 15:47, Ngie Cooper wrote: > > Author: ngie > Date: Tue Jan 17 23:47:37 2017 > New Revision: 312356 > URL: https://svnweb.freebsd.org/changeset/base/312356 > > Log: > MFC r303166: > r303166 (by imp): > > Add opt_ddb.h. This MFC fixes bug 213535 as well. Reported by: Eugene Grosbein -Ngie --Apple-Mail=_748667B6-FEAC-4487-8CA6-FAB8C97F6C22 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 iQIcBAEBCgAGBQJYfq9vAAoJEPWDqSZpMIYVaukQALXNyjaIllh7tbfg9cOCs8u0 SCwIgplSf0KZEVAisoVz4A5WoO8yj0NqWXVXlpwn33YmLxcQIei3OVzFN0v1lF46 SdGaeEWFp4QfHU8CK6nsXlSOXDjuLz12C55Frw5xX2YD/dgCdkuHWCBbfJU1FTfl oztsLF2C+2yyzZdHrH593FTVA1w3X+qA09F1fBMpIgoSQorEWPVQ26JjCgnt8DWX CPx+VbORFJOKNB7KwEUfninQd8P3fX322khixUOhY0d4tLYXIO8IwSv2zxaQKSSh UJI+5UucCo7mvO3IWmkeybYwj/fegAmY9TYUKbks1Gwu98XUzr4nOvypsq7izKFy 1NhM6zhOfJAQ52GDo4/UyZxb2eASGQp2gMD8rfcZIkKKf/AmV+4t+SoGKzUX5elz KPCypuyq2PM7bxJONR15o6lxedY3EFLt4uqfLgXkrwt4QI6h/+aHBvkqBb94G7Fz XET7x4j1AZGA4ZFRzzQ8mhXFLQZBBqd5EcLbITJ97uBEh7w9V3mk1sK/3DPvkyZm 04BHV9W8cYMDOTBwOEjk9GniyLdYydSCTmNU56w1jHfzujHmZNUxkXzMgkG3CpFE 2ZRmEf53fGsrAGJ2gjecQhhzCspN0D9h30D4j/3HddcRv/4VnJSHVwhoeEhbDXSV /In0aC3PDkYi4UFEuu5C =h+IC -----END PGP SIGNATURE----- --Apple-Mail=_748667B6-FEAC-4487-8CA6-FAB8C97F6C22-- From owner-svn-src-all@freebsd.org Tue Jan 17 23:58:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AEE9CB5B22; Tue, 17 Jan 2017 23:58:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::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 644121635; Tue, 17 Jan 2017 23:58:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x243.google.com with SMTP id 19so6393965pfo.3; Tue, 17 Jan 2017 15:58:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=usUyyjXPhk1Nq8xbwsKjiSVHVL72HemtDJkxnqOY6Uk=; b=LthrvEyXKiHDln11uzxbdu5JiT9OsI5wzKDHzqeiaitLc9JO4T6W2kHTqOmEu5IQOQ RNtz0d1UIzJGUtCrBCUs+hJcu4CjhIaAfNtXSGxapE+/VXwL5UR50uE3sS6WzfEWl8bm 3VzU81qjBOGyIykiTdr/sH4Zz3r2rtiLHRbReKK7ddoduOmy+khwQR9r1H4kDW/UTKpC nJv4Q6etvr4EHsv27zXGibfQKoUBXetfELdFifEuOKr7DbqKbgE2TIxwQ4o8WU72IviZ /c9cstqO5qVQJ5WfW48dSYz2GbeEvdgE5NJlMHV20QSQGwBEdBTUp3rLL1Rsmak6JVuY NPKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=usUyyjXPhk1Nq8xbwsKjiSVHVL72HemtDJkxnqOY6Uk=; b=ispcX2bvRQOTRJOll60HyO7xdyH5wuditfgm990cfesjHdHssqheltMqCNRjE36IxP QlhS5y0jqKfXQPObCy+iSmJXtHZX4RXh5D8uWz27U/XPpi0jF1Zm+6QpxERxO9sgr/s3 IQvvYPBl6LkH8WfwplBakEimkD63rMwEY4V255ix6qukAEnopq74ZwTzNhS6fVMqFEM+ geN/j+a6tLpsgjPA3zFYH6I1p19D/Ww7y9JqF9M0TUpHIJfSjVOQBQImFBRVjdP12dXz n1EHTJEnGKkPPdgxUAojxFHB17hg94rbkOnBSPEPUthIcfvWkVp/RpPCt/GQ9yUhP22q +vZg== X-Gm-Message-State: AIkVDXK6ieXZ1UTp91gcIfexOw0rW0J1k4byhog+rPHx7L7/3HpvqEahmaThpYTeYg/Zqw== X-Received: by 10.99.225.5 with SMTP id z5mr352819pgh.145.1484697500001; Tue, 17 Jan 2017 15:58:20 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id b1sm8802845pfa.28.2017.01.17.15.58.19 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 15:58:19 -0800 (PST) Subject: Re: svn commit: r312357 - in stable/10/sys: cam/scsi modules/cam Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_04BCB650-0076-4295-9442-CD72C73A4C96"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701172355.v0HNtA4H015522@repo.freebsd.org> Date: Tue, 17 Jan 2017 15:58:18 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org, ports@grosbein.net Message-Id: References: <201701172355.v0HNtA4H015522@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: Tue, 17 Jan 2017 23:58:20 -0000 --Apple-Mail=_04BCB650-0076-4295-9442-CD72C73A4C96 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jan 17, 2017, at 15:55, Ngie Cooper wrote: > > Author: ngie > Date: Tue Jan 17 23:55:10 2017 > New Revision: 312357 > URL: https://svnweb.freebsd.org/changeset/base/312357 > > Log: > MFC r299864,r303166: > > r299864 (by markj): > > opt_kdtrace.h is not needed for SDT probes as of r258541. > > r303166 (by imp): > > Add opt_ddb.h. The latter MFC also fixes bug 213535. Reported by: Eugene Grosbein -Ngie --Apple-Mail=_04BCB650-0076-4295-9442-CD72C73A4C96 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 iQIcBAEBCgAGBQJYfq+aAAoJEPWDqSZpMIYVYM0P/itpmUtbrg4FWykhOC2nRRhV Daig2+qUloYVsfwy9Bt10HHhES+oYvqbUoeO6sSczYN4kA4R0TZKpZYO3+iTCxn8 cRT5aa6gYTXagYPUQCfKFnaai2HAZUQOthVtyHtoPwHbuVcuTZMS7VkId26EK9YS wOPYaKQZ1UFhunpBsSTUc3Fyvd3I+Lz200qsmyw41Q37ryH21aHo/6FZH0fy6q80 WWyBn1iVJHBbinFegu3xUpPN/Z8HPUfRbErby1Kt6M/P7ELOtpZ6pWw7OGrmhLgy mtY7iRNwVZncUkNwJu6Q8D+LYH0wVCSLAiRk24Cl5oq/wgRxtgnBzT9m3Zsmlxk1 UfiXG53dWnnSekAtbjixt1wXOGee5HEwTtXzmyLACaS74+PJ9ZzZX5dwN6U1rvRX 4oKCkLCkWp7aEMexUF2gzRFe9GD611Y0ORpqRSw02sfl0ysftuI0hlS90KP7cl2Y w6hVo9gQwn1FyFEFp6PBj/T+eu3pyMZFzSA7+60frgZe7HKcJSo7Gqf1RbqPuN7d SSlbYFvJ+POEzPkxgx3h0hGN/pfUa7hNnGMFppeqc+BxUzTc60o7HfP96GFnupGt r/NzCZyBpbARmvuo7U8s5lYcReNNdvvwXLRYsH4YRgyPYX7qvFE0x+3MHR4mIqoj I9V8XWL251i90nC3bGWN =KpjK -----END PGP SIGNATURE----- --Apple-Mail=_04BCB650-0076-4295-9442-CD72C73A4C96-- From owner-svn-src-all@freebsd.org Wed Jan 18 01:28:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C936CB4DB7 for ; Wed, 18 Jan 2017 01:28:22 +0000 (UTC) (envelope-from sobomax@sippysoft.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 B4C431AE9 for ; Wed, 18 Jan 2017 01:28:21 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-io0-x236.google.com with SMTP id j18so1107120ioe.2 for ; Tue, 17 Jan 2017 17:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Y5x1as6yfqyhECSZEjdXx6nBJkv3EJi49p5JUv9xM/E=; b=JWmepxHIaURYFZsujZ08zV/ol4izuvcHF2KlbelULwFFAjXY8Wpx8Bl0aaKZHm7KMb SiOfJQgGc0iYLLD7gATJe+fWONuG0kDQFIIo54KcpUPHbtvVYOvfDSy+r1Z3zEGhOgQs lZnTdQtpRfK5LOILrWOdcKzGztmaKXv8zy2dgFET4BMsfXKwVcEZd0aIm7cDhdgWJ1ba EXGWs8hJbzcIjbPbCgS3I5GzaGi0dqHevx5YL8zDb3lp8seHbGOnPwTv7p71ThYT0EGn CuVPZqzs1khWTJYuSE8QfPBFbZFjktGLPA473Jeu/B5JIgOWV7wdg7NEnoKflmwTkLQ6 +dlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Y5x1as6yfqyhECSZEjdXx6nBJkv3EJi49p5JUv9xM/E=; b=nEAtwVzfMhuRhg9AUNEgPSLfXUhghm1CPa3MMW+nxtnMfBlHwN5pxR5/uECWRgjAGg kBNTBKwAB6NtkwTtCPElGHG6R+m+76oKb/z61LwCPumP6PV43uQuPtt67PglWBKhU+gB lkndNGzemNELlcA40fUeUsA1Aq5vaHcBx71DJJByGP4FG2I2/ZSC6wHel2irWjLojEMQ TZIWpAViHJlVujBw4gRfOt9rZQ5pOGNq2BUUwh0TNWOJlg7ETQi5O/R5gMVV4JmHEruO fMQdcQa3Vzb8UFybkhDMaJApfryZKodCjXFz/Df6BWlpVpN3TYUrnDd3XLIrSS+rDTJO o/zA== X-Gm-Message-State: AIkVDXLtxgS6Hfb5WYwoAWxe7l3tzv7jv9qAQUUG6paJ/xhoIL93uF5qw4hPEbSlYugM4aEOcXd/Lyz0rnP1DS7D X-Received: by 10.107.18.230 with SMTP id 99mr1170735ios.45.1484702900866; Tue, 17 Jan 2017 17:28:20 -0800 (PST) MIME-Version: 1.0 Sender: sobomax@sippysoft.com Received: by 10.36.160.66 with HTTP; Tue, 17 Jan 2017 17:28:20 -0800 (PST) In-Reply-To: <1484697145.86335.183.camel@freebsd.org> References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> <20170117212713.GZ2611@FreeBSD.org> <1484697145.86335.183.camel@freebsd.org> From: Maxim Sobolev Date: Tue, 17 Jan 2017 17:28:20 -0800 X-Google-Sender-Auth: EPK6A-3fVOgkvQZV19A5kOTsWrM Message-ID: Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg To: Ian Lepore Cc: "Conrad E. Meyer" , src-committers , 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: Wed, 18 Jan 2017 01:28:22 -0000 OK, guys, with all due respect I think I've heard enough to say that if somebody feels like this has to be enum feel free to jump in and tweak it out. As far as I understand there should be no user-visible differences either way, so it's not like we are going to be locked with this way forever. It's never too late to revise it (and it's FreeBSD-specific interface as well). Requesting me to implement something that it is at least a bit controversial and also something completely orthogonal to the original functionality and which I have no idea how to do/test properly on top of what's been done already is a bit overboard I would say. In my view, if we are to convert set/getsockopt(2) to enums it has to do in one shot and tested against large set of third-party software to make sure it won't bring out some corner cases (i.e. some unhandled values in switch() statements and the likes, C++ breakage, weird compilers, #ifdef blocks etc). If some developer(s) feel #define is an old way no longer relevant in 2017 the onus has to be on those to come up with a patch and go though the heat of defending it against other set of developers who don't share that opinion. Pushing me, who is largely ambivalent to either way, to do it is not fair. It's like asking mechanic who works on fixing your brakes to also paint your calipers for aesthetic reasons for the same price. Not even to mention that the change in question has been on reviews and received positive feedback from other developers working in the same area (e.g. gnn) and none of the enum guys paid any attention until it hit the tree. Also there is at least one thing that makes enum less desirable from the point of view of application developer. Particularly it makes it impossible to use preprocessor to do a conditional compilation, which is especially important for the FreeBSD-specific options. With the "old" way, I can easily have something like: #if defined(SO_TS_CLOCK) ... setsockopt(SO_TS_CLOCK, ...); #else [do something else] #endif This does not work with enums for obvious reasons, one would need to resort to using some kind of autoconfigure mechanism to figure out if the enum in question is defined. -Max On Tue, Jan 17, 2017 at 3:52 PM, Ian Lepore wrote: > I actually don't agree that it's all good, but I also don't have the > time to prove it's not (or prove myself wrong, which could certainly be > the case). > > -- Ian > > On Tue, 2017-01-17 at 15:21 -0800, Conrad Meyer wrote: > > Ian's potential objection has been met by Ben Kaduk and Eric van > > Gyzen's responses. It seems like an enum is just fine. And I agree > > with Gleb that it is preferable. > > > > Conrad > > > > On Tue, Jan 17, 2017 at 1:34 PM, Maxim Sobolev > > wrote: > > > > > > Well as other pointed out there are some concerns with using enums > > > from C++ > > > and ABI prospective. So it looks to me that there is no general > > > consensus on > > > that direction. > > > > > > -Max > > > > > > On Tue, Jan 17, 2017 at 1:27 PM, Gleb Smirnoff > > > wrote: > > > > > > > > > > > > On Tue, Jan 17, 2017 at 08:40:50AM -0800, Maxim Sobolev wrote: > > > > M> That being said, is there any other socket option value in > > > > there > > > > M> implemented as enum? I don't see anything obvious, so that I > > > > am curious > > > > if > > > > M> it would stick out as an odd one in there. What do you think? > > > > > > > > Simply because 30 years ago the language didn't allow that, and > > > > later > > > > additions mimiced the older sockopts. We need to break this loop > > > > :) > > > > > > > > -- > > > > Totus tuus, Glebius. > > > > > > From owner-svn-src-all@freebsd.org Wed Jan 18 01:43:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EBB9CB41FD; Wed, 18 Jan 2017 01:43:59 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.netplex.net", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5F90153F; Wed, 18 Jan 2017 01:43:58 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.15.1/8.15.1/NETPLEX) with ESMTP id v0I1gHXs011242; Tue, 17 Jan 2017 20:42:17 -0500 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.4.3 (mail.netplex.net [204.213.176.9]); Tue, 17 Jan 2017 20:42:17 -0500 (EST) Date: Tue, 17 Jan 2017 20:42:17 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net Reply-To: Daniel Eischen To: Maxim Sobolev cc: Ian Lepore , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg In-Reply-To: Message-ID: References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> <20170117212713.GZ2611@FreeBSD.org> <1484697145.86335.183.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 18 Jan 2017 01:43:59 -0000 On Tue, 17 Jan 2017, Maxim Sobolev wrote: > Also there is at least one thing that makes enum less desirable from the > point of view of application developer. Particularly it makes it impossible > to use preprocessor to do a conditional compilation, which is especially > important for the FreeBSD-specific options. With the "old" way, I can > easily have something like: > > #if defined(SO_TS_CLOCK) > ... > setsockopt(SO_TS_CLOCK, ...); > #else > [do something else] > #endif > > This does not work with enums for obvious reasons, one would need to resort > to using some kind of autoconfigure mechanism to figure out if the enum in > question is defined. Great point, we (at $JOB) have code that this, and would break if changed to enums. -- DE From owner-svn-src-all@freebsd.org Wed Jan 18 01:52:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE37ECB445B; Wed, 18 Jan 2017 01:52:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88BD01981; Wed, 18 Jan 2017 01:52:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I1q4wA061336; Wed, 18 Jan 2017 01:52:04 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I1q42a061332; Wed, 18 Jan 2017 01:52:04 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180152.v0I1q42a061332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 01:52: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: r312358 - in stable/11/sys/dev: alc pci 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, 18 Jan 2017 01:52:05 -0000 Author: yongari Date: Wed Jan 18 01:52:04 2017 New Revision: 312358 URL: https://svnweb.freebsd.org/changeset/base/312358 Log: MFC r304574-304575,304584: r304574: Correct DMA channel number selection on AR816x family of controllers. For Gigabit Ethernet version of AR816x, AR813x/AR815x except L1D controller, use vendor recommended ASPM parameters. While here, increase alc_dma_burst array size. Broken H/W can return bogus value in theory. r304575: Add Killer E2400 Gigabit Ethernet support. It seems Killer E2200/E2400 has a BIOS misconfiguration or silicon bug which triggers DMA write errors when driver uses advertised maximum payload size. Force the maximum payload size to 128 bytes in DMA configuration. This change should fix occasional DMA write errors reported on Killer E2200. r304584: Add a missing change in r304575. Modified: stable/11/sys/dev/alc/if_alc.c stable/11/sys/dev/alc/if_alcreg.h stable/11/sys/dev/alc/if_alcvar.h stable/11/sys/dev/pci/pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/alc/if_alc.c ============================================================================== --- stable/11/sys/dev/alc/if_alc.c Tue Jan 17 23:55:10 2017 (r312357) +++ stable/11/sys/dev/alc/if_alc.c Wed Jan 18 01:52:04 2017 (r312358) @@ -121,6 +121,8 @@ static struct alc_ident alc_ident_table[ "Atheros AR8172 PCIe Fast Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2200, 9 * 1024, "Killer E2200 Gigabit Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2400, 9 * 1024, + "Killer E2400 Gigabit Ethernet" }, { 0, 0, 0, NULL} }; @@ -255,7 +257,7 @@ static struct resource_spec alc_irq_spec { -1, 0, 0 } }; -static uint32_t alc_dma_burst[] = { 128, 256, 512, 1024, 2048, 4096, 0 }; +static uint32_t alc_dma_burst[] = { 128, 256, 512, 1024, 2048, 4096, 0, 0 }; static int alc_miibus_readreg(device_t dev, int phy, int reg) @@ -1080,6 +1082,7 @@ alc_phy_down(struct alc_softc *sc) switch (sc->alc_ident->deviceid) { case DEVICEID_ATHEROS_AR8161: case DEVICEID_ATHEROS_E2200: + case DEVICEID_ATHEROS_E2400: case DEVICEID_ATHEROS_AR8162: case DEVICEID_ATHEROS_AR8171: case DEVICEID_ATHEROS_AR8172: @@ -1397,12 +1400,15 @@ alc_attach(device_t dev) * shows the same PHY model/revision number of AR8131. */ switch (sc->alc_ident->deviceid) { + case DEVICEID_ATHEROS_E2200: + case DEVICEID_ATHEROS_E2400: + sc->alc_flags |= ALC_FLAG_E2X00; + /* FALLTHROUGH */ case DEVICEID_ATHEROS_AR8161: if (pci_get_subvendor(dev) == VENDORID_ATHEROS && pci_get_subdevice(dev) == 0x0091 && sc->alc_rev == 0) sc->alc_flags |= ALC_FLAG_LINK_WAR; /* FALLTHROUGH */ - case DEVICEID_ATHEROS_E2200: case DEVICEID_ATHEROS_AR8171: sc->alc_flags |= ALC_FLAG_AR816X_FAMILY; break; @@ -1473,6 +1479,12 @@ alc_attach(device_t dev) sc->alc_dma_rd_burst = 3; if (alc_dma_burst[sc->alc_dma_wr_burst] > 1024) sc->alc_dma_wr_burst = 3; + /* + * Force maximum payload size to 128 bytes for E2200/E2400. + * Otherwise it triggers DMA write error. + */ + if ((sc->alc_flags & ALC_FLAG_E2X00) != 0) + sc->alc_dma_wr_burst = 0; alc_init_pcie(sc); } @@ -4184,13 +4196,17 @@ alc_init_locked(struct alc_softc *sc) reg = (RXQ_CFG_RD_BURST_DEFAULT << RXQ_CFG_RD_BURST_SHIFT) & RXQ_CFG_RD_BURST_MASK; reg |= RXQ_CFG_RSS_MODE_DIS; - if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) != 0) + if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) != 0) { reg |= (RXQ_CFG_816X_IDT_TBL_SIZE_DEFAULT << RXQ_CFG_816X_IDT_TBL_SIZE_SHIFT) & RXQ_CFG_816X_IDT_TBL_SIZE_MASK; - if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0 && - sc->alc_ident->deviceid != DEVICEID_ATHEROS_AR8151_V2) - reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_1M; + if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0) + reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_100M; + } else { + if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0 && + sc->alc_ident->deviceid != DEVICEID_ATHEROS_AR8151_V2) + reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_100M; + } CSR_WRITE_4(sc, ALC_RXQ_CFG, reg); /* Configure DMA parameters. */ @@ -4214,12 +4230,12 @@ alc_init_locked(struct alc_softc *sc) switch (AR816X_REV(sc->alc_rev)) { case AR816X_REV_A0: case AR816X_REV_A1: - reg |= DMA_CFG_RD_CHNL_SEL_1; + reg |= DMA_CFG_RD_CHNL_SEL_2; break; case AR816X_REV_B0: /* FALLTHROUGH */ default: - reg |= DMA_CFG_RD_CHNL_SEL_3; + reg |= DMA_CFG_RD_CHNL_SEL_4; break; } } Modified: stable/11/sys/dev/alc/if_alcreg.h ============================================================================== --- stable/11/sys/dev/alc/if_alcreg.h Tue Jan 17 23:55:10 2017 (r312357) +++ stable/11/sys/dev/alc/if_alcreg.h Wed Jan 18 01:52:04 2017 (r312358) @@ -45,10 +45,11 @@ #define DEVICEID_ATHEROS_AR8152_B 0x2060 /* L2C V1.1 */ #define DEVICEID_ATHEROS_AR8152_B2 0x2062 /* L2C V2.0 */ #define DEVICEID_ATHEROS_AR8161 0x1091 -#define DEVICEID_ATHEROS_E2200 0xE091 #define DEVICEID_ATHEROS_AR8162 0x1090 #define DEVICEID_ATHEROS_AR8171 0x10A1 #define DEVICEID_ATHEROS_AR8172 0x10A0 +#define DEVICEID_ATHEROS_E2200 0xE091 +#define DEVICEID_ATHEROS_E2400 0xE0A1 #define ATHEROS_AR8152_B_V10 0xC0 #define ATHEROS_AR8152_B_V11 0xC1 Modified: stable/11/sys/dev/alc/if_alcvar.h ============================================================================== --- stable/11/sys/dev/alc/if_alcvar.h Tue Jan 17 23:55:10 2017 (r312357) +++ stable/11/sys/dev/alc/if_alcvar.h Wed Jan 18 01:52:04 2017 (r312358) @@ -235,7 +235,8 @@ struct alc_softc { #define ALC_FLAG_APS 0x1000 #define ALC_FLAG_AR816X_FAMILY 0x2000 #define ALC_FLAG_LINK_WAR 0x4000 -#define ALC_FLAG_LINK 0x8000 +#define ALC_FLAG_E2X00 0x8000 +#define ALC_FLAG_LINK 0x10000 struct callout alc_tick_ch; struct alc_hw_stats alc_stats; Modified: stable/11/sys/dev/pci/pci.c ============================================================================== --- stable/11/sys/dev/pci/pci.c Tue Jan 17 23:55:10 2017 (r312357) +++ stable/11/sys/dev/pci/pci.c Wed Jan 18 01:52:04 2017 (r312358) @@ -281,12 +281,13 @@ static const struct pci_quirk pci_quirks { 0x43851002, PCI_QUIRK_UNMAP_REG, 0x14, 0 }, /* - * Atheros AR8161/AR8162/E2200 Ethernet controllers have a bug that - * MSI interrupt does not assert if PCIM_CMD_INTxDIS bit of the - * command register is set. + * Atheros AR8161/AR8162/E2200/E2400 Ethernet controllers have a + * bug that MSI interrupt does not assert if PCIM_CMD_INTxDIS bit + * of the command register is set. */ { 0x10911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0xE0911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, + { 0xE0A11969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0x10901969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* From owner-svn-src-all@freebsd.org Wed Jan 18 01:53:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2802DCB44FE; Wed, 18 Jan 2017 01:53:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01FF01B65; Wed, 18 Jan 2017 01:53:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I1r8eK063508; Wed, 18 Jan 2017 01:53:08 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I1r7YA063504; Wed, 18 Jan 2017 01:53:07 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180153.v0I1r7YA063504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 01:53:07 +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: r312359 - in stable/10/sys/dev: alc pci 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, 18 Jan 2017 01:53:09 -0000 Author: yongari Date: Wed Jan 18 01:53:07 2017 New Revision: 312359 URL: https://svnweb.freebsd.org/changeset/base/312359 Log: MFC r304574-304575,304584: r304574: Correct DMA channel number selection on AR816x family of controllers. For Gigabit Ethernet version of AR816x, AR813x/AR815x except L1D controller, use vendor recommended ASPM parameters. While here, increase alc_dma_burst array size. Broken H/W can return bogus value in theory. r304575: Add Killer E2400 Gigabit Ethernet support. It seems Killer E2200/E2400 has a BIOS misconfiguration or silicon bug which triggers DMA write errors when driver uses advertised maximum payload size. Force the maximum payload size to 128 bytes in DMA configuration. This change should fix occasional DMA write errors reported on Killer E2200. r304584: Add a missing change in r304575. Modified: stable/10/sys/dev/alc/if_alc.c stable/10/sys/dev/alc/if_alcreg.h stable/10/sys/dev/alc/if_alcvar.h stable/10/sys/dev/pci/pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/alc/if_alc.c ============================================================================== --- stable/10/sys/dev/alc/if_alc.c Wed Jan 18 01:52:04 2017 (r312358) +++ stable/10/sys/dev/alc/if_alc.c Wed Jan 18 01:53:07 2017 (r312359) @@ -120,6 +120,8 @@ static struct alc_ident alc_ident_table[ "Atheros AR8172 PCIe Fast Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2200, 9 * 1024, "Killer E2200 Gigabit Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2400, 9 * 1024, + "Killer E2400 Gigabit Ethernet" }, { 0, 0, 0, NULL} }; @@ -254,7 +256,7 @@ static struct resource_spec alc_irq_spec { -1, 0, 0 } }; -static uint32_t alc_dma_burst[] = { 128, 256, 512, 1024, 2048, 4096, 0 }; +static uint32_t alc_dma_burst[] = { 128, 256, 512, 1024, 2048, 4096, 0, 0 }; static int alc_miibus_readreg(device_t dev, int phy, int reg) @@ -1079,6 +1081,7 @@ alc_phy_down(struct alc_softc *sc) switch (sc->alc_ident->deviceid) { case DEVICEID_ATHEROS_AR8161: case DEVICEID_ATHEROS_E2200: + case DEVICEID_ATHEROS_E2400: case DEVICEID_ATHEROS_AR8162: case DEVICEID_ATHEROS_AR8171: case DEVICEID_ATHEROS_AR8172: @@ -1396,12 +1399,15 @@ alc_attach(device_t dev) * shows the same PHY model/revision number of AR8131. */ switch (sc->alc_ident->deviceid) { + case DEVICEID_ATHEROS_E2200: + case DEVICEID_ATHEROS_E2400: + sc->alc_flags |= ALC_FLAG_E2X00; + /* FALLTHROUGH */ case DEVICEID_ATHEROS_AR8161: if (pci_get_subvendor(dev) == VENDORID_ATHEROS && pci_get_subdevice(dev) == 0x0091 && sc->alc_rev == 0) sc->alc_flags |= ALC_FLAG_LINK_WAR; /* FALLTHROUGH */ - case DEVICEID_ATHEROS_E2200: case DEVICEID_ATHEROS_AR8171: sc->alc_flags |= ALC_FLAG_AR816X_FAMILY; break; @@ -1472,6 +1478,12 @@ alc_attach(device_t dev) sc->alc_dma_rd_burst = 3; if (alc_dma_burst[sc->alc_dma_wr_burst] > 1024) sc->alc_dma_wr_burst = 3; + /* + * Force maximum payload size to 128 bytes for E2200/E2400. + * Otherwise it triggers DMA write error. + */ + if ((sc->alc_flags & ALC_FLAG_E2X00) != 0) + sc->alc_dma_wr_burst = 0; alc_init_pcie(sc); } @@ -4194,13 +4206,17 @@ alc_init_locked(struct alc_softc *sc) reg = (RXQ_CFG_RD_BURST_DEFAULT << RXQ_CFG_RD_BURST_SHIFT) & RXQ_CFG_RD_BURST_MASK; reg |= RXQ_CFG_RSS_MODE_DIS; - if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) != 0) + if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) != 0) { reg |= (RXQ_CFG_816X_IDT_TBL_SIZE_DEFAULT << RXQ_CFG_816X_IDT_TBL_SIZE_SHIFT) & RXQ_CFG_816X_IDT_TBL_SIZE_MASK; - if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0 && - sc->alc_ident->deviceid != DEVICEID_ATHEROS_AR8151_V2) - reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_1M; + if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0) + reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_100M; + } else { + if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0 && + sc->alc_ident->deviceid != DEVICEID_ATHEROS_AR8151_V2) + reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_100M; + } CSR_WRITE_4(sc, ALC_RXQ_CFG, reg); /* Configure DMA parameters. */ @@ -4224,12 +4240,12 @@ alc_init_locked(struct alc_softc *sc) switch (AR816X_REV(sc->alc_rev)) { case AR816X_REV_A0: case AR816X_REV_A1: - reg |= DMA_CFG_RD_CHNL_SEL_1; + reg |= DMA_CFG_RD_CHNL_SEL_2; break; case AR816X_REV_B0: /* FALLTHROUGH */ default: - reg |= DMA_CFG_RD_CHNL_SEL_3; + reg |= DMA_CFG_RD_CHNL_SEL_4; break; } } Modified: stable/10/sys/dev/alc/if_alcreg.h ============================================================================== --- stable/10/sys/dev/alc/if_alcreg.h Wed Jan 18 01:52:04 2017 (r312358) +++ stable/10/sys/dev/alc/if_alcreg.h Wed Jan 18 01:53:07 2017 (r312359) @@ -45,10 +45,11 @@ #define DEVICEID_ATHEROS_AR8152_B 0x2060 /* L2C V1.1 */ #define DEVICEID_ATHEROS_AR8152_B2 0x2062 /* L2C V2.0 */ #define DEVICEID_ATHEROS_AR8161 0x1091 -#define DEVICEID_ATHEROS_E2200 0xE091 #define DEVICEID_ATHEROS_AR8162 0x1090 #define DEVICEID_ATHEROS_AR8171 0x10A1 #define DEVICEID_ATHEROS_AR8172 0x10A0 +#define DEVICEID_ATHEROS_E2200 0xE091 +#define DEVICEID_ATHEROS_E2400 0xE0A1 #define ATHEROS_AR8152_B_V10 0xC0 #define ATHEROS_AR8152_B_V11 0xC1 Modified: stable/10/sys/dev/alc/if_alcvar.h ============================================================================== --- stable/10/sys/dev/alc/if_alcvar.h Wed Jan 18 01:52:04 2017 (r312358) +++ stable/10/sys/dev/alc/if_alcvar.h Wed Jan 18 01:53:07 2017 (r312359) @@ -235,7 +235,8 @@ struct alc_softc { #define ALC_FLAG_APS 0x1000 #define ALC_FLAG_AR816X_FAMILY 0x2000 #define ALC_FLAG_LINK_WAR 0x4000 -#define ALC_FLAG_LINK 0x8000 +#define ALC_FLAG_E2X00 0x8000 +#define ALC_FLAG_LINK 0x10000 struct callout alc_tick_ch; struct alc_hw_stats alc_stats; Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Wed Jan 18 01:52:04 2017 (r312358) +++ stable/10/sys/dev/pci/pci.c Wed Jan 18 01:53:07 2017 (r312359) @@ -269,12 +269,13 @@ static const struct pci_quirk pci_quirks { 0x43851002, PCI_QUIRK_UNMAP_REG, 0x14, 0 }, /* - * Atheros AR8161/AR8162/E2200 Ethernet controllers have a bug that - * MSI interrupt does not assert if PCIM_CMD_INTxDIS bit of the - * command register is set. + * Atheros AR8161/AR8162/E2200/E2400 Ethernet controllers have a + * bug that MSI interrupt does not assert if PCIM_CMD_INTxDIS bit + * of the command register is set. */ { 0x10911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0xE0911969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, + { 0xE0A11969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, { 0x10901969, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* From owner-svn-src-all@freebsd.org Wed Jan 18 01:55:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C993CB45A6; Wed, 18 Jan 2017 01:55:39 +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 1367C1D0D; Wed, 18 Jan 2017 01:55:39 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id t6so5264509pgt.1; Tue, 17 Jan 2017 17:55:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=whOTlZJGwByI5faJoSHqOQgsH70SQ5GVK/xNHUBS9q8=; b=F6V4l+Pa9hUITqzXcsoMkLhhU7vSR+NBXzfvjNuilSm9uT6r170CiCPhfu2aez/aet A9YUofYyyZzNYd6aOxaSGTWUOuAIOV6O4n93hVrZGKA/C5J0OuGukvYjuor+Sdm1RVRT oWUiAhemAQDcmPpF5Vm3RsbWkhnK8PqLS5gfMYWrAwjvVme1Ui3vbUf9C09JfdnhtQDQ lf3IRGEm3CZqSYKTT2nw/VTnk+Z/6JLGJETTmDKZ2qJBl3j/AFlukpVdhi7PcCYZUf1N OwwkaNGGbQUFpLDvkh+1wzOlID9UNcIAfVmwp9QLN83Ra6ebhHevl4bahsoEMwt86Rrq i6hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=whOTlZJGwByI5faJoSHqOQgsH70SQ5GVK/xNHUBS9q8=; b=T1FDRAUDpQyyjXI/H09wtUSz1sW4O5VvgmYlRnY1LpJCEsvRvkrPR7PaLUKoUOAXxC +X4D3/NvGQH7My0Ji16fG5zyjUVa3948r8/F/ES4k0X45C7VUdUS2cvCsYBU+59BnLTM vUxY0sbvJw8hU8roDUMueYpC5QR68xZc5NxK2/7ruzwbbh7SknVVbhG9UP7Cfz6wPgJX Aea/rpTxjpdYPO0UL4E95sEUYMwGxtADIo5mvvx9J0H61v5Inp2mIzIOaIdmexBaEs5X zhGCJGw80pkf/bOoJEWfxwpmU8fpaJIUGozoWBeDHVWqaItb6GEVEPURWWbxFuHzuEVx ZBWA== X-Gm-Message-State: AIkVDXK27oEWQdueGkHov8cwc2QDX0VoryVcZJCNNUcdtvULGRPOg7LFECtjAGgXqcP5wA== X-Received: by 10.99.174.75 with SMTP id e11mr937351pgp.89.1484704538448; Tue, 17 Jan 2017 17:55:38 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id p25sm58650402pfd.0.2017.01.17.17.55.37 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Jan 2017 17:55:38 -0800 (PST) Subject: Re: svn commit: r312296 - in head: lib/libc/sys sys/kern sys/netinet sys/netinet6 sys/sys tools/regression/sockets/udp_pingpong tools/regression/sockets/unix_cmsg Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_EA543583-7822-402D-B929-224972642460"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Tue, 17 Jan 2017 17:55:36 -0800 Cc: Maxim Sobolev , Ian Lepore , "Conrad E. Meyer" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201701161746.v0GHkcPX071529@repo.freebsd.org> <20170117065231.GW2611@FreeBSD.org> <20170117212713.GZ2611@FreeBSD.org> <1484697145.86335.183.camel@freebsd.org> To: Daniel Eischen 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: Wed, 18 Jan 2017 01:55:39 -0000 --Apple-Mail=_EA543583-7822-402D-B929-224972642460 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 17, 2017, at 17:42, Daniel Eischen = wrote: >=20 > On Tue, 17 Jan 2017, Maxim Sobolev wrote: >=20 >> Also there is at least one thing that makes enum less desirable from = the >> point of view of application developer. Particularly it makes it = impossible >> to use preprocessor to do a conditional compilation, which is = especially >> important for the FreeBSD-specific options. With the "old" way, I can >> easily have something like: >>=20 >> #if defined(SO_TS_CLOCK) >> ... >> setsockopt(SO_TS_CLOCK, ...); >> #else >> [do something else] >> #endif >>=20 >> This does not work with enums for obvious reasons, one would need to = resort >> to using some kind of autoconfigure mechanism to figure out if the = enum in >> question is defined. >=20 > Great point, we (at $JOB) have code that this, and would break > if changed to enums. I=E2=80=99m not saying enums would be a bad idea, but it would = require more work on the autoconf end as well, and would make testing = for these symbols' support a little less straightforward. Maybe a combination of #define=E2=80=99s for determining whether = or not the support is present, i.e. for simple #ifdef folks (I would = probably only use one though), and having a sample for testing for = support in autoconf in some products would be beneficial? Thanks, -Ngie --Apple-Mail=_EA543583-7822-402D-B929-224972642460 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 iQIcBAEBCgAGBQJYfssZAAoJEPWDqSZpMIYVlL4QAMkoAZAYzDcO/Y184l/kMxSb zUmCzTl39l/3ORffMP+YBv0LzWMgsXUyc+H8H4TAB6gIk1wd8SwBtvqLAcReL/jo jtrwkSeQ41XntmX5bp/+t3/76TE7y/j+GFThoRuwIpqZynzLz1xfn5Dgx7BwtVTm ofvRy0k5DCWoGdJh0N1mvywUiYfE4CEyq6NXFSZB/U/cMKFuhCsktMyBoeCOoyeh 3BJTfrbhj2URus9CqAKvoB+bnhGj/l48tEhEOQvi6Uh6wyVdL6/XidKC89ia6MSI oTF4UGxBqYYtDXNOZgwdPKwp1DHYA7ufIjoTYM/uJHv+2Qj9nK2tK0qIJOGhS/f6 H9wlzMCn6diV9Q0yAIvYVe1XQVfg7f8VUn/fkmTlbAyKwVaL+RWCOwhbInufE8en kkXNfpEqNI1wxiCI41JzTnMfrV3lgcllG5ZtBhaCb9D1fCb7INi6wMtnAQbKVQ+y UO8xPhpvazyr77IvNVyosZq2lNm5PdOCdHXfxLfZ1azGNKrUN056T8TDLoEa9ngD FjD+GRKC/n0oeFtzJg6yUf4IwZneUgtH2ypbSBhG+VjvS6fIESHFA8PPori/hm/O 23kk1ETA0NF7gmYYzelWCrpQMBjrNxY3oNvp2R/pfnX8JkFBO4GmgDfJWy66NUwX KtaFhIHu7eeoSBN5k+H8 =zPmc -----END PGP SIGNATURE----- --Apple-Mail=_EA543583-7822-402D-B929-224972642460-- From owner-svn-src-all@freebsd.org Wed Jan 18 01:57:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43227CB4653; Wed, 18 Jan 2017 01:57:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 123931E90; Wed, 18 Jan 2017 01:57:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I1vECp063725; Wed, 18 Jan 2017 01:57:14 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I1vEoJ063724; Wed, 18 Jan 2017 01:57:14 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180157.v0I1vEoJ063724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 01:57: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: r312360 - 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, 18 Jan 2017 01:57:15 -0000 Author: yongari Date: Wed Jan 18 01:57:13 2017 New Revision: 312360 URL: https://svnweb.freebsd.org/changeset/base/312360 Log: MFC r304576: Add Killer E2400 to the supported hardware list. Modified: stable/11/share/man/man4/alc.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/alc.4 ============================================================================== --- stable/11/share/man/man4/alc.4 Wed Jan 18 01:53:07 2017 (r312359) +++ stable/11/share/man/man4/alc.4 Wed Jan 18 01:57:13 2017 (r312360) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 8, 2014 +.Dd August 22, 2016 .Dt ALC 4 .Os .Sh NAME @@ -122,6 +122,8 @@ Atheros AR8171 PCI Express Gigabit Ether Atheros AR8172 PCI Express Fast Ethernet controller .It Killer E2200 Gigabit Ethernet controller +.It +Killer E2400 Gigabit Ethernet controller .El .Sh LOADER TUNABLES Tunables can be set at the From owner-svn-src-all@freebsd.org Wed Jan 18 01:58:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 527F7CB46E5; Wed, 18 Jan 2017 01:58:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21A001004; Wed, 18 Jan 2017 01:58:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I1wXpV063820; Wed, 18 Jan 2017 01:58:33 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I1wXuc063819; Wed, 18 Jan 2017 01:58:33 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180158.v0I1wXuc063819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 01:58: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: r312361 - 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, 18 Jan 2017 01:58:34 -0000 Author: yongari Date: Wed Jan 18 01:58:33 2017 New Revision: 312361 URL: https://svnweb.freebsd.org/changeset/base/312361 Log: MFC r304576: Add Killer E2400 to the supported hardware list. Modified: stable/10/share/man/man4/alc.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/alc.4 ============================================================================== --- stable/10/share/man/man4/alc.4 Wed Jan 18 01:57:13 2017 (r312360) +++ stable/10/share/man/man4/alc.4 Wed Jan 18 01:58:33 2017 (r312361) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 8, 2014 +.Dd August 22, 2016 .Dt ALC 4 .Os .Sh NAME @@ -122,6 +122,8 @@ Atheros AR8171 PCI Express Gigabit Ether Atheros AR8172 PCI Express Fast Ethernet controller .It Killer E2200 Gigabit Ethernet controller +.It +Killer E2400 Gigabit Ethernet controller .El .Sh LOADER TUNABLES Tunables can be set at the From owner-svn-src-all@freebsd.org Wed Jan 18 02:16:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFDEFCB4CFF; Wed, 18 Jan 2017 02:16:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF23319E8; Wed, 18 Jan 2017 02:16:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I2GIRl072010; Wed, 18 Jan 2017 02:16:18 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I2GIKd072003; Wed, 18 Jan 2017 02:16:18 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180216.v0I2GIKd072003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 02:16:18 +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: r312362 - in stable/10/sys/dev: age alc ale jme msk stge vte 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, 18 Jan 2017 02:16:20 -0000 Author: yongari Date: Wed Jan 18 02:16:17 2017 New Revision: 312362 URL: https://svnweb.freebsd.org/changeset/base/312362 Log: MFC r295735: Fix variable assignment. Modified: stable/10/sys/dev/age/if_age.c stable/10/sys/dev/alc/if_alc.c stable/10/sys/dev/ale/if_ale.c stable/10/sys/dev/jme/if_jme.c stable/10/sys/dev/msk/if_msk.c stable/10/sys/dev/stge/if_stge.c stable/10/sys/dev/vte/if_vte.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/age/if_age.c ============================================================================== --- stable/10/sys/dev/age/if_age.c Wed Jan 18 01:58:33 2017 (r312361) +++ stable/10/sys/dev/age/if_age.c Wed Jan 18 02:16:17 2017 (r312362) @@ -587,7 +587,7 @@ age_attach(device_t dev) /* Create device sysctl node. */ age_sysctl_node(sc); - if ((error = age_dma_alloc(sc) != 0)) + if ((error = age_dma_alloc(sc)) != 0) goto fail; /* Load station address. */ Modified: stable/10/sys/dev/alc/if_alc.c ============================================================================== --- stable/10/sys/dev/alc/if_alc.c Wed Jan 18 01:58:33 2017 (r312361) +++ stable/10/sys/dev/alc/if_alc.c Wed Jan 18 02:16:17 2017 (r312362) @@ -1543,7 +1543,7 @@ alc_attach(device_t dev) /* Create device sysctl node. */ alc_sysctl_node(sc); - if ((error = alc_dma_alloc(sc) != 0)) + if ((error = alc_dma_alloc(sc)) != 0) goto fail; /* Load station address. */ Modified: stable/10/sys/dev/ale/if_ale.c ============================================================================== --- stable/10/sys/dev/ale/if_ale.c Wed Jan 18 01:58:33 2017 (r312361) +++ stable/10/sys/dev/ale/if_ale.c Wed Jan 18 02:16:17 2017 (r312362) @@ -602,7 +602,7 @@ ale_attach(device_t dev) /* Create device sysctl node. */ ale_sysctl_node(sc); - if ((error = ale_dma_alloc(sc) != 0)) + if ((error = ale_dma_alloc(sc)) != 0) goto fail; /* Load station address. */ Modified: stable/10/sys/dev/jme/if_jme.c ============================================================================== --- stable/10/sys/dev/jme/if_jme.c Wed Jan 18 01:58:33 2017 (r312361) +++ stable/10/sys/dev/jme/if_jme.c Wed Jan 18 02:16:17 2017 (r312362) @@ -803,7 +803,7 @@ jme_attach(device_t dev) } /* Create coalescing sysctl node. */ jme_sysctl_node(sc); - if ((error = jme_dma_alloc(sc) != 0)) + if ((error = jme_dma_alloc(sc)) != 0) goto fail; ifp = sc->jme_ifp = if_alloc(IFT_ETHER); Modified: stable/10/sys/dev/msk/if_msk.c ============================================================================== --- stable/10/sys/dev/msk/if_msk.c Wed Jan 18 01:58:33 2017 (r312361) +++ stable/10/sys/dev/msk/if_msk.c Wed Jan 18 02:16:17 2017 (r312362) @@ -1626,7 +1626,7 @@ msk_attach(device_t dev) callout_init_mtx(&sc_if->msk_tick_ch, &sc_if->msk_softc->msk_mtx, 0); msk_sysctl_node(sc_if); - if ((error = msk_txrx_dma_alloc(sc_if) != 0)) + if ((error = msk_txrx_dma_alloc(sc_if)) != 0) goto fail; msk_rx_dma_jalloc(sc_if); Modified: stable/10/sys/dev/stge/if_stge.c ============================================================================== --- stable/10/sys/dev/stge/if_stge.c Wed Jan 18 01:58:33 2017 (r312361) +++ stable/10/sys/dev/stge/if_stge.c Wed Jan 18 02:16:17 2017 (r312362) @@ -507,7 +507,7 @@ stge_attach(device_t dev) } } - if ((error = stge_dma_alloc(sc) != 0)) + if ((error = stge_dma_alloc(sc)) != 0) goto fail; /* Modified: stable/10/sys/dev/vte/if_vte.c ============================================================================== --- stable/10/sys/dev/vte/if_vte.c Wed Jan 18 01:58:33 2017 (r312361) +++ stable/10/sys/dev/vte/if_vte.c Wed Jan 18 02:16:17 2017 (r312362) @@ -426,7 +426,7 @@ vte_attach(device_t dev) /* Reset the ethernet controller. */ vte_reset(sc); - if ((error = vte_dma_alloc(sc) != 0)) + if ((error = vte_dma_alloc(sc)) != 0) goto fail; /* Create device sysctl node. */ From owner-svn-src-all@freebsd.org Wed Jan 18 02:22:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AA16CB5024; Wed, 18 Jan 2017 02:22:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69DC51FDA; Wed, 18 Jan 2017 02:22:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I2M72Z076144; Wed, 18 Jan 2017 02:22:07 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I2M76g076143; Wed, 18 Jan 2017 02:22:07 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180222.v0I2M76g076143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 02:22:07 +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: r312363 - stable/10/sys/dev/rl 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, 18 Jan 2017 02:22:08 -0000 Author: yongari Date: Wed Jan 18 02:22:07 2017 New Revision: 312363 URL: https://svnweb.freebsd.org/changeset/base/312363 Log: MFC r295736,295738: r295736: Remove duplicated check. r295738: Fix a bug introduced in r295736 TX descriptor address should be updated for valid chain. Modified: stable/10/sys/dev/rl/if_rl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/rl/if_rl.c ============================================================================== --- stable/10/sys/dev/rl/if_rl.c Wed Jan 18 02:16:17 2017 (r312362) +++ stable/10/sys/dev/rl/if_rl.c Wed Jan 18 02:22:07 2017 (r312363) @@ -1938,15 +1938,13 @@ rl_stop(struct rl_softc *sc) */ for (i = 0; i < RL_TX_LIST_CNT; i++) { if (sc->rl_cdata.rl_tx_chain[i] != NULL) { - if (sc->rl_cdata.rl_tx_chain[i] != NULL) { - bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, - sc->rl_cdata.rl_tx_dmamap[i], - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->rl_cdata.rl_tx_tag, - sc->rl_cdata.rl_tx_dmamap[i]); - m_freem(sc->rl_cdata.rl_tx_chain[i]); - sc->rl_cdata.rl_tx_chain[i] = NULL; - } + bus_dmamap_sync(sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->rl_cdata.rl_tx_tag, + sc->rl_cdata.rl_tx_dmamap[i]); + m_freem(sc->rl_cdata.rl_tx_chain[i]); + sc->rl_cdata.rl_tx_chain[i] = NULL; CSR_WRITE_4(sc, RL_TXADDR0 + (i * sizeof(uint32_t)), 0x0000000); } From owner-svn-src-all@freebsd.org Wed Jan 18 02:40:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFDE6CB5447; Wed, 18 Jan 2017 02:40:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F00416F6; Wed, 18 Jan 2017 02:40:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I2eIQq080507; Wed, 18 Jan 2017 02:40:18 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I2eIGL080506; Wed, 18 Jan 2017 02:40:18 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180240.v0I2eIGL080506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 02:40: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: r312364 - stable/11/share/man/man9 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, 18 Jan 2017 02:40:19 -0000 Author: yongari Date: Wed Jan 18 02:40:18 2017 New Revision: 312364 URL: https://svnweb.freebsd.org/changeset/base/312364 Log: MFC r302548: Belatedly remove CSUM_IP_FRAGS and CSUM_FRAGMENT offloading capabilities. It was removed in r243624 and r254804/r271006 respectively. This file and mbuf(9) needs updates for other offloading capabilities(i.e. CSUM_SCTP and CSUM_TSO). Modified: stable/11/share/man/man9/ifnet.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/ifnet.9 ============================================================================== --- stable/11/share/man/man9/ifnet.9 Wed Jan 18 02:22:07 2017 (r312363) +++ stable/11/share/man/man9/ifnet.9 Wed Jan 18 02:40:18 2017 (r312364) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 29, 2014 +.Dd July 11, 2016 .Dt IFNET 9 .Os .Sh NAME @@ -787,18 +787,6 @@ The interface will compute IP checksums. The interface will compute TCP checksums. .It Dv CSUM_UDP The interface will compute UDP checksums. -.It Dv CSUM_IP_FRAGS -The interface can compute a TCP or UDP checksum for a packet -fragmented by the host CPU. -Makes sense only along with -.Dv CSUM_TCP -or -.Dv CSUM_UDP . -.It Dv CSUM_FRAGMENT -The interface will do the fragmentation of IP packets if necessary. -The host CPU does not need to care about MTU on this interface -as long as a packet to transmit through it is an IP one and it -does not exceed the size of the hardware buffer. .El .Pp An interface notifies the TCP/IP module about the tasks From owner-svn-src-all@freebsd.org Wed Jan 18 02:41:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33B9ECB55BF; Wed, 18 Jan 2017 02:41:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02D061A13; Wed, 18 Jan 2017 02:41:14 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I2fEni080584; Wed, 18 Jan 2017 02:41:14 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I2fEF6080583; Wed, 18 Jan 2017 02:41:14 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180241.v0I2fEF6080583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 02:41: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: r312365 - 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: Wed, 18 Jan 2017 02:41:15 -0000 Author: yongari Date: Wed Jan 18 02:41:13 2017 New Revision: 312365 URL: https://svnweb.freebsd.org/changeset/base/312365 Log: MFC r302548: Belatedly remove CSUM_IP_FRAGS and CSUM_FRAGMENT offloading capabilities. It was removed in r243624 and r254804/r271006 respectively. This file and mbuf(9) needs updates for other offloading capabilities(i.e. CSUM_SCTP and CSUM_TSO). Modified: stable/10/share/man/man9/ifnet.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/ifnet.9 ============================================================================== --- stable/10/share/man/man9/ifnet.9 Wed Jan 18 02:40:18 2017 (r312364) +++ stable/10/share/man/man9/ifnet.9 Wed Jan 18 02:41:13 2017 (r312365) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2013 +.Dd July 11, 2016 .Dt IFNET 9 .Os .Sh NAME @@ -795,18 +795,6 @@ The interface will compute IP checksums. The interface will compute TCP checksums. .It Dv CSUM_UDP The interface will compute UDP checksums. -.It Dv CSUM_IP_FRAGS -The interface can compute a TCP or UDP checksum for a packet -fragmented by the host CPU. -Makes sense only along with -.Dv CSUM_TCP -or -.Dv CSUM_UDP . -.It Dv CSUM_FRAGMENT -The interface will do the fragmentation of IP packets if necessary. -The host CPU does not need to care about MTU on this interface -as long as a packet to transmit through it is an IP one and it -does not exceed the size of the hardware buffer. .El .Pp An interface notifies the TCP/IP module about the tasks From owner-svn-src-all@freebsd.org Wed Jan 18 02:56:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D915CCB57A5; Wed, 18 Jan 2017 02:56:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F0241015; Wed, 18 Jan 2017 02:56:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I2uOLh088447; Wed, 18 Jan 2017 02:56:24 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I2uOAi088444; Wed, 18 Jan 2017 02:56:24 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180256.v0I2uOAi088444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 02:56: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: r312366 - stable/11/sys/dev/sound/pci/hda 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, 18 Jan 2017 02:56:26 -0000 Author: yongari Date: Wed Jan 18 02:56:24 2017 New Revision: 312366 URL: https://svnweb.freebsd.org/changeset/base/312366 Log: MFC r309527-309528: r309527: Recognize RealTek ALC1150 7.1 channel HD audio codec. r309528: Fix too low volume on MSI H170 GAMING M3 board by poking vendor specific COEF. Modified: stable/11/sys/dev/sound/pci/hda/hdaa_patches.c stable/11/sys/dev/sound/pci/hda/hdac.h stable/11/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- stable/11/sys/dev/sound/pci/hda/hdaa_patches.c Wed Jan 18 02:41:13 2017 (r312365) +++ stable/11/sys/dev/sound/pci/hda/hdaa_patches.c Wed Jan 18 02:56:24 2017 (r312366) @@ -739,6 +739,12 @@ hdaa_patch_direct(struct hdaa_devinfo *d hda_command(dev, HDA_CMD_12BIT(0, devinfo->nid, 0xf88, 0xc0)); break; + case HDA_CODEC_ALC1150: + if (subid == 0xd9781462) { + /* Too low volume on MSI H170 GAMING M3. */ + hdaa_write_coef(dev, 0x20, 0x07, 0x7cb); + } + break; } if (subid == APPLE_INTEL_MAC) hda_command(dev, HDA_CMD_12BIT(0, devinfo->nid, Modified: stable/11/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/11/sys/dev/sound/pci/hda/hdac.h Wed Jan 18 02:41:13 2017 (r312365) +++ stable/11/sys/dev/sound/pci/hda/hdac.h Wed Jan 18 02:56:24 2017 (r312366) @@ -368,6 +368,7 @@ #define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889) #define HDA_CODEC_ALC892 HDA_CODEC_CONSTRUCT(REALTEK, 0x0892) #define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899) +#define HDA_CODEC_ALC1150 HDA_CODEC_CONSTRUCT(REALTEK, 0x0900) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) /* Motorola */ Modified: stable/11/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/11/sys/dev/sound/pci/hda/hdacc.c Wed Jan 18 02:41:13 2017 (r312365) +++ stable/11/sys/dev/sound/pci/hda/hdacc.c Wed Jan 18 02:56:24 2017 (r312366) @@ -111,6 +111,7 @@ static const struct { { HDA_CODEC_ALC889, 0, "Realtek ALC889" }, { HDA_CODEC_ALC892, 0, "Realtek ALC892" }, { HDA_CODEC_ALC899, 0, "Realtek ALC899" }, + { HDA_CODEC_ALC1150, 0, "Realtek ALC1150" }, { HDA_CODEC_AD1882, 0, "Analog Devices AD1882" }, { HDA_CODEC_AD1882A, 0, "Analog Devices AD1882A" }, { HDA_CODEC_AD1883, 0, "Analog Devices AD1883" }, From owner-svn-src-all@freebsd.org Wed Jan 18 02:57:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F7CDCB5813; Wed, 18 Jan 2017 02:57:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8D711184; Wed, 18 Jan 2017 02:57:23 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0I2vM0P088528; Wed, 18 Jan 2017 02:57:22 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I2vMnt088525; Wed, 18 Jan 2017 02:57:22 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201701180257.v0I2vMnt088525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Wed, 18 Jan 2017 02:57:22 +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: r312367 - stable/10/sys/dev/sound/pci/hda 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, 18 Jan 2017 02:57:24 -0000 Author: yongari Date: Wed Jan 18 02:57:22 2017 New Revision: 312367 URL: https://svnweb.freebsd.org/changeset/base/312367 Log: MFC r309527-309528: r309527: Recognize RealTek ALC1150 7.1 channel HD audio codec. r309528: Fix too low volume on MSI H170 GAMING M3 board by poking vendor specific COEF. Modified: stable/10/sys/dev/sound/pci/hda/hdaa_patches.c stable/10/sys/dev/sound/pci/hda/hdac.h stable/10/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdaa_patches.c Wed Jan 18 02:56:24 2017 (r312366) +++ stable/10/sys/dev/sound/pci/hda/hdaa_patches.c Wed Jan 18 02:57:22 2017 (r312367) @@ -714,6 +714,15 @@ hdaa_patch_direct(struct hdaa_devinfo *d hda_command(dev, HDA_CMD_12BIT(0, devinfo->nid, 0xf88, 0xc0)); break; + case HDA_CODEC_ALC1150: + if (subid == 0xd9781462) { + /* Too low volume on MSI H170 GAMING M3. */ + hda_command(dev, HDA_CMD_SET_COEFF_INDEX(0, 0x20, + 0x07)); + hda_command(dev, HDA_CMD_SET_PROCESSING_COEFF(0, 0x20, + 0x7cb)); + } + break; } if (subid == APPLE_INTEL_MAC) hda_command(dev, HDA_CMD_12BIT(0, devinfo->nid, Modified: stable/10/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.h Wed Jan 18 02:56:24 2017 (r312366) +++ stable/10/sys/dev/sound/pci/hda/hdac.h Wed Jan 18 02:57:22 2017 (r312367) @@ -367,6 +367,7 @@ #define HDA_CODEC_ALC889 HDA_CODEC_CONSTRUCT(REALTEK, 0x0889) #define HDA_CODEC_ALC892 HDA_CODEC_CONSTRUCT(REALTEK, 0x0892) #define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899) +#define HDA_CODEC_ALC1150 HDA_CODEC_CONSTRUCT(REALTEK, 0x0900) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) /* Motorola */ Modified: stable/10/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdacc.c Wed Jan 18 02:56:24 2017 (r312366) +++ stable/10/sys/dev/sound/pci/hda/hdacc.c Wed Jan 18 02:57:22 2017 (r312367) @@ -111,6 +111,7 @@ static const struct { { HDA_CODEC_ALC889, 0, "Realtek ALC889" }, { HDA_CODEC_ALC892, 0, "Realtek ALC892" }, { HDA_CODEC_ALC899, 0, "Realtek ALC899" }, + { HDA_CODEC_ALC1150, 0, "Realtek ALC1150" }, { HDA_CODEC_AD1882, 0, "Analog Devices AD1882" }, { HDA_CODEC_AD1882A, 0, "Analog Devices AD1882A" }, { HDA_CODEC_AD1883, 0, "Analog Devices AD1883" }, From owner-svn-src-all@freebsd.org Wed Jan 18 03:35:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58FBDCB4461; Wed, 18 Jan 2017 03:35:43 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28B4B18C5; Wed, 18 Jan 2017 03:35:43 +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 v0I3ZgTR005244; Wed, 18 Jan 2017 03:35:42 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I3ZgCZ005243; Wed, 18 Jan 2017 03:35:42 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701180335.v0I3ZgCZ005243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 18 Jan 2017 03:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312368 - head/sys/dev/cxgbe/tom 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, 18 Jan 2017 03:35:43 -0000 Author: np Date: Wed Jan 18 03:35:42 2017 New Revision: 312368 URL: https://svnweb.freebsd.org/changeset/base/312368 Log: cxgbe/tom: Fix a case where do_pass_accept_req wasn't properly restoring the VNET. This should have been in r311949. MFC after: 2 days Modified: head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Wed Jan 18 02:57:22 2017 (r312367) +++ head/sys/dev/cxgbe/tom/t4_listen.c Wed Jan 18 03:35:42 2017 (r312368) @@ -1418,6 +1418,7 @@ found: if (!(synqe->flags & TPF_SYNQE_EXPANDED)) send_reset_synqe(tod, synqe); INP_WUNLOCK(inp); + CURVNET_RESTORE(); release_synqe(synqe); /* extra hold */ return (__LINE__); From owner-svn-src-all@freebsd.org Wed Jan 18 03:42:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD9A2CB477B; Wed, 18 Jan 2017 03:42:22 +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 A3E841D07; Wed, 18 Jan 2017 03:42:22 +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 v0I3gLZO009199; Wed, 18 Jan 2017 03:42:21 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I3gL7T009198; Wed, 18 Jan 2017 03:42:21 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201701180342.v0I3gL7T009198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 18 Jan 2017 03:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312369 - head/sys/powerpc/aim 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, 18 Jan 2017 03:42:23 -0000 Author: jhibbits Date: Wed Jan 18 03:42:21 2017 New Revision: 312369 URL: https://svnweb.freebsd.org/changeset/base/312369 Log: Use the explicit expanded form of cmp. Clang apparently requires the explicit form of this instruction, and rejects uses which ignore the optional cmpD register. This was the only use of the shorthand form of the instruction, so just fix it up to match the others. PR: kern/215681 Submitted by: Mark Millard Reported by: Mark Millard MFC after: 2 weeks Modified: head/sys/powerpc/aim/trap_subr32.S Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Wed Jan 18 03:35:42 2017 (r312368) +++ head/sys/powerpc/aim/trap_subr32.S Wed Jan 18 03:42:21 2017 (r312369) @@ -406,7 +406,7 @@ im0: mtctr %r1 /* load counter */ im1: lwzu %r1, 8(%r2) /* get next pte */ - cmp 0, %r1, %r3 /* see if found pte */ + cmp 0, 0, %r1, %r3 /* see if found pte */ bdnzf 2, im1 /* dec count br if cmp ne and if * count not zero */ bne instr_sec_hash /* if not found set up second hash From owner-svn-src-all@freebsd.org Wed Jan 18 05:32:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4A79CB319D; Wed, 18 Jan 2017 05:32: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 75E6217B1; Wed, 18 Jan 2017 05:32: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 v0I5WojE053735; Wed, 18 Jan 2017 05:32:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I5Woei053733; Wed, 18 Jan 2017 05:32:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701180532.v0I5Woei053733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 18 Jan 2017 05:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312370 - in vendor/NetBSD/tests/dist: kernel/arch/amd64 lib/libpthread 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: Wed, 18 Jan 2017 05:32:51 -0000 Author: ngie Date: Wed Jan 18 05:32:50 2017 New Revision: 312370 URL: https://svnweb.freebsd.org/changeset/base/312370 Log: More test updates from upstream Nothing much to note -- this looks like a good place to stop Modified: vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_wait.c vendor/NetBSD/tests/dist/lib/libpthread/h_common.h Modified: vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_wait.c ============================================================================== --- vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_wait.c Wed Jan 18 03:42:21 2017 (r312369) +++ vendor/NetBSD/tests/dist/kernel/arch/amd64/t_ptrace_wait.c Wed Jan 18 05:32:50 2017 (r312370) @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptrace_wait.c,v 1.9 2017/01/13 21:30:41 christos Exp $ */ +/* $NetBSD: t_ptrace_wait.c,v 1.11 2017/01/18 05:14:34 kamil Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__RCSID("$NetBSD: t_ptrace_wait.c,v 1.9 2017/01/13 21:30:41 christos Exp $"); +__RCSID("$NetBSD: t_ptrace_wait.c,v 1.11 2017/01/18 05:14:34 kamil Exp $"); #include #include @@ -247,6 +247,7 @@ ATF_TC_BODY(watchpoint_read, tc) printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -320,6 +321,7 @@ ATF_TC_BODY(watchpoint_write_unmodified, printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -364,6 +366,8 @@ ATF_TC_BODY(watchpoint_trap_code0, tc) struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -390,6 +394,7 @@ ATF_TC_BODY(watchpoint_trap_code0, tc) pw.pw_index = i; pw.pw_lwpid = 0; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = (void *)check_happy; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_EXECUTION; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -397,6 +402,7 @@ ATF_TC_BODY(watchpoint_trap_code0, tc) printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -414,6 +420,20 @@ ATF_TC_BODY(watchpoint_trap_code0, tc) validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 0); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + pw.pw_md.md_address = NULL; printf("Before writing watchpoint %d (disable it)\n", i); ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1); @@ -452,6 +472,8 @@ ATF_TC_BODY(watchpoint_trap_code1, tc) struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -478,6 +500,7 @@ ATF_TC_BODY(watchpoint_trap_code1, tc) pw.pw_index = i; pw.pw_lwpid = 0; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = (void *)check_happy; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_EXECUTION; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -485,6 +508,7 @@ ATF_TC_BODY(watchpoint_trap_code1, tc) printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%d\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -502,6 +526,20 @@ ATF_TC_BODY(watchpoint_trap_code1, tc) validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 1); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + pw.pw_md.md_address = NULL; printf("Before writing watchpoint %d (disable it)\n", i); ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1); @@ -540,6 +578,8 @@ ATF_TC_BODY(watchpoint_trap_code2, tc) struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -566,6 +606,7 @@ ATF_TC_BODY(watchpoint_trap_code2, tc) pw.pw_index = i; pw.pw_lwpid = 0; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = (void *)check_happy; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_EXECUTION; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -573,6 +614,7 @@ ATF_TC_BODY(watchpoint_trap_code2, tc) printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -590,6 +632,20 @@ ATF_TC_BODY(watchpoint_trap_code2, tc) validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 2); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + pw.pw_md.md_address = NULL; printf("Before writing watchpoint %d (disable it)\n", i); ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1); @@ -628,6 +684,8 @@ ATF_TC_BODY(watchpoint_trap_code3, tc) struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -654,6 +712,7 @@ ATF_TC_BODY(watchpoint_trap_code3, tc) pw.pw_index = i; pw.pw_lwpid = 0; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = (void *)check_happy; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_EXECUTION; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -661,6 +720,7 @@ ATF_TC_BODY(watchpoint_trap_code3, tc) printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -678,6 +738,20 @@ ATF_TC_BODY(watchpoint_trap_code3, tc) validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 3); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + pw.pw_md.md_address = NULL; printf("Before writing watchpoint %d (disable it)\n", i); ATF_REQUIRE(ptrace(PT_WRITE_WATCHPOINT, child, &pw, len) != -1); @@ -716,6 +790,8 @@ ATF_TC_BODY(watchpoint_trap_data_write0, struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -741,6 +817,7 @@ ATF_TC_BODY(watchpoint_trap_data_write0, printf("Preparing code watchpoint trap %d\n", i); pw.pw_index = 0; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = &watchme; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_WRITE; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -748,6 +825,7 @@ ATF_TC_BODY(watchpoint_trap_data_write0, printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -765,6 +843,20 @@ ATF_TC_BODY(watchpoint_trap_data_write0, validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 0); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + printf("Before resuming the child process where it left off and " "without signal to be sent\n"); ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); @@ -799,6 +891,8 @@ ATF_TC_BODY(watchpoint_trap_data_write1, struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -824,6 +918,7 @@ ATF_TC_BODY(watchpoint_trap_data_write1, printf("Preparing code watchpoint trap %d\n", i); pw.pw_index = i; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = &watchme; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_WRITE; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -831,6 +926,7 @@ ATF_TC_BODY(watchpoint_trap_data_write1, printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -848,6 +944,20 @@ ATF_TC_BODY(watchpoint_trap_data_write1, validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 1); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + printf("Before resuming the child process where it left off and " "without signal to be sent\n"); ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); @@ -882,6 +992,8 @@ ATF_TC_BODY(watchpoint_trap_data_write2, struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -907,6 +1019,7 @@ ATF_TC_BODY(watchpoint_trap_data_write2, printf("Preparing code watchpoint trap %d\n", i); pw.pw_index = i; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = &watchme; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_WRITE; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -914,6 +1027,7 @@ ATF_TC_BODY(watchpoint_trap_data_write2, printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -931,6 +1045,20 @@ ATF_TC_BODY(watchpoint_trap_data_write2, validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 2); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + printf("Before resuming the child process where it left off and " "without signal to be sent\n"); ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); @@ -966,6 +1094,8 @@ ATF_TC_BODY(watchpoint_trap_data_write3, struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -991,6 +1121,7 @@ ATF_TC_BODY(watchpoint_trap_data_write3, printf("Preparing code watchpoint trap %d\n", i); pw.pw_index = i; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = &watchme; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_WRITE; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -998,6 +1129,7 @@ ATF_TC_BODY(watchpoint_trap_data_write3, printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -1015,6 +1147,20 @@ ATF_TC_BODY(watchpoint_trap_data_write3, validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 3); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + printf("Before resuming the child process where it left off and " "without signal to be sent\n"); ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); @@ -1049,6 +1195,8 @@ ATF_TC_BODY(watchpoint_trap_data_rw0, tc struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -1074,6 +1222,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw0, tc printf("Preparing code watchpoint trap %d\n", i); pw.pw_index = i; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = &watchme; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_READWRITE; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -1081,6 +1230,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw0, tc printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -1098,6 +1248,20 @@ ATF_TC_BODY(watchpoint_trap_data_rw0, tc validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 0); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + printf("Before resuming the child process where it left off and " "without signal to be sent\n"); ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); @@ -1132,6 +1296,8 @@ ATF_TC_BODY(watchpoint_trap_data_rw1, tc struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -1157,6 +1323,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw1, tc printf("Preparing code watchpoint trap %d\n", i); pw.pw_index = i; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = &watchme; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_READWRITE; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -1164,6 +1331,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw1, tc printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -1181,6 +1349,20 @@ ATF_TC_BODY(watchpoint_trap_data_rw1, tc validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 1); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + printf("Before resuming the child process where it left off and " "without signal to be sent\n"); ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); @@ -1215,6 +1397,8 @@ ATF_TC_BODY(watchpoint_trap_data_rw2, tc struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -1240,6 +1424,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw2, tc printf("Preparing code watchpoint trap %d\n", i); pw.pw_index = i; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = &watchme; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_READWRITE; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -1247,6 +1432,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw2, tc printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -1264,6 +1450,20 @@ ATF_TC_BODY(watchpoint_trap_data_rw2, tc validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 2); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + printf("Before resuming the child process where it left off and " "without signal to be sent\n"); ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); @@ -1298,6 +1498,8 @@ ATF_TC_BODY(watchpoint_trap_data_rw3, tc struct ptrace_watchpoint pw; int len = sizeof(pw); int watchme = 1234; + struct ptrace_siginfo info; + memset(&info, 0, sizeof(info)); printf("Before forking process PID=%d\n", getpid()); ATF_REQUIRE((child = fork()) != -1); @@ -1323,6 +1525,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw3, tc printf("Preparing code watchpoint trap %d\n", i); pw.pw_index = i; + pw.pw_type = PTRACE_PW_TYPE_DBREGS; pw.pw_md.md_address = &watchme; pw.pw_md.md_condition = X86_HW_WATCHPOINT_DR7_CONDITION_DATA_READWRITE; pw.pw_md.md_length = X86_HW_WATCHPOINT_DR7_LENGTH_BYTE; @@ -1330,6 +1533,7 @@ ATF_TC_BODY(watchpoint_trap_data_rw3, tc printf("struct ptrace {\n"); printf("\t.pw_index=%d\n", pw.pw_index); printf("\t.pw_lwpid=%d\n", pw.pw_lwpid); + printf("\t.pw_type=%#x\n", pw.pw_type); printf("\t.pw_md.md_address=%p\n", pw.pw_md.md_address); printf("\t.pw_md.md_condition=%#x\n", pw.pw_md.md_condition); printf("\t.pw_md.md_length=%#x\n", pw.pw_md.md_length); @@ -1347,6 +1551,20 @@ ATF_TC_BODY(watchpoint_trap_data_rw3, tc validate_status_stopped(status, SIGTRAP); + printf("Before calling ptrace(2) with PT_GET_SIGINFO for child\n"); + ATF_REQUIRE(ptrace(PT_GET_SIGINFO, child, &info, sizeof(info)) != -1); + + printf("Signal traced to lwpid=%d\n", info.psi_lwpid); + printf("Signal properties: si_signo=%#x si_code=%#x si_errno=%#x\n", + info.psi_siginfo.si_signo, info.psi_siginfo.si_code, + info.psi_siginfo.si_errno); + + printf("Before checking siginfo_t\n"); + ATF_REQUIRE_EQ(info.psi_siginfo.si_signo, SIGTRAP); + ATF_REQUIRE_EQ(info.psi_siginfo.si_code, TRAP_HWWPT); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap2, 3); + ATF_REQUIRE_EQ(info.psi_siginfo.si_trap3, X86_HW_WATCHPOINT_EVENT_FIRED); + printf("Before resuming the child process where it left off and " "without signal to be sent\n"); ATF_REQUIRE(ptrace(PT_CONTINUE, child, (void *)1, 0) != -1); Modified: vendor/NetBSD/tests/dist/lib/libpthread/h_common.h ============================================================================== --- vendor/NetBSD/tests/dist/lib/libpthread/h_common.h Wed Jan 18 03:42:21 2017 (r312369) +++ vendor/NetBSD/tests/dist/lib/libpthread/h_common.h Wed Jan 18 05:32:50 2017 (r312370) @@ -5,14 +5,14 @@ #define PTHREAD_REQUIRE(x) \ do { \ - int ret = (x); \ - ATF_REQUIRE_MSG(ret == 0, "%s: %s", #x, strerror(ret)); \ + int _ret = (x); \ + ATF_REQUIRE_MSG(_ret == 0, "%s: %s", #x, strerror(_ret)); \ } while (0) #define PTHREAD_REQUIRE_STATUS(x, v) \ do { \ - int ret = (x); \ - ATF_REQUIRE_MSG(ret == (v), "%s: %s", #x, strerror(ret)); \ + int _ret = (x); \ + ATF_REQUIRE_MSG(_ret == (v), "%s: %s", #x, strerror(_ret)); \ } while (0) #endif // H_COMMON_H From owner-svn-src-all@freebsd.org Wed Jan 18 05:35:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2D4DCB320C; Wed, 18 Jan 2017 05:35:35 +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 589E21936; Wed, 18 Jan 2017 05:35:35 +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 v0I5ZYGm053930; Wed, 18 Jan 2017 05:35:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I5ZYY7053929; Wed, 18 Jan 2017 05:35:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701180535.v0I5ZYY7053929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 18 Jan 2017 05:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312371 - vendor/NetBSD/tests/01.17.2017_21.34 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: Wed, 18 Jan 2017 05:35:35 -0000 Author: ngie Date: Wed Jan 18 05:35:34 2017 New Revision: 312371 URL: https://svnweb.freebsd.org/changeset/base/312371 Log: Tag the "01.17.2017_21.34" snapshot of ^/vendor/NetBSD/tests Added: vendor/NetBSD/tests/01.17.2017_21.34/ - copied from r312370, vendor/NetBSD/tests/dist/ From owner-svn-src-all@freebsd.org Wed Jan 18 08:11:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3501FCB42A0; Wed, 18 Jan 2017 08:11:20 +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 041401FBF; Wed, 18 Jan 2017 08:11:19 +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 v0I8BJtK016068; Wed, 18 Jan 2017 08:11:19 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I8BIb6016063; Wed, 18 Jan 2017 08:11:18 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701180811.v0I8BIb6016063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 18 Jan 2017 08:11: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: r312373 - in stable/11: lib/libstand lib/libz lib/libz/contrib lib/libz/doc lib/libz/test usr.bin/minigzip 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, 18 Jan 2017 08:11:20 -0000 Author: delphij Date: Wed Jan 18 08:11:18 2017 New Revision: 312373 URL: https://svnweb.freebsd.org/changeset/base/312373 Log: MFC r311275: Restructure libz. Added: - copied from r311275, head/contrib/zlib/ Directory Properties: stable/11/contrib/zlib/ (props changed) Deleted: stable/11/lib/libz/ChangeLog stable/11/lib/libz/FAQ stable/11/lib/libz/README stable/11/lib/libz/adler32.c stable/11/lib/libz/compress.c stable/11/lib/libz/contrib/ stable/11/lib/libz/crc32.c stable/11/lib/libz/crc32.h stable/11/lib/libz/deflate.c stable/11/lib/libz/deflate.h stable/11/lib/libz/doc/ stable/11/lib/libz/gzclose.c stable/11/lib/libz/gzguts.h stable/11/lib/libz/gzlib.c stable/11/lib/libz/gzread.c stable/11/lib/libz/gzwrite.c stable/11/lib/libz/infback.c stable/11/lib/libz/inffast.c stable/11/lib/libz/inffast.h stable/11/lib/libz/inffixed.h stable/11/lib/libz/inflate.c stable/11/lib/libz/inflate.h stable/11/lib/libz/inftrees.c stable/11/lib/libz/inftrees.h stable/11/lib/libz/test/ stable/11/lib/libz/trees.c stable/11/lib/libz/trees.h stable/11/lib/libz/uncompr.c stable/11/lib/libz/zconf.h stable/11/lib/libz/zlib.3 stable/11/lib/libz/zlib.h stable/11/lib/libz/zutil.c stable/11/lib/libz/zutil.h Modified: stable/11/lib/libstand/Makefile stable/11/lib/libz/FREEBSD-upgrade stable/11/lib/libz/Makefile stable/11/usr.bin/minigzip/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libstand/Makefile ============================================================================== --- stable/11/lib/libstand/Makefile Wed Jan 18 05:36:09 2017 (r312372) +++ stable/11/lib/libstand/Makefile Wed Jan 18 08:11:18 2017 (r312373) @@ -109,9 +109,9 @@ libstand_bzlib_private.h: bzlib_private. sed -e 's||"stand.h"|' \ ${.ALLSRC} > ${.TARGET} -# decompression functionality from libz -.PATH: ${LIBSTAND_SRC}/../libz -CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../libz +# decompression functionality from zlib +.PATH: ${LIBSTAND_SRC}/../../contrib/zlib +CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../../contrib/zlib SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h .for file in infback.c inffast.c inflate.c inftrees.c zutil.c Modified: stable/11/lib/libz/FREEBSD-upgrade ============================================================================== --- stable/11/lib/libz/FREEBSD-upgrade Wed Jan 18 05:36:09 2017 (r312372) +++ stable/11/lib/libz/FREEBSD-upgrade Wed Jan 18 08:11:18 2017 (r312373) @@ -1,44 +1,16 @@ $FreeBSD$ -ZLib 1.2.2 - -Original distribution from http://www.gzip.org/zlib/ - -Vendor files removed from distribution before import: - INDEX configure qnx/ - Makefile contrib/ win32/ - Makefile.in msdos/ zconf.in.h - amiga/ old/ - as400/ projects/ - -Vendor files imported: - ChangeLog example.c minigzip.c - FAQ gzio.c trees.c - README infback.c trees.h - adler32.c inffast.c uncompr.c - algorithm.txt inffast.h zconf.h - compress.c inffixed.h zlib.3 - crc32.c inflate.c zlib.h - crc32.h inflate.h zutil.c - deflate.c inftrees.c zutil.h - deflate.h inftrees.h - -As of April, 2005, only the following three vendor files -had non-trivial local changes: - gzio.c minigzip.c zconf.h - -Added files (not from vendor): - Makefile zopen.c FREEBSD-upgrade +Original distribution from http://zlib.net/. Currently, only trivial +changes were made to support build of libstand and to suppress certain +compiler warnings, we upstream our local changes whenever they would +benefit other consumers. To Update: 1) Unpack vendor sources into a clean directory. - 2) Delete unnecessary files. - 3) Import onto the vendor branch. The 1.2.2 import was done like this: - cvs -d import -ko -m "ZLib 1.2.2" src/lib/libz ZLIB v1_2_2 - 4) In a clean directory, check out a fresh copy of HEAD, - merging in vendor changes since the last import. - cvs -d co -jZLIB:yesterday -jZLIB src/lib/libz - 5) Resolve any conflicts and commit them. - 6) Update this file with any changes to the file list or update procedure. + 2) Import onto the vendor area. + 3) Merge the vendor tree to contrib/zlib, which contains a stripped down + version of upstream source, resolve any conflicts. + 4) Double check zconf.h, zlib.pc, and Symbol.map to make sure that we + have the required changes. Test universe and commit them. -kientzle@FreeBSD.org +delphij@FreeBSD.org Modified: stable/11/lib/libz/Makefile ============================================================================== --- stable/11/lib/libz/Makefile Wed Jan 18 05:36:09 2017 (r312372) +++ stable/11/lib/libz/Makefile Wed Jan 18 08:11:18 2017 (r312373) @@ -8,6 +8,10 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 6 MAN= zlib.3 zopen.3 +ZLIBSRC= ${SRCTOP}/contrib/zlib + +.PATH: ${ZLIBSRC} + #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 #CFLAGS=-g -DDEBUG #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ @@ -37,14 +41,14 @@ SRCS+= zopen.c SRCS+= zutil.c #.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*} -#.PATH: ${.CURDIR}/contrib/asm686 +#.PATH: ${ZLIBSRC}/contrib/asm686 #SRCS+= match.S #CFLAGS+= -DASMV -DNO_UNDERLINE #ACFLAGS+= -Wa,--noexecstack #.endif #.if ${MACHINE_ARCH} == "amd64" -#.PATH: ${.CURDIR}/contrib/gcc_gvmat64 +#.PATH: ${ZLIBSRC}/contrib/gcc_gvmat64 #SRCS+= gvmat64.S #CFLAGS+= -DASMV -DNO_UNDERLINE #ACFLAGS+= -Wa,--noexecstack @@ -56,7 +60,7 @@ CFLAGS+= -DSYMBOL_VERSIONING INCS= zconf.h zlib.h -.PATH: ${.CURDIR}/test +.PATH: ${ZLIBSRC}/test minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz Modified: stable/11/usr.bin/minigzip/Makefile ============================================================================== --- stable/11/usr.bin/minigzip/Makefile Wed Jan 18 05:36:09 2017 (r312372) +++ stable/11/usr.bin/minigzip/Makefile Wed Jan 18 08:11:18 2017 (r312373) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCDIR= ${.CURDIR}/../../lib/libz/test +SRCDIR= ${.CURDIR}/../../contrib/zlib/test .PATH: ${SRCDIR} PROG= minigzip From owner-svn-src-all@freebsd.org Wed Jan 18 08:18:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62785CB4637; Wed, 18 Jan 2017 08:18:09 +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 3D008128D; Wed, 18 Jan 2017 08:18:09 +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 v0I8I8pZ017831; Wed, 18 Jan 2017 08:18:08 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I8I82b017827; Wed, 18 Jan 2017 08:18:08 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201701180818.v0I8I82b017827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 18 Jan 2017 08:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312374 - head/sys/boot/efi/libefi 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, 18 Jan 2017 08:18:09 -0000 Author: tsoome Date: Wed Jan 18 08:18:07 2017 New Revision: 312374 URL: https://svnweb.freebsd.org/changeset/base/312374 Log: loader: efi devpath api usage should be more aware of NULL pointers As the efi_devpath_last_node() and efi_devpath_trim() can return NULL pointers, the consumers of this API should check the the NULL pointers. Same for efinet_dev_init() using calloc(). Reported by: Robert Mustacchi Reviewed by: jhb, allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D9203 Modified: head/sys/boot/efi/libefi/devpath.c head/sys/boot/efi/libefi/efinet.c head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/devpath.c ============================================================================== --- head/sys/boot/efi/libefi/devpath.c Wed Jan 18 08:11:18 2017 (r312373) +++ head/sys/boot/efi/libefi/devpath.c Wed Jan 18 08:18:07 2017 (r312374) @@ -106,15 +106,18 @@ efi_devpath_trim(EFI_DEVICE_PATH *devpat EFI_DEVICE_PATH *node, *copy; size_t prefix, len; - node = efi_devpath_last_node(devpath); + if ((node = efi_devpath_last_node(devpath)) == NULL) + return (NULL); prefix = (UINT8 *)node - (UINT8 *)devpath; if (prefix == 0) return (NULL); len = prefix + DevicePathNodeLength(NextDevicePathNode(node)); copy = malloc(len); - memcpy(copy, devpath, prefix); - node = (EFI_DEVICE_PATH *)((UINT8 *)copy + prefix); - SetDevicePathEndNode(node); + if (copy != NULL) { + memcpy(copy, devpath, prefix); + node = (EFI_DEVICE_PATH *)((UINT8 *)copy + prefix); + SetDevicePathEndNode(node); + } return (copy); } Modified: head/sys/boot/efi/libefi/efinet.c ============================================================================== --- head/sys/boot/efi/libefi/efinet.c Wed Jan 18 08:11:18 2017 (r312373) +++ head/sys/boot/efi/libefi/efinet.c Wed Jan 18 08:18:07 2017 (r312374) @@ -291,12 +291,18 @@ efinet_dev_init() if (EFI_ERROR(status)) return (efi_status_to_errno(status)); handles2 = (EFI_HANDLE *)malloc(sz); + if (handles2 == NULL) { + free(handles); + return (ENOMEM); + } nifs = 0; for (i = 0; i < sz / sizeof(EFI_HANDLE); i++) { devpath = efi_lookup_devpath(handles[i]); if (devpath == NULL) continue; - node = efi_devpath_last_node(devpath); + if ((node = efi_devpath_last_node(devpath)) == NULL) + continue; + if (DevicePathType(node) != MESSAGING_DEVICE_PATH || DevicePathSubType(node) != MSG_MAC_ADDR_DP) continue; @@ -318,20 +324,24 @@ efinet_dev_init() } free(handles); if (nifs == 0) { - free(handles2); - return (ENOENT); + err = ENOENT; + goto done; } err = efi_register_handles(&efinet_dev, handles2, NULL, nifs); - if (err != 0) { - free(handles2); - return (err); - } + if (err != 0) + goto done; - efinetif.netif_nifs = nifs; efinetif.netif_ifs = calloc(nifs, sizeof(struct netif_dif)); - stats = calloc(nifs, sizeof(struct netif_stats)); + if (efinetif.netif_ifs == NULL || stats == NULL) { + free(efinetif.netif_ifs); + free(stats); + efinetif.netif_ifs = NULL; + err = ENOMEM; + goto done; + } + efinetif.netif_nifs = nifs; for (i = 0; i < nifs; i++) { @@ -341,9 +351,9 @@ efinet_dev_init() dif->dif_stats = &stats[i]; dif->dif_private = handles2[i]; } +done: free(handles2); - - return (0); + return (err); } static int Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Wed Jan 18 08:11:18 2017 (r312373) +++ head/sys/boot/efi/libefi/efipart.c Wed Jan 18 08:18:07 2017 (r312374) @@ -130,10 +130,13 @@ efipart_init(void) * we try to find the parent device and add that instead as * that will be the CD filesystem. */ - node = efi_devpath_last_node(devpath); + if ((node = efi_devpath_last_node(devpath)) == NULL) + continue; if (DevicePathType(node) == MEDIA_DEVICE_PATH && DevicePathSubType(node) == MEDIA_CDROM_DP) { devpathcpy = efi_devpath_trim(devpath); + if (devpathcpy == NULL) + continue; tmpdevpath = devpathcpy; status = BS->LocateDevicePath(&blkio_guid, &tmpdevpath, &handle); From owner-svn-src-all@freebsd.org Wed Jan 18 08:20:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22C4FCB4AFF; Wed, 18 Jan 2017 08:20:38 +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 EE8551973; Wed, 18 Jan 2017 08:20:37 +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 v0I8KbVo017989; Wed, 18 Jan 2017 08:20:37 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0I8Kafg017985; Wed, 18 Jan 2017 08:20:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701180820.v0I8Kafg017985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 18 Jan 2017 08:20:36 +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: r312375 - in stable/10: lib/libstand lib/libz lib/libz/contrib lib/libz/doc lib/libz/test usr.bin/minigzip 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, 18 Jan 2017 08:20:38 -0000 Author: delphij Date: Wed Jan 18 08:20:36 2017 New Revision: 312375 URL: https://svnweb.freebsd.org/changeset/base/312375 Log: MFC r311275: Restructure libz. Added: - copied from r311275, head/contrib/zlib/ Directory Properties: stable/10/contrib/zlib/ (props changed) Deleted: stable/10/lib/libz/ChangeLog stable/10/lib/libz/FAQ stable/10/lib/libz/README stable/10/lib/libz/adler32.c stable/10/lib/libz/compress.c stable/10/lib/libz/contrib/ stable/10/lib/libz/crc32.c stable/10/lib/libz/crc32.h stable/10/lib/libz/deflate.c stable/10/lib/libz/deflate.h stable/10/lib/libz/doc/ stable/10/lib/libz/gzclose.c stable/10/lib/libz/gzguts.h stable/10/lib/libz/gzlib.c stable/10/lib/libz/gzread.c stable/10/lib/libz/gzwrite.c stable/10/lib/libz/infback.c stable/10/lib/libz/inffast.c stable/10/lib/libz/inffast.h stable/10/lib/libz/inffixed.h stable/10/lib/libz/inflate.c stable/10/lib/libz/inflate.h stable/10/lib/libz/inftrees.c stable/10/lib/libz/inftrees.h stable/10/lib/libz/test/ stable/10/lib/libz/trees.c stable/10/lib/libz/trees.h stable/10/lib/libz/uncompr.c stable/10/lib/libz/zconf.h stable/10/lib/libz/zlib.3 stable/10/lib/libz/zlib.h stable/10/lib/libz/zutil.c stable/10/lib/libz/zutil.h Modified: stable/10/lib/libstand/Makefile stable/10/lib/libz/FREEBSD-upgrade stable/10/lib/libz/Makefile stable/10/usr.bin/minigzip/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libstand/Makefile ============================================================================== --- stable/10/lib/libstand/Makefile Wed Jan 18 08:18:07 2017 (r312374) +++ stable/10/lib/libstand/Makefile Wed Jan 18 08:20:36 2017 (r312375) @@ -134,8 +134,8 @@ libstand_bzlib_private.h: bzlib_private. ${.ALLSRC} > ${.TARGET} # decompression functionality from libz -.PATH: ${.CURDIR}/../libz -CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../libz +.PATH: ${.CURDIR}/../../contrib/zlib +CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../../contrib/zlib SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h .for file in infback.c inffast.c inflate.c inftrees.c zutil.c Modified: stable/10/lib/libz/FREEBSD-upgrade ============================================================================== --- stable/10/lib/libz/FREEBSD-upgrade Wed Jan 18 08:18:07 2017 (r312374) +++ stable/10/lib/libz/FREEBSD-upgrade Wed Jan 18 08:20:36 2017 (r312375) @@ -1,44 +1,16 @@ $FreeBSD: head/lib/libz/FREEBSD-upgrade 146082 2005-05-11 03:50:50Z kientzle $ -ZLib 1.2.2 - -Original distribution from http://www.gzip.org/zlib/ - -Vendor files removed from distribution before import: - INDEX configure qnx/ - Makefile contrib/ win32/ - Makefile.in msdos/ zconf.in.h - amiga/ old/ - as400/ projects/ - -Vendor files imported: - ChangeLog example.c minigzip.c - FAQ gzio.c trees.c - README infback.c trees.h - adler32.c inffast.c uncompr.c - algorithm.txt inffast.h zconf.h - compress.c inffixed.h zlib.3 - crc32.c inflate.c zlib.h - crc32.h inflate.h zutil.c - deflate.c inftrees.c zutil.h - deflate.h inftrees.h - -As of April, 2005, only the following three vendor files -had non-trivial local changes: - gzio.c minigzip.c zconf.h - -Added files (not from vendor): - Makefile zopen.c FREEBSD-upgrade +Original distribution from http://zlib.net/. Currently, only trivial +changes were made to support build of libstand and to suppress certain +compiler warnings, we upstream our local changes whenever they would +benefit other consumers. To Update: 1) Unpack vendor sources into a clean directory. - 2) Delete unnecessary files. - 3) Import onto the vendor branch. The 1.2.2 import was done like this: - cvs -d import -ko -m "ZLib 1.2.2" src/lib/libz ZLIB v1_2_2 - 4) In a clean directory, check out a fresh copy of HEAD, - merging in vendor changes since the last import. - cvs -d co -jZLIB:yesterday -jZLIB src/lib/libz - 5) Resolve any conflicts and commit them. - 6) Update this file with any changes to the file list or update procedure. + 2) Import onto the vendor area. + 3) Merge the vendor tree to contrib/zlib, which contains a stripped down + version of upstream source, resolve any conflicts. + 4) Double check zconf.h, zlib.pc, and Symbol.map to make sure that we + have the required changes. Test universe and commit them. -kientzle@FreeBSD.org +delphij@FreeBSD.org Modified: stable/10/lib/libz/Makefile ============================================================================== --- stable/10/lib/libz/Makefile Wed Jan 18 08:18:07 2017 (r312374) +++ stable/10/lib/libz/Makefile Wed Jan 18 08:20:36 2017 (r312375) @@ -7,6 +7,10 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 6 MAN= zlib.3 +ZLIBSRC= ${SRCTOP}/contrib/zlib + +.PATH: ${ZLIBSRC} + #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 #CFLAGS=-g -DDEBUG #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ @@ -36,14 +40,14 @@ SRCS+= zopen.c SRCS+= zutil.c #.if ${MACHINE_ARCH} == "i386" && ${MACHINE_CPU:M*i686*} -#.PATH: ${.CURDIR}/contrib/asm686 +#.PATH: ${ZLIBSRC}/contrib/asm686 #SRCS+= match.S #CFLAGS+= -DASMV -DNO_UNDERLINE #ACFLAGS+= -Wa,--noexecstack #.endif #.if ${MACHINE_ARCH} == "amd64" -#.PATH: ${.CURDIR}/contrib/gcc_gvmat64 +#.PATH: ${ZLIBSRC}/contrib/gcc_gvmat64 #SRCS+= gvmat64.S #CFLAGS+= -DASMV -DNO_UNDERLINE #ACFLAGS+= -Wa,--noexecstack @@ -55,7 +59,7 @@ CFLAGS+= -DSYMBOL_VERSIONING INCS= zconf.h zlib.h -.PATH: ${.CURDIR}/test +.PATH: ${ZLIBSRC}/test minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz Modified: stable/10/usr.bin/minigzip/Makefile ============================================================================== --- stable/10/usr.bin/minigzip/Makefile Wed Jan 18 08:18:07 2017 (r312374) +++ stable/10/usr.bin/minigzip/Makefile Wed Jan 18 08:20:36 2017 (r312375) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCDIR= ${.CURDIR}/../../lib/libz/test +SRCDIR= ${.CURDIR}/../../contrib/zlib/test .PATH: ${SRCDIR} PROG= minigzip From owner-svn-src-all@freebsd.org Wed Jan 18 13:27:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF3DFCB6D52; Wed, 18 Jan 2017 13:27:25 +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 8264C1A7C; Wed, 18 Jan 2017 13:27:25 +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 v0IDROtk045478; Wed, 18 Jan 2017 13:27:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IDROqV045477; Wed, 18 Jan 2017 13:27:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201701181327.v0IDROqV045477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 18 Jan 2017 13:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312378 - head/sys/cddl/dev/fbt/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, 18 Jan 2017 13:27:25 -0000 Author: andrew Date: Wed Jan 18 13:27:24 2017 New Revision: 312378 URL: https://svnweb.freebsd.org/changeset/base/312378 Log: Use the kernel stack in the ARM FBT DTrace provider. This is used to find the fifth argument to functions being traced, however there was an error where the userspace stack was being used. This may be invalid leading to a kernel panic if this address is unmapped. Submitted by: Graeme Jenkinson MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9229 Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c Modified: head/sys/cddl/dev/fbt/arm/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/arm/fbt_isa.c Wed Jan 18 10:21:06 2017 (r312377) +++ head/sys/cddl/dev/fbt/arm/fbt_isa.c Wed Jan 18 13:27:24 2017 (r312378) @@ -61,7 +61,7 @@ fbt_invop(uintptr_t addr, struct trapfra /* Get 5th parameter from stack */ DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - fifthparam = *(register_t *)frame->tf_usr_sp; + fifthparam = *(register_t *)frame->tf_svc_sp; DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT | CPU_DTRACE_BADADDR); dtrace_probe(fbt->fbtp_id, frame->tf_r0, From owner-svn-src-all@freebsd.org Wed Jan 18 13:31:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9113ACB6076; Wed, 18 Jan 2017 13:31:20 +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 5940C1DA7; Wed, 18 Jan 2017 13:31:20 +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 v0IDVJSW048451; Wed, 18 Jan 2017 13:31:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IDVHWf048428; Wed, 18 Jan 2017 13:31:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701181331.v0IDVHWf048428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 18 Jan 2017 13:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312379 - in head: lib/libc/sys sbin/ifconfig sys/conf sys/kern sys/modules/if_lagg sys/modules/if_vlan sys/net sys/netinet sys/netinet6 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: Wed, 18 Jan 2017 13:31:20 -0000 Author: hselasky Date: Wed Jan 18 13:31:17 2017 New Revision: 312379 URL: https://svnweb.freebsd.org/changeset/base/312379 Log: Implement kernel support for hardware rate limited sockets. - Add RATELIMIT kernel configuration keyword which must be set to enable the new functionality. - Add support for hardware driven, Receive Side Scaling, RSS aware, rate limited sendqueues and expose the functionality through the already established SO_MAX_PACING_RATE setsockopt(). The API support rates in the range from 1 to 4Gbytes/s which are suitable for regular TCP and UDP streams. The setsockopt(2) manual page has been updated. - Add rate limit function callback API to "struct ifnet" which supports the following operations: if_snd_tag_alloc(), if_snd_tag_modify(), if_snd_tag_query() and if_snd_tag_free(). - Add support to ifconfig to view, set and clear the IFCAP_TXRTLMT flag, which tells if a network driver supports rate limiting or not. - This patch also adds support for rate limiting through VLAN and LAGG intermediate network devices. - How rate limiting works: 1) The userspace application calls setsockopt() after accepting or making a new connection to set the rate which is then stored in the socket structure in the kernel. Later on when packets are transmitted a check is made in the transmit path for rate changes. A rate change implies a non-blocking ifp->if_snd_tag_alloc() call will be made to the destination network interface, which then sets up a custom sendqueue with the given rate limitation parameter. A "struct m_snd_tag" pointer is returned which serves as a "snd_tag" hint in the m_pkthdr for the subsequently transmitted mbufs. 2) When the network driver sees the "m->m_pkthdr.snd_tag" different from NULL, it will move the packets into a designated rate limited sendqueue given by the snd_tag pointer. It is up to the individual drivers how the rate limited traffic will be rate limited. 3) Route changes are detected by the NIC drivers in the ifp->if_transmit() routine when the ifnet pointer in the incoming snd_tag mismatches the one of the network interface. The network adapter frees the mbuf and returns EAGAIN which causes the ip_output() to release and clear the send tag. Upon next ip_output() a new "snd_tag" will be tried allocated. 4) When the PCB is detached the custom sendqueue will be released by a non-blocking ifp->if_snd_tag_free() call to the currently bound network interface. Reviewed by: wblock (manpages), adrian, gallatin, scottl (network) Differential Revision: https://reviews.freebsd.org/D3687 Sponsored by: Mellanox Technologies MFC after: 3 months Modified: head/lib/libc/sys/getsockopt.2 head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c head/sys/conf/NOTES head/sys/conf/config.mk head/sys/conf/kern.opts.mk head/sys/conf/options head/sys/kern/uipc_socket.c head/sys/modules/if_lagg/Makefile head/sys/modules/if_vlan/Makefile head/sys/net/ieee8023ad_lacp.c head/sys/net/ieee8023ad_lacp.h head/sys/net/if.h head/sys/net/if_dead.c head/sys/net/if_lagg.c head/sys/net/if_var.h head/sys/net/if_vlan.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c head/sys/sys/mbuf.h head/sys/sys/socket.h head/sys/sys/socketvar.h Modified: head/lib/libc/sys/getsockopt.2 ============================================================================== --- head/lib/libc/sys/getsockopt.2 Wed Jan 18 13:27:24 2017 (r312378) +++ head/lib/libc/sys/getsockopt.2 Wed Jan 18 13:31:17 2017 (r312379) @@ -28,7 +28,7 @@ .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd April 5, 2013 +.Dd January 18, 2017 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -188,6 +188,7 @@ The following options are recognized in .It Dv SO_LISTENINCQLEN Ta "get incomplete queue length of the socket (get only)" .It Dv SO_USER_COOKIE Ta "set the 'so_user_cookie' value for the socket (uint32_t, set only)" .It Dv SO_TS_CLOCK Ta "set specific format of timestamp returned by SO_TIMESTAMP" +.It Dv SO_MAX_PACING_RATE "set the maximum transmit rate in bytes per second for the socket" .El .Pp .Dv SO_DEBUG @@ -515,6 +516,10 @@ returns the maximal number of queued con returns the number of unaccepted complete connections. .Dv SO_LISTENINCQLEN returns the number of unaccepted incomplete connections. +.Pp +.Dv SO_MAX_PACING_RATE +instruct the socket and underlying network adapter layers to limit the +transfer rate to the given unsigned 32-bit value in bytes per second. .Sh RETURN VALUES .Rv -std .Sh ERRORS Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Jan 18 13:27:24 2017 (r312378) +++ head/sbin/ifconfig/ifconfig.8 Wed Jan 18 13:31:17 2017 (r312379) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd September 17, 2016 +.Dd January 18, 2017 .Dt IFCONFIG 8 .Os .Sh NAME @@ -460,6 +460,8 @@ this directive is used to select between and 802.11g .Pq Cm 11g operating modes. +.It Cm txrtlmt +Set if the driver supports TX rate limiting. .It Cm inst Ar minst , Cm instance Ar minst Set the media instance to .Ar minst . Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Wed Jan 18 13:27:24 2017 (r312378) +++ head/sbin/ifconfig/ifconfig.c Wed Jan 18 13:31:17 2017 (r312379) @@ -1145,7 +1145,7 @@ unsetifdescr(const char *val, int value, "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ -"\26RXCSUM_IPV6\27TXCSUM_IPV6" +"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT" /* * Print the status of the interface. If an address family was @@ -1453,6 +1453,8 @@ static struct cmd basic_cmds[] = { DEF_CMD("-wol_mcast", -IFCAP_WOL_MCAST, setifcap), DEF_CMD("wol_magic", IFCAP_WOL_MAGIC, setifcap), DEF_CMD("-wol_magic", -IFCAP_WOL_MAGIC, setifcap), + DEF_CMD("txrtlmt", IFCAP_TXRTLMT, setifcap), + DEF_CMD("-txrtlmt", -IFCAP_TXRTLMT, setifcap), DEF_CMD("normal", -IFF_LINK0, setifflags), DEF_CMD("compress", IFF_LINK0, setifflags), DEF_CMD("noicmp", IFF_LINK1, setifflags), Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/conf/NOTES Wed Jan 18 13:31:17 2017 (r312379) @@ -619,6 +619,8 @@ options HWPMC_HOOKS # Other necessary options INET #Internet communications protocols options INET6 #IPv6 communications protocols +options RATELIMIT # TX rate limiting support + options ROUTETABLES=2 # allocated fibs up to 65536. default is 1. # but that would be a bad idea as they are large. Modified: head/sys/conf/config.mk ============================================================================== --- head/sys/conf/config.mk Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/conf/config.mk Wed Jan 18 13:31:17 2017 (r312379) @@ -19,6 +19,10 @@ opt_inet.h: opt_inet6.h: @echo "#define INET6 1" > ${.TARGET} .endif +.if ${MK_RATELIMIT} != "no" +opt_ratelimit.h: + @echo "#define RATELIMIT 1" > ${.TARGET} +.endif .if ${MK_EISA} != "no" opt_eisa.h: @echo "#define DEV_EISA 1" > ${.TARGET} Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/conf/kern.opts.mk Wed Jan 18 13:31:17 2017 (r312379) @@ -48,6 +48,7 @@ __DEFAULT_NO_OPTIONS = \ EXTRA_TCP_STACKS \ NAND \ OFED \ + RATELIMIT \ REPRODUCIBLE_BUILD # Some options are totally broken on some architectures. We disable Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/conf/options Wed Jan 18 13:31:17 2017 (r312379) @@ -412,6 +412,7 @@ BOOTP_NFSV3 opt_bootp.h BOOTP_WIRED_TO opt_bootp.h DEVICE_POLLING DUMMYNET opt_ipdn.h +RATELIMIT opt_ratelimit.h INET opt_inet.h INET6 opt_inet6.h IPDIVERT Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/kern/uipc_socket.c Wed Jan 18 13:31:17 2017 (r312379) @@ -2699,6 +2699,14 @@ sosetopt(struct socket *so, struct socko so->so_ts_clock = optval; break; + case SO_MAX_PACING_RATE: + error = sooptcopyin(sopt, &val32, sizeof(val32), + sizeof(val32)); + if (error) + goto bad; + so->so_max_pacing_rate = val32; + break; + default: if (V_socket_hhh[HHOOK_SOCKET_OPT]->hhh_nhooks > 0) error = hhook_run_socket(so, sopt, @@ -2890,6 +2898,10 @@ integer: optval = so->so_ts_clock; goto integer; + case SO_MAX_PACING_RATE: + optval = so->so_max_pacing_rate; + goto integer; + default: if (V_socket_hhh[HHOOK_SOCKET_OPT]->hhh_nhooks > 0) error = hhook_run_socket(so, sopt, Modified: head/sys/modules/if_lagg/Makefile ============================================================================== --- head/sys/modules/if_lagg/Makefile Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/modules/if_lagg/Makefile Wed Jan 18 13:31:17 2017 (r312379) @@ -2,6 +2,6 @@ .PATH: ${.CURDIR}/../../net KMOD= if_lagg -SRCS= if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h +SRCS= if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h opt_ratelimit.h .include Modified: head/sys/modules/if_vlan/Makefile ============================================================================== --- head/sys/modules/if_vlan/Makefile Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/modules/if_vlan/Makefile Wed Jan 18 13:31:17 2017 (r312379) @@ -4,6 +4,6 @@ KMOD= if_vlan SRCS= if_vlan.c -SRCS+= opt_inet.h opt_vlan.h +SRCS+= opt_inet.h opt_vlan.h opt_ratelimit.h .include Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/net/ieee8023ad_lacp.c Wed Jan 18 13:31:17 2017 (r312379) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ratelimit.h" + #include #include #include @@ -853,6 +855,35 @@ lacp_select_tx_port(struct lagg_softc *s return (lp->lp_lagg); } + +#ifdef RATELIMIT +struct lagg_port * +lacp_select_tx_port_by_hash(struct lagg_softc *sc, uint32_t flowid) +{ + struct lacp_softc *lsc = LACP_SOFTC(sc); + struct lacp_portmap *pm; + struct lacp_port *lp; + uint32_t hash; + + if (__predict_false(lsc->lsc_suppress_distributing)) { + LACP_DPRINTF((NULL, "%s: waiting transit\n", __func__)); + return (NULL); + } + + pm = &lsc->lsc_pmap[lsc->lsc_activemap]; + if (pm->pm_count == 0) { + LACP_DPRINTF((NULL, "%s: no active aggregator\n", __func__)); + return (NULL); + } + + hash = flowid >> sc->flowid_shift; + hash %= pm->pm_count; + lp = pm->pm_map[hash]; + + return (lp->lp_lagg); +} +#endif + /* * lacp_suppress_distributing: drop transmit packets for a while * to preserve packet ordering. Modified: head/sys/net/ieee8023ad_lacp.h ============================================================================== --- head/sys/net/ieee8023ad_lacp.h Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/net/ieee8023ad_lacp.h Wed Jan 18 13:31:17 2017 (r312379) @@ -284,6 +284,9 @@ struct lacp_softc { struct mbuf *lacp_input(struct lagg_port *, struct mbuf *); struct lagg_port *lacp_select_tx_port(struct lagg_softc *, struct mbuf *); +#ifdef RATELIMIT +struct lagg_port *lacp_select_tx_port_by_hash(struct lagg_softc *, uint32_t); +#endif void lacp_attach(struct lagg_softc *); void lacp_detach(void *); void lacp_init(struct lagg_softc *); Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/net/if.h Wed Jan 18 13:31:17 2017 (r312379) @@ -239,6 +239,7 @@ struct if_data { #define IFCAP_RXCSUM_IPV6 0x200000 /* can offload checksum on IPv6 RX */ #define IFCAP_TXCSUM_IPV6 0x400000 /* can offload checksum on IPv6 TX */ #define IFCAP_HWSTATS 0x800000 /* manages counters internally */ +#define IFCAP_TXRTLMT 0x1000000 /* hardware supports TX rate limiting */ #define IFCAP_HWCSUM_IPV6 (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6) Modified: head/sys/net/if_dead.c ============================================================================== --- head/sys/net/if_dead.c Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/net/if_dead.c Wed Jan 18 13:31:17 2017 (r312379) @@ -100,6 +100,30 @@ ifdead_get_counter(struct ifnet *ifp, if return (0); } +static int +ifdead_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, + struct m_snd_tag **ppmt) +{ + return (EOPNOTSUPP); +} + +static int +ifdead_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *params) +{ + return (EOPNOTSUPP); +} + +static int +ifdead_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params) +{ + return (EOPNOTSUPP); +} + +static void +ifdead_snd_tag_free(struct m_snd_tag *pmt) +{ +} + void if_dead(struct ifnet *ifp) { @@ -112,4 +136,8 @@ if_dead(struct ifnet *ifp) ifp->if_qflush = ifdead_qflush; ifp->if_transmit = ifdead_transmit; ifp->if_get_counter = ifdead_get_counter; + ifp->if_snd_tag_alloc = ifdead_snd_tag_alloc; + ifp->if_snd_tag_modify = ifdead_snd_tag_modify; + ifp->if_snd_tag_query = ifdead_snd_tag_query; + ifp->if_snd_tag_free = ifdead_snd_tag_free; } Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/net/if_lagg.c Wed Jan 18 13:31:17 2017 (r312379) @@ -23,6 +23,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_ratelimit.h" #include #include @@ -118,6 +119,11 @@ static void lagg_port2req(struct lagg_po static void lagg_init(void *); static void lagg_stop(struct lagg_softc *); static int lagg_ioctl(struct ifnet *, u_long, caddr_t); +#ifdef RATELIMIT +static int lagg_snd_tag_alloc(struct ifnet *, + union if_snd_tag_alloc_params *, + struct m_snd_tag **); +#endif static int lagg_ether_setmulti(struct lagg_softc *); static int lagg_ether_cmdmulti(struct lagg_port *, int); static int lagg_setflag(struct lagg_port *, int, int, @@ -503,7 +509,12 @@ lagg_clone_create(struct if_clone *ifc, ifp->if_ioctl = lagg_ioctl; ifp->if_get_counter = lagg_get_counter; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; +#ifdef RATELIMIT + ifp->if_snd_tag_alloc = lagg_snd_tag_alloc; + ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS | IFCAP_TXRTLMT; +#else ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; +#endif /* * Attach as an ordinary ethernet device, children will be attached @@ -1549,6 +1560,52 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd return (error); } +#ifdef RATELIMIT +static int +lagg_snd_tag_alloc(struct ifnet *ifp, + union if_snd_tag_alloc_params *params, + struct m_snd_tag **ppmt) +{ + struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; + struct lagg_port *lp; + struct lagg_lb *lb; + uint32_t p; + + switch (sc->sc_proto) { + case LAGG_PROTO_FAILOVER: + lp = lagg_link_active(sc, sc->sc_primary); + break; + case LAGG_PROTO_LOADBALANCE: + if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || + params->hdr.flowtype == M_HASHTYPE_NONE) + return (EOPNOTSUPP); + p = params->hdr.flowid >> sc->flowid_shift; + p %= sc->sc_count; + lb = (struct lagg_lb *)sc->sc_psc; + lp = lb->lb_ports[p]; + lp = lagg_link_active(sc, lp); + break; + case LAGG_PROTO_LACP: + if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || + params->hdr.flowtype == M_HASHTYPE_NONE) + return (EOPNOTSUPP); + lp = lacp_select_tx_port_by_hash(sc, params->hdr.flowid); + break; + default: + return (EOPNOTSUPP); + } + if (lp == NULL) + return (EOPNOTSUPP); + ifp = lp->lp_ifp; + if (ifp == NULL || ifp->if_snd_tag_alloc == NULL || + (ifp->if_capenable & IFCAP_TXRTLMT) == 0) + return (EOPNOTSUPP); + + /* forward allocation request */ + return (ifp->if_snd_tag_alloc(ifp, params, ppmt)); +} +#endif + static int lagg_ether_setmulti(struct lagg_softc *sc) { Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/net/if_var.h Wed Jan 18 13:31:17 2017 (r312379) @@ -175,6 +175,49 @@ struct if_encap_req { #define IFENCAP_FLAG_BROADCAST 0x02 /* Destination is broadcast */ +/* + * Network interface send tag support. The storage of "struct + * m_snd_tag" comes from the network driver and it is free to allocate + * as much additional space as it wants for its own use. + */ +struct m_snd_tag; + +#define IF_SND_TAG_TYPE_RATE_LIMIT 0 +#define IF_SND_TAG_TYPE_MAX 1 + +struct if_snd_tag_alloc_header { + uint32_t type; /* send tag type, see IF_SND_TAG_XXX */ + uint32_t flowid; /* mbuf hash value */ + uint32_t flowtype; /* mbuf hash type */ +}; + +struct if_snd_tag_alloc_rate_limit { + struct if_snd_tag_alloc_header hdr; + uint64_t max_rate; /* in bytes/s */ +}; + +struct if_snd_tag_rate_limit_params { + uint64_t max_rate; /* in bytes/s */ +}; + +union if_snd_tag_alloc_params { + struct if_snd_tag_alloc_header hdr; + struct if_snd_tag_alloc_rate_limit rate_limit; +}; + +union if_snd_tag_modify_params { + struct if_snd_tag_rate_limit_params rate_limit; +}; + +union if_snd_tag_query_params { + struct if_snd_tag_rate_limit_params rate_limit; +}; + +typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params *, + struct m_snd_tag **); +typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); +typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); +typedef void (if_snd_tag_free_t)(struct m_snd_tag *); /* * Structure defining a network interface. @@ -304,12 +347,19 @@ struct ifnet { u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ /* + * Network adapter send tag support: + */ + if_snd_tag_alloc_t *if_snd_tag_alloc; + if_snd_tag_modify_t *if_snd_tag_modify; + if_snd_tag_query_t *if_snd_tag_query; + if_snd_tag_free_t *if_snd_tag_free; + + /* * Spare fields to be added before branching a stable branch, so * that structure can be enhanced without changing the kernel * binary interface. */ - void *if_pspare[4]; /* packet pacing / general use */ - int if_ispare[4]; /* packet pacing / general use */ + int if_ispare[4]; /* general use */ }; /* for compatibility with other BSDs */ Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/net/if_vlan.c Wed Jan 18 13:31:17 2017 (r312379) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_vlan.h" +#include "opt_ratelimit.h" #include #include @@ -212,6 +213,10 @@ static void trunk_destroy(struct ifvlant static void vlan_init(void *foo); static void vlan_input(struct ifnet *ifp, struct mbuf *m); static int vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr); +#ifdef RATELIMIT +static int vlan_snd_tag_alloc(struct ifnet *, + union if_snd_tag_alloc_params *, struct m_snd_tag **); +#endif static void vlan_qflush(struct ifnet *ifp); static int vlan_setflag(struct ifnet *ifp, int flag, int status, int (*func)(struct ifnet *, int)); @@ -971,6 +976,9 @@ vlan_clone_create(struct if_clone *ifc, ifp->if_transmit = vlan_transmit; ifp->if_qflush = vlan_qflush; ifp->if_ioctl = vlan_ioctl; +#ifdef RATELIMIT + ifp->if_snd_tag_alloc = vlan_snd_tag_alloc; +#endif ifp->if_flags = VLAN_IFFLAGS; ether_ifattach(ifp, eaddr); /* Now undo some of the damage... */ @@ -1591,6 +1599,15 @@ vlan_capabilities(struct ifvlan *ifv) TOEDEV(ifp) = TOEDEV(p); ifp->if_capenable |= p->if_capenable & IFCAP_TOE; } + +#ifdef RATELIMIT + /* + * If the parent interface supports ratelimiting, so does the + * VLAN interface. + */ + ifp->if_capabilities |= (p->if_capabilities & IFCAP_TXRTLMT); + ifp->if_capenable |= (p->if_capenable & IFCAP_TXRTLMT); +#endif } static void @@ -1801,3 +1818,19 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd return (error); } + +#ifdef RATELIMIT +static int +vlan_snd_tag_alloc(struct ifnet *ifp, + union if_snd_tag_alloc_params *params, + struct m_snd_tag **ppmt) +{ + + /* get trunk device */ + ifp = vlan_trunkdev(ifp); + if (ifp == NULL || (ifp->if_capenable & IFCAP_TXRTLMT) == 0) + return (EOPNOTSUPP); + /* forward allocation request */ + return (ifp->if_snd_tag_alloc(ifp, params, ppmt)); +} +#endif Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/netinet/in_pcb.c Wed Jan 18 13:31:17 2017 (r312379) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipsec.h" #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_ratelimit.h" #include "opt_pcbgroup.h" #include "opt_rss.h" @@ -57,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1140,6 +1142,10 @@ in_pcbdetach(struct inpcb *inp) KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__)); +#ifdef RATELIMIT + if (inp->inp_snd_tag != NULL) + in_pcbdetach_txrtlmt(inp); +#endif inp->inp_socket->so_pcb = NULL; inp->inp_socket = NULL; } @@ -2677,3 +2683,253 @@ DB_SHOW_COMMAND(inpcb, db_show_inpcb) db_print_inpcb(inp, "inpcb", 0); } #endif /* DDB */ + +#ifdef RATELIMIT +/* + * Modify TX rate limit based on the existing "inp->inp_snd_tag", + * if any. + */ +int +in_pcbmodify_txrtlmt(struct inpcb *inp, uint32_t max_pacing_rate) +{ + union if_snd_tag_modify_params params = { + .rate_limit.max_rate = max_pacing_rate, + }; + struct m_snd_tag *mst; + struct ifnet *ifp; + int error; + + mst = inp->inp_snd_tag; + if (mst == NULL) + return (EINVAL); + + ifp = mst->ifp; + if (ifp == NULL) + return (EINVAL); + + if (ifp->if_snd_tag_modify == NULL) { + error = EOPNOTSUPP; + } else { + error = ifp->if_snd_tag_modify(mst, ¶ms); + } + return (error); +} + +/* + * Query existing TX rate limit based on the existing + * "inp->inp_snd_tag", if any. + */ +int +in_pcbquery_txrtlmt(struct inpcb *inp, uint32_t *p_max_pacing_rate) +{ + union if_snd_tag_query_params params = { }; + struct m_snd_tag *mst; + struct ifnet *ifp; + int error; + + mst = inp->inp_snd_tag; + if (mst == NULL) + return (EINVAL); + + ifp = mst->ifp; + if (ifp == NULL) + return (EINVAL); + + if (ifp->if_snd_tag_query == NULL) { + error = EOPNOTSUPP; + } else { + error = ifp->if_snd_tag_query(mst, ¶ms); + if (error == 0 && p_max_pacing_rate != NULL) + *p_max_pacing_rate = params.rate_limit.max_rate; + } + return (error); +} + +/* + * Allocate a new TX rate limit send tag from the network interface + * given by the "ifp" argument and save it in "inp->inp_snd_tag": + */ +int +in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet *ifp, + uint32_t flowtype, uint32_t flowid, uint32_t max_pacing_rate) +{ + union if_snd_tag_alloc_params params = { + .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT, + .rate_limit.hdr.flowid = flowid, + .rate_limit.hdr.flowtype = flowtype, + .rate_limit.max_rate = max_pacing_rate, + }; + int error; + + INP_WLOCK_ASSERT(inp); + + if (inp->inp_snd_tag != NULL) + return (EINVAL); + + if (ifp->if_snd_tag_alloc == NULL) { + error = EOPNOTSUPP; + } else { + error = ifp->if_snd_tag_alloc(ifp, ¶ms, &inp->inp_snd_tag); + + /* + * At success increment the refcount on + * the send tag's network interface: + */ + if (error == 0) + if_ref(inp->inp_snd_tag->ifp); + } + return (error); +} + +/* + * Free an existing TX rate limit tag based on the "inp->inp_snd_tag", + * if any: + */ +void +in_pcbdetach_txrtlmt(struct inpcb *inp) +{ + struct m_snd_tag *mst; + struct ifnet *ifp; + + INP_WLOCK_ASSERT(inp); + + mst = inp->inp_snd_tag; + inp->inp_snd_tag = NULL; + + if (mst == NULL) + return; + + ifp = mst->ifp; + if (ifp == NULL) + return; + + /* + * If the device was detached while we still had reference(s) + * on the ifp, we assume if_snd_tag_free() was replaced with + * stubs. + */ + ifp->if_snd_tag_free(mst); + + /* release reference count on network interface */ + if_rele(ifp); +} + +/* + * This function should be called when the INP_RATE_LIMIT_CHANGED flag + * is set in the fast path and will attach/detach/modify the TX rate + * limit send tag based on the socket's so_max_pacing_rate value. + */ +void +in_pcboutput_txrtlmt(struct inpcb *inp, struct ifnet *ifp, struct mbuf *mb) +{ + struct socket *socket; + uint32_t max_pacing_rate; + bool did_upgrade; + int error; + + if (inp == NULL) + return; + + socket = inp->inp_socket; + if (socket == NULL) + return; + + if (!INP_WLOCKED(inp)) { + /* + * NOTE: If the write locking fails, we need to bail + * out and use the non-ratelimited ring for the + * transmit until there is a new chance to get the + * write lock. + */ + if (!INP_TRY_UPGRADE(inp)) + return; + did_upgrade = 1; + } else { + did_upgrade = 0; + } + + /* + * NOTE: The so_max_pacing_rate value is read unlocked, + * because atomic updates are not required since the variable + * is checked at every mbuf we send. It is assumed that the + * variable read itself will be atomic. + */ + max_pacing_rate = socket->so_max_pacing_rate; + + /* + * NOTE: When attaching to a network interface a reference is + * made to ensure the network interface doesn't go away until + * all ratelimit connections are gone. The network interface + * pointers compared below represent valid network interfaces, + * except when comparing towards NULL. + */ + if (max_pacing_rate == 0 && inp->inp_snd_tag == NULL) { + error = 0; + } else if (!(ifp->if_capenable & IFCAP_TXRTLMT)) { + if (inp->inp_snd_tag != NULL) + in_pcbdetach_txrtlmt(inp); + error = 0; + } else if (inp->inp_snd_tag == NULL) { + /* + * In order to utilize packet pacing with RSS, we need + * to wait until there is a valid RSS hash before we + * can proceed: + */ + if (M_HASHTYPE_GET(mb) == M_HASHTYPE_NONE) { + error = EAGAIN; + } else { + error = in_pcbattach_txrtlmt(inp, ifp, M_HASHTYPE_GET(mb), + mb->m_pkthdr.flowid, max_pacing_rate); + } + } else { + error = in_pcbmodify_txrtlmt(inp, max_pacing_rate); + } + if (error == 0 || error == EOPNOTSUPP) + inp->inp_flags2 &= ~INP_RATE_LIMIT_CHANGED; + if (did_upgrade) + INP_DOWNGRADE(inp); +} + +/* + * Track route changes for TX rate limiting. + */ +void +in_pcboutput_eagain(struct inpcb *inp) +{ + struct socket *socket; + bool did_upgrade; + + if (inp == NULL) + return; + + socket = inp->inp_socket; + if (socket == NULL) + return; + + if (inp->inp_snd_tag == NULL) + return; + + if (!INP_WLOCKED(inp)) { + /* + * NOTE: If the write locking fails, we need to bail + * out and use the non-ratelimited ring for the + * transmit until there is a new chance to get the + * write lock. + */ + if (!INP_TRY_UPGRADE(inp)) + return; + did_upgrade = 1; + } else { + did_upgrade = 0; + } + + /* detach rate limiting */ + in_pcbdetach_txrtlmt(inp); + + /* make sure new mbuf send tag allocation is made */ + inp->inp_flags2 |= INP_RATE_LIMIT_CHANGED; + + if (did_upgrade) + INP_DOWNGRADE(inp); +} +#endif /* RATELIMIT */ Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/netinet/in_pcb.h Wed Jan 18 13:31:17 2017 (r312379) @@ -181,6 +181,7 @@ struct icmp6_filter; * read-lock usage during modification, this model can be applied to other * protocols (especially SCTP). */ +struct m_snd_tag; struct inpcb { LIST_ENTRY(inpcb) inp_hash; /* (h/i) hash list */ LIST_ENTRY(inpcb) inp_pcbgrouphash; /* (g/i) hash list */ @@ -202,11 +203,11 @@ struct inpcb { u_char inp_ip_minttl; /* (i) minimum TTL or drop */ uint32_t inp_flowid; /* (x) flow id / queue id */ u_int inp_refcount; /* (i) refcount */ - void *inp_pspare[5]; /* (x) packet pacing / general use */ + struct m_snd_tag *inp_snd_tag; /* (i) send tag for outgoing mbufs */ + void *inp_pspare[4]; /* (x) general use */ uint32_t inp_flowtype; /* (x) M_HASHTYPE value */ uint32_t inp_rss_listen_bucket; /* (x) overridden RSS listen bucket */ - u_int inp_ispare[4]; /* (x) packet pacing / user cookie / - * general use */ + u_int inp_ispare[4]; /* (x) user cookie / general use */ /* Local and foreign ports, local and foreign addr. */ struct in_conninfo inp_inc; /* (i) list for PCB's local port */ @@ -616,6 +617,7 @@ short inp_so_options(const struct inpcb #define INP_RSS_BUCKET_SET 0x00000080 /* IP_RSS_LISTEN_BUCKET is set */ #define INP_RECVFLOWID 0x00000100 /* populate recv datagram with flow info */ #define INP_RECVRSSBUCKETID 0x00000200 /* populate recv datagram with bucket id */ +#define INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */ /* * Flags passed to in_pcblookup*() functions. @@ -736,6 +738,14 @@ int in_getsockaddr(struct socket *so, st struct sockaddr * in_sockaddr(in_port_t port, struct in_addr *addr); void in_pcbsosetlabel(struct socket *so); +#ifdef RATELIMIT +int in_pcbattach_txrtlmt(struct inpcb *, struct ifnet *, uint32_t, uint32_t, uint32_t); +void in_pcbdetach_txrtlmt(struct inpcb *); +int in_pcbmodify_txrtlmt(struct inpcb *, uint32_t); +int in_pcbquery_txrtlmt(struct inpcb *, uint32_t *); +void in_pcboutput_txrtlmt(struct inpcb *, struct ifnet *, struct mbuf *); +void in_pcboutput_eagain(struct inpcb *); +#endif #endif /* _KERNEL */ #endif /* !_NETINET_IN_PCB_H_ */ Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/netinet/ip_output.c Wed Jan 18 13:31:17 2017 (r312379) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_ratelimit.h" #include "opt_ipsec.h" #include "opt_mbuf_stress_test.h" #include "opt_mpath.h" @@ -661,8 +662,23 @@ sendit: */ m_clrprotoflags(m); IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); +#ifdef RATELIMIT + if (inp != NULL) { + if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) + in_pcboutput_txrtlmt(inp, ifp, m); + /* stamp send tag on mbuf */ + m->m_pkthdr.snd_tag = inp->inp_snd_tag; + } else { + m->m_pkthdr.snd_tag = NULL; + } +#endif error = (*ifp->if_output)(ifp, m, (const struct sockaddr *)gw, ro); +#ifdef RATELIMIT + /* check for route change */ + if (error == EAGAIN) + in_pcboutput_eagain(inp); +#endif goto done; } @@ -698,8 +714,23 @@ sendit: IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), ifp, mtod(m, struct ip *), NULL); +#ifdef RATELIMIT + if (inp != NULL) { + if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) + in_pcboutput_txrtlmt(inp, ifp, m); + /* stamp send tag on mbuf */ + m->m_pkthdr.snd_tag = inp->inp_snd_tag; + } else { + m->m_pkthdr.snd_tag = NULL; + } +#endif error = (*ifp->if_output)(ifp, m, (const struct sockaddr *)gw, ro); +#ifdef RATELIMIT + /* check for route change */ + if (error == EAGAIN) + in_pcboutput_eagain(inp); +#endif } else m_freem(m); } @@ -974,6 +1005,16 @@ ip_ctloutput(struct socket *so, struct s INP_WUNLOCK(inp); error = 0; break; + case SO_MAX_PACING_RATE: +#ifdef RATELIMIT + INP_WLOCK(inp); + inp->inp_flags2 |= INP_RATE_LIMIT_CHANGED; + INP_WUNLOCK(inp); + error = 0; +#else + error = EOPNOTSUPP; +#endif + break; default: break; } Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/netinet6/ip6_output.c Wed Jan 18 13:31:17 2017 (r312379) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_ratelimit.h" #include "opt_ipsec.h" #include "opt_sctp.h" #include "opt_route.h" @@ -954,8 +955,23 @@ passout: m->m_pkthdr.len); ifa_free(&ia6->ia_ifa); } +#ifdef RATELIMIT + if (inp != NULL) { + if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) + in_pcboutput_txrtlmt(inp, ifp, m); + /* stamp send tag on mbuf */ + m->m_pkthdr.snd_tag = inp->inp_snd_tag; + } else { + m->m_pkthdr.snd_tag = NULL; + } +#endif error = nd6_output_ifp(ifp, origifp, m, dst, (struct route *)ro); +#ifdef RATELIMIT + /* check for route change */ + if (error == EAGAIN) + in_pcboutput_eagain(inp); +#endif goto done; } @@ -1054,8 +1070,23 @@ sendorfree: counter_u64_add(ia->ia_ifa.ifa_obytes, m->m_pkthdr.len); } +#ifdef RATELIMIT + if (inp != NULL) { + if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) + in_pcboutput_txrtlmt(inp, ifp, m); + /* stamp send tag on mbuf */ + m->m_pkthdr.snd_tag = inp->inp_snd_tag; + } else { + m->m_pkthdr.snd_tag = NULL; + } +#endif error = nd6_output_ifp(ifp, origifp, m, dst, (struct route *)ro); +#ifdef RATELIMIT + /* check for route change */ + if (error == EAGAIN) + in_pcboutput_eagain(inp); +#endif } else m_freem(m); } @@ -1441,6 +1472,16 @@ ip6_ctloutput(struct socket *so, struct INP_WUNLOCK(in6p); error = 0; break; + case SO_MAX_PACING_RATE: +#ifdef RATELIMIT + INP_WLOCK(in6p); + in6p->inp_flags2 |= INP_RATE_LIMIT_CHANGED; + INP_WUNLOCK(in6p); + error = 0; +#else + error = EOPNOTSUPP; +#endif + break; default: break; } Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Wed Jan 18 13:27:24 2017 (r312378) +++ head/sys/sys/mbuf.h Wed Jan 18 13:31:17 2017 (r312379) @@ -130,6 +130,14 @@ struct m_tag { }; /* + * Static network interface owned tag. + * Allocated through ifp->if_snd_tag_alloc(). + */ +struct m_snd_tag { + struct ifnet *ifp; /* network interface tag belongs to */ +}; + +/* * Record/packet header in first mbuf of chain; valid only if M_PKTHDR is set. * Size ILP32: 48 * LP64: 56 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jan 18 13:57:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA2CACB65D0; Wed, 18 Jan 2017 13:57:30 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9BD31D02; Wed, 18 Jan 2017 13:57:30 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0IDvTM5057953; Wed, 18 Jan 2017 13:57:29 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IDvTTh057952; Wed, 18 Jan 2017 13:57:29 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701181357.v0IDvTTh057952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 18 Jan 2017 13:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312380 - head/sys/dev/e1000 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, 18 Jan 2017 13:57:31 -0000 Author: sbruno Date: Wed Jan 18 13:57:29 2017 New Revision: 312380 URL: https://svnweb.freebsd.org/changeset/base/312380 Log: Change device type to unbreak drm-next testing and builds. Submitted by: Matt Macy Modified: head/sys/dev/e1000/if_em.h Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Wed Jan 18 13:31:17 2017 (r312379) +++ head/sys/dev/e1000/if_em.h Wed Jan 18 13:57:29 2017 (r312380) @@ -436,7 +436,7 @@ struct adapter { #define intr_type shared->isc_intr /* FreeBSD operating-system-specific structures. */ struct e1000_osdep osdep; - struct device *dev; + device_t *dev; struct cdev *led_dev; struct em_tx_queue *tx_queues; From owner-svn-src-all@freebsd.org Wed Jan 18 14:13:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34D6ACB6BBF; Wed, 18 Jan 2017 14:13:30 +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 0F8E81DF1; Wed, 18 Jan 2017 14:13:29 +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 v0IEDTvt067009; Wed, 18 Jan 2017 14:13:29 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IEDSnZ067006; Wed, 18 Jan 2017 14:13:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201701181413.v0IEDSnZ067006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 18 Jan 2017 14:13:28 +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: r312381 - in stable/11: include lib/libkvm 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, 18 Jan 2017 14:13:30 -0000 Author: avg Date: Wed Jan 18 14:13:28 2017 New Revision: 312381 URL: https://svnweb.freebsd.org/changeset/base/312381 Log: MFC r310630: libkvm: support access to vmm guest memory, allow writes to fwmem and vmm Sponsored by: Panzura Modified: stable/11/include/paths.h stable/11/lib/libkvm/kvm.c stable/11/lib/libkvm/kvm_private.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/paths.h ============================================================================== --- stable/11/include/paths.h Wed Jan 18 13:57:29 2017 (r312380) +++ stable/11/include/paths.h Wed Jan 18 14:13:28 2017 (r312381) @@ -99,6 +99,7 @@ #define _PATH_VARDB "/var/db/" #define _PATH_VARRUN "/var/run/" #define _PATH_VARTMP "/var/tmp/" +#define _PATH_DEVVMM "/dev/vmm/" #define _PATH_YP "/var/yp/" #define _PATH_UUCPLOCK "/var/spool/lock/" Modified: stable/11/lib/libkvm/kvm.c ============================================================================== --- stable/11/lib/libkvm/kvm.c Wed Jan 18 13:57:29 2017 (r312380) +++ stable/11/lib/libkvm/kvm.c Wed Jan 18 14:13:28 2017 (r312381) @@ -429,8 +429,10 @@ _kvm_open(kvm_t *kd, const char *uf, con return (kd); } } + /* - * This is a crash dump. + * This is either a crash dump or a remote live system with its physical + * memory fully accessible via a special device. * Open the namelist fd and determine the architecture. */ if ((kd->nlfd = open(uf, O_RDONLY | O_CLOEXEC, 0)) < 0) { @@ -439,8 +441,11 @@ _kvm_open(kvm_t *kd, const char *uf, con } if (_kvm_read_kernel_ehdr(kd) < 0) goto failed; - if (strncmp(mf, _PATH_FWMEM, strlen(_PATH_FWMEM)) == 0) + if (strncmp(mf, _PATH_FWMEM, strlen(_PATH_FWMEM)) == 0 || + strncmp(mf, _PATH_DEVVMM, strlen(_PATH_DEVVMM)) == 0) { kd->rawdump = 1; + kd->writable = 1; + } SET_FOREACH(parch, kvm_arch) { if ((*parch)->ka_probe(kd)) { kd->arch = *parch; @@ -866,6 +871,15 @@ ssize_t kvm_write(kvm_t *kd, u_long kva, const void *buf, size_t len) { int cc; + ssize_t cw; + off_t pa; + const char *cp; + + if (!ISALIVE(kd) && !kd->writable) { + _kvm_err(kd, kd->program, + "kvm_write not implemented for dead kernels"); + return (-1); + } if (ISALIVE(kd)) { /* @@ -883,12 +897,38 @@ kvm_write(kvm_t *kd, u_long kva, const v } else if ((size_t)cc < len) _kvm_err(kd, kd->program, "short write"); return (cc); - } else { - _kvm_err(kd, kd->program, - "kvm_write not implemented for dead kernels"); - return (-1); } - /* NOTREACHED */ + + cp = buf; + while (len > 0) { + cc = kd->arch->ka_kvatop(kd, kva, &pa); + if (cc == 0) + return (-1); + if (cc > (ssize_t)len) + cc = len; + errno = 0; + if (lseek(kd->pmfd, pa, 0) == -1 && errno != 0) { + _kvm_syserr(kd, 0, _PATH_MEM); + break; + } + cw = write(kd->pmfd, cp, cc); + if (cw < 0) { + _kvm_syserr(kd, kd->program, "kvm_write"); + break; + } + /* + * If ka_kvatop returns a bogus value or our core file is + * truncated, we might wind up seeking beyond the end of the + * core file in which case the read will return 0 (EOF). + */ + if (cw == 0) + break; + cp += cw; + kva += cw; + len -= cw; + } + + return (cp - (char *)buf); } int Modified: stable/11/lib/libkvm/kvm_private.h ============================================================================== --- stable/11/lib/libkvm/kvm_private.h Wed Jan 18 13:57:29 2017 (r312380) +++ stable/11/lib/libkvm/kvm_private.h Wed Jan 18 14:13:28 2017 (r312381) @@ -78,6 +78,7 @@ struct __kvm { */ struct vmstate *vmst; int rawdump; /* raw dump format */ + int writable; /* physical memory is writable */ int vnet_initialized; /* vnet fields set up */ kvaddr_t vnet_start; /* start of kernel's vnet region */ From owner-svn-src-all@freebsd.org Wed Jan 18 14:14:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56428CB6C3C; Wed, 18 Jan 2017 14:14:02 +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 30F2C1017; Wed, 18 Jan 2017 14:14:02 +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 v0IEE101067088; Wed, 18 Jan 2017 14:14:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IEE1WF067085; Wed, 18 Jan 2017 14:14:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201701181414.v0IEE1WF067085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 18 Jan 2017 14:14:01 +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: r312382 - in stable/10: include lib/libkvm 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, 18 Jan 2017 14:14:02 -0000 Author: avg Date: Wed Jan 18 14:14:00 2017 New Revision: 312382 URL: https://svnweb.freebsd.org/changeset/base/312382 Log: MFC r310630: libkvm: support access to vmm guest memory, allow writes to fwmem and vmm Sponsored by: Panzura Modified: stable/10/include/paths.h stable/10/lib/libkvm/kvm.c stable/10/lib/libkvm/kvm_private.h Directory Properties: stable/10/ (props changed) Modified: stable/10/include/paths.h ============================================================================== --- stable/10/include/paths.h Wed Jan 18 14:13:28 2017 (r312381) +++ stable/10/include/paths.h Wed Jan 18 14:14:00 2017 (r312382) @@ -98,6 +98,7 @@ #define _PATH_VARDB "/var/db/" #define _PATH_VARRUN "/var/run/" #define _PATH_VARTMP "/var/tmp/" +#define _PATH_DEVVMM "/dev/vmm/" #define _PATH_YP "/var/yp/" #define _PATH_UUCPLOCK "/var/spool/lock/" Modified: stable/10/lib/libkvm/kvm.c ============================================================================== --- stable/10/lib/libkvm/kvm.c Wed Jan 18 14:13:28 2017 (r312381) +++ stable/10/lib/libkvm/kvm.c Wed Jan 18 14:14:00 2017 (r312382) @@ -198,8 +198,10 @@ _kvm_open(kvm_t *kd, const char *uf, con return (kd); } } + /* - * This is a crash dump. + * This is either a crash dump or a remote live system with its physical + * memory fully accessible via a special device. * Initialize the virtual address translation machinery, * but first setup the namelist fd. */ @@ -207,8 +209,11 @@ _kvm_open(kvm_t *kd, const char *uf, con _kvm_syserr(kd, kd->program, "%s", uf); goto failed; } - if (strncmp(mf, _PATH_FWMEM, strlen(_PATH_FWMEM)) == 0) + if (strncmp(mf, _PATH_FWMEM, strlen(_PATH_FWMEM)) == 0 || + strncmp(mf, _PATH_DEVVMM, strlen(_PATH_DEVVMM)) == 0) { kd->rawdump = 1; + kd->writable = 1; + } if (_kvm_initvtop(kd) < 0) goto failed; return (kd); @@ -557,6 +562,15 @@ ssize_t kvm_write(kvm_t *kd, u_long kva, const void *buf, size_t len) { int cc; + ssize_t cw; + off_t pa; + const char *cp; + + if (!ISALIVE(kd) && !kd->writable) { + _kvm_err(kd, kd->program, + "kvm_write not implemented for dead kernels"); + return (-1); + } if (ISALIVE(kd)) { /* @@ -574,10 +588,36 @@ kvm_write(kvm_t *kd, u_long kva, const v } else if ((size_t)cc < len) _kvm_err(kd, kd->program, "short write"); return (cc); - } else { - _kvm_err(kd, kd->program, - "kvm_write not implemented for dead kernels"); - return (-1); } - /* NOTREACHED */ + + cp = buf; + while (len > 0) { + cc = _kvm_kvatop(kd, kva, &pa); + if (cc == 0) + return (-1); + if (cc > (ssize_t)len) + cc = len; + errno = 0; + if (lseek(kd->pmfd, pa, 0) == -1 && errno != 0) { + _kvm_syserr(kd, 0, _PATH_MEM); + break; + } + cw = write(kd->pmfd, cp, cc); + if (cw < 0) { + _kvm_syserr(kd, kd->program, "kvm_write"); + break; + } + /* + * If ka_kvatop returns a bogus value or our core file is + * truncated, we might wind up seeking beyond the end of the + * core file in which case the read will return 0 (EOF). + */ + if (cw == 0) + break; + cp += cw; + kva += cw; + len -= cw; + } + + return (cp - (char *)buf); } Modified: stable/10/lib/libkvm/kvm_private.h ============================================================================== --- stable/10/lib/libkvm/kvm_private.h Wed Jan 18 14:13:28 2017 (r312381) +++ stable/10/lib/libkvm/kvm_private.h Wed Jan 18 14:14:00 2017 (r312382) @@ -62,6 +62,7 @@ struct __kvm { */ struct vmstate *vmst; int rawdump; /* raw dump format */ + int writable; /* physical memory is writable */ int vnet_initialized; /* vnet fields set up */ uintptr_t vnet_start; /* start of kernel's vnet region */ From owner-svn-src-all@freebsd.org Wed Jan 18 14:15:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71B32CB6CDA; Wed, 18 Jan 2017 14:15:17 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::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 1A5221197; Wed, 18 Jan 2017 14:15:17 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x241.google.com with SMTP id c85so4417729wmi.1; Wed, 18 Jan 2017 06:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wn3ZtrJBFksGXz+lHnx1HFHiYHRDAtXVil+RuCrkEQU=; b=GX9oKHH/BlLL1yK4eieAsFSLkoKd6L3w6cKecZo1RnGVMiiFWFncyb7iVm7+KhPrH0 jk1SsMgwlUDzdYTcXwEYAHc1Nz6gH0wlWUBOKIbkr3etrAjWiMidE8pbENwupVXevJLn hZmSpFylvFcI/y5WX4BbnGL2Vkcu9PdgIMOySoyDm1xd9qv6XD4dn4CT4QHD5WkK7nwA WQYwQ2U4sEMmSj+yna2pVACEgLvF5OYSPzfxPWmCWmN51Q1phMIZNTXehVWcxm0HEBpG iljPTkdwHc1ZrxHGDtr5BB4+ammCjCG4lAiG/uobau85U4rJXYue4/AFCeBLVHqiIjuY uOxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wn3ZtrJBFksGXz+lHnx1HFHiYHRDAtXVil+RuCrkEQU=; b=XUP+Mq1EJ+ruu1ONPr94t3/4AHmvOYPWsSqu40/AcB3xqR/+FgHyjSmjCO5efaIkV7 o+RKdxY47pH0HT2pZp7w0pXDmMNUBTRIbESi/ykr7Byj9iz2UxkQPEDsecaeb7hePjF3 1+WfWPj0hzsxvQeTtQfC4XM0FAuhjXrXew2Nn4u/jeJIoWvD05DU0yDlGUEoh0n9WaCp 3+iNiN0BcCtvh9jFZsWUtVhjqGxuOGI65Ov2vkYUkc3EBUPYvOr9Wf3yz7MzAWIt0Tbb 2KLuV3/CSUoNyCqyeRZwCI8byMHu0tSY4RkmoYytQ75FqolZ9dpBI9Q+uo07SGVVZ1nA vhNQ== X-Gm-Message-State: AIkVDXLfObGHstvhXn++7uJSU0GZuvT6IXjo9+h+MLzSE9cuzZOwI8S3g0cYfYm2VBpmug== X-Received: by 10.28.140.140 with SMTP id o134mr21374868wmd.87.1484748915325; Wed, 18 Jan 2017 06:15:15 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id m78sm5211346wmd.8.2017.01.18.06.15.13 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 18 Jan 2017 06:15:14 -0800 (PST) Date: Wed, 18 Jan 2017 15:15:11 +0100 From: Mateusz Guzik To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312380 - head/sys/dev/e1000 Message-ID: <20170118141511.GB4813@dft-labs.eu> References: <201701181357.v0IDvTTh057952@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201701181357.v0IDvTTh057952@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: Wed, 18 Jan 2017 14:15:17 -0000 On Wed, Jan 18, 2017 at 01:57:29PM +0000, Sean Bruno wrote: > Author: sbruno > Date: Wed Jan 18 13:57:29 2017 > New Revision: 312380 > URL: https://svnweb.freebsd.org/changeset/base/312380 > > Log: > Change device type to unbreak drm-next testing and builds. > > Submitted by: Matt Macy > > Modified: > head/sys/dev/e1000/if_em.h > > Modified: head/sys/dev/e1000/if_em.h > ============================================================================== > --- head/sys/dev/e1000/if_em.h Wed Jan 18 13:31:17 2017 (r312379) > +++ head/sys/dev/e1000/if_em.h Wed Jan 18 13:57:29 2017 (r312380) > @@ -436,7 +436,7 @@ struct adapter { > #define intr_type shared->isc_intr > /* FreeBSD operating-system-specific structures. */ > struct e1000_osdep osdep; > - struct device *dev; > + device_t *dev; this should be 'device_t dev'; > struct cdev *led_dev; > > struct em_tx_queue *tx_queues; > _______________________________________________ > 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" -- Mateusz Guzik From owner-svn-src-all@freebsd.org Wed Jan 18 14:23:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF9A0CB52E0; Wed, 18 Jan 2017 14:23:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF3AA1D2F; Wed, 18 Jan 2017 14:23:44 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0IENh6S071230; Wed, 18 Jan 2017 14:23:43 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IENhFM071229; Wed, 18 Jan 2017 14:23:43 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701181423.v0IENhFM071229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 18 Jan 2017 14:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312383 - head/sys/dev/e1000 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, 18 Jan 2017 14:23:45 -0000 Author: sbruno Date: Wed Jan 18 14:23:43 2017 New Revision: 312383 URL: https://svnweb.freebsd.org/changeset/base/312383 Log: ugh, device_t not device_t * Reported by: hps Modified: head/sys/dev/e1000/if_em.h Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Wed Jan 18 14:14:00 2017 (r312382) +++ head/sys/dev/e1000/if_em.h Wed Jan 18 14:23:43 2017 (r312383) @@ -436,7 +436,7 @@ struct adapter { #define intr_type shared->isc_intr /* FreeBSD operating-system-specific structures. */ struct e1000_osdep osdep; - device_t *dev; + device_t dev; struct cdev *led_dev; struct em_tx_queue *tx_queues; From owner-svn-src-all@freebsd.org Wed Jan 18 14:42:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 744B7CB5A85; Wed, 18 Jan 2017 14:42:01 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12C1D187A; Wed, 18 Jan 2017 14:42:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0IEg0rk078591; Wed, 18 Jan 2017 14:42:00 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IEfx12078583; Wed, 18 Jan 2017 14:41:59 GMT (envelope-from br@FreeBSD.org) Message-Id: <201701181441.v0IEfx12078583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 18 Jan 2017 14:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312384 - head/sys/boot/fdt/dts/mips 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, 18 Jan 2017 14:42:01 -0000 Author: br Date: Wed Jan 18 14:41:59 2017 New Revision: 312384 URL: https://svnweb.freebsd.org/changeset/base/312384 Log: Remove empty ranges property so beri_simplebus can be attached again. Sponsored by: DARPA, AFRL Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts head/sys/boot/fdt/dts/mips/beri-sim.dts head/sys/boot/fdt/dts/mips/beripad-de4.dts head/sys/boot/fdt/dts/mips/beripad-sockit.dts Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-netfpga.dts Wed Jan 18 14:23:43 2017 (r312383) +++ head/sys/boot/fdt/dts/mips/beri-netfpga.dts Wed Jan 18 14:41:59 2017 (r312384) @@ -97,7 +97,6 @@ * we use mips4k coprocessor 0 interrupt management directly. */ compatible = "simple-bus", "mips,mips4k"; - ranges = <>; beripic: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; Modified: head/sys/boot/fdt/dts/mips/beri-sim.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-sim.dts Wed Jan 18 14:23:43 2017 (r312383) +++ head/sys/boot/fdt/dts/mips/beri-sim.dts Wed Jan 18 14:41:59 2017 (r312384) @@ -95,7 +95,6 @@ * we use mips4k coprocessor 0 interrupt management directly. */ compatible = "simple-bus", "mips,mips4k"; - ranges = <>; beripic0: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; Modified: head/sys/boot/fdt/dts/mips/beripad-de4.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beripad-de4.dts Wed Jan 18 14:23:43 2017 (r312383) +++ head/sys/boot/fdt/dts/mips/beripad-de4.dts Wed Jan 18 14:41:59 2017 (r312384) @@ -95,7 +95,6 @@ * we use mips4k coprocessor 0 interrupt management directly. */ compatible = "simple-bus", "mips,mips4k"; - ranges = <>; beripic0: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; Modified: head/sys/boot/fdt/dts/mips/beripad-sockit.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beripad-sockit.dts Wed Jan 18 14:23:43 2017 (r312383) +++ head/sys/boot/fdt/dts/mips/beripad-sockit.dts Wed Jan 18 14:41:59 2017 (r312384) @@ -93,7 +93,6 @@ * we use mips4k coprocessor 0 interrupt management directly. */ compatible = "simple-bus", "mips,mips4k"; - /* ranges = <>; */ beripic0: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; From owner-svn-src-all@freebsd.org Wed Jan 18 15:22:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C611CB6603; Wed, 18 Jan 2017 15:22:55 +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 51AC41831; Wed, 18 Jan 2017 15:22:55 +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 v0IFMsr4096631; Wed, 18 Jan 2017 15:22:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IFMsaX096629; Wed, 18 Jan 2017 15:22:54 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701181522.v0IFMsaX096629@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 18 Jan 2017 15:22:54 +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: r312385 - stable/11/usr.bin/rpcgen 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, 18 Jan 2017 15:22:55 -0000 Author: pfg Date: Wed Jan 18 15:22:54 2017 New Revision: 312385 URL: https://svnweb.freebsd.org/changeset/base/312385 Log: MFC r311947, r311981: rpcgen(1): Avoid unused variable warning on generated code. Avoid "unused variable 'i'" warnings in generated .c files by only emitting the "int i;" for non-opaque arrays. Opaque arrays use xdr_opaque() rather than iterating over the array. Obtained from: OpenBSD (CVS rev 1.28) rpcgen(1): Check getrlimit() return for generated code. Obtained from: NetBSD (CVS rev 1.27, 1.28) Modified: stable/11/usr.bin/rpcgen/rpc_cout.c stable/11/usr.bin/rpcgen/rpc_svcout.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/rpcgen/rpc_cout.c ============================================================================== --- stable/11/usr.bin/rpcgen/rpc_cout.c Wed Jan 18 14:41:59 2017 (r312384) +++ stable/11/usr.bin/rpcgen/rpc_cout.c Wed Jan 18 15:22:54 2017 (r312385) @@ -551,7 +551,8 @@ emit_struct(definition *def) } for (dl = def->def.st.decls; dl != NULL; dl = dl->next) - if (dl->decl.rel == REL_VECTOR){ + if (dl->decl.rel == REL_VECTOR && + strcmp(dl->decl.type, "opaque") != 0){ f_print(fout, "\tint i;\n"); break; } Modified: stable/11/usr.bin/rpcgen/rpc_svcout.c ============================================================================== --- stable/11/usr.bin/rpcgen/rpc_svcout.c Wed Jan 18 14:41:59 2017 (r312384) +++ stable/11/usr.bin/rpcgen/rpc_svcout.c Wed Jan 18 15:22:54 2017 (r312385) @@ -728,7 +728,8 @@ write_timeout_func(void) if (tirpcflag) { f_print(fout, "\t\t\tstruct rlimit rl;\n\n"); f_print(fout, "\t\t\trl.rlim_max = 0;\n"); - f_print(fout, "\t\t\tgetrlimit(RLIMIT_NOFILE, &rl);\n"); + f_print(fout, "\t\t\tif (getrlimit(RLIMIT_NOFILE, &rl) == -1)\n"); + f_print(fout, "\t\t\t\treturn;\n"); f_print(fout, "\t\t\tif ((size = rl.rlim_max) == 0) {\n"); if (mtflag) @@ -902,7 +903,11 @@ write_rpc_svc_fg(const char *infile, con /* get number of file descriptors */ if (tirpcflag) { f_print(fout, "%srl.rlim_max = 0;\n", sp); - f_print(fout, "%sgetrlimit(RLIMIT_NOFILE, &rl);\n", sp); + f_print(fout, "%sif (getrlimit(RLIMIT_NOFILE, &rl) == -1) {\n", + sp); + f_print(fout, "%s\tperror(\"getrlimit\");\n", sp); + f_print(fout, "%s\texit(1);\n", sp); + f_print(fout, "%s}\n", sp); f_print(fout, "%sif ((size = rl.rlim_max) == 0)\n", sp); f_print(fout, "%s\texit(1);\n", sp); } else { From owner-svn-src-all@freebsd.org Wed Jan 18 15:23:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B463CB6672; Wed, 18 Jan 2017 15:23:41 +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 406BC19B3; Wed, 18 Jan 2017 15:23:41 +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 v0IFNeqo096721; Wed, 18 Jan 2017 15:23:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IFNeln096719; Wed, 18 Jan 2017 15:23:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701181523.v0IFNeln096719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 18 Jan 2017 15:23: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: r312386 - 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: Wed, 18 Jan 2017 15:23:41 -0000 Author: pfg Date: Wed Jan 18 15:23:40 2017 New Revision: 312386 URL: https://svnweb.freebsd.org/changeset/base/312386 Log: MFC r311947, r311981: rpcgen(1): Avoid unused variable warning on generated code. Avoid "unused variable 'i'" warnings in generated .c files by only emitting the "int i;" for non-opaque arrays. Opaque arrays use xdr_opaque() rather than iterating over the array. Obtained from: OpenBSD (CVS rev 1.28) rpcgen(1): Check getrlimit() return for generated code. Obtained from: NetBSD (CVS rev 1.27, 1.28) Modified: stable/10/usr.bin/rpcgen/rpc_cout.c stable/10/usr.bin/rpcgen/rpc_svcout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/rpcgen/rpc_cout.c ============================================================================== --- stable/10/usr.bin/rpcgen/rpc_cout.c Wed Jan 18 15:22:54 2017 (r312385) +++ stable/10/usr.bin/rpcgen/rpc_cout.c Wed Jan 18 15:23:40 2017 (r312386) @@ -551,7 +551,8 @@ emit_struct(definition *def) } for (dl = def->def.st.decls; dl != NULL; dl = dl->next) - if (dl->decl.rel == REL_VECTOR){ + if (dl->decl.rel == REL_VECTOR && + strcmp(dl->decl.type, "opaque") != 0){ f_print(fout, "\tint i;\n"); break; } Modified: stable/10/usr.bin/rpcgen/rpc_svcout.c ============================================================================== --- stable/10/usr.bin/rpcgen/rpc_svcout.c Wed Jan 18 15:22:54 2017 (r312385) +++ stable/10/usr.bin/rpcgen/rpc_svcout.c Wed Jan 18 15:23:40 2017 (r312386) @@ -728,7 +728,8 @@ write_timeout_func(void) if (tirpcflag) { f_print(fout, "\t\t\tstruct rlimit rl;\n\n"); f_print(fout, "\t\t\trl.rlim_max = 0;\n"); - f_print(fout, "\t\t\tgetrlimit(RLIMIT_NOFILE, &rl);\n"); + f_print(fout, "\t\t\tif (getrlimit(RLIMIT_NOFILE, &rl) == -1)\n"); + f_print(fout, "\t\t\t\treturn;\n"); f_print(fout, "\t\t\tif ((size = rl.rlim_max) == 0) {\n"); if (mtflag) @@ -902,7 +903,11 @@ write_rpc_svc_fg(const char *infile, con /* get number of file descriptors */ if (tirpcflag) { f_print(fout, "%srl.rlim_max = 0;\n", sp); - f_print(fout, "%sgetrlimit(RLIMIT_NOFILE, &rl);\n", sp); + f_print(fout, "%sif (getrlimit(RLIMIT_NOFILE, &rl) == -1) {\n", + sp); + f_print(fout, "%s\tperror(\"getrlimit\");\n", sp); + f_print(fout, "%s\texit(1);\n", sp); + f_print(fout, "%s}\n", sp); f_print(fout, "%sif ((size = rl.rlim_max) == 0)\n", sp); f_print(fout, "%s\texit(1);\n", sp); } else { From owner-svn-src-all@freebsd.org Wed Jan 18 17:09:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8950CB69FC; Wed, 18 Jan 2017 17:09:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8839010BD; Wed, 18 Jan 2017 17:09:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0IH9Mog038973; Wed, 18 Jan 2017 17:09:22 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IH9M5M038972; Wed, 18 Jan 2017 17:09:22 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201701181709.v0IH9M5M038972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 18 Jan 2017 17:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312387 - 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: Wed, 18 Jan 2017 17:09:23 -0000 Author: glebius Date: Wed Jan 18 17:09:22 2017 New Revision: 312387 URL: https://svnweb.freebsd.org/changeset/base/312387 Log: Fix regression from r311568: collision of MSG_NOSIGNAL with MSG_MORETOCOME lead to delayed send of data sent with sendto(MSG_NOSIGNAL). Submitted by: rrs Modified: head/sys/sys/socket.h Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Wed Jan 18 15:23:40 2017 (r312386) +++ head/sys/sys/socket.h Wed Jan 18 17:09:22 2017 (r312387) @@ -446,7 +446,7 @@ struct msghdr { #endif #ifdef _KERNEL #define MSG_SOCALLBCK 0x10000 /* for use by socket callbacks - soreceive (TCP) */ -#define MSG_MORETOCOME 0x20000 /* additional data pending */ +#define MSG_MORETOCOME 0x100000 /* additional data pending */ #endif /* From owner-svn-src-all@freebsd.org Wed Jan 18 17:21:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC20CB6E59; Wed, 18 Jan 2017 17:21:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E5EA1A46; Wed, 18 Jan 2017 17:21:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0IHLSKs044176; Wed, 18 Jan 2017 17:21:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IHLSYW044175; Wed, 18 Jan 2017 17:21:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201701181721.v0IHLSYW044175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 18 Jan 2017 17:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312388 - 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: Wed, 18 Jan 2017 17:21:29 -0000 Author: glebius Date: Wed Jan 18 17:21:28 2017 New Revision: 312388 URL: https://svnweb.freebsd.org/changeset/base/312388 Log: Format and sort MSG_* flags, to prevent misedits in future. There is no functional change. Modified: head/sys/sys/socket.h Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Wed Jan 18 17:09:22 2017 (r312387) +++ head/sys/sys/socket.h Wed Jan 18 17:21:28 2017 (r312388) @@ -425,28 +425,36 @@ struct msghdr { int msg_flags; /* flags on received message */ }; -#define MSG_OOB 0x1 /* process out-of-band data */ -#define MSG_PEEK 0x2 /* peek at incoming message */ -#define MSG_DONTROUTE 0x4 /* send without using routing tables */ -#define MSG_EOR 0x8 /* data completes record */ -#define MSG_TRUNC 0x10 /* data discarded before delivery */ -#define MSG_CTRUNC 0x20 /* control data lost before delivery */ -#define MSG_WAITALL 0x40 /* wait for full request or error */ +#define MSG_OOB 0x00000001 /* process out-of-band data */ +#define MSG_PEEK 0x00000002 /* peek at incoming message */ +#define MSG_DONTROUTE 0x00000004 /* send without using routing tables */ +#define MSG_EOR 0x00000008 /* data completes record */ +#define MSG_TRUNC 0x00000010 /* data discarded before delivery */ +#define MSG_CTRUNC 0x00000020 /* control data lost before delivery */ +#define MSG_WAITALL 0x00000040 /* wait for full request or error */ +#if __BSD_VISIBLE +#define MSG_DONTWAIT 0x00000080 /* this message should be nonblocking */ +#define MSG_EOF 0x00000100 /* data completes connection */ +/* 0x00000200 unused */ +/* 0x00000400 unused */ +/* 0x00000800 unused */ +/* 0x00001000 unused */ +#define MSG_NOTIFICATION 0x00002000 /* SCTP notification */ +#define MSG_NBIO 0x00004000 /* FIONBIO mode, used by fifofs */ +#define MSG_COMPAT 0x00008000 /* used in sendit() */ +#endif +#ifdef _KERNEL +#define MSG_SOCALLBCK 0x00010000 /* for use by socket callbacks - soreceive (TCP) */ +#endif #if __POSIX_VISIBLE >= 200809 -#define MSG_NOSIGNAL 0x20000 /* do not generate SIGPIPE on EOF */ +#define MSG_NOSIGNAL 0x00020000 /* do not generate SIGPIPE on EOF */ #endif #if __BSD_VISIBLE -#define MSG_DONTWAIT 0x80 /* this message should be nonblocking */ -#define MSG_EOF 0x100 /* data completes connection */ -#define MSG_NOTIFICATION 0x2000 /* SCTP notification */ -#define MSG_NBIO 0x4000 /* FIONBIO mode, used by fifofs */ -#define MSG_COMPAT 0x8000 /* used in sendit() */ -#define MSG_CMSG_CLOEXEC 0x40000 /* make received fds close-on-exec */ -#define MSG_WAITFORONE 0x80000 /* for recvmmsg() */ +#define MSG_CMSG_CLOEXEC 0x00040000 /* make received fds close-on-exec */ +#define MSG_WAITFORONE 0x00080000 /* for recvmmsg() */ #endif #ifdef _KERNEL -#define MSG_SOCALLBCK 0x10000 /* for use by socket callbacks - soreceive (TCP) */ -#define MSG_MORETOCOME 0x100000 /* additional data pending */ +#define MSG_MORETOCOME 0x00100000 /* additional data pending */ #endif /* From owner-svn-src-all@freebsd.org Wed Jan 18 17:31:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68E50CB6442; Wed, 18 Jan 2017 17:31:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 52C3212EF; Wed, 18 Jan 2017 17:31:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v0IHVW6Y058752 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 18 Jan 2017 09:31:32 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v0IHVWmZ058751; Wed, 18 Jan 2017 09:31:32 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 18 Jan 2017 09:31:32 -0800 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312379 - in head: lib/libc/sys sbin/ifconfig sys/conf sys/kern sys/modules/if_lagg sys/modules/if_vlan sys/net sys/netinet sys/netinet6 sys/sys Message-ID: <20170118173132.GD2611@FreeBSD.org> References: <201701181331.v0IDVHWf048428@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701181331.v0IDVHWf048428@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 18 Jan 2017 17:31:40 -0000 Hi! I'm quite disappointed by this checkin. This is an interesting experimental feature, but to my knowledge, there were no production testing of the feature, that will prove that the idea actually works. To my knowledge the code isn't used anywhere right now, it was just tested to work as a concept. At the same time it introduces yet another socket to interface layering violation, bloats the ifnet structure and other intrusive things. Please correct me if I am wrong. On Wed, Jan 18, 2017 at 01:31:17PM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Wed Jan 18 13:31:17 2017 H> New Revision: 312379 H> URL: https://svnweb.freebsd.org/changeset/base/312379 H> H> Log: H> Implement kernel support for hardware rate limited sockets. H> H> - Add RATELIMIT kernel configuration keyword which must be set to H> enable the new functionality. H> H> - Add support for hardware driven, Receive Side Scaling, RSS aware, rate H> limited sendqueues and expose the functionality through the already H> established SO_MAX_PACING_RATE setsockopt(). The API support rates in H> the range from 1 to 4Gbytes/s which are suitable for regular TCP and H> UDP streams. The setsockopt(2) manual page has been updated. H> H> - Add rate limit function callback API to "struct ifnet" which supports H> the following operations: if_snd_tag_alloc(), if_snd_tag_modify(), H> if_snd_tag_query() and if_snd_tag_free(). H> H> - Add support to ifconfig to view, set and clear the IFCAP_TXRTLMT H> flag, which tells if a network driver supports rate limiting or not. H> H> - This patch also adds support for rate limiting through VLAN and LAGG H> intermediate network devices. H> H> - How rate limiting works: H> H> 1) The userspace application calls setsockopt() after accepting or H> making a new connection to set the rate which is then stored in the H> socket structure in the kernel. Later on when packets are transmitted H> a check is made in the transmit path for rate changes. A rate change H> implies a non-blocking ifp->if_snd_tag_alloc() call will be made to the H> destination network interface, which then sets up a custom sendqueue H> with the given rate limitation parameter. A "struct m_snd_tag" pointer is H> returned which serves as a "snd_tag" hint in the m_pkthdr for the H> subsequently transmitted mbufs. H> H> 2) When the network driver sees the "m->m_pkthdr.snd_tag" different H> from NULL, it will move the packets into a designated rate limited sendqueue H> given by the snd_tag pointer. It is up to the individual drivers how the rate H> limited traffic will be rate limited. H> H> 3) Route changes are detected by the NIC drivers in the ifp->if_transmit() H> routine when the ifnet pointer in the incoming snd_tag mismatches the H> one of the network interface. The network adapter frees the mbuf and H> returns EAGAIN which causes the ip_output() to release and clear the send H> tag. Upon next ip_output() a new "snd_tag" will be tried allocated. H> H> 4) When the PCB is detached the custom sendqueue will be released by a H> non-blocking ifp->if_snd_tag_free() call to the currently bound network H> interface. H> H> Reviewed by: wblock (manpages), adrian, gallatin, scottl (network) H> Differential Revision: https://reviews.freebsd.org/D3687 H> Sponsored by: Mellanox Technologies H> MFC after: 3 months H> H> Modified: H> head/lib/libc/sys/getsockopt.2 H> head/sbin/ifconfig/ifconfig.8 H> head/sbin/ifconfig/ifconfig.c H> head/sys/conf/NOTES H> head/sys/conf/config.mk H> head/sys/conf/kern.opts.mk H> head/sys/conf/options H> head/sys/kern/uipc_socket.c H> head/sys/modules/if_lagg/Makefile H> head/sys/modules/if_vlan/Makefile H> head/sys/net/ieee8023ad_lacp.c H> head/sys/net/ieee8023ad_lacp.h H> head/sys/net/if.h H> head/sys/net/if_dead.c H> head/sys/net/if_lagg.c H> head/sys/net/if_var.h H> head/sys/net/if_vlan.c H> head/sys/netinet/in_pcb.c H> head/sys/netinet/in_pcb.h H> head/sys/netinet/ip_output.c H> head/sys/netinet6/ip6_output.c H> head/sys/sys/mbuf.h H> head/sys/sys/socket.h H> head/sys/sys/socketvar.h H> H> Modified: head/lib/libc/sys/getsockopt.2 H> ============================================================================== H> --- head/lib/libc/sys/getsockopt.2 Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/lib/libc/sys/getsockopt.2 Wed Jan 18 13:31:17 2017 (r312379) H> @@ -28,7 +28,7 @@ H> .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 H> .\" $FreeBSD$ H> .\" H> -.Dd April 5, 2013 H> +.Dd January 18, 2017 H> .Dt GETSOCKOPT 2 H> .Os H> .Sh NAME H> @@ -188,6 +188,7 @@ The following options are recognized in H> .It Dv SO_LISTENINCQLEN Ta "get incomplete queue length of the socket (get only)" H> .It Dv SO_USER_COOKIE Ta "set the 'so_user_cookie' value for the socket (uint32_t, set only)" H> .It Dv SO_TS_CLOCK Ta "set specific format of timestamp returned by SO_TIMESTAMP" H> +.It Dv SO_MAX_PACING_RATE "set the maximum transmit rate in bytes per second for the socket" H> .El H> .Pp H> .Dv SO_DEBUG H> @@ -515,6 +516,10 @@ returns the maximal number of queued con H> returns the number of unaccepted complete connections. H> .Dv SO_LISTENINCQLEN H> returns the number of unaccepted incomplete connections. H> +.Pp H> +.Dv SO_MAX_PACING_RATE H> +instruct the socket and underlying network adapter layers to limit the H> +transfer rate to the given unsigned 32-bit value in bytes per second. H> .Sh RETURN VALUES H> .Rv -std H> .Sh ERRORS H> H> Modified: head/sbin/ifconfig/ifconfig.8 H> ============================================================================== H> --- head/sbin/ifconfig/ifconfig.8 Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sbin/ifconfig/ifconfig.8 Wed Jan 18 13:31:17 2017 (r312379) H> @@ -28,7 +28,7 @@ H> .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 H> .\" $FreeBSD$ H> .\" H> -.Dd September 17, 2016 H> +.Dd January 18, 2017 H> .Dt IFCONFIG 8 H> .Os H> .Sh NAME H> @@ -460,6 +460,8 @@ this directive is used to select between H> and 802.11g H> .Pq Cm 11g H> operating modes. H> +.It Cm txrtlmt H> +Set if the driver supports TX rate limiting. H> .It Cm inst Ar minst , Cm instance Ar minst H> Set the media instance to H> .Ar minst . H> H> Modified: head/sbin/ifconfig/ifconfig.c H> ============================================================================== H> --- head/sbin/ifconfig/ifconfig.c Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sbin/ifconfig/ifconfig.c Wed Jan 18 13:31:17 2017 (r312379) H> @@ -1145,7 +1145,7 @@ unsetifdescr(const char *val, int value, H> "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ H> "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ H> "\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ H> -"\26RXCSUM_IPV6\27TXCSUM_IPV6" H> +"\26RXCSUM_IPV6\27TXCSUM_IPV6\31TXRTLMT" H> H> /* H> * Print the status of the interface. If an address family was H> @@ -1453,6 +1453,8 @@ static struct cmd basic_cmds[] = { H> DEF_CMD("-wol_mcast", -IFCAP_WOL_MCAST, setifcap), H> DEF_CMD("wol_magic", IFCAP_WOL_MAGIC, setifcap), H> DEF_CMD("-wol_magic", -IFCAP_WOL_MAGIC, setifcap), H> + DEF_CMD("txrtlmt", IFCAP_TXRTLMT, setifcap), H> + DEF_CMD("-txrtlmt", -IFCAP_TXRTLMT, setifcap), H> DEF_CMD("normal", -IFF_LINK0, setifflags), H> DEF_CMD("compress", IFF_LINK0, setifflags), H> DEF_CMD("noicmp", IFF_LINK1, setifflags), H> H> Modified: head/sys/conf/NOTES H> ============================================================================== H> --- head/sys/conf/NOTES Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/conf/NOTES Wed Jan 18 13:31:17 2017 (r312379) H> @@ -619,6 +619,8 @@ options HWPMC_HOOKS # Other necessary H> options INET #Internet communications protocols H> options INET6 #IPv6 communications protocols H> H> +options RATELIMIT # TX rate limiting support H> + H> options ROUTETABLES=2 # allocated fibs up to 65536. default is 1. H> # but that would be a bad idea as they are large. H> H> H> Modified: head/sys/conf/config.mk H> ============================================================================== H> --- head/sys/conf/config.mk Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/conf/config.mk Wed Jan 18 13:31:17 2017 (r312379) H> @@ -19,6 +19,10 @@ opt_inet.h: H> opt_inet6.h: H> @echo "#define INET6 1" > ${.TARGET} H> .endif H> +.if ${MK_RATELIMIT} != "no" H> +opt_ratelimit.h: H> + @echo "#define RATELIMIT 1" > ${.TARGET} H> +.endif H> .if ${MK_EISA} != "no" H> opt_eisa.h: H> @echo "#define DEV_EISA 1" > ${.TARGET} H> H> Modified: head/sys/conf/kern.opts.mk H> ============================================================================== H> --- head/sys/conf/kern.opts.mk Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/conf/kern.opts.mk Wed Jan 18 13:31:17 2017 (r312379) H> @@ -48,6 +48,7 @@ __DEFAULT_NO_OPTIONS = \ H> EXTRA_TCP_STACKS \ H> NAND \ H> OFED \ H> + RATELIMIT \ H> REPRODUCIBLE_BUILD H> H> # Some options are totally broken on some architectures. We disable H> H> Modified: head/sys/conf/options H> ============================================================================== H> --- head/sys/conf/options Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/conf/options Wed Jan 18 13:31:17 2017 (r312379) H> @@ -412,6 +412,7 @@ BOOTP_NFSV3 opt_bootp.h H> BOOTP_WIRED_TO opt_bootp.h H> DEVICE_POLLING H> DUMMYNET opt_ipdn.h H> +RATELIMIT opt_ratelimit.h H> INET opt_inet.h H> INET6 opt_inet6.h H> IPDIVERT H> H> Modified: head/sys/kern/uipc_socket.c H> ============================================================================== H> --- head/sys/kern/uipc_socket.c Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/kern/uipc_socket.c Wed Jan 18 13:31:17 2017 (r312379) H> @@ -2699,6 +2699,14 @@ sosetopt(struct socket *so, struct socko H> so->so_ts_clock = optval; H> break; H> H> + case SO_MAX_PACING_RATE: H> + error = sooptcopyin(sopt, &val32, sizeof(val32), H> + sizeof(val32)); H> + if (error) H> + goto bad; H> + so->so_max_pacing_rate = val32; H> + break; H> + H> default: H> if (V_socket_hhh[HHOOK_SOCKET_OPT]->hhh_nhooks > 0) H> error = hhook_run_socket(so, sopt, H> @@ -2890,6 +2898,10 @@ integer: H> optval = so->so_ts_clock; H> goto integer; H> H> + case SO_MAX_PACING_RATE: H> + optval = so->so_max_pacing_rate; H> + goto integer; H> + H> default: H> if (V_socket_hhh[HHOOK_SOCKET_OPT]->hhh_nhooks > 0) H> error = hhook_run_socket(so, sopt, H> H> Modified: head/sys/modules/if_lagg/Makefile H> ============================================================================== H> --- head/sys/modules/if_lagg/Makefile Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/modules/if_lagg/Makefile Wed Jan 18 13:31:17 2017 (r312379) H> @@ -2,6 +2,6 @@ H> H> .PATH: ${.CURDIR}/../../net H> KMOD= if_lagg H> -SRCS= if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h H> +SRCS= if_lagg.c ieee8023ad_lacp.c opt_inet.h opt_inet6.h opt_ratelimit.h H> H> .include H> H> Modified: head/sys/modules/if_vlan/Makefile H> ============================================================================== H> --- head/sys/modules/if_vlan/Makefile Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/modules/if_vlan/Makefile Wed Jan 18 13:31:17 2017 (r312379) H> @@ -4,6 +4,6 @@ H> H> KMOD= if_vlan H> SRCS= if_vlan.c H> -SRCS+= opt_inet.h opt_vlan.h H> +SRCS+= opt_inet.h opt_vlan.h opt_ratelimit.h H> H> .include H> H> Modified: head/sys/net/ieee8023ad_lacp.c H> ============================================================================== H> --- head/sys/net/ieee8023ad_lacp.c Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/net/ieee8023ad_lacp.c Wed Jan 18 13:31:17 2017 (r312379) H> @@ -30,6 +30,8 @@ H> #include H> __FBSDID("$FreeBSD$"); H> H> +#include "opt_ratelimit.h" H> + H> #include H> #include H> #include H> @@ -853,6 +855,35 @@ lacp_select_tx_port(struct lagg_softc *s H> H> return (lp->lp_lagg); H> } H> + H> +#ifdef RATELIMIT H> +struct lagg_port * H> +lacp_select_tx_port_by_hash(struct lagg_softc *sc, uint32_t flowid) H> +{ H> + struct lacp_softc *lsc = LACP_SOFTC(sc); H> + struct lacp_portmap *pm; H> + struct lacp_port *lp; H> + uint32_t hash; H> + H> + if (__predict_false(lsc->lsc_suppress_distributing)) { H> + LACP_DPRINTF((NULL, "%s: waiting transit\n", __func__)); H> + return (NULL); H> + } H> + H> + pm = &lsc->lsc_pmap[lsc->lsc_activemap]; H> + if (pm->pm_count == 0) { H> + LACP_DPRINTF((NULL, "%s: no active aggregator\n", __func__)); H> + return (NULL); H> + } H> + H> + hash = flowid >> sc->flowid_shift; H> + hash %= pm->pm_count; H> + lp = pm->pm_map[hash]; H> + H> + return (lp->lp_lagg); H> +} H> +#endif H> + H> /* H> * lacp_suppress_distributing: drop transmit packets for a while H> * to preserve packet ordering. H> H> Modified: head/sys/net/ieee8023ad_lacp.h H> ============================================================================== H> --- head/sys/net/ieee8023ad_lacp.h Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/net/ieee8023ad_lacp.h Wed Jan 18 13:31:17 2017 (r312379) H> @@ -284,6 +284,9 @@ struct lacp_softc { H> H> struct mbuf *lacp_input(struct lagg_port *, struct mbuf *); H> struct lagg_port *lacp_select_tx_port(struct lagg_softc *, struct mbuf *); H> +#ifdef RATELIMIT H> +struct lagg_port *lacp_select_tx_port_by_hash(struct lagg_softc *, uint32_t); H> +#endif H> void lacp_attach(struct lagg_softc *); H> void lacp_detach(void *); H> void lacp_init(struct lagg_softc *); H> H> Modified: head/sys/net/if.h H> ============================================================================== H> --- head/sys/net/if.h Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/net/if.h Wed Jan 18 13:31:17 2017 (r312379) H> @@ -239,6 +239,7 @@ struct if_data { H> #define IFCAP_RXCSUM_IPV6 0x200000 /* can offload checksum on IPv6 RX */ H> #define IFCAP_TXCSUM_IPV6 0x400000 /* can offload checksum on IPv6 TX */ H> #define IFCAP_HWSTATS 0x800000 /* manages counters internally */ H> +#define IFCAP_TXRTLMT 0x1000000 /* hardware supports TX rate limiting */ H> H> #define IFCAP_HWCSUM_IPV6 (IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6) H> H> H> Modified: head/sys/net/if_dead.c H> ============================================================================== H> --- head/sys/net/if_dead.c Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/net/if_dead.c Wed Jan 18 13:31:17 2017 (r312379) H> @@ -100,6 +100,30 @@ ifdead_get_counter(struct ifnet *ifp, if H> return (0); H> } H> H> +static int H> +ifdead_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, H> + struct m_snd_tag **ppmt) H> +{ H> + return (EOPNOTSUPP); H> +} H> + H> +static int H> +ifdead_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *params) H> +{ H> + return (EOPNOTSUPP); H> +} H> + H> +static int H> +ifdead_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params) H> +{ H> + return (EOPNOTSUPP); H> +} H> + H> +static void H> +ifdead_snd_tag_free(struct m_snd_tag *pmt) H> +{ H> +} H> + H> void H> if_dead(struct ifnet *ifp) H> { H> @@ -112,4 +136,8 @@ if_dead(struct ifnet *ifp) H> ifp->if_qflush = ifdead_qflush; H> ifp->if_transmit = ifdead_transmit; H> ifp->if_get_counter = ifdead_get_counter; H> + ifp->if_snd_tag_alloc = ifdead_snd_tag_alloc; H> + ifp->if_snd_tag_modify = ifdead_snd_tag_modify; H> + ifp->if_snd_tag_query = ifdead_snd_tag_query; H> + ifp->if_snd_tag_free = ifdead_snd_tag_free; H> } H> H> Modified: head/sys/net/if_lagg.c H> ============================================================================== H> --- head/sys/net/if_lagg.c Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/net/if_lagg.c Wed Jan 18 13:31:17 2017 (r312379) H> @@ -23,6 +23,7 @@ __FBSDID("$FreeBSD$"); H> H> #include "opt_inet.h" H> #include "opt_inet6.h" H> +#include "opt_ratelimit.h" H> H> #include H> #include H> @@ -118,6 +119,11 @@ static void lagg_port2req(struct lagg_po H> static void lagg_init(void *); H> static void lagg_stop(struct lagg_softc *); H> static int lagg_ioctl(struct ifnet *, u_long, caddr_t); H> +#ifdef RATELIMIT H> +static int lagg_snd_tag_alloc(struct ifnet *, H> + union if_snd_tag_alloc_params *, H> + struct m_snd_tag **); H> +#endif H> static int lagg_ether_setmulti(struct lagg_softc *); H> static int lagg_ether_cmdmulti(struct lagg_port *, int); H> static int lagg_setflag(struct lagg_port *, int, int, H> @@ -503,7 +509,12 @@ lagg_clone_create(struct if_clone *ifc, H> ifp->if_ioctl = lagg_ioctl; H> ifp->if_get_counter = lagg_get_counter; H> ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; H> +#ifdef RATELIMIT H> + ifp->if_snd_tag_alloc = lagg_snd_tag_alloc; H> + ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS | IFCAP_TXRTLMT; H> +#else H> ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; H> +#endif H> H> /* H> * Attach as an ordinary ethernet device, children will be attached H> @@ -1549,6 +1560,52 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd H> return (error); H> } H> H> +#ifdef RATELIMIT H> +static int H> +lagg_snd_tag_alloc(struct ifnet *ifp, H> + union if_snd_tag_alloc_params *params, H> + struct m_snd_tag **ppmt) H> +{ H> + struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; H> + struct lagg_port *lp; H> + struct lagg_lb *lb; H> + uint32_t p; H> + H> + switch (sc->sc_proto) { H> + case LAGG_PROTO_FAILOVER: H> + lp = lagg_link_active(sc, sc->sc_primary); H> + break; H> + case LAGG_PROTO_LOADBALANCE: H> + if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || H> + params->hdr.flowtype == M_HASHTYPE_NONE) H> + return (EOPNOTSUPP); H> + p = params->hdr.flowid >> sc->flowid_shift; H> + p %= sc->sc_count; H> + lb = (struct lagg_lb *)sc->sc_psc; H> + lp = lb->lb_ports[p]; H> + lp = lagg_link_active(sc, lp); H> + break; H> + case LAGG_PROTO_LACP: H> + if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) == 0 || H> + params->hdr.flowtype == M_HASHTYPE_NONE) H> + return (EOPNOTSUPP); H> + lp = lacp_select_tx_port_by_hash(sc, params->hdr.flowid); H> + break; H> + default: H> + return (EOPNOTSUPP); H> + } H> + if (lp == NULL) H> + return (EOPNOTSUPP); H> + ifp = lp->lp_ifp; H> + if (ifp == NULL || ifp->if_snd_tag_alloc == NULL || H> + (ifp->if_capenable & IFCAP_TXRTLMT) == 0) H> + return (EOPNOTSUPP); H> + H> + /* forward allocation request */ H> + return (ifp->if_snd_tag_alloc(ifp, params, ppmt)); H> +} H> +#endif H> + H> static int H> lagg_ether_setmulti(struct lagg_softc *sc) H> { H> H> Modified: head/sys/net/if_var.h H> ============================================================================== H> --- head/sys/net/if_var.h Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/net/if_var.h Wed Jan 18 13:31:17 2017 (r312379) H> @@ -175,6 +175,49 @@ struct if_encap_req { H> H> #define IFENCAP_FLAG_BROADCAST 0x02 /* Destination is broadcast */ H> H> +/* H> + * Network interface send tag support. The storage of "struct H> + * m_snd_tag" comes from the network driver and it is free to allocate H> + * as much additional space as it wants for its own use. H> + */ H> +struct m_snd_tag; H> + H> +#define IF_SND_TAG_TYPE_RATE_LIMIT 0 H> +#define IF_SND_TAG_TYPE_MAX 1 H> + H> +struct if_snd_tag_alloc_header { H> + uint32_t type; /* send tag type, see IF_SND_TAG_XXX */ H> + uint32_t flowid; /* mbuf hash value */ H> + uint32_t flowtype; /* mbuf hash type */ H> +}; H> + H> +struct if_snd_tag_alloc_rate_limit { H> + struct if_snd_tag_alloc_header hdr; H> + uint64_t max_rate; /* in bytes/s */ H> +}; H> + H> +struct if_snd_tag_rate_limit_params { H> + uint64_t max_rate; /* in bytes/s */ H> +}; H> + H> +union if_snd_tag_alloc_params { H> + struct if_snd_tag_alloc_header hdr; H> + struct if_snd_tag_alloc_rate_limit rate_limit; H> +}; H> + H> +union if_snd_tag_modify_params { H> + struct if_snd_tag_rate_limit_params rate_limit; H> +}; H> + H> +union if_snd_tag_query_params { H> + struct if_snd_tag_rate_limit_params rate_limit; H> +}; H> + H> +typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params *, H> + struct m_snd_tag **); H> +typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); H> +typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); H> +typedef void (if_snd_tag_free_t)(struct m_snd_tag *); H> H> /* H> * Structure defining a network interface. H> @@ -304,12 +347,19 @@ struct ifnet { H> u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ H> H> /* H> + * Network adapter send tag support: H> + */ H> + if_snd_tag_alloc_t *if_snd_tag_alloc; H> + if_snd_tag_modify_t *if_snd_tag_modify; H> + if_snd_tag_query_t *if_snd_tag_query; H> + if_snd_tag_free_t *if_snd_tag_free; H> + H> + /* H> * Spare fields to be added before branching a stable branch, so H> * that structure can be enhanced without changing the kernel H> * binary interface. H> */ H> - void *if_pspare[4]; /* packet pacing / general use */ H> - int if_ispare[4]; /* packet pacing / general use */ H> + int if_ispare[4]; /* general use */ H> }; H> H> /* for compatibility with other BSDs */ H> H> Modified: head/sys/net/if_vlan.c H> ============================================================================== H> --- head/sys/net/if_vlan.c Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/net/if_vlan.c Wed Jan 18 13:31:17 2017 (r312379) H> @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); H> H> #include "opt_inet.h" H> #include "opt_vlan.h" H> +#include "opt_ratelimit.h" H> H> #include H> #include H> @@ -212,6 +213,10 @@ static void trunk_destroy(struct ifvlant H> static void vlan_init(void *foo); H> static void vlan_input(struct ifnet *ifp, struct mbuf *m); H> static int vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr); H> +#ifdef RATELIMIT H> +static int vlan_snd_tag_alloc(struct ifnet *, H> + union if_snd_tag_alloc_params *, struct m_snd_tag **); H> +#endif H> static void vlan_qflush(struct ifnet *ifp); H> static int vlan_setflag(struct ifnet *ifp, int flag, int status, H> int (*func)(struct ifnet *, int)); H> @@ -971,6 +976,9 @@ vlan_clone_create(struct if_clone *ifc, H> ifp->if_transmit = vlan_transmit; H> ifp->if_qflush = vlan_qflush; H> ifp->if_ioctl = vlan_ioctl; H> +#ifdef RATELIMIT H> + ifp->if_snd_tag_alloc = vlan_snd_tag_alloc; H> +#endif H> ifp->if_flags = VLAN_IFFLAGS; H> ether_ifattach(ifp, eaddr); H> /* Now undo some of the damage... */ H> @@ -1591,6 +1599,15 @@ vlan_capabilities(struct ifvlan *ifv) H> TOEDEV(ifp) = TOEDEV(p); H> ifp->if_capenable |= p->if_capenable & IFCAP_TOE; H> } H> + H> +#ifdef RATELIMIT H> + /* H> + * If the parent interface supports ratelimiting, so does the H> + * VLAN interface. H> + */ H> + ifp->if_capabilities |= (p->if_capabilities & IFCAP_TXRTLMT); H> + ifp->if_capenable |= (p->if_capenable & IFCAP_TXRTLMT); H> +#endif H> } H> H> static void H> @@ -1801,3 +1818,19 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd H> H> return (error); H> } H> + H> +#ifdef RATELIMIT H> +static int H> +vlan_snd_tag_alloc(struct ifnet *ifp, H> + union if_snd_tag_alloc_params *params, H> + struct m_snd_tag **ppmt) H> +{ H> + H> + /* get trunk device */ H> + ifp = vlan_trunkdev(ifp); H> + if (ifp == NULL || (ifp->if_capenable & IFCAP_TXRTLMT) == 0) H> + return (EOPNOTSUPP); H> + /* forward allocation request */ H> + return (ifp->if_snd_tag_alloc(ifp, params, ppmt)); H> +} H> +#endif H> H> Modified: head/sys/netinet/in_pcb.c H> ============================================================================== H> --- head/sys/netinet/in_pcb.c Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/netinet/in_pcb.c Wed Jan 18 13:31:17 2017 (r312379) H> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); H> #include "opt_ipsec.h" H> #include "opt_inet.h" H> #include "opt_inet6.h" H> +#include "opt_ratelimit.h" H> #include "opt_pcbgroup.h" H> #include "opt_rss.h" H> H> @@ -57,6 +58,7 @@ __FBSDID("$FreeBSD$"); H> #include H> #include H> #include H> +#include H> #include H> #include H> #include H> @@ -1140,6 +1142,10 @@ in_pcbdetach(struct inpcb *inp) H> H> KASSERT(inp->inp_socket != NULL, ("%s: inp_socket == NULL", __func__)); H> H> +#ifdef RATELIMIT H> + if (inp->inp_snd_tag != NULL) H> + in_pcbdetach_txrtlmt(inp); H> +#endif H> inp->inp_socket->so_pcb = NULL; H> inp->inp_socket = NULL; H> } H> @@ -2677,3 +2683,253 @@ DB_SHOW_COMMAND(inpcb, db_show_inpcb) H> db_print_inpcb(inp, "inpcb", 0); H> } H> #endif /* DDB */ H> + H> +#ifdef RATELIMIT H> +/* H> + * Modify TX rate limit based on the existing "inp->inp_snd_tag", H> + * if any. H> + */ H> +int H> +in_pcbmodify_txrtlmt(struct inpcb *inp, uint32_t max_pacing_rate) H> +{ H> + union if_snd_tag_modify_params params = { H> + .rate_limit.max_rate = max_pacing_rate, H> + }; H> + struct m_snd_tag *mst; H> + struct ifnet *ifp; H> + int error; H> + H> + mst = inp->inp_snd_tag; H> + if (mst == NULL) H> + return (EINVAL); H> + H> + ifp = mst->ifp; H> + if (ifp == NULL) H> + return (EINVAL); H> + H> + if (ifp->if_snd_tag_modify == NULL) { H> + error = EOPNOTSUPP; H> + } else { H> + error = ifp->if_snd_tag_modify(mst, ¶ms); H> + } H> + return (error); H> +} H> + H> +/* H> + * Query existing TX rate limit based on the existing H> + * "inp->inp_snd_tag", if any. H> + */ H> +int H> +in_pcbquery_txrtlmt(struct inpcb *inp, uint32_t *p_max_pacing_rate) H> +{ H> + union if_snd_tag_query_params params = { }; H> + struct m_snd_tag *mst; H> + struct ifnet *ifp; H> + int error; H> + H> + mst = inp->inp_snd_tag; H> + if (mst == NULL) H> + return (EINVAL); H> + H> + ifp = mst->ifp; H> + if (ifp == NULL) H> + return (EINVAL); H> + H> + if (ifp->if_snd_tag_query == NULL) { H> + error = EOPNOTSUPP; H> + } else { H> + error = ifp->if_snd_tag_query(mst, ¶ms); H> + if (error == 0 && p_max_pacing_rate != NULL) H> + *p_max_pacing_rate = params.rate_limit.max_rate; H> + } H> + return (error); H> +} H> + H> +/* H> + * Allocate a new TX rate limit send tag from the network interface H> + * given by the "ifp" argument and save it in "inp->inp_snd_tag": H> + */ H> +int H> +in_pcbattach_txrtlmt(struct inpcb *inp, struct ifnet *ifp, H> + uint32_t flowtype, uint32_t flowid, uint32_t max_pacing_rate) H> +{ H> + union if_snd_tag_alloc_params params = { H> + .rate_limit.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT, H> + .rate_limit.hdr.flowid = flowid, H> + .rate_limit.hdr.flowtype = flowtype, H> + .rate_limit.max_rate = max_pacing_rate, H> + }; H> + int error; H> + H> + INP_WLOCK_ASSERT(inp); H> + H> + if (inp->inp_snd_tag != NULL) H> + return (EINVAL); H> + H> + if (ifp->if_snd_tag_alloc == NULL) { H> + error = EOPNOTSUPP; H> + } else { H> + error = ifp->if_snd_tag_alloc(ifp, ¶ms, &inp->inp_snd_tag); H> + H> + /* H> + * At success increment the refcount on H> + * the send tag's network interface: H> + */ H> + if (error == 0) H> + if_ref(inp->inp_snd_tag->ifp); H> + } H> + return (error); H> +} H> + H> +/* H> + * Free an existing TX rate limit tag based on the "inp->inp_snd_tag", H> + * if any: H> + */ H> +void H> +in_pcbdetach_txrtlmt(struct inpcb *inp) H> +{ H> + struct m_snd_tag *mst; H> + struct ifnet *ifp; H> + H> + INP_WLOCK_ASSERT(inp); H> + H> + mst = inp->inp_snd_tag; H> + inp->inp_snd_tag = NULL; H> + H> + if (mst == NULL) H> + return; H> + H> + ifp = mst->ifp; H> + if (ifp == NULL) H> + return; H> + H> + /* H> + * If the device was detached while we still had reference(s) H> + * on the ifp, we assume if_snd_tag_free() was replaced with H> + * stubs. H> + */ H> + ifp->if_snd_tag_free(mst); H> + H> + /* release reference count on network interface */ H> + if_rele(ifp); H> +} H> + H> +/* H> + * This function should be called when the INP_RATE_LIMIT_CHANGED flag H> + * is set in the fast path and will attach/detach/modify the TX rate H> + * limit send tag based on the socket's so_max_pacing_rate value. H> + */ H> +void H> +in_pcboutput_txrtlmt(struct inpcb *inp, struct ifnet *ifp, struct mbuf *mb) H> +{ H> + struct socket *socket; H> + uint32_t max_pacing_rate; H> + bool did_upgrade; H> + int error; H> + H> + if (inp == NULL) H> + return; H> + H> + socket = inp->inp_socket; H> + if (socket == NULL) H> + return; H> + H> + if (!INP_WLOCKED(inp)) { H> + /* H> + * NOTE: If the write locking fails, we need to bail H> + * out and use the non-ratelimited ring for the H> + * transmit until there is a new chance to get the H> + * write lock. H> + */ H> + if (!INP_TRY_UPGRADE(inp)) H> + return; H> + did_upgrade = 1; H> + } else { H> + did_upgrade = 0; H> + } H> + H> + /* H> + * NOTE: The so_max_pacing_rate value is read unlocked, H> + * because atomic updates are not required since the variable H> + * is checked at every mbuf we send. It is assumed that the H> + * variable read itself will be atomic. H> + */ H> + max_pacing_rate = socket->so_max_pacing_rate; H> + H> + /* H> + * NOTE: When attaching to a network interface a reference is H> + * made to ensure the network interface doesn't go away until H> + * all ratelimit connections are gone. The network interface H> + * pointers compared below represent valid network interfaces, H> + * except when comparing towards NULL. H> + */ H> + if (max_pacing_rate == 0 && inp->inp_snd_tag == NULL) { H> + error = 0; H> + } else if (!(ifp->if_capenable & IFCAP_TXRTLMT)) { H> + if (inp->inp_snd_tag != NULL) H> + in_pcbdetach_txrtlmt(inp); H> + error = 0; H> + } else if (inp->inp_snd_tag == NULL) { H> + /* H> + * In order to utilize packet pacing with RSS, we need H> + * to wait until there is a valid RSS hash before we H> + * can proceed: H> + */ H> + if (M_HASHTYPE_GET(mb) == M_HASHTYPE_NONE) { H> + error = EAGAIN; H> + } else { H> + error = in_pcbattach_txrtlmt(inp, ifp, M_HASHTYPE_GET(mb), H> + mb->m_pkthdr.flowid, max_pacing_rate); H> + } H> + } else { H> + error = in_pcbmodify_txrtlmt(inp, max_pacing_rate); H> + } H> + if (error == 0 || error == EOPNOTSUPP) H> + inp->inp_flags2 &= ~INP_RATE_LIMIT_CHANGED; H> + if (did_upgrade) H> + INP_DOWNGRADE(inp); H> +} H> + H> +/* H> + * Track route changes for TX rate limiting. H> + */ H> +void H> +in_pcboutput_eagain(struct inpcb *inp) H> +{ H> + struct socket *socket; H> + bool did_upgrade; H> + H> + if (inp == NULL) H> + return; H> + H> + socket = inp->inp_socket; H> + if (socket == NULL) H> + return; H> + H> + if (inp->inp_snd_tag == NULL) H> + return; H> + H> + if (!INP_WLOCKED(inp)) { H> + /* H> + * NOTE: If the write locking fails, we need to bail H> + * out and use the non-ratelimited ring for the H> + * transmit until there is a new chance to get the H> + * write lock. H> + */ H> + if (!INP_TRY_UPGRADE(inp)) H> + return; H> + did_upgrade = 1; H> + } else { H> + did_upgrade = 0; H> + } H> + H> + /* detach rate limiting */ H> + in_pcbdetach_txrtlmt(inp); H> + H> + /* make sure new mbuf send tag allocation is made */ H> + inp->inp_flags2 |= INP_RATE_LIMIT_CHANGED; H> + H> + if (did_upgrade) H> + INP_DOWNGRADE(inp); H> +} H> +#endif /* RATELIMIT */ H> H> Modified: head/sys/netinet/in_pcb.h H> ============================================================================== H> --- head/sys/netinet/in_pcb.h Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/netinet/in_pcb.h Wed Jan 18 13:31:17 2017 (r312379) H> @@ -181,6 +181,7 @@ struct icmp6_filter; H> * read-lock usage during modification, this model can be applied to other H> * protocols (especially SCTP). H> */ H> +struct m_snd_tag; H> struct inpcb { H> LIST_ENTRY(inpcb) inp_hash; /* (h/i) hash list */ H> LIST_ENTRY(inpcb) inp_pcbgrouphash; /* (g/i) hash list */ H> @@ -202,11 +203,11 @@ struct inpcb { H> u_char inp_ip_minttl; /* (i) minimum TTL or drop */ H> uint32_t inp_flowid; /* (x) flow id / queue id */ H> u_int inp_refcount; /* (i) refcount */ H> - void *inp_pspare[5]; /* (x) packet pacing / general use */ H> + struct m_snd_tag *inp_snd_tag; /* (i) send tag for outgoing mbufs */ H> + void *inp_pspare[4]; /* (x) general use */ H> uint32_t inp_flowtype; /* (x) M_HASHTYPE value */ H> uint32_t inp_rss_listen_bucket; /* (x) overridden RSS listen bucket */ H> - u_int inp_ispare[4]; /* (x) packet pacing / user cookie / H> - * general use */ H> + u_int inp_ispare[4]; /* (x) user cookie / general use */ H> H> /* Local and foreign ports, local and foreign addr. */ H> struct in_conninfo inp_inc; /* (i) list for PCB's local port */ H> @@ -616,6 +617,7 @@ short inp_so_options(const struct inpcb H> #define INP_RSS_BUCKET_SET 0x00000080 /* IP_RSS_LISTEN_BUCKET is set */ H> #define INP_RECVFLOWID 0x00000100 /* populate recv datagram with flow info */ H> #define INP_RECVRSSBUCKETID 0x00000200 /* populate recv datagram with bucket id */ H> +#define INP_RATE_LIMIT_CHANGED 0x00000400 /* rate limit needs attention */ H> H> /* H> * Flags passed to in_pcblookup*() functions. H> @@ -736,6 +738,14 @@ int in_getsockaddr(struct socket *so, st H> struct sockaddr * H> in_sockaddr(in_port_t port, struct in_addr *addr); H> void in_pcbsosetlabel(struct socket *so); H> +#ifdef RATELIMIT H> +int in_pcbattach_txrtlmt(struct inpcb *, struct ifnet *, uint32_t, uint32_t, uint32_t); H> +void in_pcbdetach_txrtlmt(struct inpcb *); H> +int in_pcbmodify_txrtlmt(struct inpcb *, uint32_t); H> +int in_pcbquery_txrtlmt(struct inpcb *, uint32_t *); H> +void in_pcboutput_txrtlmt(struct inpcb *, struct ifnet *, struct mbuf *); H> +void in_pcboutput_eagain(struct inpcb *); H> +#endif H> #endif /* _KERNEL */ H> H> #endif /* !_NETINET_IN_PCB_H_ */ H> H> Modified: head/sys/netinet/ip_output.c H> ============================================================================== H> --- head/sys/netinet/ip_output.c Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/netinet/ip_output.c Wed Jan 18 13:31:17 2017 (r312379) H> @@ -33,6 +33,7 @@ H> __FBSDID("$FreeBSD$"); H> H> #include "opt_inet.h" H> +#include "opt_ratelimit.h" H> #include "opt_ipsec.h" H> #include "opt_mbuf_stress_test.h" H> #include "opt_mpath.h" H> @@ -661,8 +662,23 @@ sendit: H> */ H> m_clrprotoflags(m); H> IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); H> +#ifdef RATELIMIT H> + if (inp != NULL) { H> + if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) H> + in_pcboutput_txrtlmt(inp, ifp, m); H> + /* stamp send tag on mbuf */ H> + m->m_pkthdr.snd_tag = inp->inp_snd_tag; H> + } else { H> + m->m_pkthdr.snd_tag = NULL; H> + } H> +#endif H> error = (*ifp->if_output)(ifp, m, H> (const struct sockaddr *)gw, ro); H> +#ifdef RATELIMIT H> + /* check for route change */ H> + if (error == EAGAIN) H> + in_pcboutput_eagain(inp); H> +#endif H> goto done; H> } H> H> @@ -698,8 +714,23 @@ sendit: H> H> IP_PROBE(send, NULL, NULL, mtod(m, struct ip *), ifp, H> mtod(m, struct ip *), NULL); H> +#ifdef RATELIMIT H> + if (inp != NULL) { H> + if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) H> + in_pcboutput_txrtlmt(inp, ifp, m); H> + /* stamp send tag on mbuf */ H> + m->m_pkthdr.snd_tag = inp->inp_snd_tag; H> + } else { H> + m->m_pkthdr.snd_tag = NULL; H> + } H> +#endif H> error = (*ifp->if_output)(ifp, m, H> (const struct sockaddr *)gw, ro); H> +#ifdef RATELIMIT H> + /* check for route change */ H> + if (error == EAGAIN) H> + in_pcboutput_eagain(inp); H> +#endif H> } else H> m_freem(m); H> } H> @@ -974,6 +1005,16 @@ ip_ctloutput(struct socket *so, struct s H> INP_WUNLOCK(inp); H> error = 0; H> break; H> + case SO_MAX_PACING_RATE: H> +#ifdef RATELIMIT H> + INP_WLOCK(inp); H> + inp->inp_flags2 |= INP_RATE_LIMIT_CHANGED; H> + INP_WUNLOCK(inp); H> + error = 0; H> +#else H> + error = EOPNOTSUPP; H> +#endif H> + break; H> default: H> break; H> } H> H> Modified: head/sys/netinet6/ip6_output.c H> ============================================================================== H> --- head/sys/netinet6/ip6_output.c Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/netinet6/ip6_output.c Wed Jan 18 13:31:17 2017 (r312379) H> @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); H> H> #include "opt_inet.h" H> #include "opt_inet6.h" H> +#include "opt_ratelimit.h" H> #include "opt_ipsec.h" H> #include "opt_sctp.h" H> #include "opt_route.h" H> @@ -954,8 +955,23 @@ passout: H> m->m_pkthdr.len); H> ifa_free(&ia6->ia_ifa); H> } H> +#ifdef RATELIMIT H> + if (inp != NULL) { H> + if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) H> + in_pcboutput_txrtlmt(inp, ifp, m); H> + /* stamp send tag on mbuf */ H> + m->m_pkthdr.snd_tag = inp->inp_snd_tag; H> + } else { H> + m->m_pkthdr.snd_tag = NULL; H> + } H> +#endif H> error = nd6_output_ifp(ifp, origifp, m, dst, H> (struct route *)ro); H> +#ifdef RATELIMIT H> + /* check for route change */ H> + if (error == EAGAIN) H> + in_pcboutput_eagain(inp); H> +#endif H> goto done; H> } H> H> @@ -1054,8 +1070,23 @@ sendorfree: H> counter_u64_add(ia->ia_ifa.ifa_obytes, H> m->m_pkthdr.len); H> } H> +#ifdef RATELIMIT H> + if (inp != NULL) { H> + if (inp->inp_flags2 & INP_RATE_LIMIT_CHANGED) H> + in_pcboutput_txrtlmt(inp, ifp, m); H> + /* stamp send tag on mbuf */ H> + m->m_pkthdr.snd_tag = inp->inp_snd_tag; H> + } else { H> + m->m_pkthdr.snd_tag = NULL; H> + } H> +#endif H> error = nd6_output_ifp(ifp, origifp, m, dst, H> (struct route *)ro); H> +#ifdef RATELIMIT H> + /* check for route change */ H> + if (error == EAGAIN) H> + in_pcboutput_eagain(inp); H> +#endif H> } else H> m_freem(m); H> } H> @@ -1441,6 +1472,16 @@ ip6_ctloutput(struct socket *so, struct H> INP_WUNLOCK(in6p); H> error = 0; H> break; H> + case SO_MAX_PACING_RATE: H> +#ifdef RATELIMIT H> + INP_WLOCK(in6p); H> + in6p->inp_flags2 |= INP_RATE_LIMIT_CHANGED; H> + INP_WUNLOCK(in6p); H> + error = 0; H> +#else H> + error = EOPNOTSUPP; H> +#endif H> + break; H> default: H> break; H> } H> H> Modified: head/sys/sys/mbuf.h H> ============================================================================== H> --- head/sys/sys/mbuf.h Wed Jan 18 13:27:24 2017 (r312378) H> +++ head/sys/sys/mbuf.h Wed Jan 18 13:31:17 2017 (r312379) H> @@ -130,6 +130,14 @@ struct m_tag { H> }; H> H> /* H> + * Static network interface owned tag. H> + * Allocated through ifp->if_snd_tag_alloc(). H> + */ H> +struct m_snd_tag { H> + struct ifnet *ifp; /* network interface tag belongs to */ H> +}; H> + H> +/* H> * Record/packet header in first mbuf of chain; valid only if M_PKTHDR is set. H> * Size ILP32: 48 H> * LP64: 56 H> H> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** H> -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Wed Jan 18 17:53:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF17ACB6F8F; Wed, 18 Jan 2017 17:53:58 +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 B18BB1A7E; Wed, 18 Jan 2017 17:53:58 +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 v0IHrvWA059591; Wed, 18 Jan 2017 17:53:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IHrvvC059589; Wed, 18 Jan 2017 17:53:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701181753.v0IHrvvC059589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 18 Jan 2017 17:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312389 - in head/sys: kern 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: Wed, 18 Jan 2017 17:53:59 -0000 Author: mjg Date: Wed Jan 18 17:53:57 2017 New Revision: 312389 URL: https://svnweb.freebsd.org/changeset/base/312389 Log: rwlock: reduce lock accesses similarly to r311172 Discussed with: jhb Tested by: pho (previous version) Modified: head/sys/kern/kern_rwlock.c head/sys/sys/rwlock.h Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Wed Jan 18 17:21:28 2017 (r312388) +++ head/sys/kern/kern_rwlock.c Wed Jan 18 17:53:57 2017 (r312389) @@ -132,9 +132,12 @@ LOCK_DELAY_SYSINIT(rw_delay_sysinit); * Return a pointer to the owning thread if the lock is write-locked or * NULL if the lock is unlocked or read-locked. */ -#define rw_wowner(rw) \ - ((rw)->rw_lock & RW_LOCK_READ ? NULL : \ - (struct thread *)RW_OWNER((rw)->rw_lock)) + +#define lv_rw_wowner(v) \ + ((v) & RW_LOCK_READ ? NULL : \ + (struct thread *)RW_OWNER((v))) + +#define rw_wowner(rw) lv_rw_wowner(RW_READ_VALUE(rw)) /* * Returns if a write owner is recursed. Write ownership is not assured @@ -415,7 +418,10 @@ __rw_rlock(volatile uintptr_t *c, const #ifdef KDTRACE_HOOKS all_time -= lockstat_nsecs(&rw->lock_object); - state = rw->rw_lock; +#endif + v = RW_READ_VALUE(rw); +#ifdef KDTRACE_HOOKS + state = v; #endif for (;;) { /* @@ -428,7 +434,6 @@ __rw_rlock(volatile uintptr_t *c, const * completely unlocked rwlock since such a lock is encoded * as a read lock with no waiters. */ - v = rw->rw_lock; if (RW_CAN_READ(v)) { /* * The RW_LOCK_READ_WAITERS flag should only be set @@ -444,6 +449,7 @@ __rw_rlock(volatile uintptr_t *c, const (void *)(v + RW_ONE_READER)); break; } + v = RW_READ_VALUE(rw); continue; } #ifdef KDTRACE_HOOKS @@ -471,9 +477,11 @@ __rw_rlock(volatile uintptr_t *c, const KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread), "spinning", "lockname:\"%s\"", rw->lock_object.lo_name); - while ((struct thread*)RW_OWNER(rw->rw_lock) == - owner && TD_IS_RUNNING(owner)) + do { lock_delay(&lda); + v = RW_READ_VALUE(rw); + owner = lv_rw_wowner(v); + } while (owner != NULL && TD_IS_RUNNING(owner)); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -484,11 +492,12 @@ __rw_rlock(volatile uintptr_t *c, const "spinning", "lockname:\"%s\"", rw->lock_object.lo_name); for (i = 0; i < rowner_loops; i++) { - v = rw->rw_lock; + v = RW_READ_VALUE(rw); if ((v & RW_LOCK_READ) == 0 || RW_CAN_READ(v)) break; cpu_spinwait(); } + v = RW_READ_VALUE(rw); #ifdef KDTRACE_HOOKS lda.spin_cnt += rowner_loops - i; #endif @@ -511,7 +520,7 @@ __rw_rlock(volatile uintptr_t *c, const * The lock might have been released while we spun, so * recheck its state and restart the loop if needed. */ - v = rw->rw_lock; + v = RW_READ_VALUE(rw); if (RW_CAN_READ(v)) { turnstile_cancel(ts); continue; @@ -549,6 +558,7 @@ __rw_rlock(volatile uintptr_t *c, const if (!atomic_cmpset_ptr(&rw->rw_lock, v, v | RW_LOCK_READ_WAITERS)) { turnstile_cancel(ts); + v = RW_READ_VALUE(rw); continue; } if (LOCK_LOG_TEST(&rw->lock_object, 0)) @@ -574,6 +584,7 @@ __rw_rlock(volatile uintptr_t *c, const if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p resuming from turnstile", __func__, rw); + v = RW_READ_VALUE(rw); } #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&rw->lock_object); @@ -657,13 +668,12 @@ _rw_runlock_cookie(volatile uintptr_t *c LOCK_LOG_LOCK("RUNLOCK", &rw->lock_object, 0, 0, file, line); /* TODO: drop "owner of record" here. */ - + x = RW_READ_VALUE(rw); for (;;) { /* * See if there is more than one read lock held. If so, * just drop one and return. */ - x = rw->rw_lock; if (RW_READERS(x) > 1) { if (atomic_cmpset_rel_ptr(&rw->rw_lock, x, x - RW_ONE_READER)) { @@ -674,6 +684,7 @@ _rw_runlock_cookie(volatile uintptr_t *c (void *)(x - RW_ONE_READER)); break; } + x = RW_READ_VALUE(rw); continue; } /* @@ -690,6 +701,7 @@ _rw_runlock_cookie(volatile uintptr_t *c __func__, rw); break; } + x = RW_READ_VALUE(rw); continue; } /* @@ -725,6 +737,7 @@ _rw_runlock_cookie(volatile uintptr_t *c if (!atomic_cmpset_rel_ptr(&rw->rw_lock, RW_READERS_LOCK(1) | v, x)) { turnstile_chain_unlock(&rw->lock_object); + x = RW_READ_VALUE(rw); continue; } if (LOCK_LOG_TEST(&rw->lock_object, 0)) @@ -790,8 +803,9 @@ __rw_wlock_hard(volatile uintptr_t *c, u lock_delay_arg_init(&lda, NULL); #endif rw = rwlock2rw(c); + v = RW_READ_VALUE(rw); - if (rw_wlocked(rw)) { + if (__predict_false(lv_rw_wowner(v) == (struct thread *)tid)) { KASSERT(rw->lock_object.lo_flags & LO_RECURSABLE, ("%s: recursing but non-recursive rw %s @ %s:%d\n", __func__, rw->lock_object.lo_name, file, line)); @@ -807,11 +821,15 @@ __rw_wlock_hard(volatile uintptr_t *c, u #ifdef KDTRACE_HOOKS all_time -= lockstat_nsecs(&rw->lock_object); - state = rw->rw_lock; + state = v; #endif for (;;) { - if (rw->rw_lock == RW_UNLOCKED && _rw_write_lock(rw, tid)) - break; + if (v == RW_UNLOCKED) { + if (_rw_write_lock(rw, tid)) + break; + v = RW_READ_VALUE(rw); + continue; + } #ifdef KDTRACE_HOOKS lda.spin_cnt++; #endif @@ -826,8 +844,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u * running on another CPU, spin until the owner stops * running or the state of the lock changes. */ - v = rw->rw_lock; - owner = (struct thread *)RW_OWNER(v); + owner = lv_rw_wowner(v); if (!(v & RW_LOCK_READ) && TD_IS_RUNNING(owner)) { if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR3(KTR_LOCK, "%s: spinning on %p held by %p", @@ -835,9 +852,11 @@ __rw_wlock_hard(volatile uintptr_t *c, u KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread), "spinning", "lockname:\"%s\"", rw->lock_object.lo_name); - while ((struct thread*)RW_OWNER(rw->rw_lock) == owner && - TD_IS_RUNNING(owner)) + do { lock_delay(&lda); + v = RW_READ_VALUE(rw); + owner = lv_rw_wowner(v); + } while (owner != NULL && TD_IS_RUNNING(owner)); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -847,6 +866,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u if (!(v & RW_LOCK_WRITE_SPINNER)) { if (!atomic_cmpset_ptr(&rw->rw_lock, v, v | RW_LOCK_WRITE_SPINNER)) { + v = RW_READ_VALUE(rw); continue; } } @@ -861,6 +881,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u } KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); + v = RW_READ_VALUE(rw); #ifdef KDTRACE_HOOKS lda.spin_cnt += rowner_loops - i; #endif @@ -869,7 +890,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u } #endif ts = turnstile_trywait(&rw->lock_object); - v = rw->rw_lock; + v = RW_READ_VALUE(rw); #ifdef ADAPTIVE_RWLOCKS /* @@ -905,6 +926,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u break; } turnstile_cancel(ts); + v = RW_READ_VALUE(rw); continue; } /* @@ -916,6 +938,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u if (!atomic_cmpset_ptr(&rw->rw_lock, v, v | RW_LOCK_WRITE_WAITERS)) { turnstile_cancel(ts); + v = RW_READ_VALUE(rw); continue; } if (LOCK_LOG_TEST(&rw->lock_object, 0)) @@ -943,6 +966,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u #ifdef ADAPTIVE_RWLOCKS spintries = 0; #endif + v = RW_READ_VALUE(rw); } #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&rw->lock_object); Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Wed Jan 18 17:21:28 2017 (r312388) +++ head/sys/sys/rwlock.h Wed Jan 18 17:53:57 2017 (r312389) @@ -76,6 +76,8 @@ #define rw_recurse lock_object.lo_data +#define RW_READ_VALUE(x) ((x)->rw_lock) + /* Very simple operations on rw_lock. */ /* Try to obtain a write lock once. */ From owner-svn-src-all@freebsd.org Wed Jan 18 17:55:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6428CB6009; Wed, 18 Jan 2017 17:55:09 +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 A8C6B1C21; Wed, 18 Jan 2017 17:55:09 +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 v0IHt8K1059715; Wed, 18 Jan 2017 17:55:08 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IHt87l059713; Wed, 18 Jan 2017 17:55:08 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701181755.v0IHt87l059713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 18 Jan 2017 17:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312390 - in head/sys: kern 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: Wed, 18 Jan 2017 17:55:10 -0000 Author: mjg Date: Wed Jan 18 17:55:08 2017 New Revision: 312390 URL: https://svnweb.freebsd.org/changeset/base/312390 Log: sx: reduce lock accesses similarly to r311172 Discussed with: jhb Tested by: pho (previous version) Modified: head/sys/kern/kern_sx.c head/sys/sys/sx.h Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Wed Jan 18 17:53:57 2017 (r312389) +++ head/sys/kern/kern_sx.c Wed Jan 18 17:55:08 2017 (r312390) @@ -563,8 +563,10 @@ _sx_xlock_hard(struct sx *sx, uintptr_t lock_delay_arg_init(&lda, NULL); #endif + x = SX_READ_VALUE(sx); + /* If we already hold an exclusive lock, then recurse. */ - if (sx_xlocked(sx)) { + if (__predict_false(lv_sx_owner(x) == (struct thread *)tid)) { KASSERT((sx->lock_object.lo_flags & LO_RECURSABLE) != 0, ("_sx_xlock_hard: recursed on non-recursive sx %s @ %s:%d\n", sx->lock_object.lo_name, file, line)); @@ -581,12 +583,15 @@ _sx_xlock_hard(struct sx *sx, uintptr_t #ifdef KDTRACE_HOOKS all_time -= lockstat_nsecs(&sx->lock_object); - state = sx->sx_lock; + state = x; #endif for (;;) { - if (sx->sx_lock == SX_LOCK_UNLOCKED && - atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) - break; + if (x == SX_LOCK_UNLOCKED) { + if (atomic_cmpset_acq_ptr(&sx->sx_lock, x, tid)) + break; + x = SX_READ_VALUE(sx); + continue; + } #ifdef KDTRACE_HOOKS lda.spin_cnt++; #endif @@ -601,11 +606,9 @@ _sx_xlock_hard(struct sx *sx, uintptr_t * running on another CPU, spin until the owner stops * running or the state of the lock changes. */ - x = sx->sx_lock; if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0) { if ((x & SX_LOCK_SHARED) == 0) { - x = SX_OWNER(x); - owner = (struct thread *)x; + owner = lv_sx_owner(x); if (TD_IS_RUNNING(owner)) { if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR3(KTR_LOCK, @@ -616,9 +619,12 @@ _sx_xlock_hard(struct sx *sx, uintptr_t "lockname:\"%s\"", sx->lock_object.lo_name); GIANT_SAVE(); - while (SX_OWNER(sx->sx_lock) == x && - TD_IS_RUNNING(owner)) + do { lock_delay(&lda); + x = SX_READ_VALUE(sx); + owner = lv_sx_owner(x); + } while (owner != NULL && + TD_IS_RUNNING(owner)); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -645,6 +651,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t } KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); + x = SX_READ_VALUE(sx); if (i != asx_loops) continue; } @@ -652,7 +659,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t #endif sleepq_lock(&sx->lock_object); - x = sx->sx_lock; + x = SX_READ_VALUE(sx); /* * If the lock was released while spinning on the @@ -701,6 +708,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t break; } sleepq_release(&sx->lock_object); + x = SX_READ_VALUE(sx); continue; } @@ -712,6 +720,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t if (!atomic_cmpset_ptr(&sx->sx_lock, x, x | SX_LOCK_EXCLUSIVE_WAITERS)) { sleepq_release(&sx->lock_object); + x = SX_READ_VALUE(sx); continue; } if (LOCK_LOG_TEST(&sx->lock_object, 0)) @@ -753,6 +762,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p resuming from sleep queue", __func__, sx); + x = SX_READ_VALUE(sx); } #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&sx->lock_object); @@ -872,20 +882,18 @@ _sx_slock_hard(struct sx *sx, int opts, lock_delay_arg_init(&lda, NULL); #endif #ifdef KDTRACE_HOOKS - state = sx->sx_lock; all_time -= lockstat_nsecs(&sx->lock_object); #endif + x = SX_READ_VALUE(sx); +#ifdef KDTRACE_HOOKS + state = x; +#endif /* * As with rwlocks, we don't make any attempt to try to block * shared locks once there is an exclusive waiter. */ for (;;) { -#ifdef KDTRACE_HOOKS - lda.spin_cnt++; -#endif - x = sx->sx_lock; - /* * If no other thread has an exclusive lock then try to bump up * the count of sharers. Since we have to preserve the state @@ -903,8 +911,13 @@ _sx_slock_hard(struct sx *sx, int opts, (void *)(x + SX_ONE_SHARER)); break; } + x = SX_READ_VALUE(sx); continue; } +#ifdef KDTRACE_HOOKS + lda.spin_cnt++; +#endif + #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif @@ -918,8 +931,7 @@ _sx_slock_hard(struct sx *sx, int opts, * changes. */ if ((sx->lock_object.lo_flags & SX_NOADAPTIVE) == 0) { - x = SX_OWNER(x); - owner = (struct thread *)x; + owner = lv_sx_owner(x); if (TD_IS_RUNNING(owner)) { if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR3(KTR_LOCK, @@ -929,9 +941,11 @@ _sx_slock_hard(struct sx *sx, int opts, sched_tdname(curthread), "spinning", "lockname:\"%s\"", sx->lock_object.lo_name); GIANT_SAVE(); - while (SX_OWNER(sx->sx_lock) == x && - TD_IS_RUNNING(owner)) + do { lock_delay(&lda); + x = SX_READ_VALUE(sx); + owner = lv_sx_owner(x); + } while (owner != NULL && TD_IS_RUNNING(owner)); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -944,7 +958,7 @@ _sx_slock_hard(struct sx *sx, int opts, * start the process of blocking. */ sleepq_lock(&sx->lock_object); - x = sx->sx_lock; + x = SX_READ_VALUE(sx); /* * The lock could have been released while we spun. @@ -966,6 +980,7 @@ _sx_slock_hard(struct sx *sx, int opts, owner = (struct thread *)SX_OWNER(x); if (TD_IS_RUNNING(owner)) { sleepq_release(&sx->lock_object); + x = SX_READ_VALUE(sx); continue; } } @@ -980,6 +995,7 @@ _sx_slock_hard(struct sx *sx, int opts, if (!atomic_cmpset_ptr(&sx->sx_lock, x, x | SX_LOCK_SHARED_WAITERS)) { sleepq_release(&sx->lock_object); + x = SX_READ_VALUE(sx); continue; } if (LOCK_LOG_TEST(&sx->lock_object, 0)) @@ -1020,6 +1036,7 @@ _sx_slock_hard(struct sx *sx, int opts, if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p resuming from sleep queue", __func__, sx); + x = SX_READ_VALUE(sx); } #ifdef KDTRACE_HOOKS all_time += lockstat_nsecs(&sx->lock_object); @@ -1054,9 +1071,8 @@ _sx_sunlock_hard(struct sx *sx, const ch if (SCHEDULER_STOPPED()) return; + x = SX_READ_VALUE(sx); for (;;) { - x = sx->sx_lock; - /* * We should never have sharers while at least one thread * holds a shared lock. @@ -1078,6 +1094,8 @@ _sx_sunlock_hard(struct sx *sx, const ch (void *)(x - SX_ONE_SHARER)); break; } + + x = SX_READ_VALUE(sx); continue; } @@ -1094,6 +1112,7 @@ _sx_sunlock_hard(struct sx *sx, const ch __func__, sx); break; } + x = SX_READ_VALUE(sx); continue; } @@ -1115,6 +1134,7 @@ _sx_sunlock_hard(struct sx *sx, const ch SX_SHARERS_LOCK(1) | SX_LOCK_EXCLUSIVE_WAITERS, SX_LOCK_UNLOCKED)) { sleepq_release(&sx->lock_object); + x = SX_READ_VALUE(sx); continue; } if (LOCK_LOG_TEST(&sx->lock_object, 0)) Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Wed Jan 18 17:53:57 2017 (r312389) +++ head/sys/sys/sx.h Wed Jan 18 17:55:08 2017 (r312390) @@ -88,6 +88,11 @@ #define sx_recurse lock_object.lo_data +#define SX_READ_VALUE(sx) ((sx)->sx_lock) + +#define lv_sx_owner(v) \ + ((v & SX_LOCK_SHARED) ? NULL : (struct thread *)SX_OWNER(v)) + /* * Function prototipes. Routines that start with an underscore are not part * of the public interface and are wrappered with a macro. From owner-svn-src-all@freebsd.org Wed Jan 18 17:55:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 775E3CB6127; Wed, 18 Jan 2017 17:55:50 +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 520171EDC; Wed, 18 Jan 2017 17:55:50 +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 v0IHtnHi059785; Wed, 18 Jan 2017 17:55:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IHtnNX059783; Wed, 18 Jan 2017 17:55:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701181755.v0IHtnNX059783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 18 Jan 2017 17:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312391 - in head: share/man/man5 sys/ufs/ufs 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, 18 Jan 2017 17:55:50 -0000 Author: cem Date: Wed Jan 18 17:55:49 2017 New Revision: 312391 URL: https://svnweb.freebsd.org/changeset/base/312391 Log: ufs/extattr.h: Fix documentation of ea_name termination The ea_name string is not nul-terminated. Correct the documentation. Because the subsequent field is padded to 8 bytes, and the padding is zeroed, the ea_name string will appear to be nul-terminated whenever the length isn't exactly one (mod eight). This was introduced in r167010 (2007). Additionally, mark the length fields as unsigned. This particularly matters for the single byte ea_namelength field, which can represent extended attribute names up to 255 bytes long. No functional change. PR: 216127 Reported by: dewayne at heuristicsystems.com.au Reviewed by: kib@ Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9206 Modified: head/share/man/man5/fs.5 head/sys/ufs/ufs/extattr.h Modified: head/share/man/man5/fs.5 ============================================================================== --- head/share/man/man5/fs.5 Wed Jan 18 17:55:08 2017 (r312390) +++ head/share/man/man5/fs.5 Wed Jan 18 17:55:49 2017 (r312391) @@ -28,7 +28,7 @@ .\" @(#)fs.5 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 23, 2016 +.Dd January 16, 2017 .Dt FS 5 .Os .Sh NAME @@ -388,18 +388,19 @@ For further information, see the include The format of an external attribute is defined by the extattr structure: .Bd -literal struct extattr { - int32_t ea_length; /* length of this attribute */ - int8_t ea_namespace; /* name space of this attribute */ - int8_t ea_contentpadlen; /* padding at end of attribute */ - int8_t ea_namelength; /* length of attribute name */ - char ea_name[1]; /* null-terminated attribute name */ + uint32_t ea_length; /* length of this attribute */ + uint8_t ea_namespace; /* name space of this attribute */ + uint8_t ea_contentpadlen; /* bytes of padding at end of attribute */ + uint8_t ea_namelength; /* length of attribute name */ + char ea_name[1]; /* attribute name (NOT nul-terminated) */ + /* padding, if any, to align attribute content to 8 byte boundary */ /* extended attribute content follows */ }; .Ed .Pp Several macros are defined to manipulate these structures. Each macro takes a pointer to an extattr structure. -.Bl -tag -width ".Dv EXTATTR_SET_LENGTHS(eap, size)" +.Bl -tag -width ".Dv EXTATTR_CONTENT_SIZE(eap)" .It Dv EXTATTR_NEXT(eap) Returns a pointer to the next extended attribute following .Fa eap . @@ -409,35 +410,19 @@ Returns a pointer to the extended attrib .It Dv EXTATTR_CONTENT_SIZE(eap) Returns the size of the extended attribute content referenced by .Fa eap . -.It Dv EXTATTR_SET_LENGTHS(eap, size) -Called with the size of the attribute content after initializing -the attribute name to calculate and set the -.Fa ea_length , -.Fa ea_namelength , -and -.Fa ea_contentpadlen -fields of the extended attribute structure. .El .Pp The following code identifies an ACL: .Bd -literal if (eap->ea_namespace == EXTATTR_NAMESPACE_SYSTEM && - !strcmp(eap->ea_name, POSIX1E_ACL_ACCESS_EXTATTR_NAME) { + eap->ea_namelength == sizeof(POSIX1E_ACL_ACCESS_EXTATTR_NAME) - 1 && + strncmp(eap->ea_name, POSIX1E_ACL_ACCESS_EXTATTR_NAME, + sizeof(POSIX1E_ACL_ACCESS_EXTATTR_NAME) - 1) == 0) { aclp = EXTATTR_CONTENT(eap); acllen = EXTATTR_CONTENT_SIZE(eap); ... } .Ed -.Pp -The following code creates an extended attribute -containing a copy of a structure -.Fa mygif : -.Bd -literal - eap->ea_namespace = EXTATTR_NAMESPACE_USER; - strcpy(eap->ea_name, "filepic.gif"); - EXTATTR_SET_LENGTHS(eap, sizeof(struct mygif)); - memcpy(EXTATTR_CONTENT(eap), &mygif, sizeof(struct mygif)); -.Ed .Sh HISTORY A super-block structure named filsys appeared in .At v6 . Modified: head/sys/ufs/ufs/extattr.h ============================================================================== --- head/sys/ufs/ufs/extattr.h Wed Jan 18 17:55:08 2017 (r312390) +++ head/sys/ufs/ufs/extattr.h Wed Jan 18 17:55:49 2017 (r312391) @@ -73,11 +73,12 @@ struct ufs_extattr_header { * This structure defines the required fields of an extended-attribute header. */ struct extattr { - int32_t ea_length; /* length of this attribute */ - int8_t ea_namespace; /* name space of this attribute */ - int8_t ea_contentpadlen; /* bytes of padding at end of attribute */ - int8_t ea_namelength; /* length of attribute name */ - char ea_name[1]; /* null-terminated attribute name */ + uint32_t ea_length; /* length of this attribute */ + uint8_t ea_namespace; /* name space of this attribute */ + uint8_t ea_contentpadlen; /* bytes of padding at end of attribute */ + uint8_t ea_namelength; /* length of attribute name */ + char ea_name[1]; /* attribute name (NOT nul-terminated) */ + /* padding, if any, to align attribute content to 8 byte boundary */ /* extended attribute content follows */ }; @@ -90,9 +91,6 @@ struct extattr { * content referenced by eap. * EXTATTR_CONTENT_SIZE(eap) returns the size of the extended attribute * content referenced by eap. - * EXTATTR_SET_LENGTHS(eap, contentsize) called after initializing the - * attribute name to calculate and set the ea_length, ea_namelength, - * and ea_contentpadlen fields of the extended attribute structure. */ #define EXTATTR_NEXT(eap) \ ((struct extattr *)(((void *)(eap)) + (eap)->ea_length)) @@ -101,15 +99,6 @@ struct extattr { ((eap)->ea_length - EXTATTR_BASE_LENGTH(eap) - (eap)->ea_contentpadlen) #define EXTATTR_BASE_LENGTH(eap) \ ((sizeof(struct extattr) + (eap)->ea_namelength + 7) & ~7) -#define EXTATTR_SET_LENGTHS(eap, contentsize) do { \ - KASSERT(((eap)->ea_name[0] != 0), \ - ("Must initialize name before setting lengths")); \ - (eap)->ea_namelength = strlen((eap)->ea_name); \ - (eap)->ea_contentpadlen = ((contentsize) % 8) ? \ - 8 - ((contentsize) % 8) : 0; \ - (eap)->ea_length = EXTATTR_BASE_LENGTH(eap) + \ - (contentsize) + (eap)->ea_contentpadlen; \ -} while (0) #ifdef _KERNEL @@ -149,13 +138,6 @@ int ufs_deleteextattr(struct vop_deletee int ufs_setextattr(struct vop_setextattr_args *ap); void ufs_extattr_vnode_inactive(struct vnode *vp, struct thread *td); -#else - -/* User-level definition of KASSERT for macros above */ -#define KASSERT(cond, str) do { \ - if (!(cond)) { printf("panic: "); printf(str); printf("\n"); exit(1); }\ -} while (0) - #endif /* !_KERNEL */ #endif /* !_UFS_UFS_EXTATTR_H_ */ From owner-svn-src-all@freebsd.org Wed Jan 18 18:04:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE4EECB65EF; Wed, 18 Jan 2017 18:04:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 744F0184B; Wed, 18 Jan 2017 18:04:42 +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 C12361FE025; Wed, 18 Jan 2017 19:04:22 +0100 (CET) Subject: Re: svn commit: r312379 - in head: lib/libc/sys sbin/ifconfig sys/conf sys/kern sys/modules/if_lagg sys/modules/if_vlan sys/net sys/netinet sys/netinet6 sys/sys To: Gleb Smirnoff References: <201701181331.v0IDVHWf048428@repo.freebsd.org> <20170118173132.GD2611@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Meny Yossefi , Navdeep Parhar From: Hans Petter Selasky Message-ID: Date: Wed, 18 Jan 2017 19:04:05 +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: <20170118173132.GD2611@FreeBSD.org> 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: Wed, 18 Jan 2017 18:04:42 -0000 On 01/18/17 18:31, Gleb Smirnoff wrote: > there were no production testing of the feature, > that will prove that the idea actually works. Hi Gleb, This feature has been tested small scale in production environments and it for sure saves CPU versus doing rate limiting all in software. Mellanox plans to checkin support for the mlx5en driver which starts using this feature soon and I believe np@ has similar plans for cxgbe. I'll reply to your other questions tomorrow. --HPS From owner-svn-src-all@freebsd.org Wed Jan 18 18:14:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B919ECB6CE0; Wed, 18 Jan 2017 18:14:08 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) (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 6FEAC11D3; Wed, 18 Jan 2017 18:14:08 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f53.google.com with SMTP id c85so255680008wmi.1; Wed, 18 Jan 2017 10:14:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=Lx0CFUzqvsRlgCJQ3MJ5zjceL5ucYw//KzjDFvoM8xI=; b=UHf6oA5jpkmC0Wr+LQz454W/tLs5B8iSNZm5aUtz4MKRQ5sKXGzl1SYjxO7tVoGQkn eRH7hDjsrULx13qDy97lVog9uJRf2iaLnpZYCjYwXQcx/o7ZTbiYFHLFFd6QAFIWlT0V /yoaZSKeS6sbS8uswp2ltvBPBb4G6IGm4l7t3NK9/smgcMBeyusDy1iVNGEuNLk3uUMw 5+QAWwFJL8eLzjL5qHZS/uplCipXEGlDnTJZ/i6zba4GNajThq1I/3tKR0NxfjbvEe7q Hi4ngZr4RTaeCaVTL+s5cNGjnmdTIYvc6Lm+EQDpJkvBeI+KmpHgo74S0Vr8ui4lxvTm L0sg== X-Gm-Message-State: AIkVDXIyiTrw6GRjoRK9mDImciVh1Vnt8Ga8qXJ9NCC9aqonyMut2ospZFnsi1ZPmPP/eA== X-Received: by 10.223.136.85 with SMTP id e21mr3907999wre.28.1484763240869; Wed, 18 Jan 2017 10:14:00 -0800 (PST) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com. [74.125.82.41]) by smtp.gmail.com with ESMTPSA id y97sm6458758wmh.24.2017.01.18.10.14.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jan 2017 10:14:00 -0800 (PST) Received: by mail-wm0-f41.google.com with SMTP id r144so38438579wme.1; Wed, 18 Jan 2017 10:14:00 -0800 (PST) X-Received: by 10.28.100.70 with SMTP id y67mr20659156wmb.45.1484763240630; Wed, 18 Jan 2017 10:14:00 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.29.72 with HTTP; Wed, 18 Jan 2017 10:14:00 -0800 (PST) In-Reply-To: <201701181755.v0IHtnNX059783@repo.freebsd.org> References: <201701181755.v0IHtnNX059783@repo.freebsd.org> From: Conrad Meyer Date: Wed, 18 Jan 2017 10:14:00 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r312391 - in head: share/man/man5 sys/ufs/ufs To: svn-src-head@freebsd.org Cc: src-committers , svn-src-all@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: Wed, 18 Jan 2017 18:14:08 -0000 On Wed, Jan 18, 2017 at 9:55 AM, Conrad E. Meyer wrote: > Author: cem > Date: Wed Jan 18 17:55:49 2017 > New Revision: 312391 > URL: https://svnweb.freebsd.org/changeset/base/312391 > > Log: > ufs/extattr.h: Fix documentation of ea_name termination > > The ea_name string is not nul-terminated. Correct the documentation. > > Because the subsequent field is padded to 8 bytes, and the padding is > zeroed, the ea_name string will appear to be nul-terminated whenever th= e > length isn't exactly one (mod eight). > > This was introduced in r167010 (2007). > > Additionally, mark the length fields as unsigned. This particularly > matters for the single byte ea_namelength field, which can represent > extended attribute names up to 255 bytes long. > > No functional change. Whoops =E2=80=94 very minor functional change =E2=80=94 restore(8) can now = handle some dumps with extended attribute names longer than 127 characters that it couldn't before, due to the unsigned type change called out above. Best, Conrad From owner-svn-src-all@freebsd.org Wed Jan 18 18:14:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF4CACB6D6A; Wed, 18 Jan 2017 18:14: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 AC4BA13BD; Wed, 18 Jan 2017 18:14: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 v0IIEoXx067792; Wed, 18 Jan 2017 18:14:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IIEoHr067791; Wed, 18 Jan 2017 18:14:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701181814.v0IIEoHr067791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 18 Jan 2017 18:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312392 - head/lib/libwrap 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, 18 Jan 2017 18:14:52 -0000 Author: ngie Date: Wed Jan 18 18:14:50 2017 New Revision: 312392 URL: https://svnweb.freebsd.org/changeset/base/312392 Log: Use SRCTOP instead of .CURDIR-relative path in .PATH directive MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libwrap/Makefile Modified: head/lib/libwrap/Makefile ============================================================================== --- head/lib/libwrap/Makefile Wed Jan 18 17:55:49 2017 (r312391) +++ head/lib/libwrap/Makefile Wed Jan 18 18:14:50 2017 (r312392) @@ -15,7 +15,7 @@ MLINKS= hosts_access.3 hosts_ctl.3 \ hosts_access.3 request_set.3 \ hosts_options.5 hosts.allow.5 -.PATH: ${.CURDIR}/../../contrib/tcp_wrappers +.PATH: ${SRCTOP}/contrib/tcp_wrappers CFLAGS+=-DFACILITY=LOG_AUTH -DHOSTS_ACCESS -DNETGROUP -DDAEMON_UMASK=022 \ -DREAL_DAEMON_DIR=\"${LIBEXECDIR}\" -DPROCESS_OPTIONS \ From owner-svn-src-all@freebsd.org Wed Jan 18 18:16:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69A52CB6E4B; Wed, 18 Jan 2017 18:16:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 512DD15EB; Wed, 18 Jan 2017 18:16:50 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v0IIGnYE059081 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 18 Jan 2017 10:16:49 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v0IIGnrb059080; Wed, 18 Jan 2017 10:16:49 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 18 Jan 2017 10:16:49 -0800 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Meny Yossefi , Navdeep Parhar Subject: Re: svn commit: r312379 - in head: lib/libc/sys sbin/ifconfig sys/conf sys/kern sys/modules/if_lagg sys/modules/if_vlan sys/net sys/netinet sys/netinet6 sys/sys Message-ID: <20170118181649.GE2611@FreeBSD.org> References: <201701181331.v0IDVHWf048428@repo.freebsd.org> <20170118173132.GD2611@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 18 Jan 2017 18:16:51 -0000 On Wed, Jan 18, 2017 at 07:04:05PM +0100, Hans Petter Selasky wrote: H> > there were no production testing of the feature, H> > that will prove that the idea actually works. H> H> Hi Gleb, H> H> This feature has been tested small scale in production environments and H> it for sure saves CPU versus doing rate limiting all in software. H> H> Mellanox plans to checkin support for the mlx5en driver which starts H> using this feature soon and I believe np@ has similar plans for cxgbe. H> H> I'll reply to your other questions tomorrow. The pacing in general (either software or hardware) haven't yet been used in production anywhere, to my knowledge. So, let's decide is FreeBSD an academical experimental OS, where we throw bare fresh ideas in, or is it a mature production ready OS, which we recommend to install to end users, who aren't hackers theirselves? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Wed Jan 18 18:16:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECEF1CB6EBC; Wed, 18 Jan 2017 18:16:58 +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 C50711640; Wed, 18 Jan 2017 18:16:58 +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 v0IIGvVF067927; Wed, 18 Jan 2017 18:16:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IIGvfW067921; Wed, 18 Jan 2017 18:16:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701181816.v0IIGvfW067921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 18 Jan 2017 18:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312393 - in head: sbin/restore sys/sys sys/ufs/ufs 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, 18 Jan 2017 18:16:59 -0000 Author: cem Date: Wed Jan 18 18:16:57 2017 New Revision: 312393 URL: https://svnweb.freebsd.org/changeset/base/312393 Log: restore(8): Handle extended attribute names correctly UFS2 extended attribute names are not NUL-terminated. Handle appropriately. Correct the EXTATTR_BASE_LENGTH() macro, which handled ea_namelength == one (mod eight) extended attributes incorrectly. PR: 216127 Reported by: dewayne at heuristicsystems.com.au Reviewed by: kib@ Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9208 Modified: head/sbin/restore/dirs.c head/sbin/restore/extern.h head/sbin/restore/tape.c head/sys/sys/extattr.h head/sys/ufs/ufs/extattr.h Modified: head/sbin/restore/dirs.c ============================================================================== --- head/sbin/restore/dirs.c Wed Jan 18 18:14:50 2017 (r312392) +++ head/sbin/restore/dirs.c Wed Jan 18 18:16:57 2017 (r312393) @@ -645,7 +645,7 @@ setdirmodes(int flags) if (!Nflag) { if (node.extsize > 0) { if (bufsize >= node.extsize) { - set_extattr_file(cp, buf, node.extsize); + set_extattr(-1, cp, buf, node.extsize, SXA_FILE); } else { fprintf(stderr, "Cannot restore %s%s\n", "extended attributes for ", cp); Modified: head/sbin/restore/extern.h ============================================================================== --- head/sbin/restore/extern.h Wed Jan 18 18:14:50 2017 (r312392) +++ head/sbin/restore/extern.h Wed Jan 18 18:16:57 2017 (r312393) @@ -87,7 +87,12 @@ struct direct *rst_readdir(RST_DIR *); void rst_closedir(void *); void runcmdshell(void); char *savename(char *); -void set_extattr_file(char *, void *, int); +enum set_extattr_mode { + SXA_FILE, + SXA_LINK, + SXA_FD, +}; +void set_extattr(int, char *, void *, int, enum set_extattr_mode); void setdirmodes(int); void setinput(char *, int); void setup(void); Modified: head/sbin/restore/tape.c ============================================================================== --- head/sbin/restore/tape.c Wed Jan 18 18:14:50 2017 (r312392) +++ head/sbin/restore/tape.c Wed Jan 18 18:16:57 2017 (r312393) @@ -105,8 +105,6 @@ static void findinode(struct s_spcl *); static void findtapeblksize(void); static char *setupextattr(int); static void xtrattr(char *, size_t); -static void set_extattr_link(char *, void *, int); -static void set_extattr_fd(int, char *, void *, int); static void skiphole(void (*)(char *, size_t), size_t *); static int gethead(struct s_spcl *); static void readtape(char *); @@ -627,7 +625,7 @@ extractfile(char *name) } if (linkit(lnkbuf, name, SYMLINK) == GOOD) { if (extsize > 0) - set_extattr_link(name, buf, extsize); + set_extattr(-1, name, buf, extsize, SXA_LINK); (void) lchown(name, uid, gid); (void) lchmod(name, mode); (void) utimensat(AT_FDCWD, name, ctimep, @@ -658,7 +656,7 @@ extractfile(char *name) } else { buf = setupextattr(extsize); getfile(xtrnull, xtrattr, xtrnull); - set_extattr_file(name, buf, extsize); + set_extattr(-1, name, buf, extsize, SXA_FILE); } (void) chown(name, uid, gid); (void) chmod(name, mode); @@ -688,7 +686,7 @@ extractfile(char *name) } else { buf = setupextattr(extsize); getfile(xtrnull, xtrattr, xtrnull); - set_extattr_file(name, buf, extsize); + set_extattr(-1, name, buf, extsize, SXA_FILE); } (void) chown(name, uid, gid); (void) chmod(name, mode); @@ -715,7 +713,7 @@ extractfile(char *name) buf = setupextattr(extsize); getfile(xtrfile, xtrattr, xtrskip); if (extsize > 0) - set_extattr_fd(ofile, name, buf, extsize); + set_extattr(ofile, name, buf, extsize, SXA_FD); (void) fchown(ofile, uid, gid); (void) fchmod(ofile, mode); (void) futimens(ofile, ctimep); @@ -728,12 +726,16 @@ extractfile(char *name) } /* - * Set attributes for a file. + * Set attributes on a file descriptor, link, or file. */ void -set_extattr_file(char *name, void *buf, int size) +set_extattr(int fd, char *name, void *buf, int size, enum set_extattr_mode mode) { struct extattr *eap, *eaend; + const char *method; + ssize_t res; + int error; + char eaname[EXTATTR_MAXNAMELEN + 1]; vprintf(stdout, "Set attributes for %s:", name); eaend = buf + size; @@ -748,77 +750,34 @@ set_extattr_file(char *name, void *buf, } if (eap->ea_namespace == EXTATTR_NAMESPACE_EMPTY) continue; - vprintf(stdout, "\n\t%s, (%d bytes), %*s", + snprintf(eaname, sizeof(eaname), "%.*s", + (int)eap->ea_namelength, eap->ea_name); + vprintf(stdout, "\n\t%s, (%d bytes), %s", namespace_names[eap->ea_namespace], eap->ea_length, - eap->ea_namelength, eap->ea_name); + eaname); /* * First we try the general attribute setting interface. * However, some attributes can only be set by root or * by using special interfaces (for example, ACLs). */ - if (extattr_set_file(name, eap->ea_namespace, eap->ea_name, - EXTATTR_CONTENT(eap), EXTATTR_CONTENT_SIZE(eap)) != -1) { - dprintf(stdout, " (set using extattr_set_file)"); - continue; - } - /* - * If the general interface refuses to set the attribute, - * then we try all the specialized interfaces that we - * know about. - */ - if (eap->ea_namespace == EXTATTR_NAMESPACE_SYSTEM && - !strcmp(eap->ea_name, POSIX1E_ACL_ACCESS_EXTATTR_NAME)) { - if (acl_set_file(name, ACL_TYPE_ACCESS, - EXTATTR_CONTENT(eap)) != -1) { - dprintf(stdout, " (set using acl_set_file)"); - continue; - } - } - if (eap->ea_namespace == EXTATTR_NAMESPACE_SYSTEM && - !strcmp(eap->ea_name, POSIX1E_ACL_DEFAULT_EXTATTR_NAME)) { - if (acl_set_file(name, ACL_TYPE_DEFAULT, - EXTATTR_CONTENT(eap)) != -1) { - dprintf(stdout, " (set using acl_set_file)"); - continue; - } - } - vprintf(stdout, " (unable to set)"); - } - vprintf(stdout, "\n"); -} - -/* - * Set attributes for a symbolic link. - */ -static void -set_extattr_link(char *name, void *buf, int size) -{ - struct extattr *eap, *eaend; - - vprintf(stdout, "Set attributes for %s:", name); - eaend = buf + size; - for (eap = buf; eap < eaend; eap = EXTATTR_NEXT(eap)) { - /* - * Make sure this entry is complete. - */ - if (EXTATTR_NEXT(eap) > eaend || eap->ea_length <= 0) { - dprintf(stdout, "\n\t%scorrupted", - eap == buf ? "" : "remainder "); - break; + if (mode == SXA_FD) { + res = extattr_set_fd(fd, eap->ea_namespace, + eaname, EXTATTR_CONTENT(eap), + EXTATTR_CONTENT_SIZE(eap)); + method = "extattr_set_fd"; + } else if (mode == SXA_LINK) { + res = extattr_set_link(name, eap->ea_namespace, + eaname, EXTATTR_CONTENT(eap), + EXTATTR_CONTENT_SIZE(eap)); + method = "extattr_set_link"; + } else if (mode == SXA_FILE) { + res = extattr_set_file(name, eap->ea_namespace, + eaname, EXTATTR_CONTENT(eap), + EXTATTR_CONTENT_SIZE(eap)); + method = "extattr_set_file"; } - if (eap->ea_namespace == EXTATTR_NAMESPACE_EMPTY) - continue; - vprintf(stdout, "\n\t%s, (%d bytes), %*s", - namespace_names[eap->ea_namespace], eap->ea_length, - eap->ea_namelength, eap->ea_name); - /* - * First we try the general attribute setting interface. - * However, some attributes can only be set by root or - * by using special interfaces (for example, ACLs). - */ - if (extattr_set_link(name, eap->ea_namespace, eap->ea_name, - EXTATTR_CONTENT(eap), EXTATTR_CONTENT_SIZE(eap)) != -1) { - dprintf(stdout, " (set using extattr_set_link)"); + if (res != -1) { + dprintf(stdout, " (set using %s)", method); continue; } /* @@ -827,77 +786,37 @@ set_extattr_link(char *name, void *buf, * know about. */ if (eap->ea_namespace == EXTATTR_NAMESPACE_SYSTEM && - !strcmp(eap->ea_name, POSIX1E_ACL_ACCESS_EXTATTR_NAME)) { - if (acl_set_link_np(name, ACL_TYPE_ACCESS, - EXTATTR_CONTENT(eap)) != -1) { - dprintf(stdout, " (set using acl_set_link_np)"); - continue; + strcmp(eaname, POSIX1E_ACL_ACCESS_EXTATTR_NAME) == 0) { + if (mode == SXA_FD) { + error = acl_set_fd(fd, EXTATTR_CONTENT(eap)); + method = "acl_set_fd"; + } else if (mode == SXA_LINK) { + error = acl_set_link_np(name, ACL_TYPE_ACCESS, + EXTATTR_CONTENT(eap)); + method = "acl_set_link_np"; + } else if (mode == SXA_FILE) { + error = acl_set_file(name, ACL_TYPE_ACCESS, + EXTATTR_CONTENT(eap)); + method = "acl_set_file"; } - } - if (eap->ea_namespace == EXTATTR_NAMESPACE_SYSTEM && - !strcmp(eap->ea_name, POSIX1E_ACL_DEFAULT_EXTATTR_NAME)) { - if (acl_set_link_np(name, ACL_TYPE_DEFAULT, - EXTATTR_CONTENT(eap)) != -1) { - dprintf(stdout, " (set using acl_set_link_np)"); + if (error != -1) { + dprintf(stdout, " (set using %s)", method); continue; } } - vprintf(stdout, " (unable to set)"); - } - vprintf(stdout, "\n"); -} - -/* - * Set attributes on a file descriptor. - */ -static void -set_extattr_fd(int fd, char *name, void *buf, int size) -{ - struct extattr *eap, *eaend; - - vprintf(stdout, "Set attributes for %s:", name); - eaend = buf + size; - for (eap = buf; eap < eaend; eap = EXTATTR_NEXT(eap)) { - /* - * Make sure this entry is complete. - */ - if (EXTATTR_NEXT(eap) > eaend || eap->ea_length <= 0) { - dprintf(stdout, "\n\t%scorrupted", - eap == buf ? "" : "remainder "); - break; - } - if (eap->ea_namespace == EXTATTR_NAMESPACE_EMPTY) - continue; - vprintf(stdout, "\n\t%s, (%d bytes), %*s", - namespace_names[eap->ea_namespace], eap->ea_length, - eap->ea_namelength, eap->ea_name); - /* - * First we try the general attribute setting interface. - * However, some attributes can only be set by root or - * by using special interfaces (for example, ACLs). - */ - if (extattr_set_fd(fd, eap->ea_namespace, eap->ea_name, - EXTATTR_CONTENT(eap), EXTATTR_CONTENT_SIZE(eap)) != -1) { - dprintf(stdout, " (set using extattr_set_fd)"); - continue; - } - /* - * If the general interface refuses to set the attribute, - * then we try all the specialized interfaces that we - * know about. - */ if (eap->ea_namespace == EXTATTR_NAMESPACE_SYSTEM && - !strcmp(eap->ea_name, POSIX1E_ACL_ACCESS_EXTATTR_NAME)) { - if (acl_set_fd(fd, EXTATTR_CONTENT(eap)) != -1) { - dprintf(stdout, " (set using acl_set_fd)"); - continue; + strcmp(eaname, POSIX1E_ACL_DEFAULT_EXTATTR_NAME) == 0) { + if (mode == SXA_LINK) { + error = acl_set_link_np(name, ACL_TYPE_DEFAULT, + EXTATTR_CONTENT(eap)); + method = "acl_set_link_np"; + } else { + error = acl_set_file(name, ACL_TYPE_DEFAULT, + EXTATTR_CONTENT(eap)); + method = "acl_set_file"; } - } - if (eap->ea_namespace == EXTATTR_NAMESPACE_SYSTEM && - !strcmp(eap->ea_name, POSIX1E_ACL_DEFAULT_EXTATTR_NAME)) { - if (acl_set_file(name, ACL_TYPE_DEFAULT, - EXTATTR_CONTENT(eap)) != -1) { - dprintf(stdout, " (set using acl_set_file)"); + if (error != -1) { + dprintf(stdout, " (set using %s)", method); continue; } } Modified: head/sys/sys/extattr.h ============================================================================== --- head/sys/sys/extattr.h Wed Jan 18 18:14:50 2017 (r312392) +++ head/sys/sys/extattr.h Wed Jan 18 18:16:57 2017 (r312393) @@ -57,10 +57,11 @@ EXTATTR_NAMESPACE_USER_STRING, \ EXTATTR_NAMESPACE_SYSTEM_STRING } +#define EXTATTR_MAXNAMELEN NAME_MAX + #ifdef _KERNEL #include -#define EXTATTR_MAXNAMELEN NAME_MAX struct thread; struct ucred; struct vnode; Modified: head/sys/ufs/ufs/extattr.h ============================================================================== --- head/sys/ufs/ufs/extattr.h Wed Jan 18 18:14:50 2017 (r312392) +++ head/sys/ufs/ufs/extattr.h Wed Jan 18 18:16:57 2017 (r312393) @@ -93,12 +93,14 @@ struct extattr { * content referenced by eap. */ #define EXTATTR_NEXT(eap) \ - ((struct extattr *)(((void *)(eap)) + (eap)->ea_length)) -#define EXTATTR_CONTENT(eap) (((void *)(eap)) + EXTATTR_BASE_LENGTH(eap)) + ((struct extattr *)(((u_char *)(eap)) + (eap)->ea_length)) +#define EXTATTR_CONTENT(eap) \ + (void *)(((u_char *)(eap)) + EXTATTR_BASE_LENGTH(eap)) #define EXTATTR_CONTENT_SIZE(eap) \ ((eap)->ea_length - EXTATTR_BASE_LENGTH(eap) - (eap)->ea_contentpadlen) +/* -1 below compensates for ea_name[1] */ #define EXTATTR_BASE_LENGTH(eap) \ - ((sizeof(struct extattr) + (eap)->ea_namelength + 7) & ~7) + roundup2((sizeof(struct extattr) - 1 + (eap)->ea_namelength), 8) #ifdef _KERNEL From owner-svn-src-all@freebsd.org Wed Jan 18 18:30:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6A89CB55CB; Wed, 18 Jan 2017 18:30:55 +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 B5EF81191; Wed, 18 Jan 2017 18:30:55 +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 20F3710A7DB; Wed, 18 Jan 2017 13:30:54 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312387 - head/sys/sys Date: Wed, 18 Jan 2017 10:27:09 -0800 Message-ID: <2007305.gnFnN0nUgT@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201701181709.v0IH9M5M038972@repo.freebsd.org> References: <201701181709.v0IH9M5M038972@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 18 Jan 2017 13:30:54 -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: Wed, 18 Jan 2017 18:30:55 -0000 On Wednesday, January 18, 2017 05:09:22 PM Gleb Smirnoff wrote: > Author: glebius > Date: Wed Jan 18 17:09:22 2017 > New Revision: 312387 > URL: https://svnweb.freebsd.org/changeset/base/312387 > > Log: > Fix regression from r311568: collision of MSG_NOSIGNAL with MSG_MORETOCOME > lead to delayed send of data sent with sendto(MSG_NOSIGNAL). > > Submitted by: rrs Ouch, thanks for fixing. Hopefully this fixes the freerdp report. :( -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jan 18 19:38:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF551CB6F6C; Wed, 18 Jan 2017 19: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 8FF281BDD; Wed, 18 Jan 2017 19:38: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 v0IJcsaU001275; Wed, 18 Jan 2017 19:38:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IJcs4f001268; Wed, 18 Jan 2017 19:38:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701181938.v0IJcs4f001268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Jan 2017 19:38:54 +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: r312394 - in stable/11/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 mips/mips powerpc/powerpc sparc64/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: Wed, 18 Jan 2017 19:38:55 -0000 Author: jhb Date: Wed Jan 18 19:38:53 2017 New Revision: 312394 URL: https://svnweb.freebsd.org/changeset/base/312394 Log: MFC 307332,312086: Drop support for using mmap() with /dev/kmem. 307332: Drop support for using mmap() with /dev/kmem. Using the device pager with /dev/kmem is not stable since KVA mappings are transient, but the device pager caches the PA associated with a given offset forever. Interestingly, mips' implementation of memmap() already refused requests for /dev/kmem. Note that kvm_read/kvm_write do not use mmap, but use read and write on /dev/kmem, so this should not affect libkvm users. 312086: Trim a few comments on platforms that did not implement mmap of /dev/kmem. After r307332, no platforms implement mmap for /dev/kmem, so the lack of it for these platforms is no longer unique. Modified: stable/11/sys/amd64/amd64/mem.c stable/11/sys/arm/arm/mem.c stable/11/sys/arm64/arm64/mem.c stable/11/sys/i386/i386/mem.c stable/11/sys/mips/mips/mem.c stable/11/sys/powerpc/powerpc/mem.c stable/11/sys/sparc64/sparc64/mem.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/mem.c ============================================================================== --- stable/11/sys/amd64/amd64/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/amd64/amd64/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -172,10 +172,9 @@ memmmap(struct cdev *dev, vm_ooffset_t o if (offset > cpu_getmaxphyaddr()) return (-1); *paddr = offset; - } else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } /* Modified: stable/11/sys/arm/arm/mem.c ============================================================================== --- stable/11/sys/arm/arm/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/arm/arm/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -161,10 +161,9 @@ 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) { *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } Modified: stable/11/sys/arm64/arm64/mem.c ============================================================================== --- stable/11/sys/arm64/arm64/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/arm64/arm64/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -123,10 +123,9 @@ 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) { *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } Modified: stable/11/sys/i386/i386/mem.c ============================================================================== --- stable/11/sys/i386/i386/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/i386/i386/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -168,10 +168,9 @@ memmmap(struct cdev *dev, vm_ooffset_t o if (offset > cpu_getmaxphyaddr()) return (-1); *paddr = offset; - } else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); - /* else panic! */ - return (0); + return (0); + } + return (-1); } /* Modified: stable/11/sys/mips/mips/mem.c ============================================================================== --- stable/11/sys/mips/mips/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/mips/mips/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -151,12 +151,6 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot, vm_memattr_t *memattr) { - /* - * /dev/mem is the only one that makes sense through this - * interface. For /dev/kmem any physaddr we return here - * could be transient and hence incorrect or invalid at - * a later time. - */ if (dev2unit(dev) != CDEV_MINOR_MEM) return (-1); Modified: stable/11/sys/powerpc/powerpc/mem.c ============================================================================== --- stable/11/sys/powerpc/powerpc/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/powerpc/powerpc/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -179,8 +179,6 @@ memmmap(struct cdev *dev, vm_ooffset_t o if (dev2unit(dev) == CDEV_MINOR_MEM) *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) - *paddr = vtophys(offset); else return (EFAULT); Modified: stable/11/sys/sparc64/sparc64/mem.c ============================================================================== --- stable/11/sys/sparc64/sparc64/mem.c Wed Jan 18 18:16:57 2017 (r312393) +++ stable/11/sys/sparc64/sparc64/mem.c Wed Jan 18 19:38:53 2017 (r312394) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); /* * Memory special file * - * NOTE: other architectures support mmap()'ing the mem and kmem devices; this + * NOTE: other architectures support mmap()'ing the mem device; this * might cause illegal aliases to be created for the locked kernel page(s), so * it is not implemented. */ From owner-svn-src-all@freebsd.org Wed Jan 18 19:44:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FFFACB6245; Wed, 18 Jan 2017 19:44:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 9870810FC; Wed, 18 Jan 2017 19:44:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id c85so259035264wmi.1; Wed, 18 Jan 2017 11:44:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6PrXeFcOFbIe7qBuLc+IhbTM3Z0bLoybpDT3F9cKm5s=; b=ZQJxZDqKWIrVM3gcpU1MsAJzVp0JKNAKb+NqC6dmh/LzzTkvCmvUWk1mXgQbfsht38 icg2e/wBeL/mu1z753Q22zbtL3ZY76iUQoXqlQ7S8szzAQTry/56mYghL1i1gN6Kcxbl rcHbap4sVPv++XP9n0MqCcFoN83LBA9mD/+2fqKoTEYChqH+GLC/peGKZte5BAmJVN1J 1H0JsLfnkeAic2uOMzq0DN19zKhjTxz6eZcrKy0yyaLrFuRhOUPXMdNSfo1RQpfT36dV LUuE61o+GKWAWAVkYyJ87M8nqpQa10lwDSLlVonZz57nZHvmTKCTtkBAk9YqX2mNeYQl H0ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6PrXeFcOFbIe7qBuLc+IhbTM3Z0bLoybpDT3F9cKm5s=; b=emEEMVAPZI7wYiI06HwEnjvu0owItypi4/yTyv3yKRJd9OYvpVK4RqPryWmdJ4iuQ+ 7CZgt3Kig4El3P7DcVOC99FA1Us7ys8clD8MfHx73KG05cyBdOd9NiYxmUr/WKaoT8Lp tCXIr9hclxi4YrTgY3/eNW0PtAbFgZPYk6f4BSqoz6VB5nuxu5Wkv3cz7j/SpMy2+Zud jgahAH1ubWGf1Zf5F59uejRN5s6EMoervblHTdvmjTLczgE9jEHU5GlYj6jFEfVUH0Fc SbtHyKJvEJqniacJINC34SzAPpB2KCA9SofoN+u5tGW6kQV8YqUd5vZKLUHnexP/nuDl IG/A== X-Gm-Message-State: AIkVDXK5+lPhK8Rei7MgErX02jKnI3eMg+FNrP9+/q6/CJ6YcJa1wBfVv9bo8D7GVQ49U/8A2Q8qQJmooW1IVw== X-Received: by 10.223.169.112 with SMTP id u103mr4208454wrc.166.1484768682255; Wed, 18 Jan 2017 11:44:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.82.162 with HTTP; Wed, 18 Jan 2017 11:44:40 -0800 (PST) In-Reply-To: <20170118181649.GE2611@FreeBSD.org> References: <201701181331.v0IDVHWf048428@repo.freebsd.org> <20170118173132.GD2611@FreeBSD.org> <20170118181649.GE2611@FreeBSD.org> From: Adrian Chadd Date: Wed, 18 Jan 2017 11:44:40 -0800 Message-ID: Subject: Re: svn commit: r312379 - in head: lib/libc/sys sbin/ifconfig sys/conf sys/kern sys/modules/if_lagg sys/modules/if_vlan sys/net sys/netinet sys/netinet6 sys/sys To: Gleb Smirnoff Cc: Hans Petter Selasky , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Meny Yossefi , Navdeep Parhar 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: Wed, 18 Jan 2017 19:44:45 -0000 It depends, is this -HEAD or is this -stable? If this thing doesn't pan out with the chelsio/mellanox hardware socket rate limiting then we can either evolve it or remove it. -adrian From owner-svn-src-all@freebsd.org Wed Jan 18 20:24:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D873BCB6E3B; Wed, 18 Jan 2017 20:24:38 +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 8E1BA1C0D; Wed, 18 Jan 2017 20:24:38 +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 v0IKObID021451; Wed, 18 Jan 2017 20:24:37 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IKObaC021450; Wed, 18 Jan 2017 20:24:37 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701182024.v0IKObaC021450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 18 Jan 2017 20:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312395 - 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: Wed, 18 Jan 2017 20:24:39 -0000 Author: asomers Date: Wed Jan 18 20:24:37 2017 New Revision: 312395 URL: https://svnweb.freebsd.org/changeset/base/312395 Log: Fix several Coverity CIDs in devd CID 1362055, 1362054: File descriptor leaks during shutdown CID 1362013: Potential null-termination fail with long network device names CID 1362097: Uncaught exception during memory pressure CID 1362017, 1362016: Unchecked errors, possibly resulting in weird behavior if two devd instances start at the same time. CID 1362015: Unchecked error that will probably never fail Reported by: Coverity CID: 1362055 1362054 1362013 1362097 1362017 1362016 1362015 MFC after: 4 weeks Sponsored by: Spectra Logic Corp Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Wed Jan 18 19:38:53 2017 (r312394) +++ head/sbin/devd/devd.cc Wed Jan 18 20:24:37 2017 (r312395) @@ -372,7 +372,7 @@ media::do_match(config &c) s = socket(PF_INET, SOCK_DGRAM, 0); if (s >= 0) { memset(&ifmr, 0, sizeof(ifmr)); - strncpy(ifmr.ifm_name, value.c_str(), sizeof(ifmr.ifm_name)); + strlcpy(ifmr.ifm_name, value.c_str(), sizeof(ifmr.ifm_name)); if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0 && ifmr.ifm_status & IFM_AVALID) { @@ -871,8 +871,10 @@ create_socket(const char *name, int sock if (::bind(fd, (struct sockaddr *) & sun, slen) < 0) err(1, "bind"); listen(fd, 4); - chown(name, 0, 0); /* XXX - root.wheel */ - chmod(name, 0666); + if (chown(name, 0, 0)) /* XXX - root.wheel */ + err(1, "chown"); + if (chmod(name, 0666)) + err(1, "chmod"); return (fd); } @@ -1058,7 +1060,13 @@ event_loop(void) buffer[rv] = '\0'; while (buffer[--rv] == '\n') buffer[rv] = '\0'; - process_event(buffer); + try { + process_event(buffer); + } + catch (std::length_error e) { + devdlog(LOG_ERR, "Dropping event %s " + "due to low memory", buffer); + } } else if (rv < 0) { if (errno != EINTR) break; @@ -1076,6 +1084,8 @@ event_loop(void) if (FD_ISSET(seqpacket_fd, &fds)) new_client(seqpacket_fd, SOCK_SEQPACKET); } + close(seqpacket_fd); + close(stream_fd); close(fd); } @@ -1218,7 +1228,8 @@ check_devd_enabled() if (val == 0) { warnx("Setting " SYSCTL " to 1000"); val = 1000; - sysctlbyname(SYSCTL, NULL, NULL, &val, sizeof(val)); + if (sysctlbyname(SYSCTL, NULL, NULL, &val, sizeof(val))) + err(1, "sysctlbyname"); } } From owner-svn-src-all@freebsd.org Wed Jan 18 22:03:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EA3BCB61DA; Wed, 18 Jan 2017 22:03:24 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yb0-x243.google.com (mail-yb0-x243.google.com [IPv6:2607:f8b0:4002:c09::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 4EFDB1644; Wed, 18 Jan 2017 22:03:24 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yb0-x243.google.com with SMTP id 123so1100402ybe.0; Wed, 18 Jan 2017 14:03:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=vPPg4l+exwR3HKT17hWmLGbKDmLRbmBsaeLhB4D8oLw=; b=FnV6QlmswxLY1QWxWRmPBSEjA/TiEZQ+fRSLALp3fMnG2reUSZvaP3UOasp0lzQ9o3 QWmikGy+HL0dfYgzy3QTQfjsUk20RDqoLfJEnwjejixdU5Jx2x3lmlXI/LSjpQJBIlBv EeqU68aNVRHLkO56K7M9JUkmEic+shonBhdXVcKDWq0167d/wOJGxP4T4HYKmZ+9c9h7 UY2gwvRSyYt/cApID9w6/kY50YLy0Li9EhdJajcjlq4g8/YHYPe8UvFo27XclBiI90iq 2zTZFRC/YUIVH3NIWibGKTqI3mUvvOJprn/VNaiDYKV04Pmn5O/sOyYWN/G8ObEFJWN9 sRnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=vPPg4l+exwR3HKT17hWmLGbKDmLRbmBsaeLhB4D8oLw=; b=E7bJzVPqfQMZgrbKQApFiEZUP+Tv7zPPB22nBRGZEsA6yk2aEyD3iQlmoBtXTVPdrn UXci25eqEyr8a/OSXHLGtZJngMpCy6UmQIPGt6U66b9IUywJ4X5NEUFcvJ64Y4sEDbQ8 Q79UPJ5N4zzsbFQKuDY/o0J308LASdp0dl8aWzfI5499qS2DVduKScouTXicLcHIWkOo KRVuNCZKR3vk+tmETngrbYyX5pnBQcRoHC6NslAnljh05XZ3JPO1vYrAo5eVGGczTs7E UCCDOWyXeUELb6xu7rDI4p0k0IIlrO7aSMbVje4JZ1Egie3cp4eCMgECVI2X5Y9d9/uN NsCQ== X-Gm-Message-State: AIkVDXKBrFNx+J4QBSp5nYIhWARmajSBr7Ov84n1h8H++eATM8fHTTOCpmwW1LrZ+VR6eiVy8jBHcBrcy9wUGg== X-Received: by 10.37.32.194 with SMTP id g185mr4216026ybg.167.1484777002784; Wed, 18 Jan 2017 14:03:22 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.38.133 with HTTP; Wed, 18 Jan 2017 14:03:22 -0800 (PST) In-Reply-To: <201508122021.t7CKL5wk016750@repo.freebsd.org> References: <201508122021.t7CKL5wk016750@repo.freebsd.org> From: Alan Somers Date: Wed, 18 Jan 2017 15:03:22 -0700 X-Google-Sender-Auth: dwjPJZd-jf0ztOJB0YjxAPUNzE4 Message-ID: Subject: Re: svn commit: r286700 - in head: sbin/ifconfig sys/net To: Hiren Panchasara 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: Wed, 18 Jan 2017 22:03:24 -0000 Is the change to lacp_port_create correct? The comment indicates that fast is configurable, but it's actually constant. Later on, there's some dead code that depends on the value of fast (it was dead before this commit, too). CID: 1305734 CID: 1305692 -Alan On Wed, Aug 12, 2015 at 2:21 PM, Hiren Panchasara wrote: > Author: hiren > Date: Wed Aug 12 20:21:04 2015 > New Revision: 286700 > URL: https://svnweb.freebsd.org/changeset/base/286700 > > Log: > Make LAG LACP fast timeout tunable through IOCTL. > > Differential Revision: D3300 > Submitted by: LN Sundararajan > Reviewed by: wblock, smh, gnn, hiren, rpokala at panasas > MFC after: 2 weeks > Sponsored by: Panasas > > Modified: > head/sbin/ifconfig/ifconfig.8 > head/sbin/ifconfig/iflagg.c > head/sys/net/ieee8023ad_lacp.c > head/sys/net/ieee8023ad_lacp.h > head/sys/net/if_lagg.c > head/sys/net/if_lagg.h > > Modified: head/sbin/ifconfig/ifconfig.8 > ============================================================================== > --- head/sbin/ifconfig/ifconfig.8 Wed Aug 12 20:16:13 2015 (r286699) > +++ head/sbin/ifconfig/ifconfig.8 Wed Aug 12 20:21:04 2015 (r286700) > @@ -28,7 +28,7 @@ > .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 > .\" $FreeBSD$ > .\" > -.Dd May 15, 2015 > +.Dd Aug 12, 2015 > .Dt IFCONFIG 8 > .Os > .Sh NAME > @@ -2396,6 +2396,10 @@ Disable local hash computation for RSS h > Set a shift parameter for RSS local hash computation. > Hash is calculated by using flowid bits in a packet header mbuf > which are shifted by the number of this parameter. > +.It Cm lacp_fast_timeout > +Enable lacp fast-timeout on the interface. > +.It Cm -lacp_fast_timeout > +Disable lacp fast-timeout on the interface. > .El > .Pp > The following parameters are specific to IP tunnel interfaces, > > Modified: head/sbin/ifconfig/iflagg.c > ============================================================================== > --- head/sbin/ifconfig/iflagg.c Wed Aug 12 20:16:13 2015 (r286699) > +++ head/sbin/ifconfig/iflagg.c Wed Aug 12 20:21:04 2015 (r286700) > @@ -115,6 +115,8 @@ setlaggsetopt(const char *val, int d, in > case -LAGG_OPT_LACP_TXTEST: > case LAGG_OPT_LACP_RXTEST: > case -LAGG_OPT_LACP_RXTEST: > + case LAGG_OPT_LACP_TIMEOUT: > + case -LAGG_OPT_LACP_TIMEOUT: > break; > default: > err(1, "Invalid lagg option"); > @@ -293,6 +295,8 @@ static struct cmd lagg_cmds[] = { > DEF_CMD("-lacp_txtest", -LAGG_OPT_LACP_TXTEST, setlaggsetopt), > DEF_CMD("lacp_rxtest", LAGG_OPT_LACP_RXTEST, setlaggsetopt), > DEF_CMD("-lacp_rxtest", -LAGG_OPT_LACP_RXTEST, setlaggsetopt), > + DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), > + DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), > DEF_CMD_ARG("flowid_shift", setlaggflowidshift), > }; > static struct afswtch af_lagg = { > > Modified: head/sys/net/ieee8023ad_lacp.c > ============================================================================== > --- head/sys/net/ieee8023ad_lacp.c Wed Aug 12 20:16:13 2015 (r286699) > +++ head/sys/net/ieee8023ad_lacp.c Wed Aug 12 20:21:04 2015 (r286700) > @@ -522,7 +522,7 @@ lacp_port_create(struct lagg_port *lgp) > int error; > > boolean_t active = TRUE; /* XXX should be configurable */ > - boolean_t fast = FALSE; /* XXX should be configurable */ > + boolean_t fast = FALSE; /* Configurable via ioctl */ > > link_init_sdl(ifp, (struct sockaddr *)&sdl, IFT_ETHER); > sdl.sdl_alen = ETHER_ADDR_LEN; > > Modified: head/sys/net/ieee8023ad_lacp.h > ============================================================================== > --- head/sys/net/ieee8023ad_lacp.h Wed Aug 12 20:16:13 2015 (r286699) > +++ head/sys/net/ieee8023ad_lacp.h Wed Aug 12 20:21:04 2015 (r286700) > @@ -251,6 +251,7 @@ struct lacp_softc { > u_int32_t lsc_tx_test; > } lsc_debug; > u_int32_t lsc_strict_mode; > + boolean_t lsc_fast_timeout; /* if set, fast timeout */ > }; > > #define LACP_TYPE_ACTORINFO 1 > > Modified: head/sys/net/if_lagg.c > ============================================================================== > --- head/sys/net/if_lagg.c Wed Aug 12 20:16:13 2015 (r286699) > +++ head/sys/net/if_lagg.c Wed Aug 12 20:21:04 2015 (r286700) > @@ -1257,6 +1257,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd > ro->ro_opts |= LAGG_OPT_LACP_RXTEST; > if (lsc->lsc_strict_mode != 0) > ro->ro_opts |= LAGG_OPT_LACP_STRICT; > + if (lsc->lsc_fast_timeout != 0) > + ro->ro_opts |= LAGG_OPT_LACP_TIMEOUT; > > ro->ro_active = sc->sc_active; > } else { > @@ -1292,6 +1294,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd > case -LAGG_OPT_LACP_RXTEST: > case LAGG_OPT_LACP_STRICT: > case -LAGG_OPT_LACP_STRICT: > + case LAGG_OPT_LACP_TIMEOUT: > + case -LAGG_OPT_LACP_TIMEOUT: > valid = lacp = 1; > break; > default: > @@ -1320,6 +1324,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd > sc->sc_opts &= ~ro->ro_opts; > } else { > struct lacp_softc *lsc; > + struct lacp_port *lp; > > lsc = (struct lacp_softc *)sc->sc_psc; > > @@ -1342,6 +1347,20 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd > case -LAGG_OPT_LACP_STRICT: > lsc->lsc_strict_mode = 0; > break; > + case LAGG_OPT_LACP_TIMEOUT: > + LACP_LOCK(lsc); > + LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) > + lp->lp_state |= LACP_STATE_TIMEOUT; > + LACP_UNLOCK(lsc); > + lsc->lsc_fast_timeout = 1; > + break; > + case -LAGG_OPT_LACP_TIMEOUT: > + LACP_LOCK(lsc); > + LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) > + lp->lp_state &= ~LACP_STATE_TIMEOUT; > + LACP_UNLOCK(lsc); > + lsc->lsc_fast_timeout = 0; > + break; > } > } > LAGG_WUNLOCK(sc); > > Modified: head/sys/net/if_lagg.h > ============================================================================== > --- head/sys/net/if_lagg.h Wed Aug 12 20:16:13 2015 (r286699) > +++ head/sys/net/if_lagg.h Wed Aug 12 20:21:04 2015 (r286700) > @@ -150,6 +150,7 @@ struct lagg_reqopts { > #define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ > #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ > #define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ > +#define LAGG_OPT_LACP_TIMEOUT 0x80 /* LACP timeout */ > u_int ro_count; /* number of ports */ > u_int ro_active; /* active port count */ > u_int ro_flapping; /* number of flapping */ > From owner-svn-src-all@freebsd.org Wed Jan 18 22:10:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AB1FCB6394; Wed, 18 Jan 2017 22:10:20 +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 DB6F918F3; Wed, 18 Jan 2017 22:10:19 +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 v0IMAJtl062939; Wed, 18 Jan 2017 22:10:19 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IMAIh2062938; Wed, 18 Jan 2017 22:10:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701182210.v0IMAIh2062938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 18 Jan 2017 22:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312396 - head/cddl/usr.sbin/zfsd 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, 18 Jan 2017 22:10:20 -0000 Author: asomers Date: Wed Jan 18 22:10:18 2017 New Revision: 312396 URL: https://svnweb.freebsd.org/changeset/base/312396 Log: Fix an unchecked return value in zfsd It's pretty unlikely to actually hit this, but good to check it anyway Reported by: Coverity CID: 1362018 MFC after: 4 weeks Sponsored by: Spectra Logic Corp Modified: head/cddl/usr.sbin/zfsd/case_file.cc Modified: head/cddl/usr.sbin/zfsd/case_file.cc ============================================================================== --- head/cddl/usr.sbin/zfsd/case_file.cc Wed Jan 18 20:24:37 2017 (r312395) +++ head/cddl/usr.sbin/zfsd/case_file.cc Wed Jan 18 22:10:18 2017 (r312396) @@ -656,8 +656,11 @@ CaseFile::DeSerializeFile(const char *fi uint64_t vdevGUID; nvlist_t *vdevConf; - sscanf(fileName, "pool_%" PRIu64 "_vdev_%" PRIu64 ".case", - &poolGUID, &vdevGUID); + if (sscanf(fileName, "pool_%" PRIu64 "_vdev_%" PRIu64 ".case", + &poolGUID, &vdevGUID) != 2) { + throw ZfsdException("CaseFile::DeSerialize: " + "Unintelligible CaseFile filename %s.\n", fileName); + } existingCaseFile = Find(Guid(poolGUID), Guid(vdevGUID)); if (existingCaseFile != NULL) { /* From owner-svn-src-all@freebsd.org Wed Jan 18 22:38:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A78D7CB6CF5; Wed, 18 Jan 2017 22:38:37 +0000 (UTC) (envelope-from hiren@freebsd.org) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 8FCDA1939; Wed, 18 Jan 2017 22:38:34 +0000 (UTC) (envelope-from hiren@freebsd.org) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id A684017386; Wed, 18 Jan 2017 14:38:27 -0800 (PST) Date: Wed, 18 Jan 2017 14:38:27 -0800 From: Hiren Panchasara To: Alan Somers , lakshmi.n@msystechnologies.com, rpokala@FreeBSD.org, smh@FreeBSD.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r286700 - in head: sbin/ifconfig sys/net Message-ID: <20170118223827.GJ86256@strugglingcoder.info> References: <201508122021.t7CKL5wk016750@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EVh9lyqKgK19OcEf" Content-Disposition: inline In-Reply-To: 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: Wed, 18 Jan 2017 22:38:37 -0000 --EVh9lyqKgK19OcEf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Adding the submitter and other reviewers for their comments. On 01/18/17 at 03:03P, Alan Somers wrote: > Is the change to lacp_port_create correct? The comment indicates that > fast is configurable, but it's actually constant. Later on, there's > some dead code that depends on the value of fast (it was dead before > this commit, too). >=20 > CID: 1305734 > CID: 1305692 >=20 > -Alan >=20 > On Wed, Aug 12, 2015 at 2:21 PM, Hiren Panchasara wro= te: > > Author: hiren > > Date: Wed Aug 12 20:21:04 2015 > > New Revision: 286700 > > URL: https://svnweb.freebsd.org/changeset/base/286700 > > > > Log: > > Make LAG LACP fast timeout tunable through IOCTL. > > > > Differential Revision: D3300 > > Submitted by: LN Sundararajan > > Reviewed by: wblock, smh, gnn, hiren, rpokala at panasas > > MFC after: 2 weeks > > Sponsored by: Panasas > > > > Modified: > > head/sbin/ifconfig/ifconfig.8 > > head/sbin/ifconfig/iflagg.c > > head/sys/net/ieee8023ad_lacp.c > > head/sys/net/ieee8023ad_lacp.h > > head/sys/net/if_lagg.c > > head/sys/net/if_lagg.h > > > > Modified: head/sbin/ifconfig/ifconfig.8 > > =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/sbin/ifconfig/ifconfig.8 Wed Aug 12 20:16:13 2015 = (r286699) > > +++ head/sbin/ifconfig/ifconfig.8 Wed Aug 12 20:21:04 2015 = (r286700) > > @@ -28,7 +28,7 @@ > > .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 > > .\" $FreeBSD$ > > .\" > > -.Dd May 15, 2015 > > +.Dd Aug 12, 2015 > > .Dt IFCONFIG 8 > > .Os > > .Sh NAME > > @@ -2396,6 +2396,10 @@ Disable local hash computation for RSS h > > Set a shift parameter for RSS local hash computation. > > Hash is calculated by using flowid bits in a packet header mbuf > > which are shifted by the number of this parameter. > > +.It Cm lacp_fast_timeout > > +Enable lacp fast-timeout on the interface. > > +.It Cm -lacp_fast_timeout > > +Disable lacp fast-timeout on the interface. > > .El > > .Pp > > The following parameters are specific to IP tunnel interfaces, > > > > Modified: head/sbin/ifconfig/iflagg.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/sbin/ifconfig/iflagg.c Wed Aug 12 20:16:13 2015 (r28669= 9) > > +++ head/sbin/ifconfig/iflagg.c Wed Aug 12 20:21:04 2015 (r28670= 0) > > @@ -115,6 +115,8 @@ setlaggsetopt(const char *val, int d, in > > case -LAGG_OPT_LACP_TXTEST: > > case LAGG_OPT_LACP_RXTEST: > > case -LAGG_OPT_LACP_RXTEST: > > + case LAGG_OPT_LACP_TIMEOUT: > > + case -LAGG_OPT_LACP_TIMEOUT: > > break; > > default: > > err(1, "Invalid lagg option"); > > @@ -293,6 +295,8 @@ static struct cmd lagg_cmds[] =3D { > > DEF_CMD("-lacp_txtest", -LAGG_OPT_LACP_TXTEST, setlaggsetopt), > > DEF_CMD("lacp_rxtest", LAGG_OPT_LACP_RXTEST, setlaggsetopt), > > DEF_CMD("-lacp_rxtest", -LAGG_OPT_LACP_RXTEST, setlaggsetopt), > > + DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_TIMEOUT, setlagg= setopt), > > + DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_TIMEOUT, setlagg= setopt), > > DEF_CMD_ARG("flowid_shift", setlaggflowidshift), > > }; > > static struct afswtch af_lagg =3D { > > > > Modified: head/sys/net/ieee8023ad_lacp.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/sys/net/ieee8023ad_lacp.c Wed Aug 12 20:16:13 2015 = (r286699) > > +++ head/sys/net/ieee8023ad_lacp.c Wed Aug 12 20:21:04 2015 = (r286700) > > @@ -522,7 +522,7 @@ lacp_port_create(struct lagg_port *lgp) > > int error; > > > > boolean_t active =3D TRUE; /* XXX should be configurable */ > > - boolean_t fast =3D FALSE; /* XXX should be configurable */ > > + boolean_t fast =3D FALSE; /* Configurable via ioctl */ > > > > link_init_sdl(ifp, (struct sockaddr *)&sdl, IFT_ETHER); > > sdl.sdl_alen =3D ETHER_ADDR_LEN; > > > > Modified: head/sys/net/ieee8023ad_lacp.h > > =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/sys/net/ieee8023ad_lacp.h Wed Aug 12 20:16:13 2015 = (r286699) > > +++ head/sys/net/ieee8023ad_lacp.h Wed Aug 12 20:21:04 2015 = (r286700) > > @@ -251,6 +251,7 @@ struct lacp_softc { > > u_int32_t lsc_tx_test; > > } lsc_debug; > > u_int32_t lsc_strict_mode; > > + boolean_t lsc_fast_timeout; /* if set, fast timeo= ut */ > > }; > > > > #define LACP_TYPE_ACTORINFO 1 > > > > Modified: head/sys/net/if_lagg.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/sys/net/if_lagg.c Wed Aug 12 20:16:13 2015 (r28669= 9) > > +++ head/sys/net/if_lagg.c Wed Aug 12 20:21:04 2015 (r28670= 0) > > @@ -1257,6 +1257,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd > > ro->ro_opts |=3D LAGG_OPT_LACP_RXTEST; > > if (lsc->lsc_strict_mode !=3D 0) > > ro->ro_opts |=3D LAGG_OPT_LACP_STRICT; > > + if (lsc->lsc_fast_timeout !=3D 0) > > + ro->ro_opts |=3D LAGG_OPT_LACP_TIMEOUT; > > > > ro->ro_active =3D sc->sc_active; > > } else { > > @@ -1292,6 +1294,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd > > case -LAGG_OPT_LACP_RXTEST: > > case LAGG_OPT_LACP_STRICT: > > case -LAGG_OPT_LACP_STRICT: > > + case LAGG_OPT_LACP_TIMEOUT: > > + case -LAGG_OPT_LACP_TIMEOUT: > > valid =3D lacp =3D 1; > > break; > > default: > > @@ -1320,6 +1324,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd > > sc->sc_opts &=3D ~ro->ro_opts; > > } else { > > struct lacp_softc *lsc; > > + struct lacp_port *lp; > > > > lsc =3D (struct lacp_softc *)sc->sc_psc; > > > > @@ -1342,6 +1347,20 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd > > case -LAGG_OPT_LACP_STRICT: > > lsc->lsc_strict_mode =3D 0; > > break; > > + case LAGG_OPT_LACP_TIMEOUT: > > + LACP_LOCK(lsc); > > + LIST_FOREACH(lp, &lsc->lsc_ports, lp_ne= xt) > > + lp->lp_state |=3D LACP_STATE_TI= MEOUT; > > + LACP_UNLOCK(lsc); > > + lsc->lsc_fast_timeout =3D 1; > > + break; > > + case -LAGG_OPT_LACP_TIMEOUT: > > + LACP_LOCK(lsc); > > + LIST_FOREACH(lp, &lsc->lsc_ports, lp_ne= xt) > > + lp->lp_state &=3D ~LACP_STATE_T= IMEOUT; > > + LACP_UNLOCK(lsc); > > + lsc->lsc_fast_timeout =3D 0; > > + break; > > } > > } > > LAGG_WUNLOCK(sc); > > > > Modified: head/sys/net/if_lagg.h > > =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/sys/net/if_lagg.h Wed Aug 12 20:16:13 2015 (r28669= 9) > > +++ head/sys/net/if_lagg.h Wed Aug 12 20:21:04 2015 (r28670= 0) > > @@ -150,6 +150,7 @@ struct lagg_reqopts { > > #define LAGG_OPT_LACP_STRICT 0x10 /* LACP= strict mode */ > > #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP= debug: txtest */ > > #define LAGG_OPT_LACP_RXTEST 0x40 /* LACP= debug: rxtest */ > > +#define LAGG_OPT_LACP_TIMEOUT 0x80 /* LACP= timeout */ > > u_int ro_count; /* number of po= rts */ > > u_int ro_active; /* active port = count */ > > u_int ro_flapping; /* number of fl= apping */ > > >=20 --EVh9lyqKgK19OcEf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJYf+5dXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lKAEH/3vpOnIjPuMagrPSCsYRx1oQ vQdpXEvWu8soXJTJuvs7k6v1mLoeUPSZkQotzKdLyuHpY/pGx+7/4lpf/BnGxq9F oHncnr7pL6cB3E8Sriyj91TeKIy0Qm6p9WB3nXvGY1oQuwQxB2Z/Md19VWmGLn0t 23jbBPBJeB81LpPqSFwZagy3lkW4TTZ69deboKoK6mLMegTknJa0p7lfXAbdVUOy Y232ZJk12G1rex0JQcDrQH5L0l3C+lUWA+QVL6aJsFNsVoKXIu88hEedixqtWoU+ br996on9xRrFWnAbnJOtTGFgXyrksbijVRizwarzyJGOh2mEUsjeQ8mEaOLkxSM= =mDTP -----END PGP SIGNATURE----- --EVh9lyqKgK19OcEf-- From owner-svn-src-all@freebsd.org Wed Jan 18 22:40:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4BF6CB6DAA; Wed, 18 Jan 2017 22:40:23 +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 90DE91AF6; Wed, 18 Jan 2017 22:40:23 +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 v0IMeMwQ075245; Wed, 18 Jan 2017 22:40:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IMeMXk075244; Wed, 18 Jan 2017 22:40:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701182240.v0IMeMXk075244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Jan 2017 22:40:22 +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: r312397 - in stable: 10/sys/vm 11/sys/vm 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, 18 Jan 2017 22:40:23 -0000 Author: jhb Date: Wed Jan 18 22:40:22 2017 New Revision: 312397 URL: https://svnweb.freebsd.org/changeset/base/312397 Log: MFC 310028: Use db_lookup_proc() in the DDB 'show procvm' command. This allows processes to be identified by PID as well as a pointer address. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Wed Jan 18 22:10:18 2017 (r312396) +++ stable/10/sys/vm/vm_map.c Wed Jan 18 22:40:22 2017 (r312397) @@ -4274,7 +4274,7 @@ DB_SHOW_COMMAND(procvm, procvm) struct proc *p; if (have_addr) { - p = (struct proc *) addr; + p = db_lookup_proc(addr); } else { p = curproc; } From owner-svn-src-all@freebsd.org Wed Jan 18 22:40:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03915CB6DAF; Wed, 18 Jan 2017 22:40:24 +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 C70421AF7; Wed, 18 Jan 2017 22:40:23 +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 v0IMeMMr075251; Wed, 18 Jan 2017 22:40:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0IMeMo3075250; Wed, 18 Jan 2017 22:40:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201701182240.v0IMeMo3075250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 18 Jan 2017 22:40: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: r312397 - in stable: 10/sys/vm 11/sys/vm 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, 18 Jan 2017 22:40:24 -0000 Author: jhb Date: Wed Jan 18 22:40:22 2017 New Revision: 312397 URL: https://svnweb.freebsd.org/changeset/base/312397 Log: MFC 310028: Use db_lookup_proc() in the DDB 'show procvm' command. This allows processes to be identified by PID as well as a pointer address. Modified: stable/11/sys/vm/vm_map.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/vm/vm_map.c ============================================================================== --- stable/11/sys/vm/vm_map.c Wed Jan 18 22:10:18 2017 (r312396) +++ stable/11/sys/vm/vm_map.c Wed Jan 18 22:40:22 2017 (r312397) @@ -4313,7 +4313,7 @@ DB_SHOW_COMMAND(procvm, procvm) struct proc *p; if (have_addr) { - p = (struct proc *) addr; + p = db_lookup_proc(addr); } else { p = curproc; } From owner-svn-src-all@freebsd.org Wed Jan 18 23:23:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 838D0CB6C31; Wed, 18 Jan 2017 23:23:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 402E51172; Wed, 18 Jan 2017 23:23:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0INNlLg095352; Wed, 18 Jan 2017 23:23:47 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0INNk6S095341; Wed, 18 Jan 2017 23:23:46 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201701182323.v0INNk6S095341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 18 Jan 2017 23:23: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: r312398 - in stable/10/sys/dev: amdsbwd arcmsr hpt27xx hptmv hptnr hptrr sdhci sound/pci tws 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, 18 Jan 2017 23:23:48 -0000 Author: marius Date: Wed Jan 18 23:23:46 2017 New Revision: 312398 URL: https://svnweb.freebsd.org/changeset/base/312398 Log: MFC: r296135 Replace several bus_alloc_resource() calls with bus_alloc_resource_any() Most of these are BARs, and we allocate them in their entirety. The one outlier in this is amdsbwd(4), which calls bus_set_resource() prior. Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c stable/10/sys/dev/arcmsr/arcmsr.c stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c stable/10/sys/dev/hptmv/entry.c stable/10/sys/dev/hptnr/hptnr_os_bsd.c stable/10/sys/dev/hptrr/hptrr_os_bsd.c stable/10/sys/dev/sdhci/sdhci_pci.c stable/10/sys/dev/sound/pci/als4000.c stable/10/sys/dev/sound/pci/cs4281.c stable/10/sys/dev/sound/pci/vibes.c stable/10/sys/dev/tws/tws.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/10/sys/dev/amdsbwd/amdsbwd.c Wed Jan 18 22:40:22 2017 (r312397) +++ stable/10/sys/dev/amdsbwd/amdsbwd.c Wed Jan 18 23:23:46 2017 (r312398) @@ -416,8 +416,8 @@ amdsbwd_probe(device_t dev) return (ENXIO); } rid = 0; - res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0ul, ~0ul, - AMDSB_PMIO_WIDTH, RF_ACTIVE | RF_SHAREABLE); + res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, + RF_ACTIVE | RF_SHAREABLE); if (res == NULL) { device_printf(dev, "bus_alloc_resource for IO failed\n"); return (ENXIO); Modified: stable/10/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/10/sys/dev/arcmsr/arcmsr.c Wed Jan 18 22:40:22 2017 (r312397) +++ stable/10/sys/dev/arcmsr/arcmsr.c Wed Jan 18 23:23:46 2017 (r312398) @@ -4143,7 +4143,7 @@ static u_int32_t arcmsr_initialize(devic u_int32_t rid0 = PCIR_BAR(0); vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource(dev,SYS_RES_MEMORY, &rid0, 0ul, ~0ul, 0x1000, RF_ACTIVE); + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); @@ -4177,11 +4177,11 @@ static u_int32_t arcmsr_initialize(devic size = sizeof(struct HBB_DOORBELL); for(i=0; i < 2; i++) { if(i == 0) { - acb->sys_res_arcmsr[i] = bus_alloc_resource(dev,SYS_RES_MEMORY, &rid[i], - 0ul, ~0ul, size, RF_ACTIVE); + acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid[i], + RF_ACTIVE); } else { - acb->sys_res_arcmsr[i] = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid[i], - 0ul, ~0ul, sizeof(struct HBB_RWBUFFER), RF_ACTIVE); + acb->sys_res_arcmsr[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid[i], + RF_ACTIVE); } if(acb->sys_res_arcmsr[i] == NULL) { arcmsr_free_resource(acb); @@ -4224,7 +4224,7 @@ static u_int32_t arcmsr_initialize(devic u_int32_t rid0 = PCIR_BAR(1); vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource(dev,SYS_RES_MEMORY, &rid0, 0ul, ~0ul, sizeof(struct HBC_MessageUnit), RF_ACTIVE); + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); @@ -4251,7 +4251,7 @@ static u_int32_t arcmsr_initialize(devic u_int32_t rid0 = PCIR_BAR(0); vm_offset_t mem_base0; - acb->sys_res_arcmsr[0] = bus_alloc_resource(dev,SYS_RES_MEMORY, &rid0, 0ul, ~0ul, sizeof(struct HBD_MessageUnit), RF_ACTIVE); + acb->sys_res_arcmsr[0] = bus_alloc_resource_any(dev,SYS_RES_MEMORY, &rid0, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); printf("arcmsr%d: bus_alloc_resource failure!\n", device_get_unit(dev)); Modified: stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c ============================================================================== --- stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c Wed Jan 18 22:40:22 2017 (r312397) +++ stable/10/sys/dev/hpt27xx/hpt27xx_os_bsd.c Wed Jan 18 23:23:46 2017 (r312398) @@ -120,13 +120,13 @@ void *os_map_pci_bar( if (base & 1) { hba->pcibar[index].type = SYS_RES_IOPORT; - hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, - hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); hba->pcibar[index].base = (void *)(unsigned long)(base & ~0x1); } else { hba->pcibar[index].type = SYS_RES_MEMORY; - hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, - hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; } Modified: stable/10/sys/dev/hptmv/entry.c ============================================================================== --- stable/10/sys/dev/hptmv/entry.c Wed Jan 18 22:40:22 2017 (r312397) +++ stable/10/sys/dev/hptmv/entry.c Wed Jan 18 23:23:46 2017 (r312398) @@ -1356,8 +1356,8 @@ init_adapter(IAL_ADAPTER_T *pAdapter) /* also map EPROM address */ rid = 0x10; - if (!(pAdapter->mem_res = bus_alloc_resource(pAdapter->hpt_dev, SYS_RES_MEMORY, &rid, - 0, ~0, MV_SATA_PCI_BAR0_SPACE_SIZE+0x40000, RF_ACTIVE)) + if (!(pAdapter->mem_res = bus_alloc_resource_any(pAdapter->hpt_dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE)) || !(pMvSataAdapter->adapterIoBaseAddress = rman_get_virtual(pAdapter->mem_res))) { Modified: stable/10/sys/dev/hptnr/hptnr_os_bsd.c ============================================================================== --- stable/10/sys/dev/hptnr/hptnr_os_bsd.c Wed Jan 18 22:40:22 2017 (r312397) +++ stable/10/sys/dev/hptnr/hptnr_os_bsd.c Wed Jan 18 23:23:46 2017 (r312398) @@ -106,13 +106,13 @@ void *os_map_pci_bar( if (base & 1) { hba->pcibar[index].type = SYS_RES_IOPORT; - hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, - hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); hba->pcibar[index].base = (void *)(unsigned long)(base & ~0x1); } else { hba->pcibar[index].type = SYS_RES_MEMORY; - hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, - hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; } Modified: stable/10/sys/dev/hptrr/hptrr_os_bsd.c ============================================================================== --- stable/10/sys/dev/hptrr/hptrr_os_bsd.c Wed Jan 18 22:40:22 2017 (r312397) +++ stable/10/sys/dev/hptrr/hptrr_os_bsd.c Wed Jan 18 23:23:46 2017 (r312398) @@ -98,8 +98,8 @@ void *os_map_pci_bar( else hba->pcibar[index].type = SYS_RES_MEMORY; - hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, - hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].res = bus_alloc_resource_any(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, RF_ACTIVE); hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; return hba->pcibar[index].base; Modified: stable/10/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci_pci.c Wed Jan 18 22:40:22 2017 (r312397) +++ stable/10/sys/dev/sdhci/sdhci_pci.c Wed Jan 18 23:23:46 2017 (r312398) @@ -331,8 +331,8 @@ sdhci_pci_attach(device_t dev) /* Allocate memory. */ rid = PCIR_BAR(bar + i); - sc->mem_res[i] = bus_alloc_resource(dev, SYS_RES_MEMORY, - &rid, 0ul, ~0ul, 0x100, RF_ACTIVE); + sc->mem_res[i] = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); if (sc->mem_res[i] == NULL) { device_printf(dev, "Can't allocate memory for slot %d\n", i); continue; Modified: stable/10/sys/dev/sound/pci/als4000.c ============================================================================== --- stable/10/sys/dev/sound/pci/als4000.c Wed Jan 18 22:40:22 2017 (r312397) +++ stable/10/sys/dev/sound/pci/als4000.c Wed Jan 18 23:23:46 2017 (r312398) @@ -760,8 +760,8 @@ static int als_resource_grab(device_t dev, struct sc_info *sc) { sc->regid = PCIR_BAR(0); - sc->reg = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->regid, 0, ~0, - ALS_CONFIG_SPACE_BYTES, RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->regid, + RF_ACTIVE); if (sc->reg == 0) { device_printf(dev, "unable to allocate register space\n"); goto bad; Modified: stable/10/sys/dev/sound/pci/cs4281.c ============================================================================== --- stable/10/sys/dev/sound/pci/cs4281.c Wed Jan 18 22:40:22 2017 (r312397) +++ stable/10/sys/dev/sound/pci/cs4281.c Wed Jan 18 23:23:46 2017 (r312398) @@ -790,12 +790,11 @@ cs4281_pci_attach(device_t dev) sc->regid = PCIR_BAR(0); sc->regtype = SYS_RES_MEMORY; - sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid, - 0, ~0, CS4281PCI_BA0_SIZE, RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, sc->regtype, &sc->regid, RF_ACTIVE); if (!sc->reg) { sc->regtype = SYS_RES_IOPORT; - sc->reg = bus_alloc_resource(dev, sc->regtype, &sc->regid, - 0, ~0, CS4281PCI_BA0_SIZE, RF_ACTIVE); + sc->reg = bus_alloc_resource_any(dev, sc->regtype, &sc->regid, + RF_ACTIVE); if (!sc->reg) { device_printf(dev, "unable to allocate register space\n"); goto bad; @@ -805,8 +804,8 @@ cs4281_pci_attach(device_t dev) sc->sh = rman_get_bushandle(sc->reg); sc->memid = PCIR_BAR(1); - sc->mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->memid, 0, - ~0, CS4281PCI_BA1_SIZE, RF_ACTIVE); + sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->memid, + RF_ACTIVE); if (sc->mem == NULL) { device_printf(dev, "unable to allocate fifo space\n"); goto bad; Modified: stable/10/sys/dev/sound/pci/vibes.c ============================================================================== --- stable/10/sys/dev/sound/pci/vibes.c Wed Jan 18 22:40:22 2017 (r312397) +++ stable/10/sys/dev/sound/pci/vibes.c Wed Jan 18 23:23:46 2017 (r312398) @@ -739,9 +739,8 @@ sv_attach(device_t dev) { #endif sc->enh_rid = SV_PCI_ENHANCED; sc->enh_type = SYS_RES_IOPORT; - sc->enh_reg = bus_alloc_resource(dev, sc->enh_type, - &sc->enh_rid, 0, ~0, - SV_PCI_ENHANCED_SIZE, RF_ACTIVE); + sc->enh_reg = bus_alloc_resource_any(dev, sc->enh_type, + &sc->enh_rid, RF_ACTIVE); if (sc->enh_reg == NULL) { device_printf(dev, "sv_attach: cannot allocate enh\n"); return ENXIO; @@ -832,9 +831,8 @@ sv_attach(device_t dev) { /* Cache resource short-cuts for dma_a */ sc->dmaa_rid = SV_PCI_DMAA; sc->dmaa_type = SYS_RES_IOPORT; - sc->dmaa_reg = bus_alloc_resource(dev, sc->dmaa_type, - &sc->dmaa_rid, 0, ~0, - SV_PCI_ENHANCED_SIZE, RF_ACTIVE); + sc->dmaa_reg = bus_alloc_resource_any(dev, sc->dmaa_type, + &sc->dmaa_rid, RF_ACTIVE); if (sc->dmaa_reg == NULL) { device_printf(dev, "sv_attach: cannot allocate dmaa\n"); goto fail; @@ -851,9 +849,8 @@ sv_attach(device_t dev) { /* Cache resource short-cuts for dma_c */ sc->dmac_rid = SV_PCI_DMAC; sc->dmac_type = SYS_RES_IOPORT; - sc->dmac_reg = bus_alloc_resource(dev, sc->dmac_type, - &sc->dmac_rid, 0, ~0, - SV_PCI_ENHANCED_SIZE, RF_ACTIVE); + sc->dmac_reg = bus_alloc_resource_any(dev, sc->dmac_type, + &sc->dmac_rid, RF_ACTIVE); if (sc->dmac_reg == NULL) { device_printf(dev, "sv_attach: cannot allocate dmac\n"); goto fail; Modified: stable/10/sys/dev/tws/tws.c ============================================================================== --- stable/10/sys/dev/tws/tws.c Wed Jan 18 22:40:22 2017 (r312397) +++ stable/10/sys/dev/tws/tws.c Wed Jan 18 23:23:46 2017 (r312398) @@ -257,8 +257,8 @@ tws_attach(device_t dev) #ifndef TWS_PULL_MODE_ENABLE /* Allocate bus space for inbound mfa */ sc->mfa_res_id = TWS_PCI_BAR2; /* BAR2 offset */ - if ((sc->mfa_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &(sc->mfa_res_id), 0, ~0, 0x100000, RF_ACTIVE)) + if ((sc->mfa_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &(sc->mfa_res_id), RF_ACTIVE)) == NULL) { tws_log(sc, ALLOC_MEMORY_RES); goto attach_fail_2; From owner-svn-src-all@freebsd.org Wed Jan 18 23:25:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B51DCB6D98; Wed, 18 Jan 2017 23:25:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49B4914C3; Wed, 18 Jan 2017 23:25:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0INPlOK095502; Wed, 18 Jan 2017 23:25:47 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0INPk9V095494; Wed, 18 Jan 2017 23:25:46 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201701182325.v0INPk9V095494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 18 Jan 2017 23:25: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: r312399 - in stable/11/sys/dev: ichiic mmc sdhci 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, 18 Jan 2017 23:25:48 -0000 Author: marius Date: Wed Jan 18 23:25:46 2017 New Revision: 312399 URL: https://svnweb.freebsd.org/changeset/base/312399 Log: MFC: r310309, r310340-310341, r311664, r311793-r311794 o sdhci/mmc: Minor whitespace cleanups o Add Braswell PCI IDs for Intel Cherryview o mmc: Accept even lower voltage for Cherryview And HP x2 210, per DragonFlyBSD 240bd9cd58f8259c12c14a8006837e698. o In mmcsd_task(), bio_resid was not being set to 0 on a successful read or write, resulting in random short-read and short-write returns for requests. Fixing this fixes nominal block I/O via mmcsd(4). Obtained from: DragonFlyBSD (fd4b97583be1a1e57234713c25f6e81bc0411cb0) o Add support for Intel Apollo Lake and Bay Trail eMMC PCI controllers. o Flesh out the support for Intel Braswell eMMC controllers further. o In sdhci_init_slot(), use the right capability field for determining the announced bus width based on MMC_CAP_*_BIT_DATA. Modified: stable/11/sys/dev/ichiic/ig4_pci.c stable/11/sys/dev/mmc/mmc.c stable/11/sys/dev/mmc/mmcreg.h stable/11/sys/dev/mmc/mmcsd.c stable/11/sys/dev/sdhci/sdhci.c stable/11/sys/dev/sdhci/sdhci.h stable/11/sys/dev/sdhci/sdhci_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ichiic/ig4_pci.c ============================================================================== --- stable/11/sys/dev/ichiic/ig4_pci.c Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/ichiic/ig4_pci.c Wed Jan 18 23:25:46 2017 (r312399) @@ -68,6 +68,12 @@ static int ig4iic_pci_detach(device_t de #define PCI_CHIP_LYNXPT_LP_I2C_1 0x9c618086 #define PCI_CHIP_LYNXPT_LP_I2C_2 0x9c628086 +#define PCI_CHIP_BRASWELL_I2C_1 0x22c18086 +#define PCI_CHIP_BRASWELL_I2C_2 0x22c28086 +#define PCI_CHIP_BRASWELL_I2C_3 0x22c38086 +#define PCI_CHIP_BRASWELL_I2C_5 0x22c58086 +#define PCI_CHIP_BRASWELL_I2C_6 0x22c68086 +#define PCI_CHIP_BRASWELL_I2C_7 0x22c78086 static int ig4iic_pci_probe(device_t dev) @@ -79,6 +85,24 @@ ig4iic_pci_probe(device_t dev) case PCI_CHIP_LYNXPT_LP_I2C_2: device_set_desc(dev, "Intel Lynx Point-LP I2C Controller-2"); break; + case PCI_CHIP_BRASWELL_I2C_1: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 1"); + break; + case PCI_CHIP_BRASWELL_I2C_2: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 2"); + break; + case PCI_CHIP_BRASWELL_I2C_3: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 3"); + break; + case PCI_CHIP_BRASWELL_I2C_5: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 5"); + break; + case PCI_CHIP_BRASWELL_I2C_6: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 6"); + break; + case PCI_CHIP_BRASWELL_I2C_7: + device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 7"); + break; default: return (ENXIO); } Modified: stable/11/sys/dev/mmc/mmc.c ============================================================================== --- stable/11/sys/dev/mmc/mmc.c Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/mmc/mmc.c Wed Jan 18 23:25:46 2017 (r312399) @@ -401,7 +401,7 @@ mmc_wait_for_req(struct mmc_softc *sc, s msleep(req, &sc->sc_mtx, 0, "mmcreq", 0); MMC_UNLOCK(sc); if (mmc_debug > 2 || (mmc_debug > 0 && req->cmd->error != MMC_ERR_NONE)) - device_printf(sc->dev, "CMD%d RESULT: %d\n", + device_printf(sc->dev, "CMD%d RESULT: %d\n", req->cmd->opcode, req->cmd->error); return (0); } @@ -511,7 +511,7 @@ mmc_idle_cards(struct mmc_softc *sc) { device_t dev; struct mmc_command cmd; - + dev = sc->dev; mmcbr_set_chip_select(dev, cs_high); mmcbr_update_ios(dev); @@ -795,7 +795,7 @@ mmc_test_bus_width(struct mmc_softc *sc) data.len = 8; data.flags = MMC_DATA_WRITE; mmc_wait_for_cmd(sc, &cmd, 0); - + memset(&cmd, 0, sizeof(cmd)); memset(&data, 0, sizeof(data)); cmd.opcode = MMC_BUSTEST_R; @@ -808,7 +808,7 @@ mmc_test_bus_width(struct mmc_softc *sc) data.flags = MMC_DATA_READ; err = mmc_wait_for_cmd(sc, &cmd, 0); sc->squelched--; - + mmcbr_set_bus_width(sc->dev, bus_width_1); mmcbr_update_ios(sc->dev); @@ -832,7 +832,7 @@ mmc_test_bus_width(struct mmc_softc *sc) data.len = 4; data.flags = MMC_DATA_WRITE; mmc_wait_for_cmd(sc, &cmd, 0); - + memset(&cmd, 0, sizeof(cmd)); memset(&data, 0, sizeof(data)); cmd.opcode = MMC_BUSTEST_R; @@ -1017,7 +1017,7 @@ mmc_decode_csd_sd(uint32_t *raw_csd, str csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); - } else + } else panic("unknown SD CSD version"); } @@ -1349,9 +1349,9 @@ mmc_discover_cards(struct mmc_softc *sc) if (ivar->csd.csd_structure > 0) ivar->high_cap = 1; ivar->tran_speed = ivar->csd.tran_speed; - ivar->erase_sector = ivar->csd.erase_sector * + ivar->erase_sector = ivar->csd.erase_sector * ivar->csd.write_bl_len / MMC_SECTOR_SIZE; - + err = mmc_send_status(sc, ivar->rca, &status); if (err != MMC_ERR_NONE) { device_printf(sc->dev, @@ -1446,7 +1446,7 @@ mmc_discover_cards(struct mmc_softc *sc) mmc_decode_csd_mmc(ivar->raw_csd, &ivar->csd); ivar->sec_count = ivar->csd.capacity / MMC_SECTOR_SIZE; ivar->tran_speed = ivar->csd.tran_speed; - ivar->erase_sector = ivar->csd.erase_sector * + ivar->erase_sector = ivar->csd.erase_sector * ivar->csd.write_bl_len / MMC_SECTOR_SIZE; err = mmc_send_status(sc, ivar->rca, &status); @@ -1655,7 +1655,7 @@ mmc_calculate_clock(struct mmc_softc *sc int nkid, i, f_max; device_t *kids; struct mmc_ivars *ivar; - + f_max = mmcbr_get_f_max(sc->dev); max_dtr = max_hs_dtr = f_max; if ((mmcbr_get_caps(sc->dev) & MMC_CAP_HSPEED)) @@ -1770,7 +1770,7 @@ static void mmc_delayed_attach(void *xsc) { struct mmc_softc *sc = xsc; - + mmc_scan(sc); config_intrhook_disestablish(&sc->config_intrhook); } Modified: stable/11/sys/dev/mmc/mmcreg.h ============================================================================== --- stable/11/sys/dev/mmc/mmcreg.h Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/mmc/mmcreg.h Wed Jan 18 23:25:46 2017 (r312399) @@ -355,8 +355,8 @@ struct mmc_request { */ #define MMC_OCR_VOLTAGE 0x3fffffffU /* Vdd Voltage mask */ #define MMC_OCR_LOW_VOLTAGE (1u << 7) /* Low Voltage Range -- tbd */ +#define MMC_OCR_MIN_VOLTAGE_SHIFT 7 #define MMC_OCR_200_210 (1U << 8) /* Vdd voltage 2.00 ~ 2.10 */ -#define MMC_OCR_MIN_VOLTAGE_SHIFT 8 #define MMC_OCR_210_220 (1U << 9) /* Vdd voltage 2.10 ~ 2.20 */ #define MMC_OCR_220_230 (1U << 10) /* Vdd voltage 2.20 ~ 2.30 */ #define MMC_OCR_230_240 (1U << 11) /* Vdd voltage 2.30 ~ 2.40 */ Modified: stable/11/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/11/sys/dev/mmc/mmcsd.c Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/mmc/mmcsd.c Wed Jan 18 23:25:46 2017 (r312399) @@ -545,6 +545,8 @@ mmcsd_task(void *arg) bp->bio_error = EIO; bp->bio_resid = (end - block) * sz; bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_resid = 0; } biodone(bp); } Modified: stable/11/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.c Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/sdhci/sdhci.c Wed Jan 18 23:25:46 2017 (r312399) @@ -376,6 +376,13 @@ sdhci_set_power(struct sdhci_slot *slot, /* Turn on the power. */ pwr |= SDHCI_POWER_ON; WR1(slot, SDHCI_POWER_CONTROL, pwr); + + if (slot->quirks & SDHCI_QUIRK_INTEL_POWER_UP_RESET) { + WR1(slot, SDHCI_POWER_CONTROL, pwr | 0x10); + DELAY(10); + WR1(slot, SDHCI_POWER_CONTROL, pwr); + DELAY(300); + } } static void @@ -629,9 +636,11 @@ sdhci_init_slot(device_t dev, struct sdh device_printf(dev, "Hardware doesn't specify base clock " "frequency, using %dMHz as default.\n", SDHCI_DEFAULT_MAX_FREQ); } - /* Calculate timeout clock frequency. */ + /* Calculate/set timeout clock frequency. */ if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) { slot->timeout_clk = slot->max_clk / 1000; + } else if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_1MHZ) { + slot->timeout_clk = 1000; } else { slot->timeout_clk = (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; @@ -675,6 +684,8 @@ sdhci_init_slot(device_t dev, struct sdh slot->opt &= ~SDHCI_HAVE_DMA; if (slot->quirks & SDHCI_QUIRK_FORCE_DMA) slot->opt |= SDHCI_HAVE_DMA; + if (slot->quirks & SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE) + slot->opt |= SDHCI_NON_REMOVABLE; /* * Use platform-provided transfer backend @@ -687,8 +698,9 @@ sdhci_init_slot(device_t dev, struct sdh slot_printf(slot, "%uMHz%s %s%s%s%s %s\n", slot->max_clk / 1000000, (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", - (caps & MMC_CAP_8_BIT_DATA) ? "8bits" : - ((caps & MMC_CAP_4_BIT_DATA) ? "4bits" : "1bit"), + (slot->host.caps & MMC_CAP_8_BIT_DATA) ? "8bits" : + ((slot->host.caps & MMC_CAP_4_BIT_DATA) ? "4bits" : + "1bit"), (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "", Modified: stable/11/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/11/sys/dev/sdhci/sdhci.h Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/sdhci/sdhci.h Wed Jan 18 23:25:46 2017 (r312399) @@ -66,7 +66,13 @@ /* Alternate clock source is required when supplying a 400 KHz clock. */ #define SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC (1<<16) /* Card insert/remove interrupts don't work, polling required. */ -#define SDHCI_QUIRK_POLL_CARD_PRESENT (1<<17) +#define SDHCI_QUIRK_POLL_CARD_PRESENT (1<<17) +/* All controller slots are non-removable. */ +#define SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE (1<<18) +/* Issue custom Intel controller reset sequence after power-up. */ +#define SDHCI_QUIRK_INTEL_POWER_UP_RESET (1<<19) +/* Data timeout is invalid, use 1 MHz clock instead. */ +#define SDHCI_QUIRK_DATA_TIMEOUT_1MHZ (1<<20) /* * Controller registers Modified: stable/11/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- stable/11/sys/dev/sdhci/sdhci_pci.c Wed Jan 18 23:23:46 2017 (r312398) +++ stable/11/sys/dev/sdhci/sdhci_pci.c Wed Jan 18 23:25:46 2017 (r312399) @@ -63,15 +63,15 @@ __FBSDID("$FreeBSD$"); #define PCI_SDHCI_IFVENDOR 0x02 #define PCI_SLOT_INFO 0x40 /* 8 bits */ -#define PCI_SLOT_INFO_SLOTS(x) (((x >> 4) & 7) + 1) -#define PCI_SLOT_INFO_FIRST_BAR(x) ((x) & 7) +#define PCI_SLOT_INFO_SLOTS(x) (((x >> 4) & 7) + 1) +#define PCI_SLOT_INFO_FIRST_BAR(x) ((x) & 7) /* * RICOH specific PCI registers */ #define SDHC_PCI_MODE_KEY 0xf9 #define SDHC_PCI_MODE 0x150 -#define SDHC_PCI_MODE_SD20 0x10 +#define SDHC_PCI_MODE_SD20 0x10 #define SDHC_PCI_BASE_FREQ_KEY 0xfc #define SDHC_PCI_BASE_FREQ 0xe1 @@ -107,6 +107,19 @@ static const struct sdhci_device { SDHCI_QUIRK_RESET_AFTER_REQUEST }, { 0x16bc14e4, 0xffff, "Broadcom BCM577xx SDXC/MMC Card Reader", SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC }, + { 0x0f148086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x0f508086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x22948086, 0xffff, "Intel Braswell eMMC 4.5.1 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_DATA_TIMEOUT_1MHZ | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x5acc8086, 0xffff, "Intel Apollo Lake eMMC 5.0 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, { 0, 0xffff, NULL, 0 } }; @@ -119,8 +132,8 @@ struct sdhci_pci_softc { int num_slots; /* Number of slots on this controller */ struct sdhci_slot slots[6]; struct resource *mem_res[6]; /* Memory resource */ - uint8_t cfg_freq; /* Saved mode */ - uint8_t cfg_mode; /* Saved frequency */ + uint8_t cfg_freq; /* Saved frequency */ + uint8_t cfg_mode; /* Saved mode */ }; static int sdhci_enable_msi = 1; @@ -450,11 +463,11 @@ static device_method_t sdhci_methods[] = DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), /* mmcbr_if */ - DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), - DEVMETHOD(mmcbr_request, sdhci_generic_request), - DEVMETHOD(mmcbr_get_ro, sdhci_generic_get_ro), - DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), - DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), + DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), + DEVMETHOD(mmcbr_request, sdhci_generic_request), + DEVMETHOD(mmcbr_get_ro, sdhci_generic_get_ro), + DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), + DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), /* SDHCI registers accessors */ DEVMETHOD(sdhci_read_1, sdhci_pci_read_1), From owner-svn-src-all@freebsd.org Wed Jan 18 23:26:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A1F8CB6E18; Wed, 18 Jan 2017 23:26:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 688C9164B; Wed, 18 Jan 2017 23:26:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0INQB16095569; Wed, 18 Jan 2017 23:26:11 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0INQAO6095562; Wed, 18 Jan 2017 23:26:10 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201701182326.v0INQAO6095562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 18 Jan 2017 23:26: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: r312400 - in stable/10/sys/dev: mmc sdhci 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, 18 Jan 2017 23:26:12 -0000 Author: marius Date: Wed Jan 18 23:26:10 2017 New Revision: 312400 URL: https://svnweb.freebsd.org/changeset/base/312400 Log: MFC: r273180, r283754, r297329, r299414, r300707, r310309, r310340 (partial), r310341, r311664, r311793-311794 o Use correct response bits for MMC_RSP_R4-R7 types o Make sdhci(4) work after suspend/resume for chipsets that require the frequency quirk. This makes it work on eg ThinkPad T420. o Add a convenience macro that masks all the bits related to clock divisors in all versions of the sdhci spec (the HI bits are just unused reserved bits in earlier versions). o sdhci/mmc: Minor whitespace cleanups o Add Braswell PCI IDs for Intel Cherryview o mmc: Accept even lower voltage for Cherryview And HP x2 210, per DragonFlyBSD 240bd9cd58f8259c12c14a8006837e698. o In mmcsd_task(), bio_resid was not being set to 0 on a successful read or write, resulting in random short-read and short-write returns for requests. Fixing this fixes nominal block I/O via mmcsd(4). Obtained from: DragonFlyBSD (fd4b97583be1a1e57234713c25f6e81bc0411cb0) o Add support for Intel Apollo Lake and Bay Trail eMMC PCI controllers. o Flesh out the support for Intel Braswell eMMC controllers further. o In sdhci_init_slot(), use the right capability field for determining the announced bus width based on MMC_CAP_*_BIT_DATA. Modified: stable/10/sys/dev/mmc/mmc.c stable/10/sys/dev/mmc/mmcreg.h stable/10/sys/dev/mmc/mmcsd.c stable/10/sys/dev/sdhci/sdhci.c stable/10/sys/dev/sdhci/sdhci.h stable/10/sys/dev/sdhci/sdhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mmc/mmc.c ============================================================================== --- stable/10/sys/dev/mmc/mmc.c Wed Jan 18 23:25:46 2017 (r312399) +++ stable/10/sys/dev/mmc/mmc.c Wed Jan 18 23:26:10 2017 (r312400) @@ -401,7 +401,7 @@ mmc_wait_for_req(struct mmc_softc *sc, s msleep(req, &sc->sc_mtx, 0, "mmcreq", 0); MMC_UNLOCK(sc); if (mmc_debug > 2 || (mmc_debug > 0 && req->cmd->error != MMC_ERR_NONE)) - device_printf(sc->dev, "CMD%d RESULT: %d\n", + device_printf(sc->dev, "CMD%d RESULT: %d\n", req->cmd->opcode, req->cmd->error); return (0); } @@ -511,7 +511,7 @@ mmc_idle_cards(struct mmc_softc *sc) { device_t dev; struct mmc_command cmd; - + dev = sc->dev; mmcbr_set_chip_select(dev, cs_high); mmcbr_update_ios(dev); @@ -795,7 +795,7 @@ mmc_test_bus_width(struct mmc_softc *sc) data.len = 8; data.flags = MMC_DATA_WRITE; mmc_wait_for_cmd(sc, &cmd, 0); - + memset(&cmd, 0, sizeof(cmd)); memset(&data, 0, sizeof(data)); cmd.opcode = MMC_BUSTEST_R; @@ -808,7 +808,7 @@ mmc_test_bus_width(struct mmc_softc *sc) data.flags = MMC_DATA_READ; err = mmc_wait_for_cmd(sc, &cmd, 0); sc->squelched--; - + mmcbr_set_bus_width(sc->dev, bus_width_1); mmcbr_update_ios(sc->dev); @@ -832,7 +832,7 @@ mmc_test_bus_width(struct mmc_softc *sc) data.len = 4; data.flags = MMC_DATA_WRITE; mmc_wait_for_cmd(sc, &cmd, 0); - + memset(&cmd, 0, sizeof(cmd)); memset(&data, 0, sizeof(data)); cmd.opcode = MMC_BUSTEST_R; @@ -1017,7 +1017,7 @@ mmc_decode_csd_sd(uint32_t *raw_csd, str csd->r2w_factor = 1 << mmc_get_bits(raw_csd, 128, 26, 3); csd->write_bl_len = 1 << mmc_get_bits(raw_csd, 128, 22, 4); csd->write_bl_partial = mmc_get_bits(raw_csd, 128, 21, 1); - } else + } else panic("unknown SD CSD version"); } @@ -1349,9 +1349,9 @@ mmc_discover_cards(struct mmc_softc *sc) if (ivar->csd.csd_structure > 0) ivar->high_cap = 1; ivar->tran_speed = ivar->csd.tran_speed; - ivar->erase_sector = ivar->csd.erase_sector * + ivar->erase_sector = ivar->csd.erase_sector * ivar->csd.write_bl_len / MMC_SECTOR_SIZE; - + err = mmc_send_status(sc, ivar->rca, &status); if (err != MMC_ERR_NONE) { device_printf(sc->dev, @@ -1446,7 +1446,7 @@ mmc_discover_cards(struct mmc_softc *sc) mmc_decode_csd_mmc(ivar->raw_csd, &ivar->csd); ivar->sec_count = ivar->csd.capacity / MMC_SECTOR_SIZE; ivar->tran_speed = ivar->csd.tran_speed; - ivar->erase_sector = ivar->csd.erase_sector * + ivar->erase_sector = ivar->csd.erase_sector * ivar->csd.write_bl_len / MMC_SECTOR_SIZE; err = mmc_send_status(sc, ivar->rca, &status); @@ -1655,7 +1655,7 @@ mmc_calculate_clock(struct mmc_softc *sc int nkid, i, f_max; device_t *kids; struct mmc_ivars *ivar; - + f_max = mmcbr_get_f_max(sc->dev); max_dtr = max_hs_dtr = f_max; if ((mmcbr_get_caps(sc->dev) & MMC_CAP_HSPEED)) @@ -1770,7 +1770,7 @@ static void mmc_delayed_attach(void *xsc) { struct mmc_softc *sc = xsc; - + mmc_scan(sc); config_intrhook_disestablish(&sc->config_intrhook); } Modified: stable/10/sys/dev/mmc/mmcreg.h ============================================================================== --- stable/10/sys/dev/mmc/mmcreg.h Wed Jan 18 23:25:46 2017 (r312399) +++ stable/10/sys/dev/mmc/mmcreg.h Wed Jan 18 23:26:10 2017 (r312400) @@ -85,8 +85,11 @@ struct mmc_command { #define MMC_RSP_R1B (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE | MMC_RSP_BUSY) #define MMC_RSP_R2 (MMC_RSP_PRESENT | MMC_RSP_136 | MMC_RSP_CRC) #define MMC_RSP_R3 (MMC_RSP_PRESENT) -#define MMC_RSP_R6 (MMC_RSP_PRESENT | MMC_RSP_CRC) -#define MMC_RSP_R7 (MMC_RSP_PRESENT | MMC_RSP_CRC) +#define MMC_RSP_R4 (MMC_RSP_PRESENT) +#define MMC_RSP_R5 (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE) +#define MMC_RSP_R5B (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE | MMC_RSP_BUSY) +#define MMC_RSP_R6 (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE) +#define MMC_RSP_R7 (MMC_RSP_PRESENT | MMC_RSP_CRC | MMC_RSP_OPCODE) #define MMC_RSP(x) ((x) & MMC_RSP_MASK) uint32_t retries; uint32_t error; @@ -352,8 +355,8 @@ struct mmc_request { */ #define MMC_OCR_VOLTAGE 0x3fffffffU /* Vdd Voltage mask */ #define MMC_OCR_LOW_VOLTAGE (1u << 7) /* Low Voltage Range -- tbd */ +#define MMC_OCR_MIN_VOLTAGE_SHIFT 7 #define MMC_OCR_200_210 (1U << 8) /* Vdd voltage 2.00 ~ 2.10 */ -#define MMC_OCR_MIN_VOLTAGE_SHIFT 8 #define MMC_OCR_210_220 (1U << 9) /* Vdd voltage 2.10 ~ 2.20 */ #define MMC_OCR_220_230 (1U << 10) /* Vdd voltage 2.20 ~ 2.30 */ #define MMC_OCR_230_240 (1U << 11) /* Vdd voltage 2.30 ~ 2.40 */ Modified: stable/10/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/10/sys/dev/mmc/mmcsd.c Wed Jan 18 23:25:46 2017 (r312399) +++ stable/10/sys/dev/mmc/mmcsd.c Wed Jan 18 23:26:10 2017 (r312400) @@ -160,14 +160,13 @@ mmcsd_attach(device_t dev) d->d_dump = mmcsd_dump; d->d_name = "mmcsd"; d->d_drv1 = sc; - d->d_maxsize = 4*1024*1024; /* Maximum defined SD card AU size. */ d->d_sectorsize = mmc_get_sector_size(dev); + d->d_maxsize = mmc_get_max_data(dev) * d->d_sectorsize; d->d_mediasize = (off_t)mmc_get_media_size(dev) * d->d_sectorsize; - d->d_stripeoffset = 0; d->d_stripesize = mmc_get_erase_sector(dev) * d->d_sectorsize; d->d_unit = device_get_unit(dev); d->d_flags = DISKFLAG_CANDELETE; - d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize * 1; /* conservative */ + d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize; strlcpy(d->d_ident, mmc_get_card_sn_string(dev), sizeof(d->d_ident)); strlcpy(d->d_descr, mmc_get_card_id_string(dev), sizeof(d->d_descr)); @@ -545,6 +544,8 @@ mmcsd_task(void *arg) bp->bio_error = EIO; bp->bio_resid = (end - block) * sz; bp->bio_flags |= BIO_ERROR; + } else { + bp->bio_resid = 0; } biodone(bp); } Modified: stable/10/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.c Wed Jan 18 23:25:46 2017 (r312399) +++ stable/10/sys/dev/sdhci/sdhci.c Wed Jan 18 23:26:10 2017 (r312400) @@ -377,6 +377,13 @@ sdhci_set_power(struct sdhci_slot *slot, /* Turn on the power. */ pwr |= SDHCI_POWER_ON; WR1(slot, SDHCI_POWER_CONTROL, pwr); + + if (slot->quirks & SDHCI_QUIRK_INTEL_POWER_UP_RESET) { + WR1(slot, SDHCI_POWER_CONTROL, pwr | 0x10); + DELAY(10); + WR1(slot, SDHCI_POWER_CONTROL, pwr); + DELAY(300); + } } static void @@ -630,9 +637,11 @@ sdhci_init_slot(device_t dev, struct sdh device_printf(dev, "Hardware doesn't specify base clock " "frequency, using %dMHz as default.\n", SDHCI_DEFAULT_MAX_FREQ); } - /* Calculate timeout clock frequency. */ + /* Calculate/set timeout clock frequency. */ if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) { slot->timeout_clk = slot->max_clk / 1000; + } else if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_1MHZ) { + slot->timeout_clk = 1000; } else { slot->timeout_clk = (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; @@ -676,6 +685,8 @@ sdhci_init_slot(device_t dev, struct sdh slot->opt &= ~SDHCI_HAVE_DMA; if (slot->quirks & SDHCI_QUIRK_FORCE_DMA) slot->opt |= SDHCI_HAVE_DMA; + if (slot->quirks & SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE) + slot->opt |= SDHCI_NON_REMOVABLE; /* * Use platform-provided transfer backend @@ -688,8 +699,9 @@ sdhci_init_slot(device_t dev, struct sdh slot_printf(slot, "%uMHz%s %s%s%s%s %s\n", slot->max_clk / 1000000, (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", - (caps & MMC_CAP_8_BIT_DATA) ? "8bits" : - ((caps & MMC_CAP_4_BIT_DATA) ? "4bits" : "1bit"), + (slot->host.caps & MMC_CAP_8_BIT_DATA) ? "8bits" : + ((slot->host.caps & MMC_CAP_4_BIT_DATA) ? "4bits" : + "1bit"), (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", (caps & SDHCI_CAN_VDD_180) ? " 1.8V" : "", Modified: stable/10/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/10/sys/dev/sdhci/sdhci.h Wed Jan 18 23:25:46 2017 (r312399) +++ stable/10/sys/dev/sdhci/sdhci.h Wed Jan 18 23:26:10 2017 (r312400) @@ -66,7 +66,13 @@ /* Alternate clock source is required when supplying a 400 KHz clock. */ #define SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC (1<<16) /* Card insert/remove interrupts don't work, polling required. */ -#define SDHCI_QUIRK_POLL_CARD_PRESENT (1<<17) +#define SDHCI_QUIRK_POLL_CARD_PRESENT (1<<17) +/* All controller slots are non-removable. */ +#define SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE (1<<18) +/* Issue custom Intel controller reset sequence after power-up. */ +#define SDHCI_QUIRK_INTEL_POWER_UP_RESET (1<<19) +/* Data timeout is invalid, use 1 MHz clock instead. */ +#define SDHCI_QUIRK_DATA_TIMEOUT_1MHZ (1<<20) /* * Controller registers @@ -155,6 +161,9 @@ #define SDHCI_CLOCK_CARD_EN 0x0004 #define SDHCI_CLOCK_INT_STABLE 0x0002 #define SDHCI_CLOCK_INT_EN 0x0001 +#define SDHCI_DIVIDERS_MASK \ + ((SDHCI_DIVIDER_MASK << SDHCI_DIVIDER_SHIFT) | \ + (SDHCI_DIVIDER_HI_MASK << SDHCI_DIVIDER_HI_SHIFT)) #define SDHCI_TIMEOUT_CONTROL 0x2E Modified: stable/10/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- stable/10/sys/dev/sdhci/sdhci_pci.c Wed Jan 18 23:25:46 2017 (r312399) +++ stable/10/sys/dev/sdhci/sdhci_pci.c Wed Jan 18 23:26:10 2017 (r312400) @@ -63,15 +63,15 @@ __FBSDID("$FreeBSD$"); #define PCI_SDHCI_IFVENDOR 0x02 #define PCI_SLOT_INFO 0x40 /* 8 bits */ -#define PCI_SLOT_INFO_SLOTS(x) (((x >> 4) & 7) + 1) -#define PCI_SLOT_INFO_FIRST_BAR(x) ((x) & 7) +#define PCI_SLOT_INFO_SLOTS(x) (((x >> 4) & 7) + 1) +#define PCI_SLOT_INFO_FIRST_BAR(x) ((x) & 7) /* * RICOH specific PCI registers */ #define SDHC_PCI_MODE_KEY 0xf9 #define SDHC_PCI_MODE 0x150 -#define SDHC_PCI_MODE_SD20 0x10 +#define SDHC_PCI_MODE_SD20 0x10 #define SDHC_PCI_BASE_FREQ_KEY 0xfc #define SDHC_PCI_BASE_FREQ 0xe1 @@ -107,6 +107,19 @@ static const struct sdhci_device { SDHCI_QUIRK_RESET_AFTER_REQUEST }, { 0x16bc14e4, 0xffff, "Broadcom BCM577xx SDXC/MMC Card Reader", SDHCI_QUIRK_BCM577XX_400KHZ_CLKSRC }, + { 0x0f148086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x0f508086, 0xffff, "Intel Bay Trail eMMC 4.5 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x22948086, 0xffff, "Intel Braswell eMMC 4.5.1 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_DATA_TIMEOUT_1MHZ | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, + { 0x5acc8086, 0xffff, "Intel Apollo Lake eMMC 5.0 Controller", + SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_INTEL_POWER_UP_RESET }, { 0, 0xffff, NULL, 0 } }; @@ -119,8 +132,8 @@ struct sdhci_pci_softc { int num_slots; /* Number of slots on this controller */ struct sdhci_slot slots[6]; struct resource *mem_res[6]; /* Memory resource */ - uint8_t cfg_freq; /* Saved mode */ - uint8_t cfg_mode; /* Saved frequency */ + uint8_t cfg_freq; /* Saved frequency */ + uint8_t cfg_mode; /* Saved mode */ }; static int sdhci_enable_msi = 1; @@ -413,11 +426,16 @@ static int sdhci_pci_resume(device_t dev) { struct sdhci_pci_softc *sc = device_get_softc(dev); - int i; + int i, err; for (i = 0; i < sc->num_slots; i++) sdhci_generic_resume(&sc->slots[i]); - return (bus_generic_resume(dev)); + err = bus_generic_resume(dev); + if (err) + return (err); + if (sc->quirks & SDHCI_QUIRK_LOWER_FREQUENCY) + sdhci_lower_frequency(dev); + return (0); } static void @@ -446,11 +464,11 @@ static device_method_t sdhci_methods[] = DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), /* mmcbr_if */ - DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), - DEVMETHOD(mmcbr_request, sdhci_generic_request), - DEVMETHOD(mmcbr_get_ro, sdhci_generic_get_ro), - DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), - DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), + DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), + DEVMETHOD(mmcbr_request, sdhci_generic_request), + DEVMETHOD(mmcbr_get_ro, sdhci_generic_get_ro), + DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), + DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), /* SDHCI registers accessors */ DEVMETHOD(sdhci_read_1, sdhci_pci_read_1), From owner-svn-src-all@freebsd.org Thu Jan 19 06:44:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A070CB7DC3; Thu, 19 Jan 2017 06:44:29 +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 0F5601E99; Thu, 19 Jan 2017 06:44:28 +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 v0J6iSx0077256; Thu, 19 Jan 2017 06:44:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0J6iSLa077255; Thu, 19 Jan 2017 06:44:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701190644.v0J6iSLa077255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 06:44:28 +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: r312401 - stable/11/libexec/rtld-elf 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, 19 Jan 2017 06:44:29 -0000 Author: kib Date: Thu Jan 19 06:44:27 2017 New Revision: 312401 URL: https://svnweb.freebsd.org/changeset/base/312401 Log: MFC r311984: For the main binary, postpone enforcing relro read-only protection until copy relocations are done. Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Wed Jan 18 23:26:10 2017 (r312400) +++ stable/11/libexec/rtld-elf/rtld.c Thu Jan 19 06:44:27 2017 (r312401) @@ -100,6 +100,7 @@ static int load_needed_objects(Obj_Entry static int load_preload_objects(void); static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int); static void map_stacks_exec(RtldLockState *); +static int obj_enforce_relro(Obj_Entry *); static Obj_Entry *obj_from_addr(const void *); static void objlist_call_fini(Objlist *, Obj_Entry *, RtldLockState *); static void objlist_call_init(Objlist *, RtldLockState *); @@ -613,6 +614,10 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ if (do_copy_relocations(obj_main) == -1) rtld_die(); + dbg("enforcing main obj relro"); + if (obj_enforce_relro(obj_main) == -1) + rtld_die(); + if (getenv(_LD("DUMP_REL_POST")) != NULL) { dump_relocations(obj_main); exit (0); @@ -2711,14 +2716,8 @@ relocate_object(Obj_Entry *obj, bool bin reloc_non_plt(obj, rtldobj, flags | SYMLOOK_IFUNC, lockstate)) return (-1); - if (obj->relro_size > 0) { - if (mprotect(obj->relro_page, obj->relro_size, - PROT_READ) == -1) { - _rtld_error("%s: Cannot enforce relro protection: %s", - obj->path, rtld_strerror(errno)); - return (-1); - } - } + if (!obj->mainprog && obj_enforce_relro(obj) == -1) + return (-1); /* * Set up the magic number and version in the Obj_Entry. These @@ -5061,6 +5060,19 @@ _rtld_is_dlopened(void *arg) return (res); } +int +obj_enforce_relro(Obj_Entry *obj) +{ + + if (obj->relro_size > 0 && mprotect(obj->relro_page, obj->relro_size, + PROT_READ) == -1) { + _rtld_error("%s: Cannot enforce relro protection: %s", + obj->path, rtld_strerror(errno)); + return (-1); + } + return (0); +} + static void map_stacks_exec(RtldLockState *lockstate) { From owner-svn-src-all@freebsd.org Thu Jan 19 06:48:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AE66CB7E98; Thu, 19 Jan 2017 06:48:04 +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 3D7C51042; Thu, 19 Jan 2017 06:48:04 +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 v0J6m3pd077438; Thu, 19 Jan 2017 06:48:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0J6m39p077437; Thu, 19 Jan 2017 06:48:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701190648.v0J6m39p077437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 06:48: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: r312402 - stable/10/libexec/rtld-elf 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, 19 Jan 2017 06:48:04 -0000 Author: kib Date: Thu Jan 19 06:48:03 2017 New Revision: 312402 URL: https://svnweb.freebsd.org/changeset/base/312402 Log: MFC r311984: For the main binary, postpone enforcing relro read-only protection until copy relocations are done. Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Thu Jan 19 06:44:27 2017 (r312401) +++ stable/10/libexec/rtld-elf/rtld.c Thu Jan 19 06:48:03 2017 (r312402) @@ -104,6 +104,7 @@ static int load_needed_objects(Obj_Entry static int load_preload_objects(void); static Obj_Entry *load_object(const char *, int fd, const Obj_Entry *, int); static void map_stacks_exec(RtldLockState *); +static int obj_enforce_relro(Obj_Entry *); static Obj_Entry *obj_from_addr(const void *); static void objlist_call_fini(Objlist *, Obj_Entry *, RtldLockState *); static void objlist_call_init(Objlist *, RtldLockState *); @@ -609,6 +610,10 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ if (do_copy_relocations(obj_main) == -1) rtld_die(); + dbg("enforcing main obj relro"); + if (obj_enforce_relro(obj_main) == -1) + rtld_die(); + if (getenv(LD_ "DUMP_REL_POST") != NULL) { dump_relocations(obj_main); exit (0); @@ -2691,14 +2696,8 @@ relocate_object(Obj_Entry *obj, bool bin reloc_non_plt(obj, rtldobj, flags | SYMLOOK_IFUNC, lockstate)) return (-1); - if (obj->relro_size > 0) { - if (mprotect(obj->relro_page, obj->relro_size, - PROT_READ) == -1) { - _rtld_error("%s: Cannot enforce relro protection: %s", - obj->path, rtld_strerror(errno)); - return (-1); - } - } + if (!obj->mainprog && obj_enforce_relro(obj) == -1) + return (-1); /* * Set up the magic number and version in the Obj_Entry. These @@ -4986,6 +4985,19 @@ _rtld_is_dlopened(void *arg) return (res); } +int +obj_enforce_relro(Obj_Entry *obj) +{ + + if (obj->relro_size > 0 && mprotect(obj->relro_page, obj->relro_size, + PROT_READ) == -1) { + _rtld_error("%s: Cannot enforce relro protection: %s", + obj->path, rtld_strerror(errno)); + return (-1); + } + return (0); +} + static void map_stacks_exec(RtldLockState *lockstate) { From owner-svn-src-all@freebsd.org Thu Jan 19 07:29:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67FB1CB7ADA; Thu, 19 Jan 2017 07:29:54 +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 309921396; Thu, 19 Jan 2017 07:29:54 +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 v0J7TrvL093829; Thu, 19 Jan 2017 07:29:53 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0J7Tr90093826; Thu, 19 Jan 2017 07:29:53 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701190729.v0J7Tr90093826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 19 Jan 2017 07:29: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: r312403 - in stable/10: lib/libstand sys/boot/libstand32 sys/boot/userboot/libstand 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, 19 Jan 2017 07:29:54 -0000 Author: delphij Date: Thu Jan 19 07:29:52 2017 New Revision: 312403 URL: https://svnweb.freebsd.org/changeset/base/312403 Log: MFC r293040,293341,293435: Reduce libstand Makefile duplication. PR: 216251 Modified: stable/10/lib/libstand/Makefile stable/10/sys/boot/libstand32/Makefile stable/10/sys/boot/userboot/libstand/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libstand/Makefile ============================================================================== --- stable/10/lib/libstand/Makefile Thu Jan 19 06:48:03 2017 (r312402) +++ stable/10/lib/libstand/Makefile Thu Jan 19 07:29:52 2017 (r312403) @@ -9,16 +9,20 @@ .include MK_SSP= no +LIBSTAND_SRC?= ${.CURDIR} +LIBSTAND_CPUARCH?=${MACHINE_CPUARCH} +LIBC_SRC= ${LIBSTAND_SRC}/../libc + LIB= stand NO_PROFILE= NO_PIC= -INCS= stand.h -MAN= libstand.3 +INCS?= stand.h +MAN?= libstand.3 WARNS?= 0 CFLAGS+= -ffreestanding -Wformat -CFLAGS+= -I${.CURDIR} +CFLAGS+= -I${LIBSTAND_SRC} .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float @@ -50,12 +54,12 @@ SRCS+= gzguts.h zutil.h __main.c assert. # private (pruned) versions of libc string functions SRCS+= strcasecmp.c -.PATH: ${.CURDIR}/../libc/net +.PATH: ${LIBC_SRC}/net SRCS+= ntoh.c # string functions from libc -.PATH: ${.CURDIR}/../libc/string +.PATH: ${LIBC_SRC}/string .if ${MACHINE_CPUARCH} != "ia64" SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ @@ -63,60 +67,60 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c memc strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .endif .if ${MACHINE_CPUARCH} == "arm" -.PATH: ${.CURDIR}/../libc/arm/gen +.PATH: ${LIBC_SRC}/arm/gen .if ${MK_ARM_EABI} == "no" SRCS+= divsi3.S .else # Compiler support functions -.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/ +.PATH: ${LIBSTAND_SRC}/../../contrib/compiler-rt/lib/ # __clzsi2 and ctzsi2 for various builtin functions SRCS+= clzsi2.c ctzsi2.c # Divide and modulus functions called by the compiler SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c -.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/arm/ +.PATH: ${LIBSTAND_SRC}/../../contrib/compiler-rt/lib/arm/ SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S .endif .endif .if ${MACHINE_CPUARCH} == "ia64" -.PATH: ${.CURDIR}/../libc/ia64/string +.PATH: ${LIBC_SRC}/ia64/string SRCS+= bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \ memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \ strlcat.c strlcpy.c \ strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \ strspn.c strstr.c strtok.c swab.c -.PATH: ${.CURDIR}/../libc/ia64/gen +.PATH: ${LIBC_SRC}/ia64/gen SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S .endif .if ${MACHINE_CPUARCH} == "powerpc" -.PATH: ${.CURDIR}/../libc/quad +.PATH: ${LIBC_SRC}/quad SRCS+= ashldi3.c ashrdi3.c -.PATH: ${.CURDIR}/../libc/powerpc/gen +.PATH: ${LIBC_SRC}/powerpc/gen SRCS+= syncicache.c .endif # uuid functions from libc -.PATH: ${.CURDIR}/../libc/uuid +.PATH: ${LIBC_SRC}/uuid SRCS+= uuid_equal.c uuid_is_nil.c # _setjmp/_longjmp .if ${MACHINE_ARCH} == "powerpc64" -.PATH: ${.CURDIR}/powerpc +.PATH: ${LIBSTAND_SRC}/powerpc .else -.PATH: ${.CURDIR}/${MACHINE_CPUARCH} +.PATH: ${LIBSTAND_SRC}/${LIBSTAND_CPUARCH} .endif SRCS+= _setjmp.S # decompression functionality from libbz2 # NOTE: to actually test this functionality after libbz2 upgrade compile # loader(8) with LOADER_BZIP2_SUPPORT defined -.PATH: ${.CURDIR}/../../contrib/bzip2 +.PATH: ${LIBSTAND_SRC}/../../contrib/bzip2 CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS SRCS+= libstand_bzlib_private.h @@ -134,8 +138,8 @@ libstand_bzlib_private.h: bzlib_private. ${.ALLSRC} > ${.TARGET} # decompression functionality from libz -.PATH: ${.CURDIR}/../../contrib/zlib -CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../../contrib/zlib +.PATH: ${LIBSTAND_SRC}/../../contrib/zlib +CFLAGS+=-DHAVE_MEMCPY -I${LIBSTAND_SRC}/../../contrib/zlib SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h .for file in infback.c inffast.c inflate.c inftrees.c zutil.c Modified: stable/10/sys/boot/libstand32/Makefile ============================================================================== --- stable/10/sys/boot/libstand32/Makefile Thu Jan 19 06:48:03 2017 (r312402) +++ stable/10/sys/boot/libstand32/Makefile Thu Jan 19 07:29:52 2017 (r312403) @@ -1,189 +1,27 @@ # $FreeBSD$ -# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $ -# -# Notes: -# - We don't use the libc strerror/sys_errlist because the string table is -# quite large. -# - -MAN= .include -MK_SSP= no - -S= ${.CURDIR}/../../../lib/libstand - -.PATH: ${S} -LIB= stand -INTERNALLIB= -NO_PROFILE= -NO_PIC= - -WARNS?= 0 - -CFLAGS+= -ffreestanding -Wformat -CFLAGS+= -I${S} - -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float -.endif -.if ${MACHINE} == "pc98" -CFLAGS+= -Os -.endif -.if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG -.endif -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" -CFLAGS+= -m32 -I. -.endif -.if ${MACHINE_CPUARCH} == "arm" -CFLAGS+= -msoft-float -D_STANDALONE -.endif -.if ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -G0 -fno-pic -mno-abicalls -.endif - -# standalone components and stuff we have modified locally -SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ - globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ - sbrk.c twiddle.c zalloc.c zalloc_malloc.c - -# private (pruned) versions of libc string functions -SRCS+= strcasecmp.c - -LIBC= ${S}/../libc - -.PATH: ${LIBC}/net - -SRCS+= ntoh.c - -# string functions from libc -.PATH: ${LIBC}/string -.if ${MACHINE_CPUARCH} != "ia64" -SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ - memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ - strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ - strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c -.endif -.if ${MACHINE_CPUARCH} == "arm" -.PATH: ${LIBC}/arm/gen -.if ${MK_ARM_EABI} == "no" -SRCS+= divsi3.S -.else -# Compiler support functions -.PATH: ${.CURDIR}/../../../contrib/compiler-rt/lib/ -# __clzsi2 and ctzsi2 for various builtin functions -SRCS+= clzsi2.c ctzsi2.c -# Divide and modulus functions called by the compiler -SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c -SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c - -.PATH: ${.CURDIR}/../../../contrib/compiler-rt/lib/arm/ -SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S -SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S -.endif +LIBSTAND_SRC= ${.CURDIR}/../../../lib/libstand -.endif -.if ${MACHINE_CPUARCH} == "ia64" -.PATH: ${LIBC}/ia64/string -SRCS+= bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \ - memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \ - strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \ - strspn.c strstr.c strtok.c swab.c - -.PATH: ${LIBC}/ia64/gen -SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S -SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S -.endif -.if ${MACHINE_CPUARCH} == "powerpc" -.PATH: ${LIBC}/quad -SRCS+= ashldi3.c ashrdi3.c -.PATH: ${LIBC}/powerpc/gen -SRCS+= syncicache.c -.endif - -# uuid functions from libc -.PATH: ${LIBC}/uuid -SRCS+= uuid_equal.c uuid_is_nil.c - -# _setjmp/_longjmp .if ${MACHINE_CPUARCH} == "amd64" -.PATH: ${S}/i386 -.elif ${MACHINE_ARCH} == "powerpc64" -.PATH: ${S}/powerpc +LIBSTAND_CPUARCH=i386 .else -.PATH: ${S}/${MACHINE_CPUARCH} +LIBSTAND_CPUARCH=${MACHINE_CPUARCH} .endif -SRCS+= _setjmp.S +LIBC_SRC= ${LIBSTAND_SRC}/../libc +INTERNALLIB= +INCS= +MAN= +.PATH: ${LIBSTAND_SRC} -# decompression functionality from libbz2 -# NOTE: to actually test this functionality after libbz2 upgrade compile -# loader(8) with LOADER_BZIP2_SUPPORT defined -.PATH: ${.CURDIR}/../../../contrib/bzip2 -CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS -SRCS+= libstand_bzlib_private.h - -.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c -SRCS+= _${file} -CLEANFILES+= _${file} - -_${file}: ${file} - sed "s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET} -.endfor - -CLEANFILES+= libstand_bzlib_private.h -libstand_bzlib_private.h: bzlib_private.h - sed -e 's||"stand.h"|' \ - ${.ALLSRC} > ${.TARGET} - -# decompression functionality from libz -.PATH: ${S}/../libz -CFLAGS+=-DHAVE_MEMCPY -I${S}/../libz -SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h - -.for file in infback.c inffast.c inflate.c inftrees.c zutil.c -SRCS+= _${file} -CLEANFILES+= _${file} - -_${file}: ${file} - sed -e "s|zutil\.h|libstand_zutil.h|" \ - -e "s|gzguts\.h|libstand_gzguts.h|" \ - ${.ALLSRC} > ${.TARGET} -.endfor - -# depend on stand.h being able to be included multiple times -.for file in zutil.h gzguts.h -CLEANFILES+= libstand_${file} -libstand_${file}: ${file} - sed -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - ${.ALLSRC} > ${.TARGET} -.endfor - -# io routines -SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ - fstat.c close.c lseek.c open.c read.c write.c readdir.c - -# network routines -SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c - -# network info services: -SRCS+= bootp.c rarp.c bootparam.c - -# boot filesystems -SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c -SRCS+= dosfs.c ext2fs.c -SRCS+= splitfs.c -.if ${MK_NAND} != "no" -SRCS+= nandfs.c +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -m32 -I. .endif -.include +WARNS?= 0 + +.include "${LIBSTAND_SRC}/Makefile" .if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine Modified: stable/10/sys/boot/userboot/libstand/Makefile ============================================================================== --- stable/10/sys/boot/userboot/libstand/Makefile Thu Jan 19 06:48:03 2017 (r312402) +++ stable/10/sys/boot/userboot/libstand/Makefile Thu Jan 19 07:29:52 2017 (r312403) @@ -1,166 +1,12 @@ # $FreeBSD$ -# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $ -# -# Notes: -# - We don't use the libc strerror/sys_errlist because the string table is -# quite large. -# - -MAN= .include -MK_SSP= no -S= ${.CURDIR}/../../../../lib/libstand +LIBSTAND_SRC= ${.CURDIR}/../../../../lib/libstand -.PATH: ${S} -LIB= stand INTERNALLIB= -NO_PROFILE= -NO_PIC= - -WARNS?= 0 - -CFLAGS+= -ffreestanding -Wformat -fPIC -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand - -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -.endif -.if ${MACHINE_CPUARCH} == "i386" -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= -mno-sse3 -.endif -.if ${MACHINE} == "pc98" -CFLAGS+= -Os -.endif -.if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -msoft-float -D_STANDALONE -DNETIF_DEBUG -.endif -.if ${MACHINE_CPUARCH} == "arm" -CFLAGS+= -msoft-float -D_STANDALONE -.endif - -# standalone components and stuff we have modified locally -SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ - globals.c pager.c printf.c strdup.c strerror.c strtol.c random.c \ - sbrk.c twiddle.c zalloc.c zalloc_malloc.c - -# private (pruned) versions of libc string functions -SRCS+= strcasecmp.c - -LIBC= ${.CURDIR}/../../../../lib/libc - -.PATH: ${LIBC}/net - -SRCS+= ntoh.c - -# string functions from libc -.PATH: ${LIBC}/string -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \ - ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "arm" -SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ - memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ - strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ - strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c -.endif -.if ${MACHINE_CPUARCH} == "arm" -.PATH: ${LIBC}/arm/gen -SRCS+= divsi3.S -.endif -.if ${MACHINE_CPUARCH} == "ia64" -.PATH: ${LIBC}/ia64/string -SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \ - memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \ - strcmp.c strcpy.c strcspn.c strlen.c \ - strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \ - strspn.c strstr.c strtok.c swab.c - -.PATH: ${LIBC}/ia64/gen -SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S -SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S -.endif -.if ${MACHINE_CPUARCH} == "powerpc" -.PATH: ${LIBC}/libc/quad -SRCS+= ashldi3.c ashrdi3.c -.PATH: ${LIBC}/powerpc/gen -SRCS+= syncicache.c -.endif - -# uuid functions from libc -.PATH: ${LIBC}/uuid -SRCS+= uuid_equal.c uuid_is_nil.c - -# _setjmp/_longjmp -.if ${MACHINE_CPUARCH} == "amd64" -.PATH: ${S}/amd64 -.elif ${MACHINE_ARCH} == "powerpc64" -.PATH: ${S}/powerpc -.else -.PATH: ${S}/${MACHINE_CPUARCH} -.endif -SRCS+= _setjmp.S - -# decompression functionality from libbz2 -# NOTE: to actually test this functionality after libbz2 upgrade compile -# loader(8) with LOADER_BZIP2_SUPPORT defined -.PATH: ${.CURDIR}/../../../../contrib/bzip2 -CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS -SRCS+= libstand_bzlib_private.h - -.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c -SRCS+= _${file} -CLEANFILES+= _${file} - -_${file}: ${file} - sed "s|bzlib_private\.h|libstand_bzlib_private.h|" ${.ALLSRC} > ${.TARGET} -.endfor - -CLEANFILES+= libstand_bzlib_private.h -libstand_bzlib_private.h: bzlib_private.h - sed -e 's||"stand.h"|' \ - ${.ALLSRC} > ${.TARGET} - -# decompression functionality from libz -.PATH: ${.CURDIR}/../../../../lib/libz -CFLAGS+=-DHAVE_MEMCPY -I${.CURDIR}/../../../../lib/libz -SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h - -.for file in infback.c inffast.c inflate.c inftrees.c zutil.c -SRCS+= _${file} -CLEANFILES+= _${file} - -_${file}: ${file} - sed -e "s|zutil\.h|libstand_zutil.h|" \ - -e "s|gzguts\.h|libstand_gzguts.h|" ${.ALLSRC} > ${.TARGET} -.endfor - -# depend on stand.h being able to be included multiple times -.for file in zutil.h gzguts.h -CLEANFILES+= libstand_${file} -libstand_${file}: ${file} - sed -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - -e 's||"stand.h"|' \ - ${.ALLSRC} > ${.TARGET} -.endfor - -# io routines -SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ - fstat.c close.c lseek.c open.c read.c write.c readdir.c - -# network routines -SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c - -# network info services: -SRCS+= bootp.c rarp.c bootparam.c - -# boot filesystems -SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c -SRCS+= dosfs.c ext2fs.c -SRCS+= splitfs.c +INCS= +MAN= +.PATH: ${LIBSTAND_SRC} -.include +.include "${LIBSTAND_SRC}/Makefile" From owner-svn-src-all@freebsd.org Thu Jan 19 08:01:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E059CB7D3E; Thu, 19 Jan 2017 08:01:36 +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 5B734186E; Thu, 19 Jan 2017 08:01:36 +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 v0J81ZFJ008268; Thu, 19 Jan 2017 08:01:35 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0J81ZG9008267; Thu, 19 Jan 2017 08:01:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701190801.v0J81ZG9008267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 19 Jan 2017 08:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312404 - head/usr.bin/sed 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, 19 Jan 2017 08:01:36 -0000 Author: delphij Date: Thu Jan 19 08:01:35 2017 New Revision: 312404 URL: https://svnweb.freebsd.org/changeset/base/312404 Log: Use S_ISREG instead of manual & (also it's better to compare the result from & and the pattern instead of just assuming it's one bit value). Pointed out by Tianjie Mao . MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D4827 Modified: head/usr.bin/sed/main.c Modified: head/usr.bin/sed/main.c ============================================================================== --- head/usr.bin/sed/main.c Thu Jan 19 07:29:52 2017 (r312403) +++ head/usr.bin/sed/main.c Thu Jan 19 08:01:35 2017 (r312404) @@ -391,7 +391,7 @@ mf_fgets(SPACE *sp, enum e_spflag spflag if (inplace != NULL) { if (lstat(fname, &sb) != 0) err(1, "%s", fname); - if (!(sb.st_mode & S_IFREG)) + if (!S_ISREG(sb.st_mode)) errx(1, "%s: %s %s", fname, "in-place editing only", "works for regular files"); From owner-svn-src-all@freebsd.org Thu Jan 19 09:24:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12776CB7F73 for ; Thu, 19 Jan 2017 09:24:50 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from smtp.smtpout.orange.fr (smtp13.smtpout.orange.fr [80.12.242.135]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AC361240 for ; Thu, 19 Jan 2017 09:24:48 +0000 (UTC) (envelope-from olivier@freebsd.org) Received: from mail-qt0-f175.google.com ([209.85.216.175]) by mwinf5d72 with ME id a9Qe1u00T3neHNR039Qf85; Thu, 19 Jan 2017 10:24:40 +0100 X-ME-Helo: mail-qt0-f175.google.com X-ME-Auth: Y29jaGFyZC1sYWJiZS5vbGl2aWVyQG9yYW5nZS5mcg== X-ME-Date: Thu, 19 Jan 2017 10:24:40 +0100 X-ME-IP: 209.85.216.175 Received: by mail-qt0-f175.google.com with SMTP id x49so57729434qtc.2; Thu, 19 Jan 2017 01:24:39 -0800 (PST) X-Gm-Message-State: AIkVDXLofN7kx0chEn21qksgTfVQ+x7A1xm54J9h17rY9fCpF5duY+R6NOwPbSVK33s/alJHyU/w+rlTF5VYng== X-Received: by 10.55.180.129 with SMTP id d123mr6794761qkf.158.1484817878289; Thu, 19 Jan 2017 01:24:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.49.99 with HTTP; Thu, 19 Jan 2017 01:24:17 -0800 (PST) In-Reply-To: <201701182024.v0IKObaC021450@repo.freebsd.org> References: <201701182024.v0IKObaC021450@repo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Thu, 19 Jan 2017 10:24:17 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r312395 - head/sbin/devd To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Thu, 19 Jan 2017 09:24:50 -0000 On Wed, Jan 18, 2017 at 9:24 PM, Alan Somers wrote: > Author: asomers > Date: Wed Jan 18 20:24:37 2017 > New Revision: 312395 > URL: https://svnweb.freebsd.org/changeset/base/312395 > > Log: > Fix several Coverity CIDs in devd > > =E2=80=8BHi, this break buildworld for mips arch: =E2=80=8B =E2=80=8B --- devd.o --- /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc: In function 'void event_loop()': /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: error: expected type-specifier /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: error: expected unqualified-id before 'e' /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: error: expected `)' before 'e' /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: error: expected `{' before 'e' /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: error: 'e' was not declared in this scope /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: error: expected `;' before ')' token --- all_subdir_sbin/hastd --- =E2=80=8B From owner-svn-src-all@freebsd.org Thu Jan 19 11:16:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0B49CB850A; Thu, 19 Jan 2017 11:16:27 +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 914151C6A; Thu, 19 Jan 2017 11:16:27 +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 v0JBGQM9086331; Thu, 19 Jan 2017 11:16:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JBGQ1n086325; Thu, 19 Jan 2017 11:16:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701191116.v0JBGQ1n086325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 19 Jan 2017 11:16: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: r312405 - in stable/11/sys: cam/nvme dev/mmc dev/nand dev/nvd geom 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, 19 Jan 2017 11:16:27 -0000 Author: mav Date: Thu Jan 19 11:16:25 2017 New Revision: 312405 URL: https://svnweb.freebsd.org/changeset/base/312405 Log: MFC r311971: Report random flash storage as non-rotating to GEOM_DISK. While doing it, introduce respective constants in geom_disk.h. Modified: stable/11/sys/cam/nvme/nvme_da.c stable/11/sys/dev/mmc/mmcsd.c stable/11/sys/dev/nand/nand_geom.c stable/11/sys/dev/nvd/nvd.c stable/11/sys/geom/geom_disk.c stable/11/sys/geom/geom_disk.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/nvme/nvme_da.c ============================================================================== --- stable/11/sys/cam/nvme/nvme_da.c Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/cam/nvme/nvme_da.c Thu Jan 19 11:16:25 2017 (r312405) @@ -761,7 +761,7 @@ ndaregister(struct cam_periph *periph, v MIN(sizeof(softc->disk->d_descr), sizeof(cd->mn))); strlcpy(softc->disk->d_ident, cd->sn, MIN(sizeof(softc->disk->d_ident), sizeof(cd->sn))); - disk->d_rotation_rate = 0; /* Spinning rust need not apply */ + disk->d_rotation_rate = DISK_RR_NON_ROTATING; disk->d_open = ndaopen; disk->d_close = ndaclose; disk->d_strategy = ndastrategy; Modified: stable/11/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/11/sys/dev/mmc/mmcsd.c Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/dev/mmc/mmcsd.c Thu Jan 19 11:16:25 2017 (r312405) @@ -170,6 +170,7 @@ mmcsd_attach(device_t dev) d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize; strlcpy(d->d_ident, mmc_get_card_sn_string(dev), sizeof(d->d_ident)); strlcpy(d->d_descr, mmc_get_card_id_string(dev), sizeof(d->d_descr)); + d->d_rotation_rate = DISK_RR_NON_ROTATING; /* * Display in most natural units. There's no cards < 1MB. The SD Modified: stable/11/sys/dev/nand/nand_geom.c ============================================================================== --- stable/11/sys/dev/nand/nand_geom.c Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/dev/nand/nand_geom.c Thu Jan 19 11:16:25 2017 (r312405) @@ -394,6 +394,7 @@ create_geom_disk(struct nand_chip *chip) snprintf(ndisk->d_ident, sizeof(ndisk->d_ident), "nand: Man:0x%02x Dev:0x%02x", chip->id.man_id, chip->id.dev_id); + ndisk->d_rotation_rate = DISK_RR_NON_ROTATING; disk_create(ndisk, DISK_VERSION); @@ -415,6 +416,7 @@ create_geom_disk(struct nand_chip *chip) snprintf(rdisk->d_ident, sizeof(rdisk->d_ident), "nand_raw: Man:0x%02x Dev:0x%02x", chip->id.man_id, chip->id.dev_id); + disk->d_rotation_rate = DISK_RR_NON_ROTATING; disk_create(rdisk, DISK_VERSION); Modified: stable/11/sys/dev/nvd/nvd.c ============================================================================== --- stable/11/sys/dev/nvd/nvd.c Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/dev/nvd/nvd.c Thu Jan 19 11:16:25 2017 (r312405) @@ -338,13 +338,11 @@ nvd_new_disk(struct nvme_namespace *ns, */ nvme_strvis(disk->d_ident, nvme_ns_get_serial_number(ns), sizeof(disk->d_ident), NVME_SERIAL_NUMBER_LENGTH); - nvme_strvis(descr, nvme_ns_get_model_number(ns), sizeof(descr), NVME_MODEL_NUMBER_LENGTH); - -#if __FreeBSD_version >= 900034 strlcpy(disk->d_descr, descr, sizeof(descr)); -#endif + + disk->d_rotation_rate = DISK_RR_NON_ROTATING; ndisk->ns = ns; ndisk->disk = disk; Modified: stable/11/sys/geom/geom_disk.c ============================================================================== --- stable/11/sys/geom/geom_disk.c Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/geom/geom_disk.c Thu Jan 19 11:16:25 2017 (r312405) @@ -586,12 +586,12 @@ g_disk_dumpconf(struct sbuf *sb, const c * special cases, and there's also a valid range. */ sbuf_printf(sb, "%s", indent); - if (dp->d_rotation_rate == 0) /* Old drives don't */ - sbuf_printf(sb, "unknown"); /* report RPM. */ - else if (dp->d_rotation_rate == 1) /* Since 0 is used */ - sbuf_printf(sb, "0"); /* above, SSDs use 1. */ - else if ((dp->d_rotation_rate >= 0x041) && - (dp->d_rotation_rate <= 0xfffe)) + if (dp->d_rotation_rate == DISK_RR_UNKNOWN) /* Old drives */ + sbuf_printf(sb, "unknown"); /* don't report RPM. */ + else if (dp->d_rotation_rate == DISK_RR_NON_ROTATING) + sbuf_printf(sb, "0"); + else if ((dp->d_rotation_rate >= DISK_RR_MIN) && + (dp->d_rotation_rate <= DISK_RR_MAX)) sbuf_printf(sb, "%u", dp->d_rotation_rate); else sbuf_printf(sb, "invalid"); Modified: stable/11/sys/geom/geom_disk.h ============================================================================== --- stable/11/sys/geom/geom_disk.h Thu Jan 19 08:01:35 2017 (r312404) +++ stable/11/sys/geom/geom_disk.h Thu Jan 19 11:16:25 2017 (r312405) @@ -119,6 +119,11 @@ struct disk { #define DISKFLAG_DIRECT_COMPLETION 0x20 #define DISKFLAG_CANZONE 0x80 +#define DISK_RR_UNKNOWN 0 +#define DISK_RR_NON_ROTATING 1 +#define DISK_RR_MIN 0x0401 +#define DISK_RR_MAX 0xfffe + struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); void disk_destroy(struct disk *disk); From owner-svn-src-all@freebsd.org Thu Jan 19 11:17:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A651CCB8582; Thu, 19 Jan 2017 11:17:11 +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 80E0F1DD3; Thu, 19 Jan 2017 11:17:11 +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 v0JBHAsb086420; Thu, 19 Jan 2017 11:17:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JBHAou086415; Thu, 19 Jan 2017 11:17:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701191117.v0JBHAou086415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 19 Jan 2017 11:17: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: r312406 - in stable/10/sys: dev/mmc dev/nand dev/nvd geom 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, 19 Jan 2017 11:17:11 -0000 Author: mav Date: Thu Jan 19 11:17:09 2017 New Revision: 312406 URL: https://svnweb.freebsd.org/changeset/base/312406 Log: MFC r311971: Report random flash storage as non-rotating to GEOM_DISK. While doing it, introduce respective constants in geom_disk.h. Modified: stable/10/sys/dev/mmc/mmcsd.c stable/10/sys/dev/nand/nand_geom.c stable/10/sys/dev/nvd/nvd.c stable/10/sys/geom/geom_disk.c stable/10/sys/geom/geom_disk.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mmc/mmcsd.c ============================================================================== --- stable/10/sys/dev/mmc/mmcsd.c Thu Jan 19 11:16:25 2017 (r312405) +++ stable/10/sys/dev/mmc/mmcsd.c Thu Jan 19 11:17:09 2017 (r312406) @@ -169,6 +169,7 @@ mmcsd_attach(device_t dev) d->d_delmaxsize = mmc_get_erase_sector(dev) * d->d_sectorsize; strlcpy(d->d_ident, mmc_get_card_sn_string(dev), sizeof(d->d_ident)); strlcpy(d->d_descr, mmc_get_card_id_string(dev), sizeof(d->d_descr)); + d->d_rotation_rate = DISK_RR_NON_ROTATING; /* * Display in most natural units. There's no cards < 1MB. The SD Modified: stable/10/sys/dev/nand/nand_geom.c ============================================================================== --- stable/10/sys/dev/nand/nand_geom.c Thu Jan 19 11:16:25 2017 (r312405) +++ stable/10/sys/dev/nand/nand_geom.c Thu Jan 19 11:17:09 2017 (r312406) @@ -394,6 +394,7 @@ create_geom_disk(struct nand_chip *chip) snprintf(ndisk->d_ident, sizeof(ndisk->d_ident), "nand: Man:0x%02x Dev:0x%02x", chip->id.man_id, chip->id.dev_id); + ndisk->d_rotation_rate = DISK_RR_NON_ROTATING; disk_create(ndisk, DISK_VERSION); @@ -415,6 +416,7 @@ create_geom_disk(struct nand_chip *chip) snprintf(rdisk->d_ident, sizeof(rdisk->d_ident), "nand_raw: Man:0x%02x Dev:0x%02x", chip->id.man_id, chip->id.dev_id); + disk->d_rotation_rate = DISK_RR_NON_ROTATING; disk_create(rdisk, DISK_VERSION); Modified: stable/10/sys/dev/nvd/nvd.c ============================================================================== --- stable/10/sys/dev/nvd/nvd.c Thu Jan 19 11:16:25 2017 (r312405) +++ stable/10/sys/dev/nvd/nvd.c Thu Jan 19 11:17:09 2017 (r312406) @@ -338,13 +338,11 @@ nvd_new_disk(struct nvme_namespace *ns, */ nvme_strvis(disk->d_ident, nvme_ns_get_serial_number(ns), sizeof(disk->d_ident), NVME_SERIAL_NUMBER_LENGTH); - nvme_strvis(descr, nvme_ns_get_model_number(ns), sizeof(descr), NVME_MODEL_NUMBER_LENGTH); - -#if __FreeBSD_version >= 900034 strlcpy(disk->d_descr, descr, sizeof(descr)); -#endif + + disk->d_rotation_rate = DISK_RR_NON_ROTATING; ndisk->ns = ns; ndisk->disk = disk; Modified: stable/10/sys/geom/geom_disk.c ============================================================================== --- stable/10/sys/geom/geom_disk.c Thu Jan 19 11:16:25 2017 (r312405) +++ stable/10/sys/geom/geom_disk.c Thu Jan 19 11:17:09 2017 (r312406) @@ -589,12 +589,12 @@ g_disk_dumpconf(struct sbuf *sb, const c * special cases, and there's also a valid range. */ sbuf_printf(sb, "%s", indent); - if (dp->d_rotation_rate == 0) /* Old drives don't */ - sbuf_printf(sb, "unknown"); /* report RPM. */ - else if (dp->d_rotation_rate == 1) /* Since 0 is used */ - sbuf_printf(sb, "0"); /* above, SSDs use 1. */ - else if ((dp->d_rotation_rate >= 0x041) && - (dp->d_rotation_rate <= 0xfffe)) + if (dp->d_rotation_rate == DISK_RR_UNKNOWN) /* Old drives */ + sbuf_printf(sb, "unknown"); /* don't report RPM. */ + else if (dp->d_rotation_rate == DISK_RR_NON_ROTATING) + sbuf_printf(sb, "0"); + else if ((dp->d_rotation_rate >= DISK_RR_MIN) && + (dp->d_rotation_rate <= DISK_RR_MAX)) sbuf_printf(sb, "%u", dp->d_rotation_rate); else sbuf_printf(sb, "invalid"); Modified: stable/10/sys/geom/geom_disk.h ============================================================================== --- stable/10/sys/geom/geom_disk.h Thu Jan 19 11:16:25 2017 (r312405) +++ stable/10/sys/geom/geom_disk.h Thu Jan 19 11:17:09 2017 (r312406) @@ -113,6 +113,11 @@ struct disk { #define DISKFLAG_DIRECT_COMPLETION 0x20 #define DISKFLAG_LACKS_ROTRATE 0x40 +#define DISK_RR_UNKNOWN 0 +#define DISK_RR_NON_ROTATING 1 +#define DISK_RR_MIN 0x0401 +#define DISK_RR_MAX 0xfffe + struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); void disk_destroy(struct disk *disk); From owner-svn-src-all@freebsd.org Thu Jan 19 13:35:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E2C8CB7793; Thu, 19 Jan 2017 13:35:15 +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 1DF4A170E; Thu, 19 Jan 2017 13:35:15 +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 v0JDZE9K044294; Thu, 19 Jan 2017 13:35:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JDZEQG044293; Thu, 19 Jan 2017 13:35:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191335.v0JDZEQG044293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 13:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312407 - head/sys/fs/tmpfs 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, 19 Jan 2017 13:35:15 -0000 Author: kib Date: Thu Jan 19 13:35:14 2017 New Revision: 312407 URL: https://svnweb.freebsd.org/changeset/base/312407 Log: Remove unused union member, fifos on tmpfs are implemented in common code. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs.h Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 11:17:09 2017 (r312406) +++ head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 13:35:14 2017 (r312407) @@ -259,12 +259,6 @@ struct tmpfs_node { vm_object_t tn_aobj; }tn_reg; - - /* Valid when tn_type = VFIFO */ - struct tn_fifo { - fo_rdwr_t *tn_fo_read; - fo_rdwr_t *tn_fo_write; - }tn_fifo; }tn_spec; }; LIST_HEAD(tmpfs_node_list, tmpfs_node); From owner-svn-src-all@freebsd.org Thu Jan 19 14:05:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E6A1CB7243; Thu, 19 Jan 2017 14:05:51 +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 06A761C0D; Thu, 19 Jan 2017 14:05:50 +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 v0JE5oMm057834; Thu, 19 Jan 2017 14:05:50 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JE5o5b057833; Thu, 19 Jan 2017 14:05:50 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701191405.v0JE5o5b057833@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, 19 Jan 2017 14:05:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312408 - 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, 19 Jan 2017 14:05:51 -0000 Author: loos Date: Thu Jan 19 14:05:49 2017 New Revision: 312408 URL: https://svnweb.freebsd.org/changeset/base/312408 Log: The port number and the to_port_en flag are valid only on SOP descriptor. 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 Jan 19 13:35:14 2017 (r312407) +++ head/sys/arm/ti/cpsw/if_cpsw.c Thu Jan 19 14:05:49 2017 (r312408) @@ -1800,13 +1800,8 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) struct cpsw_cpdma_bd bd; struct cpsw_slot *first_new_slot, *last, *last_old_slot, *next, *slot; struct mbuf *m0; - int error, flags, nsegs, seg, added = 0, padlen; + int error, nsegs, seg, added = 0, padlen; - flags = 0; - if (sc->swsc->dualemac) { - flags = CPDMA_BD_TO_PORT | - ((sc->unit + 1) & CPDMA_BD_PORT_MASK); - } /* Pull pending packets from IF queue and prep them for DMA. */ last = NULL; first_new_slot = NULL; @@ -1884,7 +1879,11 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) bd.bufoff = 0; bd.buflen = segs[0].ds_len; bd.pktlen = m_length(slot->mbuf, NULL) + padlen; - bd.flags = CPDMA_BD_SOP | CPDMA_BD_OWNER | flags; + bd.flags = CPDMA_BD_SOP | CPDMA_BD_OWNER; + if (sc->swsc->dualemac) { + bd.flags |= CPDMA_BD_TO_PORT; + bd.flags |= ((sc->unit + 1) & CPDMA_BD_PORT_MASK); + } for (seg = 1; seg < nsegs; ++seg) { /* Save the previous buffer (which isn't EOP) */ cpsw_cpdma_write_bd(sc->swsc, slot, &bd); @@ -1902,7 +1901,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) bd.bufoff = 0; bd.buflen = segs[seg].ds_len; bd.pktlen = 0; - bd.flags = CPDMA_BD_OWNER | flags; + bd.flags = CPDMA_BD_OWNER; } /* Save the final buffer. */ if (padlen <= 0) @@ -1924,7 +1923,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) bd.bufoff = 0; bd.buflen = padlen; bd.pktlen = 0; - bd.flags = CPDMA_BD_EOP | CPDMA_BD_OWNER | flags; + bd.flags = CPDMA_BD_EOP | CPDMA_BD_OWNER; cpsw_cpdma_write_bd(sc->swsc, slot, &bd); ++nsegs; From owner-svn-src-all@freebsd.org Thu Jan 19 14:27:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10A3DCB7C98; Thu, 19 Jan 2017 14:27:39 +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 CD2E41E40; Thu, 19 Jan 2017 14:27:38 +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 v0JERcqQ066665; Thu, 19 Jan 2017 14:27:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JERbbE066661; Thu, 19 Jan 2017 14:27:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191427.v0JERbbE066661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 14:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312409 - head/sys/fs/tmpfs 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, 19 Jan 2017 14:27:39 -0000 Author: kib Date: Thu Jan 19 14:27:37 2017 New Revision: 312409 URL: https://svnweb.freebsd.org/changeset/base/312409 Log: Style fixes and comment updates. Edit comments which explain no longer relevant details, and add locking annotations to the struct tmpfs_node members. Tested by: pho (as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 14:05:49 2017 (r312408) +++ head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 14:27:37 2017 (r312409) @@ -80,8 +80,10 @@ struct tmpfs_dirent { uint32_t td_hash; u_int td_namelen; - /* Pointer to the node this entry refers to. In case this field - * is NULL, the node is a whiteout. */ + /* + * Pointer to the node this entry refers to. In case this field + * is NULL, the node is a whiteout. + */ struct tmpfs_node * td_node; union { @@ -94,21 +96,24 @@ struct tmpfs_dirent { } ud; }; -/* A directory in tmpfs holds a list of directory entries, which in - * turn point to other files (which can be directories themselves). +/* + * A directory in tmpfs holds a collection of directory entries, which + * in turn point to other files (which can be directories themselves). * - * In tmpfs, this list is managed by a RB-Tree, whose head is defined by - * the struct tmpfs_dir type. + * In tmpfs, this collection is managed by a RB-Tree, whose head is + * defined by the struct tmpfs_dir type. * * It is important to notice that directories do not have entries for . and * .. as other file systems do. These can be generated when requested * based on information available by other means, such as the pointer to * the node itself in the former case or the pointer to the parent directory * in the latter case. This is done to simplify tmpfs's code and, more - * importantly, to remove redundancy. */ + * importantly, to remove redundancy. + */ RB_HEAD(tmpfs_dir, tmpfs_dirent); -/* Each entry in a directory has a cookie that identifies it. Cookies +/* + * Each entry in a directory has a cookie that identifies it. Cookies * supersede offsets within directories because, given how tmpfs stores * directories in memory, there is no such thing as an offset. * @@ -139,51 +144,65 @@ RB_HEAD(tmpfs_dir, tmpfs_dirent); * a particular type. The code must be careful to only access those * attributes that are actually allowed by the node's type. * - * * Below is the key of locks used to protected the fields in the following * structures. - * + * (v) vnode lock in exclusive mode + * (vi) vnode lock in exclusive mode, or vnode lock in shared vnode and + * tn_interlock + * (i) tn_interlock + * (m) tmpfs_mount allnode_lock + * (c) stable after creation */ struct tmpfs_node { - /* Doubly-linked list entry which links all existing nodes for a - * single file system. This is provided to ease the removal of - * all nodes during the unmount operation. */ - LIST_ENTRY(tmpfs_node) tn_entries; + /* + * Doubly-linked list entry which links all existing nodes for + * a single file system. This is provided to ease the removal + * of all nodes during the unmount operation, and to support + * the implementation of VOP_VNTOCNP(). + */ + LIST_ENTRY(tmpfs_node) tn_entries; /* (m) */ - /* The node's type. Any of 'VBLK', 'VCHR', 'VDIR', 'VFIFO', + /* + * The node's type. Any of 'VBLK', 'VCHR', 'VDIR', 'VFIFO', * 'VLNK', 'VREG' and 'VSOCK' is allowed. The usage of vnode * types instead of a custom enumeration is to make things simpler - * and faster, as we do not need to convert between two types. */ - enum vtype tn_type; + * and faster, as we do not need to convert between two types. + */ + enum vtype tn_type; /* (c) */ /* Node identifier. */ - ino_t tn_id; + ino_t tn_id; /* (c) */ - /* Node's internal status. This is used by several file system + /* + * Node's internal status. This is used by several file system * operations to do modifications to the node in a delayed - * fashion. */ - int tn_status; + * fashion. + */ + int tn_status; /* (vi) */ #define TMPFS_NODE_ACCESSED (1 << 1) #define TMPFS_NODE_MODIFIED (1 << 2) #define TMPFS_NODE_CHANGED (1 << 3) - /* The node size. It does not necessarily match the real amount - * of memory consumed by it. */ - off_t tn_size; + /* + * The node size. It does not necessarily match the real amount + * of memory consumed by it. + */ + off_t tn_size; /* (v) */ /* Generic node attributes. */ - uid_t tn_uid; - gid_t tn_gid; - mode_t tn_mode; - u_long tn_flags; - nlink_t tn_links; - struct timespec tn_atime; - struct timespec tn_mtime; - struct timespec tn_ctime; - struct timespec tn_birthtime; - unsigned long tn_gen; + uid_t tn_uid; /* (v) */ + gid_t tn_gid; /* (v) */ + mode_t tn_mode; /* (v) */ + u_long tn_flags; /* (v) */ + nlink_t tn_links; /* (v) */ + struct timespec tn_atime; /* (vi) */ + struct timespec tn_mtime; /* (vi) */ + struct timespec tn_ctime; /* (vi) */ + struct timespec tn_birthtime; /* (v) */ + unsigned long tn_gen; /* (c) */ - /* As there is a single vnode for each active file within the + /* + * As there is a single vnode for each active file within the * system, care has to be taken to avoid allocating more than one * vnode per file. In order to do this, a bidirectional association * is kept between vnodes and nodes. @@ -196,70 +215,81 @@ struct tmpfs_node { * tn_vnode. * * May be NULL when the node is unused (that is, no vnode has been - * allocated for it or it has been reclaimed). */ - struct vnode * tn_vnode; + * allocated for it or it has been reclaimed). + */ + struct vnode * tn_vnode; /* (i) */ - /* Interlock to protect tn_vpstate, and tn_status under shared + /* + * Interlock to protect tn_vpstate, and tn_status under shared * vnode lock. */ struct mtx tn_interlock; - /* Identify if current node has vnode assiocate with + /* + * Identify if current node has vnode assiocate with * or allocating vnode. */ - int tn_vpstate; + int tn_vpstate; /* (i) */ /* misc data field for different tn_type node */ union { /* Valid when tn_type == VBLK || tn_type == VCHR. */ - dev_t tn_rdev; + dev_t tn_rdev; /* (c) */ /* Valid when tn_type == VDIR. */ struct tn_dir { - /* Pointer to the parent directory. The root + /* + * Pointer to the parent directory. The root * directory has a pointer to itself in this field; - * this property identifies the root node. */ + * this property identifies the root node. + */ struct tmpfs_node * tn_parent; - /* Head of a tree that links the contents of - * the directory together. */ + /* + * Head of a tree that links the contents of + * the directory together. + */ struct tmpfs_dir tn_dirhead; - /* Head of a list the contains fake directory entries + /* + * Head of a list the contains fake directory entries * heads, i.e. entries with TMPFS_DIRCOOKIE_DUPHEAD - * flag. */ + * flag. + */ struct tmpfs_dir_duphead tn_dupindex; - /* Number and pointer of the first directory entry + /* + * Number and pointer of the first directory entry * returned by the readdir operation if it were * called again to continue reading data from the * same directory as before. This is used to speed * up reads of long directories, assuming that no * more than one read is in progress at a given time. - * Otherwise, these values are discarded. */ + * Otherwise, these values are discarded. + */ off_t tn_readdir_lastn; struct tmpfs_dirent * tn_readdir_lastp; } tn_dir; /* Valid when tn_type == VLNK. */ /* The link's target, allocated from a string pool. */ - char * tn_link; + char * tn_link; /* (c) */ /* Valid when tn_type == VREG. */ struct tn_reg { - /* The contents of regular files stored in a tmpfs - * file system are represented by a single anonymous - * memory object (aobj, for short). The aobj provides - * direct access to any position within the file, - * because its contents are always mapped in a - * contiguous region of virtual memory. It is a task - * of the memory management subsystem (see uvm(9)) to - * issue the required page ins or page outs whenever - * a position within the file is accessed. */ - vm_object_t tn_aobj; - - }tn_reg; - }tn_spec; + /* + * The contents of regular files stored in a + * tmpfs file system are represented by a + * single anonymous memory object (aobj, for + * short). The aobj provides direct access to + * any position within the file. It is a task + * of the memory management subsystem to issue + * the required page ins or page outs whenever + * a position within the file is accessed. + */ + vm_object_t tn_aobj; /* (c) */ + } tn_reg; + } tn_spec; /* (v) */ }; LIST_HEAD(tmpfs_node_list, tmpfs_node); @@ -303,26 +333,34 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); * Internal representation of a tmpfs mount point. */ struct tmpfs_mount { - /* Maximum number of memory pages available for use by the file + /* + * Maximum number of memory pages available for use by the file * system, set during mount time. This variable must never be * used directly as it may be bigger than the current amount of * free memory; in the extreme case, it will hold the ULONG_MAX - * value. */ + * value. + */ u_long tm_pages_max; /* Number of pages in use by the file system. */ u_long tm_pages_used; - /* Pointer to the node representing the root directory of this - * file system. */ + /* + * Pointer to the node representing the root directory of this + * file system. + */ struct tmpfs_node * tm_root; - /* Maximum number of possible nodes for this file system; set + struct mount * tm_mnt; + + /* + * Maximum number of possible nodes for this file system; set * during mount time. We need a hard limit on the maximum number * of nodes to avoid allocating too much of them; their objects * cannot be released until the file system is unmounted. * Otherwise, we could easily run out of memory by creating lots - * of empty files and then simply removing them. */ + * of empty files and then simply removing them. + */ ino_t tm_nodes_max; /* unrhdr used to allocate inode numbers */ @@ -334,27 +372,16 @@ struct tmpfs_mount { /* maximum representable file size */ u_int64_t tm_maxfilesize; - /* Nodes are organized in two different lists. The used list - * contains all nodes that are currently used by the file system; - * i.e., they refer to existing files. The available list contains - * all nodes that are currently available for use by new files. - * Nodes must be kept in this list (instead of deleting them) - * because we need to keep track of their generation number (tn_gen - * field). - * - * Note that nodes are lazily allocated: if the available list is - * empty and we have enough space to create more nodes, they will be - * created and inserted in the used list. Once these are released, - * they will go into the available list, remaining alive until the - * file system is unmounted. */ + /* + * The used list contains all nodes that are currently used by + * the file system; i.e., they refer to existing files. + */ struct tmpfs_node_list tm_nodes_used; - /* All node lock to protect the node list and tmp_pages_used */ + /* All node lock to protect the node list and tmp_pages_used. */ struct mtx allnode_lock; - /* Pools used to store file system meta data. These are not shared - * across several instances of tmpfs for the reasons described in - * tmpfs_pool.c. */ + /* Zones used to store file system meta data, per tmpfs mount. */ uma_zone_t tm_dirent_pool; uma_zone_t tm_node_pool; @@ -444,10 +471,6 @@ int tmpfs_truncate(struct vnode *, off_t } while (0) /* - * Memory management stuff. - */ - -/* * Amount of memory pages to reserve for the system (e.g., to not use by * tmpfs). */ @@ -464,37 +487,34 @@ size_t tmpfs_pages_used(struct tmpfs_mou * specific ones. */ -static inline -struct tmpfs_mount * +static inline struct tmpfs_mount * VFS_TO_TMPFS(struct mount *mp) { struct tmpfs_mount *tmp; - MPASS((mp) != NULL && (mp)->mnt_data != NULL); - tmp = (struct tmpfs_mount *)(mp)->mnt_data; - return tmp; + MPASS(mp != NULL && mp->mnt_data != NULL); + tmp = (struct tmpfs_mount *)mp->mnt_data; + return (tmp); } -static inline -struct tmpfs_node * +static inline struct tmpfs_node * VP_TO_TMPFS_NODE(struct vnode *vp) { struct tmpfs_node *node; - MPASS((vp) != NULL && (vp)->v_data != NULL); + MPASS(vp != NULL && vp->v_data != NULL); node = (struct tmpfs_node *)vp->v_data; - return node; + return (node); } -static inline -struct tmpfs_node * +static inline struct tmpfs_node * VP_TO_TMPFS_DIR(struct vnode *vp) { struct tmpfs_node *node; node = VP_TO_TMPFS_NODE(vp); TMPFS_VALIDATE_DIR(node); - return node; + return (node); } #endif /* _FS_TMPFS_TMPFS_H_ */ Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 14:05:49 2017 (r312408) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 14:27:37 2017 (r312409) @@ -198,8 +198,8 @@ tmpfs_alloc_node(struct mount *mp, struc return (EBUSY); } - nnode = (struct tmpfs_node *)uma_zalloc_arg( - tmp->tm_node_pool, tmp, M_WAITOK); + nnode = (struct tmpfs_node *)uma_zalloc_arg(tmp->tm_node_pool, tmp, + M_WAITOK); /* Generic initialization. */ nnode->tn_type = type; @@ -257,7 +257,8 @@ tmpfs_alloc_node(struct mount *mp, struc break; default: - panic("tmpfs_alloc_node: type %p %d", nnode, (int)nnode->tn_type); + panic("tmpfs_alloc_node: type %p %d", nnode, + (int)nnode->tn_type); } TMPFS_LOCK(tmp); @@ -266,25 +267,12 @@ tmpfs_alloc_node(struct mount *mp, struc TMPFS_UNLOCK(tmp); *node = nnode; - return 0; + return (0); } /* * Destroys the node pointed to by node from the file system 'tmp'. - * If the node does not belong to the given mount point, the results are - * unpredicted. - * - * If the node references a directory; no entries are allowed because - * their removal could need a recursive algorithm, something forbidden in - * kernel space. Furthermore, there is not need to provide such - * functionality (recursive removal) because the only primitives offered - * to the user are the removal of empty directories and the deletion of - * individual files. - * - * Note that nodes are not really deleted; in fact, when a node has been - * allocated, it cannot be deleted during the whole life of the file - * system. Instead, they are moved to the available list and remain there - * until reused. + * If the node references a directory, no entries are allowed. */ void tmpfs_free_node(struct tmpfs_mount *tmp, struct tmpfs_node *node) @@ -609,7 +597,7 @@ loop1: VN_LOCK_ASHARE(vp); error = insmntque1(vp, mp, tmpfs_insmntque_dtr, NULL); - if (error) + if (error != 0) vp = NULL; unlock: @@ -638,7 +626,7 @@ out: } #endif - return error; + return (error); } /* @@ -706,8 +694,8 @@ tmpfs_alloc_file(struct vnode *dvp, stru /* Allocate a node that represents the new file. */ error = tmpfs_alloc_node(dvp->v_mount, tmp, vap->va_type, - cnp->cn_cred->cr_uid, - dnode->tn_gid, vap->va_mode, parent, target, vap->va_rdev, &node); + cnp->cn_cred->cr_uid, dnode->tn_gid, vap->va_mode, parent, + target, vap->va_rdev, &node); if (error != 0) return (error); @@ -1115,9 +1103,8 @@ tmpfs_dir_getdotdotdent(struct tmpfs_nod * Return ENOENT if the current node is already removed. */ TMPFS_ASSERT_LOCKED(node); - if (node->tn_dir.tn_parent == NULL) { + if (node->tn_dir.tn_parent == NULL) return (ENOENT); - } TMPFS_NODE_LOCK(node->tn_dir.tn_parent); dent.d_fileno = node->tn_dir.tn_parent->tn_id; Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Thu Jan 19 14:05:49 2017 (r312408) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Thu Jan 19 14:27:37 2017 (r312409) @@ -190,7 +190,7 @@ tmpfs_mount(struct mount *mp) /* Do not allow mounts if we do not have enough memory to preserve * the minimum reserved pages. */ if (tmpfs_mem_avail() < TMPFS_PAGES_MINRESERVED) - return ENOSPC; + return (ENOSPC); /* Get the maximum number of memory pages this file system is * allowed to use, based on the maximum size the user passed in @@ -229,27 +229,23 @@ tmpfs_mount(struct mount *mp) tmp->tm_pages_used = 0; tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, &tmp->allnode_lock); tmp->tm_dirent_pool = uma_zcreate("TMPFS dirent", - sizeof(struct tmpfs_dirent), - NULL, NULL, NULL, NULL, + sizeof(struct tmpfs_dirent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); tmp->tm_node_pool = uma_zcreate("TMPFS node", - sizeof(struct tmpfs_node), - tmpfs_node_ctor, tmpfs_node_dtor, - tmpfs_node_init, tmpfs_node_fini, - UMA_ALIGN_PTR, 0); + sizeof(struct tmpfs_node), tmpfs_node_ctor, tmpfs_node_dtor, + tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0); tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; /* Allocate the root node. */ - error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, - root_gid, root_mode & ALLPERMS, NULL, NULL, - VNOVAL, &root); + error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid, + root_mode & ALLPERMS, NULL, NULL, VNOVAL, &root); if (error != 0 || root == NULL) { - uma_zdestroy(tmp->tm_node_pool); - uma_zdestroy(tmp->tm_dirent_pool); - delete_unrhdr(tmp->tm_ino_unr); - free(tmp, M_TMPFSMNT); - return error; + uma_zdestroy(tmp->tm_node_pool); + uma_zdestroy(tmp->tm_dirent_pool); + delete_unrhdr(tmp->tm_ino_unr); + free(tmp, M_TMPFSMNT); + return (error); } KASSERT(root->tn_id == 2, ("tmpfs root with invalid ino: %ju", (uintmax_t)root->tn_id)); @@ -340,12 +336,11 @@ static int tmpfs_root(struct mount *mp, int flags, struct vnode **vpp) { int error; - error = tmpfs_alloc_vp(mp, VFS_TO_TMPFS(mp)->tm_root, flags, vpp); - if (!error) + error = tmpfs_alloc_vp(mp, VFS_TO_TMPFS(mp)->tm_root, flags, vpp); + if (error == 0) (*vpp)->v_vflag |= VV_ROOT; - - return error; + return (error); } static int Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 19 14:05:49 2017 (r312408) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 19 14:27:37 2017 (r312409) @@ -117,10 +117,12 @@ tmpfs_lookup(struct vop_cachedlookup_arg if (de != NULL && de->td_node == NULL) cnp->cn_flags |= ISWHITEOUT; if (de == NULL || de->td_node == NULL) { - /* The entry was not found in the directory. + /* + * The entry was not found in the directory. * This is OK if we are creating or renaming an * entry and are working on the last component of - * the path name. */ + * the path name. + */ if ((cnp->cn_flags & ISLASTCN) && (cnp->cn_nameiop == CREATE || \ cnp->cn_nameiop == RENAME || @@ -132,8 +134,10 @@ tmpfs_lookup(struct vop_cachedlookup_arg if (error != 0) goto out; - /* Keep the component name in the buffer for - * future uses. */ + /* + * Keep the component name in the buffer for + * future uses. + */ cnp->cn_flags |= SAVENAME; error = EJUSTRETURN; @@ -142,14 +146,18 @@ tmpfs_lookup(struct vop_cachedlookup_arg } else { struct tmpfs_node *tnode; - /* The entry was found, so get its associated - * tmpfs_node. */ + /* + * The entry was found, so get its associated + * tmpfs_node. + */ tnode = de->td_node; - /* If we are not at the last path component and + /* + * If we are not at the last path component and * found a non-directory or non-link entry (which * may itself be pointing to a directory), raise - * an error. */ + * an error. + */ if ((tnode->tn_type != VDIR && tnode->tn_type != VLNK) && !(cnp->cn_flags & ISLASTCN)) { @@ -157,9 +165,11 @@ tmpfs_lookup(struct vop_cachedlookup_arg goto out; } - /* If we are deleting or renaming the entry, keep + /* + * If we are deleting or renaming the entry, keep * track of its tmpfs_dirent so that it can be - * easily deleted later. */ + * easily deleted later. + */ if ((cnp->cn_flags & ISLASTCN) && (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) { @@ -175,8 +185,9 @@ tmpfs_lookup(struct vop_cachedlookup_arg goto out; if ((dnode->tn_mode & S_ISTXT) && - VOP_ACCESS(dvp, VADMIN, cnp->cn_cred, cnp->cn_thread) && - VOP_ACCESS(*vpp, VADMIN, cnp->cn_cred, cnp->cn_thread)) { + VOP_ACCESS(dvp, VADMIN, cnp->cn_cred, + cnp->cn_thread) && VOP_ACCESS(*vpp, VADMIN, + cnp->cn_cred, cnp->cn_thread)) { error = EPERM; vput(*vpp); *vpp = NULL; @@ -192,18 +203,22 @@ tmpfs_lookup(struct vop_cachedlookup_arg } } - /* Store the result of this lookup in the cache. Avoid this if the + /* + * Store the result of this lookup in the cache. Avoid this if the * request was for creation, as it does not improve timings on - * emprical tests. */ + * emprical tests. + */ if ((cnp->cn_flags & MAKEENTRY) != 0) cache_enter(dvp, *vpp, cnp); out: - /* If there were no errors, *vpp cannot be null and it must be - * locked. */ + /* + * If there were no errors, *vpp cannot be null and it must be + * locked. + */ MPASS(IFF(error == 0, *vpp != NULLVP && VOP_ISLOCKED(*vpp))); - return error; + return (error); } static int @@ -1390,7 +1405,7 @@ tmpfs_whiteout(struct vop_whiteout_args } /* - * vnode operations vector used for files stored in a tmpfs file system. + * Vnode operations vector used for files stored in a tmpfs file system. */ struct vop_vector tmpfs_vnodeop_entries = { .vop_default = &default_vnodeops, From owner-svn-src-all@freebsd.org Thu Jan 19 14:49:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D354CB8426; Thu, 19 Jan 2017 14:49:57 +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 E314F1FF2; Thu, 19 Jan 2017 14:49: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 v0JEnugf074953; Thu, 19 Jan 2017 14:49:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JEnton074950; Thu, 19 Jan 2017 14:49:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191449.v0JEnton074950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 14:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312410 - head/sys/fs/tmpfs 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, 19 Jan 2017 14:49:57 -0000 Author: kib Date: Thu Jan 19 14:49:55 2017 New Revision: 312410 URL: https://svnweb.freebsd.org/changeset/base/312410 Log: Rework some tmpfs lock assertions. Remove TMPFS_ASSERT_ELOCKED(). Its claims are already stated by other asserts nearby and by VFS guarantees. Change TMPFS_ASSERT_LOCKED() and one inlined place to use ASSERT_VOP_(E)LOCKED() instead of hand-rolled imprecise asserts. Tested by: pho (as part of the larger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 14:27:37 2017 (r312409) +++ head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 14:49:55 2017 (r312410) @@ -309,19 +309,10 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #define TMPFS_ASSERT_LOCKED(node) do { \ MPASS(node != NULL); \ MPASS(node->tn_vnode != NULL); \ - if (!VOP_ISLOCKED(node->tn_vnode) && \ - !mtx_owned(TMPFS_NODE_MTX(node))) \ - panic("tmpfs: node is not locked: %p", node); \ - } while (0) -#define TMPFS_ASSERT_ELOCKED(node) do { \ - MPASS((node) != NULL); \ - MPASS((node)->tn_vnode != NULL); \ - mtx_assert(TMPFS_NODE_MTX(node), MA_OWNED); \ - ASSERT_VOP_LOCKED((node)->tn_vnode, "tmpfs"); \ + ASSERT_VOP_LOCKED(node->tn_vnode, "tmpfs assert"); \ } while (0) #else #define TMPFS_ASSERT_LOCKED(node) (void)0 -#define TMPFS_ASSERT_ELOCKED(node) (void)0 #endif #define TMPFS_VNODE_ALLOCATING 1 Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 14:27:37 2017 (r312409) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 14:49:55 2017 (r312410) @@ -669,7 +669,7 @@ tmpfs_alloc_file(struct vnode *dvp, stru struct tmpfs_node *node; struct tmpfs_node *parent; - MPASS(VOP_ISLOCKED(dvp)); + ASSERT_VOP_ELOCKED(dvp, "tmpfs_alloc_file"); MPASS(cnp->cn_flags & HASBUF); tmp = VFS_TO_TMPFS(dvp->v_mount); Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 19 14:27:37 2017 (r312409) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 19 14:49:55 2017 (r312410) @@ -1111,7 +1111,6 @@ tmpfs_rmdir(struct vop_rmdir_args *v) /* No vnode should be allocated for this entry from this point */ TMPFS_NODE_LOCK(node); - TMPFS_ASSERT_ELOCKED(node); node->tn_links--; node->tn_dir.tn_parent = NULL; node->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | @@ -1120,7 +1119,6 @@ tmpfs_rmdir(struct vop_rmdir_args *v) TMPFS_NODE_UNLOCK(node); TMPFS_NODE_LOCK(dnode); - TMPFS_ASSERT_ELOCKED(dnode); dnode->tn_links--; dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | TMPFS_NODE_MODIFIED; @@ -1274,7 +1272,6 @@ tmpfs_reclaim(struct vop_reclaim_args *v cache_purge(vp); TMPFS_NODE_LOCK(node); - TMPFS_ASSERT_ELOCKED(node); tmpfs_free_vp(vp); /* If the node referenced by this vnode was deleted by the user, From owner-svn-src-all@freebsd.org Thu Jan 19 14:58:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3804CB868A; Thu, 19 Jan 2017 14:58:56 +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 5854C1A25; Thu, 19 Jan 2017 14:58:56 +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 v0JEwtZi078810; Thu, 19 Jan 2017 14:58:55 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JEwtoU078808; Thu, 19 Jan 2017 14:58:55 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701191458.v0JEwtoU078808@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, 19 Jan 2017 14:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312411 - 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, 19 Jan 2017 14:58:56 -0000 Author: loos Date: Thu Jan 19 14:58:55 2017 New Revision: 312411 URL: https://svnweb.freebsd.org/changeset/base/312411 Log: Handle the set capabilities ioctl, letting the hardware checksum be disabled (Hi netmap!). Only remove the CRC bytes from packets when the hardware tell us to do so. Fixes the 'discard frame w/o leading ethernet header' issues. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswreg.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Thu Jan 19 14:49:55 2017 (r312410) +++ head/sys/arm/ti/cpsw/if_cpsw.c Thu Jan 19 14:58:55 2017 (r312411) @@ -1395,6 +1395,16 @@ cpswp_ioctl(struct ifnet *ifp, u_long co ifr = (struct ifreq *)data; switch (command) { + case SIOCSIFCAP: + changed = ifp->if_capenable ^ ifr->ifr_reqcap; + if (changed & IFCAP_HWCSUM) { + if ((ifr->ifr_reqcap & changed) & IFCAP_HWCSUM) + ifp->if_capenable |= IFCAP_HWCSUM; + else + ifp->if_capenable &= ~IFCAP_HWCSUM; + } + error = 0; + break; case SIOCSIFFLAGS: CPSW_PORT_LOCK(sc); if (ifp->if_flags & IFF_UP) { @@ -1632,15 +1642,22 @@ cpsw_rx_dequeue(struct cpsw_softc *sc) /* TODO: track SOP/EOP bits to assemble a full mbuf out of received fragments. */ slot->mbuf->m_data += bd.bufoff; - slot->mbuf->m_len = bd.pktlen - 4; - slot->mbuf->m_pkthdr.len = bd.pktlen - 4; - slot->mbuf->m_flags |= M_PKTHDR; - slot->mbuf->m_pkthdr.rcvif = psc->ifp; + slot->mbuf->m_len = bd.buflen; + if (bd.flags & CPDMA_BD_SOP) { + slot->mbuf->m_pkthdr.len = bd.pktlen; + slot->mbuf->m_pkthdr.rcvif = psc->ifp; + slot->mbuf->m_flags |= M_PKTHDR; + } + slot->mbuf->m_next = NULL; slot->mbuf->m_nextpkt = NULL; + if (bd.flags & CPDMA_BD_PASS_CRC) + m_adj(slot->mbuf, -ETHER_CRC_LEN); if ((psc->ifp->if_capenable & IFCAP_RXCSUM) != 0) { /* check for valid CRC by looking into pkt_err[5:4] */ - if ((bd.flags & CPDMA_BD_PKT_ERR_MASK) == 0) { + if ((bd.flags & + (CPDMA_BD_SOP | CPDMA_BD_PKT_ERR_MASK)) == + CPDMA_BD_SOP) { slot->mbuf->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; slot->mbuf->m_pkthdr.csum_flags |= CSUM_IP_VALID; slot->mbuf->m_pkthdr.csum_data = 0xffff; Modified: head/sys/arm/ti/cpsw/if_cpswreg.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswreg.h Thu Jan 19 14:49:55 2017 (r312410) +++ head/sys/arm/ti/cpsw/if_cpswreg.h Thu Jan 19 14:58:55 2017 (r312411) @@ -191,6 +191,7 @@ #define CPDMA_BD_OWNER (1 << 13) #define CPDMA_BD_EOQ (1 << 12) #define CPDMA_BD_TDOWNCMPLT (1 << 11) +#define CPDMA_BD_PASS_CRC (1 << 10) #define CPDMA_BD_PKT_ERR_MASK (3 << 4) #define CPDMA_BD_TO_PORT (1 << 4) #define CPDMA_BD_PORT_MASK 3 From owner-svn-src-all@freebsd.org Thu Jan 19 15:06:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EA79CB885A; Thu, 19 Jan 2017 15:06: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 3E5931070; Thu, 19 Jan 2017 15:06: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 v0JF6IdR082941; Thu, 19 Jan 2017 15:06:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JF6IvN082940; Thu, 19 Jan 2017 15:06:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191506.v0JF6IvN082940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 15:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312412 - head/sys/fs/tmpfs 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, 19 Jan 2017 15:06:19 -0000 Author: kib Date: Thu Jan 19 15:06:18 2017 New Revision: 312412 URL: https://svnweb.freebsd.org/changeset/base/312412 Log: Protect macro argument. Requested by: hselasky Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs.h Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 14:58:55 2017 (r312411) +++ head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 15:06:18 2017 (r312412) @@ -307,9 +307,9 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #ifdef INVARIANTS #define TMPFS_ASSERT_LOCKED(node) do { \ - MPASS(node != NULL); \ - MPASS(node->tn_vnode != NULL); \ - ASSERT_VOP_LOCKED(node->tn_vnode, "tmpfs assert"); \ + MPASS((node) != NULL); \ + MPASS((node)->tn_vnode != NULL); \ + ASSERT_VOP_LOCKED((node)->tn_vnode, "tmpfs assert"); \ } while (0) #else #define TMPFS_ASSERT_LOCKED(node) (void)0 From owner-svn-src-all@freebsd.org Thu Jan 19 15:27:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7635DCB8DA6; Thu, 19 Jan 2017 15:27:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BF121F71; Thu, 19 Jan 2017 15:27:54 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JFRr5b091015; Thu, 19 Jan 2017 15:27:53 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JFRrqr091014; Thu, 19 Jan 2017 15:27:53 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201701191527.v0JFRrqr091014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 19 Jan 2017 15:27:53 +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: r312413 - stable/11/sys/contrib/ipfilter/netinet 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, 19 Jan 2017 15:27:54 -0000 Author: bz Date: Thu Jan 19 15:27:53 2017 New Revision: 312413 URL: https://svnweb.freebsd.org/changeset/base/312413 Log: MFC r311950: Get rid of a compiler warning which I saw too often. Include netinet/in.h before ip_compat.t which will then check if IPPROTO_IPIP is defined or not. Doing it the other way round, ip_compat.h would not find it defined and netinet/in.h then redefine it. Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jan 19 15:06:18 2017 (r312412) +++ stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Thu Jan 19 15:27:53 2017 (r312413) @@ -11,6 +11,10 @@ #ifndef __IP_FIL_H__ #define __IP_FIL_H__ +#if !defined(linux) || !defined(_KERNEL) +# include +#endif + #include "netinet/ip_compat.h" #include "netinet/ipf_rb.h" #if NETBSD_GE_REV(104040000) @@ -24,10 +28,6 @@ # endif #endif -#if !defined(linux) || !defined(_KERNEL) -# include -#endif - #ifndef SOLARIS # if defined(sun) && (defined(__svr4__) || defined(__SVR4)) # define SOLARIS 1 From owner-svn-src-all@freebsd.org Thu Jan 19 16:01:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19500CB863F; Thu, 19 Jan 2017 16:01:38 +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 C75081453; Thu, 19 Jan 2017 16:01:37 +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 v0JG1ak6009745; Thu, 19 Jan 2017 16:01:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JG1aZX009743; Thu, 19 Jan 2017 16:01:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191601.v0JG1aZX009743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 16:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312414 - head/sys/fs/tmpfs 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, 19 Jan 2017 16:01:38 -0000 Author: kib Date: Thu Jan 19 16:01:36 2017 New Revision: 312414 URL: https://svnweb.freebsd.org/changeset/base/312414 Log: Rename tmpfs_mount member allnode_lock to include namespace prefix. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 15:27:53 2017 (r312413) +++ head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 16:01:36 2017 (r312414) @@ -150,7 +150,7 @@ RB_HEAD(tmpfs_dir, tmpfs_dirent); * (vi) vnode lock in exclusive mode, or vnode lock in shared vnode and * tn_interlock * (i) tn_interlock - * (m) tmpfs_mount allnode_lock + * (m) tmpfs_mount tm_allnode_lock * (c) stable after creation */ struct tmpfs_node { @@ -370,7 +370,7 @@ struct tmpfs_mount { struct tmpfs_node_list tm_nodes_used; /* All node lock to protect the node list and tmp_pages_used. */ - struct mtx allnode_lock; + struct mtx tm_allnode_lock; /* Zones used to store file system meta data, per tmpfs mount. */ uma_zone_t tm_dirent_pool; @@ -379,8 +379,9 @@ struct tmpfs_mount { /* Read-only status. */ int tm_ronly; }; -#define TMPFS_LOCK(tm) mtx_lock(&(tm)->allnode_lock) -#define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->allnode_lock) +#define TMPFS_LOCK(tm) mtx_lock(&(tm)->tm_allnode_lock) +#define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->tm_allnode_lock) +#define TMPFS_MP_ASSERT_LOCKED(tm) mtx_assert(&(tm)->tm_allnode_lock, MA_OWNED) /* * This structure maps a file identifier to a tmpfs node. Used by the Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Thu Jan 19 15:27:53 2017 (r312413) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Thu Jan 19 16:01:36 2017 (r312414) @@ -219,7 +219,7 @@ tmpfs_mount(struct mount *mp) tmp = (struct tmpfs_mount *)malloc(sizeof(struct tmpfs_mount), M_TMPFSMNT, M_WAITOK | M_ZERO); - mtx_init(&tmp->allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF); + mtx_init(&tmp->tm_allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF); tmp->tm_nodes_max = nodes_max; tmp->tm_nodes_inuse = 0; tmp->tm_maxfilesize = maxfilesize > 0 ? maxfilesize : OFF_MAX; @@ -227,7 +227,7 @@ tmpfs_mount(struct mount *mp) tmp->tm_pages_max = pages; tmp->tm_pages_used = 0; - tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, &tmp->allnode_lock); + tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, &tmp->tm_allnode_lock); tmp->tm_dirent_pool = uma_zcreate("TMPFS dirent", sizeof(struct tmpfs_dirent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); @@ -316,7 +316,7 @@ tmpfs_unmount(struct mount *mp, int mntf uma_zdestroy(tmp->tm_node_pool); delete_unrhdr(tmp->tm_ino_unr); - mtx_destroy(&tmp->allnode_lock); + mtx_destroy(&tmp->tm_allnode_lock); MPASS(tmp->tm_pages_used == 0); MPASS(tmp->tm_nodes_inuse == 0); From owner-svn-src-all@freebsd.org Thu Jan 19 16:07:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E99FFCB8821; Thu, 19 Jan 2017 16:07:53 +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 B30C117C9; Thu, 19 Jan 2017 16:07:53 +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 v0JG7qn2012270; Thu, 19 Jan 2017 16:07:52 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JG7q3R012269; Thu, 19 Jan 2017 16:07:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701191607.v0JG7q3R012269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 19 Jan 2017 16:07: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: r312415 - stable/11/sys/boot/forth 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, 19 Jan 2017 16:07:54 -0000 Author: asomers Date: Thu Jan 19 16:07:52 2017 New Revision: 312415 URL: https://svnweb.freebsd.org/changeset/base/312415 Log: MFC r310417 Add a dumpdev example to /boot/defaults/loader.conf Modified: stable/11/sys/boot/forth/loader.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/forth/loader.conf ============================================================================== --- stable/11/sys/boot/forth/loader.conf Thu Jan 19 16:01:36 2017 (r312414) +++ stable/11/sys/boot/forth/loader.conf Thu Jan 19 16:07:52 2017 (r312415) @@ -101,6 +101,7 @@ module_path="/boot/modules" # Set the mo #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number #rootdev="disk1s1a" # Set the root filesystem +#dumpdev="disk1s1b" # Set a dump device early in the boot process #tftp.blksize="1428" # Set the RFC 2348 TFTP block size. # If the TFTP server does not support RFC 2348, # the block size is set to 512. If the value From owner-svn-src-all@freebsd.org Thu Jan 19 16:17:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8750ACB8A56; Thu, 19 Jan 2017 16:17:47 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A6101D2C; Thu, 19 Jan 2017 16:17:47 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cUFP9-000DKc-Gz; Thu, 19 Jan 2017 19:17:39 +0300 Date: Thu, 19 Jan 2017 19:17:39 +0300 From: Slawa Olhovchenkov To: "Jonathan T. Looney" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r307319 - in head/sys/netinet: . tcp_stacks Message-ID: <20170119161739.GF58505@zxy.spb.ru> References: <201610141457.u9EEvhT8039210@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201610141457.u9EEvhT8039210@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2017 16:17:47 -0000 On Fri, Oct 14, 2016 at 02:57:43PM +0000, Jonathan T. Looney wrote: > Author: jtl > Date: Fri Oct 14 14:57:43 2016 > New Revision: 307319 > URL: https://svnweb.freebsd.org/changeset/base/307319 > > Log: > The code currently resets the keepalive timer each time a packet is > received on a TCP session that has entered the ESTABLISHED state. This > results in a lot of calls to reset the keepalive timer. > > This patch changes the behavior so we set the keepalive timer for the > keepalive idle time (TP_KEEPIDLE). When the keepalive timer fires, it will > first check to see if the session has been idle for TP_KEEPIDLE ticks. If > not, it will reschedule the keepalive timer for the time the session will > have been idle for TP_KEEPIDLE ticks. > > For a session with regular communication, the keepalive timer should fire > approximately once every TP_KEEPIDLE ticks. For sessions with irregular > communication, the keepalive timer might fire more often. But, the > disruption from a periodic keepalive timer should be less than the regular > cost of resetting the keepalive timer on every packet. > > (FWIW, this change saved approximately 1.73% of the busy CPU cycles on a > particular test system with a heavy TCP output load. Of course, the > actual impact is very specific to the particular hardware and workload.) > > Reviewed by: gallatin, rrs > MFC after: 2 weeks > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D8243 Some issus exist? From owner-svn-src-all@freebsd.org Thu Jan 19 16:46:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DF2ACB852A; Thu, 19 Jan 2017 16:46:06 +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 4810B1252; Thu, 19 Jan 2017 16:46:06 +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 v0JGk59J028457; Thu, 19 Jan 2017 16:46:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JGk5p1028456; Thu, 19 Jan 2017 16:46:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701191646.v0JGk5p1028456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 19 Jan 2017 16:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312416 - head/sys/ufs/ffs 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, 19 Jan 2017 16:46:06 -0000 Author: cem Date: Thu Jan 19 16:46:05 2017 New Revision: 312416 URL: https://svnweb.freebsd.org/changeset/base/312416 Log: ffs_vnops: Simplify extattr access As suggested in r167010, use the structure type and macros to access and modify UFS2 extended attributes. Add assertions that pointers are aligned in places where we now access the data through a structure pointer, instead of character-by-character. PR: 216127 Reported by: dewayne at heuristicsystems.com.au Reviewed by: kib@ Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9225 Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Thu Jan 19 16:07:52 2017 (r312415) +++ head/sys/ufs/ffs/ffs_vnops.c Thu Jan 19 16:46:05 2017 (r312416) @@ -100,6 +100,9 @@ __FBSDID("$FreeBSD$"); #include "opt_directio.h" #include "opt_ffs.h" +#define ALIGNED_TO(ptr, s) \ + (((uintptr_t)(ptr) & (_Alignof(s) - 1)) == 0) + #ifdef DIRECTIO extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); #endif @@ -1100,46 +1103,30 @@ ffs_extwrite(struct vnode *vp, struct ui * the length of the EA, and possibly the pointer to the entry and to the data. */ static int -ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name, u_char **eap, u_char **eac) +ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name, + struct extattr **eapp, u_char **eac) { - u_char *p, *pe, *pn, *p0; - int eapad1, eapad2, ealength, ealen, nlen; - uint32_t ul; + struct extattr *eap, *eaend; + size_t nlen; - pe = ptr + length; nlen = strlen(name); - - for (p = ptr; p < pe; p = pn) { - p0 = p; - bcopy(p, &ul, sizeof(ul)); - pn = p + ul; + KASSERT(ALIGNED_TO(ptr, struct extattr), ("unaligned")); + eap = (struct extattr *)ptr; + eaend = (struct extattr *)(ptr + length); + for (; eap < eaend; eap = EXTATTR_NEXT(eap)) { /* make sure this entry is complete */ - if (pn > pe) + if (EXTATTR_NEXT(eap) > eaend) break; - p += sizeof(uint32_t); - if (*p != nspace) - continue; - p++; - eapad2 = *p++; - if (*p != nlen) - continue; - p++; - if (bcmp(p, name, nlen)) + if (eap->ea_namespace != nspace || eap->ea_namelength != nlen + || memcmp(eap->ea_name, name, nlen) != 0) continue; - ealength = sizeof(uint32_t) + 3 + nlen; - eapad1 = 8 - (ealength % 8); - if (eapad1 == 8) - eapad1 = 0; - ealength += eapad1; - ealen = ul - ealength - eapad2; - p += nlen + eapad1; - if (eap != NULL) - *eap = p0; + if (eapp != NULL) + *eapp = eap; if (eac != NULL) - *eac = p; - return (ealen); + *eac = EXTATTR_CONTENT(eap); + return (EXTATTR_CONTENT_SIZE(eap)); } - return(-1); + return (-1); } static int @@ -1380,9 +1367,11 @@ vop_deleteextattr { { struct inode *ip; struct fs *fs; - uint32_t ealength, ul; - int ealen, olen, eapad1, eapad2, error, i, easize; - u_char *eae, *p; + struct extattr *eap; + uint32_t ul; + int olen, error, i, easize; + u_char *eae; + void *tmp; ip = VTOI(ap->a_vp); fs = ITOFS(ip); @@ -1413,39 +1402,30 @@ vop_deleteextattr { if (error) return (error); - ealength = eapad1 = ealen = eapad2 = 0; - + /* CEM: delete could be done in-place instead */ eae = malloc(ip->i_ea_len, M_TEMP, M_WAITOK); bcopy(ip->i_ea_area, eae, ip->i_ea_len); easize = ip->i_ea_len; olen = ffs_findextattr(eae, easize, ap->a_attrnamespace, ap->a_name, - &p, NULL); + &eap, NULL); if (olen == -1) { /* delete but nonexistent */ free(eae, M_TEMP); ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); - return(ENOATTR); + return (ENOATTR); } - bcopy(p, &ul, sizeof ul); - i = p - eae + ul; - if (ul != ealength) { - bcopy(p + ul, p + ealength, easize - i); - easize += (ealength - ul); - } - if (easize > NXADDR * fs->fs_bsize) { - free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); - if (ip->i_ea_area != NULL && ip->i_ea_error == 0) - ip->i_ea_error = ENOSPC; - return(ENOSPC); - } - p = ip->i_ea_area; + ul = eap->ea_length; + i = (u_char *)EXTATTR_NEXT(eap) - eae; + bcopy(EXTATTR_NEXT(eap), eap, easize - i); + easize -= ul; + + tmp = ip->i_ea_area; ip->i_ea_area = eae; ip->i_ea_len = easize; - free(p, M_TEMP); + free(tmp, M_TEMP); error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); - return(error); + return (error); } /* @@ -1499,7 +1479,7 @@ vop_getextattr { error = ENOATTR; ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); - return(error); + return (error); } /* @@ -1519,9 +1499,7 @@ vop_listextattr { */ { struct inode *ip; - u_char *eae, *p, *pe, *pn; - unsigned easize; - uint32_t ul; + struct extattr *eap, *eaend; int error, ealen; ip = VTOI(ap->a_vp); @@ -1537,31 +1515,31 @@ vop_listextattr { error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); if (error) return (error); - eae = ip->i_ea_area; - easize = ip->i_ea_len; error = 0; if (ap->a_size != NULL) *ap->a_size = 0; - pe = eae + easize; - for(p = eae; error == 0 && p < pe; p = pn) { - bcopy(p, &ul, sizeof(ul)); - pn = p + ul; - if (pn > pe) + + KASSERT(ALIGNED_TO(ip->i_ea_area, struct extattr), ("unaligned")); + eap = (struct extattr *)ip->i_ea_area; + eaend = (struct extattr *)(ip->i_ea_area + ip->i_ea_len); + for (; error == 0 && eap < eaend; eap = EXTATTR_NEXT(eap)) { + /* make sure this entry is complete */ + if (EXTATTR_NEXT(eap) > eaend) break; - p += sizeof(ul); - if (*p++ != ap->a_attrnamespace) + if (eap->ea_namespace != ap->a_attrnamespace) continue; - p++; /* pad2 */ - ealen = *p; - if (ap->a_size != NULL) { + + ealen = eap->ea_namelength; + if (ap->a_size != NULL) *ap->a_size += ealen + 1; - } else if (ap->a_uio != NULL) { - error = uiomove(p, ealen + 1, ap->a_uio); - } + else if (ap->a_uio != NULL) + error = uiomove(&eap->ea_namelength, ealen + 1, + ap->a_uio); } + ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); - return(error); + return (error); } /* @@ -1582,10 +1560,12 @@ vop_setextattr { { struct inode *ip; struct fs *fs; + struct extattr *eap; uint32_t ealength, ul; ssize_t ealen; int olen, eapad1, eapad2, error, i, easize; - u_char *eae, *p; + u_char *eae; + void *tmp; ip = VTOI(ap->a_vp); fs = ITOFS(ip); @@ -1625,29 +1605,33 @@ vop_setextattr { return (error); ealength = sizeof(uint32_t) + 3 + strlen(ap->a_name); - eapad1 = 8 - (ealength % 8); - if (eapad1 == 8) - eapad1 = 0; - eapad2 = 8 - (ealen % 8); - if (eapad2 == 8) - eapad2 = 0; + eapad1 = roundup2(ealength, 8) - ealength; + eapad2 = roundup2(ealen, 8) - ealen; ealength += eapad1 + ealen + eapad2; + /* + * CEM: rewrites of the same size or smaller could be done in-place + * instead. (We don't acquire any fine-grained locks in here either, + * so we could also do bigger writes in-place.) + */ eae = malloc(ip->i_ea_len + ealength, M_TEMP, M_WAITOK); bcopy(ip->i_ea_area, eae, ip->i_ea_len); easize = ip->i_ea_len; - olen = ffs_findextattr(eae, easize, - ap->a_attrnamespace, ap->a_name, &p, NULL); + olen = ffs_findextattr(eae, easize, ap->a_attrnamespace, ap->a_name, + &eap, NULL); if (olen == -1) { /* new, append at end */ - p = eae + easize; + KASSERT(ALIGNED_TO(eae + easize, struct extattr), + ("unaligned")); + eap = (struct extattr *)(eae + easize); easize += ealength; } else { - bcopy(p, &ul, sizeof ul); - i = p - eae + ul; + ul = eap->ea_length; + i = (u_char *)EXTATTR_NEXT(eap) - eae; if (ul != ealength) { - bcopy(p + ul, p + ealength, easize - i); + bcopy(EXTATTR_NEXT(eap), (u_char *)eap + ealength, + easize - i); easize += (ealength - ul); } } @@ -1656,34 +1640,30 @@ vop_setextattr { ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = ENOSPC; - return(ENOSPC); + return (ENOSPC); } - bcopy(&ealength, p, sizeof(ealength)); - p += sizeof(ealength); - *p++ = ap->a_attrnamespace; - *p++ = eapad2; - *p++ = strlen(ap->a_name); - strcpy(p, ap->a_name); - p += strlen(ap->a_name); - bzero(p, eapad1); - p += eapad1; - error = uiomove(p, ealen, ap->a_uio); + eap->ea_length = ealength; + eap->ea_namespace = ap->a_attrnamespace; + eap->ea_contentpadlen = eapad2; + eap->ea_namelength = strlen(ap->a_name); + memcpy(eap->ea_name, ap->a_name, strlen(ap->a_name)); + bzero(&eap->ea_name[strlen(ap->a_name)], eapad1); + error = uiomove(EXTATTR_CONTENT(eap), ealen, ap->a_uio); if (error) { free(eae, M_TEMP); ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = error; - return(error); + return (error); } - p += ealen; - bzero(p, eapad2); + bzero((u_char *)EXTATTR_CONTENT(eap) + ealen, eapad2); - p = ip->i_ea_area; + tmp = ip->i_ea_area; ip->i_ea_area = eae; ip->i_ea_len = easize; - free(p, M_TEMP); + free(tmp, M_TEMP); error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); - return(error); + return (error); } /* From owner-svn-src-all@freebsd.org Thu Jan 19 16:59:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40FDECB8A02; Thu, 19 Jan 2017 16:59:57 +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 10ABD1E12; Thu, 19 Jan 2017 16:59:56 +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 v0JGxuLG033190; Thu, 19 Jan 2017 16:59:56 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JGxuS8033189; Thu, 19 Jan 2017 16:59:56 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701191659.v0JGxuS8033189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 19 Jan 2017 16:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312417 - 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, 19 Jan 2017 16:59:57 -0000 Author: asomers Date: Thu Jan 19 16:59:55 2017 New Revision: 312417 URL: https://svnweb.freebsd.org/changeset/base/312417 Log: Fix build of devd with GCC 4.2 Reported by: olivier Pointy-hat-to: asomers MFC after: 27 days X-MFC-with: 312395 Sponsored by: Spectra Logic Corp Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Thu Jan 19 16:46:05 2017 (r312416) +++ head/sbin/devd/devd.cc Thu Jan 19 16:59:55 2017 (r312417) @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "devd.h" /* C compatible definitions */ From owner-svn-src-all@freebsd.org Thu Jan 19 17:01:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5081FCB8DA5; Thu, 19 Jan 2017 17:01:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yw0-x244.google.com (mail-yw0-x244.google.com [IPv6:2607:f8b0:4002: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 0E85B12AF; Thu, 19 Jan 2017 17:01:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yw0-x244.google.com with SMTP id 17so5118965ywk.2; Thu, 19 Jan 2017 09:01:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=mutaqToPTLhVghE9HJbBdK+4e8MD5rMkLdX1Zzku8Dc=; b=pSeffQIZs8I/AyYyUPC24jZ7V7iQflBmNbx3liG4dbV8B8GP7VZevKkrjQbK8KJrW1 LL5o7Ky4TRReQNeLqQk6DTUt8nJJ5jDbgvAzmFr6eECJRTlEv+/t6wkrJecaWdGomH74 vo55Af/C5VUkvZxV4KIYh5sgp4b17gAOT/vrr91aZmfTEEY802VQuI3oVU+TOo1EUPBS kg9h8g7ywLTEtN5MiyM9cNBxxqdMN4fmLVvfmXJFvwAxCtJLKEhpMOeJuP306eyFiwR1 LVBFHwHpYhUI8zrpWZtpR0RLAQw7InfKZGh+HHXDo7jmiGPvUmUTOWLOXW9k4CmVPeDF ngqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=mutaqToPTLhVghE9HJbBdK+4e8MD5rMkLdX1Zzku8Dc=; b=Nzd0bn35kyPrLTQGWpEgB/o5q77/9PRBWP2HOZCINj55oTsyIyh1rkZPMvVAoeHQLU ai0Pp6NptcgMYZIRbBORNi8XPvUCXJuYGh20Khd+eFAIJX4Pkwt5sz2DR6hM+9BPkKRR kOsz7dvq95ZX6Nd3zEqQvkPqOc6gyvUuRCSkU92v4ZgzzwjkuHggfua+2pSLf1fVWK2y Mcjfj5m9rBaVrdxFgOQU2VxPXZ+e+6pQkTkK2K3GEyi30XqqgiJvag+/AxYFFIINZPYK zbRwuMjUuyap6+1VtzXvM4tU9MwYmbMV6wyhokqsKDRlQCd1HXiUvUnmhgN02Quc8Geu 12sw== X-Gm-Message-State: AIkVDXL60c7KKh90Qcbqpr96z50cahbi35sdeqrnhtCo+u7Zp2JlG3i/HxWvtklB1feaZs4wSXTtuHYnD7KPaw== X-Received: by 10.129.154.194 with SMTP id r185mr7202021ywg.252.1484845259784; Thu, 19 Jan 2017 09:00:59 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.38.133 with HTTP; Thu, 19 Jan 2017 09:00:59 -0800 (PST) In-Reply-To: References: <201701182024.v0IKObaC021450@repo.freebsd.org> From: Alan Somers Date: Thu, 19 Jan 2017 10:00:59 -0700 X-Google-Sender-Auth: aXC_ERQNXsyRoHgTOfV4b7Hg_cs Message-ID: Subject: Re: svn commit: r312395 - head/sbin/devd To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Cc: src-committers , svn-src-all , svn-src-head 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: Thu, 19 Jan 2017 17:01:02 -0000 On Thu, Jan 19, 2017 at 2:24 AM, Olivier Cochard-Labb=C3=A9 wrote: > On Wed, Jan 18, 2017 at 9:24 PM, Alan Somers wrote: >> >> Author: asomers >> Date: Wed Jan 18 20:24:37 2017 >> New Revision: 312395 >> URL: https://svnweb.freebsd.org/changeset/base/312395 >> >> Log: >> Fix several Coverity CIDs in devd >> > > > Hi, > > this break buildworld for mips arch: > > > --- devd.o --- > /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc: In > function 'void event_loop()': > /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: > error: expected type-specifier > /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: > error: expected unqualified-id before 'e' > /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: > error: expected `)' before 'e' > /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: > error: expected `{' before 'e' > /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: > error: 'e' was not declared in this scope > /usr/local/poudriere/jails/head-mips32/usr/src/sbin/devd/devd.cc:1066: > error: expected `;' before ')' token > --- all_subdir_sbin/hastd --- Sorry for the breakage. Should be fixed in r312417. -Alan From owner-svn-src-all@freebsd.org Thu Jan 19 17:03:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38434CB50BA; Thu, 19 Jan 2017 17:03:47 +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 E380C1653; Thu, 19 Jan 2017 17:03:46 +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 v0JH3k8j036893; Thu, 19 Jan 2017 17:03:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JH3jnt036891; Thu, 19 Jan 2017 17:03:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701191703.v0JH3jnt036891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 19 Jan 2017 17:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312418 - head/lib/libc/x86/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, 19 Jan 2017 17:03:47 -0000 Author: ngie Date: Thu Jan 19 17:03:45 2017 New Revision: 312418 URL: https://svnweb.freebsd.org/changeset/base/312418 Log: Conditionalize hyperv support in gettimeofday(2) based on MK_HYPERV The effect at runtime is negligible as the hyperv timer isn't available except when hyperv is loaded. This is a prerequisite for conditionalizing the header build/install out of the build MFC after: 3 weeks Reviewed by: sephe Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9242 Modified: head/lib/libc/x86/sys/Makefile.inc head/lib/libc/x86/sys/__vdso_gettc.c Modified: head/lib/libc/x86/sys/Makefile.inc ============================================================================== --- head/lib/libc/x86/sys/Makefile.inc Thu Jan 19 16:59:55 2017 (r312417) +++ head/lib/libc/x86/sys/Makefile.inc Thu Jan 19 17:03:45 2017 (r312418) @@ -4,3 +4,7 @@ SRCS+= \ __vdso_gettc.c + +.if ${MK_HYPERV} != "no" +CFLAGS+= -DWANT_HYPERV +.endif Modified: head/lib/libc/x86/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/x86/sys/__vdso_gettc.c Thu Jan 19 16:59:55 2017 (r312417) +++ head/lib/libc/x86/sys/__vdso_gettc.c Thu Jan 19 17:03:45 2017 (r312418) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef __amd64__ +#ifdef WANT_HYPERV #include #endif #include "libc_private.h" @@ -158,7 +158,7 @@ __vdso_init_hpet(uint32_t u) munmap((void *)new_map, PAGE_SIZE); } -#ifdef __amd64__ +#ifdef WANT_HYPERV #define HYPERV_REFTSC_DEVPATH "/dev/" HYPERV_REFTSC_DEVNAME @@ -217,7 +217,7 @@ __vdso_hyperv_tsc(struct hyperv_reftsc * return (ENOSYS); } -#endif /* __amd64__ */ +#endif /* WANT_HYPERV */ #pragma weak __vdso_gettc int @@ -246,7 +246,7 @@ __vdso_gettc(const struct vdso_timehands return (ENOSYS); *tc = *(volatile uint32_t *)(map + HPET_MAIN_COUNTER); return (0); -#ifdef __amd64__ +#ifdef WANT_HYPERV case VDSO_TH_ALGO_X86_HVTSC: if (hyperv_ref_tsc == NULL) __vdso_init_hyperv_tsc(); From owner-svn-src-all@freebsd.org Thu Jan 19 17:09:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A9DCB515E; Thu, 19 Jan 2017 17:09:12 +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 50E1418A7; Thu, 19 Jan 2017 17:09:12 +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 v0JH9BxA037124; Thu, 19 Jan 2017 17:09:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JH9BDd037121; Thu, 19 Jan 2017 17:09:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701191709.v0JH9BDd037121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 19 Jan 2017 17:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312419 - 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: Thu, 19 Jan 2017 17:09:12 -0000 Author: ngie Date: Thu Jan 19 17:09:11 2017 New Revision: 312419 URL: https://svnweb.freebsd.org/changeset/base/312419 Log: Add manpage for mlx4ib(4) This manpage isn't differentiated from mlx4en except where necessary, replacing eth/ETH with ib/IB. Eventually the manpages will be split and the common bits be placed in a manpage named "mlx4.4". MFC after: 3 weeks Reviewed by: hselasky Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9241 Added: head/share/man/man4/mlx4ib.4 - copied, changed from r312391, head/share/man/man4/mlx4en.4 Modified: head/share/man/man4/Makefile head/share/man/man4/mlx4en.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Jan 19 17:03:45 2017 (r312418) +++ head/share/man/man4/Makefile Thu Jan 19 17:09:11 2017 (r312419) @@ -889,6 +889,10 @@ MAN+= iscsi_initiator.4 MAN+= iser.4 .endif +.if ${MK_OFED} != "no" +MAN+= mlx4ib.4 +.endif + .if ${MK_TESTS} != "no" ATF= ${.CURDIR}/../../../contrib/atf .PATH: ${ATF}/doc Modified: head/share/man/man4/mlx4en.4 ============================================================================== --- head/share/man/man4/mlx4en.4 Thu Jan 19 17:03:45 2017 (r312418) +++ head/share/man/man4/mlx4en.4 Thu Jan 19 17:09:11 2017 (r312419) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2016 +.Dd January 18, 2017 .Dt MLX4EN 4 .Os .Sh NAME @@ -81,6 +81,7 @@ If an issue is identified with this driv email all the specific information related to the issue to .Aq Mt freebsd-drivers@mellanox.com . .Sh SEE ALSO +.Xr mlx4ib 4 , .Xr ifconfig 8 .Sh HISTORY The Copied and modified: head/share/man/man4/mlx4ib.4 (from r312391, head/share/man/man4/mlx4en.4) ============================================================================== --- head/share/man/man4/mlx4en.4 Wed Jan 18 17:55:49 2017 (r312391, copy source) +++ head/share/man/man4/mlx4ib.4 Thu Jan 19 17:09:11 2017 (r312419) @@ -24,11 +24,11 @@ .\" .\" $FreeBSD$ .\" -.Dd September 30, 2016 -.Dt MLX4EN 4 +.Dd January 18, 2017 +.Dt MLX4IB 4 .Os .Sh NAME -.Nm mlx4en +.Nm mlx4ib .Nd "Mellanox ConnectX-3 10GbE/40GbE network adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, @@ -37,20 +37,20 @@ kernel configuration file: .Bd -ragged -offset indent .Cd "options COMPAT_LINUXKPI" .Cd "device mlx4" -.Cd "device mlx4en" +.Cd "device mlx4ib" .Ed .Pp To load the driver as a module at run-time, run the following command as root: .Bd -literal -offset indent -kldload mlx4en +kldload mlx4ib .Ed .Pp To load the driver as a module at boot time, place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent -mlx4en_load="YES" +mlx4ib_load="YES" .Ed .Sh DESCRIPTION Mellanox ConnectX adapter cards with Virtual Protocol Interconnect @@ -68,9 +68,9 @@ driver supports the following network ad .Pp .Bl -bullet -compact .It -Mellanox ConnectX-2 (ETH) +Mellanox ConnectX-2 (IB) .It -Mellanox ConnectX-3 (ETH) +Mellanox ConnectX-3 (IB) .El .Sh SUPPORT For general information and support, @@ -81,6 +81,7 @@ If an issue is identified with this driv email all the specific information related to the issue to .Aq Mt freebsd-drivers@mellanox.com . .Sh SEE ALSO +.Xr mlx4en 4 , .Xr ifconfig 8 .Sh HISTORY The From owner-svn-src-all@freebsd.org Thu Jan 19 17:49:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2272CB5F7C; Thu, 19 Jan 2017 17:49:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A70ED1251; Thu, 19 Jan 2017 17:49:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JHnlos053239; Thu, 19 Jan 2017 17:49:47 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JHnl2Z053238; Thu, 19 Jan 2017 17:49:47 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201701191749.v0JHnl2Z053238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 19 Jan 2017 17:49: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: r312420 - stable/11/sys/fs/nfsserver 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, 19 Jan 2017 17:49:49 -0000 Author: jpaetzel Date: Thu Jan 19 17:49:47 2017 New Revision: 312420 URL: https://svnweb.freebsd.org/changeset/base/312420 Log: MFC 311122 Workaround NFS bug with readdirplus when there are greater than 1 billion files in a filesystem. Reviewed by: kib Modified: stable/11/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdport.c Thu Jan 19 17:09:11 2017 (r312419) +++ stable/11/sys/fs/nfsserver/nfs_nfsdport.c Thu Jan 19 17:49:47 2017 (r312420) @@ -2018,25 +2018,17 @@ again: } /* - * Check to see if entries in this directory can be safely acquired - * via VFS_VGET() or if a switch to VOP_LOOKUP() is required. - * ZFS snapshot directories need VOP_LOOKUP(), so that any - * automount of the snapshot directory that is required will - * be done. - * This needs to be done here for NFSv4, since NFSv4 never does - * a VFS_VGET() for "." or "..". + * For now ZFS requires VOP_LOOKUP as a workaround. Until ino_t is changed + * to 64 bit type a ZFS filesystem with over 1 billion files in it + * will suffer from 64bit -> 32bit truncation. */ - if (is_zfs == 1) { - r = VFS_VGET(mp, at.na_fileid, LK_SHARED, &nvp); - if (r == EOPNOTSUPP) { - usevget = 0; - cn.cn_nameiop = LOOKUP; - cn.cn_lkflags = LK_SHARED | LK_RETRY; - cn.cn_cred = nd->nd_cred; - cn.cn_thread = p; - } else if (r == 0) - vput(nvp); - } + if (is_zfs == 1) + usevget = 0; + + cn.cn_nameiop = LOOKUP; + cn.cn_lkflags = LK_SHARED | LK_RETRY; + cn.cn_cred = nd->nd_cred; + cn.cn_thread = p; /* * Save this position, in case there is an error before one entry @@ -2105,16 +2097,7 @@ again: else r = EOPNOTSUPP; if (r == EOPNOTSUPP) { - if (usevget) { - usevget = 0; - cn.cn_nameiop = LOOKUP; - cn.cn_lkflags = - LK_SHARED | - LK_RETRY; - cn.cn_cred = - nd->nd_cred; - cn.cn_thread = p; - } + usevget = 0; cn.cn_nameptr = dp->d_name; cn.cn_namelen = nlen; cn.cn_flags = ISLASTCN | From owner-svn-src-all@freebsd.org Thu Jan 19 17:58:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80BA5CB74BB; Thu, 19 Jan 2017 17:58:09 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3599C1D46; Thu, 19 Jan 2017 17:58:09 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JHw8J0057470; Thu, 19 Jan 2017 17:58:08 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JHw8uU057469; Thu, 19 Jan 2017 17:58:08 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201701191758.v0JHw8uU057469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 19 Jan 2017 17:58: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: r312421 - stable/10/sys/fs/nfsserver 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, 19 Jan 2017 17:58:09 -0000 Author: jpaetzel Date: Thu Jan 19 17:58:08 2017 New Revision: 312421 URL: https://svnweb.freebsd.org/changeset/base/312421 Log: MFC 311122 Workaround NFS bug with readdirplus when there are greater than 1 billion files in a filesystem. Reviewed by: kib Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/10/sys/fs/nfsserver/nfs_nfsdport.c Thu Jan 19 17:49:47 2017 (r312420) +++ stable/10/sys/fs/nfsserver/nfs_nfsdport.c Thu Jan 19 17:58:08 2017 (r312421) @@ -2013,25 +2013,17 @@ again: } /* - * Check to see if entries in this directory can be safely acquired - * via VFS_VGET() or if a switch to VOP_LOOKUP() is required. - * ZFS snapshot directories need VOP_LOOKUP(), so that any - * automount of the snapshot directory that is required will - * be done. - * This needs to be done here for NFSv4, since NFSv4 never does - * a VFS_VGET() for "." or "..". + * For now ZFS requires VOP_LOOKUP as a workaround. Until ino_t is changed + * to 64 bit type a ZFS filesystem with over 1 billion files in it + * will suffer from 64bit -> 32bit truncation. */ - if (is_zfs == 1) { - r = VFS_VGET(mp, at.na_fileid, LK_SHARED, &nvp); - if (r == EOPNOTSUPP) { - usevget = 0; - cn.cn_nameiop = LOOKUP; - cn.cn_lkflags = LK_SHARED | LK_RETRY; - cn.cn_cred = nd->nd_cred; - cn.cn_thread = p; - } else if (r == 0) - vput(nvp); - } + if (is_zfs == 1) + usevget = 0; + + cn.cn_nameiop = LOOKUP; + cn.cn_lkflags = LK_SHARED | LK_RETRY; + cn.cn_cred = nd->nd_cred; + cn.cn_thread = p; /* * Save this position, in case there is an error before one entry @@ -2100,16 +2092,7 @@ again: else r = EOPNOTSUPP; if (r == EOPNOTSUPP) { - if (usevget) { - usevget = 0; - cn.cn_nameiop = LOOKUP; - cn.cn_lkflags = - LK_SHARED | - LK_RETRY; - cn.cn_cred = - nd->nd_cred; - cn.cn_thread = p; - } + usevget = 0; cn.cn_nameptr = dp->d_name; cn.cn_namelen = nlen; cn.cn_flags = ISLASTCN | From owner-svn-src-all@freebsd.org Thu Jan 19 18:07:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC3FDCB7842; Thu, 19 Jan 2017 18:07: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 7B8BA130E; Thu, 19 Jan 2017 18:07: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 v0JI7Ofq061445; Thu, 19 Jan 2017 18:07:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JI7OBN061444; Thu, 19 Jan 2017 18:07:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701191807.v0JI7OBN061444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 19 Jan 2017 18:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312422 - head/lib/libc/x86/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, 19 Jan 2017 18:07:25 -0000 Author: ngie Date: Thu Jan 19 18:07:24 2017 New Revision: 312422 URL: https://svnweb.freebsd.org/changeset/base/312422 Log: Only conditionally add in hyperv support if we're building amd64 This unbreaks the build because the assembly is written for x64. MFC after: 3 weeks X-MFC with: r312418 Pointyhat to: ngie Reported by: Jenkins (i386 job) Sponsored by: Dell EMC Isilon Modified: head/lib/libc/x86/sys/Makefile.inc Modified: head/lib/libc/x86/sys/Makefile.inc ============================================================================== --- head/lib/libc/x86/sys/Makefile.inc Thu Jan 19 17:58:08 2017 (r312421) +++ head/lib/libc/x86/sys/Makefile.inc Thu Jan 19 18:07:24 2017 (r312422) @@ -5,6 +5,6 @@ SRCS+= \ __vdso_gettc.c -.if ${MK_HYPERV} != "no" +.if ${MACHINE_CPUARCH} == "amd64" && ${MK_HYPERV} != "no" CFLAGS+= -DWANT_HYPERV .endif From owner-svn-src-all@freebsd.org Thu Jan 19 18:26:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DEFACB830D; Thu, 19 Jan 2017 18:26:07 +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 381A5156B; Thu, 19 Jan 2017 18:26:07 +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 v0JIQ6ib069976; Thu, 19 Jan 2017 18:26:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JIQ6qO069975; Thu, 19 Jan 2017 18:26:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191826.v0JIQ6qO069975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 18:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312423 - head/share/man/man5 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, 19 Jan 2017 18:26:07 -0000 Author: kib Date: Thu Jan 19 18:26:06 2017 New Revision: 312423 URL: https://svnweb.freebsd.org/changeset/base/312423 Log: Refresh tmpfs(5) man page. Provide more useful explanation of features and quirks. Reviewed by: emaste, vangyzen Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D9211 Modified: head/share/man/man5/tmpfs.5 Modified: head/share/man/man5/tmpfs.5 ============================================================================== --- head/share/man/man5/tmpfs.5 Thu Jan 19 18:07:24 2017 (r312422) +++ head/share/man/man5/tmpfs.5 Thu Jan 19 18:26:06 2017 (r312423) @@ -1,7 +1,12 @@ .\"- .\" Copyright (c) 2007 Xin LI +.\" Copyright (c) 2017 The FreeBSD Foundation, Inc. .\" All rights reserved. .\" +.\" Part of this documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -49,12 +54,12 @@ .\" .\" $FreeBSD$ .\" -.Dd April 23, 2012 +.Dd January 17, 2017 .Dt TMPFS 5 .Os .Sh NAME .Nm tmpfs -.Nd "efficient memory file system" +.Nd "in-memory file system" .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your @@ -72,17 +77,40 @@ tmpfs_load="YES" .Sh DESCRIPTION The .Nm -driver will permit the -.Fx -kernel to access +driver implements in-memory, or .Tn tmpfs -file systems. +file system. +The filesystem stores both file metadata and data in main memory. +This allows very fast and low latency accesses to the data. +The data is volatile. +An umount or system reboot invalidates it. +These properties make the filesystem's mounts suitable for fast +scratch storage, e.g. +.Pa /tmp . +.Pp +If the system becomes low on memory and swap is configured (see +.Xr swapon 8 ), +file data may be written to the swap space, freeing memory +for other needs. +The current implementation never swaps out metadata, including +the directory content. +Keep this in mind when planning the mount limits, especially when expecting +to place many small files on a tmpfs mount. +.Pp +When a file from a tmpfs mount is mmaped (see +.Xr mmap 2 ) +into the process address space, the swap VM object which manages the file +pages is used to implement mapping and to avoid double-copying of +the file data. +This quirk causes process inspection tools, like +.Xr procstat 1 , +to report anonymous memory mappings instead of file mappings. .Sh OPTIONS The following options are available when mounting .Nm file systems: -.Bl -tag -width indent +.Bl -tag -width "It Cm maxfilesize" .It Cm gid Specifies the group ID of the root inode of the file system. Defaults to the mount point's GID. @@ -114,11 +142,15 @@ memory file system: .Pp .Dl "mount -t tmpfs tmpfs /tmp" .Sh SEE ALSO +.Xr procstat 1 , .Xr nmount 2 , +.Xr mmap 2 , .Xr unmount 2 , .Xr fstab 5 , .Xr mdmfs 8 , -.Xr mount 8 +.Xr mount 8 , +.Xr swapinfo 8 , +.Xr swapon 8 .Sh HISTORY The .Nm @@ -130,7 +162,7 @@ The .Nm kernel implementation was written by .An Julio M. Merino Vidal Aq Mt jmmv@NetBSD.org -as a Google SoC project. +as a Google Summer of Code project. .Pp .An Rohit Jalan and others ported it from @@ -140,5 +172,3 @@ to .Pp This manual page was written by .An Xin LI Aq Mt delphij@FreeBSD.org . -.Sh BUGS -Some file system mount time options may not be well-supported. From owner-svn-src-all@freebsd.org Thu Jan 19 18:33:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6294CB8613; Thu, 19 Jan 2017 18:33:28 +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 90C751CC7; Thu, 19 Jan 2017 18:33:28 +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 v0JIXRos074189; Thu, 19 Jan 2017 18:33:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JIXRkh074186; Thu, 19 Jan 2017 18:33:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701191833.v0JIXRkh074186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 19 Jan 2017 18:33:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312424 - head/sys/dev/usb/controller 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, 19 Jan 2017 18:33:28 -0000 Author: hselasky Date: Thu Jan 19 18:33:27 2017 New Revision: 312424 URL: https://svnweb.freebsd.org/changeset/base/312424 Log: Fix problem with suspend and resume when using Skylake chipsets. Make sure the XHCI controller is reset after halting it. The problem is clearly a BIOS bug as the suspend and resume is failing without loading the XHCI driver. The same happens when using Linux and the XHCI driver is not loaded. Submitted by: Yanko Yankulov PR: 216261 MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Thu Jan 19 18:26:06 2017 (r312423) +++ head/sys/dev/usb/controller/xhci.c Thu Jan 19 18:33:27 2017 (r312424) @@ -347,6 +347,7 @@ xhci_start_controller(struct xhci_softc struct usb_page_search buf_res; struct xhci_hw_root *phwr; struct xhci_dev_ctx_addr *pdctxa; + usb_error_t err; uint64_t addr; uint32_t temp; uint16_t i; @@ -358,22 +359,9 @@ xhci_start_controller(struct xhci_softc sc->sc_command_ccs = 1; sc->sc_command_idx = 0; - /* Reset controller */ - XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST); - - for (i = 0; i != 100; i++) { - usb_pause_mtx(NULL, hz / 100); - temp = (XREAD4(sc, oper, XHCI_USBCMD) & XHCI_CMD_HCRST) | - (XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_CNR); - if (!temp) - break; - } - - if (temp) { - device_printf(sc->sc_bus.parent, "Controller " - "reset timeout.\n"); - return (USB_ERR_IOERROR); - } + err = xhci_reset_controller(sc); + if (err) + return (err); /* set up number of device slots */ DPRINTF("CONFIG=0x%08x -> 0x%08x\n", @@ -521,6 +509,33 @@ xhci_halt_controller(struct xhci_softc * } usb_error_t +xhci_reset_controller(struct xhci_softc *sc) +{ + uint32_t temp = 0; + uint16_t i; + + DPRINTF("\n"); + + /* Reset controller */ + XWRITE4(sc, oper, XHCI_USBCMD, XHCI_CMD_HCRST); + + for (i = 0; i != 100; i++) { + usb_pause_mtx(NULL, hz / 100); + temp = (XREAD4(sc, oper, XHCI_USBCMD) & XHCI_CMD_HCRST) | + (XREAD4(sc, oper, XHCI_USBSTS) & XHCI_STS_CNR); + if (!temp) + break; + } + + if (temp) { + device_printf(sc->sc_bus.parent, "Controller " + "reset timeout.\n"); + return (USB_ERR_IOERROR); + } + return (0); +} + +usb_error_t xhci_init(struct xhci_softc *sc, device_t self, uint8_t dma32) { uint32_t temp; @@ -671,10 +686,12 @@ xhci_set_hw_power_sleep(struct usb_bus * case USB_HW_POWER_SUSPEND: DPRINTF("Stopping the XHCI\n"); xhci_halt_controller(sc); + xhci_reset_controller(sc); break; case USB_HW_POWER_SHUTDOWN: DPRINTF("Stopping the XHCI\n"); xhci_halt_controller(sc); + xhci_reset_controller(sc); break; case USB_HW_POWER_RESUME: DPRINTF("Starting the XHCI\n"); Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Thu Jan 19 18:26:06 2017 (r312423) +++ head/sys/dev/usb/controller/xhci.h Thu Jan 19 18:33:27 2017 (r312424) @@ -525,6 +525,7 @@ struct xhci_softc { uint8_t xhci_use_polling(void); usb_error_t xhci_halt_controller(struct xhci_softc *); +usb_error_t xhci_reset_controller(struct xhci_softc *); usb_error_t xhci_init(struct xhci_softc *, device_t, uint8_t); usb_error_t xhci_start_controller(struct xhci_softc *); void xhci_interrupt(struct xhci_softc *); Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Thu Jan 19 18:26:06 2017 (r312423) +++ head/sys/dev/usb/controller/xhci_pci.c Thu Jan 19 18:33:27 2017 (r312424) @@ -348,6 +348,7 @@ xhci_pci_detach(device_t self) usb_callout_drain(&sc->sc_callout); xhci_halt_controller(sc); + xhci_reset_controller(sc); pci_disable_busmaster(self); From owner-svn-src-all@freebsd.org Thu Jan 19 18:39:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15848CB87EE; Thu, 19 Jan 2017 18:39: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 B72E01FE0; Thu, 19 Jan 2017 18:38:59 +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 v0JIcwiT074434; Thu, 19 Jan 2017 18:38:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JIcwWL074432; Thu, 19 Jan 2017 18:38:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191838.v0JIcwWL074432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 18:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312425 - head/sys/fs/tmpfs 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, 19 Jan 2017 18:39:00 -0000 Author: kib Date: Thu Jan 19 18:38:58 2017 New Revision: 312425 URL: https://svnweb.freebsd.org/changeset/base/312425 Log: Make tmpfs directory cursor available outside tmpfs_subr.c. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 18:33:27 2017 (r312424) +++ head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 18:38:58 2017 (r312425) @@ -394,6 +394,11 @@ struct tmpfs_fid { unsigned long tf_gen; }; +struct tmpfs_dir_cursor { + struct tmpfs_dirent *tdc_current; + struct tmpfs_dirent *tdc_tree; +}; + #ifdef _KERNEL /* * Prototypes for tmpfs_subr.c. @@ -438,6 +443,10 @@ void tmpfs_itimes(struct vnode *, const void tmpfs_set_status(struct tmpfs_node *node, int status); void tmpfs_update(struct vnode *); int tmpfs_truncate(struct vnode *, off_t); +struct tmpfs_dirent *tmpfs_dir_first(struct tmpfs_node *dnode, + struct tmpfs_dir_cursor *dc); +struct tmpfs_dirent *tmpfs_dir_next(struct tmpfs_node *dnode, + struct tmpfs_dir_cursor *dc); /* * Convenience macros to simplify some logical expressions. Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 18:33:27 2017 (r312424) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 18:38:58 2017 (r312425) @@ -62,11 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct tmpfs_dir_cursor { - struct tmpfs_dirent *tdc_current; - struct tmpfs_dirent *tdc_tree; -}; - SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW, 0, "tmpfs file system"); static long tmpfs_pages_reserved = TMPFS_PAGES_MINRESERVED; @@ -724,7 +719,7 @@ tmpfs_alloc_file(struct vnode *dvp, stru return (0); } -static struct tmpfs_dirent * +struct tmpfs_dirent * tmpfs_dir_first(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc) { struct tmpfs_dirent *de; @@ -738,7 +733,7 @@ tmpfs_dir_first(struct tmpfs_node *dnode return (dc->tdc_current); } -static struct tmpfs_dirent * +struct tmpfs_dirent * tmpfs_dir_next(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc) { struct tmpfs_dirent *de; From owner-svn-src-all@freebsd.org Thu Jan 19 18:46:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9CFACB89E5; Thu, 19 Jan 2017 18:46:42 +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 6147E14EC; Thu, 19 Jan 2017 18:46:42 +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 v0JIkfod078269; Thu, 19 Jan 2017 18:46:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JIkfMI078267; Thu, 19 Jan 2017 18:46:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201701191846.v0JIkfMI078267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 19 Jan 2017 18:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312426 - 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: Thu, 19 Jan 2017 18:46:42 -0000 Author: avg Date: Thu Jan 19 18:46:41 2017 New Revision: 312426 URL: https://svnweb.freebsd.org/changeset/base/312426 Log: fix a thread preemption regression in schedulers introduced in r270423 Commit r270423 fixed a regression in sched_yield() that was introduced in earlier changes. Unfortunately, at the same time it introduced an new regression. The problem is that SWT_RELINQUISH (6), like all other SWT_* constants and unlike SW_* flags, is not a bit flag. So, (flags & SWT_RELINQUISH) is true in cases where that was not really indended, for example, with SWT_OWEPREEMPT (2) and SWT_REMOTEPREEMPT (11). A straight forward fix would be to use (flags & SW_TYPE_MASK) == SWT_RELINQUISH, but my impression is that the switch types are designed mostly for gathering statistics, not for influencing scheduling decisions. So, I decided that it would be better to check for SW_PREEMPT flag instead. That's also the same flag that was checked before r239157. I double-checked how that flag is used and I am confident that the flag is set only in the places where we really have the preemption: - critical_exit + td_owepreempt - sched_preempt in the ULE scheduler - sched_preempt in the 4BSD scheduler Reviewed by: kib, mav MFC after: 4 days Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D9230 Modified: head/sys/kern/sched_4bsd.c head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Thu Jan 19 18:38:58 2017 (r312425) +++ head/sys/kern/sched_4bsd.c Thu Jan 19 18:46:41 2017 (r312426) @@ -968,8 +968,8 @@ sched_switch(struct thread *td, struct t sched_load_rem(); td->td_lastcpu = td->td_oncpu; - preempted = !((td->td_flags & TDF_SLICEEND) || - (flags & SWT_RELINQUISH)); + preempted = (td->td_flags & TDF_SLICEEND) == 0 && + (flags & SW_PREEMPT) != 0; td->td_flags &= ~(TDF_NEEDRESCHED | TDF_SLICEEND); td->td_owepreempt = 0; td->td_oncpu = NOCPU; Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Thu Jan 19 18:38:58 2017 (r312425) +++ head/sys/kern/sched_ule.c Thu Jan 19 18:46:41 2017 (r312426) @@ -1898,8 +1898,8 @@ sched_switch(struct thread *td, struct t ts->ts_rltick = ticks; td->td_lastcpu = td->td_oncpu; td->td_oncpu = NOCPU; - preempted = !((td->td_flags & TDF_SLICEEND) || - (flags & SWT_RELINQUISH)); + preempted = (td->td_flags & TDF_SLICEEND) == 0 && + (flags & SW_PREEMPT) != 0; td->td_flags &= ~(TDF_NEEDRESCHED | TDF_SLICEEND); td->td_owepreempt = 0; if (!TD_IS_IDLETHREAD(td)) From owner-svn-src-all@freebsd.org Thu Jan 19 18:52:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80775CB8C99; Thu, 19 Jan 2017 18:52:40 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B0BA1AC3; Thu, 19 Jan 2017 18:52:40 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JIqdw1082006; Thu, 19 Jan 2017 18:52:39 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JIqckt082001; Thu, 19 Jan 2017 18:52:38 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201701191852.v0JIqckt082001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 19 Jan 2017 18:52:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312427 - head/sys/dev/e1000 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, 19 Jan 2017 18:52:40 -0000 Author: erj Date: Thu Jan 19 18:52:38 2017 New Revision: 312427 URL: https://svnweb.freebsd.org/changeset/base/312427 Log: e1000: Add support for Kaby Lake generation i219 (4) and i219 (5) devices MFC after: 1 week Sponsored by: Intel Corporation Modified: head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_82575.h head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/e1000_82575.c ============================================================================== --- head/sys/dev/e1000/e1000_82575.c Thu Jan 19 18:46:41 2017 (r312426) +++ head/sys/dev/e1000/e1000_82575.c Thu Jan 19 18:52:38 2017 (r312427) @@ -101,7 +101,6 @@ static s32 e1000_validate_nvm_checksum_w u16 offset); static s32 e1000_validate_nvm_checksum_i350(struct e1000_hw *hw); static s32 e1000_update_nvm_checksum_i350(struct e1000_hw *hw); -static void e1000_write_vfta_i350(struct e1000_hw *hw, u32 offset, u32 value); static void e1000_clear_vfta_i350(struct e1000_hw *hw); static void e1000_i2c_start(struct e1000_hw *hw); Modified: head/sys/dev/e1000/e1000_82575.h ============================================================================== --- head/sys/dev/e1000/e1000_82575.h Thu Jan 19 18:46:41 2017 (r312426) +++ head/sys/dev/e1000/e1000_82575.h Thu Jan 19 18:52:38 2017 (r312427) @@ -493,6 +493,7 @@ enum e1000_promisc_type { void e1000_vfta_set_vf(struct e1000_hw *, u16, bool); void e1000_rlpml_set_vf(struct e1000_hw *, u16); s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type); +void e1000_write_vfta_i350(struct e1000_hw *hw, u32 offset, u32 value); u16 e1000_rxpbs_adjust_82580(u32 data); s32 e1000_read_emi_reg(struct e1000_hw *hw, u16 addr, u16 *data); s32 e1000_set_eee_i350(struct e1000_hw *hw, bool adv1G, bool adv100M); Modified: head/sys/dev/e1000/e1000_defines.h ============================================================================== --- head/sys/dev/e1000/e1000_defines.h Thu Jan 19 18:46:41 2017 (r312426) +++ head/sys/dev/e1000/e1000_defines.h Thu Jan 19 18:52:38 2017 (r312427) @@ -469,6 +469,8 @@ #define ETHERNET_FCS_SIZE 4 #define MAX_JUMBO_FRAME_SIZE 0x3F00 +/* The datasheet maximum supported RX size is 9.5KB (9728 bytes) */ +#define MAX_RX_JUMBO_FRAME_SIZE 0x2600 #define E1000_TX_PTR_GAP 0x1F /* Extended Configuration Control and Size */ Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Thu Jan 19 18:46:41 2017 (r312426) +++ head/sys/dev/e1000/e1000_ich8lan.c Thu Jan 19 18:52:38 2017 (r312427) @@ -243,8 +243,7 @@ static bool e1000_phy_is_accessible_pchl if (ret_val) return FALSE; out: - if ((hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt)) { + if (hw->mac.type >= e1000_pch_lpt) { /* Only unforce SMBus if ME is not active */ if (!(E1000_READ_REG(hw, E1000_FWSM) & E1000_ICH_FWSM_FW_VALID)) { @@ -641,7 +640,7 @@ static s32 e1000_init_nvm_params_ich8lan nvm->type = e1000_nvm_flash_sw; - if (hw->mac.type == e1000_pch_spt) { + if (hw->mac.type >= e1000_pch_spt) { /* in SPT, gfpreg doesn't exist. NVM size is taken from the * STRAP register. This is because in SPT the GbE Flash region * is no longer accessed through the flash registers. Instead, @@ -701,7 +700,7 @@ static s32 e1000_init_nvm_params_ich8lan /* Function Pointers */ nvm->ops.acquire = e1000_acquire_nvm_ich8lan; nvm->ops.release = e1000_release_nvm_ich8lan; - if (hw->mac.type == e1000_pch_spt) { + if (hw->mac.type >= e1000_pch_spt) { nvm->ops.read = e1000_read_nvm_spt; nvm->ops.update = e1000_update_nvm_checksum_spt; } else { @@ -815,8 +814,7 @@ static s32 e1000_init_mac_params_ich8lan break; } - if ((mac->type == e1000_pch_lpt) || - (mac->type == e1000_pch_spt)) { + if (mac->type >= e1000_pch_lpt) { mac->rar_entry_count = E1000_PCH_LPT_RAR_ENTRIES; mac->ops.rar_set = e1000_rar_set_pch_lpt; mac->ops.setup_physical_interface = e1000_setup_copper_link_pch_lpt; @@ -1576,9 +1574,7 @@ static s32 e1000_check_for_copper_link_i * aggressive resulting in many collisions. To avoid this, increase * the IPG and reduce Rx latency in the PHY. */ - if (((hw->mac.type == e1000_pch2lan) || - (hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt)) && link) { + if ((hw->mac.type >= e1000_pch2lan) && link) { u16 speed, duplex; e1000_get_speed_and_duplex_copper_generic(hw, &speed, &duplex); @@ -1589,7 +1585,7 @@ static s32 e1000_check_for_copper_link_i tipg_reg |= 0xFF; /* Reduce Rx latency in analog PHY */ emi_val = 0; - } else if (hw->mac.type == e1000_pch_spt && + } else if (hw->mac.type >= e1000_pch_spt && duplex == FULL_DUPLEX && speed != SPEED_1000) { tipg_reg |= 0xC; emi_val = 1; @@ -1611,8 +1607,8 @@ static s32 e1000_check_for_copper_link_i emi_addr = I217_RX_CONFIG; ret_val = e1000_write_emi_reg_locked(hw, emi_addr, emi_val); - if (hw->mac.type == e1000_pch_lpt || - hw->mac.type == e1000_pch_spt) { + + if (hw->mac.type >= e1000_pch_lpt) { u16 phy_reg; hw->phy.ops.read_reg_locked(hw, I217_PLL_CLOCK_GATE_REG, @@ -1641,7 +1637,7 @@ static s32 e1000_check_for_copper_link_i if (ret_val) return ret_val; - if (hw->mac.type == e1000_pch_spt) { + if (hw->mac.type >= e1000_pch_spt) { u16 data; u16 ptr_gap; @@ -1690,8 +1686,7 @@ static s32 e1000_check_for_copper_link_i * on power up. * Set the Beacon Duration for I217 to 8 usec */ - if ((hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt)) { + if (hw->mac.type >= e1000_pch_lpt) { u32 mac_reg; mac_reg = E1000_READ_REG(hw, E1000_FEXTNVM4); @@ -1709,8 +1704,7 @@ static s32 e1000_check_for_copper_link_i if (ret_val) return ret_val; } - if ((hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt)) { + if (hw->mac.type >= e1000_pch_lpt) { /* Set platform power management values for * Latency Tolerance Reporting (LTR) * Optimized Buffer Flush/Fill (OBFF) @@ -1723,15 +1717,20 @@ static s32 e1000_check_for_copper_link_i /* Clear link partner's EEE ability */ hw->dev_spec.ich8lan.eee_lp_ability = 0; - /* FEXTNVM6 K1-off workaround */ - if (hw->mac.type == e1000_pch_spt) { - u32 pcieanacfg = E1000_READ_REG(hw, E1000_PCIEANACFG); + if (hw->mac.type >= e1000_pch_lpt) { u32 fextnvm6 = E1000_READ_REG(hw, E1000_FEXTNVM6); - if ((pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) && - (hw->dev_spec.ich8lan.disable_k1_off == FALSE)) - fextnvm6 |= E1000_FEXTNVM6_K1_OFF_ENABLE; - else + if (hw->mac.type == e1000_pch_spt) { + /* FEXTNVM6 K1-off workaround - for SPT only */ + u32 pcieanacfg = E1000_READ_REG(hw, E1000_PCIEANACFG); + + if (pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) + fextnvm6 |= E1000_FEXTNVM6_K1_OFF_ENABLE; + else + fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE; + } + + if (hw->dev_spec.ich8lan.disable_k1_off == TRUE) fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE; E1000_WRITE_REG(hw, E1000_FEXTNVM6, fextnvm6); @@ -3671,7 +3670,7 @@ static s32 e1000_flash_cycle_init_ich8la /* Clear FCERR and DAEL in hw status by writing 1 */ hsfsts.hsf_status.flcerr = 1; hsfsts.hsf_status.dael = 1; - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS, hsfsts.regval & 0xFFFF); else @@ -3691,7 +3690,7 @@ static s32 e1000_flash_cycle_init_ich8la * Begin by setting Flash Cycle Done. */ hsfsts.hsf_status.flcdone = 1; - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS, hsfsts.regval & 0xFFFF); else @@ -3718,7 +3717,7 @@ static s32 e1000_flash_cycle_init_ich8la * now set the Flash Cycle Done. */ hsfsts.hsf_status.flcdone = 1; - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS, hsfsts.regval & 0xFFFF); else @@ -3748,13 +3747,13 @@ static s32 e1000_flash_cycle_ich8lan(str DEBUGFUNC("e1000_flash_cycle_ich8lan"); /* Start a cycle by writing 1 in Flash Cycle Go in Hw Flash Control */ - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) hsflctl.regval = E1000_READ_FLASH_REG(hw, ICH_FLASH_HSFSTS)>>16; else hsflctl.regval = E1000_READ_FLASH_REG16(hw, ICH_FLASH_HSFCTL); hsflctl.hsf_ctrl.flcgo = 1; - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS, hsflctl.regval << 16); else @@ -3837,7 +3836,7 @@ static s32 e1000_read_flash_byte_ich8lan /* In SPT, only 32 bits access is supported, * so this function should not be called. */ - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) return -E1000_ERR_NVM; else ret_val = e1000_read_flash_data_ich8lan(hw, offset, 1, &word); @@ -3946,7 +3945,7 @@ static s32 e1000_read_flash_data32_ich8l DEBUGFUNC("e1000_read_flash_data_ich8lan"); if (offset > ICH_FLASH_LINEAR_ADDR_MASK || - hw->mac.type != e1000_pch_spt) + hw->mac.type < e1000_pch_spt) return -E1000_ERR_NVM; flash_linear_addr = ((ICH_FLASH_LINEAR_ADDR_MASK & offset) + hw->nvm.flash_base_addr); @@ -4434,7 +4433,7 @@ static s32 e1000_write_flash_data_ich8la DEBUGFUNC("e1000_write_ich8_data"); - if (hw->mac.type == e1000_pch_spt) { + if (hw->mac.type >= e1000_pch_spt) { if (size != 4 || offset > ICH_FLASH_LINEAR_ADDR_MASK) return -E1000_ERR_NVM; } else { @@ -4454,7 +4453,7 @@ static s32 e1000_write_flash_data_ich8la /* In SPT, This register is in Lan memory space, not * flash. Therefore, only 32 bit access is supported */ - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) hsflctl.regval = E1000_READ_FLASH_REG(hw, ICH_FLASH_HSFSTS)>>16; else @@ -4468,7 +4467,7 @@ static s32 e1000_write_flash_data_ich8la * not flash. Therefore, only 32 bit access is * supported */ - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS, hsflctl.regval << 16); else @@ -4530,7 +4529,7 @@ static s32 e1000_write_flash_data32_ich8 DEBUGFUNC("e1000_write_flash_data32_ich8lan"); - if (hw->mac.type == e1000_pch_spt) { + if (hw->mac.type >= e1000_pch_spt) { if (offset > ICH_FLASH_LINEAR_ADDR_MASK) return -E1000_ERR_NVM; } @@ -4546,7 +4545,7 @@ static s32 e1000_write_flash_data32_ich8 /* In SPT, This register is in Lan memory space, not * flash. Therefore, only 32 bit access is supported */ - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) hsflctl.regval = E1000_READ_FLASH_REG(hw, ICH_FLASH_HSFSTS) >> 16; @@ -4561,7 +4560,7 @@ static s32 e1000_write_flash_data32_ich8 * not flash. Therefore, only 32 bit access is * supported */ - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS, hsflctl.regval << 16); else @@ -4763,7 +4762,7 @@ static s32 e1000_erase_flash_bank_ich8la /* Write a value 11 (block Erase) in Flash * Cycle field in hw flash control */ - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) hsflctl.regval = E1000_READ_FLASH_REG(hw, ICH_FLASH_HSFSTS)>>16; @@ -4773,7 +4772,7 @@ static s32 e1000_erase_flash_bank_ich8la ICH_FLASH_HSFCTL); hsflctl.hsf_ctrl.flcycle = ICH_CYCLE_ERASE; - if (hw->mac.type == e1000_pch_spt) + if (hw->mac.type >= e1000_pch_spt) E1000_WRITE_FLASH_REG(hw, ICH_FLASH_HSFSTS, hsflctl.regval << 16); else @@ -5211,8 +5210,7 @@ static void e1000_initialize_hw_bits_ich E1000_WRITE_REG(hw, E1000_RFCTL, reg); /* Enable ECC on Lynxpoint */ - if ((hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt)) { + if (hw->mac.type >= e1000_pch_lpt) { reg = E1000_READ_REG(hw, E1000_PBECCSTS); reg |= E1000_PBECCSTS_ECC_ENABLE; E1000_WRITE_REG(hw, E1000_PBECCSTS, reg); @@ -5645,7 +5643,7 @@ void e1000_suspend_workarounds_ich8lan(s (device_id == E1000_DEV_ID_PCH_LPTLP_I218_V) || (device_id == E1000_DEV_ID_PCH_I218_LM3) || (device_id == E1000_DEV_ID_PCH_I218_V3) || - (hw->mac.type == e1000_pch_spt)) { + (hw->mac.type >= e1000_pch_spt)) { u32 fextnvm6 = E1000_READ_REG(hw, E1000_FEXTNVM6); E1000_WRITE_REG(hw, E1000_FEXTNVM6, Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 19 18:46:41 2017 (r312426) +++ head/sys/dev/e1000/if_em.c Thu Jan 19 18:52:38 2017 (r312427) @@ -159,6 +159,10 @@ static pci_vendor_info_t em_vendor_info_ PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM2, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, "Intel(R) PRO/1000 Network Connection"), PVID(0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, "Intel(R) PRO/1000 Network Connection"), + PVID(0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, "Intel(R) PRO/1000 Network Connection"), /* required last entry */ PVID_END }; From owner-svn-src-all@freebsd.org Thu Jan 19 19:15:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1B2ECB8474; Thu, 19 Jan 2017 19:15:22 +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 7C2521985; Thu, 19 Jan 2017 19:15:22 +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 v0JJFL1F090581; Thu, 19 Jan 2017 19:15:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JJFLEL090577; Thu, 19 Jan 2017 19:15:21 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191915.v0JJFLEL090577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 19:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312428 - head/sys/fs/tmpfs 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, 19 Jan 2017 19:15:22 -0000 Author: kib Date: Thu Jan 19 19:15:21 2017 New Revision: 312428 URL: https://svnweb.freebsd.org/changeset/base/312428 Log: Refcount tmpfs nodes and mount structures. On dotdot lookup and fhtovp operations, it is possible for the file represented by tmpfs node to be removed after the thread calculated the pointer. In this case, tmpfs_alloc_vp() accesses freed memory. Introduce the reference count on the nodes. The allnodes list from tmpfs mount owns 1 reference, and threads performing unlocked operations on the node, add one transient reference. Similarly, since struct tmpfs_mount maintains the list where nodes are enlisted, refcount it by one reference from struct mount and one reference from each node on the list. Both nodes and tmpfs_mounts are removed when refcount goes to zero. Note that this means that nodes and tmpfs_mounts might survive some time after the node is deleted or tmpfs_unmount() finished. The tmpfs_alloc_vp() in these cases returns error either due to node removal (tn_nlinks == 0) or because of insmntque1(9) error. Tested by: pho (as part of larger patch) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 18:52:38 2017 (r312427) +++ head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 19:15:21 2017 (r312428) @@ -158,9 +158,11 @@ struct tmpfs_node { * Doubly-linked list entry which links all existing nodes for * a single file system. This is provided to ease the removal * of all nodes during the unmount operation, and to support - * the implementation of VOP_VNTOCNP(). + * the implementation of VOP_VNTOCNP(). tn_attached is false + * when the node is removed from list and unlocked. */ LIST_ENTRY(tmpfs_node) tn_entries; /* (m) */ + bool tn_attached; /* (m) */ /* * The node's type. Any of 'VBLK', 'VCHR', 'VDIR', 'VFIFO', @@ -231,6 +233,9 @@ struct tmpfs_node { */ int tn_vpstate; /* (i) */ + /* Transient refcounter on this node. */ + u_int tn_refcount; /* (m) + (i) */ + /* misc data field for different tn_type node */ union { /* Valid when tn_type == VBLK || tn_type == VCHR. */ @@ -360,6 +365,9 @@ struct tmpfs_mount { /* Number of nodes currently that are in use. */ ino_t tm_nodes_inuse; + /* Refcounter on this struct tmpfs_mount. */ + uint64_t tm_refcount; + /* maximum representable file size */ u_int64_t tm_maxfilesize; @@ -404,10 +412,14 @@ struct tmpfs_dir_cursor { * Prototypes for tmpfs_subr.c. */ +void tmpfs_ref_node(struct tmpfs_node *node); +void tmpfs_ref_node_locked(struct tmpfs_node *node); int tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount *, enum vtype, uid_t uid, gid_t gid, mode_t mode, struct tmpfs_node *, char *, dev_t, struct tmpfs_node **); void tmpfs_free_node(struct tmpfs_mount *, struct tmpfs_node *); +bool tmpfs_free_node_locked(struct tmpfs_mount *, struct tmpfs_node *, bool); +void tmpfs_free_tmp(struct tmpfs_mount *); int tmpfs_alloc_dirent(struct tmpfs_mount *, struct tmpfs_node *, const char *, u_int, struct tmpfs_dirent **); void tmpfs_free_dirent(struct tmpfs_mount *, struct tmpfs_dirent *); Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 18:52:38 2017 (r312427) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 19:15:21 2017 (r312428) @@ -131,6 +131,26 @@ tmpfs_pages_check_avail(struct tmpfs_mou return (1); } +void +tmpfs_ref_node(struct tmpfs_node *node) +{ + + TMPFS_NODE_LOCK(node); + tmpfs_ref_node_locked(node); + TMPFS_NODE_UNLOCK(node); +} + +void +tmpfs_ref_node_locked(struct tmpfs_node *node) +{ + + TMPFS_NODE_ASSERT_LOCKED(node); + KASSERT(node->tn_refcount > 0, ("node %p zero refcount", node)); + KASSERT(node->tn_refcount < UINT_MAX, ("node %p refcount %u", node, + node->tn_refcount)); + node->tn_refcount++; +} + /* * Allocates a new node of type 'type' inside the 'tmp' mount point, with * its owner set to 'uid', its group to 'gid' and its mode set to 'mode', @@ -205,6 +225,7 @@ tmpfs_alloc_node(struct mount *mp, struc nnode->tn_gid = gid; nnode->tn_mode = mode; nnode->tn_id = alloc_unr(tmp->tm_ino_unr); + nnode->tn_refcount = 1; /* Type-specific initialization. */ switch (nnode->tn_type) { @@ -258,7 +279,9 @@ tmpfs_alloc_node(struct mount *mp, struc TMPFS_LOCK(tmp); LIST_INSERT_HEAD(&tmp->tm_nodes_used, nnode, tn_entries); + nnode->tn_attached = true; tmp->tm_nodes_inuse++; + tmp->tm_refcount++; TMPFS_UNLOCK(tmp); *node = nnode; @@ -272,18 +295,40 @@ tmpfs_alloc_node(struct mount *mp, struc void tmpfs_free_node(struct tmpfs_mount *tmp, struct tmpfs_node *node) { + + TMPFS_LOCK(tmp); + TMPFS_NODE_LOCK(node); + if (!tmpfs_free_node_locked(tmp, node, false)) { + TMPFS_NODE_UNLOCK(node); + TMPFS_UNLOCK(tmp); + } +} + +bool +tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct tmpfs_node *node, + bool detach) +{ vm_object_t uobj; + TMPFS_MP_ASSERT_LOCKED(tmp); + TMPFS_NODE_ASSERT_LOCKED(node); + KASSERT(node->tn_refcount > 0, ("node %p refcount zero", node)); + + node->tn_refcount--; + if (node->tn_attached && (detach || node->tn_refcount == 0)) { + MPASS(tmp->tm_nodes_inuse > 0); + tmp->tm_nodes_inuse--; + LIST_REMOVE(node, tn_entries); + node->tn_attached = false; + } + if (node->tn_refcount > 0) + return (false); + #ifdef INVARIANTS - TMPFS_NODE_LOCK(node); MPASS(node->tn_vnode == NULL); MPASS((node->tn_vpstate & TMPFS_VNODE_ALLOCATING) == 0); - TMPFS_NODE_UNLOCK(node); #endif - - TMPFS_LOCK(tmp); - LIST_REMOVE(node, tn_entries); - tmp->tm_nodes_inuse--; + TMPFS_NODE_UNLOCK(node); TMPFS_UNLOCK(tmp); switch (node->tn_type) { @@ -323,6 +368,9 @@ tmpfs_free_node(struct tmpfs_mount *tmp, free_unr(tmp->tm_ino_unr, node->tn_id); uma_zfree(tmp->tm_node_pool, node); + TMPFS_LOCK(tmp); + tmpfs_free_tmp(tmp); + return (true); } static __inline uint32_t @@ -468,13 +516,16 @@ tmpfs_alloc_vp(struct mount *mp, struct struct vnode **vpp) { struct vnode *vp; + struct tmpfs_mount *tm; vm_object_t object; int error; error = 0; -loop: + tm = VFS_TO_TMPFS(mp); TMPFS_NODE_LOCK(node); -loop1: + tmpfs_ref_node_locked(node); +loop: + TMPFS_NODE_ASSERT_LOCKED(node); if ((vp = node->tn_vnode) != NULL) { MPASS((node->tn_vpstate & TMPFS_VNODE_DOOMED) == 0); VI_LOCK(vp); @@ -494,12 +545,14 @@ loop1: msleep(&node->tn_vnode, TMPFS_NODE_MTX(node), 0, "tmpfsE", 0); } - goto loop1; + goto loop; } TMPFS_NODE_UNLOCK(node); error = vget(vp, lkflag | LK_INTERLOCK, curthread); - if (error == ENOENT) + if (error == ENOENT) { + TMPFS_NODE_LOCK(node); goto loop; + } if (error != 0) { vp = NULL; goto out; @@ -511,6 +564,7 @@ loop1: */ if (node->tn_vnode == NULL || node->tn_vnode != vp) { vput(vp); + TMPFS_NODE_LOCK(node); goto loop; } @@ -532,11 +586,9 @@ loop1: if (node->tn_vpstate & TMPFS_VNODE_ALLOCATING) { node->tn_vpstate |= TMPFS_VNODE_WANT; error = msleep((caddr_t) &node->tn_vpstate, - TMPFS_NODE_MTX(node), PDROP | PCATCH, - "tmpfs_alloc_vp", 0); - if (error) - return error; - + TMPFS_NODE_MTX(node), 0, "tmpfs_alloc_vp", 0); + if (error != 0) + goto out; goto loop; } else node->tn_vpstate |= TMPFS_VNODE_ALLOCATING; @@ -610,16 +662,17 @@ unlock: TMPFS_NODE_UNLOCK(node); out: - *vpp = vp; + if (error == 0) { + *vpp = vp; #ifdef INVARIANTS - if (error == 0) { MPASS(*vpp != NULL && VOP_ISLOCKED(*vpp)); TMPFS_NODE_LOCK(node); MPASS(*vpp == node->tn_vnode); TMPFS_NODE_UNLOCK(node); - } #endif + } + tmpfs_free_node(tm, node); return (error); } Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Thu Jan 19 18:52:38 2017 (r312427) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Thu Jan 19 19:15:21 2017 (r312428) @@ -222,6 +222,7 @@ tmpfs_mount(struct mount *mp) mtx_init(&tmp->tm_allnode_lock, "tmpfs allnode lock", NULL, MTX_DEF); tmp->tm_nodes_max = nodes_max; tmp->tm_nodes_inuse = 0; + tmp->tm_refcount = 1; tmp->tm_maxfilesize = maxfilesize > 0 ? maxfilesize : OFF_MAX; LIST_INIT(&tmp->tm_nodes_used); @@ -304,11 +305,35 @@ tmpfs_unmount(struct mount *mp, int mntf TMPFS_LOCK(tmp); while ((node = LIST_FIRST(&tmp->tm_nodes_used)) != NULL) { - TMPFS_UNLOCK(tmp); + TMPFS_NODE_LOCK(node); if (node->tn_type == VDIR) tmpfs_dir_destroy(tmp, node); - tmpfs_free_node(tmp, node); - TMPFS_LOCK(tmp); + if (tmpfs_free_node_locked(tmp, node, true)) + TMPFS_LOCK(tmp); + else + TMPFS_NODE_UNLOCK(node); + } + + mp->mnt_data = NULL; + tmpfs_free_tmp(tmp); + vfs_write_resume(mp, VR_START_WRITE); + + MNT_ILOCK(mp); + mp->mnt_flag &= ~MNT_LOCAL; + MNT_IUNLOCK(mp); + + return (0); +} + +void +tmpfs_free_tmp(struct tmpfs_mount *tmp) +{ + + MPASS(tmp->tm_refcount > 0); + tmp->tm_refcount--; + if (tmp->tm_refcount > 0) { + TMPFS_UNLOCK(tmp); + return; } TMPFS_UNLOCK(tmp); @@ -320,16 +345,7 @@ tmpfs_unmount(struct mount *mp, int mntf MPASS(tmp->tm_pages_used == 0); MPASS(tmp->tm_nodes_inuse == 0); - /* Throw away the tmpfs_mount structure. */ - free(mp->mnt_data, M_TMPFSMNT); - mp->mnt_data = NULL; - vfs_write_resume(mp, VR_START_WRITE); - - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_LOCAL; - MNT_IUNLOCK(mp); - - return (0); + free(tmp, M_TMPFSMNT); } static int @@ -347,36 +363,36 @@ static int tmpfs_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp) { - boolean_t found; struct tmpfs_fid *tfhp; struct tmpfs_mount *tmp; struct tmpfs_node *node; + int error; tmp = VFS_TO_TMPFS(mp); tfhp = (struct tmpfs_fid *)fhp; if (tfhp->tf_len != sizeof(struct tmpfs_fid)) - return EINVAL; + return (EINVAL); if (tfhp->tf_id >= tmp->tm_nodes_max) - return EINVAL; - - found = FALSE; + return (EINVAL); TMPFS_LOCK(tmp); LIST_FOREACH(node, &tmp->tm_nodes_used, tn_entries) { if (node->tn_id == tfhp->tf_id && node->tn_gen == tfhp->tf_gen) { - found = TRUE; + tmpfs_ref_node(node); break; } } TMPFS_UNLOCK(tmp); - if (found) - return (tmpfs_alloc_vp(mp, node, LK_EXCLUSIVE, vpp)); - - return (EINVAL); + if (node != NULL) { + error = tmpfs_alloc_vp(mp, node, LK_EXCLUSIVE, vpp); + tmpfs_free_node(tmp, node); + } else + error = EINVAL; + return (error); } /* ARGSUSED2 */ Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 19 18:52:38 2017 (r312427) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 19 19:15:21 2017 (r312428) @@ -82,7 +82,8 @@ tmpfs_lookup(struct vop_cachedlookup_arg struct vnode **vpp = v->a_vpp; struct componentname *cnp = v->a_cnp; struct tmpfs_dirent *de; - struct tmpfs_node *dnode; + struct tmpfs_node *dnode, *pnode; + struct tmpfs_mount *tm; int error; dnode = VP_TO_TMPFS_DIR(dvp); @@ -104,8 +105,12 @@ tmpfs_lookup(struct vop_cachedlookup_arg goto out; } if (cnp->cn_flags & ISDOTDOT) { + tm = VFS_TO_TMPFS(dvp->v_mount); + pnode = dnode->tn_dir.tn_parent; + tmpfs_ref_node(pnode); error = vn_vget_ino_gen(dvp, tmpfs_vn_get_ino_alloc, - dnode->tn_dir.tn_parent, cnp->cn_lkflags, vpp); + pnode, cnp->cn_lkflags, vpp); + tmpfs_free_node(tm, pnode); if (error != 0) goto out; } else if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') { From owner-svn-src-all@freebsd.org Thu Jan 19 19:25:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA00BCB889F; Thu, 19 Jan 2017 19:25:43 +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 7658D1244; Thu, 19 Jan 2017 19:25:43 +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 v0JJPg4q094610; Thu, 19 Jan 2017 19:25:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JJPgsQ094609; Thu, 19 Jan 2017 19:25:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191925.v0JJPgsQ094609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 19:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312429 - head/sys/fs/tmpfs 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, 19 Jan 2017 19:25:43 -0000 Author: kib Date: Thu Jan 19 19:25:42 2017 New Revision: 312429 URL: https://svnweb.freebsd.org/changeset/base/312429 Log: VNON nodes cannot exist. Tested by: pho (as part of larger patch) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/tmpfs/tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 19:15:21 2017 (r312428) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 19:25:42 2017 (r312429) @@ -332,11 +332,6 @@ tmpfs_free_node_locked(struct tmpfs_moun TMPFS_UNLOCK(tmp); switch (node->tn_type) { - case VNON: - /* Do not do anything. VNON is provided to let the - * allocation routine clean itself easily by avoiding - * duplicating code in it. */ - /* FALLTHROUGH */ case VBLK: /* FALLTHROUGH */ case VCHR: From owner-svn-src-all@freebsd.org Thu Jan 19 19:29:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F8B0CB8BD4; Thu, 19 Jan 2017 19:29:15 +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 DC36E1EF7; Thu, 19 Jan 2017 19:29:14 +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 v0JJTDj6096053; Thu, 19 Jan 2017 19:29:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JJTDt1096052; Thu, 19 Jan 2017 19:29:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191929.v0JJTDt1096052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 19:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312430 - head/sys/fs/tmpfs 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, 19 Jan 2017 19:29:15 -0000 Author: kib Date: Thu Jan 19 19:29:13 2017 New Revision: 312430 URL: https://svnweb.freebsd.org/changeset/base/312430 Log: Implement VOP_VPTOCNP() for tmpfs. For directories, node->tn_spec.tn_dir.tn_parent pointer to the parent is used. For non-directories, the implementation is naive, all directory nodes are scanned to find a dirent linking the specified node. This can be significantly improved by maintaining tn_parent for all nodes, later. Tested by: pho (as part of larger patch) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 19 19:25:42 2017 (r312429) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 19 19:29:13 2017 (r312430) @@ -1406,6 +1406,132 @@ tmpfs_whiteout(struct vop_whiteout_args } } +static int +tmpfs_vptocnp_dir(struct tmpfs_node *tn, struct tmpfs_node *tnp, + struct tmpfs_dirent **pde) +{ + struct tmpfs_dir_cursor dc; + struct tmpfs_dirent *de; + + for (de = tmpfs_dir_first(tnp, &dc); de != NULL; + de = tmpfs_dir_next(tnp, &dc)) { + if (de->td_node == tn) { + *pde = de; + return (0); + } + } + return (ENOENT); +} + +static int +tmpfs_vptocnp_fill(struct vnode *vp, struct tmpfs_node *tn, + struct tmpfs_node *tnp, char *buf, int *buflen, struct vnode **dvp) +{ + struct tmpfs_dirent *de; + int error, i; + + error = vn_vget_ino_gen(vp, tmpfs_vn_get_ino_alloc, tnp, LK_SHARED, + dvp); + if (error != 0) + return (error); + error = tmpfs_vptocnp_dir(tn, tnp, &de); + if (error == 0) { + i = *buflen; + i -= de->td_namelen; + if (i < 0) { + error = ENOMEM; + } else { + bcopy(de->ud.td_name, buf + i, de->td_namelen); + *buflen = i; + } + } + if (error == 0) { + if (vp != *dvp) + VOP_UNLOCK(*dvp, 0); + } else { + if (vp != *dvp) + vput(*dvp); + else + vrele(vp); + } + return (error); +} + +static int +tmpfs_vptocnp(struct vop_vptocnp_args *ap) +{ + struct vnode *vp, **dvp; + struct tmpfs_node *tn, *tnp, *tnp1; + struct tmpfs_dirent *de; + struct tmpfs_mount *tm; + char *buf; + int *buflen; + int error; + + vp = ap->a_vp; + dvp = ap->a_vpp; + buf = ap->a_buf; + buflen = ap->a_buflen; + + tm = VFS_TO_TMPFS(vp->v_mount); + tn = VP_TO_TMPFS_NODE(vp); + if (tn->tn_type == VDIR) { + tnp = tn->tn_dir.tn_parent; + if (tnp == NULL) + return (ENOENT); + tmpfs_ref_node(tnp); + error = tmpfs_vptocnp_fill(vp, tn, tn->tn_dir.tn_parent, buf, + buflen, dvp); + tmpfs_free_node(tm, tnp); + return (error); + } +restart: + TMPFS_LOCK(tm); + LIST_FOREACH_SAFE(tnp, &tm->tm_nodes_used, tn_entries, tnp1) { + if (tnp->tn_type != VDIR) + continue; + TMPFS_NODE_LOCK(tnp); + tmpfs_ref_node_locked(tnp); + + /* + * tn_vnode cannot be instantiated while we hold the + * node lock, so the directory cannot be changed while + * we iterate over it. Do this to avoid instantiating + * vnode for directories which cannot point to our + * node. + */ + error = tnp->tn_vnode == NULL ? tmpfs_vptocnp_dir(tn, tnp, + &de) : 0; + + if (error == 0) { + TMPFS_NODE_UNLOCK(tnp); + TMPFS_UNLOCK(tm); + error = tmpfs_vptocnp_fill(vp, tn, tnp, buf, buflen, + dvp); + if (error == 0) { + tmpfs_free_node(tm, tnp); + return (0); + } + if ((vp->v_iflag & VI_DOOMED) != 0) { + tmpfs_free_node(tm, tnp); + return (ENOENT); + } + TMPFS_LOCK(tm); + TMPFS_NODE_LOCK(tnp); + } + if (tmpfs_free_node_locked(tm, tnp, false)) { + goto restart; + } else { + KASSERT(tnp->tn_refcount > 0, + ("node %p refcount zero", tnp)); + tnp1 = LIST_NEXT(tnp, tn_entries); + TMPFS_NODE_UNLOCK(tnp); + } + } + TMPFS_UNLOCK(tm); + return (ENOENT); +} + /* * Vnode operations vector used for files stored in a tmpfs file system. */ @@ -1438,5 +1564,6 @@ struct vop_vector tmpfs_vnodeop_entries .vop_vptofh = tmpfs_vptofh, .vop_whiteout = tmpfs_whiteout, .vop_bmap = VOP_EOPNOTSUPP, + .vop_vptocnp = tmpfs_vptocnp, }; From owner-svn-src-all@freebsd.org Thu Jan 19 19:46:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BEA6CB8257; Thu, 19 Jan 2017 19:46:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 926B61C27; Thu, 19 Jan 2017 19:46:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JJkOGP005168; Thu, 19 Jan 2017 19:46:24 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JJkGIo005079; Thu, 19 Jan 2017 19:46:16 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201701191946.v0JJkGIo005079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 19 Jan 2017 19:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312431 - in vendor-sys/acpica/dist: . generate/unix source/common source/compiler source/components/debugger source/components/disassembler source/components/dispatcher source/componen... 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: Thu, 19 Jan 2017 19:46:26 -0000 Author: jkim Date: Thu Jan 19 19:46:15 2017 New Revision: 312431 URL: https://svnweb.freebsd.org/changeset/base/312431 Log: Import ACPICA 20170119. Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/Makefile.common vendor-sys/acpica/dist/source/common/acfileio.c vendor-sys/acpica/dist/source/common/acgetline.c vendor-sys/acpica/dist/source/common/adfile.c vendor-sys/acpica/dist/source/common/adisasm.c vendor-sys/acpica/dist/source/common/adwalk.c vendor-sys/acpica/dist/source/common/ahids.c vendor-sys/acpica/dist/source/common/ahpredef.c vendor-sys/acpica/dist/source/common/ahtable.c vendor-sys/acpica/dist/source/common/ahuuids.c vendor-sys/acpica/dist/source/common/cmfsize.c vendor-sys/acpica/dist/source/common/dmextern.c vendor-sys/acpica/dist/source/common/dmrestag.c vendor-sys/acpica/dist/source/common/dmtable.c vendor-sys/acpica/dist/source/common/dmtables.c vendor-sys/acpica/dist/source/common/dmtbdump.c vendor-sys/acpica/dist/source/common/dmtbinfo.c vendor-sys/acpica/dist/source/common/getopt.c vendor-sys/acpica/dist/source/compiler/aslanalyze.c vendor-sys/acpica/dist/source/compiler/aslascii.c vendor-sys/acpica/dist/source/compiler/aslbtypes.c vendor-sys/acpica/dist/source/compiler/aslcodegen.c vendor-sys/acpica/dist/source/compiler/aslcompile.c vendor-sys/acpica/dist/source/compiler/aslcompiler.h vendor-sys/acpica/dist/source/compiler/aslcompiler.l vendor-sys/acpica/dist/source/compiler/aslcstyle.y vendor-sys/acpica/dist/source/compiler/asldebug.c vendor-sys/acpica/dist/source/compiler/asldefine.h vendor-sys/acpica/dist/source/compiler/aslerror.c vendor-sys/acpica/dist/source/compiler/aslexternal.c vendor-sys/acpica/dist/source/compiler/aslfileio.c vendor-sys/acpica/dist/source/compiler/aslfiles.c vendor-sys/acpica/dist/source/compiler/aslfold.c vendor-sys/acpica/dist/source/compiler/aslglobal.h vendor-sys/acpica/dist/source/compiler/aslhelp.c vendor-sys/acpica/dist/source/compiler/aslhelpers.y vendor-sys/acpica/dist/source/compiler/aslhex.c vendor-sys/acpica/dist/source/compiler/aslkeywords.y vendor-sys/acpica/dist/source/compiler/asllength.c vendor-sys/acpica/dist/source/compiler/asllisting.c vendor-sys/acpica/dist/source/compiler/asllistsup.c vendor-sys/acpica/dist/source/compiler/aslload.c vendor-sys/acpica/dist/source/compiler/asllookup.c vendor-sys/acpica/dist/source/compiler/aslmain.c vendor-sys/acpica/dist/source/compiler/aslmap.c vendor-sys/acpica/dist/source/compiler/aslmapenter.c vendor-sys/acpica/dist/source/compiler/aslmapoutput.c vendor-sys/acpica/dist/source/compiler/aslmaputils.c vendor-sys/acpica/dist/source/compiler/aslmessages.c vendor-sys/acpica/dist/source/compiler/aslmessages.h vendor-sys/acpica/dist/source/compiler/aslmethod.c vendor-sys/acpica/dist/source/compiler/aslnamesp.c vendor-sys/acpica/dist/source/compiler/asloffset.c vendor-sys/acpica/dist/source/compiler/aslopcodes.c vendor-sys/acpica/dist/source/compiler/asloperands.c vendor-sys/acpica/dist/source/compiler/aslopt.c vendor-sys/acpica/dist/source/compiler/asloptions.c vendor-sys/acpica/dist/source/compiler/aslparser.y vendor-sys/acpica/dist/source/compiler/aslpld.c vendor-sys/acpica/dist/source/compiler/aslpredef.c vendor-sys/acpica/dist/source/compiler/aslprepkg.c vendor-sys/acpica/dist/source/compiler/aslprimaries.y vendor-sys/acpica/dist/source/compiler/aslprintf.c vendor-sys/acpica/dist/source/compiler/aslprune.c vendor-sys/acpica/dist/source/compiler/aslresource.c vendor-sys/acpica/dist/source/compiler/aslresources.y vendor-sys/acpica/dist/source/compiler/aslrestype1.c vendor-sys/acpica/dist/source/compiler/aslrestype1i.c vendor-sys/acpica/dist/source/compiler/aslrestype2.c vendor-sys/acpica/dist/source/compiler/aslrestype2d.c vendor-sys/acpica/dist/source/compiler/aslrestype2e.c vendor-sys/acpica/dist/source/compiler/aslrestype2q.c vendor-sys/acpica/dist/source/compiler/aslrestype2s.c vendor-sys/acpica/dist/source/compiler/aslrestype2w.c vendor-sys/acpica/dist/source/compiler/aslrules.y vendor-sys/acpica/dist/source/compiler/aslstartup.c vendor-sys/acpica/dist/source/compiler/aslstubs.c vendor-sys/acpica/dist/source/compiler/aslsupport.l vendor-sys/acpica/dist/source/compiler/aslsupport.y vendor-sys/acpica/dist/source/compiler/asltokens.y vendor-sys/acpica/dist/source/compiler/asltransform.c vendor-sys/acpica/dist/source/compiler/asltree.c vendor-sys/acpica/dist/source/compiler/asltypes.h vendor-sys/acpica/dist/source/compiler/asltypes.y vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/compiler/asluuid.c vendor-sys/acpica/dist/source/compiler/aslwalks.c vendor-sys/acpica/dist/source/compiler/aslxref.c vendor-sys/acpica/dist/source/compiler/aslxrefout.c vendor-sys/acpica/dist/source/compiler/dtcompile.c vendor-sys/acpica/dist/source/compiler/dtcompiler.h vendor-sys/acpica/dist/source/compiler/dtexpress.c vendor-sys/acpica/dist/source/compiler/dtfield.c vendor-sys/acpica/dist/source/compiler/dtio.c vendor-sys/acpica/dist/source/compiler/dtparser.l vendor-sys/acpica/dist/source/compiler/dtparser.y vendor-sys/acpica/dist/source/compiler/dtsubtable.c vendor-sys/acpica/dist/source/compiler/dttable.c vendor-sys/acpica/dist/source/compiler/dttable1.c vendor-sys/acpica/dist/source/compiler/dttable2.c vendor-sys/acpica/dist/source/compiler/dttemplate.c vendor-sys/acpica/dist/source/compiler/dttemplate.h vendor-sys/acpica/dist/source/compiler/dtutils.c vendor-sys/acpica/dist/source/compiler/preprocess.h vendor-sys/acpica/dist/source/compiler/prexpress.c vendor-sys/acpica/dist/source/compiler/prmacros.c vendor-sys/acpica/dist/source/compiler/prparser.l vendor-sys/acpica/dist/source/compiler/prparser.y vendor-sys/acpica/dist/source/compiler/prscan.c vendor-sys/acpica/dist/source/compiler/prutils.c vendor-sys/acpica/dist/source/components/debugger/dbcmds.c vendor-sys/acpica/dist/source/components/debugger/dbconvert.c vendor-sys/acpica/dist/source/components/debugger/dbdisply.c vendor-sys/acpica/dist/source/components/debugger/dbexec.c vendor-sys/acpica/dist/source/components/debugger/dbfileio.c vendor-sys/acpica/dist/source/components/debugger/dbhistry.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/debugger/dbmethod.c vendor-sys/acpica/dist/source/components/debugger/dbnames.c vendor-sys/acpica/dist/source/components/debugger/dbobject.c vendor-sys/acpica/dist/source/components/debugger/dbstats.c vendor-sys/acpica/dist/source/components/debugger/dbtest.c vendor-sys/acpica/dist/source/components/debugger/dbutils.c vendor-sys/acpica/dist/source/components/debugger/dbxface.c vendor-sys/acpica/dist/source/components/disassembler/dmbuffer.c vendor-sys/acpica/dist/source/components/disassembler/dmcstyle.c vendor-sys/acpica/dist/source/components/disassembler/dmdeferred.c vendor-sys/acpica/dist/source/components/disassembler/dmnames.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/disassembler/dmresrc.c vendor-sys/acpica/dist/source/components/disassembler/dmresrcl.c vendor-sys/acpica/dist/source/components/disassembler/dmresrcl2.c vendor-sys/acpica/dist/source/components/disassembler/dmresrcs.c vendor-sys/acpica/dist/source/components/disassembler/dmutils.c vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c vendor-sys/acpica/dist/source/components/dispatcher/dsargs.c vendor-sys/acpica/dist/source/components/dispatcher/dscontrol.c vendor-sys/acpica/dist/source/components/dispatcher/dsdebug.c vendor-sys/acpica/dist/source/components/dispatcher/dsfield.c vendor-sys/acpica/dist/source/components/dispatcher/dsinit.c vendor-sys/acpica/dist/source/components/dispatcher/dsmethod.c vendor-sys/acpica/dist/source/components/dispatcher/dsmthdat.c vendor-sys/acpica/dist/source/components/dispatcher/dsobject.c vendor-sys/acpica/dist/source/components/dispatcher/dsopcode.c vendor-sys/acpica/dist/source/components/dispatcher/dsutils.c vendor-sys/acpica/dist/source/components/dispatcher/dswexec.c vendor-sys/acpica/dist/source/components/dispatcher/dswload.c vendor-sys/acpica/dist/source/components/dispatcher/dswload2.c vendor-sys/acpica/dist/source/components/dispatcher/dswscope.c vendor-sys/acpica/dist/source/components/dispatcher/dswstate.c vendor-sys/acpica/dist/source/components/events/evevent.c vendor-sys/acpica/dist/source/components/events/evglock.c vendor-sys/acpica/dist/source/components/events/evgpe.c vendor-sys/acpica/dist/source/components/events/evgpeblk.c vendor-sys/acpica/dist/source/components/events/evgpeinit.c vendor-sys/acpica/dist/source/components/events/evgpeutil.c vendor-sys/acpica/dist/source/components/events/evhandler.c vendor-sys/acpica/dist/source/components/events/evmisc.c vendor-sys/acpica/dist/source/components/events/evregion.c vendor-sys/acpica/dist/source/components/events/evrgnini.c vendor-sys/acpica/dist/source/components/events/evsci.c vendor-sys/acpica/dist/source/components/events/evxface.c vendor-sys/acpica/dist/source/components/events/evxfevnt.c vendor-sys/acpica/dist/source/components/events/evxfgpe.c vendor-sys/acpica/dist/source/components/events/evxfregn.c vendor-sys/acpica/dist/source/components/executer/exconcat.c vendor-sys/acpica/dist/source/components/executer/exconfig.c vendor-sys/acpica/dist/source/components/executer/exconvrt.c vendor-sys/acpica/dist/source/components/executer/excreate.c vendor-sys/acpica/dist/source/components/executer/exdebug.c vendor-sys/acpica/dist/source/components/executer/exdump.c vendor-sys/acpica/dist/source/components/executer/exfield.c vendor-sys/acpica/dist/source/components/executer/exfldio.c vendor-sys/acpica/dist/source/components/executer/exmisc.c vendor-sys/acpica/dist/source/components/executer/exmutex.c vendor-sys/acpica/dist/source/components/executer/exnames.c vendor-sys/acpica/dist/source/components/executer/exoparg1.c vendor-sys/acpica/dist/source/components/executer/exoparg2.c vendor-sys/acpica/dist/source/components/executer/exoparg3.c vendor-sys/acpica/dist/source/components/executer/exoparg6.c vendor-sys/acpica/dist/source/components/executer/exprep.c vendor-sys/acpica/dist/source/components/executer/exregion.c vendor-sys/acpica/dist/source/components/executer/exresnte.c vendor-sys/acpica/dist/source/components/executer/exresolv.c vendor-sys/acpica/dist/source/components/executer/exresop.c vendor-sys/acpica/dist/source/components/executer/exstore.c vendor-sys/acpica/dist/source/components/executer/exstoren.c vendor-sys/acpica/dist/source/components/executer/exstorob.c vendor-sys/acpica/dist/source/components/executer/exsystem.c vendor-sys/acpica/dist/source/components/executer/extrace.c vendor-sys/acpica/dist/source/components/executer/exutils.c vendor-sys/acpica/dist/source/components/hardware/hwacpi.c vendor-sys/acpica/dist/source/components/hardware/hwesleep.c vendor-sys/acpica/dist/source/components/hardware/hwgpe.c vendor-sys/acpica/dist/source/components/hardware/hwpci.c vendor-sys/acpica/dist/source/components/hardware/hwregs.c vendor-sys/acpica/dist/source/components/hardware/hwsleep.c vendor-sys/acpica/dist/source/components/hardware/hwtimer.c vendor-sys/acpica/dist/source/components/hardware/hwvalid.c vendor-sys/acpica/dist/source/components/hardware/hwxface.c vendor-sys/acpica/dist/source/components/hardware/hwxfsleep.c vendor-sys/acpica/dist/source/components/namespace/nsaccess.c vendor-sys/acpica/dist/source/components/namespace/nsalloc.c vendor-sys/acpica/dist/source/components/namespace/nsarguments.c vendor-sys/acpica/dist/source/components/namespace/nsconvert.c vendor-sys/acpica/dist/source/components/namespace/nsdump.c vendor-sys/acpica/dist/source/components/namespace/nsdumpdv.c vendor-sys/acpica/dist/source/components/namespace/nseval.c vendor-sys/acpica/dist/source/components/namespace/nsinit.c vendor-sys/acpica/dist/source/components/namespace/nsload.c vendor-sys/acpica/dist/source/components/namespace/nsnames.c vendor-sys/acpica/dist/source/components/namespace/nsobject.c vendor-sys/acpica/dist/source/components/namespace/nsparse.c vendor-sys/acpica/dist/source/components/namespace/nspredef.c vendor-sys/acpica/dist/source/components/namespace/nsprepkg.c vendor-sys/acpica/dist/source/components/namespace/nsrepair.c vendor-sys/acpica/dist/source/components/namespace/nsrepair2.c vendor-sys/acpica/dist/source/components/namespace/nssearch.c vendor-sys/acpica/dist/source/components/namespace/nsutils.c vendor-sys/acpica/dist/source/components/namespace/nswalk.c vendor-sys/acpica/dist/source/components/namespace/nsxfeval.c vendor-sys/acpica/dist/source/components/namespace/nsxfname.c vendor-sys/acpica/dist/source/components/namespace/nsxfobj.c vendor-sys/acpica/dist/source/components/parser/psargs.c vendor-sys/acpica/dist/source/components/parser/psloop.c vendor-sys/acpica/dist/source/components/parser/psobject.c vendor-sys/acpica/dist/source/components/parser/psopcode.c vendor-sys/acpica/dist/source/components/parser/psopinfo.c vendor-sys/acpica/dist/source/components/parser/psparse.c vendor-sys/acpica/dist/source/components/parser/psscope.c vendor-sys/acpica/dist/source/components/parser/pstree.c vendor-sys/acpica/dist/source/components/parser/psutils.c vendor-sys/acpica/dist/source/components/parser/pswalk.c vendor-sys/acpica/dist/source/components/parser/psxface.c vendor-sys/acpica/dist/source/components/resources/rsaddr.c vendor-sys/acpica/dist/source/components/resources/rscalc.c vendor-sys/acpica/dist/source/components/resources/rscreate.c vendor-sys/acpica/dist/source/components/resources/rsdump.c vendor-sys/acpica/dist/source/components/resources/rsdumpinfo.c vendor-sys/acpica/dist/source/components/resources/rsinfo.c vendor-sys/acpica/dist/source/components/resources/rsio.c vendor-sys/acpica/dist/source/components/resources/rsirq.c vendor-sys/acpica/dist/source/components/resources/rslist.c vendor-sys/acpica/dist/source/components/resources/rsmemory.c vendor-sys/acpica/dist/source/components/resources/rsmisc.c vendor-sys/acpica/dist/source/components/resources/rsserial.c vendor-sys/acpica/dist/source/components/resources/rsutils.c vendor-sys/acpica/dist/source/components/resources/rsxface.c vendor-sys/acpica/dist/source/components/tables/tbdata.c vendor-sys/acpica/dist/source/components/tables/tbfadt.c vendor-sys/acpica/dist/source/components/tables/tbfind.c vendor-sys/acpica/dist/source/components/tables/tbinstal.c vendor-sys/acpica/dist/source/components/tables/tbprint.c vendor-sys/acpica/dist/source/components/tables/tbutils.c vendor-sys/acpica/dist/source/components/tables/tbxface.c vendor-sys/acpica/dist/source/components/tables/tbxfload.c vendor-sys/acpica/dist/source/components/tables/tbxfroot.c vendor-sys/acpica/dist/source/components/utilities/utaddress.c vendor-sys/acpica/dist/source/components/utilities/utalloc.c vendor-sys/acpica/dist/source/components/utilities/utascii.c vendor-sys/acpica/dist/source/components/utilities/utbuffer.c vendor-sys/acpica/dist/source/components/utilities/utcache.c vendor-sys/acpica/dist/source/components/utilities/utclib.c vendor-sys/acpica/dist/source/components/utilities/utcopy.c vendor-sys/acpica/dist/source/components/utilities/utdebug.c vendor-sys/acpica/dist/source/components/utilities/utdecode.c vendor-sys/acpica/dist/source/components/utilities/utdelete.c vendor-sys/acpica/dist/source/components/utilities/uterror.c vendor-sys/acpica/dist/source/components/utilities/uteval.c vendor-sys/acpica/dist/source/components/utilities/utexcep.c vendor-sys/acpica/dist/source/components/utilities/utglobal.c vendor-sys/acpica/dist/source/components/utilities/uthex.c vendor-sys/acpica/dist/source/components/utilities/utids.c vendor-sys/acpica/dist/source/components/utilities/utinit.c vendor-sys/acpica/dist/source/components/utilities/utlock.c vendor-sys/acpica/dist/source/components/utilities/utmath.c vendor-sys/acpica/dist/source/components/utilities/utmisc.c vendor-sys/acpica/dist/source/components/utilities/utmutex.c vendor-sys/acpica/dist/source/components/utilities/utnonansi.c vendor-sys/acpica/dist/source/components/utilities/utobject.c vendor-sys/acpica/dist/source/components/utilities/utosi.c vendor-sys/acpica/dist/source/components/utilities/utownerid.c vendor-sys/acpica/dist/source/components/utilities/utpredef.c vendor-sys/acpica/dist/source/components/utilities/utprint.c vendor-sys/acpica/dist/source/components/utilities/utresrc.c vendor-sys/acpica/dist/source/components/utilities/utstate.c vendor-sys/acpica/dist/source/components/utilities/utstring.c vendor-sys/acpica/dist/source/components/utilities/utstrtoul64.c vendor-sys/acpica/dist/source/components/utilities/uttrack.c vendor-sys/acpica/dist/source/components/utilities/utuuid.c vendor-sys/acpica/dist/source/components/utilities/utxface.c vendor-sys/acpica/dist/source/components/utilities/utxferror.c vendor-sys/acpica/dist/source/components/utilities/utxfinit.c vendor-sys/acpica/dist/source/components/utilities/utxfmutex.c vendor-sys/acpica/dist/source/include/acapps.h vendor-sys/acpica/dist/source/include/acbuffer.h vendor-sys/acpica/dist/source/include/acclib.h vendor-sys/acpica/dist/source/include/accommon.h vendor-sys/acpica/dist/source/include/acconfig.h vendor-sys/acpica/dist/source/include/acdebug.h vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acdispat.h vendor-sys/acpica/dist/source/include/acevents.h vendor-sys/acpica/dist/source/include/acexcep.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/achware.h vendor-sys/acpica/dist/source/include/acinterp.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acmacros.h vendor-sys/acpica/dist/source/include/acnames.h vendor-sys/acpica/dist/source/include/acnamesp.h vendor-sys/acpica/dist/source/include/acobject.h vendor-sys/acpica/dist/source/include/acopcode.h vendor-sys/acpica/dist/source/include/acoutput.h vendor-sys/acpica/dist/source/include/acparser.h vendor-sys/acpica/dist/source/include/acpi.h vendor-sys/acpica/dist/source/include/acpiosxf.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/acpredef.h vendor-sys/acpica/dist/source/include/acresrc.h vendor-sys/acpica/dist/source/include/acrestyp.h vendor-sys/acpica/dist/source/include/acstruct.h vendor-sys/acpica/dist/source/include/actables.h vendor-sys/acpica/dist/source/include/actbl.h vendor-sys/acpica/dist/source/include/actbl1.h vendor-sys/acpica/dist/source/include/actbl2.h vendor-sys/acpica/dist/source/include/actbl3.h vendor-sys/acpica/dist/source/include/actypes.h vendor-sys/acpica/dist/source/include/acutils.h vendor-sys/acpica/dist/source/include/acuuid.h vendor-sys/acpica/dist/source/include/amlcode.h vendor-sys/acpica/dist/source/include/amlresrc.h vendor-sys/acpica/dist/source/include/platform/accygwin.h vendor-sys/acpica/dist/source/include/platform/acdragonfly.h vendor-sys/acpica/dist/source/include/platform/acdragonflyex.h vendor-sys/acpica/dist/source/include/platform/acefi.h vendor-sys/acpica/dist/source/include/platform/acefiex.h vendor-sys/acpica/dist/source/include/platform/acenv.h vendor-sys/acpica/dist/source/include/platform/acenvex.h vendor-sys/acpica/dist/source/include/platform/acfreebsd.h vendor-sys/acpica/dist/source/include/platform/acgcc.h vendor-sys/acpica/dist/source/include/platform/acgccex.h vendor-sys/acpica/dist/source/include/platform/achaiku.h vendor-sys/acpica/dist/source/include/platform/acintel.h vendor-sys/acpica/dist/source/include/platform/aclinux.h vendor-sys/acpica/dist/source/include/platform/aclinuxex.h vendor-sys/acpica/dist/source/include/platform/acmacosx.h vendor-sys/acpica/dist/source/include/platform/acmsvc.h vendor-sys/acpica/dist/source/include/platform/acmsvcex.h vendor-sys/acpica/dist/source/include/platform/acnetbsd.h vendor-sys/acpica/dist/source/include/platform/acos2.h vendor-sys/acpica/dist/source/include/platform/acqnx.h vendor-sys/acpica/dist/source/include/platform/acwin.h vendor-sys/acpica/dist/source/include/platform/acwin64.h vendor-sys/acpica/dist/source/os_specific/service_layers/osbsdtbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/osgendbg.c vendor-sys/acpica/dist/source/os_specific/service_layers/oslinuxtbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/osunixdir.c vendor-sys/acpica/dist/source/os_specific/service_layers/osunixmap.c vendor-sys/acpica/dist/source/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswindir.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswintbl.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/source/tools/acpibin/abcompare.c vendor-sys/acpica/dist/source/tools/acpibin/abmain.c vendor-sys/acpica/dist/source/tools/acpibin/acpibin.h vendor-sys/acpica/dist/source/tools/acpidump/acpidump.h vendor-sys/acpica/dist/source/tools/acpidump/apdump.c vendor-sys/acpica/dist/source/tools/acpidump/apfiles.c vendor-sys/acpica/dist/source/tools/acpidump/apmain.c vendor-sys/acpica/dist/source/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/source/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/source/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/source/tools/acpiexec/aeinitfile.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpiexec/aeregion.c vendor-sys/acpica/dist/source/tools/acpiexec/aetables.c vendor-sys/acpica/dist/source/tools/acpiexec/aetables.h vendor-sys/acpica/dist/source/tools/acpihelp/acpihelp.h vendor-sys/acpica/dist/source/tools/acpihelp/ahaml.c vendor-sys/acpica/dist/source/tools/acpihelp/ahamlops.c vendor-sys/acpica/dist/source/tools/acpihelp/ahasl.c vendor-sys/acpica/dist/source/tools/acpihelp/ahaslkey.c vendor-sys/acpica/dist/source/tools/acpihelp/ahaslops.c vendor-sys/acpica/dist/source/tools/acpihelp/ahdecode.c vendor-sys/acpica/dist/source/tools/acpihelp/ahgrammar.c vendor-sys/acpica/dist/source/tools/acpihelp/ahmain.c vendor-sys/acpica/dist/source/tools/acpinames/acpinames.h vendor-sys/acpica/dist/source/tools/acpinames/anmain.c vendor-sys/acpica/dist/source/tools/acpinames/anstubs.c vendor-sys/acpica/dist/source/tools/acpinames/antables.c vendor-sys/acpica/dist/source/tools/acpisrc/acpisrc.h vendor-sys/acpica/dist/source/tools/acpisrc/ascase.c vendor-sys/acpica/dist/source/tools/acpisrc/asconvrt.c vendor-sys/acpica/dist/source/tools/acpisrc/asfile.c vendor-sys/acpica/dist/source/tools/acpisrc/asmain.c vendor-sys/acpica/dist/source/tools/acpisrc/asremove.c vendor-sys/acpica/dist/source/tools/acpisrc/astable.c vendor-sys/acpica/dist/source/tools/acpisrc/asutils.c vendor-sys/acpica/dist/source/tools/acpixtract/acpixtract.c vendor-sys/acpica/dist/source/tools/acpixtract/acpixtract.h vendor-sys/acpica/dist/source/tools/acpixtract/axmain.c vendor-sys/acpica/dist/source/tools/acpixtract/axutils.c vendor-sys/acpica/dist/source/tools/efihello/efihello.c vendor-sys/acpica/dist/source/tools/examples/examples.c vendor-sys/acpica/dist/source/tools/examples/examples.h vendor-sys/acpica/dist/source/tools/examples/exstubs.c vendor-sys/acpica/dist/source/tools/examples/extables.c vendor-sys/acpica/dist/tests/misc/grammar.asl Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/changes.txt Thu Jan 19 19:46:15 2017 (r312431) @@ -1,4 +1,39 @@ ---------------------------------------- +19 January 2017. Summary of changes for version 20170119: + +This release is available at https://acpica.org/downloads + +1) General ACPICA software: + +Entire source code base: Added the 2017 copyright to all source code +legal/licensing module headers and utility/tool signons. This includes +the standard Linux dual-license header. This affects virtually every file +in the ACPICA core subsystem, iASL compiler, all ACPICA utilities, and +the ACPICA test suite. + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Removed/fixed an inadvertent remark when a method argument +containing a reference is used as a target operand within the method (and +never used as a simple argument), as in the example below. Jeffrey Hugo. + + dsdt.asl 1507: Store(0x1, Arg0) + Remark 2146 - ^ Method Argument is never used (Arg0) + +All tools: Removed the bit width of the compiler that generated the tool +from the common signon for all user space tools. This proved to be +confusing and unnecessary. This includes similar removal of HARDWARE_NAME +from the generic makefiles (Thomas Petazzoni). Example below. + + Old: + ASL+ Optimizing Compiler version 20170119-32 + ASL+ Optimizing Compiler version 20170119-64 + + New: + ASL+ Optimizing Compiler version 20170119 + +---------------------------------------- 22 December 2016. Summary of changes for version 20161222: Modified: vendor-sys/acpica/dist/generate/unix/Makefile.common ============================================================================== --- vendor-sys/acpica/dist/generate/unix/Makefile.common Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/generate/unix/Makefile.common Thu Jan 19 19:46:15 2017 (r312431) @@ -2,34 +2,11 @@ # Common make for acpica tools and utilities # -# -# Get the OS machine architecture. Anything with a "64" in the returned -# string will be treated as a 64-bit OS. Otherwise, the default is 32-bit. -# -ifeq ($(HOST), _FreeBSD) -HARDWARE_NAME := $(shell uname -p) -else -ifeq ($(HOST), _QNX) -HARDWARE_NAME := x86pc -else -HARDWARE_NAME := $(shell uname -m) -endif -endif - -# -# Main rule will only generate versions that are appropriate for the running -# OS, either 64-bit or 32-bit. -# all: $(PROGS) $(PROGS): FORCE @cd $(BUILD_DIRECTORY_PATH)/$@; \ mkdir -p obj; \ $(MAKE) || exit "$$?"; \ - if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \ - echo "64-bit version of $@:"; \ - else \ - echo "32-bit version of $@:"; \ - fi; \ ls -al ../bin/$@; \ echo ""; @@ -72,26 +49,15 @@ veryclean: FORCE rmdir bin; \ fi; -# -# Install all tools, either 32-bit or 64-bit as appropriate for the host OS -# install: FORCE @for toolname in $(PROGS); do \ (cd $(BUILD_DIRECTORY_PATH)/$$toolname; \ pwd; \ $(MAKE) PROG=$$toolname install; \ - if [ $(findstring 64,$(HARDWARE_NAME)) ]; then \ - echo "Installed 64-bit version of $$toolname"; \ - else \ - echo "Installed 32-bit version of $$toolname"; \ - fi; \ - echo ""; \ ); \ done; machine: FORCE - @echo "Machine architecture: $(HARDWARE_NAME), $(XBITS)"; - @echo "Findstring: $(findstring 64, $(HARDWARE_NAME))"; FORCE: Modified: vendor-sys/acpica/dist/source/common/acfileio.c ============================================================================== --- vendor-sys/acpica/dist/source/common/acfileio.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/acfileio.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/acgetline.c ============================================================================== --- vendor-sys/acpica/dist/source/common/acgetline.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/acgetline.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/adfile.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adfile.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/adfile.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adisasm.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/adisasm.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/adwalk.c ============================================================================== --- vendor-sys/acpica/dist/source/common/adwalk.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/adwalk.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/ahids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahids.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/ahids.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/ahpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahpredef.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/ahpredef.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/ahtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahtable.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/ahtable.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/ahuuids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahuuids.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/ahuuids.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/cmfsize.c ============================================================================== --- vendor-sys/acpica/dist/source/common/cmfsize.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/cmfsize.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmextern.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/dmextern.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/dmrestag.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmrestag.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/dmrestag.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtable.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/dmtable.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/dmtables.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtables.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/dmtables.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbdump.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/dmtbdump.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/source/common/dmtbinfo.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/dmtbinfo.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/common/getopt.c ============================================================================== --- vendor-sys/acpica/dist/source/common/getopt.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/common/getopt.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslanalyze.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslanalyze.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslanalyze.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslascii.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslascii.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslascii.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslbtypes.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslbtypes.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslbtypes.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslcodegen.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcodegen.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslcodegen.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompile.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslcompile.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.h Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.h Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslcompiler.l ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcompiler.l Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslcompiler.l Thu Jan 19 19:46:15 2017 (r312431) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslcstyle.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslcstyle.y Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslcstyle.y Thu Jan 19 19:46:15 2017 (r312431) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asldebug.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asldebug.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asldebug.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asldefine.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asldefine.h Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asldefine.h Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ /* * Compiler versions and names */ -#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler" +#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler/Disassembler" #define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler" #define ASL_INVOCATION_NAME "iasl" #define ASL_CREATOR_ID "INTL" Modified: vendor-sys/acpica/dist/source/compiler/aslerror.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslerror.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslerror.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslexternal.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslexternal.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslexternal.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslfileio.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfileio.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslfileio.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslfiles.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfiles.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslfiles.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslfold.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslfold.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslfold.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslglobal.h Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslglobal.h Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslhelp.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslhelp.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslhelp.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslhelpers.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslhelpers.y Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslhelpers.y Thu Jan 19 19:46:15 2017 (r312431) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslhex.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslhex.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslhex.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslkeywords.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslkeywords.y Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslkeywords.y Thu Jan 19 19:46:15 2017 (r312431) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asllength.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asllength.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asllength.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asllisting.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asllisting.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asllisting.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asllistsup.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asllistsup.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asllistsup.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslload.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslload.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslload.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asllookup.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asllookup.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asllookup.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmain.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslmain.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslmap.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmap.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslmap.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslmapenter.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmapenter.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslmapenter.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslmapoutput.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmapoutput.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslmapoutput.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslmaputils.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmaputils.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslmaputils.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslmessages.h ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmessages.h Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslmessages.h Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslmethod.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslmethod.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslmethod.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslnamesp.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslnamesp.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslnamesp.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asloffset.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloffset.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asloffset.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslopcodes.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslopcodes.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslopcodes.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asloperands.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloperands.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asloperands.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslopt.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslopt.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslopt.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asloptions.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asloptions.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asloptions.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslparser.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslparser.y Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslparser.y Thu Jan 19 19:46:15 2017 (r312431) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslpld.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslpld.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslpld.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslpredef.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslpredef.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslpredef.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslprepkg.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslprepkg.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslprepkg.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslprimaries.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslprimaries.y Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslprimaries.y Thu Jan 19 19:46:15 2017 (r312431) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslprintf.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslprintf.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslprintf.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslprune.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslprune.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslprune.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslresource.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslresource.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslresource.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslresources.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslresources.y Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslresources.y Thu Jan 19 19:46:15 2017 (r312431) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslrestype1.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslrestype1.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslrestype1.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslrestype1i.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslrestype1i.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslrestype1i.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslrestype2.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslrestype2.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslrestype2.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslrestype2d.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslrestype2d.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslrestype2d.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslrestype2e.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslrestype2e.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslrestype2e.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslrestype2q.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslrestype2q.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslrestype2q.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslrestype2s.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslrestype2s.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslrestype2s.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslrestype2w.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslrestype2w.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslrestype2w.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslrules.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslrules.y Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslrules.y Thu Jan 19 19:46:15 2017 (r312431) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslstartup.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslstartup.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslstartup.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslstubs.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslstubs.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslstubs.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslsupport.l ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslsupport.l Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslsupport.l Thu Jan 19 19:46:15 2017 (r312431) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/aslsupport.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslsupport.y Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/aslsupport.y Thu Jan 19 19:46:15 2017 (r312431) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asltokens.y ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asltokens.y Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asltokens.y Thu Jan 19 19:46:15 2017 (r312431) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asltransform.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asltransform.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asltransform.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/source/compiler/asltree.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/asltree.c Thu Jan 19 19:29:13 2017 (r312430) +++ vendor-sys/acpica/dist/source/compiler/asltree.c Thu Jan 19 19:46:15 2017 (r312431) @@ -5,7 +5,7 @@ *****************************************************************************/ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jan 19 19:46:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7982CB8290; Thu, 19 Jan 2017 19:46:50 +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 8F9601D5B; Thu, 19 Jan 2017 19:46:50 +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 v0JJknJW005233; Thu, 19 Jan 2017 19:46:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JJkn2Y005228; Thu, 19 Jan 2017 19:46:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191946.v0JJkn2Y005228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 19:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312432 - head/sys/fs/tmpfs 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, 19 Jan 2017 19:46:50 -0000 Author: kib Date: Thu Jan 19 19:46:49 2017 New Revision: 312432 URL: https://svnweb.freebsd.org/changeset/base/312432 Log: Add mount option for tmpfs(5) to not use namecache. The option "nonc" disables using of namecache for the created mount, by default namecache is used. The rationale for the option is that namecache duplicates the information which is already kept in memory by tmpfs. Since it believed that namecache scales better than tmpfs, or will scale better, do not enable the option by default. On the other hand, smaller machines may benefit from lesser namecache pressure. Discussed with: mjg Tested by: pho (as part of larger patch) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.h Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 19:46:15 2017 (r312431) +++ head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 19:46:49 2017 (r312432) @@ -385,7 +385,9 @@ struct tmpfs_mount { uma_zone_t tm_node_pool; /* Read-only status. */ - int tm_ronly; + bool tm_ronly; + /* Do not use namecache. */ + bool tm_nonc; }; #define TMPFS_LOCK(tm) mtx_lock(&(tm)->tm_allnode_lock) #define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->tm_allnode_lock) @@ -530,4 +532,11 @@ VP_TO_TMPFS_DIR(struct vnode *vp) return (node); } +static inline bool +tmpfs_use_nc(struct vnode *vp) +{ + + return (!(VFS_TO_TMPFS(vp->v_mount)->tm_nonc)); +} + #endif /* _FS_TMPFS_TMPFS_H_ */ Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 19:46:15 2017 (r312431) +++ head/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 19 19:46:49 2017 (r312432) @@ -591,7 +591,8 @@ loop: TMPFS_NODE_UNLOCK(node); /* Get a new vnode and associate it with our node. */ - error = getnewvnode("tmpfs", mp, &tmpfs_vnodeop_entries, &vp); + error = getnewvnode("tmpfs", mp, VFS_TO_TMPFS(mp)->tm_nonc ? + &tmpfs_vnodeop_nonc_entries : &tmpfs_vnodeop_entries, &vp); if (error != 0) goto unlock; MPASS(vp != NULL); Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Thu Jan 19 19:46:15 2017 (r312431) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Thu Jan 19 19:46:49 2017 (r312432) @@ -79,7 +79,7 @@ static void tmpfs_susp_clean(struct moun static const char *tmpfs_opts[] = { "from", "size", "maxfilesize", "inodes", "uid", "gid", "mode", "export", - "union", NULL + "union", "nonc", NULL }; static const char *tmpfs_updateopts[] = { @@ -138,6 +138,7 @@ tmpfs_mount(struct mount *mp) struct tmpfs_node *root; struct thread *td = curthread; int error; + bool nonc; /* Size counters. */ u_quad_t pages; off_t nodes_max, size_max, maxfilesize; @@ -186,6 +187,7 @@ tmpfs_mount(struct mount *mp) size_max = 0; if (vfs_getopt_size(mp->mnt_optnew, "maxfilesize", &maxfilesize) != 0) maxfilesize = 0; + nonc = vfs_getopt(mp->mnt_optnew, "nonc", NULL, NULL) == 0; /* Do not allow mounts if we do not have enough memory to preserve * the minimum reserved pages. */ @@ -236,6 +238,7 @@ tmpfs_mount(struct mount *mp) sizeof(struct tmpfs_node), tmpfs_node_ctor, tmpfs_node_dtor, tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0); tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; + tmp->tm_nonc = nonc; /* Allocate the root node. */ error = tmpfs_alloc_node(mp, tmp, VDIR, root_uid, root_gid, Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 19 19:46:15 2017 (r312431) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 19 19:46:49 2017 (r312432) @@ -76,11 +76,8 @@ tmpfs_vn_get_ino_alloc(struct mount *mp, } static int -tmpfs_lookup(struct vop_cachedlookup_args *v) +tmpfs_lookup1(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) { - struct vnode *dvp = v->a_dvp; - struct vnode **vpp = v->a_vpp; - struct componentname *cnp = v->a_cnp; struct tmpfs_dirent *de; struct tmpfs_node *dnode, *pnode; struct tmpfs_mount *tm; @@ -213,7 +210,7 @@ tmpfs_lookup(struct vop_cachedlookup_arg * request was for creation, as it does not improve timings on * emprical tests. */ - if ((cnp->cn_flags & MAKEENTRY) != 0) + if ((cnp->cn_flags & MAKEENTRY) != 0 && tmpfs_use_nc(dvp)) cache_enter(dvp, *vpp, cnp); out: @@ -227,6 +224,20 @@ out: } static int +tmpfs_cached_lookup(struct vop_cachedlookup_args *v) +{ + + return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp)); +} + +static int +tmpfs_lookup(struct vop_lookup_args *v) +{ + + return (tmpfs_lookup1(v->a_dvp, v->a_vpp, v->a_cnp)); +} + +static int tmpfs_create(struct vop_create_args *v) { struct vnode *dvp = v->a_dvp; @@ -238,7 +249,7 @@ tmpfs_create(struct vop_create_args *v) MPASS(vap->va_type == VREG || vap->va_type == VSOCK); error = tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL); - if (error == 0 && (cnp->cn_flags & MAKEENTRY) != 0) + if (error == 0 && (cnp->cn_flags & MAKEENTRY) != 0 && tmpfs_use_nc(dvp)) cache_enter(dvp, *vpp, cnp); return (error); } @@ -1013,10 +1024,12 @@ tmpfs_rename(struct vop_rename_args *v) tmpfs_dir_attach(tdvp, de); - cache_purge(fvp); - if (tvp != NULL) - cache_purge(tvp); - cache_purge_negative(tdvp); + if (tmpfs_use_nc(fvp)) { + cache_purge(fvp); + if (tvp != NULL) + cache_purge(tvp); + cache_purge_negative(tdvp); + } error = 0; @@ -1129,8 +1142,10 @@ tmpfs_rmdir(struct vop_rmdir_args *v) TMPFS_NODE_MODIFIED; TMPFS_NODE_UNLOCK(dnode); - cache_purge(dvp); - cache_purge(vp); + if (tmpfs_use_nc(dvp)) { + cache_purge(dvp); + cache_purge(vp); + } /* Free the directory entry we just deleted. Note that the node * referred by it will not be removed until the vnode is really @@ -1274,7 +1289,8 @@ tmpfs_reclaim(struct vop_reclaim_args *v else vnode_destroy_vobject(vp); vp->v_object = NULL; - cache_purge(vp); + if (tmpfs_use_nc(vp)) + cache_purge(vp); TMPFS_NODE_LOCK(node); tmpfs_free_vp(vp); @@ -1538,7 +1554,7 @@ restart: struct vop_vector tmpfs_vnodeop_entries = { .vop_default = &default_vnodeops, .vop_lookup = vfs_cache_lookup, - .vop_cachedlookup = tmpfs_lookup, + .vop_cachedlookup = tmpfs_cached_lookup, .vop_create = tmpfs_create, .vop_mknod = tmpfs_mknod, .vop_open = tmpfs_open, @@ -1567,3 +1583,10 @@ struct vop_vector tmpfs_vnodeop_entries .vop_vptocnp = tmpfs_vptocnp, }; +/* + * Same vector for mounts which do not use namecache. + */ +struct vop_vector tmpfs_vnodeop_nonc_entries = { + .vop_default = &tmpfs_vnodeop_entries, + .vop_lookup = tmpfs_lookup, +}; Modified: head/sys/fs/tmpfs/tmpfs_vnops.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.h Thu Jan 19 19:46:15 2017 (r312431) +++ head/sys/fs/tmpfs/tmpfs_vnops.h Thu Jan 19 19:46:49 2017 (r312432) @@ -44,6 +44,7 @@ */ extern struct vop_vector tmpfs_vnodeop_entries; +extern struct vop_vector tmpfs_vnodeop_nonc_entries; vop_access_t tmpfs_access; vop_getattr_t tmpfs_getattr; From owner-svn-src-all@freebsd.org Thu Jan 19 19:47:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21AAFCB830B; Thu, 19 Jan 2017 19:47:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBE581F3A; Thu, 19 Jan 2017 19:47:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JJlWd3005307; Thu, 19 Jan 2017 19:47:32 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JJlWdW005306; Thu, 19 Jan 2017 19:47:32 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201701191947.v0JJlWdW005306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 19 Jan 2017 19:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312433 - vendor-sys/acpica/20170119 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: Thu, 19 Jan 2017 19:47:34 -0000 Author: jkim Date: Thu Jan 19 19:47:32 2017 New Revision: 312433 URL: https://svnweb.freebsd.org/changeset/base/312433 Log: Tag ACPICA 20170119. Added: vendor-sys/acpica/20170119/ - copied from r312432, vendor-sys/acpica/dist/ From owner-svn-src-all@freebsd.org Thu Jan 19 19:58:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DDE8CB88C1; Thu, 19 Jan 2017 19:58:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13C11199B; Thu, 19 Jan 2017 19:58:10 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JJw9Do009582; Thu, 19 Jan 2017 19:58:09 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JJw98r009581; Thu, 19 Jan 2017 19:58:09 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201701191958.v0JJw98r009581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 19 Jan 2017 19:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312434 - 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, 19 Jan 2017 19:58:10 -0000 Author: sbruno Date: Thu Jan 19 19:58:08 2017 New Revision: 312434 URL: https://svnweb.freebsd.org/changeset/base/312434 Log: Adjust gtaskqueue startup again so that we catch the !SMP case and users that choose not to use EARLY_AP_STARTUP. There is still an initialization issue/panic with !SMP and !EARLY_AP_STARTUP that we have yet to resolve. Submitted by: bde Modified: head/sys/sys/gtaskqueue.h Modified: head/sys/sys/gtaskqueue.h ============================================================================== --- head/sys/sys/gtaskqueue.h Thu Jan 19 19:47:32 2017 (r312433) +++ head/sys/sys/gtaskqueue.h Thu Jan 19 19:58:08 2017 (r312434) @@ -81,7 +81,7 @@ int taskqgroup_adjust(struct taskqgroup extern struct taskqgroup *qgroup_##name -#ifdef EARLY_AP_STARTUP +#if (!defined(SMP) || defined(EARLY_AP_STARTUP)) #define TASKQGROUP_DEFINE(name, cnt, stride) \ \ struct taskqgroup *qgroup_##name; \ @@ -95,7 +95,7 @@ taskqgroup_define_##name(void *arg) \ SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \ taskqgroup_define_##name, NULL) -#else +#else /* SMP && !EARLY_AP_STARTUP */ #define TASKQGROUP_DEFINE(name, cnt, stride) \ \ struct taskqgroup *qgroup_##name; \ @@ -104,6 +104,15 @@ static void \ taskqgroup_define_##name(void *arg) \ { \ qgroup_##name = taskqgroup_create(#name); \ + /* Adjustment will be null unless smp_cpus == 1. */ \ + /* \ + * XXX this was intended to fix the smp_cpus == 1 case, but \ + * doesn't actually work for that. It gives thes same strange \ + * panic as adjustment at SI_SUB_INIT_IF:SI_ORDER_ANY for a \ + * device that works with a pure UP kernel. \ + */ \ + /* XXX this code is common now, so should not be ifdefed. */ \ + taskqgroup_adjust(qgroup_##name, (cnt), (stride)); \ } \ \ SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \ @@ -112,14 +121,18 @@ SYSINIT(taskqgroup_##name, SI_SUB_INIT_I static void \ taskqgroup_adjust_##name(void *arg) \ { \ + /* \ + * Adjustment when smp_cpus > 1 only works accidentally \ + * (when there is no device interrupt before adjustment). \ + */ \ taskqgroup_adjust(qgroup_##name, (cnt), (stride)); \ } \ \ -SYSINIT(taskqgroup_adj_##name, SI_SUB_INIT_IF, SI_ORDER_ANY, \ +SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY, \ taskqgroup_adjust_##name, NULL); \ - \ -struct __hack -#endif + +#endif /* !SMP || EARLY_AP_STARTUP */ + TASKQGROUP_DECLARE(net); #endif /* !_SYS_GTASKQUEUE_H_ */ From owner-svn-src-all@freebsd.org Thu Jan 19 20:03:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 639C3CB8C6E; Thu, 19 Jan 2017 20:03:27 +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 3362E111C; Thu, 19 Jan 2017 20:03:27 +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 v0JK3QPg013360; Thu, 19 Jan 2017 20:03:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JK3QhD013359; Thu, 19 Jan 2017 20:03:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701192003.v0JK3QhD013359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 20:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312435 - head/sys/fs/tmpfs 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, 19 Jan 2017 20:03:27 -0000 Author: kib Date: Thu Jan 19 20:03:26 2017 New Revision: 312435 URL: https://svnweb.freebsd.org/changeset/base/312435 Log: Remove mistakenly merged field. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/tmpfs/tmpfs.h Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 19:58:08 2017 (r312434) +++ head/sys/fs/tmpfs/tmpfs.h Thu Jan 19 20:03:26 2017 (r312435) @@ -347,8 +347,6 @@ struct tmpfs_mount { */ struct tmpfs_node * tm_root; - struct mount * tm_mnt; - /* * Maximum number of possible nodes for this file system; set * during mount time. We need a hard limit on the maximum number From owner-svn-src-all@freebsd.org Thu Jan 19 20:44:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 076B6CB8DE3; Thu, 19 Jan 2017 20:44:31 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9D1E1DB6; Thu, 19 Jan 2017 20:44:30 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JKiTqS030184; Thu, 19 Jan 2017 20:44:29 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JKiTBw030181; Thu, 19 Jan 2017 20:44:29 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201701192044.v0JKiTBw030181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 19 Jan 2017 20:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312436 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys 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: Thu, 19 Jan 2017 20:44:31 -0000 Author: jpaetzel Date: Thu Jan 19 20:44:29 2017 New Revision: 312436 URL: https://svnweb.freebsd.org/changeset/base/312436 Log: 6569 large file delete can starve out write ops illumos/illumos-gate@ff5177ee8bf9a355131ce2cc61ae2da6a5a6fdd6 https://github.com/illumos/illumos-gate/commit/ff5177ee8bf9a355131ce2cc61ae2da6a5a6fdd6 https://www.illumos.org/issues/6569 The core issue I've found is that there is no throttle for how many deletes get assigned to one TXG. As a results when deleting large files we end up filling consecutive TXGs with deletes/frees, then write throttling other (more important) ops. There is an easy test case for this problem. Try deleting several large files (at least 1/2 TB) while you do write ops on the same pool. What we've seen is performance of these write ops (let's call it sideload I/O) would drop to zero. More specifically the problem is that dmu_free_long_range_impl() can/will fill up all of the dirty data in the pool "instantly", before many of the sideload ops can get in. So sideload performance will be impacted until all the files are freed. The solution we have tested at Nexenta (with positive results) creates a relatively simple throttle for how many "free" ops we let into one TXG. However this solution exposes other problems that should also be addressed. If we are to slow down freeing of data that means one has to wait even longer (assuming vnode ref count of 1) to get shell back after an rm or for NFS thread to finish the free-ing op. To avoid this the proposed solution is to call zfs_inactive() async for "large" files. Async freeing then begs for the reclaimed space to be accounted for in the zpool's "freeing" prop. The other issue with having a longer delete is the inability to export/unmount for a longer period of time. The proposed solution is to interrupt freeing of blocks when a fs is unmounted. Author: Alek Pinchuk Reviewed by: Matt Ahrens Reviewed by: Sanjay Nadkarni Reviewed by: Pavel Zakharov Approved by: Dan McDonald Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Thu Jan 19 20:03:26 2017 (r312435) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Thu Jan 19 20:44:29 2017 (r312436) @@ -56,6 +56,14 @@ */ int zfs_nopwrite_enabled = 1; +/* + * Tunable to control percentage of dirtied blocks from frees in one TXG. + * After this threshold is crossed, additional dirty blocks from frees + * wait until the next TXG. + * A value of zero will disable this throttle. + */ +uint32_t zfs_per_txg_dirty_frees_percent = 30; + const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = { { DMU_BSWAP_UINT8, TRUE, "unallocated" }, { DMU_BSWAP_ZAP, TRUE, "object directory" }, @@ -717,15 +725,25 @@ dmu_free_long_range_impl(objset_t *os, d { uint64_t object_size = (dn->dn_maxblkid + 1) * dn->dn_datablksz; int err; + uint64_t dirty_frees_threshold; + dsl_pool_t *dp = dmu_objset_pool(os); if (offset >= object_size) return (0); + if (zfs_per_txg_dirty_frees_percent <= 100) + dirty_frees_threshold = + zfs_per_txg_dirty_frees_percent * zfs_dirty_data_max / 100; + else + dirty_frees_threshold = zfs_dirty_data_max / 4; + if (length == DMU_OBJECT_END || offset + length > object_size) length = object_size - offset; while (length != 0) { - uint64_t chunk_end, chunk_begin; + uint64_t chunk_end, chunk_begin, chunk_len; + uint64_t long_free_dirty_all_txgs = 0; + dmu_tx_t *tx; if (dmu_objset_zfs_unmounting(dn->dn_objset)) return (SET_ERROR(EINTR)); @@ -739,9 +757,28 @@ dmu_free_long_range_impl(objset_t *os, d ASSERT3U(chunk_begin, >=, offset); ASSERT3U(chunk_begin, <=, chunk_end); - dmu_tx_t *tx = dmu_tx_create(os); - dmu_tx_hold_free(tx, dn->dn_object, - chunk_begin, chunk_end - chunk_begin); + chunk_len = chunk_end - chunk_begin; + + mutex_enter(&dp->dp_lock); + for (int t = 0; t < TXG_SIZE; t++) { + long_free_dirty_all_txgs += + dp->dp_long_free_dirty_pertxg[t]; + } + mutex_exit(&dp->dp_lock); + + /* + * To avoid filling up a TXG with just frees wait for + * the next TXG to open before freeing more chunks if + * we have reached the threshold of frees + */ + if (dirty_frees_threshold != 0 && + long_free_dirty_all_txgs >= dirty_frees_threshold) { + txg_wait_open(dp, 0); + continue; + } + + tx = dmu_tx_create(os); + dmu_tx_hold_free(tx, dn->dn_object, chunk_begin, chunk_len); /* * Mark this transaction as typically resulting in a net @@ -753,10 +790,18 @@ dmu_free_long_range_impl(objset_t *os, d dmu_tx_abort(tx); return (err); } - dnode_free_range(dn, chunk_begin, chunk_end - chunk_begin, tx); + + mutex_enter(&dp->dp_lock); + dp->dp_long_free_dirty_pertxg[dmu_tx_get_txg(tx) & TXG_MASK] += + chunk_len; + mutex_exit(&dp->dp_lock); + DTRACE_PROBE3(free__long__range, + uint64_t, long_free_dirty_all_txgs, uint64_t, chunk_len, + uint64_t, dmu_tx_get_txg(tx)); + dnode_free_range(dn, chunk_begin, chunk_len, tx); dmu_tx_commit(tx); - length -= chunk_end - chunk_begin; + length -= chunk_len; } return (0); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Thu Jan 19 20:03:26 2017 (r312435) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Thu Jan 19 20:44:29 2017 (r312436) @@ -24,6 +24,7 @@ * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Nexenta Systems, Inc. All rights reserved. */ #include @@ -493,6 +494,16 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t dsl_pool_undirty_space(dp, dp->dp_dirty_pertxg[txg & TXG_MASK], txg); /* + * Update the long range free counter after + * we're done syncing user data + */ + mutex_enter(&dp->dp_lock); + ASSERT(spa_sync_pass(dp->dp_spa) == 1 || + dp->dp_long_free_dirty_pertxg[txg & TXG_MASK] == 0); + dp->dp_long_free_dirty_pertxg[txg & TXG_MASK] = 0; + mutex_exit(&dp->dp_lock); + + /* * After the data blocks have been written (ensured by the zio_wait() * above), update the user/group space accounting. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Thu Jan 19 20:03:26 2017 (r312435) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_pool.h Thu Jan 19 20:44:29 2017 (r312436) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2016 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SYS_DSL_POOL_H @@ -103,6 +104,7 @@ typedef struct dsl_pool { kcondvar_t dp_spaceavail_cv; uint64_t dp_dirty_pertxg[TXG_SIZE]; uint64_t dp_dirty_total; + uint64_t dp_long_free_dirty_pertxg[TXG_SIZE]; uint64_t dp_mos_used_delta; uint64_t dp_mos_compressed_delta; uint64_t dp_mos_uncompressed_delta; From owner-svn-src-all@freebsd.org Thu Jan 19 21:47:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23080CA6CEB; Thu, 19 Jan 2017 21:47:53 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3DB01E26; Thu, 19 Jan 2017 21:47:52 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JLlpjG054897; Thu, 19 Jan 2017 21:47:51 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JLlpp3054889; Thu, 19 Jan 2017 21:47:51 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201701192147.v0JLlpp3054889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Thu, 19 Jan 2017 21:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312437 - in head/sys/dev: mpr mps 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, 19 Jan 2017 21:47:53 -0000 Author: scottl Date: Thu Jan 19 21:47:50 2017 New Revision: 312437 URL: https://svnweb.freebsd.org/changeset/base/312437 Log: Rework the debug print API. Event printing no longer gets special handling. All of the printing from the tables file now has wrappers so that the handling is cleaner and it's possible to print something out (say, during development) without having to fight the global debug flags. This re-org will also make it easier to have the tables be compiled out at build time if desired. Other than fixing some minor bugs, there are no user-visible changes from this change Sponsored by: Netflix, Inc. Differential Revision: D9238 Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_table.c head/sys/dev/mpr/mpr_table.h head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_table.c head/sys/dev/mps/mps_table.h head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Thu Jan 19 20:44:29 2017 (r312436) +++ head/sys/dev/mpr/mpr_sas.c Thu Jan 19 21:47:50 2017 (r312437) @@ -349,7 +349,7 @@ mprsas_log_command(struct mpr_command *c sbuf_printf(&sb, "SMID %u ", cm->cm_desc.Default.SMID); sbuf_vprintf(&sb, fmt, ap); sbuf_finish(&sb); - mpr_dprint_field(cm->cm_sc, level, "%s", sbuf_data(&sb)); + mpr_print_field(cm->cm_sc, "%s", sbuf_data(&sb)); va_end(ap); } Modified: head/sys/dev/mpr/mpr_table.c ============================================================================== --- head/sys/dev/mpr/mpr_table.c Thu Jan 19 20:44:29 2017 (r312436) +++ head/sys/dev/mpr/mpr_table.c Thu Jan 19 21:47:50 2017 (r312437) @@ -197,27 +197,26 @@ mpr_describe_devinfo(uint32_t devinfo, c } void -mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts) +_mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts) { - MPR_PRINTFIELD_START(sc, "IOCFacts"); MPR_PRINTFIELD(sc, facts, MsgVersion, 0x%x); MPR_PRINTFIELD(sc, facts, HeaderVersion, 0x%x); MPR_PRINTFIELD(sc, facts, IOCNumber, %d); MPR_PRINTFIELD(sc, facts, IOCExceptions, 0x%x); MPR_PRINTFIELD(sc, facts, MaxChainDepth, %d); - mpr_dprint_field(sc, MPR_XINFO, "WhoInit: %s\n", + mpr_print_field(sc, "WhoInit: %s\n", mpr_describe_table(mpr_whoinit_names, facts->WhoInit)); MPR_PRINTFIELD(sc, facts, NumberOfPorts, %d); MPR_PRINTFIELD(sc, facts, MaxMSIxVectors, %d); MPR_PRINTFIELD(sc, facts, RequestCredit, %d); MPR_PRINTFIELD(sc, facts, ProductID, 0x%x); - mpr_dprint_field(sc, MPR_XINFO, "IOCCapabilities: %b\n", + mpr_print_field(sc, "IOCCapabilities: %b\n", facts->IOCCapabilities, "\20" "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf" "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR" "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc"); - mpr_dprint_field(sc, MPR_XINFO, "FWVersion= %d-%d-%d-%d\n", + mpr_print_field(sc, "FWVersion= %d-%d-%d-%d\n", facts->FWVersion.Struct.Major, facts->FWVersion.Struct.Minor, facts->FWVersion.Struct.Unit, @@ -227,7 +226,7 @@ mpr_print_iocfacts(struct mpr_softc *sc, MPR_PRINTFIELD(sc, facts, MaxTargets, %d); MPR_PRINTFIELD(sc, facts, MaxSasExpanders, %d); MPR_PRINTFIELD(sc, facts, MaxEnclosures, %d); - mpr_dprint_field(sc, MPR_XINFO, "ProtocolFlags: %b\n", + mpr_print_field(sc, "ProtocolFlags: %b\n", facts->ProtocolFlags, "\20" "\1ScsiTarg" "\2ScsiInit"); MPR_PRINTFIELD(sc, facts, HighPriorityCredit, %d); MPR_PRINTFIELD(sc, facts, MaxReplyDescriptorPostQueueDepth, %d); @@ -238,7 +237,7 @@ mpr_print_iocfacts(struct mpr_softc *sc, } void -mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts) +_mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts) { MPR_PRINTFIELD_START(sc, "PortFacts"); @@ -248,24 +247,24 @@ mpr_print_portfacts(struct mpr_softc *sc } void -mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +_mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) { - MPR_EVENTFIELD_START(sc, "EventReply"); - MPR_EVENTFIELD(sc, event, EventDataLength, %d); - MPR_EVENTFIELD(sc, event, AckRequired, %d); - mpr_dprint_field(sc, MPR_EVENT, "Event: %s (0x%x)\n", + MPR_PRINTFIELD_START(sc, "EventReply"); + MPR_PRINTFIELD(sc, event, EventDataLength, %d); + MPR_PRINTFIELD(sc, event, AckRequired, %d); + mpr_print_field(sc, "Event: %s (0x%x)\n", mpr_describe_table(mpr_event_names, event->Event), event->Event); - MPR_EVENTFIELD(sc, event, EventContext, 0x%x); + MPR_PRINTFIELD(sc, event, EventContext, 0x%x); } void -mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) +_mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) { MPR_PRINTFIELD_START(sc, "SAS Device Page 0"); MPR_PRINTFIELD(sc, buf, Slot, %d); MPR_PRINTFIELD(sc, buf, EnclosureHandle, 0x%x); - mpr_dprint_field(sc, MPR_XINFO, "SASAddress: 0x%jx\n", + mpr_print_field(sc, "SASAddress: 0x%jx\n", mpr_to_u64(&buf->SASAddress)); MPR_PRINTFIELD(sc, buf, ParentDevHandle, 0x%x); MPR_PRINTFIELD(sc, buf, PhyNum, %d); @@ -273,7 +272,7 @@ mpr_print_sasdev0(struct mpr_softc *sc, MPR_PRINTFIELD(sc, buf, DevHandle, 0x%x); MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, 0x%x); MPR_PRINTFIELD(sc, buf, ZoneGroup, %d); - mpr_dprint_field(sc, MPR_XINFO, "DeviceInfo: %b,%s\n", buf->DeviceInfo, + mpr_print_field(sc, "DeviceInfo: %b,%s\n", buf->DeviceInfo, "\20" "\4SataHost" "\5SmpInit" "\6StpInit" "\7SspInit" "\10SataDev" "\11SmpTarg" "\12StpTarg" "\13SspTarg" "\14Direct" "\15LsiDev" "\16AtapiDev" "\17SepDev", @@ -281,7 +280,7 @@ mpr_print_sasdev0(struct mpr_softc *sc, MPR_PRINTFIELD(sc, buf, Flags, 0x%x); MPR_PRINTFIELD(sc, buf, PhysicalPort, %d); MPR_PRINTFIELD(sc, buf, MaxPortConnections, %d); - mpr_dprint_field(sc, MPR_XINFO, "DeviceName: 0x%jx\n", + mpr_print_field(sc, "DeviceName: 0x%jx\n", mpr_to_u64(&buf->DeviceName)); MPR_PRINTFIELD(sc, buf, PortGroups, %d); MPR_PRINTFIELD(sc, buf, DmaGroup, %d); @@ -289,10 +288,10 @@ mpr_print_sasdev0(struct mpr_softc *sc, } void -mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +_mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) { - mpr_print_event(sc, event); + _mpr_print_event(sc, event); switch(event->Event) { case MPI2_EVENT_SAS_DISCOVERY: @@ -300,12 +299,12 @@ mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_DATA_SAS_DISCOVERY *data; data = (MPI2_EVENT_DATA_SAS_DISCOVERY *)&event->EventData; - mpr_dprint_field(sc, MPR_EVENT, "Flags: %b\n", data->Flags, + mpr_print_field(sc, "Flags: %b\n", data->Flags, "\20" "\1InProgress" "\2DeviceChange"); - mpr_dprint_field(sc, MPR_EVENT, "ReasonCode: %s\n", + mpr_print_field(sc, "ReasonCode: %s\n", mpr_describe_table(mpr_sasdisc_reason, data->ReasonCode)); - MPR_EVENTFIELD(sc, data, PhysicalPort, %d); - mpr_dprint_field(sc, MPR_EVENT, "DiscoveryStatus: %b\n", + MPR_PRINTFIELD(sc, data, PhysicalPort, %d); + mpr_print_field(sc, "DiscoveryStatus: %b\n", data->DiscoveryStatus, "\20" "\1Loop" "\2UnaddressableDev" "\3DupSasAddr" "\5SmpTimeout" "\6ExpRouteFull" "\7RouteIndexError" "\10SmpFailed" @@ -324,26 +323,26 @@ mpr_print_evt_sas(struct mpr_softc *sc, data = (MPI2_EVENT_DATA_SAS_TOPOLOGY_CHANGE_LIST *) &event->EventData; - MPR_EVENTFIELD(sc, data, EnclosureHandle, 0x%x); - MPR_EVENTFIELD(sc, data, ExpanderDevHandle, 0x%x); - MPR_EVENTFIELD(sc, data, NumPhys, %d); - MPR_EVENTFIELD(sc, data, NumEntries, %d); - MPR_EVENTFIELD(sc, data, StartPhyNum, %d); - mpr_dprint_field(sc, MPR_EVENT, "ExpStatus: %s (0x%x)\n", + MPR_PRINTFIELD(sc, data, EnclosureHandle, 0x%x); + MPR_PRINTFIELD(sc, data, ExpanderDevHandle, 0x%x); + MPR_PRINTFIELD(sc, data, NumPhys, %d); + MPR_PRINTFIELD(sc, data, NumEntries, %d); + MPR_PRINTFIELD(sc, data, StartPhyNum, %d); + mpr_print_field(sc, "ExpStatus: %s (0x%x)\n", mpr_describe_table(mpr_sastopo_exp, data->ExpStatus), data->ExpStatus); - MPR_EVENTFIELD(sc, data, PhysicalPort, %d); + MPR_PRINTFIELD(sc, data, PhysicalPort, %d); for (i = 0; i < data->NumEntries; i++) { phy = &data->PHY[i]; phynum = data->StartPhyNum + i; - mpr_dprint_field(sc, MPR_EVENT, + mpr_print_field(sc, "PHY[%d].AttachedDevHandle: 0x%04x\n", phynum, phy->AttachedDevHandle); - mpr_dprint_field(sc, MPR_EVENT, + mpr_print_field(sc, "PHY[%d].LinkRate: %s (0x%x)\n", phynum, mpr_describe_table(mpr_linkrate_names, (phy->LinkRate >> 4) & 0xf), phy->LinkRate); - mpr_dprint_field(sc,MPR_EVENT,"PHY[%d].PhyStatus: %s\n", + mpr_print_field(sc, "PHY[%d].PhyStatus: %s\n", phynum, mpr_describe_table(mpr_phystatus_names, phy->PhyStatus)); } @@ -355,13 +354,13 @@ mpr_print_evt_sas(struct mpr_softc *sc, data = (MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE *) &event->EventData; - MPR_EVENTFIELD(sc, data, EnclosureHandle, 0x%x); - mpr_dprint_field(sc, MPR_EVENT, "ReasonCode: %s\n", + MPR_PRINTFIELD(sc, data, EnclosureHandle, 0x%x); + mpr_print_field(sc, "ReasonCode: %s\n", mpr_describe_table(mpr_sastopo_exp, data->ReasonCode)); - MPR_EVENTFIELD(sc, data, PhysicalPort, %d); - MPR_EVENTFIELD(sc, data, NumSlots, %d); - MPR_EVENTFIELD(sc, data, StartSlot, %d); - MPR_EVENTFIELD(sc, data, PhyBits, 0x%x); + MPR_PRINTFIELD(sc, data, PhysicalPort, %d); + MPR_PRINTFIELD(sc, data, NumSlots, %d); + MPR_PRINTFIELD(sc, data, StartSlot, %d); + MPR_PRINTFIELD(sc, data, PhyBits, 0x%x); break; } case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE: @@ -370,13 +369,13 @@ mpr_print_evt_sas(struct mpr_softc *sc, data = (MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *) &event->EventData; - MPR_EVENTFIELD(sc, data, TaskTag, 0x%x); - mpr_dprint_field(sc, MPR_EVENT, "ReasonCode: %s\n", + MPR_PRINTFIELD(sc, data, TaskTag, 0x%x); + mpr_print_field(sc, "ReasonCode: %s\n", mpr_describe_table(mpr_sasdev_reason, data->ReasonCode)); - MPR_EVENTFIELD(sc, data, ASC, 0x%x); - MPR_EVENTFIELD(sc, data, ASCQ, 0x%x); - MPR_EVENTFIELD(sc, data, DevHandle, 0x%x); - mpr_dprint_field(sc, MPR_EVENT, "SASAddress: 0x%jx\n", + MPR_PRINTFIELD(sc, data, ASC, 0x%x); + MPR_PRINTFIELD(sc, data, ASCQ, 0x%x); + MPR_PRINTFIELD(sc, data, DevHandle, 0x%x); + mpr_print_field(sc, "SASAddress: 0x%jx\n", mpr_to_u64(&data->SASAddress)); } default: @@ -385,24 +384,24 @@ mpr_print_evt_sas(struct mpr_softc *sc, } void -mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) +_mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) { MPR_PRINTFIELD_START(sc, "SAS Expander Page 1 #%d", buf->Phy); MPR_PRINTFIELD(sc, buf, PhysicalPort, %d); MPR_PRINTFIELD(sc, buf, NumPhys, %d); MPR_PRINTFIELD(sc, buf, Phy, %d); MPR_PRINTFIELD(sc, buf, NumTableEntriesProgrammed, %d); - mpr_dprint_field(sc, MPR_XINFO, "ProgrammedLinkRate: %s (0x%x)\n", + mpr_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, (buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate); - mpr_dprint_field(sc, MPR_XINFO, "HwLinkRate: %s (0x%x)\n", + mpr_print_field(sc, "HwLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, (buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate); MPR_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x); - mpr_dprint_field(sc, MPR_XINFO, "PhyInfo Reason: %s (0x%x)\n", + mpr_print_field(sc, "PhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, (buf->PhyInfo >> 16) & 0xf), buf->PhyInfo); - mpr_dprint_field(sc, MPR_XINFO, "AttachedDeviceInfo: %b,%s\n", + mpr_print_field(sc, "AttachedDeviceInfo: %b,%s\n", buf->AttachedDeviceInfo, "\20" "\4SATAhost" "\5SMPinit" "\6STPinit" "\7SSPinit" "\10SATAdev" "\11SMPtarg" "\12STPtarg" "\13SSPtarg" "\14Direct" "\15LSIdev" "\16ATAPIdev" "\17SEPdev", @@ -410,14 +409,14 @@ mpr_print_expander1(struct mpr_softc *sc buf->AttachedDeviceInfo & 0x03)); MPR_PRINTFIELD(sc, buf, ExpanderDevHandle, 0x%04x); MPR_PRINTFIELD(sc, buf, ChangeCount, %d); - mpr_dprint_field(sc, MPR_XINFO, "NegotiatedLinkRate: %s (0x%x)\n", + mpr_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate); MPR_PRINTFIELD(sc, buf, PhyIdentifier, %d); MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d); MPR_PRINTFIELD(sc, buf, DiscoveryInfo, 0x%x); MPR_PRINTFIELD(sc, buf, AttachedPhyInfo, 0x%x); - mpr_dprint_field(sc, MPR_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n", + mpr_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo); MPR_PRINTFIELD(sc, buf, ZoneGroup, %d); @@ -425,27 +424,27 @@ mpr_print_expander1(struct mpr_softc *sc } void -mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) +_mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) { MPR_PRINTFIELD_START(sc, "SAS PHY Page 0"); MPR_PRINTFIELD(sc, buf, OwnerDevHandle, 0x%04x); MPR_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x); MPR_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d); - mpr_dprint_field(sc, MPR_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n", + mpr_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo); - mpr_dprint_field(sc, MPR_XINFO, "ProgrammedLinkRate: %s (0x%x)\n", + mpr_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, (buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate); - mpr_dprint_field(sc, MPR_XINFO, "HwLinkRate: %s (0x%x)\n", + mpr_print_field(sc, "HwLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, (buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate); MPR_PRINTFIELD(sc, buf, ChangeCount, %d); MPR_PRINTFIELD(sc, buf, Flags, 0x%x); - mpr_dprint_field(sc, MPR_XINFO, "PhyInfo Reason: %s (0x%x)\n", + mpr_print_field(sc, "PhyInfo Reason: %s (0x%x)\n", mpr_describe_table(mpr_phyinfo_reason_names, (buf->PhyInfo >> 16) & 0xf), buf->PhyInfo); - mpr_dprint_field(sc, MPR_XINFO, "NegotiatedLinkRate: %s (0x%x)\n", + mpr_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n", mpr_describe_table(mpr_linkrate_names, buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate); } Modified: head/sys/dev/mpr/mpr_table.h ============================================================================== --- head/sys/dev/mpr/mpr_table.h Thu Jan 19 20:44:29 2017 (r312436) +++ head/sys/dev/mpr/mpr_table.h Thu Jan 19 21:47:50 2017 (r312437) @@ -41,13 +41,63 @@ extern struct mpr_table_lookup mpr_event extern struct mpr_table_lookup mpr_phystatus_names[]; extern struct mpr_table_lookup mpr_linkrate_names[]; -void mpr_print_iocfacts(struct mpr_softc *, MPI2_IOC_FACTS_REPLY *); -void mpr_print_portfacts(struct mpr_softc *, MPI2_PORT_FACTS_REPLY *); -void mpr_print_event(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); -void mpr_print_sasdev0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *); -void mpr_print_evt_sas(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); -void mpr_print_expander1(struct mpr_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *); -void mpr_print_sasphy0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *); +void _mpr_print_iocfacts(struct mpr_softc *, MPI2_IOC_FACTS_REPLY *); +void _mpr_print_portfacts(struct mpr_softc *, MPI2_PORT_FACTS_REPLY *); +void _mpr_print_event(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); +void _mpr_print_sasdev0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *); +void _mpr_print_evt_sas(struct mpr_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); +void _mpr_print_expander1(struct mpr_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *); +void _mpr_print_sasphy0(struct mpr_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *); void mpr_print_sgl(struct mpr_softc *, struct mpr_command *, int); void mpr_print_scsiio_cmd(struct mpr_softc *, struct mpr_command *); + +static __inline void +mpr_print_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_REPLY *facts) +{ + if (sc->mpr_debug & MPR_XINFO) + _mpr_print_iocfacts(sc, facts); +} + +static __inline void +mpr_print_portfacts(struct mpr_softc *sc, MPI2_PORT_FACTS_REPLY *facts) +{ + if (sc->mpr_debug & MPR_XINFO) + _mpr_print_portfacts(sc, facts); +} + +static __inline void +mpr_print_event(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +{ + if (sc->mpr_debug & MPR_EVENT) + _mpr_print_event(sc, event); +} + +static __inline void +mpr_print_evt_sas(struct mpr_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +{ + if (sc->mpr_debug & MPR_EVENT) + _mpr_print_evt_sas(sc, event); +} + +static __inline void +mpr_print_sasdev0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) +{ + if (sc->mpr_debug & MPR_XINFO) + _mpr_print_sasdev0(sc, buf); +} + +static __inline void +mpr_print_expander1(struct mpr_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) +{ + if (sc->mpr_debug & MPR_XINFO) + _mpr_print_expander1(sc, buf); +} + +static __inline void +mpr_print_sasphy0(struct mpr_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) +{ + if (sc->mpr_debug & MPR_XINFO) + _mpr_print_sasphy0(sc, buf); +} + #endif Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Thu Jan 19 20:44:29 2017 (r312436) +++ head/sys/dev/mpr/mprvar.h Thu Jan 19 21:47:50 2017 (r312437) @@ -584,6 +584,9 @@ mpr_unlock(struct mpr_softc *sc) #define mpr_printf(sc, args...) \ device_printf((sc)->mpr_dev, ##args) +#define mpr_print_field(sc, msg, args...) \ + printf("\t" msg, ##args) + #define mpr_vprintf(sc, args...) \ do { \ if (bootverbose) \ @@ -596,25 +599,13 @@ do { \ device_printf((sc)->mpr_dev, msg, ##args); \ } while (0) -#define mpr_dprint_field(sc, level, msg, args...) \ -do { \ - if ((sc)->mpr_debug & (level)) \ - printf("\t" msg, ##args); \ -} while (0) - #define MPR_PRINTFIELD_START(sc, tag...) \ - mpr_dprint((sc), MPR_INFO, ##tag); \ - mpr_dprint_field((sc), MPR_INFO, ":\n") + mpr_printf((sc), ##tag); \ + mpr_print_field((sc), ":\n") #define MPR_PRINTFIELD_END(sc, tag) \ - mpr_dprint((sc), MPR_INFO, tag "\n") + mpr_printf((sc), tag "\n") #define MPR_PRINTFIELD(sc, facts, attr, fmt) \ - mpr_dprint_field((sc), MPR_INFO, #attr ": " #fmt "\n", (facts)->attr) - -#define MPR_EVENTFIELD_START(sc, tag...) \ - mpr_dprint((sc), MPR_EVENT, ##tag); \ - mpr_dprint_field((sc), MPR_EVENT, ":\n") -#define MPR_EVENTFIELD(sc, facts, attr, fmt) \ - mpr_dprint_field((sc), MPR_EVENT, #attr ": " #fmt "\n", (facts)->attr) + mpr_print_field((sc), #attr ": " #fmt "\n", (facts)->attr) static __inline void mpr_from_u64(uint64_t data, U64 *mpr) Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Thu Jan 19 20:44:29 2017 (r312436) +++ head/sys/dev/mps/mps_sas.c Thu Jan 19 21:47:50 2017 (r312437) @@ -347,7 +347,7 @@ mpssas_log_command(struct mps_command *c sbuf_printf(&sb, "SMID %u ", cm->cm_desc.Default.SMID); sbuf_vprintf(&sb, fmt, ap); sbuf_finish(&sb); - mps_dprint_field(cm->cm_sc, level, "%s", sbuf_data(&sb)); + mps_print_field(cm->cm_sc, "%s", sbuf_data(&sb)); va_end(ap); } Modified: head/sys/dev/mps/mps_table.c ============================================================================== --- head/sys/dev/mps/mps_table.c Thu Jan 19 20:44:29 2017 (r312436) +++ head/sys/dev/mps/mps_table.c Thu Jan 19 21:47:50 2017 (r312437) @@ -196,7 +196,7 @@ mps_describe_devinfo(uint32_t devinfo, c } void -mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts) +_mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts) { MPS_PRINTFIELD_START(sc, "IOCFacts"); @@ -205,18 +205,18 @@ mps_print_iocfacts(struct mps_softc *sc, MPS_PRINTFIELD(sc, facts, IOCNumber, %d); MPS_PRINTFIELD(sc, facts, IOCExceptions, 0x%x); MPS_PRINTFIELD(sc, facts, MaxChainDepth, %d); - mps_dprint_field(sc, MPS_XINFO, "WhoInit: %s\n", + mps_print_field(sc, "WhoInit: %s\n", mps_describe_table(mps_whoinit_names, facts->WhoInit)); MPS_PRINTFIELD(sc, facts, NumberOfPorts, %d); MPS_PRINTFIELD(sc, facts, MaxMSIxVectors, %d); MPS_PRINTFIELD(sc, facts, RequestCredit, %d); MPS_PRINTFIELD(sc, facts, ProductID, 0x%x); - mps_dprint_field(sc, MPS_XINFO, "IOCCapabilities: %b\n", + mps_print_field(sc, "IOCCapabilities: %b\n", facts->IOCCapabilities, "\20" "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf" "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR" "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc"); - mps_dprint_field(sc, MPS_XINFO, "FWVersion= %d-%d-%d-%d\n", + mps_print_field(sc, "FWVersion= %d-%d-%d-%d\n", facts->FWVersion.Struct.Major, facts->FWVersion.Struct.Minor, facts->FWVersion.Struct.Unit, @@ -226,7 +226,7 @@ mps_print_iocfacts(struct mps_softc *sc, MPS_PRINTFIELD(sc, facts, MaxTargets, %d); MPS_PRINTFIELD(sc, facts, MaxSasExpanders, %d); MPS_PRINTFIELD(sc, facts, MaxEnclosures, %d); - mps_dprint_field(sc, MPS_XINFO, "ProtocolFlags: %b\n", + mps_print_field(sc, "ProtocolFlags: %b\n", facts->ProtocolFlags, "\20" "\1ScsiTarg" "\2ScsiInit"); MPS_PRINTFIELD(sc, facts, HighPriorityCredit, %d); MPS_PRINTFIELD(sc, facts, MaxReplyDescriptorPostQueueDepth, %d); @@ -237,7 +237,7 @@ mps_print_iocfacts(struct mps_softc *sc, } void -mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts) +_mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts) { MPS_PRINTFIELD_START(sc, "PortFacts"); @@ -247,24 +247,24 @@ mps_print_portfacts(struct mps_softc *sc } void -mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +_mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) { - MPS_EVENTFIELD_START(sc, "EventReply"); - MPS_EVENTFIELD(sc, event, EventDataLength, %d); - MPS_EVENTFIELD(sc, event, AckRequired, %d); - mps_dprint_field(sc, MPS_EVENT, "Event: %s (0x%x)\n", + MPS_PRINTFIELD_START(sc, "EventReply"); + MPS_PRINTFIELD(sc, event, EventDataLength, %d); + MPS_PRINTFIELD(sc, event, AckRequired, %d); + mps_print_field(sc, "Event: %s (0x%x)\n", mps_describe_table(mps_event_names, event->Event), event->Event); - MPS_EVENTFIELD(sc, event, EventContext, 0x%x); + MPS_PRINTFIELD(sc, event, EventContext, 0x%x); } void -mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) +_mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) { MPS_PRINTFIELD_START(sc, "SAS Device Page 0"); MPS_PRINTFIELD(sc, buf, Slot, %d); MPS_PRINTFIELD(sc, buf, EnclosureHandle, 0x%x); - mps_dprint_field(sc, MPS_XINFO, "SASAddress: 0x%jx\n", + mps_print_field(sc, "SASAddress: 0x%jx\n", mps_to_u64(&buf->SASAddress)); MPS_PRINTFIELD(sc, buf, ParentDevHandle, 0x%x); MPS_PRINTFIELD(sc, buf, PhyNum, %d); @@ -272,7 +272,7 @@ mps_print_sasdev0(struct mps_softc *sc, MPS_PRINTFIELD(sc, buf, DevHandle, 0x%x); MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, 0x%x); MPS_PRINTFIELD(sc, buf, ZoneGroup, %d); - mps_dprint_field(sc, MPS_XINFO, "DeviceInfo: %b,%s\n", buf->DeviceInfo, + mps_print_field(sc, "DeviceInfo: %b,%s\n", buf->DeviceInfo, "\20" "\4SataHost" "\5SmpInit" "\6StpInit" "\7SspInit" "\10SataDev" "\11SmpTarg" "\12StpTarg" "\13SspTarg" "\14Direct" "\15LsiDev" "\16AtapiDev" "\17SepDev", @@ -280,7 +280,7 @@ mps_print_sasdev0(struct mps_softc *sc, MPS_PRINTFIELD(sc, buf, Flags, 0x%x); MPS_PRINTFIELD(sc, buf, PhysicalPort, %d); MPS_PRINTFIELD(sc, buf, MaxPortConnections, %d); - mps_dprint_field(sc, MPS_XINFO, "DeviceName: 0x%jx\n", + mps_print_field(sc, "DeviceName: 0x%jx\n", mps_to_u64(&buf->DeviceName)); MPS_PRINTFIELD(sc, buf, PortGroups, %d); MPS_PRINTFIELD(sc, buf, DmaGroup, %d); @@ -288,10 +288,10 @@ mps_print_sasdev0(struct mps_softc *sc, } void -mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +_mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) { - mps_print_event(sc, event); + _mps_print_event(sc, event); switch(event->Event) { case MPI2_EVENT_SAS_DISCOVERY: @@ -299,12 +299,12 @@ mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_DATA_SAS_DISCOVERY *data; data = (MPI2_EVENT_DATA_SAS_DISCOVERY *)&event->EventData; - mps_dprint_field(sc, MPS_EVENT, "Flags: %b\n", data->Flags, + mps_print_field(sc, "Flags: %b\n", data->Flags, "\20" "\1InProgress" "\2DeviceChange"); - mps_dprint_field(sc, MPS_EVENT, "ReasonCode: %s\n", + mps_print_field(sc, "ReasonCode: %s\n", mps_describe_table(mps_sasdisc_reason, data->ReasonCode)); - MPS_EVENTFIELD(sc, data, PhysicalPort, %d); - mps_dprint_field(sc, MPS_EVENT, "DiscoveryStatus: %b\n", + MPS_PRINTFIELD(sc, data, PhysicalPort, %d); + mps_print_field(sc, "DiscoveryStatus: %b\n", data->DiscoveryStatus, "\20" "\1Loop" "\2UnaddressableDev" "\3DupSasAddr" "\5SmpTimeout" "\6ExpRouteFull" "\7RouteIndexError" "\10SmpFailed" @@ -323,26 +323,26 @@ mps_print_evt_sas(struct mps_softc *sc, data = (MPI2_EVENT_DATA_SAS_TOPOLOGY_CHANGE_LIST *) &event->EventData; - MPS_EVENTFIELD(sc, data, EnclosureHandle, 0x%x); - MPS_EVENTFIELD(sc, data, ExpanderDevHandle, 0x%x); - MPS_EVENTFIELD(sc, data, NumPhys, %d); - MPS_EVENTFIELD(sc, data, NumEntries, %d); - MPS_EVENTFIELD(sc, data, StartPhyNum, %d); - mps_dprint_field(sc, MPS_EVENT, "ExpStatus: %s (0x%x)\n", + MPS_PRINTFIELD(sc, data, EnclosureHandle, 0x%x); + MPS_PRINTFIELD(sc, data, ExpanderDevHandle, 0x%x); + MPS_PRINTFIELD(sc, data, NumPhys, %d); + MPS_PRINTFIELD(sc, data, NumEntries, %d); + MPS_PRINTFIELD(sc, data, StartPhyNum, %d); + mps_print_field(sc, "ExpStatus: %s (0x%x)\n", mps_describe_table(mps_sastopo_exp, data->ExpStatus), data->ExpStatus); - MPS_EVENTFIELD(sc, data, PhysicalPort, %d); + MPS_PRINTFIELD(sc, data, PhysicalPort, %d); for (i = 0; i < data->NumEntries; i++) { phy = &data->PHY[i]; phynum = data->StartPhyNum + i; - mps_dprint_field(sc, MPS_EVENT, + mps_print_field(sc, "PHY[%d].AttachedDevHandle: 0x%04x\n", phynum, phy->AttachedDevHandle); - mps_dprint_field(sc, MPS_EVENT, + mps_print_field(sc, "PHY[%d].LinkRate: %s (0x%x)\n", phynum, mps_describe_table(mps_linkrate_names, (phy->LinkRate >> 4) & 0xf), phy->LinkRate); - mps_dprint_field(sc,MPS_EVENT,"PHY[%d].PhyStatus: %s\n", + mps_print_field(sc, "PHY[%d].PhyStatus: %s\n", phynum, mps_describe_table(mps_phystatus_names, phy->PhyStatus)); } @@ -354,13 +354,13 @@ mps_print_evt_sas(struct mps_softc *sc, data = (MPI2_EVENT_DATA_SAS_ENCL_DEV_STATUS_CHANGE *) &event->EventData; - MPS_EVENTFIELD(sc, data, EnclosureHandle, 0x%x); - mps_dprint_field(sc, MPS_EVENT, "ReasonCode: %s\n", + MPS_PRINTFIELD(sc, data, EnclosureHandle, 0x%x); + mps_print_field(sc, "ReasonCode: %s\n", mps_describe_table(mps_sastopo_exp, data->ReasonCode)); - MPS_EVENTFIELD(sc, data, PhysicalPort, %d); - MPS_EVENTFIELD(sc, data, NumSlots, %d); - MPS_EVENTFIELD(sc, data, StartSlot, %d); - MPS_EVENTFIELD(sc, data, PhyBits, 0x%x); + MPS_PRINTFIELD(sc, data, PhysicalPort, %d); + MPS_PRINTFIELD(sc, data, NumSlots, %d); + MPS_PRINTFIELD(sc, data, StartSlot, %d); + MPS_PRINTFIELD(sc, data, PhyBits, 0x%x); break; } case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE: @@ -369,13 +369,13 @@ mps_print_evt_sas(struct mps_softc *sc, data = (MPI2_EVENT_DATA_SAS_DEVICE_STATUS_CHANGE *) &event->EventData; - MPS_EVENTFIELD(sc, data, TaskTag, 0x%x); - mps_dprint_field(sc, MPS_EVENT, "ReasonCode: %s\n", + MPS_PRINTFIELD(sc, data, TaskTag, 0x%x); + mps_print_field(sc, "ReasonCode: %s\n", mps_describe_table(mps_sasdev_reason, data->ReasonCode)); - MPS_EVENTFIELD(sc, data, ASC, 0x%x); - MPS_EVENTFIELD(sc, data, ASCQ, 0x%x); - MPS_EVENTFIELD(sc, data, DevHandle, 0x%x); - mps_dprint_field(sc, MPS_EVENT, "SASAddress: 0x%jx\n", + MPS_PRINTFIELD(sc, data, ASC, 0x%x); + MPS_PRINTFIELD(sc, data, ASCQ, 0x%x); + MPS_PRINTFIELD(sc, data, DevHandle, 0x%x); + mps_print_field(sc, "SASAddress: 0x%jx\n", mps_to_u64(&data->SASAddress)); } default: @@ -384,24 +384,24 @@ mps_print_evt_sas(struct mps_softc *sc, } void -mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) +_mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) { MPS_PRINTFIELD_START(sc, "SAS Expander Page 1 #%d", buf->Phy); MPS_PRINTFIELD(sc, buf, PhysicalPort, %d); MPS_PRINTFIELD(sc, buf, NumPhys, %d); MPS_PRINTFIELD(sc, buf, Phy, %d); MPS_PRINTFIELD(sc, buf, NumTableEntriesProgrammed, %d); - mps_dprint_field(sc, MPS_XINFO, "ProgrammedLinkRate: %s (0x%x)\n", + mps_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n", mps_describe_table(mps_linkrate_names, (buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate); - mps_dprint_field(sc, MPS_XINFO, "HwLinkRate: %s (0x%x)\n", + mps_print_field(sc, "HwLinkRate: %s (0x%x)\n", mps_describe_table(mps_linkrate_names, (buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate); MPS_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x); - mps_dprint_field(sc, MPS_XINFO, "PhyInfo Reason: %s (0x%x)\n", + mps_print_field(sc, "PhyInfo Reason: %s (0x%x)\n", mps_describe_table(mps_phyinfo_reason_names, (buf->PhyInfo >> 16) & 0xf), buf->PhyInfo); - mps_dprint_field(sc, MPS_XINFO, "AttachedDeviceInfo: %b,%s\n", + mps_print_field(sc, "AttachedDeviceInfo: %b,%s\n", buf->AttachedDeviceInfo, "\20" "\4SATAhost" "\5SMPinit" "\6STPinit" "\7SSPinit" "\10SATAdev" "\11SMPtarg" "\12STPtarg" "\13SSPtarg" "\14Direct" "\15LSIdev" "\16ATAPIdev" "\17SEPdev", @@ -409,14 +409,14 @@ mps_print_expander1(struct mps_softc *sc buf->AttachedDeviceInfo & 0x03)); MPS_PRINTFIELD(sc, buf, ExpanderDevHandle, 0x%04x); MPS_PRINTFIELD(sc, buf, ChangeCount, %d); - mps_dprint_field(sc, MPS_XINFO, "NegotiatedLinkRate: %s (0x%x)\n", + mps_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n", mps_describe_table(mps_linkrate_names, buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate); MPS_PRINTFIELD(sc, buf, PhyIdentifier, %d); MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d); MPS_PRINTFIELD(sc, buf, DiscoveryInfo, 0x%x); MPS_PRINTFIELD(sc, buf, AttachedPhyInfo, 0x%x); - mps_dprint_field(sc, MPS_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n", + mps_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n", mps_describe_table(mps_phyinfo_reason_names, buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo); MPS_PRINTFIELD(sc, buf, ZoneGroup, %d); @@ -424,27 +424,27 @@ mps_print_expander1(struct mps_softc *sc } void -mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) +_mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) { MPS_PRINTFIELD_START(sc, "SAS PHY Page 0"); MPS_PRINTFIELD(sc, buf, OwnerDevHandle, 0x%04x); MPS_PRINTFIELD(sc, buf, AttachedDevHandle, 0x%04x); MPS_PRINTFIELD(sc, buf, AttachedPhyIdentifier, %d); - mps_dprint_field(sc, MPS_XINFO, "AttachedPhyInfo Reason: %s (0x%x)\n", + mps_print_field(sc, "AttachedPhyInfo Reason: %s (0x%x)\n", mps_describe_table(mps_phyinfo_reason_names, buf->AttachedPhyInfo & 0xf), buf->AttachedPhyInfo); - mps_dprint_field(sc, MPS_XINFO, "ProgrammedLinkRate: %s (0x%x)\n", + mps_print_field(sc, "ProgrammedLinkRate: %s (0x%x)\n", mps_describe_table(mps_linkrate_names, (buf->ProgrammedLinkRate >> 4) & 0xf), buf->ProgrammedLinkRate); - mps_dprint_field(sc, MPS_XINFO, "HwLinkRate: %s (0x%x)\n", + mps_print_field(sc, "HwLinkRate: %s (0x%x)\n", mps_describe_table(mps_linkrate_names, (buf->HwLinkRate >> 4) & 0xf), buf->HwLinkRate); MPS_PRINTFIELD(sc, buf, ChangeCount, %d); MPS_PRINTFIELD(sc, buf, Flags, 0x%x); - mps_dprint_field(sc, MPS_XINFO, "PhyInfo Reason: %s (0x%x)\n", + mps_print_field(sc, "PhyInfo Reason: %s (0x%x)\n", mps_describe_table(mps_phyinfo_reason_names, (buf->PhyInfo >> 16) & 0xf), buf->PhyInfo); - mps_dprint_field(sc, MPS_XINFO, "NegotiatedLinkRate: %s (0x%x)\n", + mps_print_field(sc, "NegotiatedLinkRate: %s (0x%x)\n", mps_describe_table(mps_linkrate_names, buf->NegotiatedLinkRate & 0xf), buf->NegotiatedLinkRate); } Modified: head/sys/dev/mps/mps_table.h ============================================================================== --- head/sys/dev/mps/mps_table.h Thu Jan 19 20:44:29 2017 (r312436) +++ head/sys/dev/mps/mps_table.h Thu Jan 19 21:47:50 2017 (r312437) @@ -41,13 +41,63 @@ extern struct mps_table_lookup mps_event extern struct mps_table_lookup mps_phystatus_names[]; extern struct mps_table_lookup mps_linkrate_names[]; -void mps_print_iocfacts(struct mps_softc *, MPI2_IOC_FACTS_REPLY *); -void mps_print_portfacts(struct mps_softc *, MPI2_PORT_FACTS_REPLY *); -void mps_print_event(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); -void mps_print_sasdev0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *); -void mps_print_evt_sas(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); -void mps_print_expander1(struct mps_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *); -void mps_print_sasphy0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *); +void _mps_print_iocfacts(struct mps_softc *, MPI2_IOC_FACTS_REPLY *); +void _mps_print_portfacts(struct mps_softc *, MPI2_PORT_FACTS_REPLY *); +void _mps_print_event(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); +void _mps_print_sasdev0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_DEV_0 *); +void _mps_print_evt_sas(struct mps_softc *, MPI2_EVENT_NOTIFICATION_REPLY *); +void _mps_print_expander1(struct mps_softc *, MPI2_CONFIG_PAGE_EXPANDER_1 *); +void _mps_print_sasphy0(struct mps_softc *, MPI2_CONFIG_PAGE_SAS_PHY_0 *); void mps_print_sgl(struct mps_softc *, struct mps_command *, int); void mps_print_scsiio_cmd(struct mps_softc *, struct mps_command *); + +static __inline void +mps_print_iocfacts(struct mps_softc *sc, MPI2_IOC_FACTS_REPLY *facts) +{ + if (sc->mps_debug & MPS_XINFO) + _mps_print_iocfacts(sc, facts); +} + +static __inline void +mps_print_portfacts(struct mps_softc *sc, MPI2_PORT_FACTS_REPLY *facts) +{ + if (sc->mps_debug & MPS_XINFO) + _mps_print_portfacts(sc, facts); +} + +static __inline void +mps_print_event(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +{ + if (sc->mps_debug & MPS_EVENT) + _mps_print_event(sc, event); +} + +static __inline void +mps_print_sasdev0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_DEV_0 *buf) +{ + if (sc->mps_debug & MPS_XINFO) + _mps_print_sasdev0(sc, buf); +} + +static __inline void +mps_print_evt_sas(struct mps_softc *sc, MPI2_EVENT_NOTIFICATION_REPLY *event) +{ + if (sc->mps_debug & MPS_EVENT) + _mps_print_evt_sas(sc, event); +} + +static __inline void +mps_print_expander1(struct mps_softc *sc, MPI2_CONFIG_PAGE_EXPANDER_1 *buf) +{ + if (sc->mps_debug & MPS_XINFO) + _mps_print_expander1(sc, buf); +} + +static __inline void +mps_print_sasphy0(struct mps_softc *sc, MPI2_CONFIG_PAGE_SAS_PHY_0 *buf) +{ + if (sc->mps_debug & MPS_XINFO) + _mps_print_sasphy0(sc, buf); +} + #endif Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Thu Jan 19 20:44:29 2017 (r312436) +++ head/sys/dev/mps/mpsvar.h Thu Jan 19 21:47:50 2017 (r312437) @@ -609,6 +609,9 @@ mps_unlock(struct mps_softc *sc) #define mps_printf(sc, args...) \ device_printf((sc)->mps_dev, ##args) +#define mps_print_field(sc, msg, args...) \ + printf("\t" msg, ##args) + #define mps_vprintf(sc, args...) \ do { \ if (bootverbose) \ @@ -621,25 +624,13 @@ do { \ device_printf((sc)->mps_dev, msg, ##args); \ } while (0) -#define mps_dprint_field(sc, level, msg, args...) \ -do { \ - if ((sc)->mps_debug & (level)) \ - printf("\t" msg, ##args); \ -} while (0) - #define MPS_PRINTFIELD_START(sc, tag...) \ - mps_dprint((sc), MPS_XINFO, ##tag); \ - mps_dprint_field((sc), MPS_XINFO, ":\n") + mps_printf((sc), ##tag); \ + mps_print_field((sc), ":\n") #define MPS_PRINTFIELD_END(sc, tag) \ - mps_dprint((sc), MPS_XINFO, tag "\n") + mps_printf((sc), tag "\n") #define MPS_PRINTFIELD(sc, facts, attr, fmt) \ - mps_dprint_field((sc), MPS_XINFO, #attr ": " #fmt "\n", (facts)->attr) - -#define MPS_EVENTFIELD_START(sc, tag...) \ - mps_dprint((sc), MPS_EVENT, ##tag); \ - mps_dprint_field((sc), MPS_EVENT, ":\n") -#define MPS_EVENTFIELD(sc, facts, attr, fmt) \ - mps_dprint_field((sc), MPS_EVENT, #attr ": " #fmt "\n", (facts)->attr) + mps_print_field((sc), #attr ": " #fmt "\n", (facts)->attr) #define MPS_FUNCTRACE(sc) \ mps_dprint((sc), MPS_TRACE, "%s\n", __func__) From owner-svn-src-all@freebsd.org Thu Jan 19 22:07:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64866CB8661; Thu, 19 Jan 2017 22:07:32 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0E651E26; Thu, 19 Jan 2017 22:07:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JM7VVD063108; Thu, 19 Jan 2017 22:07:31 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JM7LaP063016; Thu, 19 Jan 2017 22:07:21 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201701192207.v0JM7LaP063016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 19 Jan 2017 22:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312438 - in head/sys/contrib/dev/acpica: . common compiler components/debugger components/disassembler components/dispatcher components/events components/executer components/hardware c... 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, 19 Jan 2017 22:07:32 -0000 Author: jkim Date: Thu Jan 19 22:07:21 2017 New Revision: 312438 URL: https://svnweb.freebsd.org/changeset/base/312438 Log: Merge ACPICA 20170119. Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/acfileio.c head/sys/contrib/dev/acpica/common/acgetline.c head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/ahids.c head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/ahtable.c head/sys/contrib/dev/acpica/common/ahuuids.c head/sys/contrib/dev/acpica/common/cmfsize.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtables.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslascii.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslcstyle.y head/sys/contrib/dev/acpica/compiler/asldebug.c head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslexternal.c head/sys/contrib/dev/acpica/compiler/aslfileio.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslhelp.c head/sys/contrib/dev/acpica/compiler/aslhelpers.y head/sys/contrib/dev/acpica/compiler/aslhex.c head/sys/contrib/dev/acpica/compiler/aslkeywords.y head/sys/contrib/dev/acpica/compiler/asllength.c head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/asllistsup.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslmapenter.c head/sys/contrib/dev/acpica/compiler/aslmapoutput.c head/sys/contrib/dev/acpica/compiler/aslmaputils.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/aslnamesp.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslparser.y head/sys/contrib/dev/acpica/compiler/aslpld.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslprepkg.c head/sys/contrib/dev/acpica/compiler/aslprimaries.y head/sys/contrib/dev/acpica/compiler/aslprintf.c head/sys/contrib/dev/acpica/compiler/aslprune.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslresources.y head/sys/contrib/dev/acpica/compiler/aslrestype1.c head/sys/contrib/dev/acpica/compiler/aslrestype1i.c head/sys/contrib/dev/acpica/compiler/aslrestype2.c head/sys/contrib/dev/acpica/compiler/aslrestype2d.c head/sys/contrib/dev/acpica/compiler/aslrestype2e.c head/sys/contrib/dev/acpica/compiler/aslrestype2q.c head/sys/contrib/dev/acpica/compiler/aslrestype2s.c head/sys/contrib/dev/acpica/compiler/aslrestype2w.c head/sys/contrib/dev/acpica/compiler/aslrules.y head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslstubs.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/aslsupport.y head/sys/contrib/dev/acpica/compiler/asltokens.y head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/asltypes.y head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/asluuid.c head/sys/contrib/dev/acpica/compiler/aslwalks.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/aslxrefout.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtparser.l head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/compiler/preprocess.h head/sys/contrib/dev/acpica/compiler/prexpress.c head/sys/contrib/dev/acpica/compiler/prmacros.c head/sys/contrib/dev/acpica/compiler/prparser.l head/sys/contrib/dev/acpica/compiler/prparser.y head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbconvert.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbfileio.c head/sys/contrib/dev/acpica/components/debugger/dbhistry.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbobject.c head/sys/contrib/dev/acpica/components/debugger/dbstats.c head/sys/contrib/dev/acpica/components/debugger/dbtest.c head/sys/contrib/dev/acpica/components/debugger/dbutils.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c head/sys/contrib/dev/acpica/components/disassembler/dmutils.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c head/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/dispatcher/dswscope.c head/sys/contrib/dev/acpica/components/dispatcher/dswstate.c head/sys/contrib/dev/acpica/components/events/evevent.c head/sys/contrib/dev/acpica/components/events/evglock.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evgpeblk.c head/sys/contrib/dev/acpica/components/events/evgpeinit.c head/sys/contrib/dev/acpica/components/events/evgpeutil.c head/sys/contrib/dev/acpica/components/events/evhandler.c head/sys/contrib/dev/acpica/components/events/evmisc.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/events/evrgnini.c head/sys/contrib/dev/acpica/components/events/evsci.c head/sys/contrib/dev/acpica/components/events/evxface.c head/sys/contrib/dev/acpica/components/events/evxfevnt.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/events/evxfregn.c head/sys/contrib/dev/acpica/components/executer/exconcat.c head/sys/contrib/dev/acpica/components/executer/exconfig.c head/sys/contrib/dev/acpica/components/executer/exconvrt.c head/sys/contrib/dev/acpica/components/executer/excreate.c head/sys/contrib/dev/acpica/components/executer/exdebug.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/executer/exfield.c head/sys/contrib/dev/acpica/components/executer/exfldio.c head/sys/contrib/dev/acpica/components/executer/exmisc.c head/sys/contrib/dev/acpica/components/executer/exmutex.c head/sys/contrib/dev/acpica/components/executer/exnames.c head/sys/contrib/dev/acpica/components/executer/exoparg1.c head/sys/contrib/dev/acpica/components/executer/exoparg2.c head/sys/contrib/dev/acpica/components/executer/exoparg3.c head/sys/contrib/dev/acpica/components/executer/exoparg6.c head/sys/contrib/dev/acpica/components/executer/exprep.c head/sys/contrib/dev/acpica/components/executer/exregion.c head/sys/contrib/dev/acpica/components/executer/exresnte.c head/sys/contrib/dev/acpica/components/executer/exresolv.c head/sys/contrib/dev/acpica/components/executer/exresop.c head/sys/contrib/dev/acpica/components/executer/exstore.c head/sys/contrib/dev/acpica/components/executer/exstoren.c head/sys/contrib/dev/acpica/components/executer/exstorob.c head/sys/contrib/dev/acpica/components/executer/exsystem.c head/sys/contrib/dev/acpica/components/executer/extrace.c head/sys/contrib/dev/acpica/components/executer/exutils.c head/sys/contrib/dev/acpica/components/hardware/hwacpi.c head/sys/contrib/dev/acpica/components/hardware/hwesleep.c head/sys/contrib/dev/acpica/components/hardware/hwgpe.c head/sys/contrib/dev/acpica/components/hardware/hwpci.c head/sys/contrib/dev/acpica/components/hardware/hwregs.c head/sys/contrib/dev/acpica/components/hardware/hwsleep.c head/sys/contrib/dev/acpica/components/hardware/hwtimer.c head/sys/contrib/dev/acpica/components/hardware/hwvalid.c head/sys/contrib/dev/acpica/components/hardware/hwxface.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsalloc.c head/sys/contrib/dev/acpica/components/namespace/nsarguments.c head/sys/contrib/dev/acpica/components/namespace/nsconvert.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c head/sys/contrib/dev/acpica/components/namespace/nseval.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nsload.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsobject.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c head/sys/contrib/dev/acpica/components/namespace/nsrepair.c head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c head/sys/contrib/dev/acpica/components/namespace/nssearch.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nswalk.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/namespace/nsxfname.c head/sys/contrib/dev/acpica/components/namespace/nsxfobj.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psopcode.c head/sys/contrib/dev/acpica/components/parser/psopinfo.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/parser/psscope.c head/sys/contrib/dev/acpica/components/parser/pstree.c head/sys/contrib/dev/acpica/components/parser/psutils.c head/sys/contrib/dev/acpica/components/parser/pswalk.c head/sys/contrib/dev/acpica/components/parser/psxface.c head/sys/contrib/dev/acpica/components/resources/rsaddr.c head/sys/contrib/dev/acpica/components/resources/rscalc.c head/sys/contrib/dev/acpica/components/resources/rscreate.c head/sys/contrib/dev/acpica/components/resources/rsdump.c head/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c head/sys/contrib/dev/acpica/components/resources/rsinfo.c head/sys/contrib/dev/acpica/components/resources/rsio.c head/sys/contrib/dev/acpica/components/resources/rsirq.c head/sys/contrib/dev/acpica/components/resources/rslist.c head/sys/contrib/dev/acpica/components/resources/rsmemory.c head/sys/contrib/dev/acpica/components/resources/rsmisc.c head/sys/contrib/dev/acpica/components/resources/rsserial.c head/sys/contrib/dev/acpica/components/resources/rsutils.c head/sys/contrib/dev/acpica/components/resources/rsxface.c head/sys/contrib/dev/acpica/components/tables/tbdata.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbfind.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbprint.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/tables/tbxfroot.c head/sys/contrib/dev/acpica/components/utilities/utaddress.c head/sys/contrib/dev/acpica/components/utilities/utalloc.c head/sys/contrib/dev/acpica/components/utilities/utascii.c head/sys/contrib/dev/acpica/components/utilities/utbuffer.c head/sys/contrib/dev/acpica/components/utilities/utcache.c head/sys/contrib/dev/acpica/components/utilities/utcopy.c head/sys/contrib/dev/acpica/components/utilities/utdebug.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/uterror.c head/sys/contrib/dev/acpica/components/utilities/uteval.c head/sys/contrib/dev/acpica/components/utilities/utexcep.c head/sys/contrib/dev/acpica/components/utilities/utglobal.c head/sys/contrib/dev/acpica/components/utilities/uthex.c head/sys/contrib/dev/acpica/components/utilities/utids.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utlock.c head/sys/contrib/dev/acpica/components/utilities/utmath.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utmutex.c head/sys/contrib/dev/acpica/components/utilities/utnonansi.c head/sys/contrib/dev/acpica/components/utilities/utobject.c head/sys/contrib/dev/acpica/components/utilities/utosi.c head/sys/contrib/dev/acpica/components/utilities/utownerid.c head/sys/contrib/dev/acpica/components/utilities/utpredef.c head/sys/contrib/dev/acpica/components/utilities/utresrc.c head/sys/contrib/dev/acpica/components/utilities/utstate.c head/sys/contrib/dev/acpica/components/utilities/utstring.c head/sys/contrib/dev/acpica/components/utilities/utstrtoul64.c head/sys/contrib/dev/acpica/components/utilities/uttrack.c head/sys/contrib/dev/acpica/components/utilities/utuuid.c head/sys/contrib/dev/acpica/components/utilities/utxface.c head/sys/contrib/dev/acpica/components/utilities/utxferror.c head/sys/contrib/dev/acpica/components/utilities/utxfinit.c head/sys/contrib/dev/acpica/components/utilities/utxfmutex.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acbuffer.h head/sys/contrib/dev/acpica/include/acclib.h head/sys/contrib/dev/acpica/include/accommon.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acdispat.h head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/achware.h head/sys/contrib/dev/acpica/include/acinterp.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acnames.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acopcode.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acparser.h head/sys/contrib/dev/acpica/include/acpi.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acresrc.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/acstruct.h head/sys/contrib/dev/acpica/include/actables.h head/sys/contrib/dev/acpica/include/actbl.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/acuuid.h head/sys/contrib/dev/acpica/include/amlcode.h head/sys/contrib/dev/acpica/include/amlresrc.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/contrib/dev/acpica/include/platform/acenvex.h head/sys/contrib/dev/acpica/include/platform/acfreebsd.h head/sys/contrib/dev/acpica/include/platform/acgcc.h head/sys/contrib/dev/acpica/include/platform/acgccex.h head/sys/contrib/dev/acpica/os_specific/service_layers/osgendbg.c head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/changes.txt Thu Jan 19 22:07:21 2017 (r312438) @@ -1,4 +1,39 @@ ---------------------------------------- +19 January 2017. Summary of changes for version 20170119: + +This release is available at https://acpica.org/downloads + +1) General ACPICA software: + +Entire source code base: Added the 2017 copyright to all source code +legal/licensing module headers and utility/tool signons. This includes +the standard Linux dual-license header. This affects virtually every file +in the ACPICA core subsystem, iASL compiler, all ACPICA utilities, and +the ACPICA test suite. + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Removed/fixed an inadvertent remark when a method argument +containing a reference is used as a target operand within the method (and +never used as a simple argument), as in the example below. Jeffrey Hugo. + + dsdt.asl 1507: Store(0x1, Arg0) + Remark 2146 - ^ Method Argument is never used (Arg0) + +All tools: Removed the bit width of the compiler that generated the tool +from the common signon for all user space tools. This proved to be +confusing and unnecessary. This includes similar removal of HARDWARE_NAME +from the generic makefiles (Thomas Petazzoni). Example below. + + Old: + ASL+ Optimizing Compiler version 20170119-32 + ASL+ Optimizing Compiler version 20170119-64 + + New: + ASL+ Optimizing Compiler version 20170119 + +---------------------------------------- 22 December 2016. Summary of changes for version 20161222: Modified: head/sys/contrib/dev/acpica/common/acfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/common/acfileio.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/acfileio.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/acgetline.c ============================================================================== --- head/sys/contrib/dev/acpica/common/acgetline.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/acgetline.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/adfile.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/adisasm.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/adwalk.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/ahids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahids.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/ahids.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/ahpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahpredef.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/ahpredef.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/ahtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahtable.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/ahtable.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/ahuuids.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahuuids.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/ahuuids.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/cmfsize.c ============================================================================== --- head/sys/contrib/dev/acpica/common/cmfsize.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/cmfsize.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/dmextern.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/dmtable.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmtables.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtables.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/dmtables.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/dmtbinfo.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/getopt.c ============================================================================== --- head/sys/contrib/dev/acpica/common/getopt.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/common/getopt.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslanalyze.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslanalyze.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslascii.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslascii.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslascii.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslbtypes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslbtypes.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslbtypes.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcodegen.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslcodegen.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.l Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcstyle.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcstyle.y Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslcstyle.y Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asldebug.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldebug.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asldebug.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -48,7 +48,7 @@ /* * Compiler versions and names */ -#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler" +#define ASL_COMPILER_NAME "ASL+ Optimizing Compiler/Disassembler" #define AML_DISASSEMBLER_NAME "AML/ASL+ Disassembler" #define ASL_INVOCATION_NAME "iasl" #define ASL_CREATOR_ID "INTL" Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslexternal.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslexternal.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslexternal.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslfileio.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfileio.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslfileio.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslfold.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfold.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslfold.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslglobal.h Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslglobal.h Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslhelp.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslhelp.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslhelp.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslhelpers.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslhelpers.y Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslhelpers.y Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslhex.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslhex.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslhex.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslkeywords.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslkeywords.y Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslkeywords.y Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asllength.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllength.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asllength.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asllisting.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllisting.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asllisting.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asllistsup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllistsup.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asllistsup.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asllookup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllookup.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asllookup.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslmap.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmap.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslmap.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslmapenter.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmapenter.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslmapenter.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslmapoutput.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmapoutput.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslmapoutput.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslmaputils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmaputils.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslmaputils.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslmethod.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmethod.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslmethod.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslnamesp.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslnamesp.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslnamesp.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asloffset.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloffset.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asloffset.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslopcodes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopcodes.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslopcodes.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asloperands.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloperands.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asloperands.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslopt.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopt.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslopt.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asloptions.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloptions.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asloptions.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslparser.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslparser.y Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslparser.y Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslpld.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpld.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslpld.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpredef.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslpredef.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslprepkg.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprepkg.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslprepkg.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslprimaries.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprimaries.y Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslprimaries.y Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslprintf.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprintf.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslprintf.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslprune.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslprune.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslprune.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslresource.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslresource.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslresource.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslresources.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslresources.y Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslresources.y Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype1.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype1.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslrestype1.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype1i.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype1i.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslrestype1i.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2d.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2d.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2d.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2e.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2e.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2e.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2q.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2q.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2q.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2s.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2s.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2s.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2w.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2w.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2w.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrules.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrules.y Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslrules.y Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslstubs.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstubs.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslstubs.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslsupport.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslsupport.l Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslsupport.l Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslsupport.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslsupport.y Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslsupport.y Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asltokens.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltokens.y Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asltokens.y Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asltransform.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltransform.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asltransform.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asltree.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltree.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asltree.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asltypes.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltypes.h Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asltypes.h Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asltypes.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltypes.y Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asltypes.y Thu Jan 19 22:07:21 2017 (r312438) @@ -6,7 +6,7 @@ NoEcho(' *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslutils.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslutils.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -381,8 +381,8 @@ UtDisplaySummary ( { /* Compiler name and version number */ - FlPrintFile (FileId, "%s version %X%s\n\n", - ASL_COMPILER_NAME, (UINT32) ACPI_CA_VERSION, ACPI_WIDTH); + FlPrintFile (FileId, "%s version %X\n\n", + ASL_COMPILER_NAME, (UINT32) ACPI_CA_VERSION); } /* Summary of main input and output files */ Modified: head/sys/contrib/dev/acpica/compiler/asluuid.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asluuid.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/asluuid.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2016, Intel Corp. + * Copyright (C) 2000 - 2017, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslwalks.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslwalks.c Thu Jan 19 21:47:50 2017 (r312437) +++ head/sys/contrib/dev/acpica/compiler/aslwalks.c Thu Jan 19 22:07:21 2017 (r312438) @@ -5,7 +5,7 @@ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Jan 19 23:38:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF735CB8B7C; Thu, 19 Jan 2017 23:38:32 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98B0915F9; Thu, 19 Jan 2017 23:38:32 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JNcVDx099733; Thu, 19 Jan 2017 23:38:31 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JNcVM5099732; Thu, 19 Jan 2017 23:38:31 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201701192338.v0JNcVM5099732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 19 Jan 2017 23:38:31 +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: r312439 - stable/11/sys/netinet 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, 19 Jan 2017 23:38:32 -0000 Author: jpaetzel Date: Thu Jan 19 23:38:31 2017 New Revision: 312439 URL: https://svnweb.freebsd.org/changeset/base/312439 Log: MFC 310847 310864 Harden CARP against network loops. If there is a loop in the network a CARP that is in MASTER state will see it's own broadcasts, which will then cause it to assume BACKUP state. When it assumes BACKUP it will stop sending advertisements. In that state it will no longer see advertisements and will assume MASTER... We can't catch all the cases where we are seeing our own CARP broadcast, but we can catch the obvious case. Unbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all IPv6 structs under the INET6 #ifdef. Similarly (even though it doesn't seem to affect the build), conditionalize all IPv4 structs under the INET #ifdef This also unbreaks the LINT-NOINET6 tinderbox target on amd64; I have not verified other MACHINE/TARGET pairs (e.g. armv6/arm). Submitted by: torek Obtained from: FreeNAS Pointyhat fix: ngie Modified: stable/11/sys/netinet/ip_carp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_carp.c ============================================================================== --- stable/11/sys/netinet/ip_carp.c Thu Jan 19 22:07:21 2017 (r312438) +++ stable/11/sys/netinet/ip_carp.c Thu Jan 19 23:38:31 2017 (r312439) @@ -581,27 +581,96 @@ carp6_input(struct mbuf **mp, int *offp, } #endif /* INET6 */ +/* + * This routine should not be necessary at all, but some switches + * (VMWare ESX vswitches) can echo our own packets back at us, + * and we must ignore them or they will cause us to drop out of + * MASTER mode. + * + * We cannot catch all cases of network loops. Instead, what we + * do here is catch any packet that arrives with a carp header + * with a VHID of 0, that comes from an address that is our own. + * These packets are by definition "from us" (even if they are from + * a misconfigured host that is pretending to be us). + * + * The VHID test is outside this mini-function. + */ +static int +carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af) +{ +#ifdef INET + struct ip *ip4; + struct in_addr in4; +#endif +#ifdef INET6 + struct ip6_hdr *ip6; + struct in6_addr in6; +#endif + + switch (af) { +#ifdef INET + case AF_INET: + ip4 = mtod(m, struct ip *); + in4 = ifatoia(ifa)->ia_addr.sin_addr; + return (in4.s_addr == ip4->ip_src.s_addr); +#endif +#ifdef INET6 + case AF_INET6: + ip6 = mtod(m, struct ip6_hdr *); + in6 = ifatoia6(ifa)->ia_addr.sin6_addr; + return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0); +#endif + default: + break; + } + return (0); +} + static void carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) { struct ifnet *ifp = m->m_pkthdr.rcvif; - struct ifaddr *ifa; + struct ifaddr *ifa, *match; struct carp_softc *sc; uint64_t tmp_counter; struct timeval sc_tv, ch_tv; + int error; - /* verify that the VHID is valid on the receiving interface */ + /* + * Verify that the VHID is valid on the receiving interface. + * + * There should be just one match. If there are none + * the VHID is not valid and we drop the packet. If + * there are multiple VHID matches, take just the first + * one, for compatibility with previous code. While we're + * scanning, check for obvious loops in the network topology + * (these should never happen, and as noted above, we may + * miss real loops; this is just a double-check). + */ IF_ADDR_RLOCK(ifp); - IFNET_FOREACH_IFA(ifp, ifa) - if (ifa->ifa_addr->sa_family == af && - ifa->ifa_carp->sc_vhid == ch->carp_vhid) { - ifa_ref(ifa); - break; - } + error = 0; + match = NULL; + IFNET_FOREACH_IFA(ifp, ifa) { + if (match == NULL && ifa->ifa_carp != NULL && + ifa->ifa_addr->sa_family == af && + ifa->ifa_carp->sc_vhid == ch->carp_vhid) + match = ifa; + if (ch->carp_vhid == 0 && carp_source_is_self(m, ifa, af)) + error = ELOOP; + } + ifa = error ? NULL : match; + if (ifa != NULL) + ifa_ref(ifa); IF_ADDR_RUNLOCK(ifp); if (ifa == NULL) { - CARPSTATS_INC(carps_badvhid); + if (error == ELOOP) { + CARP_DEBUG("dropping looped packet on interface %s\n", + ifp->if_xname); + CARPSTATS_INC(carps_badif); /* ??? */ + } else { + CARPSTATS_INC(carps_badvhid); + } m_freem(m); return; } @@ -787,12 +856,41 @@ carp_send_ad_error(struct carp_softc *sc } } +/* + * Pick the best ifaddr on the given ifp for sending CARP + * advertisements. + * + * "Best" here is defined by ifa_preferred(). This function is much + * much like ifaof_ifpforaddr() except that we just use ifa_preferred(). + * + * (This could be simplified to return the actual address, except that + * it has a different format in AF_INET and AF_INET6.) + */ +static struct ifaddr * +carp_best_ifa(int af, struct ifnet *ifp) +{ + struct ifaddr *ifa, *best; + + if (af >= AF_MAX) + return (NULL); + best = NULL; + IF_ADDR_RLOCK(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family == af && + (best == NULL || ifa_preferred(best, ifa))) + best = ifa; + } + IF_ADDR_RUNLOCK(ifp); + if (best != NULL) + ifa_ref(best); + return (best); +} + static void carp_send_ad_locked(struct carp_softc *sc) { struct carp_header ch; struct timeval tv; - struct sockaddr sa; struct ifaddr *ifa; struct carp_header *ch_ptr; struct mbuf *m; @@ -841,9 +939,7 @@ carp_send_ad_locked(struct carp_softc *s ip->ip_sum = 0; ip_fillid(ip); - bzero(&sa, sizeof(sa)); - sa.sa_family = AF_INET; - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); + ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); if (ifa != NULL) { ip->ip_src.s_addr = ifatoia(ifa)->ia_addr.sin_addr.s_addr; @@ -887,11 +983,9 @@ carp_send_ad_locked(struct carp_softc *s ip6->ip6_vfc |= IPV6_VERSION; ip6->ip6_hlim = CARP_DFLTTL; ip6->ip6_nxt = IPPROTO_CARP; - bzero(&sa, sizeof(sa)); /* set the source address */ - sa.sa_family = AF_INET6; - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); + ifa = carp_best_ifa(AF_INET6, sc->sc_carpdev); if (ifa != NULL) { bcopy(IFA_IN6(ifa), &ip6->ip6_src, sizeof(struct in6_addr)); From owner-svn-src-all@freebsd.org Thu Jan 19 23:42:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9616ACB8D47; Thu, 19 Jan 2017 23:42:27 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 709CB1A4E; Thu, 19 Jan 2017 23:42:27 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JNgQtL003642; Thu, 19 Jan 2017 23:42:26 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JNgQ15003641; Thu, 19 Jan 2017 23:42:26 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201701192342.v0JNgQ15003641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Thu, 19 Jan 2017 23:42: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: r312440 - stable/10/sys/netinet 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, 19 Jan 2017 23:42:27 -0000 Author: jpaetzel Date: Thu Jan 19 23:42:26 2017 New Revision: 312440 URL: https://svnweb.freebsd.org/changeset/base/312440 Log: MFC 310847 310864 Harden CARP against network loops. If there is a loop in the network a CARP that is in MASTER state will see it's own broadcasts, which will then cause it to assume BACKUP state. When it assumes BACKUP it will stop sending advertisements. In that state it will no longer see advertisements and will assume MASTER... We can't catch all the cases where we are seeing our own CARP broadcast, but we can catch the obvious case. Unbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all IPv6 structs under the INET6 #ifdef. Similarly (even though it doesn't seem to affect the build), conditionalize all IPv4 structs under the INET #ifdef This also unbreaks the LINT-NOINET6 tinderbox target on amd64; I have not verified other MACHINE/TARGET pairs (e.g. armv6/arm). Submitted by: torek Obtained from: FreeNAS Pointyhat fix: ngie Modified: stable/10/sys/netinet/ip_carp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_carp.c ============================================================================== --- stable/10/sys/netinet/ip_carp.c Thu Jan 19 23:38:31 2017 (r312439) +++ stable/10/sys/netinet/ip_carp.c Thu Jan 19 23:42:26 2017 (r312440) @@ -573,27 +573,96 @@ carp6_input(struct mbuf **mp, int *offp, } #endif /* INET6 */ +/* + * This routine should not be necessary at all, but some switches + * (VMWare ESX vswitches) can echo our own packets back at us, + * and we must ignore them or they will cause us to drop out of + * MASTER mode. + * + * We cannot catch all cases of network loops. Instead, what we + * do here is catch any packet that arrives with a carp header + * with a VHID of 0, that comes from an address that is our own. + * These packets are by definition "from us" (even if they are from + * a misconfigured host that is pretending to be us). + * + * The VHID test is outside this mini-function. + */ +static int +carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af) +{ +#ifdef INET + struct ip *ip4; + struct in_addr in4; +#endif +#ifdef INET6 + struct ip6_hdr *ip6; + struct in6_addr in6; +#endif + + switch (af) { +#ifdef INET + case AF_INET: + ip4 = mtod(m, struct ip *); + in4 = ifatoia(ifa)->ia_addr.sin_addr; + return (in4.s_addr == ip4->ip_src.s_addr); +#endif +#ifdef INET6 + case AF_INET6: + ip6 = mtod(m, struct ip6_hdr *); + in6 = ifatoia6(ifa)->ia_addr.sin6_addr; + return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0); +#endif + default: + break; + } + return (0); +} + static void carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) { struct ifnet *ifp = m->m_pkthdr.rcvif; - struct ifaddr *ifa; + struct ifaddr *ifa, *match; struct carp_softc *sc; uint64_t tmp_counter; struct timeval sc_tv, ch_tv; + int error; - /* verify that the VHID is valid on the receiving interface */ + /* + * Verify that the VHID is valid on the receiving interface. + * + * There should be just one match. If there are none + * the VHID is not valid and we drop the packet. If + * there are multiple VHID matches, take just the first + * one, for compatibility with previous code. While we're + * scanning, check for obvious loops in the network topology + * (these should never happen, and as noted above, we may + * miss real loops; this is just a double-check). + */ IF_ADDR_RLOCK(ifp); - IFNET_FOREACH_IFA(ifp, ifa) - if (ifa->ifa_addr->sa_family == af && - ifa->ifa_carp->sc_vhid == ch->carp_vhid) { - ifa_ref(ifa); - break; - } + error = 0; + match = NULL; + IFNET_FOREACH_IFA(ifp, ifa) { + if (match == NULL && ifa->ifa_carp != NULL && + ifa->ifa_addr->sa_family == af && + ifa->ifa_carp->sc_vhid == ch->carp_vhid) + match = ifa; + if (ch->carp_vhid == 0 && carp_source_is_self(m, ifa, af)) + error = ELOOP; + } + ifa = error ? NULL : match; + if (ifa != NULL) + ifa_ref(ifa); IF_ADDR_RUNLOCK(ifp); if (ifa == NULL) { - CARPSTATS_INC(carps_badvhid); + if (error == ELOOP) { + CARP_DEBUG("dropping looped packet on interface %s\n", + ifp->if_xname); + CARPSTATS_INC(carps_badif); /* ??? */ + } else { + CARPSTATS_INC(carps_badvhid); + } m_freem(m); return; } @@ -789,12 +858,41 @@ carp_send_ad_error(struct carp_softc *sc } } +/* + * Pick the best ifaddr on the given ifp for sending CARP + * advertisements. + * + * "Best" here is defined by ifa_preferred(). This function is much + * much like ifaof_ifpforaddr() except that we just use ifa_preferred(). + * + * (This could be simplified to return the actual address, except that + * it has a different format in AF_INET and AF_INET6.) + */ +static struct ifaddr * +carp_best_ifa(int af, struct ifnet *ifp) +{ + struct ifaddr *ifa, *best; + + if (af >= AF_MAX) + return (NULL); + best = NULL; + IF_ADDR_RLOCK(ifp); + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family == af && + (best == NULL || ifa_preferred(best, ifa))) + best = ifa; + } + IF_ADDR_RUNLOCK(ifp); + if (best != NULL) + ifa_ref(best); + return (best); +} + static void carp_send_ad_locked(struct carp_softc *sc) { struct carp_header ch; struct timeval tv; - struct sockaddr sa; struct ifaddr *ifa; struct carp_header *ch_ptr; struct mbuf *m; @@ -843,9 +941,7 @@ carp_send_ad_locked(struct carp_softc *s ip->ip_p = IPPROTO_CARP; ip->ip_sum = 0; - bzero(&sa, sizeof(sa)); - sa.sa_family = AF_INET; - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); + ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); if (ifa != NULL) { ip->ip_src.s_addr = ifatoia(ifa)->ia_addr.sin_addr.s_addr; @@ -889,11 +985,9 @@ carp_send_ad_locked(struct carp_softc *s ip6->ip6_vfc |= IPV6_VERSION; ip6->ip6_hlim = CARP_DFLTTL; ip6->ip6_nxt = IPPROTO_CARP; - bzero(&sa, sizeof(sa)); /* set the source address */ - sa.sa_family = AF_INET6; - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); + ifa = carp_best_ifa(AF_INET6, sc->sc_carpdev); if (ifa != NULL) { bcopy(IFA_IN6(ifa), &ip6->ip6_src, sizeof(struct in6_addr)); From owner-svn-src-all@freebsd.org Thu Jan 19 23:42:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30335CB8DD3; Thu, 19 Jan 2017 23:42:53 +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 F3A411BDE; Thu, 19 Jan 2017 23:42:52 +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 v0JNgquw003697; Thu, 19 Jan 2017 23:42:52 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JNgq7d003696; Thu, 19 Jan 2017 23:42:52 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201701192342.v0JNgq7d003696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Thu, 19 Jan 2017 23:42: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: r312441 - 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: Thu, 19 Jan 2017 23:42:53 -0000 Author: rpokala Date: Thu Jan 19 23:42:51 2017 New Revision: 312441 URL: https://svnweb.freebsd.org/changeset/base/312441 Log: MFC r311963: Remove writability requirement for single-mbuf, contiguous- range m_pulldown() m_pulldown() only needs to determine if a mbuf is writable if it is going to copy data into the data region of an existing mbuf. It does this to create a contiguous data region in a single mbuf from multiple mbufs in the chain. If the requested memory region is already contiguous and nothing needs to change, the mbuf does not need to be writeable. Modified: stable/11/sys/kern/uipc_mbuf2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_mbuf2.c ============================================================================== --- stable/11/sys/kern/uipc_mbuf2.c Thu Jan 19 23:42:26 2017 (r312440) +++ stable/11/sys/kern/uipc_mbuf2.c Thu Jan 19 23:42:51 2017 (r312441) @@ -159,7 +159,7 @@ m_pulldown(struct mbuf *m, int off, int * the target data is on . * if we got enough data on the mbuf "n", we're done. */ - if ((off == 0 || offp) && len <= n->m_len - off && writable) + if ((off == 0 || offp) && len <= n->m_len - off) goto ok; /* From owner-svn-src-all@freebsd.org Thu Jan 19 23:44:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18353CB8E85; Thu, 19 Jan 2017 23:44:07 +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 D98D31D4C; Thu, 19 Jan 2017 23:44:06 +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 v0JNi5jk003806; Thu, 19 Jan 2017 23:44:05 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JNi5qQ003805; Thu, 19 Jan 2017 23:44:05 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201701192344.v0JNi5qQ003805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Thu, 19 Jan 2017 23:44: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: r312442 - 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: Thu, 19 Jan 2017 23:44:07 -0000 Author: rpokala Date: Thu Jan 19 23:44:05 2017 New Revision: 312442 URL: https://svnweb.freebsd.org/changeset/base/312442 Log: MFC r311963: Remove writability requirement for single-mbuf, contiguous- range m_pulldown() m_pulldown() only needs to determine if a mbuf is writable if it is going to copy data into the data region of an existing mbuf. It does this to create a contiguous data region in a single mbuf from multiple mbufs in the chain. If the requested memory region is already contiguous and nothing needs to change, the mbuf does not need to be writeable. Modified: stable/10/sys/kern/uipc_mbuf2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_mbuf2.c ============================================================================== --- stable/10/sys/kern/uipc_mbuf2.c Thu Jan 19 23:42:51 2017 (r312441) +++ stable/10/sys/kern/uipc_mbuf2.c Thu Jan 19 23:44:05 2017 (r312442) @@ -161,7 +161,7 @@ m_pulldown(struct mbuf *m, int off, int * the target data is on . * if we got enough data on the mbuf "n", we're done. */ - if ((off == 0 || offp) && len <= n->m_len - off && writable) + if ((off == 0 || offp) && len <= n->m_len - off) goto ok; /* From owner-svn-src-all@freebsd.org Thu Jan 19 23:57:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 404B4CB887E; Thu, 19 Jan 2017 23:57:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B41316A6; Thu, 19 Jan 2017 23:57:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v0JNv1Dr070739 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Jan 2017 15:57:01 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v0JNv1BI070738; Thu, 19 Jan 2017 15:57:01 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 19 Jan 2017 15:57:00 -0800 From: Gleb Smirnoff To: Josh Paetzel Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r312439 - stable/11/sys/netinet Message-ID: <20170119235700.GM2611@FreeBSD.org> References: <201701192338.v0JNcVM5099732@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701192338.v0JNcVM5099732@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 19 Jan 2017 23:57:03 -0000 Josh, did you notice my reply to the original commit?! On Thu, Jan 19, 2017 at 11:38:31PM +0000, Josh Paetzel wrote: J> Author: jpaetzel J> Date: Thu Jan 19 23:38:31 2017 J> New Revision: 312439 J> URL: https://svnweb.freebsd.org/changeset/base/312439 J> J> Log: J> MFC 310847 310864 J> J> Harden CARP against network loops. J> J> If there is a loop in the network a CARP that is in MASTER state will see it's J> own broadcasts, which will then cause it to assume BACKUP state. When it J> assumes BACKUP it will stop sending advertisements. In that state it will no J> longer see advertisements and will assume MASTER... J> J> We can't catch all the cases where we are seeing our own CARP broadcast, but J> we can catch the obvious case. J> J> Unbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all IPv6 J> structs under the INET6 #ifdef. Similarly (even though it doesn't seem J> to affect the build), conditionalize all IPv4 structs under the INET J> #ifdef J> J> This also unbreaks the LINT-NOINET6 tinderbox target on amd64; I have not J> verified other MACHINE/TARGET pairs (e.g. armv6/arm). J> J> Submitted by: torek J> Obtained from: FreeNAS J> Pointyhat fix: ngie J> J> Modified: J> stable/11/sys/netinet/ip_carp.c J> Directory Properties: J> stable/11/ (props changed) J> J> Modified: stable/11/sys/netinet/ip_carp.c J> ============================================================================== J> --- stable/11/sys/netinet/ip_carp.c Thu Jan 19 22:07:21 2017 (r312438) J> +++ stable/11/sys/netinet/ip_carp.c Thu Jan 19 23:38:31 2017 (r312439) J> @@ -581,27 +581,96 @@ carp6_input(struct mbuf **mp, int *offp, J> } J> #endif /* INET6 */ J> J> +/* J> + * This routine should not be necessary at all, but some switches J> + * (VMWare ESX vswitches) can echo our own packets back at us, J> + * and we must ignore them or they will cause us to drop out of J> + * MASTER mode. J> + * J> + * We cannot catch all cases of network loops. Instead, what we J> + * do here is catch any packet that arrives with a carp header J> + * with a VHID of 0, that comes from an address that is our own. J> + * These packets are by definition "from us" (even if they are from J> + * a misconfigured host that is pretending to be us). J> + * J> + * The VHID test is outside this mini-function. J> + */ J> +static int J> +carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af) J> +{ J> +#ifdef INET J> + struct ip *ip4; J> + struct in_addr in4; J> +#endif J> +#ifdef INET6 J> + struct ip6_hdr *ip6; J> + struct in6_addr in6; J> +#endif J> + J> + switch (af) { J> +#ifdef INET J> + case AF_INET: J> + ip4 = mtod(m, struct ip *); J> + in4 = ifatoia(ifa)->ia_addr.sin_addr; J> + return (in4.s_addr == ip4->ip_src.s_addr); J> +#endif J> +#ifdef INET6 J> + case AF_INET6: J> + ip6 = mtod(m, struct ip6_hdr *); J> + in6 = ifatoia6(ifa)->ia_addr.sin6_addr; J> + return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0); J> +#endif J> + default: J> + break; J> + } J> + return (0); J> +} J> + J> static void J> carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) J> { J> struct ifnet *ifp = m->m_pkthdr.rcvif; J> - struct ifaddr *ifa; J> + struct ifaddr *ifa, *match; J> struct carp_softc *sc; J> uint64_t tmp_counter; J> struct timeval sc_tv, ch_tv; J> + int error; J> J> - /* verify that the VHID is valid on the receiving interface */ J> + /* J> + * Verify that the VHID is valid on the receiving interface. J> + * J> + * There should be just one match. If there are none J> + * the VHID is not valid and we drop the packet. If J> + * there are multiple VHID matches, take just the first J> + * one, for compatibility with previous code. While we're J> + * scanning, check for obvious loops in the network topology J> + * (these should never happen, and as noted above, we may J> + * miss real loops; this is just a double-check). J> + */ J> IF_ADDR_RLOCK(ifp); J> - IFNET_FOREACH_IFA(ifp, ifa) J> - if (ifa->ifa_addr->sa_family == af && J> - ifa->ifa_carp->sc_vhid == ch->carp_vhid) { J> - ifa_ref(ifa); J> - break; J> - } J> + error = 0; J> + match = NULL; J> + IFNET_FOREACH_IFA(ifp, ifa) { J> + if (match == NULL && ifa->ifa_carp != NULL && J> + ifa->ifa_addr->sa_family == af && J> + ifa->ifa_carp->sc_vhid == ch->carp_vhid) J> + match = ifa; J> + if (ch->carp_vhid == 0 && carp_source_is_self(m, ifa, af)) J> + error = ELOOP; J> + } J> + ifa = error ? NULL : match; J> + if (ifa != NULL) J> + ifa_ref(ifa); J> IF_ADDR_RUNLOCK(ifp); J> J> if (ifa == NULL) { J> - CARPSTATS_INC(carps_badvhid); J> + if (error == ELOOP) { J> + CARP_DEBUG("dropping looped packet on interface %s\n", J> + ifp->if_xname); J> + CARPSTATS_INC(carps_badif); /* ??? */ J> + } else { J> + CARPSTATS_INC(carps_badvhid); J> + } J> m_freem(m); J> return; J> } J> @@ -787,12 +856,41 @@ carp_send_ad_error(struct carp_softc *sc J> } J> } J> J> +/* J> + * Pick the best ifaddr on the given ifp for sending CARP J> + * advertisements. J> + * J> + * "Best" here is defined by ifa_preferred(). This function is much J> + * much like ifaof_ifpforaddr() except that we just use ifa_preferred(). J> + * J> + * (This could be simplified to return the actual address, except that J> + * it has a different format in AF_INET and AF_INET6.) J> + */ J> +static struct ifaddr * J> +carp_best_ifa(int af, struct ifnet *ifp) J> +{ J> + struct ifaddr *ifa, *best; J> + J> + if (af >= AF_MAX) J> + return (NULL); J> + best = NULL; J> + IF_ADDR_RLOCK(ifp); J> + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { J> + if (ifa->ifa_addr->sa_family == af && J> + (best == NULL || ifa_preferred(best, ifa))) J> + best = ifa; J> + } J> + IF_ADDR_RUNLOCK(ifp); J> + if (best != NULL) J> + ifa_ref(best); J> + return (best); J> +} J> + J> static void J> carp_send_ad_locked(struct carp_softc *sc) J> { J> struct carp_header ch; J> struct timeval tv; J> - struct sockaddr sa; J> struct ifaddr *ifa; J> struct carp_header *ch_ptr; J> struct mbuf *m; J> @@ -841,9 +939,7 @@ carp_send_ad_locked(struct carp_softc *s J> ip->ip_sum = 0; J> ip_fillid(ip); J> J> - bzero(&sa, sizeof(sa)); J> - sa.sa_family = AF_INET; J> - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); J> + ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); J> if (ifa != NULL) { J> ip->ip_src.s_addr = J> ifatoia(ifa)->ia_addr.sin_addr.s_addr; J> @@ -887,11 +983,9 @@ carp_send_ad_locked(struct carp_softc *s J> ip6->ip6_vfc |= IPV6_VERSION; J> ip6->ip6_hlim = CARP_DFLTTL; J> ip6->ip6_nxt = IPPROTO_CARP; J> - bzero(&sa, sizeof(sa)); J> J> /* set the source address */ J> - sa.sa_family = AF_INET6; J> - ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); J> + ifa = carp_best_ifa(AF_INET6, sc->sc_carpdev); J> if (ifa != NULL) { J> bcopy(IFA_IN6(ifa), &ip6->ip6_src, J> sizeof(struct in6_addr)); J> _______________________________________________ J> svn-src-all@freebsd.org mailing list J> https://lists.freebsd.org/mailman/listinfo/svn-src-all J> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Fri Jan 20 00:02:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F399CB8CAE; Fri, 20 Jan 2017 00:02:13 +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 017CB1A94; Fri, 20 Jan 2017 00:02:12 +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 v0K02CVV011787; Fri, 20 Jan 2017 00:02:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K02BhI011784; Fri, 20 Jan 2017 00:02:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701200002.v0K02BhI011784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 20 Jan 2017 00:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312443 - in head/sys: conf 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, 20 Jan 2017 00:02:13 -0000 Author: pfg Date: Fri Jan 20 00:02:11 2017 New Revision: 312443 URL: https://svnweb.freebsd.org/changeset/base/312443 Log: mppc - Finish pluging NETGRAPH_MPPC_COMPRESSION. There were several places where reference to compression were left unfinished. Furthermore, KASSERTs contained references to MPPC_INVALID which is not defined in the tree and therefore were sure to break with INVARIANTS: comment them out. Reported by: Eugene Grosbein PR: 216265 MFC after: 3 days Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/netgraph/ng_mppc.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Jan 19 23:44:05 2017 (r312442) +++ head/sys/conf/NOTES Fri Jan 20 00:02:11 2017 (r312443) @@ -774,8 +774,7 @@ options NETGRAPH_IPFW options NETGRAPH_KSOCKET options NETGRAPH_L2TP options NETGRAPH_LMI -# MPPC compression requires proprietary files (not included) -#options NETGRAPH_MPPC_COMPRESSION +options NETGRAPH_MPPC_COMPRESSION options NETGRAPH_MPPC_ENCRYPTION options NETGRAPH_NETFLOW options NETGRAPH_NAT Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Jan 19 23:44:05 2017 (r312442) +++ head/sys/conf/options Fri Jan 20 00:02:11 2017 (r312443) @@ -517,7 +517,6 @@ NETGRAPH_IPFW opt_netgraph.h NETGRAPH_KSOCKET opt_netgraph.h NETGRAPH_L2TP opt_netgraph.h NETGRAPH_LMI opt_netgraph.h -# MPPC compression requires proprietary files (not included) NETGRAPH_MPPC_COMPRESSION opt_netgraph.h NETGRAPH_MPPC_ENCRYPTION opt_netgraph.h NETGRAPH_NAT opt_netgraph.h Modified: head/sys/netgraph/ng_mppc.c ============================================================================== --- head/sys/netgraph/ng_mppc.c Thu Jan 19 23:44:05 2017 (r312442) +++ head/sys/netgraph/ng_mppc.c Fri Jan 20 00:02:11 2017 (r312443) @@ -66,7 +66,7 @@ #if !defined(NETGRAPH_MPPC_COMPRESSION) && !defined(NETGRAPH_MPPC_ENCRYPTION) #ifdef KLD_MODULE -/* XXX NETGRAPH_MPPC_COMPRESSION isn't functional yet */ +#define NETGRAPH_MPPC_COMPRESSION #define NETGRAPH_MPPC_ENCRYPTION #else /* This case is indicative of an error in sys/conf files */ @@ -81,7 +81,6 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, "n #endif #ifdef NETGRAPH_MPPC_COMPRESSION -/* XXX this file doesn't exist yet, but hopefully someday it will... */ #include #endif #ifdef NETGRAPH_MPPC_ENCRYPTION @@ -543,7 +542,7 @@ err1: &destCnt, d->history, flags, 0); /* Check return value */ - KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); + /* KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); */ if ((rtn & MPPC_EXPANDED) == 0 && (rtn & MPPC_COMP_OK) == MPPC_COMP_OK) { outlen -= destCnt; @@ -805,7 +804,7 @@ failed: &sourceCnt, &destCnt, d->history, flags); /* Check return value */ - KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); + /* KASSERT(rtn != MPPC_INVALID, ("%s: invalid", __func__)); */ if ((rtn & MPPC_DEST_EXHAUSTED) != 0 || (rtn & MPPC_DECOMP_OK) != MPPC_DECOMP_OK) { log(LOG_ERR, "%s: decomp returned 0x%x", From owner-svn-src-all@freebsd.org Fri Jan 20 00:11:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 535B1CB53BC; Fri, 20 Jan 2017 00:11:40 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13FD3147D; Fri, 20 Jan 2017 00:11:40 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1cUMnp-00005c-66; Fri, 20 Jan 2017 03:11:37 +0300 Date: Fri, 20 Jan 2017 03:11:37 +0300 From: Slawa Olhovchenkov To: Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312437 - in head/sys/dev: mpr mps Message-ID: <20170120001136.GG58505@zxy.spb.ru> References: <201701192147.v0JLlpp3054889@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701192147.v0JLlpp3054889@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2017 00:11:40 -0000 On Thu, Jan 19, 2017 at 09:47:51PM +0000, Scott Long wrote: > Author: scottl > Date: Thu Jan 19 21:47:50 2017 > New Revision: 312437 > URL: https://svnweb.freebsd.org/changeset/base/312437 > > Log: > Rework the debug print API. Event printing no longer gets special handling. > All of the printing from the tables file now has wrappers so that the > handling is cleaner and it's possible to print something out (say, during > development) without having to fight the global debug flags. This re-org > will also make it easier to have the tables be compiled out at build time > if desired. > > Other than fixing some minor bugs, there are no user-visible changes from > this change Can you also do "atomics" print? Now debugs interleave w/ other outputs and line can split multiple times. From owner-svn-src-all@freebsd.org Fri Jan 20 00:15:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61F6DCB5689; Fri, 20 Jan 2017 00:15:12 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2338F1865; Fri, 20 Jan 2017 00:15:12 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0K0FBbk016413; Fri, 20 Jan 2017 00:15:11 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K0FBqA016412; Fri, 20 Jan 2017 00:15:11 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201701200015.v0K0FBqA016412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 20 Jan 2017 00:15: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: r312444 - stable/10/sys/netinet 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, 20 Jan 2017 00:15:12 -0000 Author: jpaetzel Date: Fri Jan 20 00:15:11 2017 New Revision: 312444 URL: https://svnweb.freebsd.org/changeset/base/312444 Log: Revert MFC of 310847 and 310864 Requested by glebius who had questions about the original head commit that I didn't see. Modified: stable/10/sys/netinet/ip_carp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/ip_carp.c ============================================================================== --- stable/10/sys/netinet/ip_carp.c Fri Jan 20 00:02:11 2017 (r312443) +++ stable/10/sys/netinet/ip_carp.c Fri Jan 20 00:15:11 2017 (r312444) @@ -573,96 +573,27 @@ carp6_input(struct mbuf **mp, int *offp, } #endif /* INET6 */ -/* - * This routine should not be necessary at all, but some switches - * (VMWare ESX vswitches) can echo our own packets back at us, - * and we must ignore them or they will cause us to drop out of - * MASTER mode. - * - * We cannot catch all cases of network loops. Instead, what we - * do here is catch any packet that arrives with a carp header - * with a VHID of 0, that comes from an address that is our own. - * These packets are by definition "from us" (even if they are from - * a misconfigured host that is pretending to be us). - * - * The VHID test is outside this mini-function. - */ -static int -carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af) -{ -#ifdef INET - struct ip *ip4; - struct in_addr in4; -#endif -#ifdef INET6 - struct ip6_hdr *ip6; - struct in6_addr in6; -#endif - - switch (af) { -#ifdef INET - case AF_INET: - ip4 = mtod(m, struct ip *); - in4 = ifatoia(ifa)->ia_addr.sin_addr; - return (in4.s_addr == ip4->ip_src.s_addr); -#endif -#ifdef INET6 - case AF_INET6: - ip6 = mtod(m, struct ip6_hdr *); - in6 = ifatoia6(ifa)->ia_addr.sin6_addr; - return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0); -#endif - default: - break; - } - return (0); -} - static void carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) { struct ifnet *ifp = m->m_pkthdr.rcvif; - struct ifaddr *ifa, *match; + struct ifaddr *ifa; struct carp_softc *sc; uint64_t tmp_counter; struct timeval sc_tv, ch_tv; - int error; - /* - * Verify that the VHID is valid on the receiving interface. - * - * There should be just one match. If there are none - * the VHID is not valid and we drop the packet. If - * there are multiple VHID matches, take just the first - * one, for compatibility with previous code. While we're - * scanning, check for obvious loops in the network topology - * (these should never happen, and as noted above, we may - * miss real loops; this is just a double-check). - */ + /* verify that the VHID is valid on the receiving interface */ IF_ADDR_RLOCK(ifp); - error = 0; - match = NULL; - IFNET_FOREACH_IFA(ifp, ifa) { - if (match == NULL && ifa->ifa_carp != NULL && - ifa->ifa_addr->sa_family == af && - ifa->ifa_carp->sc_vhid == ch->carp_vhid) - match = ifa; - if (ch->carp_vhid == 0 && carp_source_is_self(m, ifa, af)) - error = ELOOP; - } - ifa = error ? NULL : match; - if (ifa != NULL) - ifa_ref(ifa); + IFNET_FOREACH_IFA(ifp, ifa) + if (ifa->ifa_addr->sa_family == af && + ifa->ifa_carp->sc_vhid == ch->carp_vhid) { + ifa_ref(ifa); + break; + } IF_ADDR_RUNLOCK(ifp); if (ifa == NULL) { - if (error == ELOOP) { - CARP_DEBUG("dropping looped packet on interface %s\n", - ifp->if_xname); - CARPSTATS_INC(carps_badif); /* ??? */ - } else { - CARPSTATS_INC(carps_badvhid); - } + CARPSTATS_INC(carps_badvhid); m_freem(m); return; } @@ -858,41 +789,12 @@ carp_send_ad_error(struct carp_softc *sc } } -/* - * Pick the best ifaddr on the given ifp for sending CARP - * advertisements. - * - * "Best" here is defined by ifa_preferred(). This function is much - * much like ifaof_ifpforaddr() except that we just use ifa_preferred(). - * - * (This could be simplified to return the actual address, except that - * it has a different format in AF_INET and AF_INET6.) - */ -static struct ifaddr * -carp_best_ifa(int af, struct ifnet *ifp) -{ - struct ifaddr *ifa, *best; - - if (af >= AF_MAX) - return (NULL); - best = NULL; - IF_ADDR_RLOCK(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family == af && - (best == NULL || ifa_preferred(best, ifa))) - best = ifa; - } - IF_ADDR_RUNLOCK(ifp); - if (best != NULL) - ifa_ref(best); - return (best); -} - static void carp_send_ad_locked(struct carp_softc *sc) { struct carp_header ch; struct timeval tv; + struct sockaddr sa; struct ifaddr *ifa; struct carp_header *ch_ptr; struct mbuf *m; @@ -941,7 +843,9 @@ carp_send_ad_locked(struct carp_softc *s ip->ip_p = IPPROTO_CARP; ip->ip_sum = 0; - ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); + bzero(&sa, sizeof(sa)); + sa.sa_family = AF_INET; + ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); if (ifa != NULL) { ip->ip_src.s_addr = ifatoia(ifa)->ia_addr.sin_addr.s_addr; @@ -985,9 +889,11 @@ carp_send_ad_locked(struct carp_softc *s ip6->ip6_vfc |= IPV6_VERSION; ip6->ip6_hlim = CARP_DFLTTL; ip6->ip6_nxt = IPPROTO_CARP; + bzero(&sa, sizeof(sa)); /* set the source address */ - ifa = carp_best_ifa(AF_INET6, sc->sc_carpdev); + sa.sa_family = AF_INET6; + ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); if (ifa != NULL) { bcopy(IFA_IN6(ifa), &ip6->ip6_src, sizeof(struct in6_addr)); From owner-svn-src-all@freebsd.org Fri Jan 20 00:17:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CB94CB57BF; Fri, 20 Jan 2017 00:17:55 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B85BB1AF4; Fri, 20 Jan 2017 00:17:54 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0K0Hrgk016685; Fri, 20 Jan 2017 00:17:53 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K0Hr4t016684; Fri, 20 Jan 2017 00:17:53 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201701200017.v0K0Hr4t016684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 20 Jan 2017 00:17:53 +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: r312445 - stable/11/sys/netinet 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, 20 Jan 2017 00:17:55 -0000 Author: jpaetzel Date: Fri Jan 20 00:17:53 2017 New Revision: 312445 URL: https://svnweb.freebsd.org/changeset/base/312445 Log: Revert MFC of 310847 and 310864 Requested by glebius who had questions about the original head commit that I didn't see. Modified: stable/11/sys/netinet/ip_carp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_carp.c ============================================================================== --- stable/11/sys/netinet/ip_carp.c Fri Jan 20 00:15:11 2017 (r312444) +++ stable/11/sys/netinet/ip_carp.c Fri Jan 20 00:17:53 2017 (r312445) @@ -581,96 +581,27 @@ carp6_input(struct mbuf **mp, int *offp, } #endif /* INET6 */ -/* - * This routine should not be necessary at all, but some switches - * (VMWare ESX vswitches) can echo our own packets back at us, - * and we must ignore them or they will cause us to drop out of - * MASTER mode. - * - * We cannot catch all cases of network loops. Instead, what we - * do here is catch any packet that arrives with a carp header - * with a VHID of 0, that comes from an address that is our own. - * These packets are by definition "from us" (even if they are from - * a misconfigured host that is pretending to be us). - * - * The VHID test is outside this mini-function. - */ -static int -carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af) -{ -#ifdef INET - struct ip *ip4; - struct in_addr in4; -#endif -#ifdef INET6 - struct ip6_hdr *ip6; - struct in6_addr in6; -#endif - - switch (af) { -#ifdef INET - case AF_INET: - ip4 = mtod(m, struct ip *); - in4 = ifatoia(ifa)->ia_addr.sin_addr; - return (in4.s_addr == ip4->ip_src.s_addr); -#endif -#ifdef INET6 - case AF_INET6: - ip6 = mtod(m, struct ip6_hdr *); - in6 = ifatoia6(ifa)->ia_addr.sin6_addr; - return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0); -#endif - default: - break; - } - return (0); -} - static void carp_input_c(struct mbuf *m, struct carp_header *ch, sa_family_t af) { struct ifnet *ifp = m->m_pkthdr.rcvif; - struct ifaddr *ifa, *match; + struct ifaddr *ifa; struct carp_softc *sc; uint64_t tmp_counter; struct timeval sc_tv, ch_tv; - int error; - /* - * Verify that the VHID is valid on the receiving interface. - * - * There should be just one match. If there are none - * the VHID is not valid and we drop the packet. If - * there are multiple VHID matches, take just the first - * one, for compatibility with previous code. While we're - * scanning, check for obvious loops in the network topology - * (these should never happen, and as noted above, we may - * miss real loops; this is just a double-check). - */ + /* verify that the VHID is valid on the receiving interface */ IF_ADDR_RLOCK(ifp); - error = 0; - match = NULL; - IFNET_FOREACH_IFA(ifp, ifa) { - if (match == NULL && ifa->ifa_carp != NULL && - ifa->ifa_addr->sa_family == af && - ifa->ifa_carp->sc_vhid == ch->carp_vhid) - match = ifa; - if (ch->carp_vhid == 0 && carp_source_is_self(m, ifa, af)) - error = ELOOP; - } - ifa = error ? NULL : match; - if (ifa != NULL) - ifa_ref(ifa); + IFNET_FOREACH_IFA(ifp, ifa) + if (ifa->ifa_addr->sa_family == af && + ifa->ifa_carp->sc_vhid == ch->carp_vhid) { + ifa_ref(ifa); + break; + } IF_ADDR_RUNLOCK(ifp); if (ifa == NULL) { - if (error == ELOOP) { - CARP_DEBUG("dropping looped packet on interface %s\n", - ifp->if_xname); - CARPSTATS_INC(carps_badif); /* ??? */ - } else { - CARPSTATS_INC(carps_badvhid); - } + CARPSTATS_INC(carps_badvhid); m_freem(m); return; } @@ -856,41 +787,12 @@ carp_send_ad_error(struct carp_softc *sc } } -/* - * Pick the best ifaddr on the given ifp for sending CARP - * advertisements. - * - * "Best" here is defined by ifa_preferred(). This function is much - * much like ifaof_ifpforaddr() except that we just use ifa_preferred(). - * - * (This could be simplified to return the actual address, except that - * it has a different format in AF_INET and AF_INET6.) - */ -static struct ifaddr * -carp_best_ifa(int af, struct ifnet *ifp) -{ - struct ifaddr *ifa, *best; - - if (af >= AF_MAX) - return (NULL); - best = NULL; - IF_ADDR_RLOCK(ifp); - TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family == af && - (best == NULL || ifa_preferred(best, ifa))) - best = ifa; - } - IF_ADDR_RUNLOCK(ifp); - if (best != NULL) - ifa_ref(best); - return (best); -} - static void carp_send_ad_locked(struct carp_softc *sc) { struct carp_header ch; struct timeval tv; + struct sockaddr sa; struct ifaddr *ifa; struct carp_header *ch_ptr; struct mbuf *m; @@ -939,7 +841,9 @@ carp_send_ad_locked(struct carp_softc *s ip->ip_sum = 0; ip_fillid(ip); - ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); + bzero(&sa, sizeof(sa)); + sa.sa_family = AF_INET; + ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); if (ifa != NULL) { ip->ip_src.s_addr = ifatoia(ifa)->ia_addr.sin_addr.s_addr; @@ -983,9 +887,11 @@ carp_send_ad_locked(struct carp_softc *s ip6->ip6_vfc |= IPV6_VERSION; ip6->ip6_hlim = CARP_DFLTTL; ip6->ip6_nxt = IPPROTO_CARP; + bzero(&sa, sizeof(sa)); /* set the source address */ - ifa = carp_best_ifa(AF_INET6, sc->sc_carpdev); + sa.sa_family = AF_INET6; + ifa = ifaof_ifpforaddr(&sa, sc->sc_carpdev); if (ifa != NULL) { bcopy(IFA_IN6(ifa), &ip6->ip6_src, sizeof(struct in6_addr)); From owner-svn-src-all@freebsd.org Fri Jan 20 02:10:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7AB1CB75E3; Fri, 20 Jan 2017 02:10:00 +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 7902C1E37; Fri, 20 Jan 2017 02:10:00 +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 v0K29xjw060832; Fri, 20 Jan 2017 02:09:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K29xu4060831; Fri, 20 Jan 2017 02:09:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701200209.v0K29xu4060831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 02:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312446 - head/lib/libc/stdtime 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, 20 Jan 2017 02:10:00 -0000 Author: emaste Date: Fri Jan 20 02:09:59 2017 New Revision: 312446 URL: https://svnweb.freebsd.org/changeset/base/312446 Log: libc: remove reference to nonexistent lib/locale directory As far as I can tell this was introduced in r72406 and updated in several subsequent revisions, but the lib/locale directory it referenced never existed. Reviewed by: ngie Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9252 Modified: head/lib/libc/stdtime/Makefile.inc Modified: head/lib/libc/stdtime/Makefile.inc ============================================================================== --- head/lib/libc/stdtime/Makefile.inc Fri Jan 20 00:17:53 2017 (r312445) +++ head/lib/libc/stdtime/Makefile.inc Fri Jan 20 02:09:59 2017 (r312446) @@ -1,8 +1,7 @@ # Makefile.inc,v 1.2 1994/09/13 21:26:01 wollman Exp # $FreeBSD$ -.PATH: ${LIBC_SRCTOP}/stdtime ${LIBC_SRCTOP}/../locale \ - ${LIBC_SRCTOP}/../../contrib/tzcode/stdtime +.PATH: ${LIBC_SRCTOP}/stdtime ${LIBC_SRCTOP}/../../contrib/tzcode/stdtime SRCS+= asctime.c difftime.c localtime.c strftime.c strptime.c timelocal.c \ time32.c From owner-svn-src-all@freebsd.org Fri Jan 20 02:46:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 983B4CB7F2C; Fri, 20 Jan 2017 02:46:16 +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 364A21EB7; Fri, 20 Jan 2017 02:46:16 +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 v0K2kF7M077001; Fri, 20 Jan 2017 02:46:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K2kEa2076991; Fri, 20 Jan 2017 02:46:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701200246.v0K2kEa2076991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 02:46: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: r312447 - in stable/11/contrib/llvm/projects/libunwind: include src 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, 20 Jan 2017 02:46:16 -0000 Author: emaste Date: Fri Jan 20 02:46:14 2017 New Revision: 312447 URL: https://svnweb.freebsd.org/changeset/base/312447 Log: MFC r308006: libunwind: consistently add \n to log and trace messages Previously most messages included a newline in the string, but a few of them were missing. Fix these and simplify by just adding the newline in the _LIBUNWIND_LOG macro itself. While here correct 'libuwind' typo (missing 'n'). Upstream LLVM libunwind commits r280086 and r280103. Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/llvm/projects/libunwind/include/libunwind.h stable/11/contrib/llvm/projects/libunwind/src/AddressSpace.hpp stable/11/contrib/llvm/projects/libunwind/src/CompactUnwinder.hpp stable/11/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp stable/11/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp stable/11/contrib/llvm/projects/libunwind/src/Unwind-sjlj.c stable/11/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1.c stable/11/contrib/llvm/projects/libunwind/src/config.h stable/11/contrib/llvm/projects/libunwind/src/libunwind.cpp Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/projects/libunwind/include/libunwind.h ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/include/libunwind.h Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/include/libunwind.h Fri Jan 20 02:46:14 2017 (r312447) @@ -6,7 +6,7 @@ // Source Licenses. See LICENSE.TXT for details. // // -// Compatible with libuwind API documented at: +// Compatible with libunwind API documented at: // http://www.nongnu.org/libunwind/man/libunwind(3).html // //===----------------------------------------------------------------------===// @@ -120,7 +120,7 @@ extern int unw_init_remote_thread(unw_cu #endif /* UNW_REMOTE */ /* - * traditional libuwind "remote" API + * traditional libunwind "remote" API * NOT IMPLEMENTED on Mac OS X * * extern int unw_init_remote(unw_cursor_t*, unw_addr_space_t, Modified: stable/11/contrib/llvm/projects/libunwind/src/AddressSpace.hpp ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/AddressSpace.hpp Fri Jan 20 02:46:14 2017 (r312447) @@ -374,7 +374,7 @@ inline bool LocalAddressSpace::findUnwin (_Unwind_Ptr) targetAddr, &length); info.arm_section_length = (uintptr_t)length; #endif - _LIBUNWIND_TRACE_UNWINDING("findUnwindSections: section %X length %x\n", + _LIBUNWIND_TRACE_UNWINDING("findUnwindSections: section %X length %x", info.arm_section, info.arm_section_length); if (info.arm_section && info.arm_section_length) return true; Modified: stable/11/contrib/llvm/projects/libunwind/src/CompactUnwinder.hpp ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/CompactUnwinder.hpp Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/CompactUnwinder.hpp Fri Jan 20 02:46:14 2017 (r312447) @@ -105,7 +105,7 @@ int CompactUnwinder_x86::stepWithComp default: (void)functionStart; _LIBUNWIND_DEBUG_LOG("bad register for EBP frame, encoding=%08X for " - "function starting at 0x%X\n", + "function starting at 0x%X", compactEncoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } @@ -224,7 +224,7 @@ int CompactUnwinder_x86::stepWithComp break; default: _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for " - "function starting at 0x%X\n", + "function starting at 0x%X", encoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } @@ -336,7 +336,7 @@ int CompactUnwinder_x86_64::stepWithC default: (void)functionStart; _LIBUNWIND_DEBUG_LOG("bad register for RBP frame, encoding=%08X for " - "function starting at 0x%llX\n", + "function starting at 0x%llX", compactEncoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } @@ -455,7 +455,7 @@ int CompactUnwinder_x86_64::stepWithC break; default: _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for " - "function starting at 0x%llX\n", + "function starting at 0x%llX", encoding, functionStart); _LIBUNWIND_ABORT("invalid compact unwind encoding"); } Modified: stable/11/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/EHHeaderParser.hpp Fri Jan 20 02:46:14 2017 (r312447) @@ -85,7 +85,7 @@ bool EHHeaderParser::decodeTableEntry const char *message = CFI_Parser::decodeFDE(addressSpace, fde, fdeInfo, cieInfo); if (message != NULL) { - _LIBUNWIND_DEBUG_LOG("EHHeaderParser::decodeTableEntry: bad fde: %s\n", + _LIBUNWIND_DEBUG_LOG("EHHeaderParser::decodeTableEntry: bad fde: %s", message); return false; } Modified: stable/11/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp Fri Jan 20 02:46:14 2017 (r312447) @@ -454,7 +454,7 @@ unwind_phase1(unw_context_t *uc, unw_cur unw_proc_info_t frameInfo; if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE1_ERROR\n", + "failed => _URC_FATAL_PHASE1_ERROR", static_cast(exception_object)); return _URC_FATAL_PHASE1_ERROR; } @@ -472,7 +472,7 @@ unwind_phase1(unw_context_t *uc, unw_cur unw_get_reg(cursor, UNW_REG_IP, &pc); _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): pc=0x%llX, start_ip=0x%llX, func=%s, " - "lsda=0x%llX, personality=0x%llX\n", + "lsda=0x%llX, personality=0x%llX", static_cast(exception_object), (long long)pc, (long long)frameInfo.start_ip, functionName, (long long)frameInfo.lsda, (long long)frameInfo.handler); @@ -484,7 +484,7 @@ unwind_phase1(unw_context_t *uc, unw_cur __personality_routine p = (__personality_routine)(long)(frameInfo.handler); _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): calling personality function %p\n", + "unwind_phase1(ex_ojb=%p): calling personality function %p", static_cast(exception_object), reinterpret_cast(reinterpret_cast(p))); struct _Unwind_Context *context = (struct _Unwind_Context *)(cursor); @@ -496,7 +496,7 @@ unwind_phase1(unw_context_t *uc, unw_cur (*p)(_US_VIRTUAL_UNWIND_FRAME, exception_object, context); _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): personality result %d start_ip %x ehtp %p " - "additional %x\n", + "additional %x", static_cast(exception_object), personalityResult, exception_object->pr_cache.fnstart, static_cast(exception_object->pr_cache.ehtp), @@ -508,13 +508,13 @@ unwind_phase1(unw_context_t *uc, unw_cur handlerNotFound = false; // p should have initialized barrier_cache. EHABI #7.3.5 _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND \n", + "unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND", static_cast(exception_object)); return _URC_NO_REASON; case _URC_CONTINUE_UNWIND: _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND", static_cast(exception_object)); // continue unwinding break; @@ -526,7 +526,7 @@ unwind_phase1(unw_context_t *uc, unw_cur default: // something went wrong _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR\n", + "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR", static_cast(exception_object)); return _URC_FATAL_PHASE1_ERROR; } @@ -541,13 +541,13 @@ static _Unwind_Reason_Code unwind_phase2 // See comment at the start of unwind_phase1 regarding VRS integrity. unw_init_local(cursor, uc); - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)\n", + _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)", static_cast(exception_object)); int frame_count = 0; // Walk each frame until we reach where search phase said to stop. while (true) { - // Ask libuwind to get next frame (skip over first which is + // Ask libunwind to get next frame (skip over first which is // _Unwind_RaiseException or _Unwind_Resume). // // Resume only ever makes sense for 1 frame. @@ -572,7 +572,7 @@ static _Unwind_Reason_Code unwind_phase2 unw_get_reg(cursor, UNW_REG_SP, &sp); if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE2_ERROR\n", + "failed => _URC_FATAL_PHASE2_ERROR", static_cast(exception_object)); return _URC_FATAL_PHASE2_ERROR; } @@ -588,7 +588,7 @@ static _Unwind_Reason_Code unwind_phase2 functionName = ".anonymous."; _LIBUNWIND_TRACE_UNWINDING( "unwind_phase2(ex_ojb=%p): start_ip=0x%llX, func=%s, sp=0x%llX, " - "lsda=0x%llX, personality=0x%llX\n", + "lsda=0x%llX, personality=0x%llX", static_cast(exception_object), (long long)frameInfo.start_ip, functionName, (long long)sp, (long long)frameInfo.lsda, (long long)frameInfo.handler); @@ -610,7 +610,7 @@ static _Unwind_Reason_Code unwind_phase2 case _URC_CONTINUE_UNWIND: // Continue unwinding _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND", static_cast(exception_object)); // EHABI #7.2 if (sp == exception_object->barrier_cache.sp) { @@ -621,7 +621,7 @@ static _Unwind_Reason_Code unwind_phase2 break; case _URC_INSTALL_CONTEXT: _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT\n", + "unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT", static_cast(exception_object)); // Personality routine says to transfer control to landing pad. // We may get control back if landing pad calls _Unwind_Resume(). @@ -630,7 +630,7 @@ static _Unwind_Reason_Code unwind_phase2 unw_get_reg(cursor, UNW_REG_IP, &pc); unw_get_reg(cursor, UNW_REG_SP, &sp); _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): re-entering " - "user code with ip=0x%llX, sp=0x%llX\n", + "user code with ip=0x%llX, sp=0x%llX", static_cast(exception_object), (long long)pc, (long long)sp); } @@ -668,7 +668,7 @@ static _Unwind_Reason_Code unwind_phase2 /// Called by __cxa_throw. Only returns if there is a fatal error. _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_RaiseException(ex_obj=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_RaiseException(ex_obj=%p)", static_cast(exception_object)); unw_context_t uc; unw_cursor_t cursor; @@ -706,7 +706,7 @@ _LIBUNWIND_EXPORT void _Unwind_Complete( /// in turn calls _Unwind_Resume_or_Rethrow(). _LIBUNWIND_EXPORT void _Unwind_Resume(_Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)", static_cast(exception_object)); unw_context_t uc; unw_cursor_t cursor; @@ -730,7 +730,7 @@ _Unwind_GetLanguageSpecificData(struct _ if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS) result = (uintptr_t)frameInfo.lsda; _LIBUNWIND_TRACE_API( - "_Unwind_GetLanguageSpecificData(context=%p) => 0x%llx\n", + "_Unwind_GetLanguageSpecificData(context=%p) => 0x%llx", static_cast(context), (long long)result); return result; } @@ -758,7 +758,7 @@ _Unwind_VRS_Set(_Unwind_Context *context uint32_t regno, _Unwind_VRS_DataRepresentation representation, void *valuep) { _LIBUNWIND_TRACE_API("_Unwind_VRS_Set(context=%p, regclass=%d, reg=%d, " - "rep=%d, value=0x%llX)\n", + "rep=%d, value=0x%llX)", static_cast(context), regclass, regno, representation, ValueAsBitPattern(representation, valuep)); @@ -863,7 +863,7 @@ _Unwind_VRS_Result _Unwind_VRS_Get( _Unwind_VRS_Get_Internal(context, regclass, regno, representation, valuep); _LIBUNWIND_TRACE_API("_Unwind_VRS_Get(context=%p, regclass=%d, reg=%d, " - "rep=%d, value=0x%llX, result = %d)\n", + "rep=%d, value=0x%llX, result = %d)", static_cast(context), regclass, regno, representation, ValueAsBitPattern(representation, valuep), result); @@ -875,7 +875,7 @@ _Unwind_VRS_Pop(_Unwind_Context *context uint32_t discriminator, _Unwind_VRS_DataRepresentation representation) { _LIBUNWIND_TRACE_API("_Unwind_VRS_Pop(context=%p, regclass=%d, " - "discriminator=%d, representation=%d)\n", + "discriminator=%d, representation=%d)", static_cast(context), regclass, discriminator, representation); switch (regclass) { @@ -948,7 +948,7 @@ _Unwind_GetRegionStart(struct _Unwind_Co uintptr_t result = 0; if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS) result = (uintptr_t)frameInfo.start_ip; - _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%llX\n", + _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%llX", static_cast(context), (long long)result); return result; } @@ -958,7 +958,7 @@ _Unwind_GetRegionStart(struct _Unwind_Co // is caught. _LIBUNWIND_EXPORT void _Unwind_DeleteException(_Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)", static_cast(exception_object)); if (exception_object->exception_cleanup != NULL) (*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT, Modified: stable/11/contrib/llvm/projects/libunwind/src/Unwind-sjlj.c ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/Unwind-sjlj.c Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/Unwind-sjlj.c Fri Jan 20 02:46:14 2017 (r312447) @@ -72,7 +72,7 @@ _Unwind_SjLj_Unregister(struct _Unwind_F static _Unwind_Reason_Code unwind_phase1(struct _Unwind_Exception *exception_object) { _Unwind_FunctionContext_t c = __Unwind_SjLj_GetTopOfFunctionStack(); - _LIBUNWIND_TRACE_UNWINDING("unwind_phase1: initial function-context=%p\n", c); + _LIBUNWIND_TRACE_UNWINDING("unwind_phase1: initial function-context=%p", c); // walk each frame looking for a place to stop for (bool handlerNotFound = true; handlerNotFound; c = c->prev) { @@ -80,17 +80,17 @@ unwind_phase1(struct _Unwind_Exception * // check for no more frames if (c == NULL) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): reached " - "bottom => _URC_END_OF_STACK\n", + "bottom => _URC_END_OF_STACK", exception_object); return _URC_END_OF_STACK; } - _LIBUNWIND_TRACE_UNWINDING("unwind_phase1: function-context=%p\n", c); + _LIBUNWIND_TRACE_UNWINDING("unwind_phase1: function-context=%p", c); // if there is a personality routine, ask it if it will want to stop at this // frame if (c->personality != NULL) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): calling " - "personality function %p\n", + "personality function %p", exception_object, c->personality); _Unwind_Reason_Code personalityResult = (*c->personality)( 1, _UA_SEARCH_PHASE, exception_object->exception_class, @@ -102,19 +102,19 @@ unwind_phase1(struct _Unwind_Exception * handlerNotFound = false; exception_object->private_2 = (uintptr_t) c; _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): " - "_URC_HANDLER_FOUND\n", exception_object); + "_URC_HANDLER_FOUND", exception_object); return _URC_NO_REASON; case _URC_CONTINUE_UNWIND: _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): " - "_URC_CONTINUE_UNWIND\n", exception_object); + "_URC_CONTINUE_UNWIND", exception_object); // continue unwinding break; default: // something went wrong _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR\n", + "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR", exception_object); return _URC_FATAL_PHASE1_ERROR; } @@ -126,18 +126,18 @@ unwind_phase1(struct _Unwind_Exception * static _Unwind_Reason_Code unwind_phase2(struct _Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)\n", exception_object); + _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)", exception_object); // walk each frame until we reach where search phase said to stop _Unwind_FunctionContext_t c = __Unwind_SjLj_GetTopOfFunctionStack(); while (true) { - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2s(ex_ojb=%p): context=%p\n", + _LIBUNWIND_TRACE_UNWINDING("unwind_phase2s(ex_ojb=%p): context=%p", exception_object, c); // check for no more frames if (c == NULL) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached " - "bottom => _URC_END_OF_STACK\n", + "bottom => _URC_END_OF_STACK", exception_object); return _URC_END_OF_STACK; } @@ -157,7 +157,7 @@ unwind_phase2(struct _Unwind_Exception * case _URC_CONTINUE_UNWIND: // continue unwinding _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND", exception_object); if ((uintptr_t) c == exception_object->private_2) { // phase 1 said we would stop at this frame, but we did not... @@ -168,7 +168,7 @@ unwind_phase2(struct _Unwind_Exception * case _URC_INSTALL_CONTEXT: _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): " "_URC_INSTALL_CONTEXT, will resume at " - "landing pad %p\n", + "landing pad %p", exception_object, c->jbuf[1]); // personality routine says to transfer control to landing pad // we may get control back if landing pad calls _Unwind_Resume() @@ -202,7 +202,7 @@ unwind_phase2_forced(struct _Unwind_Exce // get next frame (skip over first which is _Unwind_RaiseException) if (c == NULL) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached " - "bottom => _URC_END_OF_STACK\n", + "bottom => _URC_END_OF_STACK", exception_object); return _URC_END_OF_STACK; } @@ -214,11 +214,11 @@ unwind_phase2_forced(struct _Unwind_Exce (*stop)(1, action, exception_object->exception_class, exception_object, (struct _Unwind_Context *)c, stop_parameter); _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " - "stop function returned %d\n", + "stop function returned %d", exception_object, stopResult); if (stopResult != _URC_NO_REASON) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " - "stopped by stop function\n", + "stopped by stop function", exception_object); return _URC_FATAL_PHASE2_ERROR; } @@ -227,7 +227,7 @@ unwind_phase2_forced(struct _Unwind_Exce if (c->personality != NULL) { __personality_routine p = (__personality_routine) c->personality; _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " - "calling personality function %p\n", + "calling personality function %p", exception_object, p); _Unwind_Reason_Code personalityResult = (*p)(1, action, exception_object->exception_class, exception_object, @@ -235,13 +235,13 @@ unwind_phase2_forced(struct _Unwind_Exce switch (personalityResult) { case _URC_CONTINUE_UNWIND: _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " - "personality returned _URC_CONTINUE_UNWIND\n", + "personality returned _URC_CONTINUE_UNWIND", exception_object); // destructors called, continue unwinding break; case _URC_INSTALL_CONTEXT: _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " - "personality returned _URC_INSTALL_CONTEXT\n", + "personality returned _URC_INSTALL_CONTEXT", exception_object); // we may get control back if landing pad calls _Unwind_Resume() __Unwind_SjLj_SetTopOfFunctionStack(c); @@ -251,7 +251,7 @@ unwind_phase2_forced(struct _Unwind_Exce // something went wrong _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): " "personality returned %d, " - "_URC_FATAL_PHASE2_ERROR\n", + "_URC_FATAL_PHASE2_ERROR", exception_object, personalityResult); return _URC_FATAL_PHASE2_ERROR; } @@ -262,7 +262,7 @@ unwind_phase2_forced(struct _Unwind_Exce // call stop function one last time and tell it we've reached the end of the // stack _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): calling stop " - "function with _UA_END_OF_STACK\n", + "function with _UA_END_OF_STACK", exception_object); _Unwind_Action lastAction = (_Unwind_Action)(_UA_FORCE_UNWIND | _UA_CLEANUP_PHASE | _UA_END_OF_STACK); @@ -278,7 +278,7 @@ unwind_phase2_forced(struct _Unwind_Exce /// Called by __cxa_throw. Only returns if there is a fatal error _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_SjLj_RaiseException(struct _Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_SjLj_RaiseException(ex_obj=%p)\n", exception_object); + _LIBUNWIND_TRACE_API("_Unwind_SjLj_RaiseException(ex_obj=%p)", exception_object); // mark that this is a non-forced unwind, so _Unwind_Resume() can do the right // thing @@ -308,7 +308,7 @@ _Unwind_SjLj_RaiseException(struct _Unwi /// __cxa_rethrow() which in turn calls _Unwind_Resume_or_Rethrow() _LIBUNWIND_EXPORT void _Unwind_SjLj_Resume(struct _Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_SjLj_Resume(ex_obj=%p)\n", exception_object); + _LIBUNWIND_TRACE_API("_Unwind_SjLj_Resume(ex_obj=%p)", exception_object); if (exception_object->private_1 != 0) unwind_phase2_forced(exception_object, @@ -326,7 +326,7 @@ _Unwind_SjLj_Resume(struct _Unwind_Excep _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow(struct _Unwind_Exception *exception_object) { _LIBUNWIND_TRACE_API("__Unwind_SjLj_Resume_or_Rethrow(ex_obj=%p), " - "private_1=%ld\n", + "private_1=%ld", exception_object, exception_object->private_1); // If this is non-forced and a stopping place was found, then this is a // re-throw. @@ -350,7 +350,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; _LIBUNWIND_TRACE_API("_Unwind_GetLanguageSpecificData(context=%p) " - "=> 0x%0lX\n", context, ufc->lsda); + "=> 0x%0lX", context, ufc->lsda); return ufc->lsda; } @@ -358,7 +358,7 @@ _Unwind_GetLanguageSpecificData(struct _ /// Called by personality handler during phase 2 to get register values. _LIBUNWIND_EXPORT uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index) { - _LIBUNWIND_TRACE_API("_Unwind_GetGR(context=%p, reg=%d)\n", + _LIBUNWIND_TRACE_API("_Unwind_GetGR(context=%p, reg=%d)", context, index); _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; return ufc->resumeParameters[index]; @@ -368,7 +368,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetG /// Called by personality handler during phase 2 to alter register values. _LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index, uintptr_t new_value) { - _LIBUNWIND_TRACE_API("_Unwind_SetGR(context=%p, reg=%d, value=0x%0lX)\n" + _LIBUNWIND_TRACE_API("_Unwind_SetGR(context=%p, reg=%d, value=0x%0lX)" , context, index, new_value); _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; ufc->resumeParameters[index] = new_value; @@ -378,7 +378,7 @@ _LIBUNWIND_EXPORT void _Unwind_SetGR(str /// Called by personality handler during phase 2 to get instruction pointer. _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; - _LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%lX\n", context, + _LIBUNWIND_TRACE_API("_Unwind_GetIP(context=%p) => 0x%lX", context, ufc->resumeLocation + 1); return ufc->resumeLocation + 1; } @@ -391,7 +391,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetI int *ipBefore) { _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; *ipBefore = 0; - _LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p, %p) => 0x%lX\n", + _LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p, %p) => 0x%lX", context, ipBefore, ufc->resumeLocation + 1); return ufc->resumeLocation + 1; } @@ -400,7 +400,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetI /// Called by personality handler during phase 2 to alter instruction pointer. _LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context, uintptr_t new_value) { - _LIBUNWIND_TRACE_API("_Unwind_SetIP(context=%p, value=0x%0lX)\n", + _LIBUNWIND_TRACE_API("_Unwind_SetIP(context=%p, value=0x%0lX)", context, new_value); _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; ufc->resumeLocation = new_value - 1; @@ -413,7 +413,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context) { // Not supported or needed for sjlj based unwinding (void)context; - _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p)\n", context); + _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p)", context); return 0; } @@ -422,7 +422,7 @@ _Unwind_GetRegionStart(struct _Unwind_Co /// is caught. _LIBUNWIND_EXPORT void _Unwind_DeleteException(struct _Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)", exception_object); if (exception_object->exception_cleanup != NULL) (*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT, @@ -437,7 +437,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context) { // Not supported or needed for sjlj based unwinding (void)context; - _LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)\n", context); + _LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)", context); _LIBUNWIND_ABORT("_Unwind_GetDataRelBase() not implemented"); } @@ -448,14 +448,14 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *context) { // Not supported or needed for sjlj based unwinding (void)context; - _LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)\n", context); + _LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)", context); _LIBUNWIND_ABORT("_Unwind_GetTextRelBase() not implemented"); } /// Called by personality handler to get "Call Frame Area" for current frame. _LIBUNWIND_EXPORT uintptr_t _Unwind_GetCFA(struct _Unwind_Context *context) { - _LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p)\n", context); + _LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p)", context); if (context != NULL) { _Unwind_FunctionContext_t ufc = (_Unwind_FunctionContext_t) context; // Setjmp/longjmp based exceptions don't have a true CFA. Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindCursor.hpp Fri Jan 20 02:46:14 2017 (r312447) @@ -6,7 +6,7 @@ // Source Licenses. See LICENSE.TXT for details. // // -// C++ interface to lower levels of libuwind +// C++ interface to lower levels of libunwind //===----------------------------------------------------------------------===// #ifndef __UNWINDCURSOR_HPP__ @@ -935,7 +935,7 @@ bool UnwindCursor::getInfoFromDwar return true; } } - //_LIBUNWIND_DEBUG_LOG("can't find/use FDE for pc=0x%llX\n", (uint64_t)pc); + //_LIBUNWIND_DEBUG_LOG("can't find/use FDE for pc=0x%llX", (uint64_t)pc); return false; } #endif // _LIBUNWIND_SUPPORT_DWARF_UNWIND @@ -1092,13 +1092,13 @@ bool UnwindCursor::getInfoFromComp funcEnd = firstLevelNextPageFunctionOffset + sects.dso_base; if (pc < funcStart) { _LIBUNWIND_DEBUG_LOG("malformed __unwind_info, pc=0x%llX not in second " - "level compressed unwind table. funcStart=0x%llX\n", + "level compressed unwind table. funcStart=0x%llX", (uint64_t) pc, (uint64_t) funcStart); return false; } if (pc > funcEnd) { _LIBUNWIND_DEBUG_LOG("malformed __unwind_info, pc=0x%llX not in second " - "level compressed unwind table. funcEnd=0x%llX\n", + "level compressed unwind table. funcEnd=0x%llX", (uint64_t) pc, (uint64_t) funcEnd); return false; } @@ -1119,7 +1119,7 @@ bool UnwindCursor::getInfoFromComp } } else { _LIBUNWIND_DEBUG_LOG("malformed __unwind_info at 0x%0llX bad second " - "level page\n", + "level page", (uint64_t) sects.compact_unwind_section); return false; } @@ -1149,7 +1149,7 @@ bool UnwindCursor::getInfoFromComp } if (lsda == 0) { _LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with HAS_LSDA bit set for " - "pc=0x%0llX, but lsda table has no entry\n", + "pc=0x%0llX, but lsda table has no entry", encoding, (uint64_t) pc); return false; } @@ -1162,7 +1162,7 @@ bool UnwindCursor::getInfoFromComp --personalityIndex; // change 1-based to zero-based index if (personalityIndex > sectionHeader.personalityArrayCount()) { _LIBUNWIND_DEBUG_LOG("found encoding 0x%08X with personality index %d, " - "but personality table has only %d entires\n", + "but personality table has only %d entires", encoding, personalityIndex, sectionHeader.personalityArrayCount()); return false; Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c Fri Jan 20 02:46:14 2017 (r312447) @@ -29,11 +29,11 @@ _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) { #if _LIBUNWIND_ARM_EHABI - _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld\n", + _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld", (void *)exception_object, (long)exception_object->unwinder_cache.reserved1); #else - _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld\n", + _LIBUNWIND_TRACE_API("_Unwind_Resume_or_Rethrow(ex_obj=%p), private_1=%ld", (void *)exception_object, (long)exception_object->private_1); #endif @@ -66,7 +66,7 @@ _Unwind_Resume_or_Rethrow(_Unwind_Except _LIBUNWIND_EXPORT uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context) { (void)context; - _LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)\n", (void *)context); + _LIBUNWIND_TRACE_API("_Unwind_GetDataRelBase(context=%p)", (void *)context); _LIBUNWIND_ABORT("_Unwind_GetDataRelBase() not implemented"); } @@ -76,7 +76,7 @@ _Unwind_GetDataRelBase(struct _Unwind_Co _LIBUNWIND_EXPORT uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *context) { (void)context; - _LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)\n", (void *)context); + _LIBUNWIND_TRACE_API("_Unwind_GetTextRelBase(context=%p)", (void *)context); _LIBUNWIND_ABORT("_Unwind_GetTextRelBase() not implemented"); } @@ -84,7 +84,7 @@ _Unwind_GetTextRelBase(struct _Unwind_Co /// Scans unwind information to find the function that contains the /// specified code address "pc". _LIBUNWIND_EXPORT void *_Unwind_FindEnclosingFunction(void *pc) { - _LIBUNWIND_TRACE_API("_Unwind_FindEnclosingFunction(pc=%p)\n", pc); + _LIBUNWIND_TRACE_API("_Unwind_FindEnclosingFunction(pc=%p)", pc); // This is slow, but works. // We create an unwind cursor then alter the IP to be pc unw_cursor_t cursor; @@ -108,7 +108,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callb unw_getcontext(&uc); unw_init_local(&cursor, &uc); - _LIBUNWIND_TRACE_API("_Unwind_Backtrace(callback=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_Backtrace(callback=%p)", (void *)(uintptr_t)callback); #if _LIBUNWIND_ARM_EHABI @@ -123,11 +123,11 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callb _Unwind_Reason_Code result; #if !_LIBUNWIND_ARM_EHABI - // ask libuwind to get next frame (skip over first frame which is + // ask libunwind to get next frame (skip over first frame which is // _Unwind_Backtrace()) if (unw_step(&cursor) <= 0) { _LIBUNWIND_TRACE_UNWINDING(" _backtrace: ended because cursor reached " - "bottom of stack, returning %d\n", + "bottom of stack, returning %d", _URC_END_OF_STACK); return _URC_END_OF_STACK; } @@ -164,7 +164,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callb unw_get_proc_name(&cursor, functionName, 512, &offset); unw_get_proc_info(&cursor, &frame); _LIBUNWIND_TRACE_UNWINDING( - " _backtrace: start_ip=0x%llX, func=%s, lsda=0x%llX, context=%p\n", + " _backtrace: start_ip=0x%llX, func=%s, lsda=0x%llX, context=%p", (long long)frame.start_ip, functionName, (long long)frame.lsda, (void *)&cursor); } @@ -173,7 +173,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callb result = (*callback)((struct _Unwind_Context *)(&cursor), ref); if (result != _URC_NO_REASON) { _LIBUNWIND_TRACE_UNWINDING( - " _backtrace: ended because callback returned %d\n", result); + " _backtrace: ended because callback returned %d", result); return result; } } @@ -195,7 +195,7 @@ _LIBUNWIND_EXPORT const void *_Unwind_Fi bases->tbase = (uintptr_t)info.extra; bases->dbase = 0; // dbase not used on Mac OS X bases->func = (uintptr_t)info.start_ip; - _LIBUNWIND_TRACE_API("_Unwind_Find_FDE(pc=%p) => %p\n", pc, + _LIBUNWIND_TRACE_API("_Unwind_Find_FDE(pc=%p) => %p", pc, (void *)(long) info.unwind_info); return (void *)(long) info.unwind_info; } @@ -206,7 +206,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetC unw_cursor_t *cursor = (unw_cursor_t *)context; unw_word_t result; unw_get_reg(cursor, UNW_REG_SP, &result); - _LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p) => 0x%" PRIx64 "\n", + _LIBUNWIND_TRACE_API("_Unwind_GetCFA(context=%p) => 0x%" PRIx64, (void *)context, (uint64_t)result); return (uintptr_t)result; } @@ -217,7 +217,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetC /// site address. Normally IP is the return address. _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context, int *ipBefore) { - _LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p)\n", (void *)context); + _LIBUNWIND_TRACE_API("_Unwind_GetIPInfo(context=%p)", (void *)context); *ipBefore = 0; return _Unwind_GetIP(context); } @@ -229,7 +229,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetI /// This function has existed on Mac OS X since 10.4, but /// was broken until 10.6. _LIBUNWIND_EXPORT void __register_frame(const void *fde) { - _LIBUNWIND_TRACE_API("__register_frame(%p)\n", fde); + _LIBUNWIND_TRACE_API("__register_frame(%p)", fde); _unw_add_dynamic_fde((unw_word_t)(uintptr_t) fde); } @@ -239,7 +239,7 @@ _LIBUNWIND_EXPORT void __register_frame( /// This function has existed on Mac OS X since 10.4, but /// was broken until 10.6. _LIBUNWIND_EXPORT void __deregister_frame(const void *fde) { - _LIBUNWIND_TRACE_API("__deregister_frame(%p)\n", fde); + _LIBUNWIND_TRACE_API("__deregister_frame(%p)", fde); _unw_remove_dynamic_fde((unw_word_t)(uintptr_t) fde); } @@ -259,7 +259,7 @@ _LIBUNWIND_EXPORT void __register_frame_ (void)ob; (void)tb; (void)db; - _LIBUNWIND_TRACE_API("__register_frame_info_bases(%p,%p, %p, %p)\n", + _LIBUNWIND_TRACE_API("__register_frame_info_bases(%p,%p, %p, %p)", fde, ob, tb, db); // do nothing, this function never worked in Mac OS X } @@ -267,7 +267,7 @@ _LIBUNWIND_EXPORT void __register_frame_ _LIBUNWIND_EXPORT void __register_frame_info(const void *fde, void *ob) { (void)fde; (void)ob; - _LIBUNWIND_TRACE_API("__register_frame_info(%p, %p)\n", fde, ob); + _LIBUNWIND_TRACE_API("__register_frame_info(%p, %p)", fde, ob); // do nothing, this function never worked in Mac OS X } @@ -279,33 +279,33 @@ _LIBUNWIND_EXPORT void __register_frame_ (void)tb; (void)db; _LIBUNWIND_TRACE_API("__register_frame_info_table_bases" - "(%p,%p, %p, %p)\n", fde, ob, tb, db); + "(%p,%p, %p, %p)", fde, ob, tb, db); // do nothing, this function never worked in Mac OS X } _LIBUNWIND_EXPORT void __register_frame_info_table(const void *fde, void *ob) { (void)fde; (void)ob; - _LIBUNWIND_TRACE_API("__register_frame_info_table(%p, %p)\n", fde, ob); + _LIBUNWIND_TRACE_API("__register_frame_info_table(%p, %p)", fde, ob); // do nothing, this function never worked in Mac OS X } _LIBUNWIND_EXPORT void __register_frame_table(const void *fde) { (void)fde; - _LIBUNWIND_TRACE_API("__register_frame_table(%p)\n", fde); + _LIBUNWIND_TRACE_API("__register_frame_table(%p)", fde); // do nothing, this function never worked in Mac OS X } _LIBUNWIND_EXPORT void *__deregister_frame_info(const void *fde) { (void)fde; - _LIBUNWIND_TRACE_API("__deregister_frame_info(%p)\n", fde); + _LIBUNWIND_TRACE_API("__deregister_frame_info(%p)", fde); // do nothing, this function never worked in Mac OS X return NULL; } _LIBUNWIND_EXPORT void *__deregister_frame_info_bases(const void *fde) { (void)fde; - _LIBUNWIND_TRACE_API("__deregister_frame_info_bases(%p)\n", fde); + _LIBUNWIND_TRACE_API("__deregister_frame_info_bases(%p)", fde); // do nothing, this function never worked in Mac OS X return NULL; } Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1.c ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1.c Fri Jan 20 02:09:59 2017 (r312446) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1.c Fri Jan 20 02:46:14 2017 (r312447) @@ -39,17 +39,17 @@ unwind_phase1(unw_context_t *uc, unw_cur // Walk each frame looking for a place to stop. bool handlerNotFound = true; while (handlerNotFound) { - // Ask libuwind to get next frame (skip over first which is + // Ask libunwind to get next frame (skip over first which is // _Unwind_RaiseException). int stepResult = unw_step(cursor); if (stepResult == 0) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_step() reached " - "bottom => _URC_END_OF_STACK\n", + "bottom => _URC_END_OF_STACK", (void *)exception_object); return _URC_END_OF_STACK; } else if (stepResult < 0) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_step failed => " - "_URC_FATAL_PHASE1_ERROR\n", + "_URC_FATAL_PHASE1_ERROR", (void *)exception_object); return _URC_FATAL_PHASE1_ERROR; } @@ -59,7 +59,7 @@ unwind_phase1(unw_context_t *uc, unw_cur unw_word_t sp; if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE1_ERROR\n", + "failed => _URC_FATAL_PHASE1_ERROR", (void *)exception_object); return _URC_FATAL_PHASE1_ERROR; } @@ -77,7 +77,7 @@ unwind_phase1(unw_context_t *uc, unw_cur unw_get_reg(cursor, UNW_REG_IP, &pc); _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): pc=0x%" PRIx64 ", start_ip=0x%" PRIx64 - ", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "\n", + ", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "", (void *)exception_object, pc, frameInfo.start_ip, functionName, frameInfo.lsda, frameInfo.handler); } @@ -88,7 +88,7 @@ unwind_phase1(unw_context_t *uc, unw_cur __personality_routine p = (__personality_routine)(long)(frameInfo.handler); _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): calling personality function %p\n", + "unwind_phase1(ex_ojb=%p): calling personality function %p", (void *)exception_object, (void *)(uintptr_t)p); _Unwind_Reason_Code personalityResult = (*p)(1, _UA_SEARCH_PHASE, exception_object->exception_class, @@ -101,13 +101,13 @@ unwind_phase1(unw_context_t *uc, unw_cur unw_get_reg(cursor, UNW_REG_SP, &sp); exception_object->private_2 = (uintptr_t)sp; _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND \n", + "unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND", (void *)exception_object); return _URC_NO_REASON; case _URC_CONTINUE_UNWIND: _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND", (void *)exception_object); // continue unwinding break; @@ -115,7 +115,7 @@ unwind_phase1(unw_context_t *uc, unw_cur default: // something went wrong _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR\n", + "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR", (void *)exception_object); return _URC_FATAL_PHASE1_ERROR; } @@ -129,23 +129,23 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) { unw_init_local(cursor, uc); - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)\n", + _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)", (void *)exception_object); // Walk each frame until we reach where search phase said to stop. while (true) { - // Ask libuwind to get next frame (skip over first which is + // Ask libunwind to get next frame (skip over first which is // _Unwind_RaiseException). int stepResult = unw_step(cursor); if (stepResult == 0) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached " - "bottom => _URC_END_OF_STACK\n", + "bottom => _URC_END_OF_STACK", (void *)exception_object); return _URC_END_OF_STACK; } else if (stepResult < 0) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step failed => " - "_URC_FATAL_PHASE1_ERROR\n", + "_URC_FATAL_PHASE1_ERROR", (void *)exception_object); return _URC_FATAL_PHASE2_ERROR; } @@ -156,7 +156,7 @@ unwind_phase2(unw_context_t *uc, unw_cur unw_get_reg(cursor, UNW_REG_SP, &sp); if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE1_ERROR\n", + "failed => _URC_FATAL_PHASE1_ERROR", (void *)exception_object); return _URC_FATAL_PHASE2_ERROR; } @@ -172,7 +172,7 @@ unwind_phase2(unw_context_t *uc, unw_cur functionName = ".anonymous."; _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): start_ip=0x%" PRIx64 ", func=%s, sp=0x%" PRIx64 ", lsda=0x%" PRIx64 - ", personality=0x%" PRIx64 "\n", + ", personality=0x%" PRIx64, (void *)exception_object, frameInfo.start_ip, functionName, sp, frameInfo.lsda, frameInfo.handler); @@ -194,7 +194,7 @@ unwind_phase2(unw_context_t *uc, unw_cur case _URC_CONTINUE_UNWIND: // Continue unwinding _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND", (void *)exception_object); if (sp == exception_object->private_2) { // Phase 1 said we would stop at this frame, but we did not... @@ -204,7 +204,7 @@ unwind_phase2(unw_context_t *uc, unw_cur break; case _URC_INSTALL_CONTEXT: _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT\n", + "unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT", (void *)exception_object); // Personality routine says to transfer control to landing pad. // We may get control back if landing pad calls _Unwind_Resume(). @@ -214,7 +214,7 @@ unwind_phase2(unw_context_t *uc, unw_cur unw_get_reg(cursor, UNW_REG_SP, &sp); _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): re-entering " "user code with ip=0x%" PRIx64 - ", sp=0x%" PRIx64 "\n", + ", sp=0x%" PRIx64, (void *)exception_object, pc, sp); } unw_resume(cursor); @@ -247,7 +247,7 @@ unwind_phase2_forced(unw_context_t *uc, unw_proc_info_t frameInfo; if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2_forced(ex_ojb=%p): unw_step " - "failed => _URC_END_OF_STACK\n", + "failed => _URC_END_OF_STACK", (void *)exception_object); return _URC_FATAL_PHASE2_ERROR; } @@ -263,7 +263,7 @@ unwind_phase2_forced(unw_context_t *uc, functionName = ".anonymous."; _LIBUNWIND_TRACE_UNWINDING( "unwind_phase2_forced(ex_ojb=%p): start_ip=0x%" PRIx64 - ", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64 "\n", + ", func=%s, lsda=0x%" PRIx64 ", personality=0x%" PRIx64, (void *)exception_object, frameInfo.start_ip, functionName, frameInfo.lsda, frameInfo.handler); } @@ -275,11 +275,11 @@ unwind_phase2_forced(unw_context_t *uc, (*stop)(1, action, exception_object->exception_class, exception_object, (struct _Unwind_Context *)(cursor), stop_parameter); _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2_forced(ex_ojb=%p): stop function returned %d\n", + "unwind_phase2_forced(ex_ojb=%p): stop function returned %d", (void *)exception_object, stopResult); if (stopResult != _URC_NO_REASON) { _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2_forced(ex_ojb=%p): stopped by stop function\n", + "unwind_phase2_forced(ex_ojb=%p): stopped by stop function", (void *)exception_object); return _URC_FATAL_PHASE2_ERROR; } @@ -289,7 +289,7 @@ unwind_phase2_forced(unw_context_t *uc, __personality_routine p = (__personality_routine)(long)(frameInfo.handler); _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2_forced(ex_ojb=%p): calling personality function %p\n", + "unwind_phase2_forced(ex_ojb=%p): calling personality function %p", (void *)exception_object, (void *)(uintptr_t)p); _Unwind_Reason_Code personalityResult = (*p)(1, action, exception_object->exception_class, exception_object, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jan 20 02:48:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 246B1CB705D; Fri, 20 Jan 2017 02:48:54 +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 D98361152; Fri, 20 Jan 2017 02:48:53 +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 v0K2mq6f077268; Fri, 20 Jan 2017 02:48:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K2mqS4077267; Fri, 20 Jan 2017 02:48:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701200248.v0K2mqS4077267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 02:48: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: r312448 - stable/11/contrib/llvm/projects/libunwind/src 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, 20 Jan 2017 02:48:54 -0000 Author: emaste Date: Fri Jan 20 02:48:52 2017 New Revision: 312448 URL: https://svnweb.freebsd.org/changeset/base/312448 Log: MFC r310365: libunwind: make __{de,}register_frame compatible with libgcc API The libgcc __register_frame and __deregister_frame functions take a pointer to a set of FDE/CIEs, terminated by an entry where length is 0. In Apple's libunwind implementation the pointer is taken to be to a single FDE. I suspect this was just an Apple bug, compensated by Apple- specific code in LLVM. See lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp and http://lists.llvm.org/pipermail/llvm-dev/2013-April/061737.html for more detail. This change is based on the LLVM RTDyldMemoryManager.cpp. It should later be changed to be alignment-safe. Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c Fri Jan 20 02:46:14 2017 (r312447) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindLevel1-gcc-ext.c Fri Jan 20 02:48:52 2017 (r312448) @@ -224,6 +224,47 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetI #if _LIBUNWIND_SUPPORT_DWARF_UNWIND +#ifdef __FreeBSD__ + +// Based on LLVM's lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp +// and XXX should be fixed to be alignment-safe. +static void processFDE(const char *addr, bool isDeregister) { + uint64_t length; + while ((length = *((const uint32_t *)addr)) != 0) { + const char *p = addr + 4; + if (length == 0xffffffff) { + length = *((const uint64_t *)p); + p += 8; + } + uint32_t offset = *((const uint32_t *)p); + if (offset != 0) { + if (isDeregister) + _unw_remove_dynamic_fde((unw_word_t)(uintptr_t)addr); + else + _unw_add_dynamic_fde((unw_word_t)(uintptr_t)addr); + } + addr = p + length; + } +} + +/// Called by programs with dynamic code generators that want to register +/// dynamically generated FDEs, with a libgcc-compatible API. + +_LIBUNWIND_EXPORT void __register_frame(const void *addr) { + _LIBUNWIND_TRACE_API("__register_frame(%p)", addr); + processFDE(addr, false); +} + +/// Called by programs with dynamic code generators that want to unregister +/// dynamically generated FDEs, with a libgcc-compatible API. +_LIBUNWIND_EXPORT void __deregister_frame(const void *addr) { + _LIBUNWIND_TRACE_API("__deregister_frame(%p)", addr); + processFDE(addr, true); +} + + +#else + /// Called by programs with dynamic code generators that want /// to register a dynamically generated FDE. /// This function has existed on Mac OS X since 10.4, but @@ -243,6 +284,7 @@ _LIBUNWIND_EXPORT void __deregister_fram _unw_remove_dynamic_fde((unw_word_t)(uintptr_t) fde); } +#endif // The following register/deregister functions are gcc extensions. // They have existed on Mac OS X, but have never worked because Mac OS X From owner-svn-src-all@freebsd.org Fri Jan 20 02:50:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 848FFCB711A; Fri, 20 Jan 2017 02:50:25 +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 52A3012D9; Fri, 20 Jan 2017 02:50: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 v0K2oOq4077395; Fri, 20 Jan 2017 02:50:24 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K2oOhs077393; Fri, 20 Jan 2017 02:50:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701200250.v0K2oOhs077393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 02:50: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: r312449 - stable/11/contrib/llvm/projects/libunwind/src 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, 20 Jan 2017 02:50:25 -0000 Author: emaste Date: Fri Jan 20 02:50:24 2017 New Revision: 312449 URL: https://svnweb.freebsd.org/changeset/base/312449 Log: MFC r311647: libunwind: add noexec stack annotation Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Fri Jan 20 02:48:52 2017 (r312448) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Fri Jan 20 02:50:24 2017 (r312449) @@ -483,3 +483,5 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9li /* RISCVTODO */ #endif + + .section .note.GNU-stack,"",@progbits Modified: stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S ============================================================================== --- stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Fri Jan 20 02:48:52 2017 (r312448) +++ stable/11/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Fri Jan 20 02:50:24 2017 (r312449) @@ -469,3 +469,5 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext /* RISCVTODO */ #endif + + .section .note.GNU-stack,"",@progbits From owner-svn-src-all@freebsd.org Fri Jan 20 03:14:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 730F6CB7971; Fri, 20 Jan 2017 03:14:19 +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 42A151385; Fri, 20 Jan 2017 03:14:19 +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 v0K3EII5090513; Fri, 20 Jan 2017 03:14:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3EISc090512; Fri, 20 Jan 2017 03:14:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701200314.v0K3EISc090512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 03:14:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312450 - head/etc/mtree 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, 20 Jan 2017 03:14:19 -0000 Author: emaste Date: Fri Jan 20 03:14:18 2017 New Revision: 312450 URL: https://svnweb.freebsd.org/changeset/base/312450 Log: Remove obsolete /usr/lib/debug/usr/lib/private dir Missed in r282420 Reported by: dim Modified: head/etc/mtree/BSD.debug.dist Modified: head/etc/mtree/BSD.debug.dist ============================================================================== --- head/etc/mtree/BSD.debug.dist Fri Jan 20 02:50:24 2017 (r312449) +++ head/etc/mtree/BSD.debug.dist Fri Jan 20 03:14:18 2017 (r312450) @@ -40,8 +40,6 @@ .. i18n .. - private - .. .. libexec bsdinstall From owner-svn-src-all@freebsd.org Fri Jan 20 03:23:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20B37CB7C22; Fri, 20 Jan 2017 03:23:27 +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 D48301980; Fri, 20 Jan 2017 03:23: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 v0K3NPK3094427; Fri, 20 Jan 2017 03:23:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3NOBA094412; Fri, 20 Jan 2017 03:23:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200323.v0K3NOBA094412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:23:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312451 - in head/lib/libc: . aarch64/string arm/aeabi capability gdtoa gen iconv md posix1e regex/grot resolv stdlib/jemalloc stdtime string 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, 20 Jan 2017 03:23:27 -0000 Author: ngie Date: Fri Jan 20 03:23:24 2017 New Revision: 312451 URL: https://svnweb.freebsd.org/changeset/base/312451 Log: Replace dot-dot relative pathing with SRCTOP-relative paths where possible This reduces build output, need for recalculating paths, and makes it clearer which paths are relative to what areas in the source tree. The change in performance over a locally mounted UFS filesystem was negligible in my testing, but this may more positively impact other filesystems like NFS. LIBC_SRCTOP was left alone so Juniper (and other users) can continue to manipulate lib/libc/Makefile (and other Makefile.inc's under lib/libc) as include Makefiles with custom options. Discussed with: marcel, sjg MFC after: 1 week Reviewed by: emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9207 Modified: head/lib/libc/Makefile head/lib/libc/aarch64/string/Makefile.inc head/lib/libc/arm/aeabi/Makefile.inc head/lib/libc/capability/Makefile.inc head/lib/libc/gdtoa/Makefile.inc head/lib/libc/gen/Makefile.inc head/lib/libc/iconv/Makefile.inc head/lib/libc/md/Makefile.inc head/lib/libc/posix1e/Makefile.inc head/lib/libc/regex/grot/Makefile head/lib/libc/resolv/Makefile.inc head/lib/libc/stdlib/jemalloc/Makefile.inc head/lib/libc/stdtime/Makefile.inc head/lib/libc/string/Makefile.inc head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/Makefile Fri Jan 20 03:23:24 2017 (r312451) @@ -36,7 +36,7 @@ SHLIB_LDSCRIPT=libc_nossp.ldscript .endif SHLIB_LDSCRIPT_LINKS=libxnet.so WARNS?= 2 -CFLAGS+=-I${LIBC_SRCTOP}/include -I${LIBC_SRCTOP}/../../include +CFLAGS+=-I${LIBC_SRCTOP}/include -I${SRCTOP}/include CFLAGS+=-I${LIBC_SRCTOP}/${LIBC_ARCH} .if ${MK_NLS} != "no" CFLAGS+=-DNLS Modified: head/lib/libc/aarch64/string/Makefile.inc ============================================================================== --- head/lib/libc/aarch64/string/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/aarch64/string/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -4,7 +4,7 @@ # https://git.linaro.org/toolchain/cortex-strings.git # -.PATH: ${LIBC_SRCTOP}/../../contrib/cortex-strings/src/aarch64 +.PATH: ${SRCTOP}/contrib/cortex-strings/src/aarch64 MDSRCS+=memchr.S \ memcmp.S \ Modified: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- head/lib/libc/arm/aeabi/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/arm/aeabi/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -21,7 +21,7 @@ SRCS+= aeabi_vfp_double.S \ # libc. This causes issues when other parts of libc call these functions. # We work around this by including these functions in libc but mark them as # hidden so users of libc will not pick up these versions. -.PATH: ${LIBC_SRCTOP}/../../contrib/compiler-rt/lib/builtins/arm +.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/arm SRCS+= aeabi_memcmp.S \ aeabi_memcpy.S \ Modified: head/lib/libc/capability/Makefile.inc ============================================================================== --- head/lib/libc/capability/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/capability/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -1,7 +1,7 @@ # $FreeBSD$ # capability sources -.PATH: ${LIBC_SRCTOP}/../../sys/kern ${LIBC_SRCTOP}/capability +.PATH: ${SRCTOP}/sys/kern ${LIBC_SRCTOP}/capability SRCS+= subr_capability.c Modified: head/lib/libc/gdtoa/Makefile.inc ============================================================================== --- head/lib/libc/gdtoa/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/gdtoa/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -10,11 +10,11 @@ GDTOASRCS+=dmisc.c dtoa.c gdtoa.c gethex SYM_MAPS+=${LIBC_SRCTOP}/gdtoa/Symbol.map -CFLAGS+=-I${LIBC_SRCTOP}/../../contrib/gdtoa +CFLAGS+=-I${SRCTOP}/contrib/gdtoa .for src in ${GDTOASRCS} MISRCS+=gdtoa_${src} CLEANFILES+=gdtoa_${src} -gdtoa_${src}: ${LIBC_SRCTOP}/../../contrib/gdtoa/${src} .NOMETA +gdtoa_${src}: ${SRCTOP}/contrib/gdtoa/${src} .NOMETA ln -sf ${.ALLSRC} ${.TARGET} .endfor Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/gen/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -152,11 +152,11 @@ SRCS+= fts-compat.c \ unvis-compat.c .endif -.PATH: ${LIBC_SRCTOP}/../../contrib/libc-pwcache +.PATH: ${SRCTOP}/contrib/libc-pwcache SRCS+= pwcache.c pwcache.h -.PATH: ${LIBC_SRCTOP}/../../contrib/libc-vis -CFLAGS+= -I${LIBC_SRCTOP}/../../contrib/libc-vis +.PATH: ${SRCTOP}/contrib/libc-vis +CFLAGS+= -I${SRCTOP}/contrib/libc-vis SRCS+= unvis.c vis.c MISRCS+=modf.c Modified: head/lib/libc/iconv/Makefile.inc ============================================================================== --- head/lib/libc/iconv/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/iconv/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -22,5 +22,5 @@ SRCS+= iconv_compat.c SYM_MAPS+= ${LIBC_SRCTOP}/iconv/Symbol.map .if ${MK_ICONV} == yes -.include "${LIBC_SRCTOP}/../libc_nonshared/Makefile.iconv" +.include "${SRCTOP}/lib/libc_nonshared/Makefile.iconv" .endif Modified: head/lib/libc/md/Makefile.inc ============================================================================== --- head/lib/libc/md/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/md/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -1,5 +1,5 @@ # $FreeBSD$ -.PATH: ${LIBC_SRCTOP}/../libmd +.PATH: ${SRCTOP}/lib/libmd SRCS+= md5c.c Modified: head/lib/libc/posix1e/Makefile.inc ============================================================================== --- head/lib/libc/posix1e/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/posix1e/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -5,7 +5,7 @@ CFLAGS+=-D_ACL_PRIVATE # Copy kern/subr_acl_nfs4.c to the libc object directory. -subr_acl_nfs4.c: ${LIBC_SRCTOP}/../../sys/kern/subr_acl_nfs4.c +subr_acl_nfs4.c: ${SRCTOP}/sys/kern/subr_acl_nfs4.c cat ${.ALLSRC} > ${.TARGET} SRCS+= acl_branding.c \ Modified: head/lib/libc/regex/grot/Makefile ============================================================================== --- head/lib/libc/regex/grot/Makefile Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/regex/grot/Makefile Fri Jan 20 03:23:24 2017 (r312451) @@ -5,7 +5,7 @@ # Do not take -DPOSIX_MISTAKE out. REGCFLAGS isn't important to you (it's # for my use in some special contexts). -PATHS= ${.CURDIR:H} ${.CURDIR:H:H}/locale ${SRCTOP}/include +PATHS= ${LIBC_SRCTOP}/regex ${LIBC_SRCTOP}/locale ${SRCTOP}/include .PATH: ${PATHS} CFLAGS+= -static -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS) Modified: head/lib/libc/resolv/Makefile.inc ============================================================================== --- head/lib/libc/resolv/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/resolv/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -9,4 +9,4 @@ SRCS+= herror.c h_errno.c mtctxres.c res SYM_MAPS+= ${LIBC_SRCTOP}/resolv/Symbol.map -CFLAGS+=-I${LIBC_SRCTOP}/../libmd +CFLAGS+=-I${SRCTOP}/lib/libmd Modified: head/lib/libc/stdlib/jemalloc/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/jemalloc/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/stdlib/jemalloc/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -9,18 +9,18 @@ JEMALLOCSRCS:= jemalloc.c arena.c atomic SYM_MAPS+=${LIBC_SRCTOP}/stdlib/jemalloc/Symbol.map -CFLAGS+=-I${LIBC_SRCTOP}/../../contrib/jemalloc/include +CFLAGS+=-I${SRCTOP}/contrib/jemalloc/include .for src in ${JEMALLOCSRCS} MISRCS+=jemalloc_${src} CLEANFILES+=jemalloc_${src} -jemalloc_${src}: ${LIBC_SRCTOP}/../../contrib/jemalloc/src/${src} .NOMETA +jemalloc_${src}: ${SRCTOP}/contrib/jemalloc/src/${src} .NOMETA ln -sf ${.ALLSRC} ${.TARGET} .endfor MAN+=jemalloc.3 CLEANFILES+=jemalloc.3 -jemalloc.3: ${LIBC_SRCTOP}/../../contrib/jemalloc/doc/jemalloc.3 .NOMETA +jemalloc.3: ${SRCTOP}/contrib/jemalloc/doc/jemalloc.3 .NOMETA ln -sf ${.ALLSRC} ${.TARGET} MLINKS+= \ Modified: head/lib/libc/stdtime/Makefile.inc ============================================================================== --- head/lib/libc/stdtime/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/stdtime/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -1,14 +1,14 @@ # Makefile.inc,v 1.2 1994/09/13 21:26:01 wollman Exp # $FreeBSD$ -.PATH: ${LIBC_SRCTOP}/stdtime ${LIBC_SRCTOP}/../../contrib/tzcode/stdtime +.PATH: ${LIBC_SRCTOP}/stdtime ${SRCTOP}/contrib/tzcode/stdtime SRCS+= asctime.c difftime.c localtime.c strftime.c strptime.c timelocal.c \ time32.c SYM_MAPS+= ${LIBC_SRCTOP}/stdtime/Symbol.map -CFLAGS+= -I${LIBC_SRCTOP}/../../contrib/tzcode/stdtime -I${LIBC_SRCTOP}/stdtime +CFLAGS+= -I${SRCTOP}/contrib/tzcode/stdtime -I${LIBC_SRCTOP}/stdtime CFLAGS.localtime.c= -fwrapv Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/string/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -2,7 +2,7 @@ # $FreeBSD$ .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/string ${LIBC_SRCTOP}/string -.PATH: ${LIBC_SRCTOP}/../../sys/libkern +.PATH: ${SRCTOP}/sys/libkern CFLAGS+= -I${LIBC_SRCTOP}/locale Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Fri Jan 20 03:14:18 2017 (r312450) +++ head/lib/libc/sys/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) @@ -6,7 +6,7 @@ # Include the generated makefile containing the *complete* list # of syscall names in MIASM. -.include "${LIBC_SRCTOP}/../../sys/sys/syscall.mk" +.include "${SRCTOP}/sys/sys/syscall.mk" # Include machine dependent definitions. # From owner-svn-src-all@freebsd.org Fri Jan 20 03:27:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1897ECB7CAF; Fri, 20 Jan 2017 03:27:49 +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 B71171B93; Fri, 20 Jan 2017 03:27:48 +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 v0K3Rlbt094612; Fri, 20 Jan 2017 03:27:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3RlxG094608; Fri, 20 Jan 2017 03:27:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200327.v0K3RlxG094608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312452 - in head/lib/libpam/modules: . pam_passwdqc pam_ssh 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, 20 Jan 2017 03:27:49 -0000 Author: ngie Date: Fri Jan 20 03:27:47 2017 New Revision: 312452 URL: https://svnweb.freebsd.org/changeset/base/312452 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libpam/modules/Makefile.inc head/lib/libpam/modules/pam_passwdqc/Makefile head/lib/libpam/modules/pam_ssh/Makefile Modified: head/lib/libpam/modules/Makefile.inc ============================================================================== --- head/lib/libpam/modules/Makefile.inc Fri Jan 20 03:23:24 2017 (r312451) +++ head/lib/libpam/modules/Makefile.inc Fri Jan 20 03:27:47 2017 (r312452) @@ -1,11 +1,11 @@ # $FreeBSD$ -PAMDIR= ${.CURDIR}/../../../../contrib/openpam +PAMDIR= ${SRCTOP}/contrib/openpam MK_INSTALLLIB= no MK_PROFILE= no -CFLAGS+= -I${PAMDIR}/include -I${.CURDIR}/../../libpam +CFLAGS+= -I${PAMDIR}/include -I${SRCTOP}/lib/libpam SHLIB_NAME?= ${LIB}.so.${SHLIB_MAJOR} LIBADD+= pam Modified: head/lib/libpam/modules/pam_passwdqc/Makefile ============================================================================== --- head/lib/libpam/modules/pam_passwdqc/Makefile Fri Jan 20 03:23:24 2017 (r312451) +++ head/lib/libpam/modules/pam_passwdqc/Makefile Fri Jan 20 03:27:47 2017 (r312452) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCDIR= ${.CURDIR}/../../../../contrib/pam_modules/pam_passwdqc +SRCDIR= ${SRCTOP}/contrib/pam_modules/pam_passwdqc .PATH: ${SRCDIR} LIB= pam_passwdqc Modified: head/lib/libpam/modules/pam_ssh/Makefile ============================================================================== --- head/lib/libpam/modules/pam_ssh/Makefile Fri Jan 20 03:23:24 2017 (r312451) +++ head/lib/libpam/modules/pam_ssh/Makefile Fri Jan 20 03:27:47 2017 (r312452) @@ -1,7 +1,7 @@ # PAM module for SSH # $FreeBSD$ -SSHDIR= ${.CURDIR}/../../../../crypto/openssh +SSHDIR= ${SRCTOP}/crypto/openssh LIB= pam_ssh MAN= pam_ssh.8 From owner-svn-src-all@freebsd.org Fri Jan 20 03:31:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BC28CB80E0; Fri, 20 Jan 2017 03:31:52 +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 DF6E3104E; Fri, 20 Jan 2017 03:31: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 v0K3VpSa098492; Fri, 20 Jan 2017 03:31:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3VoR3098490; Fri, 20 Jan 2017 03:31:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200331.v0K3VoR3098490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312453 - in head/lib/libpam: libpam static_libpam 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, 20 Jan 2017 03:31:52 -0000 Author: ngie Date: Fri Jan 20 03:31:50 2017 New Revision: 312453 URL: https://svnweb.freebsd.org/changeset/base/312453 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libpam/libpam/Makefile head/lib/libpam/static_libpam/Makefile Modified: head/lib/libpam/libpam/Makefile ============================================================================== --- head/lib/libpam/libpam/Makefile Fri Jan 20 03:27:47 2017 (r312452) +++ head/lib/libpam/libpam/Makefile Fri Jan 20 03:31:50 2017 (r312453) @@ -36,7 +36,7 @@ # $FreeBSD$ PACKAGE=lib${LIB} -OPENPAM= ${.CURDIR}/../../../contrib/openpam +OPENPAM= ${SRCTOP}/contrib/openpam .PATH: ${OPENPAM}/include ${OPENPAM}/lib/libpam ${OPENPAM}/doc/man # static_libpam will build libpam.a Modified: head/lib/libpam/static_libpam/Makefile ============================================================================== --- head/lib/libpam/static_libpam/Makefile Fri Jan 20 03:27:47 2017 (r312452) +++ head/lib/libpam/static_libpam/Makefile Fri Jan 20 03:31:50 2017 (r312453) @@ -35,7 +35,7 @@ # # $FreeBSD$ -.PATH: ${.CURDIR}/../libpam +.PATH: ${SRCTOP}/lib/libpam # Only build the static library. LIB= pam @@ -66,4 +66,4 @@ CLEANFILES+= openpam_static.o \ openpam_static_modules.o: openpam_static.o ${STATIC_MODULES} ${CC} -nostdlib ${CFLAGS} -o ${.TARGET} -r -Wl,--whole-archive ${.ALLSRC} -.include "${.CURDIR}/../libpam/Makefile" +.include "${.CURDIR:H}/libpam/Makefile" From owner-svn-src-all@freebsd.org Fri Jan 20 03:35:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B02FFCB816E; Fri, 20 Jan 2017 03:35:00 +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 7E2691293; Fri, 20 Jan 2017 03:35: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 v0K3YxmT098677; Fri, 20 Jan 2017 03:34:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3YxtO098674; Fri, 20 Jan 2017 03:34:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200334.v0K3YxtO098674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:34:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312454 - in head/lib/libalias: libalias modules 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, 20 Jan 2017 03:35:00 -0000 Author: ngie Date: Fri Jan 20 03:34:59 2017 New Revision: 312454 URL: https://svnweb.freebsd.org/changeset/base/312454 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libalias/libalias/Makefile head/lib/libalias/modules/Makefile head/lib/libalias/modules/Makefile.inc Modified: head/lib/libalias/libalias/Makefile ============================================================================== --- head/lib/libalias/libalias/Makefile Fri Jan 20 03:31:50 2017 (r312453) +++ head/lib/libalias/libalias/Makefile Fri Jan 20 03:34:59 2017 (r312454) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../sys/netinet/libalias +.PATH: ${SRCTOP}/sys/netinet/libalias PACKAGE=lib${LIB} LIB= alias Modified: head/lib/libalias/modules/Makefile ============================================================================== --- head/lib/libalias/modules/Makefile Fri Jan 20 03:31:50 2017 (r312453) +++ head/lib/libalias/modules/Makefile Fri Jan 20 03:34:59 2017 (r312454) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include "${.CURDIR}/../../../sys/modules/libalias/modules/modules.inc" +.include "${SRCTOP}/sys/modules/libalias/modules/modules.inc" SUBDIR= ${MODULES} Modified: head/lib/libalias/modules/Makefile.inc ============================================================================== --- head/lib/libalias/modules/Makefile.inc Fri Jan 20 03:31:50 2017 (r312453) +++ head/lib/libalias/modules/Makefile.inc Fri Jan 20 03:34:59 2017 (r312454) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../../../sys/netinet/libalias +.PATH: ${SRCTOP}/sys/netinet/libalias SHLIBDIR?= /lib LIB?= alias_${NAME} From owner-svn-src-all@freebsd.org Fri Jan 20 03:52:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54E83CB8668; Fri, 20 Jan 2017 03:52: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 2C6811C98; Fri, 20 Jan 2017 03:52: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 v0K3qH9i006094; Fri, 20 Jan 2017 03:52:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3qGlV006085; Fri, 20 Jan 2017 03:52:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200352.v0K3qGlV006085@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312455 - in head/lib/csu: aarch64 amd64 arm i386 mips powerpc powerpc64 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, 20 Jan 2017 03:52:18 -0000 Author: ngie Date: Fri Jan 20 03:52:16 2017 New Revision: 312455 URL: https://svnweb.freebsd.org/changeset/base/312455 Log: Use SRCTOP-relative paths and .CURDIR with :H instead of ".." specified paths This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/csu/aarch64/Makefile head/lib/csu/amd64/Makefile head/lib/csu/arm/Makefile head/lib/csu/i386/Makefile head/lib/csu/mips/Makefile head/lib/csu/powerpc/Makefile head/lib/csu/powerpc64/Makefile head/lib/csu/riscv/Makefile head/lib/csu/sparc64/Makefile Modified: head/lib/csu/aarch64/Makefile ============================================================================== --- head/lib/csu/aarch64/Makefile Fri Jan 20 03:34:59 2017 (r312454) +++ head/lib/csu/aarch64/Makefile Fri Jan 20 03:52:16 2017 (r312455) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common +.PATH: ${.CURDIR:H}/common SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR}/../common \ - -I${.CURDIR}/../../libc/include +CFLAGS+= -I${.CURDIR:H}/common \ + -I${SRCTOP}/lib/libc/include FILES= ${OBJS} FILESMODE= ${LIBMODE} Modified: head/lib/csu/amd64/Makefile ============================================================================== --- head/lib/csu/amd64/Makefile Fri Jan 20 03:34:59 2017 (r312454) +++ head/lib/csu/amd64/Makefile Fri Jan 20 03:52:16 2017 (r312455) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common +.PATH: ${.CURDIR:H}/common SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR}/../common \ - -I${.CURDIR}/../../libc/include +CFLAGS+= -I${.CURDIR:H}/common \ + -I${SRCTOP}/lib/libc/include CFLAGS+= -fno-omit-frame-pointer FILES= ${OBJS} Modified: head/lib/csu/arm/Makefile ============================================================================== --- head/lib/csu/arm/Makefile Fri Jan 20 03:34:59 2017 (r312454) +++ head/lib/csu/arm/Makefile Fri Jan 20 03:52:16 2017 (r312455) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common +.PATH: ${.CURDIR:H}/common SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR}/../common \ - -I${.CURDIR}/../../libc/include +CFLAGS+= -I${.CURDIR:H}/common \ + -I${SRCTOP}/lib/libc/include STATIC_CFLAGS+= -mlong-calls FILES= ${OBJS} Modified: head/lib/csu/i386/Makefile ============================================================================== --- head/lib/csu/i386/Makefile Fri Jan 20 03:34:59 2017 (r312454) +++ head/lib/csu/i386/Makefile Fri Jan 20 03:52:16 2017 (r312455) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common +.PATH: ${.CURDIR:H}/common SRCS= crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= gcrt1.o crt1.o Scrt1.o -CFLAGS+= -I${.CURDIR}/../common \ - -I${.CURDIR}/../../libc/include +CFLAGS+= -I${.CURDIR:H}/common \ + -I${SRCTOP}/lib/libc/include FILES= ${OBJS} FILESMODE= ${LIBMODE} Modified: head/lib/csu/mips/Makefile ============================================================================== --- head/lib/csu/mips/Makefile Fri Jan 20 03:34:59 2017 (r312454) +++ head/lib/csu/mips/Makefile Fri Jan 20 03:52:16 2017 (r312455) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common +.PATH: ${.CURDIR:H}/common SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR}/../common \ - -I${.CURDIR}/../../libc/include +CFLAGS+= -I${.CURDIR:H}/common \ + -I${SRCTOP}/lib/libc/include FILES= ${OBJS} FILESMODE= ${LIBMODE} Modified: head/lib/csu/powerpc/Makefile ============================================================================== --- head/lib/csu/powerpc/Makefile Fri Jan 20 03:34:59 2017 (r312454) +++ head/lib/csu/powerpc/Makefile Fri Jan 20 03:52:16 2017 (r312455) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common +.PATH: ${.CURDIR:H}/common SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR}/../common \ - -I${.CURDIR}/../../libc/include +CFLAGS+= -I${.CURDIR:H}/common \ + -I${SRCTOP}/lib/libc/include FILES= ${OBJS} FILESMODE= ${LIBMODE} Modified: head/lib/csu/powerpc64/Makefile ============================================================================== --- head/lib/csu/powerpc64/Makefile Fri Jan 20 03:34:59 2017 (r312454) +++ head/lib/csu/powerpc64/Makefile Fri Jan 20 03:52:16 2017 (r312455) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common +.PATH: ${.CURDIR:H}/common SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR}/../common \ - -I${.CURDIR}/../../libc/include \ +CFLAGS+= -I${.CURDIR:H}/common \ + -I${SRCTOP}/lib/libc/include \ -mlongcall # XXX: See the log for r232932 as to why the above -mlongcall is needed. Since Modified: head/lib/csu/riscv/Makefile ============================================================================== --- head/lib/csu/riscv/Makefile Fri Jan 20 03:34:59 2017 (r312454) +++ head/lib/csu/riscv/Makefile Fri Jan 20 03:52:16 2017 (r312455) @@ -1,12 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common +.PATH: ${.CURDIR:H}/common SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR}/../common \ - -I${.CURDIR}/../../libc/include +CFLAGS+= -I${.CURDIR:H}/common \ + -I${SRCTOP}/lib/libc/include FILES= ${OBJS} FILESMODE= ${LIBMODE} Modified: head/lib/csu/sparc64/Makefile ============================================================================== --- head/lib/csu/sparc64/Makefile Fri Jan 20 03:34:59 2017 (r312454) +++ head/lib/csu/sparc64/Makefile Fri Jan 20 03:52:16 2017 (r312455) @@ -1,11 +1,12 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../common +.PATH: ${.CURDIR:H}/common SRCS= crt1.c crti.S crtn.S OBJS= ${SRCS:N*.h:R:S/$/.o/g} OBJS+= Scrt1.o gcrt1.o -CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../../libc/include +CFLAGS+= -I${.CURDIR:H}/common \ + -I${SRCTOP}/lib/libc/include FILES= ${OBJS} FILESMODE= ${LIBMODE} From owner-svn-src-all@freebsd.org Fri Jan 20 03:54:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 182D1CB8780; Fri, 20 Jan 2017 03:54:38 +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 DBFBB1E92; Fri, 20 Jan 2017 03:54:37 +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 v0K3saGr007058; Fri, 20 Jan 2017 03:54:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3saJA007057; Fri, 20 Jan 2017 03:54:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200354.v0K3saJA007057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312456 - head/lib/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, 20 Jan 2017 03:54:38 -0000 Author: ngie Date: Fri Jan 20 03:54:36 2017 New Revision: 312456 URL: https://svnweb.freebsd.org/changeset/base/312456 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libarchive/Makefile Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Fri Jan 20 03:52:16 2017 (r312455) +++ head/lib/libarchive/Makefile Fri Jan 20 03:54:36 2017 (r312456) @@ -2,7 +2,7 @@ .include PACKAGE=lib${LIB} -_LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive +_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive LIB= archive From owner-svn-src-all@freebsd.org Fri Jan 20 03:55:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75987CB885E; Fri, 20 Jan 2017 03:55: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 457231040; Fri, 20 Jan 2017 03:55:22 +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 v0K3tLg9007169; Fri, 20 Jan 2017 03:55:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3tLEI007168; Fri, 20 Jan 2017 03:55:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200355.v0K3tLEI007168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312457 - head/lib/libauditd 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, 20 Jan 2017 03:55:22 -0000 Author: ngie Date: Fri Jan 20 03:55:21 2017 New Revision: 312457 URL: https://svnweb.freebsd.org/changeset/base/312457 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libauditd/Makefile Modified: head/lib/libauditd/Makefile ============================================================================== --- head/lib/libauditd/Makefile Fri Jan 20 03:54:36 2017 (r312456) +++ head/lib/libauditd/Makefile Fri Jan 20 03:55:21 2017 (r312457) @@ -3,7 +3,7 @@ # PACKAGE=lib${LIB} -OPENBSMDIR= ${.CURDIR}/../../contrib/openbsm +OPENBSMDIR= ${SRCTOP}/contrib/openbsm _LIBAUDITDDIR= ${OPENBSMDIR}/libauditd _LIBBSMDIR= ${OPENBSMDIR}/libbsm From owner-svn-src-all@freebsd.org Fri Jan 20 03:55:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84B63CB88BE; Fri, 20 Jan 2017 03:55:44 +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 4EFE511BB; Fri, 20 Jan 2017 03:55:44 +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 v0K3th7e007239; Fri, 20 Jan 2017 03:55:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3thtv007238; Fri, 20 Jan 2017 03:55:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200355.v0K3thtv007238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312458 - head/lib/libbegemot 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, 20 Jan 2017 03:55:44 -0000 Author: ngie Date: Fri Jan 20 03:55:43 2017 New Revision: 312458 URL: https://svnweb.freebsd.org/changeset/base/312458 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libbegemot/Makefile Modified: head/lib/libbegemot/Makefile ============================================================================== --- head/lib/libbegemot/Makefile Fri Jan 20 03:55:21 2017 (r312457) +++ head/lib/libbegemot/Makefile Fri Jan 20 03:55:43 2017 (r312458) @@ -1,6 +1,6 @@ # $FreeBSD$ -LIBBEGEMOT_DIR=${.CURDIR}/../../contrib/libbegemot +LIBBEGEMOT_DIR=${SRCTOP}/contrib/libbegemot PACKAGE=lib${LIB} .PATH: ${LIBBEGEMOT_DIR} From owner-svn-src-all@freebsd.org Fri Jan 20 03:56:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0921CB8931; Fri, 20 Jan 2017 03:56:11 +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 705191341; Fri, 20 Jan 2017 03:56:11 +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 v0K3uAmh007307; Fri, 20 Jan 2017 03:56:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3uAc7007306; Fri, 20 Jan 2017 03:56:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200356.v0K3uAc7007306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:56:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312459 - head/lib/libblocksruntime 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, 20 Jan 2017 03:56:11 -0000 Author: ngie Date: Fri Jan 20 03:56:10 2017 New Revision: 312459 URL: https://svnweb.freebsd.org/changeset/base/312459 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libblocksruntime/Makefile Modified: head/lib/libblocksruntime/Makefile ============================================================================== --- head/lib/libblocksruntime/Makefile Fri Jan 20 03:55:43 2017 (r312458) +++ head/lib/libblocksruntime/Makefile Fri Jan 20 03:56:10 2017 (r312459) @@ -6,7 +6,7 @@ SHLIB_MAJOR=0 CFLAGS+=-I${.CURDIR} WARNS?= 2 -.PATH: ${.CURDIR}/../../contrib/compiler-rt/lib/BlocksRuntime +.PATH: ${SRCTOP}/contrib/compiler-rt/lib/BlocksRuntime INCS= Block.h Block_private.h SRCS= data.c runtime.c From owner-svn-src-all@freebsd.org Fri Jan 20 03:56:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68004CB89AB; Fri, 20 Jan 2017 03:56:43 +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 37C45152C; Fri, 20 Jan 2017 03:56:43 +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 v0K3ugOS007380; Fri, 20 Jan 2017 03:56:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3ugfs007379; Fri, 20 Jan 2017 03:56:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200356.v0K3ugfs007379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312460 - head/lib/libbluetooth 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, 20 Jan 2017 03:56:43 -0000 Author: ngie Date: Fri Jan 20 03:56:42 2017 New Revision: 312460 URL: https://svnweb.freebsd.org/changeset/base/312460 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libbluetooth/Makefile Modified: head/lib/libbluetooth/Makefile ============================================================================== --- head/lib/libbluetooth/Makefile Fri Jan 20 03:56:10 2017 (r312459) +++ head/lib/libbluetooth/Makefile Fri Jan 20 03:56:42 2017 (r312460) @@ -6,7 +6,7 @@ LIB= bluetooth MAN= bluetooth.3 WARNS?= 2 -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../sys +CFLAGS+= -I${.CURDIR} -I${SRCTOP}/sys SHLIB_MAJOR= 4 From owner-svn-src-all@freebsd.org Fri Jan 20 03:57:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3FD3CB8A35; Fri, 20 Jan 2017 03:57: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 C3E5516CF; Fri, 20 Jan 2017 03:57: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 v0K3vOZe007457; Fri, 20 Jan 2017 03:57:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3vOnr007456; Fri, 20 Jan 2017 03:57:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200357.v0K3vOnr007456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312461 - head/lib/libbsm 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, 20 Jan 2017 03:57:26 -0000 Author: ngie Date: Fri Jan 20 03:57:24 2017 New Revision: 312461 URL: https://svnweb.freebsd.org/changeset/base/312461 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libbsm/Makefile Modified: head/lib/libbsm/Makefile ============================================================================== --- head/lib/libbsm/Makefile Fri Jan 20 03:56:42 2017 (r312460) +++ head/lib/libbsm/Makefile Fri Jan 20 03:57:24 2017 (r312461) @@ -3,7 +3,7 @@ # PACKAGE= lib${LIB} -OPENBSMDIR= ${.CURDIR}/../../contrib/openbsm +OPENBSMDIR= ${SRCTOP}/contrib/openbsm _LIBBSMDIR= ${OPENBSMDIR}/libbsm LIB= bsm From owner-svn-src-all@freebsd.org Fri Jan 20 03:57:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCF1FCB8AAE; Fri, 20 Jan 2017 03:57:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACC12187E; Fri, 20 Jan 2017 03:57:53 +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 v0K3vqU2007523; Fri, 20 Jan 2017 03:57:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3vqFl007522; Fri, 20 Jan 2017 03:57:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200357.v0K3vqFl007522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312462 - head/lib/libbsnmp/libbsnmp 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, 20 Jan 2017 03:57:54 -0000 Author: ngie Date: Fri Jan 20 03:57:52 2017 New Revision: 312462 URL: https://svnweb.freebsd.org/changeset/base/312462 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libbsnmp/libbsnmp/Makefile Modified: head/lib/libbsnmp/libbsnmp/Makefile ============================================================================== --- head/lib/libbsnmp/libbsnmp/Makefile Fri Jan 20 03:57:24 2017 (r312461) +++ head/lib/libbsnmp/libbsnmp/Makefile Fri Jan 20 03:57:52 2017 (r312462) @@ -4,7 +4,7 @@ .include -CONTRIB= ${.CURDIR}/../../../contrib/bsnmp/lib +CONTRIB= ${SRCTOP}/contrib/bsnmp/lib .PATH: ${CONTRIB} LIB= bsnmp From owner-svn-src-all@freebsd.org Fri Jan 20 03:58:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3036CB8B3C; Fri, 20 Jan 2017 03:58: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 7302C1A27; Fri, 20 Jan 2017 03:58: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 v0K3wona007623; Fri, 20 Jan 2017 03:58:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3wo0C007622; Fri, 20 Jan 2017 03:58:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200358.v0K3wo0C007622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:58:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312463 - head/lib/libbz2 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, 20 Jan 2017 03:58:51 -0000 Author: ngie Date: Fri Jan 20 03:58:50 2017 New Revision: 312463 URL: https://svnweb.freebsd.org/changeset/base/312463 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libbz2/Makefile Modified: head/lib/libbz2/Makefile ============================================================================== --- head/lib/libbz2/Makefile Fri Jan 20 03:57:52 2017 (r312462) +++ head/lib/libbz2/Makefile Fri Jan 20 03:58:50 2017 (r312463) @@ -1,7 +1,7 @@ # $FreeBSD$ PACKAGE= lib${LIB} -BZ2DIR= ${.CURDIR}/../../contrib/bzip2 +BZ2DIR= ${SRCTOP}/contrib/bzip2 .PATH: ${BZ2DIR} LIB= bz2 From owner-svn-src-all@freebsd.org Fri Jan 20 03:59:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3ECA0CB8B8E; Fri, 20 Jan 2017 03:59:12 +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 0EC611BB9; Fri, 20 Jan 2017 03:59:11 +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 v0K3xBZI007684; Fri, 20 Jan 2017 03:59:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K3xBFB007683; Fri, 20 Jan 2017 03:59:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200359.v0K3xBFB007683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 03:59:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312464 - head/lib/libc++ 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, 20 Jan 2017 03:59:12 -0000 Author: ngie Date: Fri Jan 20 03:59:10 2017 New Revision: 312464 URL: https://svnweb.freebsd.org/changeset/base/312464 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libc++/Makefile Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri Jan 20 03:58:50 2017 (r312463) +++ head/lib/libc++/Makefile Fri Jan 20 03:59:10 2017 (r312464) @@ -3,9 +3,9 @@ .include PACKAGE= clibs -_LIBCXXRTDIR= ${.CURDIR}/../../contrib/libcxxrt -HDRDIR= ${.CURDIR}/../../contrib/libc++/include -SRCDIR= ${.CURDIR}/../../contrib/libc++/src +_LIBCXXRTDIR= ${SRCTOP}/contrib/libcxxrt +HDRDIR= ${SRCTOP}/contrib/libc++/include +SRCDIR= ${SRCTOP}/contrib/libc++/src CXXINCLUDEDIR= ${INCLUDEDIR}/c++/v${SHLIB_MAJOR} .if ${MACHINE_CPUARCH} == "arm" STATIC_CXXFLAGS+= -mlong-calls From owner-svn-src-all@freebsd.org Fri Jan 20 04:03:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C0B5CB8DD2; Fri, 20 Jan 2017 04:03: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 EA38B104C; Fri, 20 Jan 2017 04:03:56 +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 v0K43ugp011636; Fri, 20 Jan 2017 04:03:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K43u56011635; Fri, 20 Jan 2017 04:03:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200403.v0K43u56011635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312465 - head/lib/libcam 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, 20 Jan 2017 04:03:57 -0000 Author: ngie Date: Fri Jan 20 04:03:55 2017 New Revision: 312465 URL: https://svnweb.freebsd.org/changeset/base/312465 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libcam/Makefile Modified: head/lib/libcam/Makefile ============================================================================== --- head/lib/libcam/Makefile Fri Jan 20 03:59:10 2017 (r312464) +++ head/lib/libcam/Makefile Fri Jan 20 04:03:55 2017 (r312465) @@ -36,11 +36,10 @@ MLINKS+= cam.3 cam_open_device.3 \ cam_cdbparse.3 csio_encode_visit.3 \ cam_cdbparse.3 buff_encode_visit.3 -.PATH: ${.CURDIR}/../../sys/cam/scsi ${.CURDIR}/../../sys/cam/ata \ - ${.CURDIR}/../../sys/cam +.PATH: ${SRCTOP}/sys/cam/scsi ${SRCTOP}/sys/cam/ata \ + ${SRCTOP}/sys/cam -SDIR= ${.CURDIR}/../../sys -CFLAGS+= -I${.CURDIR} -I${SDIR} +CFLAGS+= -I${.CURDIR} -I${SRCTOP}/sys SHLIB_MAJOR= 7 From owner-svn-src-all@freebsd.org Fri Jan 20 04:04:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0EFBCB8E67; Fri, 20 Jan 2017 04:04: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 A0B0F11C2; Fri, 20 Jan 2017 04:04: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 v0K44Pfo011704; Fri, 20 Jan 2017 04:04:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K44PBV011703; Fri, 20 Jan 2017 04:04:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200404.v0K44PBV011703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312466 - head/lib/libc_nonshared 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, 20 Jan 2017 04:04:26 -0000 Author: ngie Date: Fri Jan 20 04:04:25 2017 New Revision: 312466 URL: https://svnweb.freebsd.org/changeset/base/312466 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libc_nonshared/Makefile Modified: head/lib/libc_nonshared/Makefile ============================================================================== --- head/lib/libc_nonshared/Makefile Fri Jan 20 04:03:55 2017 (r312465) +++ head/lib/libc_nonshared/Makefile Fri Jan 20 04:04:25 2017 (r312466) @@ -6,7 +6,7 @@ # bsd.lib.mk doesn't have an easy way to express that. MK_PROFILE?=no .include -NO_PIC= +NO_PIC= # -fpic on some platforms, -fPIC on others. CFLAGS+=${PICFLAG} -DPIC -fvisibility=hidden @@ -18,9 +18,9 @@ LIBC_NONSHARED_SRCS= SRCS= __stub.c .if ${MK_ICONV} == "yes" -.PATH: ${.CURDIR}/../libc/iconv +.PATH: ${SRCTOP}/lib/libc/iconv .include "Makefile.iconv" -CFLAGS+=-I${.CURDIR}/../libc/iconv +CFLAGS+=-I${SRCTOP}/lib/libc/iconv .endif SRCS+= ${LIBC_NONSHARED_SRCS} From owner-svn-src-all@freebsd.org Fri Jan 20 04:27:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A86DBCB9309; Fri, 20 Jan 2017 04:27: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 68B001ADB; Fri, 20 Jan 2017 04:27: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 v0K4RfXs020046; Fri, 20 Jan 2017 04:27:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4Re1a020037; Fri, 20 Jan 2017 04:27:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200427.v0K4Re1a020037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312467 - in head/lib/ncurses: . form formw menu menuw ncurses ncursesw panel panelw 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, 20 Jan 2017 04:27:42 -0000 Author: ngie Date: Fri Jan 20 04:27:40 2017 New Revision: 312467 URL: https://svnweb.freebsd.org/changeset/base/312467 Log: Use SRCTOP-relative paths and .CURDIR with :H instead of ".." specified paths This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/ncurses/config.mk head/lib/ncurses/form/Makefile head/lib/ncurses/formw/Makefile head/lib/ncurses/menu/Makefile head/lib/ncurses/menuw/Makefile head/lib/ncurses/ncurses/Makefile head/lib/ncurses/ncursesw/Makefile head/lib/ncurses/panel/Makefile head/lib/ncurses/panelw/Makefile Modified: head/lib/ncurses/config.mk ============================================================================== --- head/lib/ncurses/config.mk Fri Jan 20 04:04:25 2017 (r312466) +++ head/lib/ncurses/config.mk Fri Jan 20 04:27:40 2017 (r312467) @@ -2,25 +2,25 @@ # This Makefile is shared by libncurses, libform, libmenu, libpanel. -NCURSES_DIR= ${.CURDIR}/../../../contrib/ncurses +NCURSES_DIR= ${SRCTOP}/contrib/ncurses .if defined(ENABLE_WIDEC) LIB_SUFFIX= w CFLAGS+= -D_XOPEN_SOURCE_EXTENDED -DENABLE_WIDEC -NCURSES_CFG_H= ${.CURDIR}/../ncurses/ncurses_cfg.h +NCURSES_CFG_H= ${.CURDIR:H}/ncurses/ncurses_cfg.h .else LIB_SUFFIX= NCURSES_CFG_H= ${.CURDIR}/ncurses_cfg.h .endif CFLAGS+= -I. -.if exists(${.OBJDIR}/../ncurses${LIB_SUFFIX}) -CFLAGS+= -I${.OBJDIR}/../ncurses${LIB_SUFFIX} +.if exists(${.OBJDIR:H}/ncurses${LIB_SUFFIX}) +CFLAGS+= -I${.OBJDIR:H}/ncurses${LIB_SUFFIX} .endif -CFLAGS+= -I${.CURDIR}/../ncurses${LIB_SUFFIX} +CFLAGS+= -I${.CURDIR:H}/ncurses${LIB_SUFFIX} # for ${NCURSES_CFG_H} -CFLAGS+= -I${.CURDIR}/../ncurses +CFLAGS+= -I${.CURDIR:H}/ncurses CFLAGS+= -I${NCURSES_DIR}/include CFLAGS+= -I${NCURSES_DIR}/ncurses Modified: head/lib/ncurses/form/Makefile ============================================================================== --- head/lib/ncurses/form/Makefile Fri Jan 20 04:04:25 2017 (r312466) +++ head/lib/ncurses/form/Makefile Fri Jan 20 04:27:40 2017 (r312467) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include "${.CURDIR}/../config.mk" +.include "${.CURDIR:H}/config.mk" SRCDIR= ${NCURSES_DIR}/form Modified: head/lib/ncurses/formw/Makefile ============================================================================== --- head/lib/ncurses/formw/Makefile Fri Jan 20 04:04:25 2017 (r312466) +++ head/lib/ncurses/formw/Makefile Fri Jan 20 04:27:40 2017 (r312467) @@ -2,4 +2,4 @@ ENABLE_WIDEC= -.include "${.CURDIR}/../form/Makefile" +.include "${.CURDIR:H}/form/Makefile" Modified: head/lib/ncurses/menu/Makefile ============================================================================== --- head/lib/ncurses/menu/Makefile Fri Jan 20 04:04:25 2017 (r312466) +++ head/lib/ncurses/menu/Makefile Fri Jan 20 04:27:40 2017 (r312467) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include "${.CURDIR}/../config.mk" +.include "${.CURDIR:H}/config.mk" SRCDIR= ${NCURSES_DIR}/menu Modified: head/lib/ncurses/menuw/Makefile ============================================================================== --- head/lib/ncurses/menuw/Makefile Fri Jan 20 04:04:25 2017 (r312466) +++ head/lib/ncurses/menuw/Makefile Fri Jan 20 04:27:40 2017 (r312467) @@ -2,4 +2,4 @@ ENABLE_WIDEC= -.include "${.CURDIR}/../menu/Makefile" +.include "${.CURDIR:H}/menu/Makefile" Modified: head/lib/ncurses/ncurses/Makefile ============================================================================== --- head/lib/ncurses/ncurses/Makefile Fri Jan 20 04:04:25 2017 (r312466) +++ head/lib/ncurses/ncurses/Makefile Fri Jan 20 04:27:40 2017 (r312467) @@ -10,7 +10,7 @@ MK_MAN=no .include -.include "${.CURDIR}/../config.mk" +.include "${.CURDIR:H}/config.mk" LIB= ncurses${LIB_SUFFIX} SHLIB_MAJOR= 8 Modified: head/lib/ncurses/ncursesw/Makefile ============================================================================== --- head/lib/ncurses/ncursesw/Makefile Fri Jan 20 04:04:25 2017 (r312466) +++ head/lib/ncurses/ncursesw/Makefile Fri Jan 20 04:27:40 2017 (r312467) @@ -2,6 +2,6 @@ ENABLE_WIDEC= -.PATH: ${.CURDIR}/../ncurses +.PATH: ${.CURDIR:H}/ncurses -.include "${.CURDIR}/../ncurses/Makefile" +.include "${.CURDIR:H}/ncurses/Makefile" Modified: head/lib/ncurses/panel/Makefile ============================================================================== --- head/lib/ncurses/panel/Makefile Fri Jan 20 04:04:25 2017 (r312466) +++ head/lib/ncurses/panel/Makefile Fri Jan 20 04:27:40 2017 (r312467) @@ -1,6 +1,6 @@ # $FreeBSD$ -.include "${.CURDIR}/../config.mk" +.include "${.CURDIR:H}/config.mk" SRCDIR= ${NCURSES_DIR}/panel Modified: head/lib/ncurses/panelw/Makefile ============================================================================== --- head/lib/ncurses/panelw/Makefile Fri Jan 20 04:04:25 2017 (r312466) +++ head/lib/ncurses/panelw/Makefile Fri Jan 20 04:27:40 2017 (r312467) @@ -2,4 +2,4 @@ ENABLE_WIDEC= -.include "${.CURDIR}/../panel/Makefile" +.include "${.CURDIR:H}/panel/Makefile" From owner-svn-src-all@freebsd.org Fri Jan 20 04:28:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97EEBCB9366; Fri, 20 Jan 2017 04:28:17 +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 67C2F1C61; Fri, 20 Jan 2017 04:28:17 +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 v0K4SGGt020117; Fri, 20 Jan 2017 04:28:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4SGhR020116; Fri, 20 Jan 2017 04:28:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200428.v0K4SGhR020116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312468 - head/lib/libthread_db 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, 20 Jan 2017 04:28:17 -0000 Author: ngie Date: Fri Jan 20 04:28:16 2017 New Revision: 312468 URL: https://svnweb.freebsd.org/changeset/base/312468 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libthread_db/Makefile Modified: head/lib/libthread_db/Makefile ============================================================================== --- head/lib/libthread_db/Makefile Fri Jan 20 04:27:40 2017 (r312467) +++ head/lib/libthread_db/Makefile Fri Jan 20 04:28:16 2017 (r312468) @@ -15,7 +15,7 @@ CFLAGS+=-I. -I${.CURDIR} SYM_MAPS+=${.CURDIR}/Symbol.map SYMBOL_MAPS=${SYM_MAPS} -VERSION_DEF=${.CURDIR}/../libc/Versions.def +VERSION_DEF=${SRCTOP}/lib/libc/Versions.def # Unfortunately, clang gives an incorrect warning about alignment in # arch/i386/libpthread_md.c, so turn that off for now. From owner-svn-src-all@freebsd.org Fri Jan 20 04:28:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2F3FCB93AB; Fri, 20 Jan 2017 04:28: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 A157D1DD3; Fri, 20 Jan 2017 04:28: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 v0K4Sf8u020180; Fri, 20 Jan 2017 04:28:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4SfvE020179; Fri, 20 Jan 2017 04:28:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200428.v0K4SfvE020179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312469 - head/lib/libypclnt 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, 20 Jan 2017 04:28:42 -0000 Author: ngie Date: Fri Jan 20 04:28:41 2017 New Revision: 312469 URL: https://svnweb.freebsd.org/changeset/base/312469 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libypclnt/Makefile Modified: head/lib/libypclnt/Makefile ============================================================================== --- head/lib/libypclnt/Makefile Fri Jan 20 04:28:16 2017 (r312468) +++ head/lib/libypclnt/Makefile Fri Jan 20 04:28:41 2017 (r312469) @@ -24,9 +24,9 @@ GENSRCS=yp.h \ yppasswd_private_xdr.c RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C -RPCSRC= ${.CURDIR}/../../include/rpcsvc/yp.x -RPCSRC_PW= ${.CURDIR}/../../include/rpcsvc/yppasswd.x -RPCSRC_PRIV= ${.CURDIR}/../../usr.sbin/rpc.yppasswdd/yppasswd_private.x +RPCSRC= ${SRCTOP}/include/rpcsvc/yp.x +RPCSRC_PW= ${SRCTOP}/include/rpcsvc/yppasswd.x +RPCSRC_PRIV= ${SRCTOP}/usr.sbin/rpc.yppasswdd/yppasswd_private.x yp.h: ${RPCSRC} ${RPCGEN} -h -o ${.TARGET} ${RPCSRC} From owner-svn-src-all@freebsd.org Fri Jan 20 04:29:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2483CB9406; Fri, 20 Jan 2017 04:29:06 +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 823DC1F40; Fri, 20 Jan 2017 04:29:06 +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 v0K4T5lc020242; Fri, 20 Jan 2017 04:29:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4T50Y020241; Fri, 20 Jan 2017 04:29:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200429.v0K4T50Y020241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312470 - 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: Fri, 20 Jan 2017 04:29:06 -0000 Author: ngie Date: Fri Jan 20 04:29:05 2017 New Revision: 312470 URL: https://svnweb.freebsd.org/changeset/base/312470 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libutil/Makefile Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Fri Jan 20 04:28:41 2017 (r312469) +++ head/lib/libutil/Makefile Fri Jan 20 04:29:05 2017 (r312470) @@ -25,7 +25,7 @@ CFLAGS+= -DLIBC_SCCS CFLAGS+= -DINET6 .endif -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libc/gen/ +CFLAGS+= -I${.CURDIR} -I${SRCTOP}/lib/libc/gen/ MAN+= expand_number.3 flopen.3 fparseln.3 hexdump.3 \ humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \ From owner-svn-src-all@freebsd.org Fri Jan 20 04:29:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BBA8CB944C; Fri, 20 Jan 2017 04:29: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 0BA8610AF; Fri, 20 Jan 2017 04:29: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 v0K4TOEc020295; Fri, 20 Jan 2017 04:29:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4TOtt020294; Fri, 20 Jan 2017 04:29:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200429.v0K4TOtt020294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:29:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312471 - head/lib/libulog 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, 20 Jan 2017 04:29:25 -0000 Author: ngie Date: Fri Jan 20 04:29:23 2017 New Revision: 312471 URL: https://svnweb.freebsd.org/changeset/base/312471 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libulog/Makefile Modified: head/lib/libulog/Makefile ============================================================================== --- head/lib/libulog/Makefile Fri Jan 20 04:29:05 2017 (r312470) +++ head/lib/libulog/Makefile Fri Jan 20 04:29:23 2017 (r312471) @@ -22,7 +22,7 @@ MLINKS+=ulog_login.3 ulog_login_pseudo.3 LIBADD= md -VERSION_DEF= ${.CURDIR}/../libc/Versions.def +VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map .if ${MK_INSTALLLIB} != "no" From owner-svn-src-all@freebsd.org Fri Jan 20 04:30:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADD40CB94BA; Fri, 20 Jan 2017 04:30:06 +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 7D916124B; Fri, 20 Jan 2017 04:30:06 +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 v0K4U5pw020392; Fri, 20 Jan 2017 04:30:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4U5Q1020391; Fri, 20 Jan 2017 04:30:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200430.v0K4U5Q1020391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312472 - head/lib/libufs 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, 20 Jan 2017 04:30:06 -0000 Author: ngie Date: Fri Jan 20 04:30:05 2017 New Revision: 312472 URL: https://svnweb.freebsd.org/changeset/base/312472 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libufs/Makefile Modified: head/lib/libufs/Makefile ============================================================================== --- head/lib/libufs/Makefile Fri Jan 20 04:29:23 2017 (r312471) +++ head/lib/libufs/Makefile Fri Jan 20 04:30:05 2017 (r312472) @@ -18,7 +18,7 @@ MLINKS+= ufs_disk_close.3 ufs_disk_fillo MLINKS+= ufs_disk_close.3 ufs_disk_fillout_blank.3 MLINKS+= ufs_disk_close.3 ufs_disk_write.3 -.PATH: ${.CURDIR}/../../sys/ufs/ffs +.PATH: ${SRCTOP}/sys/ufs/ffs WARNS?= 2 From owner-svn-src-all@freebsd.org Fri Jan 20 04:31:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDA0BCB953E; Fri, 20 Jan 2017 04:31:20 +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 9549514B1; Fri, 20 Jan 2017 04:31:20 +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 v0K4VJf0023234; Fri, 20 Jan 2017 04:31:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4VJgB023233; Fri, 20 Jan 2017 04:31:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200431.v0K4VJgB023233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312473 - head/lib/libunbound 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, 20 Jan 2017 04:31:20 -0000 Author: ngie Date: Fri Jan 20 04:31:19 2017 New Revision: 312473 URL: https://svnweb.freebsd.org/changeset/base/312473 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libunbound/Makefile Modified: head/lib/libunbound/Makefile ============================================================================== --- head/lib/libunbound/Makefile Fri Jan 20 04:30:05 2017 (r312472) +++ head/lib/libunbound/Makefile Fri Jan 20 04:31:19 2017 (r312473) @@ -2,8 +2,8 @@ PACKAGE=lib${LIB} # Vendor sources and generated files -LDNSDIR= ${.CURDIR}/../../contrib/ldns -UNBOUNDDIR= ${.CURDIR}/../../contrib/unbound +LDNSDIR= ${SRCTOP}/contrib/ldns +UNBOUNDDIR= ${SRCTOP}/contrib/unbound # Hold my beer and watch this .PATH: ${UNBOUNDDIR} ${UNBOUNDDIR}/cachedb ${UNBOUNDDIR}/dns64 ${UNBOUNDDIR}/iterator ${UNBOUNDDIR}/sldns ${UNBOUNDDIR}/libunbound ${UNBOUNDDIR}/services ${UNBOUNDDIR}/services/cache ${UNBOUNDDIR}/util ${UNBOUNDDIR}/util/data ${UNBOUNDDIR}/util/storage ${UNBOUNDDIR}/validator From owner-svn-src-all@freebsd.org Fri Jan 20 04:32:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1576DCB959F; Fri, 20 Jan 2017 04:32: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 BF4C51806; Fri, 20 Jan 2017 04:32:20 +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 v0K4WJC1024152; Fri, 20 Jan 2017 04:32:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4WJ1W024150; Fri, 20 Jan 2017 04:32:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200432.v0K4WJ1W024150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312474 - in head/lib/libthr: . support 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, 20 Jan 2017 04:32:21 -0000 Author: ngie Date: Fri Jan 20 04:32:19 2017 New Revision: 312474 URL: https://svnweb.freebsd.org/changeset/base/312474 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libthr/Makefile head/lib/libthr/support/Makefile.inc Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Fri Jan 20 04:31:19 2017 (r312473) +++ head/lib/libthr/Makefile Fri Jan 20 04:32:19 2017 (r312474) @@ -18,13 +18,13 @@ LIB=thr SHLIB_MAJOR= 3 WARNS?= 3 CFLAGS+=-DPTHREAD_KERNEL -CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \ - -I${.CURDIR}/../../include +CFLAGS+=-I${SRCTOP}/lib/libc/include -I${.CURDIR}/thread \ + -I${SRCTOP}/include CFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include CFLAGS+=-I${.CURDIR}/sys -CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf -CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH} -CFLAGS+=-I${.CURDIR}/../libthread_db +CFLAGS+=-I${SRCTOP}/libexec/rtld-elf +CFLAGS+=-I${SRCTOP}/libexec/rtld-elf/${MACHINE_CPUARCH} +CFLAGS+=-I${SRCTOP}/lib/libthread_db CFLAGS+=-Winline .ifndef NO_THREAD_UNWIND_STACK @@ -34,7 +34,7 @@ CFLAGS+=-D_PTHREAD_FORCED_UNWIND LDFLAGS+=-Wl,-znodelete -VERSION_DEF=${.CURDIR}/../libc/Versions.def +VERSION_DEF=${SRCTOP}/lib/libc/Versions.def SYMBOL_MAPS=${.CURDIR}/pthread.map MAN= libthr.3 Modified: head/lib/libthr/support/Makefile.inc ============================================================================== --- head/lib/libthr/support/Makefile.inc Fri Jan 20 04:31:19 2017 (r312473) +++ head/lib/libthr/support/Makefile.inc Fri Jan 20 04:32:19 2017 (r312474) @@ -1,15 +1,15 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/support ${.CURDIR}/../libc/gen ${.CURDIR}/../libc/string +.PATH: ${.CURDIR}/support ${SRCTOP}/lib/libc/gen ${SRCTOP}/lib/libc/string # libc must search machine_arch, then machine_cpuarch, but libthr has all its # code implemented in machine_cpuarch. Cope. -.if exists(${.CURDIR}/../libc/${MACHINE_ARCH}/sys) -.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys -CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_ARCH} +.if exists(${SRCTOP}/lib/libc/${MACHINE_ARCH}/sys) +.PATH: ${SRCTOP}/lib/libc/${MACHINE_ARCH}/sys +CFLAGS+= -I${SRCTOP}/lib/libc/${MACHINE_ARCH} .else -.PATH: ${.CURDIR}/../libc/${MACHINE_CPUARCH}/sys -CFLAGS+= -I${.CURDIR}/../libc/${MACHINE_CPUARCH} +.PATH: ${SRCTOP}/lib/libc/${MACHINE_CPUARCH}/sys +CFLAGS+= -I${SRCTOP}/lib/libc/${MACHINE_CPUARCH} .endif SYSCALLS= thr_new From owner-svn-src-all@freebsd.org Fri Jan 20 04:32:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96EA6CB96C5; Fri, 20 Jan 2017 04:32:37 +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 6465C1968; Fri, 20 Jan 2017 04:32:37 +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 v0K4Wahc024205; Fri, 20 Jan 2017 04:32:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4Wadh024204; Fri, 20 Jan 2017 04:32:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200432.v0K4Wadh024204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312475 - head/lib/libtelnet 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, 20 Jan 2017 04:32:37 -0000 Author: ngie Date: Fri Jan 20 04:32:36 2017 New Revision: 312475 URL: https://svnweb.freebsd.org/changeset/base/312475 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libtelnet/Makefile Modified: head/lib/libtelnet/Makefile ============================================================================== --- head/lib/libtelnet/Makefile Fri Jan 20 04:32:19 2017 (r312474) +++ head/lib/libtelnet/Makefile Fri Jan 20 04:32:36 2017 (r312475) @@ -4,7 +4,7 @@ .include PACKAGE=lib${LIB} -TELNETDIR= ${.CURDIR}/../../contrib/telnet +TELNETDIR= ${SRCTOP}/contrib/telnet .PATH: ${TELNETDIR}/libtelnet LIB= telnet From owner-svn-src-all@freebsd.org Fri Jan 20 04:33:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 892DDCB973B; Fri, 20 Jan 2017 04:33: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 56AA21B78; Fri, 20 Jan 2017 04:33: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 v0K4XK6d024298; Fri, 20 Jan 2017 04:33:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4XKmG024297; Fri, 20 Jan 2017 04:33:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200433.v0K4XKmG024297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312476 - head/lib/libsysdecode 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, 20 Jan 2017 04:33:21 -0000 Author: ngie Date: Fri Jan 20 04:33:20 2017 New Revision: 312476 URL: https://svnweb.freebsd.org/changeset/base/312476 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libsysdecode/Makefile Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Fri Jan 20 04:32:36 2017 (r312475) +++ head/lib/libsysdecode/Makefile Fri Jan 20 04:33:20 2017 (r312476) @@ -9,8 +9,8 @@ SRCS= errno.c flags.c ioctl.c signal.c s INCS= sysdecode.h CFLAGS+= -I${.OBJDIR} -CFLAGS+= -I${.CURDIR}/../../sys -CFLAGS+= -I${.CURDIR}/../../libexec/rtld-elf +CFLAGS+= -I${SRCTOP}/sys +CFLAGS+= -I${SRCTOP}/libexec/rtld-elf MAN= sysdecode.3 \ sysdecode_abi_to_freebsd_errno.3 \ From owner-svn-src-all@freebsd.org Fri Jan 20 04:33:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA0C9CB9792; Fri, 20 Jan 2017 04:33:46 +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 99D611CFB; Fri, 20 Jan 2017 04:33:46 +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 v0K4XjQT024354; Fri, 20 Jan 2017 04:33:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4XjEC024353; Fri, 20 Jan 2017 04:33:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200433.v0K4XjEC024353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312477 - head/lib/libstdthreads 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, 20 Jan 2017 04:33:46 -0000 Author: ngie Date: Fri Jan 20 04:33:45 2017 New Revision: 312477 URL: https://svnweb.freebsd.org/changeset/base/312477 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libstdthreads/Makefile Modified: head/lib/libstdthreads/Makefile ============================================================================== --- head/lib/libstdthreads/Makefile Fri Jan 20 04:33:20 2017 (r312476) +++ head/lib/libstdthreads/Makefile Fri Jan 20 04:33:45 2017 (r312477) @@ -35,7 +35,7 @@ MLINKS= thrd_create.3 call_once.3 \ LIBADD= pthread -VERSION_DEF= ${.CURDIR}/../libc/Versions.def +VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map .include From owner-svn-src-all@freebsd.org Fri Jan 20 04:34:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35248CB97E6; Fri, 20 Jan 2017 04:34:03 +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 04DE71E0E; Fri, 20 Jan 2017 04:34:02 +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 v0K4Y2Hx024415; Fri, 20 Jan 2017 04:34:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4Y2gT024414; Fri, 20 Jan 2017 04:34:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200434.v0K4Y2gT024414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312478 - head/lib/libsqlite3 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, 20 Jan 2017 04:34:03 -0000 Author: ngie Date: Fri Jan 20 04:34:01 2017 New Revision: 312478 URL: https://svnweb.freebsd.org/changeset/base/312478 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libsqlite3/Makefile Modified: head/lib/libsqlite3/Makefile ============================================================================== --- head/lib/libsqlite3/Makefile Fri Jan 20 04:33:45 2017 (r312477) +++ head/lib/libsqlite3/Makefile Fri Jan 20 04:34:01 2017 (r312478) @@ -8,7 +8,7 @@ LIBADD+= pthread SRCS= sqlite3.c -SQLITE= ${.CURDIR}/../../contrib/sqlite3 +SQLITE= ${SRCTOP}/contrib/sqlite3 .PATH: ${SQLITE} WARNS= 3 From owner-svn-src-all@freebsd.org Fri Jan 20 04:34:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4177FCB9846; Fri, 20 Jan 2017 04:34: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 0C6E81FE6; Fri, 20 Jan 2017 04:34:35 +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 v0K4YZsh024479; Fri, 20 Jan 2017 04:34:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4YZke024478; Fri, 20 Jan 2017 04:34:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200434.v0K4YZke024478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312479 - head/lib/libsmutil 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, 20 Jan 2017 04:34:36 -0000 Author: ngie Date: Fri Jan 20 04:34:34 2017 New Revision: 312479 URL: https://svnweb.freebsd.org/changeset/base/312479 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libsmutil/Makefile Modified: head/lib/libsmutil/Makefile ============================================================================== --- head/lib/libsmutil/Makefile Fri Jan 20 04:34:01 2017 (r312478) +++ head/lib/libsmutil/Makefile Fri Jan 20 04:34:34 2017 (r312479) @@ -1,7 +1,7 @@ # $FreeBSD$ PACKAGE=lib${LIB} -SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail +SENDMAIL_DIR=${SRCTOP}/contrib/sendmail .PATH: ${SENDMAIL_DIR}/libsmutil CFLAGS+=-I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I. From owner-svn-src-all@freebsd.org Fri Jan 20 04:35:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9940ACB98A5; Fri, 20 Jan 2017 04:35: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 69298115D; Fri, 20 Jan 2017 04:35: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 v0K4Z05W024552; Fri, 20 Jan 2017 04:35:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4Z0J5024551; Fri, 20 Jan 2017 04:35:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200435.v0K4Z0J5024551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312480 - head/lib/libsmb 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, 20 Jan 2017 04:35:01 -0000 Author: ngie Date: Fri Jan 20 04:35:00 2017 New Revision: 312480 URL: https://svnweb.freebsd.org/changeset/base/312480 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libsmb/Makefile Modified: head/lib/libsmb/Makefile ============================================================================== --- head/lib/libsmb/Makefile Fri Jan 20 04:34:34 2017 (r312479) +++ head/lib/libsmb/Makefile Fri Jan 20 04:35:00 2017 (r312480) @@ -3,7 +3,7 @@ .include PACKAGE=lib${LIB} -CONTRIBDIR= ${.CURDIR}/../../contrib/smbfs +CONTRIBDIR= ${SRCTOP}/contrib/smbfs .PATH: ${CONTRIBDIR}/lib/smb LIB= smb From owner-svn-src-all@freebsd.org Fri Jan 20 04:35:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FFCCCB98E9; Fri, 20 Jan 2017 04:35:20 +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 0FDC912BC; Fri, 20 Jan 2017 04:35:19 +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 v0K4ZJVo024607; Fri, 20 Jan 2017 04:35:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4ZJvU024606; Fri, 20 Jan 2017 04:35:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200435.v0K4ZJvU024606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312481 - head/lib/libsmdb 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, 20 Jan 2017 04:35:20 -0000 Author: ngie Date: Fri Jan 20 04:35:18 2017 New Revision: 312481 URL: https://svnweb.freebsd.org/changeset/base/312481 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libsmdb/Makefile Modified: head/lib/libsmdb/Makefile ============================================================================== --- head/lib/libsmdb/Makefile Fri Jan 20 04:35:00 2017 (r312480) +++ head/lib/libsmdb/Makefile Fri Jan 20 04:35:18 2017 (r312481) @@ -1,7 +1,7 @@ # $FreeBSD$ PACKAGE=lib${LIB} -SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail +SENDMAIL_DIR=${SRCTOP}/contrib/sendmail .PATH: ${SENDMAIL_DIR}/libsmdb CFLAGS+=-I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I. From owner-svn-src-all@freebsd.org Fri Jan 20 04:35:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C865ECB9936; Fri, 20 Jan 2017 04:35:37 +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 8EF87143B; Fri, 20 Jan 2017 04:35:37 +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 v0K4Za4R024663; Fri, 20 Jan 2017 04:35:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4ZaUd024662; Fri, 20 Jan 2017 04:35:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200435.v0K4ZaUd024662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312482 - head/lib/libsm 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, 20 Jan 2017 04:35:37 -0000 Author: ngie Date: Fri Jan 20 04:35:36 2017 New Revision: 312482 URL: https://svnweb.freebsd.org/changeset/base/312482 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libsm/Makefile Modified: head/lib/libsm/Makefile ============================================================================== --- head/lib/libsm/Makefile Fri Jan 20 04:35:18 2017 (r312481) +++ head/lib/libsm/Makefile Fri Jan 20 04:35:36 2017 (r312482) @@ -3,7 +3,7 @@ .include PACKAGE=sendmail -SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail +SENDMAIL_DIR=${SRCTOP}/contrib/sendmail .PATH: ${SENDMAIL_DIR}/libsm CFLAGS+=-I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I. From owner-svn-src-all@freebsd.org Fri Jan 20 04:35:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09038CB9990; Fri, 20 Jan 2017 04:35: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 C50141591; Fri, 20 Jan 2017 04:35: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 v0K4Zn8I024719; Fri, 20 Jan 2017 04:35:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4ZnkJ024718; Fri, 20 Jan 2017 04:35:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200435.v0K4ZnkJ024718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312483 - head/lib/libsbuf 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, 20 Jan 2017 04:35:51 -0000 Author: ngie Date: Fri Jan 20 04:35:49 2017 New Revision: 312483 URL: https://svnweb.freebsd.org/changeset/base/312483 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libsbuf/Makefile Modified: head/lib/libsbuf/Makefile ============================================================================== --- head/lib/libsbuf/Makefile Fri Jan 20 04:35:36 2017 (r312482) +++ head/lib/libsbuf/Makefile Fri Jan 20 04:35:49 2017 (r312483) @@ -10,6 +10,6 @@ SHLIB_MAJOR = 6 SYMBOL_MAPS= ${.CURDIR}/Symbol.map VERSION_DEF= ${.CURDIR}/Version.def -.PATH: ${.CURDIR}/../../sys/kern +.PATH: ${SRCTOP}/sys/kern .include From owner-svn-src-all@freebsd.org Fri Jan 20 04:36:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35CE4CB9A45; Fri, 20 Jan 2017 04:36:08 +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 C36B11757; Fri, 20 Jan 2017 04:36: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 v0K4a6xp024780; Fri, 20 Jan 2017 04:36:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4a6N3024779; Fri, 20 Jan 2017 04:36:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200436.v0K4a6N3024779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312484 - head/lib/librt 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, 20 Jan 2017 04:36:08 -0000 Author: ngie Date: Fri Jan 20 04:36:06 2017 New Revision: 312484 URL: https://svnweb.freebsd.org/changeset/base/312484 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/librt/Makefile Modified: head/lib/librt/Makefile ============================================================================== --- head/lib/librt/Makefile Fri Jan 20 04:35:49 2017 (r312483) +++ head/lib/librt/Makefile Fri Jan 20 04:36:06 2017 (r312484) @@ -5,7 +5,7 @@ PACKAGE=lib${LIB} LIB=rt SHLIB_MAJOR= 1 -CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR} +CFLAGS+=-I${SRCTOP}/lib/libc/include -I${.CURDIR} .ifndef NO_THREAD_STACK_UNWIND CFLAGS+=-fexceptions .endif @@ -18,7 +18,7 @@ SRCS+= aio.c mq.c sigev_thread.c timer.c PRECIOUSLIB= -VERSION_DEF=${.CURDIR}/../libc/Versions.def +VERSION_DEF=${SRCTOP}/lib/libc/Versions.def SYMBOL_MAPS=${.CURDIR}/Symbol.map .if ${MK_TESTS} != "no" From owner-svn-src-all@freebsd.org Fri Jan 20 04:36:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ADBECB9AEA; Fri, 20 Jan 2017 04:36: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 3AD4C19E4; Fri, 20 Jan 2017 04:36: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 v0K4aSvx024834; Fri, 20 Jan 2017 04:36:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4aSSP024833; Fri, 20 Jan 2017 04:36:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200436.v0K4aSSP024833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312485 - head/lib/librpcsvc 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, 20 Jan 2017 04:36:29 -0000 Author: ngie Date: Fri Jan 20 04:36:28 2017 New Revision: 312485 URL: https://svnweb.freebsd.org/changeset/base/312485 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/librpcsvc/Makefile Modified: head/lib/librpcsvc/Makefile ============================================================================== --- head/lib/librpcsvc/Makefile Fri Jan 20 04:36:06 2017 (r312484) +++ head/lib/librpcsvc/Makefile Fri Jan 20 04:36:28 2017 (r312485) @@ -3,7 +3,7 @@ .include -.PATH: ${.CURDIR}/../../include/rpcsvc +.PATH: ${SRCTOP}/include/rpcsvc PACKAGE=lib${LIB} LIB= rpcsvc From owner-svn-src-all@freebsd.org Fri Jan 20 04:36:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74F5CCB9B63; Fri, 20 Jan 2017 04:36:49 +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 44F8A1BDB; Fri, 20 Jan 2017 04:36:49 +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 v0K4amv1024896; Fri, 20 Jan 2017 04:36:48 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4am8L024895; Fri, 20 Jan 2017 04:36:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200436.v0K4am8L024895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312486 - head/lib/librpcsec_gss 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, 20 Jan 2017 04:36:49 -0000 Author: ngie Date: Fri Jan 20 04:36:48 2017 New Revision: 312486 URL: https://svnweb.freebsd.org/changeset/base/312486 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/librpcsec_gss/Makefile Modified: head/lib/librpcsec_gss/Makefile ============================================================================== --- head/lib/librpcsec_gss/Makefile Fri Jan 20 04:36:28 2017 (r312485) +++ head/lib/librpcsec_gss/Makefile Fri Jan 20 04:36:48 2017 (r312486) @@ -8,11 +8,11 @@ SRCS+= rpcsec_gss.c rpcsec_gss_prot.c rp LIBADD= gssapi -VERSION_DEF= ${.CURDIR}/../libc/Versions.def +VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map -CFLAGS+= -I${.CURDIR}/../../include -CFLAGS+= -I${.CURDIR}/../../libc_rpc +CFLAGS+= -I${SRCTOP}/include +CFLAGS+= -I${SRCTOP}/lib/libc_rpc MK_PROFILE= no MAN= rpcsec_gss.3 From owner-svn-src-all@freebsd.org Fri Jan 20 04:37:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9561DCB9BCE; Fri, 20 Jan 2017 04:37: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 51A561CE7; Fri, 20 Jan 2017 04:37: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 v0K4b3AB024954; Fri, 20 Jan 2017 04:37:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4b3V6024953; Fri, 20 Jan 2017 04:37:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200437.v0K4b3V6024953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312487 - head/lib/libpe 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, 20 Jan 2017 04:37:04 -0000 Author: ngie Date: Fri Jan 20 04:37:03 2017 New Revision: 312487 URL: https://svnweb.freebsd.org/changeset/base/312487 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libpe/Makefile Modified: head/lib/libpe/Makefile ============================================================================== --- head/lib/libpe/Makefile Fri Jan 20 04:36:48 2017 (r312486) +++ head/lib/libpe/Makefile Fri Jan 20 04:37:03 2017 (r312487) @@ -3,7 +3,7 @@ INTERNALLIB= -ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ELFTCDIR= ${SRCTOP}/contrib/elftoolchain .PATH: ${ELFTCDIR}/libpe From owner-svn-src-all@freebsd.org Fri Jan 20 04:37:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD3ECCB9C29; Fri, 20 Jan 2017 04:37:23 +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 9B1241EA4; Fri, 20 Jan 2017 04:37:23 +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 v0K4bMXd025008; Fri, 20 Jan 2017 04:37:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4bM2H025007; Fri, 20 Jan 2017 04:37:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200437.v0K4bM2H025007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312488 - head/lib/libproc 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, 20 Jan 2017 04:37:24 -0000 Author: ngie Date: Fri Jan 20 04:37:22 2017 New Revision: 312488 URL: https://svnweb.freebsd.org/changeset/base/312488 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libproc/Makefile Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Fri Jan 20 04:37:03 2017 (r312487) +++ head/lib/libproc/Makefile Fri Jan 20 04:37:22 2017 (r312488) @@ -30,9 +30,9 @@ LIBADD+= elf procstat rtld_db util .if ${MK_CDDL} != "no" LIBADD+= ctf IGNORE_PRAGMA= YES -CFLAGS+= -I${.CURDIR}/../../cddl/contrib/opensolaris/lib/libctf/common \ - -I${.CURDIR}/../../sys/cddl/contrib/opensolaris/uts/common \ - -I${.CURDIR}/../../sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libctf/common \ + -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common \ + -I${SRCTOP}/sys/cddl/compat/opensolaris .else CFLAGS+= -DNO_CTF .endif From owner-svn-src-all@freebsd.org Fri Jan 20 04:38:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57700CB9CAB; Fri, 20 Jan 2017 04:38:56 +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 0D4491067; Fri, 20 Jan 2017 04:38:55 +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 v0K4ctCu025115; Fri, 20 Jan 2017 04:38:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4ctZp025114; Fri, 20 Jan 2017 04:38:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200438.v0K4ctZp025114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:38:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312489 - head/lib/libprocstat/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: Fri, 20 Jan 2017 04:38:56 -0000 Author: ngie Date: Fri Jan 20 04:38:54 2017 New Revision: 312489 URL: https://svnweb.freebsd.org/changeset/base/312489 Log: Use SRCTOP-relative paths and .CURDIR with :H instead of ".." specified paths This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libprocstat/zfs/Makefile Modified: head/lib/libprocstat/zfs/Makefile ============================================================================== --- head/lib/libprocstat/zfs/Makefile Fri Jan 20 04:37:22 2017 (r312488) +++ head/lib/libprocstat/zfs/Makefile Fri Jan 20 04:38:54 2017 (r312489) @@ -1,21 +1,21 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/.. +.PATH: ${.CURDIR:H} SRCS= zfs.c OBJS= zfs.o WARNS?= 1 -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include -CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common -CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys -CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/head -CFLAGS+= -I${.CURDIR}/.. +CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/lib/libumem +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/lib/libzpool/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/common/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/fs/zfs +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common/sys +CFLAGS+= -I${SRCTOP}/cddl/contrib/opensolaris/head +CFLAGS+= -I${.CURDIR:H} CFLAGS+= -DNEED_SOLARIS_BOOLEAN all: ${OBJS} From owner-svn-src-all@freebsd.org Fri Jan 20 04:39:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92B75CB9D51; Fri, 20 Jan 2017 04:39:37 +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 5FE831248; Fri, 20 Jan 2017 04:39:37 +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 v0K4daje025198; Fri, 20 Jan 2017 04:39:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4daKA025197; Fri, 20 Jan 2017 04:39:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200439.v0K4daKA025197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312490 - head/lib/libpcap 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, 20 Jan 2017 04:39:37 -0000 Author: ngie Date: Fri Jan 20 04:39:36 2017 New Revision: 312490 URL: https://svnweb.freebsd.org/changeset/base/312490 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libpcap/Makefile Modified: head/lib/libpcap/Makefile ============================================================================== --- head/lib/libpcap/Makefile Fri Jan 20 04:38:54 2017 (r312489) +++ head/lib/libpcap/Makefile Fri Jan 20 04:39:36 2017 (r312490) @@ -114,7 +114,7 @@ SHLIB_MAJOR= 8 # # Magic to grab sources out of src/contrib # -PCAP_DISTDIR?=${.CURDIR}/../../contrib/libpcap +PCAP_DISTDIR?=${SRCTOP}/contrib/libpcap CFLAGS+=-I${PCAP_DISTDIR} .PATH: ${PCAP_DISTDIR} .PATH: ${PCAP_DISTDIR}/bpf/net From owner-svn-src-all@freebsd.org Fri Jan 20 04:40:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 117F5CB9DFB; Fri, 20 Jan 2017 04:40:12 +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 D5712143C; Fri, 20 Jan 2017 04:40:11 +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 v0K4eAso025296; Fri, 20 Jan 2017 04:40:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4eAln025295; Fri, 20 Jan 2017 04:40:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200440.v0K4eAln025295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312491 - head/lib/libopie 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, 20 Jan 2017 04:40:12 -0000 Author: ngie Date: Fri Jan 20 04:40:10 2017 New Revision: 312491 URL: https://svnweb.freebsd.org/changeset/base/312491 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libopie/Makefile Modified: head/lib/libopie/Makefile ============================================================================== --- head/lib/libopie/Makefile Fri Jan 20 04:39:36 2017 (r312490) +++ head/lib/libopie/Makefile Fri Jan 20 04:40:10 2017 (r312491) @@ -3,7 +3,7 @@ # $FreeBSD$ # PACKAGE=lib${LIB} -OPIE_DIST?= ${.CURDIR}/../../contrib/opie +OPIE_DIST?= ${SRCTOP}/contrib/opie DIST_DIR= ${OPIE_DIST}/${.CURDIR:T} SHLIB_MAJOR= 8 From owner-svn-src-all@freebsd.org Fri Jan 20 04:40:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 949C0CB9E4E; Fri, 20 Jan 2017 04:40:56 +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 6486B164A; Fri, 20 Jan 2017 04:40:56 +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 v0K4etR0025363; Fri, 20 Jan 2017 04:40:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4etMm025362; Fri, 20 Jan 2017 04:40:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200440.v0K4etMm025362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312492 - head/lib/libnv 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, 20 Jan 2017 04:40:56 -0000 Author: ngie Date: Fri Jan 20 04:40:55 2017 New Revision: 312492 URL: https://svnweb.freebsd.org/changeset/base/312492 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libnv/Makefile Modified: head/lib/libnv/Makefile ============================================================================== --- head/lib/libnv/Makefile Fri Jan 20 04:40:10 2017 (r312491) +++ head/lib/libnv/Makefile Fri Jan 20 04:40:55 2017 (r312492) @@ -8,8 +8,8 @@ SHLIBDIR?= /lib LIB= nv SHLIB_MAJOR= 0 -.PATH: ${.CURDIR}/../../sys/contrib/libnv ${.CURDIR}/../../sys/sys -CFLAGS+=-I${.CURDIR}/../../sys -I${.CURDIR} +.PATH: ${SRCTOP}/sys/contrib/libnv ${SRCTOP}/sys/sys +CFLAGS+=-I${SRCTOP}/sys -I${.CURDIR} SRCS= cnvlist.c SRCS+= dnvlist.c From owner-svn-src-all@freebsd.org Fri Jan 20 04:41:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB963CB9FAD; Fri, 20 Jan 2017 04:41:54 +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 8B9F819A2; Fri, 20 Jan 2017 04:41:54 +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 v0K4frSV026179; Fri, 20 Jan 2017 04:41:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4frja026178; Fri, 20 Jan 2017 04:41:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200441.v0K4frja026178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312493 - head/lib/libngatm 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, 20 Jan 2017 04:41:54 -0000 Author: ngie Date: Fri Jan 20 04:41:53 2017 New Revision: 312493 URL: https://svnweb.freebsd.org/changeset/base/312493 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libngatm/Makefile Modified: head/lib/libngatm/Makefile ============================================================================== --- head/lib/libngatm/Makefile Fri Jan 20 04:40:55 2017 (r312492) +++ head/lib/libngatm/Makefile Fri Jan 20 04:41:53 2017 (r312493) @@ -8,8 +8,8 @@ SHLIB_MAJOR= 4 MAN= libngatm.3 uniaddr.3 unifunc.3 unimsg.3 unisap.3 unistruct.3 # source of the library lives in contrib -SDIR= ${.CURDIR}/../../sys -CTRB= ${.CURDIR}/../../contrib/ngatm +SDIR= ${SRCTOP}/sys +CTRB= ${SRCTOP}/contrib/ngatm LIBBASE= ${SDIR}/contrib/ngatm CFLAGS+= -I${LIBBASE} -I${.OBJDIR} -I${CTRB}/libngatm From owner-svn-src-all@freebsd.org Fri Jan 20 04:42:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19C7CCB9004; Fri, 20 Jan 2017 04:42: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 DDB891B1A; Fri, 20 Jan 2017 04:42:12 +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 v0K4gBua029170; Fri, 20 Jan 2017 04:42:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4gBDw029169; Fri, 20 Jan 2017 04:42:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200442.v0K4gBDw029169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312494 - head/lib/libmp 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, 20 Jan 2017 04:42:13 -0000 Author: ngie Date: Fri Jan 20 04:42:11 2017 New Revision: 312494 URL: https://svnweb.freebsd.org/changeset/base/312494 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libmp/Makefile Modified: head/lib/libmp/Makefile ============================================================================== --- head/lib/libmp/Makefile Fri Jan 20 04:41:53 2017 (r312493) +++ head/lib/libmp/Makefile Fri Jan 20 04:42:11 2017 (r312494) @@ -10,9 +10,9 @@ MAN= libmp.3 INCS= mp.h SRCS= mpasbn.c -CFLAGS+= -I${.CURDIR}/../../crypto +CFLAGS+= -I${SRCTOP}/crypto -VERSION_DEF= ${.CURDIR}/../libc/Versions.def +VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map .if ${MK_TESTS} != "no" From owner-svn-src-all@freebsd.org Fri Jan 20 04:42:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DDF1CB905A; Fri, 20 Jan 2017 04:42: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 D1F701D18; Fri, 20 Jan 2017 04:42:44 +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 v0K4gh3t029229; Fri, 20 Jan 2017 04:42:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4ghkn029228; Fri, 20 Jan 2017 04:42:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200442.v0K4ghkn029228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312495 - head/lib/libmilter 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, 20 Jan 2017 04:42:45 -0000 Author: ngie Date: Fri Jan 20 04:42:43 2017 New Revision: 312495 URL: https://svnweb.freebsd.org/changeset/base/312495 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libmilter/Makefile Modified: head/lib/libmilter/Makefile ============================================================================== --- head/lib/libmilter/Makefile Fri Jan 20 04:42:11 2017 (r312494) +++ head/lib/libmilter/Makefile Fri Jan 20 04:42:43 2017 (r312495) @@ -3,7 +3,7 @@ .include PACKAGE=sendmail -SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail +SENDMAIL_DIR=${SRCTOP}/contrib/sendmail .PATH: ${SENDMAIL_DIR}/libmilter ${SENDMAIL_DIR}/libsm CFLAGS+=-I${SENDMAIL_DIR}/src -I${SENDMAIL_DIR}/include -I. From owner-svn-src-all@freebsd.org Fri Jan 20 04:43:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CF28CB90D1; Fri, 20 Jan 2017 04:43: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 3CA991E9C; Fri, 20 Jan 2017 04:43:22 +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 v0K4hLuQ029301; Fri, 20 Jan 2017 04:43:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4hLOa029300; Fri, 20 Jan 2017 04:43:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200443.v0K4hLOa029300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:43:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312496 - head/lib/libmd 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, 20 Jan 2017 04:43:22 -0000 Author: ngie Date: Fri Jan 20 04:43:21 2017 New Revision: 312496 URL: https://svnweb.freebsd.org/changeset/base/312496 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libmd/Makefile Modified: head/lib/libmd/Makefile ============================================================================== --- head/lib/libmd/Makefile Fri Jan 20 04:42:43 2017 (r312495) +++ head/lib/libmd/Makefile Fri Jan 20 04:43:21 2017 (r312496) @@ -78,11 +78,11 @@ CLEANFILES+= md[245]hl.c md[245].ref md[ # in which case: # * macros are used to rename symbols to libcrypt internal names # * no weak aliases are generated -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../sys/crypto/sha2 -CFLAGS+= -I${.CURDIR}/../../sys/crypto/skein +CFLAGS+= -I${.CURDIR} -I${SRCTOP}/sys/crypto/sha2 +CFLAGS+= -I${SRCTOP}/sys/crypto/skein CFLAGS+= -DWEAK_REFS -.PATH: ${.CURDIR}/${MACHINE_ARCH} ${.CURDIR}/../../sys/crypto/sha2 -.PATH: ${.CURDIR}/../../sys/crypto/skein ${.CURDIR}/../../sys/crypto/skein/${MACHINE_ARCH} +.PATH: ${.CURDIR}/${MACHINE_ARCH} ${SRCTOP}/sys/crypto/sha2 +.PATH: ${SRCTOP}/sys/crypto/skein ${SRCTOP}/sys/crypto/skein/${MACHINE_ARCH} .if exists(${MACHINE_ARCH}/sha.S) SRCS+= sha.S From owner-svn-src-all@freebsd.org Fri Jan 20 04:45:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB7E9CB9153; Fri, 20 Jan 2017 04:45: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 AB258102B; Fri, 20 Jan 2017 04:45: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 v0K4j9xN029435; Fri, 20 Jan 2017 04:45:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4j9KM029434; Fri, 20 Jan 2017 04:45:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200445.v0K4j9KM029434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312497 - head/lib/libmagic 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, 20 Jan 2017 04:45:11 -0000 Author: ngie Date: Fri Jan 20 04:45:09 2017 New Revision: 312497 URL: https://svnweb.freebsd.org/changeset/base/312497 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libmagic/Makefile Modified: head/lib/libmagic/Makefile ============================================================================== --- head/lib/libmagic/Makefile Fri Jan 20 04:43:21 2017 (r312496) +++ head/lib/libmagic/Makefile Fri Jan 20 04:45:09 2017 (r312497) @@ -2,7 +2,7 @@ # Copyright (c) David E. O'Brien, 2000-2004, 2006, 2009 PACKAGE=lib${LIB} -CONTRDIR= ${.CURDIR}/../../contrib/file +CONTRDIR= ${SRCTOP}/contrib/file .PATH: ${CONTRDIR}/src .PATH: ${CONTRDIR}/doc From owner-svn-src-all@freebsd.org Fri Jan 20 04:46:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3905CB91D3; Fri, 20 Jan 2017 04:46: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 A335C11B2; Fri, 20 Jan 2017 04:46: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 v0K4kKwh029527; Fri, 20 Jan 2017 04:46:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4kKd2029526; Fri, 20 Jan 2017 04:46:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200446.v0K4kKd2029526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312498 - head/lib/liblzma 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, 20 Jan 2017 04:46:21 -0000 Author: ngie Date: Fri Jan 20 04:46:20 2017 New Revision: 312498 URL: https://svnweb.freebsd.org/changeset/base/312498 Log: Use SRCTOP-relative paths and .CURDIR with :H instead of ".." specified paths This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/liblzma/Makefile Modified: head/lib/liblzma/Makefile ============================================================================== --- head/lib/liblzma/Makefile Fri Jan 20 04:45:09 2017 (r312497) +++ head/lib/liblzma/Makefile Fri Jan 20 04:46:20 2017 (r312498) @@ -2,9 +2,9 @@ PACKAGE=lib${LIB} LIB= lzma -LZMADIR= ${.CURDIR}/../../contrib/xz/src/liblzma +LZMADIR= ${SRCTOP}/contrib/xz/src/liblzma -.PATH: ${LZMADIR}/../common +.PATH: ${LZMADIR:H}/common SRCS+= tuklib_physmem.c tuklib_cpucores.c .PATH: ${LZMADIR}/api/lzma @@ -145,7 +145,7 @@ CFLAGS+= -DHAVE_CONFIG_H \ -I${LZMADIR}/lzma \ -I${LZMADIR}/delta \ -I${LZMADIR}/simple \ - -I${LZMADIR}/../common + -I${LZMADIR:H}/common LIBADD+= pthread From owner-svn-src-all@freebsd.org Fri Jan 20 04:50:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BFC5CB9276; Fri, 20 Jan 2017 04:50:20 +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 2D5F41355; Fri, 20 Jan 2017 04:50:20 +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 v0K4oJi5029730; Fri, 20 Jan 2017 04:50:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4oJs7029729; Fri, 20 Jan 2017 04:50:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200450.v0K4oJs7029729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312499 - head/lib/libldns 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, 20 Jan 2017 04:50:20 -0000 Author: ngie Date: Fri Jan 20 04:50:19 2017 New Revision: 312499 URL: https://svnweb.freebsd.org/changeset/base/312499 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libldns/Makefile Modified: head/lib/libldns/Makefile ============================================================================== --- head/lib/libldns/Makefile Fri Jan 20 04:46:20 2017 (r312498) +++ head/lib/libldns/Makefile Fri Jan 20 04:50:19 2017 (r312499) @@ -1,7 +1,7 @@ # $FreeBSD$ # Vendor sources and generated files -LDNSDIR = ${.CURDIR}/../../contrib/ldns +LDNSDIR = ${SRCTOP}/contrib/ldns PACKAGE=lib${LIB} .PATH: ${LDNSDIR} ${LDNSDIR}/compat From owner-svn-src-all@freebsd.org Fri Jan 20 04:50:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1CFFCB92D0; Fri, 20 Jan 2017 04:50:47 +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 81A931568; Fri, 20 Jan 2017 04:50:47 +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 v0K4okE2029789; Fri, 20 Jan 2017 04:50:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4okdv029788; Fri, 20 Jan 2017 04:50:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200450.v0K4okdv029788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312500 - head/lib/libkiconv 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, 20 Jan 2017 04:50:47 -0000 Author: ngie Date: Fri Jan 20 04:50:46 2017 New Revision: 312500 URL: https://svnweb.freebsd.org/changeset/base/312500 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libkiconv/Makefile Modified: head/lib/libkiconv/Makefile ============================================================================== --- head/lib/libkiconv/Makefile Fri Jan 20 04:50:19 2017 (r312499) +++ head/lib/libkiconv/Makefile Fri Jan 20 04:50:46 2017 (r312500) @@ -17,7 +17,7 @@ MLINKS+= kiconv.3 kiconv_add_xlat16_cspa kiconv.3 kiconv_add_xlat16_cspairs.3 \ kiconv.3 kiconv_add_xlat16_table.3 -CFLAGS+= -I${.CURDIR}/../../sys +CFLAGS+= -I${SRCTOP}/sys WARNS?= 1 From owner-svn-src-all@freebsd.org Fri Jan 20 04:51:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4E9DCB943C; Fri, 20 Jan 2017 04:51:37 +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 B398D1772; Fri, 20 Jan 2017 04:51:37 +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 v0K4paaX030598; Fri, 20 Jan 2017 04:51:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4parv030597; Fri, 20 Jan 2017 04:51:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200451.v0K4parv030597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312501 - head/lib/libcom_err 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, 20 Jan 2017 04:51:38 -0000 Author: ngie Date: Fri Jan 20 04:51:36 2017 New Revision: 312501 URL: https://svnweb.freebsd.org/changeset/base/312501 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libcom_err/Makefile Modified: head/lib/libcom_err/Makefile ============================================================================== --- head/lib/libcom_err/Makefile Fri Jan 20 04:50:46 2017 (r312500) +++ head/lib/libcom_err/Makefile Fri Jan 20 04:51:36 2017 (r312501) @@ -5,7 +5,7 @@ LIB= com_err SRCS= com_err.c error.c INCS= ${COM_ERRDIR}/com_err.h ${COM_ERRDIR}/com_right.h MAN= com_err.3 -COM_ERRDIR= ${.CURDIR}/../../contrib/com_err +COM_ERRDIR= ${SRCTOP}/contrib/com_err CFLAGS+= -I${COM_ERRDIR} LDFLAGS= -Wl,--no-undefined From owner-svn-src-all@freebsd.org Fri Jan 20 04:52:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 445A6CB948D; Fri, 20 Jan 2017 04:52: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 136601976; Fri, 20 Jan 2017 04:52:02 +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 v0K4q1Ze031321; Fri, 20 Jan 2017 04:52:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4q1UH031320; Fri, 20 Jan 2017 04:52:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200452.v0K4q1UH031320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:52:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312502 - head/lib/libcompat 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, 20 Jan 2017 04:52:02 -0000 Author: ngie Date: Fri Jan 20 04:52:00 2017 New Revision: 312502 URL: https://svnweb.freebsd.org/changeset/base/312502 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libcompat/Makefile Modified: head/lib/libcompat/Makefile ============================================================================== --- head/lib/libcompat/Makefile Fri Jan 20 04:51:36 2017 (r312501) +++ head/lib/libcompat/Makefile Fri Jan 20 04:52:00 2017 (r312502) @@ -3,7 +3,7 @@ PACKAGE=lib${LIB} LIB= compat -CFLAGS+=-DLIBC_SCCS -DSYSLIBC_SCCS -I${.CURDIR}/../libc/locale +CFLAGS+=-DLIBC_SCCS -DSYSLIBC_SCCS -I${SRCTOP}/lib/libc/locale NO_PIC= WARNS?= 0 From owner-svn-src-all@freebsd.org Fri Jan 20 04:52:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E132CB94F6; Fri, 20 Jan 2017 04:52: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 E201F1C53; Fri, 20 Jan 2017 04:52:30 +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 v0K4qUYQ033470; Fri, 20 Jan 2017 04:52:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4qUvh033469; Fri, 20 Jan 2017 04:52:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200452.v0K4qUvh033469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312503 - head/lib/libcrypt 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, 20 Jan 2017 04:52:31 -0000 Author: ngie Date: Fri Jan 20 04:52:29 2017 New Revision: 312503 URL: https://svnweb.freebsd.org/changeset/base/312503 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libcrypt/Makefile Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Fri Jan 20 04:52:00 2017 (r312502) +++ head/lib/libcrypt/Makefile Fri Jan 20 04:52:29 2017 (r312503) @@ -10,7 +10,7 @@ SHLIBDIR?= /lib SHLIB_MAJOR= 5 LIB= crypt -.PATH: ${.CURDIR}/../libmd ${.CURDIR}/../../sys/crypto/sha2 +.PATH: ${SRCTOP}/lib/libmd ${SRCTOP}/sys/crypto/sha2 SRCS= crypt.c misc.c \ crypt-md5.c md5c.c \ crypt-nthash.c md4c.c \ @@ -19,12 +19,12 @@ SRCS= crypt.c misc.c \ MAN= crypt.3 MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_r.3 \ crypt.3 crypt_set_format.3 -CFLAGS+= -I${.CURDIR}/../libmd -I${.CURDIR}/../libutil \ - -I${.CURDIR}/../../sys/crypto/sha2 +CFLAGS+= -I${SRCTOP}/lib/libmd -I${SRCTOP}/lib/libutil \ + -I${SRCTOP}/sys/crypto/sha2 # Pull in the strong crypto, if it is present. -.if exists(${.CURDIR}/../../secure/lib/libcrypt) && ${MK_CRYPT} != "no" -.PATH: ${.CURDIR}/../../secure/lib/libcrypt +.if exists(${SRCTOP}/secure/lib/libcrypt) && ${MK_CRYPT} != "no" +.PATH: ${SRCTOP}/secure/lib/libcrypt SRCS+= crypt-des.c crypt-blowfish.c blowfish.c CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BLOWFISH .endif From owner-svn-src-all@freebsd.org Fri Jan 20 04:53:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE8F6CB957E; Fri, 20 Jan 2017 04:53: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 7E7461E2D; Fri, 20 Jan 2017 04:53: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 v0K4r05B033545; Fri, 20 Jan 2017 04:53:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4r0k1033544; Fri, 20 Jan 2017 04:53:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200453.v0K4r0k1033544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312504 - head/lib/libcxxrt 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, 20 Jan 2017 04:53:01 -0000 Author: ngie Date: Fri Jan 20 04:53:00 2017 New Revision: 312504 URL: https://svnweb.freebsd.org/changeset/base/312504 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libcxxrt/Makefile Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Fri Jan 20 04:52:29 2017 (r312503) +++ head/lib/libcxxrt/Makefile Fri Jan 20 04:53:00 2017 (r312504) @@ -1,7 +1,7 @@ # $FreeBSD$ PACKAGE= clibs -SRCDIR= ${.CURDIR}/../../contrib/libcxxrt +SRCDIR= ${SRCTOP}/contrib/libcxxrt SHLIB_MAJOR= 1 SHLIBDIR?= /lib From owner-svn-src-all@freebsd.org Fri Jan 20 04:53:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7B09CB95D9; Fri, 20 Jan 2017 04:53: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 778741FA1; Fri, 20 Jan 2017 04:53: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 v0K4rKlX033599; Fri, 20 Jan 2017 04:53:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4rKM6033598; Fri, 20 Jan 2017 04:53:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200453.v0K4rKM6033598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312505 - head/lib/libgssapi 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, 20 Jan 2017 04:53:21 -0000 Author: ngie Date: Fri Jan 20 04:53:20 2017 New Revision: 312505 URL: https://svnweb.freebsd.org/changeset/base/312505 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libgssapi/Makefile Modified: head/lib/libgssapi/Makefile ============================================================================== --- head/lib/libgssapi/Makefile Fri Jan 20 04:53:00 2017 (r312504) +++ head/lib/libgssapi/Makefile Fri Jan 20 04:53:20 2017 (r312505) @@ -3,7 +3,7 @@ PACKAGE=lib${LIB} LIB= gssapi SHLIB_MAJOR= 10 -VERSION_DEF= ${.CURDIR}/../libc/Versions.def +VERSION_DEF= ${SRCTOP}/lib/libc/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map SRCS= From owner-svn-src-all@freebsd.org Fri Jan 20 04:53:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6161CB9620; Fri, 20 Jan 2017 04:53:27 +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 A2D1D1FF8; Fri, 20 Jan 2017 04:53: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 v0K4rQ0u033649; Fri, 20 Jan 2017 04:53:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4rQEJ033647; Fri, 20 Jan 2017 04:53:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200453.v0K4rQEJ033647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312506 - in head/lib/libiconv_modules: . mapper_parallel 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, 20 Jan 2017 04:53:28 -0000 Author: ngie Date: Fri Jan 20 04:53:26 2017 New Revision: 312506 URL: https://svnweb.freebsd.org/changeset/base/312506 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libiconv_modules/Makefile.inc head/lib/libiconv_modules/mapper_parallel/Makefile Modified: head/lib/libiconv_modules/Makefile.inc ============================================================================== --- head/lib/libiconv_modules/Makefile.inc Fri Jan 20 04:53:20 2017 (r312505) +++ head/lib/libiconv_modules/Makefile.inc Fri Jan 20 04:53:26 2017 (r312506) @@ -1,10 +1,10 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../libc/iconv +.PATH: ${SRCTOP}/lib/libc/iconv SHLIB_MAJOR= 4 WARNS?= 6 -CFLAGS+= -I${.CURDIR}/../../libc/iconv +CFLAGS+= -I${SRCTOP}/lib/libc/iconv CFLAGS+= -Dbool=_Bool Modified: head/lib/libiconv_modules/mapper_parallel/Makefile ============================================================================== --- head/lib/libiconv_modules/mapper_parallel/Makefile Fri Jan 20 04:53:20 2017 (r312505) +++ head/lib/libiconv_modules/mapper_parallel/Makefile Fri Jan 20 04:53:26 2017 (r312506) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../mapper_serial +.PATH: ${.CURDIR:H}/mapper_serial SHLIB= mapper_parallel SRCS+= citrus_mapper_serial.c From owner-svn-src-all@freebsd.org Fri Jan 20 04:53:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB581CB96B1; Fri, 20 Jan 2017 04:53: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 A30311193; Fri, 20 Jan 2017 04:53: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 v0K4reNA033702; Fri, 20 Jan 2017 04:53:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4reId033701; Fri, 20 Jan 2017 04:53:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200453.v0K4reId033701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:53:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312507 - head/lib/libexecinfo 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, 20 Jan 2017 04:53:42 -0000 Author: ngie Date: Fri Jan 20 04:53:40 2017 New Revision: 312507 URL: https://svnweb.freebsd.org/changeset/base/312507 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libexecinfo/Makefile Modified: head/lib/libexecinfo/Makefile ============================================================================== --- head/lib/libexecinfo/Makefile Fri Jan 20 04:53:26 2017 (r312506) +++ head/lib/libexecinfo/Makefile Fri Jan 20 04:53:40 2017 (r312507) @@ -1,7 +1,7 @@ # $FreeBSD$ PACKAGE=lib${LIB} -LIBEXECINFO= ${.CURDIR}/../../contrib/libexecinfo +LIBEXECINFO= ${SRCTOP}/contrib/libexecinfo LIB= execinfo SHLIB_MAJOR= 1 From owner-svn-src-all@freebsd.org Fri Jan 20 04:53:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56357CB96E7; Fri, 20 Jan 2017 04:53:46 +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 1E1791214; Fri, 20 Jan 2017 04:53:46 +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 v0K4rjS8033752; Fri, 20 Jan 2017 04:53:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4rj4E033751; Fri, 20 Jan 2017 04:53:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200453.v0K4rj4E033751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312508 - head/lib/libexpat 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, 20 Jan 2017 04:53:46 -0000 Author: ngie Date: Fri Jan 20 04:53:45 2017 New Revision: 312508 URL: https://svnweb.freebsd.org/changeset/base/312508 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libexpat/Makefile Modified: head/lib/libexpat/Makefile ============================================================================== --- head/lib/libexpat/Makefile Fri Jan 20 04:53:40 2017 (r312507) +++ head/lib/libexpat/Makefile Fri Jan 20 04:53:45 2017 (r312508) @@ -1,7 +1,7 @@ # $FreeBSD$ PACKAGE=lib${LIB} -EXPAT= ${.CURDIR}/../../contrib/expat +EXPAT= ${SRCTOP}/contrib/expat LIB= bsdxml SHLIBDIR?= /lib From owner-svn-src-all@freebsd.org Fri Jan 20 04:53:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96443CB9732; Fri, 20 Jan 2017 04:53: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 65BD512AF; Fri, 20 Jan 2017 04:53: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 v0K4roqK033803; Fri, 20 Jan 2017 04:53:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4roia033802; Fri, 20 Jan 2017 04:53:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200453.v0K4roia033802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312509 - head/lib/libevent 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, 20 Jan 2017 04:53:51 -0000 Author: ngie Date: Fri Jan 20 04:53:50 2017 New Revision: 312509 URL: https://svnweb.freebsd.org/changeset/base/312509 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libevent/Makefile Modified: head/lib/libevent/Makefile ============================================================================== --- head/lib/libevent/Makefile Fri Jan 20 04:53:45 2017 (r312508) +++ head/lib/libevent/Makefile Fri Jan 20 04:53:50 2017 (r312509) @@ -1,7 +1,7 @@ # $FreeBSD$ PACKAGE=lib${LIB} -.PATH: ${.CURDIR}/../../contrib/pf/libevent +.PATH: ${SRCTOP}/contrib/pf/libevent .include From owner-svn-src-all@freebsd.org Fri Jan 20 04:54:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4707DCB97C1; Fri, 20 Jan 2017 04:54:11 +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 0BD0614FF; Fri, 20 Jan 2017 04:54: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 v0K4sAeq033865; Fri, 20 Jan 2017 04:54:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4sASc033864; Fri, 20 Jan 2017 04:54:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200454.v0K4sASc033864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312510 - head/lib/libelf 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, 20 Jan 2017 04:54:11 -0000 Author: ngie Date: Fri Jan 20 04:54:09 2017 New Revision: 312510 URL: https://svnweb.freebsd.org/changeset/base/312510 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libelf/Makefile Modified: head/lib/libelf/Makefile ============================================================================== --- head/lib/libelf/Makefile Fri Jan 20 04:53:50 2017 (r312509) +++ head/lib/libelf/Makefile Fri Jan 20 04:54:09 2017 (r312510) @@ -82,7 +82,7 @@ CLEANFILES= ${GENSRCS} CLEANDIRS= sys CFLAGS+= -I. -I${SRCDIR} -I${ELFTCDIR}/common -sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET} .NOMETA +sys/elf32.h sys/elf64.h sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA mkdir -p ${.OBJDIR}/sys ln -sf ${.ALLSRC} ${.TARGET} From owner-svn-src-all@freebsd.org Fri Jan 20 04:54:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1ED0CB9809; Fri, 20 Jan 2017 04:54: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 6CAC41643; Fri, 20 Jan 2017 04:54:22 +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 v0K4sLIR033915; Fri, 20 Jan 2017 04:54:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4sLLQ033914; Fri, 20 Jan 2017 04:54:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200454.v0K4sLLQ033914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312511 - head/lib/libdwarf 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, 20 Jan 2017 04:54:22 -0000 Author: ngie Date: Fri Jan 20 04:54:21 2017 New Revision: 312511 URL: https://svnweb.freebsd.org/changeset/base/312511 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libdwarf/Makefile Modified: head/lib/libdwarf/Makefile ============================================================================== --- head/lib/libdwarf/Makefile Fri Jan 20 04:54:09 2017 (r312510) +++ head/lib/libdwarf/Makefile Fri Jan 20 04:54:21 2017 (r312511) @@ -94,7 +94,7 @@ CLEANFILES= ${GENSRCS} CLEANDIRS= sys CFLAGS+= -I. -I${SRCDIR} -I${ELFTCDIR}/common -I${ELFTCDIR}/libelf -sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET} .NOMETA +sys/elf32.h sys/elf64.h sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA mkdir -p ${.OBJDIR}/sys ln -sf ${.ALLSRC} ${.TARGET} From owner-svn-src-all@freebsd.org Fri Jan 20 04:55:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49BE5CB98CC; Fri, 20 Jan 2017 04:55: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 197CE1B25; Fri, 20 Jan 2017 04:55: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 v0K4tF0c034019; Fri, 20 Jan 2017 04:55:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K4tFUM034018; Fri, 20 Jan 2017 04:55:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200455.v0K4tFUM034018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 04:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312512 - head/lib/libdevdctl/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: Fri, 20 Jan 2017 04:55:16 -0000 Author: ngie Date: Fri Jan 20 04:55:14 2017 New Revision: 312512 URL: https://svnweb.freebsd.org/changeset/base/312512 Log: Use .CURDIR:H instead of .CURDIR to simplify pathing in output, etc MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libdevdctl/tests/Makefile Modified: head/lib/libdevdctl/tests/Makefile ============================================================================== --- head/lib/libdevdctl/tests/Makefile Fri Jan 20 04:54:21 2017 (r312511) +++ head/lib/libdevdctl/tests/Makefile Fri Jan 20 04:55:14 2017 (r312512) @@ -2,7 +2,7 @@ TESTSDIR= ${TESTSBASE}/lib/libdevdctl -.PATH: ${.CURDIR}/.. +.PATH: ${.CURDIR:H} PLAIN_TESTS_CXX= libdevdctl_unittest From owner-svn-src-all@freebsd.org Fri Jan 20 05:35:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53F30CB9110; Fri, 20 Jan 2017 05:35:32 +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 0F5171AAB; Fri, 20 Jan 2017 05:35:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 741F110450B0; Fri, 20 Jan 2017 16:35:21 +1100 (AEDT) Date: Fri, 20 Jan 2017 16:35:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sean Bruno cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312434 - head/sys/sys In-Reply-To: <201701191958.v0JJw98r009581@repo.freebsd.org> Message-ID: <20170120162524.D1727@besplex.bde.org> References: <201701191958.v0JJw98r009581@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=H7qr+6Qi c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=Ti_X0qcXNKnn0ZM1Vb4A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2017 05:35:32 -0000 On Thu, 19 Jan 2017, Sean Bruno wrote: > Author: sbruno > Date: Thu Jan 19 19:58:08 2017 > New Revision: 312434 > URL: https://svnweb.freebsd.org/changeset/base/312434 > > Log: > Adjust gtaskqueue startup again so that we catch the !SMP case and > users that choose not to use EARLY_AP_STARTUP. > > There is still an initialization issue/panic with !SMP and !EARLY_AP_STARTUP > that we have yet to resolve. > > Submitted by: bde It is more for "legacy" (non-MSI) interrupts with most of the 8 combinations SMP, EARLY_AP_STARTUP and (ncpus > 1). Some combinations work, but not the simplest ones with ncpus == 1 since the complications for the complex cases affect the simplest cases adversely. Bruce From owner-svn-src-all@freebsd.org Fri Jan 20 05:45:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CA75CB92CE; Fri, 20 Jan 2017 05:45:08 +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 2F29B1F72; Fri, 20 Jan 2017 05:45:08 +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 v0K5j7uS054349; Fri, 20 Jan 2017 05:45:07 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K5j7RQ054348; Fri, 20 Jan 2017 05:45:07 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200545.v0K5j7RQ054348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 05:45:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312513 - head/sys/modules/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: Fri, 20 Jan 2017 05:45:08 -0000 Author: ngie Date: Fri Jan 20 05:45:07 2017 New Revision: 312513 URL: https://svnweb.freebsd.org/changeset/base/312513 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/modules/ath/Makefile Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Fri Jan 20 04:55:14 2017 (r312512) +++ head/sys/modules/ath/Makefile Fri Jan 20 05:45:07 2017 (r312513) @@ -31,8 +31,8 @@ ATH_RATE?= sample # tx rate control algorithm -.PATH: ${.CURDIR}/../../dev/ath -.PATH: ${.CURDIR}/../../dev/ath/ath_hal +.PATH: ${SRCTOP}/sys/dev/ath +.PATH: ${SRCTOP}/sys/dev/ath/ath_hal KMOD= if_ath SRCS= if_ath.c if_ath_alq.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c @@ -46,7 +46,7 @@ SRCS+= device_if.h bus_if.h pci_if.h opt # # AR5210 support; these are first generation 11a-only devices. # -.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5210 +.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5210 SRCS+= ah_eeprom_v1.c \ ar5210_attach.c ar5210_beacon.c ar5210_interrupts.c \ ar5210_keycache.c ar5210_misc.c ar5210_phy.c ar5210_power.c \ @@ -56,7 +56,7 @@ SRCS+= ah_eeprom_v1.c \ # AR5211 support; these are second generation 11b/g/a devices # (but 11g was OFDM only and is not supported). # -.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5211 +.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5211 SRCS+= ar5211_attach.c ar5211_beacon.c ar5211_interrupts.c \ ar5211_keycache.c ar5211_misc.c ar5211_phy.c ar5211_power.c \ ar5211_recv.c ar5211_reset.c ar5211_xmit.c @@ -64,7 +64,7 @@ SRCS+= ar5211_attach.c ar5211_beacon.c a # # AR5212 support; this covers all other pci/cardbus legacy parts. # -.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5212 +.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5212 SRCS+= ar5212_ani.c ar5212_attach.c ar5212_beacon.c ar5212_eeprom.c \ ar5212_gpio.c ar5212_interrupts.c ar5212_keycache.c ar5212_misc.c \ ar5212_phy.c ar5212_power.c ar5212_recv.c ar5212_reset.c \ @@ -85,7 +85,7 @@ SRCS+= ar5413.c # NB: 9160 depends on 5416 but 5416 does not require 9160 # # + 5416 (Owl) -.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5416 +.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar5416 SRCS+= ah_eeprom_v14.c ah_eeprom_v4k.c \ ar5416_ani.c ar5416_attach.c ar5416_beacon.c ar5416_btcoex.c \ ar5416_cal.c ar5416_cal_iq.c ar5416_cal_adcgain.c ar5416_cal_adcdc.c \ @@ -97,7 +97,7 @@ SRCS+= ah_eeprom_v14.c ah_eeprom_v4k.c \ SRCS+= ar2133.c # + AR9160 (Sowl) -.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9001 +.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar9001 SRCS+= ar9160_attach.c # + AR9130 - (Sowl) - Embedded (AR913x SoC) @@ -111,7 +111,7 @@ SRCS+= ar9130_attach.c ar9130_eeprom.c a # AR9002 series chips # + AR9220/AR9280 - Merlin -.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9002 +.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar9002 SRCS+= ar9280.c ar9280_attach.c ar9280_olc.c # + AR9285 - Kite @@ -119,13 +119,13 @@ SRCS+= ar9285.c ar9285_reset.c ar9285_at SRCS+= ar9285_diversity.c ar9285_btcoex.c # + AR9287 - Kiwi -.PATH: ${.CURDIR}/../../dev/ath/ath_hal +.PATH: ${SRCTOP}/sys/dev/ath/ath_hal SRCS+= ah_eeprom_9287.c -.PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar9002 +.PATH: ${SRCTOP}/sys/dev/ath/ath_hal/ar9002 SRCS+= ar9287.c ar9287_reset.c ar9287_attach.c ar9287_cal.c ar9287_olc.c # + AR9300 HAL -.PATH: ${.CURDIR}/../../contrib/dev/ath/ath_hal/ar9300 +.PATH: ${SRCTOP}/sys/contrib/dev/ath/ath_hal/ar9300 SRCS+= ar9300_interrupts.c ar9300_radar.c ar9300_ani.c ar9300_keycache.c SRCS+= ar9300_radio.c ar9300_xmit.c ar9300_attach.c ar9300_mci.c ar9300_stub.c SRCS+= ar9300_xmit_ds.c ar9300_beacon.c ar9300_misc.c ar9300_recv.c @@ -135,22 +135,22 @@ SRCS+= ar9300_power.c ar9300_timer.c ar9 # NB: rate control is bound to the driver by symbol names so only pick one .if ${ATH_RATE} == "sample" -.PATH: ${.CURDIR}/../../dev/ath/ath_rate/sample +.PATH: ${SRCTOP}/sys/dev/ath/ath_rate/sample SRCS+= sample.c .elif ${ATH_RATE} == "onoe" -.PATH: ${.CURDIR}/../../dev/ath/ath_rate/onoe +.PATH: ${SRCTOP}/sys/dev/ath/ath_rate/onoe SRCS+= onoe.c .elif ${ATH_RATE} == "amrr" -.PATH: ${.CURDIR}/../../dev/ath/ath_rate/amrr +.PATH: ${SRCTOP}/sys/dev/ath/ath_rate/amrr SRCS+= amrr.c .endif # DFS -.PATH: ${.CURDIR}/../../dev/ath/ath_dfs/null +.PATH: ${SRCTOP}/sys/dev/ath/ath_dfs/null SRCS+= dfs_null.c -CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal -CFLAGS+= -I. -I${.CURDIR}/../../contrib/dev/ath/ath_hal/ +CFLAGS+= -I. -I${SRCTOP}/sys/dev/ath -I${SRCTOP}/sys/dev/ath/ath_hal +CFLAGS+= -I. -I${SRCTOP}/sys/contrib/dev/ath/ath_hal/ .if !defined(KERNBUILDDIR) opt_ah.h: From owner-svn-src-all@freebsd.org Fri Jan 20 05:51:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D8A2CB93FB; Fri, 20 Jan 2017 05:51: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 69DAC1395; Fri, 20 Jan 2017 05:51: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 v0K5pPaZ055370; Fri, 20 Jan 2017 05:51:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K5pPNG055369; Fri, 20 Jan 2017 05:51:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200551.v0K5pPNG055369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 05:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312514 - head/gnu/usr.bin/gdb/gdbserver 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, 20 Jan 2017 05:51:26 -0000 Author: ngie Date: Fri Jan 20 05:51:25 2017 New Revision: 312514 URL: https://svnweb.freebsd.org/changeset/base/312514 Log: Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones This simplifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/gnu/usr.bin/gdb/gdbserver/Makefile Modified: head/gnu/usr.bin/gdb/gdbserver/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdbserver/Makefile Fri Jan 20 05:45:07 2017 (r312513) +++ head/gnu/usr.bin/gdb/gdbserver/Makefile Fri Jan 20 05:51:25 2017 (r312514) @@ -3,7 +3,7 @@ # Not elf specific so don't install in /usr/libexec/elf BINDIR=/usr/bin -GDBDIR= ${.CURDIR}/../../../../contrib/gdb +GDBDIR= ${SRCTOP}/contrib/gdb .PATH: ${GDBDIR}/gdb/signals .PATH: ${GDBDIR}/gdb/gdbserver .PATH: ${GDBDIR}/gdb From owner-svn-src-all@freebsd.org Fri Jan 20 05:56:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4205CB95A3; Fri, 20 Jan 2017 05:56:26 +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 655391673; Fri, 20 Jan 2017 05:56:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id e4so4762672pfg.0; Thu, 19 Jan 2017 21:56:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=P9rfnczcrJByxkHyuHfOF9RIlwTgYcp914RLrNfoQAY=; b=YJ4kPS6rLHx2MB+XI24BLQOqt9kFBmIiA9tr+0QnJWxcIujad1fLEQUb+b/1sVL9vr 8xdsqHcSrBK1PFYHgfE7vRDuGzPykULd1o9riiKiEkS8hQqYbJMRVcay6YjJQxOkpe4B Eu+ZjdNor7whzSZoamR5wf6xRu5WtlpyqImT21i9DqZVCw/Jn79F77nllAzYZ8yT3VbG hZ4mNjpHAUI9kCf//up8rOsZda41hY8qcQGhVpt4sazkWdcgqdfbHQelTjgqN7Ha9nE4 lna9BGjcLzX5ffhHw4LdFTiefVmDWClArJuTYgRbfZmli17jJpAdY670KmEAESyz2Oot 9hVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=P9rfnczcrJByxkHyuHfOF9RIlwTgYcp914RLrNfoQAY=; b=XPxSDMj18mwnfMBp9V4BmWZHzyzpEzvRbb1LSIr7ad7zivch3hquCoiW/3ZipKryzm 2IrzjI75l0L2mxsbOIKuFyb2qjrJAXghmmaoDGNJ1FttwWincJB+WxAa2sonjM/vq/UO IGdRozxGHc6/jnNybQxgERsPIqz6/M8jaSe6GRQuK3dLi7G2BoDtBoTXWGXey1Dx6I3m YLcP2Lal9HZOsaxi+oahlT4qtuYJ4ZycdzDvbxZt84KgKwKnVnQ5TBRO2c6JAWety0ik uyEPAwQ7y3sq4zePoY2KfcYsdjpU3zMmvy/T+KRCNb/pXOZGnW112ieb44RGhgawddnE kx5w== X-Gm-Message-State: AIkVDXLo/JxS9VZ+eBEEWqj2F+6YZDLcJH5KMb9PWK5pGIdbcXpgZMA0+JTxN6rsOYaoGw== X-Received: by 10.98.10.69 with SMTP id s66mr14369264pfi.146.1484891785860; Thu, 19 Jan 2017 21:56:25 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id p1sm13085844pgc.29.2017.01.19.21.56.24 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Jan 2017 21:56:25 -0800 (PST) Subject: Re: svn commit: r312513 - head/sys/modules/ath Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_0A03316C-9C98-4A60-A3F3-30EE6D4C1155"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701200545.v0K5j7RQ054348@repo.freebsd.org> Date: Thu, 19 Jan 2017 21:56:24 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <9AFF044E-E0D2-429F-A350-49FEA2D43CF8@gmail.com> References: <201701200545.v0K5j7RQ054348@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: Fri, 20 Jan 2017 05:56:26 -0000 --Apple-Mail=_0A03316C-9C98-4A60-A3F3-30EE6D4C1155 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 19, 2017, at 21:45, Ngie Cooper wrote: >=20 > Author: ngie > Date: Fri Jan 20 05:45:07 2017 > New Revision: 312513 > URL: https://svnweb.freebsd.org/changeset/base/312513 >=20 > Log: > Use SRCTOP-relative paths to other directories instead of = .CURDIR-relative ones >=20 > This simplifies pathing in make/displayed output >=20 > MFC after: 3 weeks > Sponsored by: Dell EMC Isilon I hope that this also gives Jenkins the hint that these warnings are not = unique because the filename is now consistent between sys/conf/files and = sys/modules/ath/Makefile: = https://groups.google.com/forum/#!topic/jenkinsci-issues/8ewZHr_dXiU . = We=E2=80=99ll see=E2=80=A6 -Ngie --Apple-Mail=_0A03316C-9C98-4A60-A3F3-30EE6D4C1155 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 iQIcBAEBCgAGBQJYgaaIAAoJEPWDqSZpMIYVtewQAKDGafKgvtA/L8hr9ptOI9UC 8Ne/eJMifH10NFByhMweQCRNgQC755aS/xqzQmF3ViMeZ23jHYwUPWTGFdTKfaCB +ZLBgo/KMhRXo8bbbZDYe3mNDd/yFxVETaJMdwSGaaUPlHmJ+FX3hD5UcJSElM/+ FZxf9jcm9Rdad9NwmpATs2+OfDZAGnw4T33FkNoMSunp10J/DWJZo51VFePbYV/k rbzIkiPWEoFoE1Oq6wTsWCRHdcdJUVnhvCEJkTBX1ZabZW958ttuo7OQMekEfiq8 ofzP9crsGzUq22b5dv35/zklT1+1EvAKneG1QF/pCy4g4Quudpe7cwWkOdpVjAS/ 9bf8aEBrH1p4DonvCddvad+D2mnXHxtRYRyg/2YpP+9+gWC9eTxm/SNm9y1aN5aE 1sMouK84eq/yn0cG4XNi51pX1sVNYFPYgKmnXslRJgomiWFWo5pqXwAka0nkAhAO lilvpnqS5riz6vkJlRFlfl6GT3XKcHGVcEqZGokOcGVI377zOh9I4z+c4Qxuz4KS hwZocoAEAZpfe5rWYFyDY8LmA7NKJmtrUTtIvzOUATSxJDlosgth3cUQ75RdGXSr fiH7SL2qL4BJ/7cWs2/+zqSCKMByfJwiOPEZq8HYGo18pq9CUtaLJJIe0z1miJaE /bqdmFirK5G/ten7aAGK =xKiZ -----END PGP SIGNATURE----- --Apple-Mail=_0A03316C-9C98-4A60-A3F3-30EE6D4C1155-- From owner-svn-src-all@freebsd.org Fri Jan 20 06:22:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8392ACB9CC7; Fri, 20 Jan 2017 06:22:43 +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 4197A1302; Fri, 20 Jan 2017 06:22:43 +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 v0K6Mg5u070434; Fri, 20 Jan 2017 06:22:42 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K6Mg1A070432; Fri, 20 Jan 2017 06:22:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200622.v0K6Mg1A070432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 06:22:42 +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: r312515 - stable/11/contrib/bsnmp/snmpd 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, 20 Jan 2017 06:22:43 -0000 Author: ngie Date: Fri Jan 20 06:22:42 2017 New Revision: 312515 URL: https://svnweb.freebsd.org/changeset/base/312515 Log: MFC r312331: r312331 (by glebius): Fix regression from r310655, which broke operation of bsnmpd if it is bound to a non-wildcard address. As documented in ip(4), doing sendmsg(2) with IP_SENDSRCADDR on a socket that is bound to non-wildcard address is completely different to using this control message on a wildcard one. A fix is to add a bool to mark whether we did setsockopt(IP_RECVDSTADDR) on the socket, and use IP_SENDSRCADDR control message only if we did. While here, garbage collect absolutely useless udp_recv() function that establishes some structures on stack to never use them later. Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.c stable/11/contrib/bsnmp/snmpd/trans_udp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 20 05:51:25 2017 (r312514) +++ stable/11/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 20 06:22:42 2017 (r312515) @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -119,13 +120,15 @@ udp_init_port(struct tport *tp) addr.sin_port = htons(p->port); addr.sin_family = AF_INET; addr.sin_len = sizeof(addr); - if (addr.sin_addr.s_addr == INADDR_ANY && - setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, - sizeof(on)) == -1) { - syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); - close(p->input.fd); - p->input.fd = -1; - return (SNMP_ERR_GENERR); + if (addr.sin_addr.s_addr == INADDR_ANY) { + if (setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, + sizeof(on)) == -1) { + syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); + close(p->input.fd); + p->input.fd = -1; + return (SNMP_ERR_GENERR); + } + p->recvdstaddr = true; } if (bind(p->input.fd, (struct sockaddr *)&addr, sizeof(addr))) { if (errno == EADDRNOTAVAIL) { @@ -218,7 +221,6 @@ udp_send(struct tport *tp, const u_char { struct udp_port *p = (struct udp_port *)tp; struct cmsghdr *cmsg; - struct in_addr *src_addr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; struct iovec iov; @@ -231,15 +233,20 @@ udp_send(struct tport *tp, const u_char msg.msg_iovlen = 1; msg.msg_name = __DECONST(void *, addr); msg.msg_namelen = addrlen; - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - cmsg = CMSG_FIRSTHDR(&msg); - cmsg->cmsg_level = IPPROTO_IP; - cmsg->cmsg_type = IP_SENDSRCADDR; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - src_addr = (struct in_addr *)(void*)CMSG_DATA(cmsg); - memcpy(src_addr, &p->recv_addr, sizeof(struct in_addr)); + if (p->recvdstaddr) { + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_IP; + cmsg->cmsg_type = IP_SENDSRCADDR; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + memcpy(CMSG_DATA(cmsg), &p->dstaddr, sizeof(struct in_addr)); + } else { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } return (sendmsg(p->input.fd, &msg, 0)); } @@ -260,11 +267,12 @@ check_priv_dgram(struct port_input *pi, * Each receive should return one datagram. */ static ssize_t -recv_dgram(struct port_input *pi, struct in_addr *laddr) +udp_recv(struct tport *tp, struct port_input *pi) { u_char embuf[1000]; char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + CMSG_SPACE(sizeof(struct in_addr))]; + struct udp_port *p = (struct udp_port *)tp; struct msghdr msg; struct iovec iov[1]; ssize_t len; @@ -316,7 +324,8 @@ recv_dgram(struct port_input *pi, struct cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_RECVDSTADDR) - memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); + memcpy(&p->dstaddr, CMSG_DATA(cmsg), + sizeof(struct in_addr)); if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDS) cred = (struct sockcred *)CMSG_DATA(cmsg); @@ -329,42 +338,6 @@ recv_dgram(struct port_input *pi, struct } /* - * Receive something - */ -static ssize_t -udp_recv(struct tport *tp, struct port_input *pi) -{ - struct udp_port *p = (struct udp_port *)tp; - struct cmsghdr *cmsgp; - struct in_addr *laddr; - struct msghdr msg; - char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - ssize_t ret; - - memset(cbuf, 0, sizeof(cbuf)); - - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - - cmsgp = CMSG_FIRSTHDR(&msg); - cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - cmsgp->cmsg_level = IPPROTO_IP; - cmsgp->cmsg_type = IP_SENDSRCADDR; - laddr = (struct in_addr *)CMSG_DATA(cmsgp); - - ret = recv_dgram(pi, laddr); - - memcpy(&p->recv_addr, laddr, sizeof(struct in_addr)); - - if (laddr->s_addr == INADDR_ANY) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } - - return (ret); -} - -/* * Port table */ int Modified: stable/11/contrib/bsnmp/snmpd/trans_udp.h ============================================================================== --- stable/11/contrib/bsnmp/snmpd/trans_udp.h Fri Jan 20 05:51:25 2017 (r312514) +++ stable/11/contrib/bsnmp/snmpd/trans_udp.h Fri Jan 20 06:22:42 2017 (r312515) @@ -39,7 +39,9 @@ struct udp_port { struct port_input input; /* common input stuff */ struct sockaddr_in ret; /* the return address */ - struct in_addr recv_addr; /* the address the request was sent to */ + + bool recvdstaddr; /* IP_RECVDSTADDR is on */ + struct in_addr dstaddr; /* address the request was sent to */ }; /* argument for open call */ From owner-svn-src-all@freebsd.org Fri Jan 20 06:24:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFFE9CB9D40; Fri, 20 Jan 2017 06:24: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 B0C4814AF; Fri, 20 Jan 2017 06:24:32 +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 v0K6OVek070574; Fri, 20 Jan 2017 06:24:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K6OVNa070572; Fri, 20 Jan 2017 06:24:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200624.v0K6OVNa070572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 06:24:31 +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: r312516 - stable/10/contrib/bsnmp/snmpd 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, 20 Jan 2017 06:24:33 -0000 Author: ngie Date: Fri Jan 20 06:24:31 2017 New Revision: 312516 URL: https://svnweb.freebsd.org/changeset/base/312516 Log: MFC r312331: r312331 (by glebius): Fix regression from r310655, which broke operation of bsnmpd if it is bound to a non-wildcard address. As documented in ip(4), doing sendmsg(2) with IP_SENDSRCADDR on a socket that is bound to non-wildcard address is completely different to using this control message on a wildcard one. A fix is to add a bool to mark whether we did setsockopt(IP_RECVDSTADDR) on the socket, and use IP_SENDSRCADDR control message only if we did. While here, garbage collect absolutely useless udp_recv() function that establishes some structures on stack to never use them later. Modified: stable/10/contrib/bsnmp/snmpd/trans_udp.c stable/10/contrib/bsnmp/snmpd/trans_udp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bsnmp/snmpd/trans_udp.c ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 20 06:22:42 2017 (r312515) +++ stable/10/contrib/bsnmp/snmpd/trans_udp.c Fri Jan 20 06:24:31 2017 (r312516) @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -119,13 +120,15 @@ udp_init_port(struct tport *tp) addr.sin_port = htons(p->port); addr.sin_family = AF_INET; addr.sin_len = sizeof(addr); - if (addr.sin_addr.s_addr == INADDR_ANY && - setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, - sizeof(on)) == -1) { - syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); - close(p->input.fd); - p->input.fd = -1; - return (SNMP_ERR_GENERR); + if (addr.sin_addr.s_addr == INADDR_ANY) { + if (setsockopt(p->input.fd, IPPROTO_IP, IP_RECVDSTADDR, &on, + sizeof(on)) == -1) { + syslog(LOG_ERR, "setsockopt(IP_RECVDSTADDR): %m"); + close(p->input.fd); + p->input.fd = -1; + return (SNMP_ERR_GENERR); + } + p->recvdstaddr = true; } if (bind(p->input.fd, (struct sockaddr *)&addr, sizeof(addr))) { if (errno == EADDRNOTAVAIL) { @@ -218,7 +221,6 @@ udp_send(struct tport *tp, const u_char { struct udp_port *p = (struct udp_port *)tp; struct cmsghdr *cmsg; - struct in_addr *src_addr; struct msghdr msg; char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; struct iovec iov; @@ -231,15 +233,20 @@ udp_send(struct tport *tp, const u_char msg.msg_iovlen = 1; msg.msg_name = __DECONST(void *, addr); msg.msg_namelen = addrlen; - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - cmsg = CMSG_FIRSTHDR(&msg); - cmsg->cmsg_level = IPPROTO_IP; - cmsg->cmsg_type = IP_SENDSRCADDR; - cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - src_addr = (struct in_addr *)(void*)CMSG_DATA(cmsg); - memcpy(src_addr, &p->recv_addr, sizeof(struct in_addr)); + if (p->recvdstaddr) { + msg.msg_control = cbuf; + msg.msg_controllen = sizeof(cbuf); + + cmsg = CMSG_FIRSTHDR(&msg); + cmsg->cmsg_level = IPPROTO_IP; + cmsg->cmsg_type = IP_SENDSRCADDR; + cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); + memcpy(CMSG_DATA(cmsg), &p->dstaddr, sizeof(struct in_addr)); + } else { + msg.msg_control = NULL; + msg.msg_controllen = 0; + } return (sendmsg(p->input.fd, &msg, 0)); } @@ -260,11 +267,12 @@ check_priv_dgram(struct port_input *pi, * Each receive should return one datagram. */ static ssize_t -recv_dgram(struct port_input *pi, struct in_addr *laddr) +udp_recv(struct tport *tp, struct port_input *pi) { u_char embuf[1000]; char cbuf[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + CMSG_SPACE(sizeof(struct in_addr))]; + struct udp_port *p = (struct udp_port *)tp; struct msghdr msg; struct iovec iov[1]; ssize_t len; @@ -316,7 +324,8 @@ recv_dgram(struct port_input *pi, struct cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == IPPROTO_IP && cmsg->cmsg_type == IP_RECVDSTADDR) - memcpy(laddr, CMSG_DATA(cmsg), sizeof(struct in_addr)); + memcpy(&p->dstaddr, CMSG_DATA(cmsg), + sizeof(struct in_addr)); if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_CREDS) cred = (struct sockcred *)CMSG_DATA(cmsg); @@ -329,42 +338,6 @@ recv_dgram(struct port_input *pi, struct } /* - * Receive something - */ -static ssize_t -udp_recv(struct tport *tp, struct port_input *pi) -{ - struct udp_port *p = (struct udp_port *)tp; - struct cmsghdr *cmsgp; - struct in_addr *laddr; - struct msghdr msg; - char cbuf[CMSG_SPACE(sizeof(struct in_addr))]; - ssize_t ret; - - memset(cbuf, 0, sizeof(cbuf)); - - msg.msg_control = cbuf; - msg.msg_controllen = sizeof(cbuf); - - cmsgp = CMSG_FIRSTHDR(&msg); - cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); - cmsgp->cmsg_level = IPPROTO_IP; - cmsgp->cmsg_type = IP_SENDSRCADDR; - laddr = (struct in_addr *)CMSG_DATA(cmsgp); - - ret = recv_dgram(pi, laddr); - - memcpy(&p->recv_addr, laddr, sizeof(struct in_addr)); - - if (laddr->s_addr == INADDR_ANY) { - msg.msg_control = NULL; - msg.msg_controllen = 0; - } - - return (ret); -} - -/* * Port table */ int Modified: stable/10/contrib/bsnmp/snmpd/trans_udp.h ============================================================================== --- stable/10/contrib/bsnmp/snmpd/trans_udp.h Fri Jan 20 06:22:42 2017 (r312515) +++ stable/10/contrib/bsnmp/snmpd/trans_udp.h Fri Jan 20 06:24:31 2017 (r312516) @@ -39,7 +39,9 @@ struct udp_port { struct port_input input; /* common input stuff */ struct sockaddr_in ret; /* the return address */ - struct in_addr recv_addr; /* the address the request was sent to */ + + bool recvdstaddr; /* IP_RECVDSTADDR is on */ + struct in_addr dstaddr; /* address the request was sent to */ }; /* argument for open call */ From owner-svn-src-all@freebsd.org Fri Jan 20 06:29:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAACECB9E59; Fri, 20 Jan 2017 06:29:53 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::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 741431717; Fri, 20 Jan 2017 06:29:53 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-it0-x244.google.com with SMTP id e137so1953649itc.0; Thu, 19 Jan 2017 22:29:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GWCy4sLcOg3U5r2wNHfXR7anBHpMaN9lybgeMkd0ZgA=; b=kqHrt9B3d/T4NaWyXdspEVhtxzHmBoxdBPjuz21sioBpuUkh3pii1bpc+Xs/MbZEnL T3sKpu+p6sED0/dgQNgWQbA9u9q3Cb58/c8fiiYDagDaYEnjFnARup4FmoFRj30Hbl4t robUaDK45DWacPipAhmDdYfv0KmR6gnuHR/y5rJlp93Dn9ctWzQbxRfTvOqled50FnNO KDq9yFS4sQQ7vyojbvbMu+SDxmhwKdX1T7nMlij4y2y/D3Tl3RrFLPrjjPSpSfDzUmx0 iZedq5/mSwyOjGOVN6kdXuvxWBklOlbB6g+FIQ+eae4FDqMUn+nxLb5ZRM7hLH7PND/n 7PfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GWCy4sLcOg3U5r2wNHfXR7anBHpMaN9lybgeMkd0ZgA=; b=Z1DO8bIWR8i6caQIciG4yFRz2grotP2A2N95fov9rNYsVV7fFcipkqkjvl9ZnEDp9Z +FsAWYZ4ZnHYNEY/sl+VWK56X+qiEa9TrfQwsmKtBs4U7iHE5gXBJ4zxaOg63ubeJt2k WUzvhaElKMUJCcSEc3ueezvHtp0wpCEcYT6c9XltwWiKx76eU7gafHWCsokUcFqZLHMX 272gC0e8JPHey1y0CAFHFExNO4JZzn+8Dt2hN8r+7HDQNxd5rwF0zgRjgAOj4lF0vUEB xdTto1yphmOeLkP24p2Q6pWmmcAZw57iEyFq0zDvOvh97kfkowtRw8gR5tvaWZ74gHJa /qpw== X-Gm-Message-State: AIkVDXLBvjEPq3wp9eW+86dwMZl1FH0rMqxA1qKzgWbolg/spl/WNj/TyYf0cjtmDo/o4RL+3rfsYuI2uqBgIg== X-Received: by 10.36.40.139 with SMTP id h133mr2174106ith.40.1484893792682; Thu, 19 Jan 2017 22:29:52 -0800 (PST) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.205.142 with HTTP; Thu, 19 Jan 2017 22:29:52 -0800 (PST) In-Reply-To: <201701190801.v0J81ZG9008267@repo.freebsd.org> References: <201701190801.v0J81ZG9008267@repo.freebsd.org> From: Antoine Brodin Date: Fri, 20 Jan 2017 07:29:52 +0100 X-Google-Sender-Auth: qjXz9JKboAGyxKL30Dxn8dmkN5w Message-ID: Subject: Re: svn commit: r312404 - head/usr.bin/sed To: Xin LI 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: Fri, 20 Jan 2017 06:29:53 -0000 On Thu, Jan 19, 2017 at 9:01 AM, Xin LI wrote: > Author: delphij > Date: Thu Jan 19 08:01:35 2017 > New Revision: 312404 > URL: https://svnweb.freebsd.org/changeset/base/312404 > > Log: > Use S_ISREG instead of manual & (also it's better to compare the > result from & and the pattern instead of just assuming it's one bit > value). > > Pointed out by Tianjie Mao . > > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D4827 Hi, sed -i no longer works on symlinks which breaks lots of ports. Please revert and request an exp-run. Cheers, Antoine From owner-svn-src-all@freebsd.org Fri Jan 20 06:38:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 614E7CB9084; Fri, 20 Jan 2017 06:38:57 +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 116851D06; Fri, 20 Jan 2017 06:38:56 +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 v0K6cuJi074852; Fri, 20 Jan 2017 06:38:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K6cuu5074850; Fri, 20 Jan 2017 06:38:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701200638.v0K6cuu5074850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 20 Jan 2017 06:38: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: r312517 - in stable/11: contrib/xz contrib/xz/src/common contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblzma/common contrib/xz/src/liblzma/delta contrib/... 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, 20 Jan 2017 06:38:57 -0000 Author: delphij Date: Fri Jan 20 06:38:56 2017 New Revision: 312517 URL: https://svnweb.freebsd.org/changeset/base/312517 Log: MFC r311504: MFV r311477: xz 5.2.3. Modified: stable/11/contrib/xz/ChangeLog stable/11/contrib/xz/THANKS stable/11/contrib/xz/src/common/tuklib_cpucores.c stable/11/contrib/xz/src/common/tuklib_physmem.c stable/11/contrib/xz/src/liblzma/api/lzma/version.h stable/11/contrib/xz/src/liblzma/check/check.h stable/11/contrib/xz/src/liblzma/common/alone_decoder.c stable/11/contrib/xz/src/liblzma/common/alone_encoder.c stable/11/contrib/xz/src/liblzma/common/auto_decoder.c stable/11/contrib/xz/src/liblzma/common/block_decoder.c stable/11/contrib/xz/src/liblzma/common/block_encoder.c stable/11/contrib/xz/src/liblzma/common/common.h stable/11/contrib/xz/src/liblzma/common/index.c stable/11/contrib/xz/src/liblzma/common/index_decoder.c stable/11/contrib/xz/src/liblzma/common/index_encoder.c stable/11/contrib/xz/src/liblzma/common/stream_decoder.c stable/11/contrib/xz/src/liblzma/common/stream_encoder.c stable/11/contrib/xz/src/liblzma/common/stream_encoder_mt.c stable/11/contrib/xz/src/liblzma/delta/delta_common.c stable/11/contrib/xz/src/liblzma/delta/delta_decoder.c stable/11/contrib/xz/src/liblzma/delta/delta_encoder.c stable/11/contrib/xz/src/liblzma/delta/delta_private.h stable/11/contrib/xz/src/liblzma/lz/lz_decoder.c stable/11/contrib/xz/src/liblzma/lz/lz_decoder.h stable/11/contrib/xz/src/liblzma/lz/lz_encoder.c stable/11/contrib/xz/src/liblzma/lz/lz_encoder.h stable/11/contrib/xz/src/liblzma/lzma/lzma2_decoder.c stable/11/contrib/xz/src/liblzma/lzma/lzma2_encoder.c stable/11/contrib/xz/src/liblzma/lzma/lzma_decoder.c stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder.c stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder.h stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c stable/11/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h stable/11/contrib/xz/src/liblzma/simple/arm.c stable/11/contrib/xz/src/liblzma/simple/armthumb.c stable/11/contrib/xz/src/liblzma/simple/ia64.c stable/11/contrib/xz/src/liblzma/simple/powerpc.c stable/11/contrib/xz/src/liblzma/simple/simple_coder.c stable/11/contrib/xz/src/liblzma/simple/simple_private.h stable/11/contrib/xz/src/liblzma/simple/sparc.c stable/11/contrib/xz/src/liblzma/simple/x86.c stable/11/contrib/xz/src/xz/args.c stable/11/contrib/xz/src/xz/coder.c stable/11/contrib/xz/src/xz/file_io.c stable/11/contrib/xz/src/xz/file_io.h stable/11/contrib/xz/src/xz/main.c stable/11/contrib/xz/src/xz/private.h stable/11/lib/liblzma/config.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/xz/ChangeLog ============================================================================== --- stable/11/contrib/xz/ChangeLog Fri Jan 20 06:24:31 2017 (r312516) +++ stable/11/contrib/xz/ChangeLog Fri Jan 20 06:38:56 2017 (r312517) @@ -1,3 +1,563 @@ +commit 3d566cd519017eee1a400e7961ff14058dfaf33c +Author: Lasse Collin +Date: 2016-12-30 13:26:36 +0200 + + Bump version and soname for 5.2.3. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 053e624fe33795e779ff736f16ce44a129c829b5 +Author: Lasse Collin +Date: 2016-12-30 13:25:10 +0200 + + Update NEWS for 5.2.3. + + NEWS | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit cae412b2b77d7fd88d187ed7659331709311f80d +Author: Lasse Collin +Date: 2015-04-01 14:45:25 +0300 + + xz: Fix the Capsicum rights on user_abort_pipe. + + src/xz/file_io.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 9ccbae41000572193b9a09e7102f9e84dc6d96de +Author: Lasse Collin +Date: 2016-12-28 21:05:22 +0200 + + Mention potential sandboxing bugs in INSTALL. + + INSTALL | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit e013a337d3de77cce24360dffe956ea2339489b6 +Author: Lasse Collin +Date: 2016-11-21 20:24:50 +0200 + + liblzma: Avoid multiple definitions of lzma_coder structures. + + Only one definition was visible in a translation unit. + It avoided a few casts and temp variables but seems that + this hack doesn't work with link-time optimizations in compilers + as it's not C99/C11 compliant. + + Fixes: + http://www.mail-archive.com/xz-devel@tukaani.org/msg00279.html + + src/liblzma/common/alone_decoder.c | 44 +++++---- + src/liblzma/common/alone_encoder.c | 34 ++++--- + src/liblzma/common/auto_decoder.c | 35 ++++--- + src/liblzma/common/block_decoder.c | 41 ++++---- + src/liblzma/common/block_encoder.c | 40 ++++---- + src/liblzma/common/common.h | 18 ++-- + src/liblzma/common/index_decoder.c | 33 ++++--- + src/liblzma/common/index_encoder.c | 16 ++-- + src/liblzma/common/stream_decoder.c | 50 +++++----- + src/liblzma/common/stream_encoder.c | 56 ++++++----- + src/liblzma/common/stream_encoder_mt.c | 124 ++++++++++++++----------- + src/liblzma/delta/delta_common.c | 25 ++--- + src/liblzma/delta/delta_decoder.c | 6 +- + src/liblzma/delta/delta_encoder.c | 12 ++- + src/liblzma/delta/delta_private.h | 4 +- + src/liblzma/lz/lz_decoder.c | 60 ++++++------ + src/liblzma/lz/lz_decoder.h | 13 ++- + src/liblzma/lz/lz_encoder.c | 57 +++++++----- + src/liblzma/lz/lz_encoder.h | 9 +- + src/liblzma/lzma/lzma2_decoder.c | 32 ++++--- + src/liblzma/lzma/lzma2_encoder.c | 51 +++++----- + src/liblzma/lzma/lzma_decoder.c | 27 +++--- + src/liblzma/lzma/lzma_encoder.c | 29 +++--- + src/liblzma/lzma/lzma_encoder.h | 9 +- + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 3 +- + src/liblzma/lzma/lzma_encoder_optimum_normal.c | 23 ++--- + src/liblzma/lzma/lzma_encoder_private.h | 6 +- + src/liblzma/simple/arm.c | 2 +- + src/liblzma/simple/armthumb.c | 2 +- + src/liblzma/simple/ia64.c | 2 +- + src/liblzma/simple/powerpc.c | 2 +- + src/liblzma/simple/simple_coder.c | 61 ++++++------ + src/liblzma/simple/simple_private.h | 12 +-- + src/liblzma/simple/sparc.c | 2 +- + src/liblzma/simple/x86.c | 15 +-- + 35 files changed, 532 insertions(+), 423 deletions(-) + +commit 8e0f1af3dcaec00a3879cce8ad7441edc6359d1c +Author: Lasse Collin +Date: 2016-12-26 20:50:25 +0200 + + Document --enable-sandbox configure option in INSTALL. + + INSTALL | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit ce2542d220de06acd618fd9f5c0a6683029fb4eb +Author: Lasse Collin +Date: 2015-03-31 22:19:34 +0300 + + xz: Add support for sandboxing with Capsicum (disabled by default). + + In the v5.2 branch this feature is considered experimental + and thus disabled by default. + + The sandboxing is used conditionally as described in main.c. + This isn't optimal but it was much easier to implement than + a full sandboxing solution and it still covers the most common + use cases where xz is writing to standard output. This should + have practically no effect on performance even with small files + as fork() isn't needed. + + C and locale libraries can open files as needed. This has been + fine in the past, but it's a problem with things like Capsicum. + io_sandbox_enter() tries to ensure that various locale-related + files have been loaded before cap_enter() is called, but it's + possible that there are other similar problems which haven't + been seen yet. + + Currently Capsicum is available on FreeBSD 10 and later + and there is a port to Linux too. + + Thanks to Loganaden Velvindron for help. + + configure.ac | 41 +++++++++++++++++++++++++++ + src/xz/Makefile.am | 2 +- + src/xz/file_io.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/xz/file_io.h | 6 ++++ + src/xz/main.c | 18 ++++++++++++ + src/xz/private.h | 4 +++ + 6 files changed, 151 insertions(+), 1 deletion(-) + +commit 3ca1d5e6320111043e19434da881065fadafa0e4 +Author: Lasse Collin +Date: 2015-03-31 21:12:30 +0300 + + Fix bugs and otherwise improve ax_check_capsicum.m4. + + AU_ALIAS was removed because the new version is incompatible + with the old version. + + It no longer checks for separately. + It's enough to test for it as part of AC_CHECK_DECL. + The defines HAVE_CAPSICUM_SYS_CAPSICUM_H and + HAVE_CAPSICUM_SYS_CAPABILITY_H were removed as unneeded. + HAVE_SYS_CAPSICUM_H from AC_CHECK_HEADERS is enough. + + It no longer does a useless search for the Capsicum library + if the header wasn't found. + + Fixed a bug in ACTION-IF-FOUND (the first argument). Specifying + the argument omitted the default action but the given action + wasn't used instead. + + AC_DEFINE([HAVE_CAPSICUM]) is now always called when Capsicum + support is found. Previously it was part of the default + ACTION-IF-FOUND which a custom action would override. Now + the default action only prepends ${CAPSICUM_LIB} to LIBS. + + The documentation was updated. + + Since there as no serial number, "#serial 2" was added. + + m4/ax_check_capsicum.m4 | 103 ++++++++++++++++++++++++------------------------ + 1 file changed, 51 insertions(+), 52 deletions(-) + +commit 5f3a742b64197fe8bedb6f05fc6ce5d177d11145 +Author: Lasse Collin +Date: 2015-03-31 19:20:24 +0300 + + Add m4/ax_check_capsicum.m4 for detecting Capsicum support. + + The file was loaded from this web page: + https://github.com/google/capsicum-test/blob/dev/autoconf/m4/ax_check_capsicum.m4 + + Thanks to Loganaden Velvindron for pointing it out for me. + + m4/ax_check_capsicum.m4 | 86 +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 86 insertions(+) + +commit d74377e62b4c649e40294dd441de72c0f092e67c +Author: Lasse Collin +Date: 2015-10-12 20:29:09 +0300 + + liblzma: Fix a memory leak in error path of lzma_index_dup(). + + lzma_index_dup() calls index_dup_stream() which, in case of + an error, calls index_stream_end() to free memory allocated + by index_stream_init(). However, it illogically didn't + actually free the memory. To make it logical, the tree + handling code was modified a bit in addition to changing + index_stream_end(). + + Thanks to Evan Nemerson for the bug report. + + src/liblzma/common/index.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit f580732216dcf971f3f006fe8e01cd4979e1d964 +Author: Lasse Collin +Date: 2016-10-24 18:53:25 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 88d7a7fd153bf1355cdf798ffdac7443d0169afc +Author: Lasse Collin +Date: 2016-10-24 18:51:36 +0300 + + tuklib_cpucores: Add support for sched_getaffinity(). + + It's available in glibc (GNU/Linux, GNU/kFreeBSD). It's better + than sysconf(_SC_NPROCESSORS_ONLN) because sched_getaffinity() + gives the number of cores available to the process instead of + the total number of cores online. + + As a side effect, this commit fixes a bug on GNU/kFreeBSD where + configure would detect the FreeBSD-specific cpuset_getaffinity() + but it wouldn't actually work because on GNU/kFreeBSD it requires + using -lfreebsd-glue when linking. Now the glibc-specific function + will be used instead. + + Thanks to Sebastian Andrzej Siewior for the original patch + and testing. + + m4/tuklib_cpucores.m4 | 30 +++++++++++++++++++++++++++++- + src/common/tuklib_cpucores.c | 9 +++++++++ + 2 files changed, 38 insertions(+), 1 deletion(-) + +commit 51baf684376903dbeddd840582bfdf9fa91b311b +Author: Lasse Collin +Date: 2016-06-30 20:27:36 +0300 + + xz: Fix copying of timestamps on Windows. + + xz used to call utime() on Windows, but its result gets lost + on close(). Using _futime() seems to work. + + Thanks to Martok for reporting the bug: + http://www.mail-archive.com/xz-devel@tukaani.org/msg00261.html + + configure.ac | 2 +- + src/xz/file_io.c | 18 ++++++++++++++++++ + 2 files changed, 19 insertions(+), 1 deletion(-) + +commit 1ddc479851139d6e8202e5835421bfe6578d9e07 +Author: Lasse Collin +Date: 2016-06-16 22:46:02 +0300 + + xz: Silence warnings from -Wlogical-op. + + Thanks to Evan Nemerson. + + src/xz/file_io.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit be647ff5ed5a1c244a65722af6ce250259f3b14a +Author: Lasse Collin +Date: 2016-04-10 20:55:49 +0300 + + Build: Fix = to += for xz_SOURCES in src/xz/Makefile.am. + + Thanks to Christian Kujau. + + src/xz/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fb6d50c15343831f35305982cefa82053099191d +Author: Lasse Collin +Date: 2016-04-10 20:54:17 +0300 + + Build: Bump GNU Gettext version requirement to 0.19. + + It silences a few warnings and most people probably have + 0.19 even on stable distributions. + + Thanks to Christian Kujau. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 74f8dad9f912a2993768d93d108ea2b0b2c196e0 +Author: Lasse Collin +Date: 2016-03-13 20:21:49 +0200 + + liblzma: Disable external SHA-256 by default. + + This is the sane thing to do. The conflict with OpenSSL + on some OSes and especially that the OS-provided versions + can be significantly slower makes it clear that it was + a mistake to have the external SHA-256 support enabled by + default. + + Those who want it can now pass --enable-external-sha256 to + configure. INSTALL was updated with notes about OSes where + this can be a bad idea. + + The SHA-256 detection code in configure.ac had some bugs that + could lead to a build failure in some situations. These were + fixed, although it doesn't matter that much now that the + external SHA-256 is disabled by default. + + MINIX >= 3.2.0 uses NetBSD's libc and thus has SHA256_Init + in libc instead of libutil. Support for the libutil version + was removed. + + INSTALL | 36 ++++++++++++++++++++++ + configure.ac | 76 +++++++++++++++++++++++------------------------ + src/liblzma/check/check.h | 16 ++++------ + 3 files changed, 79 insertions(+), 49 deletions(-) + +commit ea7f6ff04cb5bb1498088eb09960a4c3f13dfe39 +Author: Lasse Collin +Date: 2016-03-10 20:27:05 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit d0e018016b311232e82d9a98dc68f1e3dabce794 +Author: Lasse Collin +Date: 2016-03-10 20:26:49 +0200 + + Build: Avoid SHA256_Init on FreeBSD and MINIX 3. + + On FreeBSD 10 and older, SHA256_Init from libmd conflicts + with libcrypto from OpenSSL. The OpenSSL version has + different sizeof(SHA256_CTX) and it can cause weird + problems if wrong SHA256_Init gets used. + + Looking at the source, MINIX 3 seems to have a similar issue but + I'm not sure. To be safe, I disabled SHA256_Init on MINIX 3 too. + + NetBSD has SHA256_Init in libc and they had a similar problem, + but they already fixed it in 2009. + + Thanks to Jim Wilcoxson for the bug report that helped + in finding the problem. + + configure.ac | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +commit 5daae123915f32a4ed6dc948b831533c2d1beec3 +Author: Lasse Collin +Date: 2015-11-08 20:16:10 +0200 + + tuklib_physmem: Hopefully silence a warning on Windows. + + src/common/tuklib_physmem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 491acc406e098167ccb7fce0728b94c2f32cff9f +Author: Lasse Collin +Date: 2015-11-04 23:17:43 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 8173ff8790ad3502d04e1c07d014cb84a3b8187b +Author: Lasse Collin +Date: 2015-11-04 23:14:00 +0200 + + liblzma: Make Valgrind happier with optimized (gcc -O2) liblzma. + + When optimizing, GCC can reorder code so that an uninitialized + value gets used in a comparison, which makes Valgrind unhappy. + It doesn't happen when compiled with -O0, which I tend to use + when running Valgrind. + + Thanks to Rich Prohaska. I remember this being mentioned long + ago by someone else but nothing was done back then. + + src/liblzma/lz/lz_encoder.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 013de2b5ab8094d2c82a2771f3d143eeb656eda9 +Author: Lasse Collin +Date: 2015-11-03 20:55:45 +0200 + + liblzma: Rename lzma_presets.c back to lzma_encoder_presets.c. + + It would be too annoying to update other build systems + just because of this. + + src/liblzma/lzma/Makefile.inc | 2 +- + src/liblzma/lzma/{lzma_presets.c => lzma_encoder_presets.c} | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit a322f70ad96de88968c2c36e6a36bc08ae30bd20 +Author: Lasse Collin +Date: 2015-11-03 20:47:07 +0200 + + Build: Disable xzdec, lzmadec, and lzmainfo when they cannot be built. + + They all need decoder support and if that isn't available, + there's no point trying to build them. + + configure.ac | 3 +++ + 1 file changed, 3 insertions(+) + +commit 8ea49606cf6427e32319de7693eca9e43f1c8ad6 +Author: Lasse Collin +Date: 2015-11-03 20:35:19 +0200 + + Build: Simplify $enable_{encoders,decoders} usage a bit. + + configure.ac | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 42131a25e52bfe400acfa7df93469a96bb78bb78 +Author: Lasse Collin +Date: 2015-11-03 20:31:31 +0200 + + Windows/MSVC: Update config.h. + + windows/config.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit e9184e87cc989d14c7413e6adb3eca98f6ae0290 +Author: Lasse Collin +Date: 2015-11-03 20:29:58 +0200 + + DOS: Update config.h. + + dos/config.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 2296778f3c9a1e3a8699973b09dd3610b8baa402 +Author: Lasse Collin +Date: 2015-11-03 20:29:33 +0200 + + xz: Make xz buildable even when encoders or decoders are disabled. + + The patch is quite long but it's mostly about adding new #ifdefs + to omit code when encoders or decoders have been disabled. + + This adds two new #defines to config.h: HAVE_ENCODERS and + HAVE_DECODERS. + + configure.ac | 4 ++++ + src/xz/Makefile.am | 8 ++++++-- + src/xz/args.c | 16 ++++++++++++++++ + src/xz/coder.c | 33 +++++++++++++++++++++++++-------- + src/xz/main.c | 9 +++++++-- + src/xz/private.h | 5 ++++- + 6 files changed, 62 insertions(+), 13 deletions(-) + +commit 97a3109281e475d9cf1b5095237d672fa0ad25e5 +Author: Lasse Collin +Date: 2015-11-03 18:06:40 +0200 + + Build: Build LZMA1/2 presets also when only decoder is wanted. + + People shouldn't rely on the presets when decoding raw streams, + but xz uses the presets as the starting point for raw decoder + options anyway. + + lzma_encocder_presets.c was renamed to lzma_presets.c to + make it clear it's not used solely by the encoder code. + + src/liblzma/lzma/Makefile.inc | 6 +++++- + src/liblzma/lzma/{lzma_encoder_presets.c => lzma_presets.c} | 3 ++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +commit dc6b78d7f0f6fe43e9d4215146e8581feb8090e7 +Author: Lasse Collin +Date: 2015-11-03 17:54:48 +0200 + + Build: Fix configure to handle LZMA1 dependency with LZMA2. + + Now it gives an error if LZMA1 encoder/decoder is missing + when LZMA2 encoder/decoder was requested. Even better would + be LZMA2 implicitly enabling LZMA1 but it would need more code. + + configure.ac | 5 ----- + 1 file changed, 5 deletions(-) + +commit 46d76c9cd3cb26a31f5ae6c3a8bbcf38e6da1add +Author: Lasse Collin +Date: 2015-11-03 17:41:54 +0200 + + Build: Don't omit lzma_cputhreads() unless using --disable-threads. + + Previously it was omitted if encoders were disabled + with --disable-encoders. It didn't make sense and + it also broke the build. + + src/liblzma/common/Makefile.inc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 16d68f874d89f1e4a1919786a35bbaef7d71a077 +Author: Lasse Collin +Date: 2015-11-02 18:16:51 +0200 + + liblzma: Fix a build failure related to external SHA-256 support. + + If an appropriate header and structure were found by configure, + but a library with a usable SHA-256 functions wasn't, the build + failed. + + src/liblzma/check/check.h | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +commit d9311647fc1ab512a3394596221ab8039c00af6b +Author: Lasse Collin +Date: 2015-11-02 15:19:10 +0200 + + xz: Always close the file before trying to delete it. + + unlink() can return EBUSY in errno for open files on some + operating systems and file systems. + + src/xz/file_io.c | 25 ++++++++++++------------- + 1 file changed, 12 insertions(+), 13 deletions(-) + +commit f59c4183f3c9066626ce45dc3db4642fa603fa21 +Author: Lasse Collin +Date: 2015-10-12 21:08:42 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 35f189673e280c12e4c5129f9f97e54eef3bbc04 +Author: Lasse Collin +Date: 2015-10-12 21:07:41 +0300 + + Tests: Add tests for the two bugs fixed in index.c. + + tests/test_index.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +commit e10bfdb0fcaff12f3a6dadee51e0a022aadccb51 +Author: Lasse Collin +Date: 2015-10-12 20:45:15 +0300 + + liblzma: Fix lzma_index_dup() for empty Streams. + + Stream Flags and Stream Padding weren't copied from + empty Streams. + + src/liblzma/common/index.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 06f434bd8980f25ca23232eb7bb7df7e37dc8448 +Author: Lasse Collin +Date: 2015-10-12 20:31:44 +0300 + + liblzma: Add a note to index.c for those using static analyzers. + + src/liblzma/common/index.c | 3 +++ + 1 file changed, 3 insertions(+) + commit 9815cdf6987ef91a85493bfcfd1ce2aaf3b47a0a Author: Lasse Collin Date: 2015-09-29 13:59:35 +0300 @@ -129,11 +689,10 @@ Date: 2015-06-19 20:21:30 +0300 Windows: Update the docs. - INSTALL | 29 ++++++---- - windows/INSTALL-MSVC.txt | 47 +++++++++++++++ - windows/INSTALL-MinGW.txt | 138 ++++++++++++++++++++++++++++++++++++++++++++ - windows/INSTALL-Windows.txt | 138 -------------------------------------------- - 4 files changed, 204 insertions(+), 148 deletions(-) + INSTALL | 29 ++++++++----- + windows/INSTALL-MSVC.txt | 47 ++++++++++++++++++++++ + windows/{INSTALL-Windows.txt => INSTALL-MinGW.txt} | 2 +- + 3 files changed, 67 insertions(+), 11 deletions(-) commit 28195e4c877007cc760ecea1d17f740693d66873 Author: Lasse Collin @@ -1587,11 +2146,10 @@ Date: 2014-05-04 11:07:17 +0300 It can be confusing that two header files have the same name. The public API file is still lzma.h. - src/liblzma/api/Makefile.am | 2 +- - src/liblzma/api/lzma.h | 2 +- - src/liblzma/api/lzma/lzma.h | 420 ------------------------------------------ - src/liblzma/api/lzma/lzma12.h | 420 ++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 422 insertions(+), 422 deletions(-) + src/liblzma/api/Makefile.am | 2 +- + src/liblzma/api/lzma.h | 2 +- + src/liblzma/api/lzma/{lzma.h => lzma12.h} | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) commit 1555a9c5664afc7893a2b75e9970105437f01ef1 Author: Lasse Collin @@ -2650,20 +3208,20 @@ Date: 2012-11-19 00:10:10 -0800 with “|-â€. That worked well for a while, but the version string from ‘less’ versions 448 (June, 2012) is misparsed, producing a warning: - $ xzless /tmp/test.xz; echo $? - /usr/bin/xzless: line 49: test: 456 (GNU regular expressions): \ - integer expression expected - 0 + $ xzless /tmp/test.xz; echo $? + /usr/bin/xzless: line 49: test: 456 (GNU regular expressions): \ + integer expression expected + 0 More precisely, modern ‘less’ lists the regexp implementation along with its version number, and xzless passes the entire version number with attached parenthetical phrase as a number to "test $a -gt $b", producing the above confusing message. - $ less-444 -V | head -1 - less 444 - $ less -V | head -1 - less 456 (no regular expressions) + $ less-444 -V | head -1 + less 444 + $ less -V | head -1 + less 456 (no regular expressions) So relax the pattern matched --- instead of expecting "less ", look for a line of the form "less [ (extra parenthetical)]". @@ -3058,11 +3616,9 @@ Date: 2012-06-14 10:33:27 +0300 copied the decompressor bug from xz_pipe_decomp.c he has an example how to easily fix it. - doc/examples/xz_pipe_comp.c | 127 -------------------------------------- - doc/examples/xz_pipe_decomp.c | 123 ------------------------------------ - doc/examples_old/xz_pipe_comp.c | 127 ++++++++++++++++++++++++++++++++++++++ - doc/examples_old/xz_pipe_decomp.c | 123 ++++++++++++++++++++++++++++++++++++ - 4 files changed, 250 insertions(+), 250 deletions(-) + doc/{examples => examples_old}/xz_pipe_comp.c | 0 + doc/{examples => examples_old}/xz_pipe_decomp.c | 0 + 2 files changed, 0 insertions(+), 0 deletions(-) commit 905f0ab5b5ce544d4b68a2ed6077df0f3d021292 Author: Lasse Collin @@ -4159,10 +4715,9 @@ Date: 2011-04-10 14:58:10 +0300 DOS: Update the docs and include notes about 8.3 filenames. - dos/INSTALL.txt | 79 ++++++++++++++++++++++++++++++++++++ - dos/README | 88 ---------------------------------------- - dos/README.txt | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 202 insertions(+), 88 deletions(-) + dos/{README => INSTALL.txt} | 13 +---- + dos/README.txt | 123 ++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 125 insertions(+), 11 deletions(-) commit ebd54dbd6e481d31e80757f900ac8109ad1423c6 Author: Lasse Collin @@ -4279,10 +4834,9 @@ Date: 2011-04-05 17:12:20 +0300 It was renamed to ax_pthread.m4 in Autoconf Archive. - configure.ac | 2 +- - m4/acx_pthread.m4 | 279 ----------------------------------------------------- - m4/ax_pthread.m4 | 283 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 284 insertions(+), 280 deletions(-) + configure.ac | 2 +- + m4/{acx_pthread.m4 => ax_pthread.m4} | 170 ++++++++++++++++++----------------- + 2 files changed, 88 insertions(+), 84 deletions(-) commit 1039bfcfc098b69d56ecb39d198a092552eacf6d Author: Lasse Collin @@ -4664,10 +5218,10 @@ Date: 2010-11-12 15:22:13 -0600 Builds from a separate build directory with - mkdir build - cd build - ../configure - doxygen Doxyfile + mkdir build + cd build + ../configure + doxygen Doxyfile include an even longer prefix /home/someone/src/xz/src; this patch has the nice side-effect of eliminating that prefix, too. @@ -5232,12 +5786,11 @@ Date: 2010-09-28 10:59:53 +0300 Move version.sh to build-aux. - Makefile.am | 4 ++-- - build-aux/version.sh | 24 ++++++++++++++++++++++++ - configure.ac | 2 +- - version.sh | 24 ------------------------ - windows/build.bash | 2 +- - 5 files changed, 28 insertions(+), 28 deletions(-) + Makefile.am | 4 ++-- + version.sh => build-aux/version.sh | 0 + configure.ac | 2 +- + windows/build.bash | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) commit 84af9d8770451339a692e9b70f96cf56156a6069 Author: Lasse Collin @@ -5739,11 +6292,10 @@ Date: 2010-07-27 20:45:03 +0300 Windows: build.sh is a bash script so name it correctly. - INSTALL | 2 +- - windows/INSTALL-Windows.txt | 6 +- - windows/build.bash | 189 ++++++++++++++++++++++++++++++++++++++++++++ - windows/build.sh | 189 -------------------------------------------- - 4 files changed, 193 insertions(+), 193 deletions(-) + INSTALL | 2 +- + windows/INSTALL-Windows.txt | 6 +++--- + windows/{build.sh => build.bash} | 6 +++--- + 3 files changed, 7 insertions(+), 7 deletions(-) commit b1cbfd40f049a646a639eb78a3e41e9e3ef73339 Author: Lasse Collin @@ -7597,48 +8149,44 @@ Date: 2009-09-19 09:47:30 +0300 building XZ Utils on OpenVMS. Thanks to Jouk Jansen for the original patch. - THANKS | 1 + - configure.ac | 12 ++-- - m4/lc_cpucores.m4 | 57 ---------------- - m4/lc_physmem.m4 | 84 ----------------------- - m4/tuklib_common.m4 | 22 ++++++ - m4/tuklib_cpucores.m4 | 72 ++++++++++++++++++++ - m4/tuklib_physmem.m4 | 119 ++++++++++++++++++++++++++++++++ - m4/tuklib_progname.m4 | 25 +++++++ - src/common/cpucores.h | 51 -------------- - src/common/open_stdxxx.h | 49 -------------- - src/common/physmem.h | 144 --------------------------------------- - src/common/sysdefs.h | 4 -- - src/common/tuklib_common.h | 67 ++++++++++++++++++ - src/common/tuklib_config.h | 1 + - src/common/tuklib_cpucores.c | 46 +++++++++++++ - src/common/tuklib_cpucores.h | 23 +++++++ - src/common/tuklib_exit.c | 57 ++++++++++++++++ - src/common/tuklib_exit.h | 25 +++++++ - src/common/tuklib_gettext.h | 44 ++++++++++++ - src/common/tuklib_open_stdxxx.c | 51 ++++++++++++++ - src/common/tuklib_open_stdxxx.h | 23 +++++++ - src/common/tuklib_physmem.c | 146 ++++++++++++++++++++++++++++++++++++++++ - src/common/tuklib_physmem.h | 28 ++++++++ - src/common/tuklib_progname.c | 50 ++++++++++++++ - src/common/tuklib_progname.h | 32 +++++++++ - src/lzmainfo/Makefile.am | 5 +- - src/lzmainfo/lzmainfo.c | 65 ++++++------------ - src/xz/Makefile.am | 7 +- - src/xz/args.c | 8 +-- - src/xz/file_io.c | 43 ++++++------ - src/xz/hardware.c | 8 +-- - src/xz/main.c | 100 ++++++--------------------- - src/xz/main.h | 7 -- - src/xz/message.c | 30 +++++---- - src/xz/message.h | 8 +-- - src/xz/private.h | 11 +-- - src/xz/signals.c | 2 + - src/xz/signals.h | 17 +++-- - src/xz/suffix.c | 2 +- - src/xzdec/Makefile.am | 13 +++- - src/xzdec/xzdec.c | 55 +++++---------- - 41 files changed, 974 insertions(+), 640 deletions(-) + THANKS | 1 + + configure.ac | 12 +-- + m4/lc_physmem.m4 | 84 --------------- + m4/tuklib_common.m4 | 22 ++++ + m4/{lc_cpucores.m4 => tuklib_cpucores.m4} | 83 ++++++++------ + m4/tuklib_physmem.m4 | 119 +++++++++++++++++++++ + m4/tuklib_progname.m4 | 25 +++++ + src/common/sysdefs.h | 4 - + src/common/tuklib_common.h | 67 ++++++++++++ + src/common/tuklib_config.h | 1 + + src/common/{cpucores.h => tuklib_cpucores.c} | 39 +++---- + src/common/tuklib_cpucores.h | 23 ++++ + src/common/tuklib_exit.c | 57 ++++++++++ + src/common/tuklib_exit.h | 25 +++++ + src/common/tuklib_gettext.h | 44 ++++++++ + src/common/{open_stdxxx.h => tuklib_open_stdxxx.c} | 24 +++-- + src/common/tuklib_open_stdxxx.h | 23 ++++ + src/common/{physmem.h => tuklib_physmem.c} | 58 +++++----- + src/common/tuklib_physmem.h | 28 +++++ + src/common/tuklib_progname.c | 50 +++++++++ + src/common/tuklib_progname.h | 32 ++++++ + src/lzmainfo/Makefile.am | 5 +- + src/lzmainfo/lzmainfo.c | 65 ++++------- + src/xz/Makefile.am | 7 +- + src/xz/args.c | 8 +- + src/xz/file_io.c | 43 ++++---- + src/xz/hardware.c | 8 +- + src/xz/main.c | 100 ++++------------- + src/xz/main.h | 7 -- + src/xz/message.c | 30 +++--- + src/xz/message.h | 8 +- + src/xz/private.h | 11 +- + src/xz/signals.c | 2 + + src/xz/signals.h | 17 ++- + src/xz/suffix.c | 2 +- + src/xzdec/Makefile.am | 13 ++- + src/xzdec/xzdec.c | 55 +++------- + 37 files changed, 768 insertions(+), 434 deletions(-) commit 49cfc8d392cf535f8dd10233225b1fc726fec9ef Author: Lasse Collin @@ -8268,11 +8816,11 @@ Date: 2009-08-09 13:22:12 -0500 It can be somewhat confusing that - less < some_file.txt + less < some_file.txt works fine, whereas - xzless < some_file.txt.xz + xzless < some_file.txt.xz does not. Since version 429, ‘less’ allows a filter specified in the LESSOPEN environment variable to preprocess its input even if @@ -8760,18 +9308,13 @@ Date: 2009-06-27 17:28:01 +0300 Moved the Windows resource files outside the windows directory to prepare for building them with Autotools. - src/common/common_w32res.rc | 46 +++++++++++++++++++++++++++++++++++++++++++ - src/liblzma/liblzma_w32res.rc | 5 +++++ - src/xz/xz_w32res.rc | 5 +++++ - src/xzdec/lzmadec_w32res.rc | 5 +++++ - src/xzdec/xzdec_w32res.rc | 5 +++++ - windows/Makefile | 35 +++++++++++++++++--------------- - windows/common.rc | 46 ------------------------------------------- - windows/liblzma.rc | 5 ----- - windows/lzmadec.rc | 5 ----- - windows/xz.rc | 5 ----- - windows/xzdec.rc | 5 ----- - 11 files changed, 85 insertions(+), 82 deletions(-) + windows/common.rc => src/common/common_w32res.rc | 0 + .../liblzma.rc => src/liblzma/liblzma_w32res.rc | 2 +- + windows/xz.rc => src/xz/xz_w32res.rc | 2 +- + windows/lzmadec.rc => src/xzdec/lzmadec_w32res.rc | 2 +- + windows/xzdec.rc => src/xzdec/xzdec_w32res.rc | 2 +- + windows/Makefile | 35 ++++++++++++---------- + 6 files changed, 23 insertions(+), 20 deletions(-) commit 449c634674f35336a4815d398172e447659a135e Author: Lasse Collin @@ -8853,19 +9396,15 @@ Date: 2009-06-26 20:49:54 +0300 to avoid problems on systems with system headers with those names. - dos/Makefile | 4 +- - src/xz/Makefile.am | 8 +- - src/xz/coder.c | 488 ++++++++++++++++++++++++++++++++++++ - src/xz/coder.h | 57 +++++ - src/xz/file_io.c | 716 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - src/xz/file_io.h | 86 +++++++ - src/xz/io.c | 716 ----------------------------------------------------- - src/xz/io.h | 86 ------- - src/xz/private.h | 4 +- - src/xz/process.c | 488 ------------------------------------ - src/xz/process.h | 57 ----- - windows/Makefile | 4 +- - 12 files changed, 1357 insertions(+), 1357 deletions(-) + dos/Makefile | 4 ++-- + src/xz/Makefile.am | 8 ++++---- + src/xz/{process.c => coder.c} | 0 + src/xz/{process.h => coder.h} | 0 + src/xz/{io.c => file_io.c} | 0 + src/xz/{io.h => file_io.h} | 0 + src/xz/private.h | 4 ++-- + windows/Makefile | 4 ++-- + 8 files changed, 10 insertions(+), 10 deletions(-) commit 5e1257466dcb66f1d7a3f71814a5ad885cba43e8 Author: Lasse Collin @@ -9247,9 +9786,8 @@ Date: 2009-05-01 11:20:23 +0300 Renamed the file format specification to xz-file-format.txt which is the filename used on the WWW. - doc/file-format.txt | 1127 ------------------------------------------------ - doc/xz-file-format.txt | 1127 ++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 1127 insertions(+), 1127 deletions(-) + doc/{file-format.txt => xz-file-format.txt} | 0 + 1 file changed, 0 insertions(+), 0 deletions(-) commit 21c6b94373d239d7e86bd480fcd558e30391712f Author: Lasse Collin @@ -9318,20 +9856,14 @@ Date: 2009-04-13 14:49:48 +0300 Quick & dirty update to support xz in diff/grep/more scripts. - src/scripts/Makefile.am | 38 +++++++++------ - src/scripts/lzdiff | 67 -------------------------- - src/scripts/lzdiff.1 | 51 -------------------- - src/scripts/lzgrep | 123 ------------------------------------------------ - src/scripts/lzgrep.1 | 61 ------------------------ - src/scripts/lzmore | 74 ----------------------------- - src/scripts/lzmore.1 | 55 ---------------------- - src/scripts/xzdiff | 67 ++++++++++++++++++++++++++ - src/scripts/xzdiff.1 | 58 +++++++++++++++++++++++ - src/scripts/xzgrep | 123 ++++++++++++++++++++++++++++++++++++++++++++++++ - src/scripts/xzgrep.1 | 77 ++++++++++++++++++++++++++++++ - src/scripts/xzmore | 74 +++++++++++++++++++++++++++++ - src/scripts/xzmore.1 | 66 ++++++++++++++++++++++++++ - 13 files changed, 489 insertions(+), 445 deletions(-) + src/scripts/Makefile.am | 38 +++++++++++++++++++----------- + src/scripts/{lzdiff => xzdiff} | 24 +++++++++---------- + src/scripts/{lzdiff.1 => xzdiff.1} | 29 ++++++++++++++--------- + src/scripts/{lzgrep => xzgrep} | 10 ++++---- + src/scripts/{lzgrep.1 => xzgrep.1} | 48 +++++++++++++++++++++++++------------- + src/scripts/{lzmore => xzmore} | 12 +++++----- + src/scripts/{lzmore.1 => xzmore.1} | 33 +++++++++++++++++--------- + 7 files changed, 119 insertions(+), 75 deletions(-) commit 02ddf09bc3079b3e17297729b9e43f14d407b8fc Author: Lasse Collin @@ -9675,16 +10207,15 @@ Date: 2009-02-17 10:43:00 +0200 pieces to avoid unneeded dependencies making statically linked applications bigger than needed. - dos/Makefile | 6 +- - src/liblzma/common/easy.c | 128 ----------------------------- - src/liblzma/common/easy_buffer_encoder.c | 34 ++++++++ - src/liblzma/common/easy_decoder_memusage.c | 31 +++++++ - src/liblzma/common/easy_encoder.c | 87 ++++++++++++++++++++ - src/liblzma/common/easy_encoder_memusage.c | 31 +++++++ - src/liblzma/common/easy_preset.c | 34 ++++++++ - src/liblzma/common/easy_preset.h | 39 +++++++++ - windows/Makefile | 6 +- - 9 files changed, 266 insertions(+), 130 deletions(-) + dos/Makefile | 6 ++- + src/liblzma/common/easy_buffer_encoder.c | 34 +++++++++++++++++ + src/liblzma/common/easy_decoder_memusage.c | 31 ++++++++++++++++ + src/liblzma/common/{easy.c => easy_encoder.c} | 53 +++------------------------ + src/liblzma/common/easy_encoder_memusage.c | 31 ++++++++++++++++ + src/liblzma/common/easy_preset.c | 34 +++++++++++++++++ + src/liblzma/common/easy_preset.h | 39 ++++++++++++++++++++ + windows/Makefile | 6 ++- + 8 files changed, 185 insertions(+), 49 deletions(-) commit 7494816ab08d82f4d6409788825930c4e43cfd0d Author: Lasse Collin @@ -10657,15 +11188,14 @@ Date: 2008-12-31 16:29:39 +0200 The internal implementation is still using the name "simple". It may need some cleanups, so I look at it later. - src/liblzma/api/Makefile.am | 2 +- - src/liblzma/api/lzma.h | 2 +- - src/liblzma/api/lzma/bcj.h | 94 +++++++++++++++++++++++++++++++++++++ - src/liblzma/api/lzma/simple.h | 94 ------------------------------------- - src/liblzma/simple/simple_coder.c | 2 +- - src/liblzma/simple/simple_decoder.c | 4 +- - src/liblzma/simple/simple_encoder.c | 4 +- - tests/test_filter_flags.c | 8 ++-- - 8 files changed, 105 insertions(+), 105 deletions(-) + src/liblzma/api/Makefile.am | 2 +- + src/liblzma/api/lzma.h | 2 +- + src/liblzma/api/lzma/{simple.h => bcj.h} | 22 +++++++++++----------- + src/liblzma/simple/simple_coder.c | 2 +- + src/liblzma/simple/simple_decoder.c | 4 ++-- + src/liblzma/simple/simple_encoder.c | 4 ++-- + tests/test_filter_flags.c | 8 ++++---- + 7 files changed, 22 insertions(+), 22 deletions(-) commit 7eea8bec3abfed883efba66264a1452a1c04f6b0 Author: Lasse Collin @@ -10719,47 +11249,44 @@ Date: 2008-12-31 00:30:49 +0200 as the more bloated uint32_t array on x86; hopefully it's not bad on other architectures. - configure.ac | 29 ++++++++-- - src/common/mythread.h | 34 ++++++++++++ - src/liblzma/api/Makefile.am | 1 - - src/liblzma/api/lzma.h | 1 - - src/liblzma/api/lzma/init.h | 85 ----------------------------- - src/liblzma/check/Makefile.am | 29 ++++------ - src/liblzma/check/check.c | 10 ++-- - src/liblzma/check/check.h | 25 ++++----- - src/liblzma/check/check_init.c | 37 ------------- - src/liblzma/check/crc32.c | 88 ------------------------------- - src/liblzma/check/crc32_fast.c | 88 +++++++++++++++++++++++++++++++ - src/liblzma/check/crc32_init.c | 55 ------------------- - src/liblzma/check/crc32_small.c | 54 +++++++++++++++++++ - src/liblzma/check/crc32_tablegen.c | 55 ++++++++++++++++--- - src/liblzma/check/crc64.c | 75 -------------------------- - src/liblzma/check/crc64_fast.c | 75 ++++++++++++++++++++++++++ - src/liblzma/check/crc64_small.c | 54 +++++++++++++++++++ - src/liblzma/check/crc64_tablegen.c | 55 ++++++++++++++++--- - src/liblzma/common/Makefile.am | 3 -- - src/liblzma/common/common.h | 1 + - src/liblzma/common/init.c | 39 -------------- - src/liblzma/common/init_decoder.c | 31 ----------- - src/liblzma/common/init_encoder.c | 40 -------------- - src/liblzma/liblzma.pc.in | 12 +++++ - src/liblzma/lz/lz_encoder.c | 6 +++ - src/liblzma/lzma.pc.in | 11 ---- - src/liblzma/rangecoder/Makefile.am | 8 +-- - src/liblzma/rangecoder/price.h | 16 +----- - src/liblzma/rangecoder/price_table.c | 2 +- - src/liblzma/rangecoder/price_table_init.c | 55 ------------------- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jan 20 06:40:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE7C5CB9107; Fri, 20 Jan 2017 06:40:13 +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 A3D171E6D; Fri, 20 Jan 2017 06:40:13 +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 v0K6eC5E074983; Fri, 20 Jan 2017 06:40:12 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K6eCAr074981; Fri, 20 Jan 2017 06:40:12 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701200640.v0K6eCAr074981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 20 Jan 2017 06:40: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: r312518 - in stable/10: contrib/xz contrib/xz/src/common contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblzma/common contrib/xz/src/liblzma/delta contrib/... 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, 20 Jan 2017 06:40:14 -0000 Author: delphij Date: Fri Jan 20 06:40:12 2017 New Revision: 312518 URL: https://svnweb.freebsd.org/changeset/base/312518 Log: MFC r311504: MFV r311477: xz 5.2.3. Modified: stable/10/contrib/xz/ChangeLog stable/10/contrib/xz/THANKS stable/10/contrib/xz/src/common/tuklib_cpucores.c stable/10/contrib/xz/src/common/tuklib_physmem.c stable/10/contrib/xz/src/liblzma/api/lzma/version.h stable/10/contrib/xz/src/liblzma/check/check.h stable/10/contrib/xz/src/liblzma/common/alone_decoder.c stable/10/contrib/xz/src/liblzma/common/alone_encoder.c stable/10/contrib/xz/src/liblzma/common/auto_decoder.c stable/10/contrib/xz/src/liblzma/common/block_decoder.c stable/10/contrib/xz/src/liblzma/common/block_encoder.c stable/10/contrib/xz/src/liblzma/common/common.h stable/10/contrib/xz/src/liblzma/common/index.c stable/10/contrib/xz/src/liblzma/common/index_decoder.c stable/10/contrib/xz/src/liblzma/common/index_encoder.c stable/10/contrib/xz/src/liblzma/common/stream_decoder.c stable/10/contrib/xz/src/liblzma/common/stream_encoder.c stable/10/contrib/xz/src/liblzma/common/stream_encoder_mt.c stable/10/contrib/xz/src/liblzma/delta/delta_common.c stable/10/contrib/xz/src/liblzma/delta/delta_decoder.c stable/10/contrib/xz/src/liblzma/delta/delta_encoder.c stable/10/contrib/xz/src/liblzma/delta/delta_private.h stable/10/contrib/xz/src/liblzma/lz/lz_decoder.c stable/10/contrib/xz/src/liblzma/lz/lz_decoder.h stable/10/contrib/xz/src/liblzma/lz/lz_encoder.c stable/10/contrib/xz/src/liblzma/lz/lz_encoder.h stable/10/contrib/xz/src/liblzma/lzma/lzma2_decoder.c stable/10/contrib/xz/src/liblzma/lzma/lzma2_encoder.c stable/10/contrib/xz/src/liblzma/lzma/lzma_decoder.c stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder.c stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder.h stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c stable/10/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h stable/10/contrib/xz/src/liblzma/simple/arm.c stable/10/contrib/xz/src/liblzma/simple/armthumb.c stable/10/contrib/xz/src/liblzma/simple/ia64.c stable/10/contrib/xz/src/liblzma/simple/powerpc.c stable/10/contrib/xz/src/liblzma/simple/simple_coder.c stable/10/contrib/xz/src/liblzma/simple/simple_private.h stable/10/contrib/xz/src/liblzma/simple/sparc.c stable/10/contrib/xz/src/liblzma/simple/x86.c stable/10/contrib/xz/src/xz/args.c stable/10/contrib/xz/src/xz/coder.c stable/10/contrib/xz/src/xz/file_io.c stable/10/contrib/xz/src/xz/file_io.h stable/10/contrib/xz/src/xz/main.c stable/10/contrib/xz/src/xz/private.h stable/10/lib/liblzma/config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/xz/ChangeLog ============================================================================== --- stable/10/contrib/xz/ChangeLog Fri Jan 20 06:38:56 2017 (r312517) +++ stable/10/contrib/xz/ChangeLog Fri Jan 20 06:40:12 2017 (r312518) @@ -1,3 +1,563 @@ +commit 3d566cd519017eee1a400e7961ff14058dfaf33c +Author: Lasse Collin +Date: 2016-12-30 13:26:36 +0200 + + Bump version and soname for 5.2.3. + + src/liblzma/Makefile.am | 2 +- + src/liblzma/api/lzma/version.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit 053e624fe33795e779ff736f16ce44a129c829b5 +Author: Lasse Collin +Date: 2016-12-30 13:25:10 +0200 + + Update NEWS for 5.2.3. + + NEWS | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +commit cae412b2b77d7fd88d187ed7659331709311f80d +Author: Lasse Collin +Date: 2015-04-01 14:45:25 +0300 + + xz: Fix the Capsicum rights on user_abort_pipe. + + src/xz/file_io.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +commit 9ccbae41000572193b9a09e7102f9e84dc6d96de +Author: Lasse Collin +Date: 2016-12-28 21:05:22 +0200 + + Mention potential sandboxing bugs in INSTALL. + + INSTALL | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit e013a337d3de77cce24360dffe956ea2339489b6 +Author: Lasse Collin +Date: 2016-11-21 20:24:50 +0200 + + liblzma: Avoid multiple definitions of lzma_coder structures. + + Only one definition was visible in a translation unit. + It avoided a few casts and temp variables but seems that + this hack doesn't work with link-time optimizations in compilers + as it's not C99/C11 compliant. + + Fixes: + http://www.mail-archive.com/xz-devel@tukaani.org/msg00279.html + + src/liblzma/common/alone_decoder.c | 44 +++++---- + src/liblzma/common/alone_encoder.c | 34 ++++--- + src/liblzma/common/auto_decoder.c | 35 ++++--- + src/liblzma/common/block_decoder.c | 41 ++++---- + src/liblzma/common/block_encoder.c | 40 ++++---- + src/liblzma/common/common.h | 18 ++-- + src/liblzma/common/index_decoder.c | 33 ++++--- + src/liblzma/common/index_encoder.c | 16 ++-- + src/liblzma/common/stream_decoder.c | 50 +++++----- + src/liblzma/common/stream_encoder.c | 56 ++++++----- + src/liblzma/common/stream_encoder_mt.c | 124 ++++++++++++++----------- + src/liblzma/delta/delta_common.c | 25 ++--- + src/liblzma/delta/delta_decoder.c | 6 +- + src/liblzma/delta/delta_encoder.c | 12 ++- + src/liblzma/delta/delta_private.h | 4 +- + src/liblzma/lz/lz_decoder.c | 60 ++++++------ + src/liblzma/lz/lz_decoder.h | 13 ++- + src/liblzma/lz/lz_encoder.c | 57 +++++++----- + src/liblzma/lz/lz_encoder.h | 9 +- + src/liblzma/lzma/lzma2_decoder.c | 32 ++++--- + src/liblzma/lzma/lzma2_encoder.c | 51 +++++----- + src/liblzma/lzma/lzma_decoder.c | 27 +++--- + src/liblzma/lzma/lzma_encoder.c | 29 +++--- + src/liblzma/lzma/lzma_encoder.h | 9 +- + src/liblzma/lzma/lzma_encoder_optimum_fast.c | 3 +- + src/liblzma/lzma/lzma_encoder_optimum_normal.c | 23 ++--- + src/liblzma/lzma/lzma_encoder_private.h | 6 +- + src/liblzma/simple/arm.c | 2 +- + src/liblzma/simple/armthumb.c | 2 +- + src/liblzma/simple/ia64.c | 2 +- + src/liblzma/simple/powerpc.c | 2 +- + src/liblzma/simple/simple_coder.c | 61 ++++++------ + src/liblzma/simple/simple_private.h | 12 +-- + src/liblzma/simple/sparc.c | 2 +- + src/liblzma/simple/x86.c | 15 +-- + 35 files changed, 532 insertions(+), 423 deletions(-) + +commit 8e0f1af3dcaec00a3879cce8ad7441edc6359d1c +Author: Lasse Collin +Date: 2016-12-26 20:50:25 +0200 + + Document --enable-sandbox configure option in INSTALL. + + INSTALL | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +commit ce2542d220de06acd618fd9f5c0a6683029fb4eb +Author: Lasse Collin +Date: 2015-03-31 22:19:34 +0300 + + xz: Add support for sandboxing with Capsicum (disabled by default). + + In the v5.2 branch this feature is considered experimental + and thus disabled by default. + + The sandboxing is used conditionally as described in main.c. + This isn't optimal but it was much easier to implement than + a full sandboxing solution and it still covers the most common + use cases where xz is writing to standard output. This should + have practically no effect on performance even with small files + as fork() isn't needed. + + C and locale libraries can open files as needed. This has been + fine in the past, but it's a problem with things like Capsicum. + io_sandbox_enter() tries to ensure that various locale-related + files have been loaded before cap_enter() is called, but it's + possible that there are other similar problems which haven't + been seen yet. + + Currently Capsicum is available on FreeBSD 10 and later + and there is a port to Linux too. + + Thanks to Loganaden Velvindron for help. + + configure.ac | 41 +++++++++++++++++++++++++++ + src/xz/Makefile.am | 2 +- + src/xz/file_io.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ + src/xz/file_io.h | 6 ++++ + src/xz/main.c | 18 ++++++++++++ + src/xz/private.h | 4 +++ + 6 files changed, 151 insertions(+), 1 deletion(-) + +commit 3ca1d5e6320111043e19434da881065fadafa0e4 +Author: Lasse Collin +Date: 2015-03-31 21:12:30 +0300 + + Fix bugs and otherwise improve ax_check_capsicum.m4. + + AU_ALIAS was removed because the new version is incompatible + with the old version. + + It no longer checks for separately. + It's enough to test for it as part of AC_CHECK_DECL. + The defines HAVE_CAPSICUM_SYS_CAPSICUM_H and + HAVE_CAPSICUM_SYS_CAPABILITY_H were removed as unneeded. + HAVE_SYS_CAPSICUM_H from AC_CHECK_HEADERS is enough. + + It no longer does a useless search for the Capsicum library + if the header wasn't found. + + Fixed a bug in ACTION-IF-FOUND (the first argument). Specifying + the argument omitted the default action but the given action + wasn't used instead. + + AC_DEFINE([HAVE_CAPSICUM]) is now always called when Capsicum + support is found. Previously it was part of the default + ACTION-IF-FOUND which a custom action would override. Now + the default action only prepends ${CAPSICUM_LIB} to LIBS. + + The documentation was updated. + + Since there as no serial number, "#serial 2" was added. + + m4/ax_check_capsicum.m4 | 103 ++++++++++++++++++++++++------------------------ + 1 file changed, 51 insertions(+), 52 deletions(-) + +commit 5f3a742b64197fe8bedb6f05fc6ce5d177d11145 +Author: Lasse Collin +Date: 2015-03-31 19:20:24 +0300 + + Add m4/ax_check_capsicum.m4 for detecting Capsicum support. + + The file was loaded from this web page: + https://github.com/google/capsicum-test/blob/dev/autoconf/m4/ax_check_capsicum.m4 + + Thanks to Loganaden Velvindron for pointing it out for me. + + m4/ax_check_capsicum.m4 | 86 +++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 86 insertions(+) + +commit d74377e62b4c649e40294dd441de72c0f092e67c +Author: Lasse Collin +Date: 2015-10-12 20:29:09 +0300 + + liblzma: Fix a memory leak in error path of lzma_index_dup(). + + lzma_index_dup() calls index_dup_stream() which, in case of + an error, calls index_stream_end() to free memory allocated + by index_stream_init(). However, it illogically didn't + actually free the memory. To make it logical, the tree + handling code was modified a bit in addition to changing + index_stream_end(). + + Thanks to Evan Nemerson for the bug report. + + src/liblzma/common/index.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +commit f580732216dcf971f3f006fe8e01cd4979e1d964 +Author: Lasse Collin +Date: 2016-10-24 18:53:25 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 88d7a7fd153bf1355cdf798ffdac7443d0169afc +Author: Lasse Collin +Date: 2016-10-24 18:51:36 +0300 + + tuklib_cpucores: Add support for sched_getaffinity(). + + It's available in glibc (GNU/Linux, GNU/kFreeBSD). It's better + than sysconf(_SC_NPROCESSORS_ONLN) because sched_getaffinity() + gives the number of cores available to the process instead of + the total number of cores online. + + As a side effect, this commit fixes a bug on GNU/kFreeBSD where + configure would detect the FreeBSD-specific cpuset_getaffinity() + but it wouldn't actually work because on GNU/kFreeBSD it requires + using -lfreebsd-glue when linking. Now the glibc-specific function + will be used instead. + + Thanks to Sebastian Andrzej Siewior for the original patch + and testing. + + m4/tuklib_cpucores.m4 | 30 +++++++++++++++++++++++++++++- + src/common/tuklib_cpucores.c | 9 +++++++++ + 2 files changed, 38 insertions(+), 1 deletion(-) + +commit 51baf684376903dbeddd840582bfdf9fa91b311b +Author: Lasse Collin +Date: 2016-06-30 20:27:36 +0300 + + xz: Fix copying of timestamps on Windows. + + xz used to call utime() on Windows, but its result gets lost + on close(). Using _futime() seems to work. + + Thanks to Martok for reporting the bug: + http://www.mail-archive.com/xz-devel@tukaani.org/msg00261.html + + configure.ac | 2 +- + src/xz/file_io.c | 18 ++++++++++++++++++ + 2 files changed, 19 insertions(+), 1 deletion(-) + +commit 1ddc479851139d6e8202e5835421bfe6578d9e07 +Author: Lasse Collin +Date: 2016-06-16 22:46:02 +0300 + + xz: Silence warnings from -Wlogical-op. + + Thanks to Evan Nemerson. + + src/xz/file_io.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +commit be647ff5ed5a1c244a65722af6ce250259f3b14a +Author: Lasse Collin +Date: 2016-04-10 20:55:49 +0300 + + Build: Fix = to += for xz_SOURCES in src/xz/Makefile.am. + + Thanks to Christian Kujau. + + src/xz/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit fb6d50c15343831f35305982cefa82053099191d +Author: Lasse Collin +Date: 2016-04-10 20:54:17 +0300 + + Build: Bump GNU Gettext version requirement to 0.19. + + It silences a few warnings and most people probably have + 0.19 even on stable distributions. + + Thanks to Christian Kujau. + + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +commit 74f8dad9f912a2993768d93d108ea2b0b2c196e0 +Author: Lasse Collin +Date: 2016-03-13 20:21:49 +0200 + + liblzma: Disable external SHA-256 by default. + + This is the sane thing to do. The conflict with OpenSSL + on some OSes and especially that the OS-provided versions + can be significantly slower makes it clear that it was + a mistake to have the external SHA-256 support enabled by + default. + + Those who want it can now pass --enable-external-sha256 to + configure. INSTALL was updated with notes about OSes where + this can be a bad idea. + + The SHA-256 detection code in configure.ac had some bugs that + could lead to a build failure in some situations. These were + fixed, although it doesn't matter that much now that the + external SHA-256 is disabled by default. + + MINIX >= 3.2.0 uses NetBSD's libc and thus has SHA256_Init + in libc instead of libutil. Support for the libutil version + was removed. + + INSTALL | 36 ++++++++++++++++++++++ + configure.ac | 76 +++++++++++++++++++++++------------------------ + src/liblzma/check/check.h | 16 ++++------ + 3 files changed, 79 insertions(+), 49 deletions(-) + +commit ea7f6ff04cb5bb1498088eb09960a4c3f13dfe39 +Author: Lasse Collin +Date: 2016-03-10 20:27:05 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit d0e018016b311232e82d9a98dc68f1e3dabce794 +Author: Lasse Collin +Date: 2016-03-10 20:26:49 +0200 + + Build: Avoid SHA256_Init on FreeBSD and MINIX 3. + + On FreeBSD 10 and older, SHA256_Init from libmd conflicts + with libcrypto from OpenSSL. The OpenSSL version has + different sizeof(SHA256_CTX) and it can cause weird + problems if wrong SHA256_Init gets used. + + Looking at the source, MINIX 3 seems to have a similar issue but + I'm not sure. To be safe, I disabled SHA256_Init on MINIX 3 too. + + NetBSD has SHA256_Init in libc and they had a similar problem, + but they already fixed it in 2009. + + Thanks to Jim Wilcoxson for the bug report that helped + in finding the problem. + + configure.ac | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +commit 5daae123915f32a4ed6dc948b831533c2d1beec3 +Author: Lasse Collin +Date: 2015-11-08 20:16:10 +0200 + + tuklib_physmem: Hopefully silence a warning on Windows. + + src/common/tuklib_physmem.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 491acc406e098167ccb7fce0728b94c2f32cff9f +Author: Lasse Collin +Date: 2015-11-04 23:17:43 +0200 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 8173ff8790ad3502d04e1c07d014cb84a3b8187b +Author: Lasse Collin +Date: 2015-11-04 23:14:00 +0200 + + liblzma: Make Valgrind happier with optimized (gcc -O2) liblzma. + + When optimizing, GCC can reorder code so that an uninitialized + value gets used in a comparison, which makes Valgrind unhappy. + It doesn't happen when compiled with -O0, which I tend to use + when running Valgrind. + + Thanks to Rich Prohaska. I remember this being mentioned long + ago by someone else but nothing was done back then. + + src/liblzma/lz/lz_encoder.c | 4 ++++ + 1 file changed, 4 insertions(+) + +commit 013de2b5ab8094d2c82a2771f3d143eeb656eda9 +Author: Lasse Collin +Date: 2015-11-03 20:55:45 +0200 + + liblzma: Rename lzma_presets.c back to lzma_encoder_presets.c. + + It would be too annoying to update other build systems + just because of this. + + src/liblzma/lzma/Makefile.inc | 2 +- + src/liblzma/lzma/{lzma_presets.c => lzma_encoder_presets.c} | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +commit a322f70ad96de88968c2c36e6a36bc08ae30bd20 +Author: Lasse Collin +Date: 2015-11-03 20:47:07 +0200 + + Build: Disable xzdec, lzmadec, and lzmainfo when they cannot be built. + + They all need decoder support and if that isn't available, + there's no point trying to build them. + + configure.ac | 3 +++ + 1 file changed, 3 insertions(+) + +commit 8ea49606cf6427e32319de7693eca9e43f1c8ad6 +Author: Lasse Collin +Date: 2015-11-03 20:35:19 +0200 + + Build: Simplify $enable_{encoders,decoders} usage a bit. + + configure.ac | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +commit 42131a25e52bfe400acfa7df93469a96bb78bb78 +Author: Lasse Collin +Date: 2015-11-03 20:31:31 +0200 + + Windows/MSVC: Update config.h. + + windows/config.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit e9184e87cc989d14c7413e6adb3eca98f6ae0290 +Author: Lasse Collin +Date: 2015-11-03 20:29:58 +0200 + + DOS: Update config.h. + + dos/config.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +commit 2296778f3c9a1e3a8699973b09dd3610b8baa402 +Author: Lasse Collin +Date: 2015-11-03 20:29:33 +0200 + + xz: Make xz buildable even when encoders or decoders are disabled. + + The patch is quite long but it's mostly about adding new #ifdefs + to omit code when encoders or decoders have been disabled. + + This adds two new #defines to config.h: HAVE_ENCODERS and + HAVE_DECODERS. + + configure.ac | 4 ++++ + src/xz/Makefile.am | 8 ++++++-- + src/xz/args.c | 16 ++++++++++++++++ + src/xz/coder.c | 33 +++++++++++++++++++++++++-------- + src/xz/main.c | 9 +++++++-- + src/xz/private.h | 5 ++++- + 6 files changed, 62 insertions(+), 13 deletions(-) + +commit 97a3109281e475d9cf1b5095237d672fa0ad25e5 +Author: Lasse Collin +Date: 2015-11-03 18:06:40 +0200 + + Build: Build LZMA1/2 presets also when only decoder is wanted. + + People shouldn't rely on the presets when decoding raw streams, + but xz uses the presets as the starting point for raw decoder + options anyway. + + lzma_encocder_presets.c was renamed to lzma_presets.c to + make it clear it's not used solely by the encoder code. + + src/liblzma/lzma/Makefile.inc | 6 +++++- + src/liblzma/lzma/{lzma_encoder_presets.c => lzma_presets.c} | 3 ++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +commit dc6b78d7f0f6fe43e9d4215146e8581feb8090e7 +Author: Lasse Collin +Date: 2015-11-03 17:54:48 +0200 + + Build: Fix configure to handle LZMA1 dependency with LZMA2. + + Now it gives an error if LZMA1 encoder/decoder is missing + when LZMA2 encoder/decoder was requested. Even better would + be LZMA2 implicitly enabling LZMA1 but it would need more code. + + configure.ac | 5 ----- + 1 file changed, 5 deletions(-) + +commit 46d76c9cd3cb26a31f5ae6c3a8bbcf38e6da1add +Author: Lasse Collin +Date: 2015-11-03 17:41:54 +0200 + + Build: Don't omit lzma_cputhreads() unless using --disable-threads. + + Previously it was omitted if encoders were disabled + with --disable-encoders. It didn't make sense and + it also broke the build. + + src/liblzma/common/Makefile.inc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +commit 16d68f874d89f1e4a1919786a35bbaef7d71a077 +Author: Lasse Collin +Date: 2015-11-02 18:16:51 +0200 + + liblzma: Fix a build failure related to external SHA-256 support. + + If an appropriate header and structure were found by configure, + but a library with a usable SHA-256 functions wasn't, the build + failed. + + src/liblzma/check/check.h | 32 +++++++++++++++++++++++--------- + 1 file changed, 23 insertions(+), 9 deletions(-) + +commit d9311647fc1ab512a3394596221ab8039c00af6b +Author: Lasse Collin +Date: 2015-11-02 15:19:10 +0200 + + xz: Always close the file before trying to delete it. + + unlink() can return EBUSY in errno for open files on some + operating systems and file systems. + + src/xz/file_io.c | 25 ++++++++++++------------- + 1 file changed, 12 insertions(+), 13 deletions(-) + +commit f59c4183f3c9066626ce45dc3db4642fa603fa21 +Author: Lasse Collin +Date: 2015-10-12 21:08:42 +0300 + + Update THANKS. + + THANKS | 1 + + 1 file changed, 1 insertion(+) + +commit 35f189673e280c12e4c5129f9f97e54eef3bbc04 +Author: Lasse Collin +Date: 2015-10-12 21:07:41 +0300 + + Tests: Add tests for the two bugs fixed in index.c. + + tests/test_index.c | 30 ++++++++++++++++++++++++++++++ + 1 file changed, 30 insertions(+) + +commit e10bfdb0fcaff12f3a6dadee51e0a022aadccb51 +Author: Lasse Collin +Date: 2015-10-12 20:45:15 +0300 + + liblzma: Fix lzma_index_dup() for empty Streams. + + Stream Flags and Stream Padding weren't copied from + empty Streams. + + src/liblzma/common/index.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +commit 06f434bd8980f25ca23232eb7bb7df7e37dc8448 +Author: Lasse Collin +Date: 2015-10-12 20:31:44 +0300 + + liblzma: Add a note to index.c for those using static analyzers. + + src/liblzma/common/index.c | 3 +++ + 1 file changed, 3 insertions(+) + commit 9815cdf6987ef91a85493bfcfd1ce2aaf3b47a0a Author: Lasse Collin Date: 2015-09-29 13:59:35 +0300 @@ -129,11 +689,10 @@ Date: 2015-06-19 20:21:30 +0300 Windows: Update the docs. - INSTALL | 29 ++++++---- - windows/INSTALL-MSVC.txt | 47 +++++++++++++++ - windows/INSTALL-MinGW.txt | 138 ++++++++++++++++++++++++++++++++++++++++++++ - windows/INSTALL-Windows.txt | 138 -------------------------------------------- - 4 files changed, 204 insertions(+), 148 deletions(-) + INSTALL | 29 ++++++++----- + windows/INSTALL-MSVC.txt | 47 ++++++++++++++++++++++ + windows/{INSTALL-Windows.txt => INSTALL-MinGW.txt} | 2 +- + 3 files changed, 67 insertions(+), 11 deletions(-) commit 28195e4c877007cc760ecea1d17f740693d66873 Author: Lasse Collin @@ -1587,11 +2146,10 @@ Date: 2014-05-04 11:07:17 +0300 It can be confusing that two header files have the same name. The public API file is still lzma.h. - src/liblzma/api/Makefile.am | 2 +- - src/liblzma/api/lzma.h | 2 +- - src/liblzma/api/lzma/lzma.h | 420 ------------------------------------------ - src/liblzma/api/lzma/lzma12.h | 420 ++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 422 insertions(+), 422 deletions(-) + src/liblzma/api/Makefile.am | 2 +- + src/liblzma/api/lzma.h | 2 +- + src/liblzma/api/lzma/{lzma.h => lzma12.h} | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) commit 1555a9c5664afc7893a2b75e9970105437f01ef1 Author: Lasse Collin @@ -2650,20 +3208,20 @@ Date: 2012-11-19 00:10:10 -0800 with “|-â€. That worked well for a while, but the version string from ‘less’ versions 448 (June, 2012) is misparsed, producing a warning: - $ xzless /tmp/test.xz; echo $? - /usr/bin/xzless: line 49: test: 456 (GNU regular expressions): \ - integer expression expected - 0 + $ xzless /tmp/test.xz; echo $? + /usr/bin/xzless: line 49: test: 456 (GNU regular expressions): \ + integer expression expected + 0 More precisely, modern ‘less’ lists the regexp implementation along with its version number, and xzless passes the entire version number with attached parenthetical phrase as a number to "test $a -gt $b", producing the above confusing message. - $ less-444 -V | head -1 - less 444 - $ less -V | head -1 - less 456 (no regular expressions) + $ less-444 -V | head -1 + less 444 + $ less -V | head -1 + less 456 (no regular expressions) So relax the pattern matched --- instead of expecting "less ", look for a line of the form "less [ (extra parenthetical)]". @@ -3058,11 +3616,9 @@ Date: 2012-06-14 10:33:27 +0300 copied the decompressor bug from xz_pipe_decomp.c he has an example how to easily fix it. - doc/examples/xz_pipe_comp.c | 127 -------------------------------------- - doc/examples/xz_pipe_decomp.c | 123 ------------------------------------ - doc/examples_old/xz_pipe_comp.c | 127 ++++++++++++++++++++++++++++++++++++++ - doc/examples_old/xz_pipe_decomp.c | 123 ++++++++++++++++++++++++++++++++++++ - 4 files changed, 250 insertions(+), 250 deletions(-) + doc/{examples => examples_old}/xz_pipe_comp.c | 0 + doc/{examples => examples_old}/xz_pipe_decomp.c | 0 + 2 files changed, 0 insertions(+), 0 deletions(-) commit 905f0ab5b5ce544d4b68a2ed6077df0f3d021292 Author: Lasse Collin @@ -4159,10 +4715,9 @@ Date: 2011-04-10 14:58:10 +0300 DOS: Update the docs and include notes about 8.3 filenames. - dos/INSTALL.txt | 79 ++++++++++++++++++++++++++++++++++++ - dos/README | 88 ---------------------------------------- - dos/README.txt | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 202 insertions(+), 88 deletions(-) + dos/{README => INSTALL.txt} | 13 +---- + dos/README.txt | 123 ++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 125 insertions(+), 11 deletions(-) commit ebd54dbd6e481d31e80757f900ac8109ad1423c6 Author: Lasse Collin @@ -4279,10 +4834,9 @@ Date: 2011-04-05 17:12:20 +0300 It was renamed to ax_pthread.m4 in Autoconf Archive. - configure.ac | 2 +- - m4/acx_pthread.m4 | 279 ----------------------------------------------------- - m4/ax_pthread.m4 | 283 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 284 insertions(+), 280 deletions(-) + configure.ac | 2 +- + m4/{acx_pthread.m4 => ax_pthread.m4} | 170 ++++++++++++++++++----------------- + 2 files changed, 88 insertions(+), 84 deletions(-) commit 1039bfcfc098b69d56ecb39d198a092552eacf6d Author: Lasse Collin @@ -4664,10 +5218,10 @@ Date: 2010-11-12 15:22:13 -0600 Builds from a separate build directory with - mkdir build - cd build - ../configure - doxygen Doxyfile + mkdir build + cd build + ../configure + doxygen Doxyfile include an even longer prefix /home/someone/src/xz/src; this patch has the nice side-effect of eliminating that prefix, too. @@ -5232,12 +5786,11 @@ Date: 2010-09-28 10:59:53 +0300 Move version.sh to build-aux. - Makefile.am | 4 ++-- - build-aux/version.sh | 24 ++++++++++++++++++++++++ - configure.ac | 2 +- - version.sh | 24 ------------------------ - windows/build.bash | 2 +- - 5 files changed, 28 insertions(+), 28 deletions(-) + Makefile.am | 4 ++-- + version.sh => build-aux/version.sh | 0 + configure.ac | 2 +- + windows/build.bash | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) commit 84af9d8770451339a692e9b70f96cf56156a6069 Author: Lasse Collin @@ -5739,11 +6292,10 @@ Date: 2010-07-27 20:45:03 +0300 Windows: build.sh is a bash script so name it correctly. - INSTALL | 2 +- - windows/INSTALL-Windows.txt | 6 +- - windows/build.bash | 189 ++++++++++++++++++++++++++++++++++++++++++++ - windows/build.sh | 189 -------------------------------------------- - 4 files changed, 193 insertions(+), 193 deletions(-) + INSTALL | 2 +- + windows/INSTALL-Windows.txt | 6 +++--- + windows/{build.sh => build.bash} | 6 +++--- + 3 files changed, 7 insertions(+), 7 deletions(-) commit b1cbfd40f049a646a639eb78a3e41e9e3ef73339 Author: Lasse Collin @@ -7597,48 +8149,44 @@ Date: 2009-09-19 09:47:30 +0300 building XZ Utils on OpenVMS. Thanks to Jouk Jansen for the original patch. - THANKS | 1 + - configure.ac | 12 ++-- - m4/lc_cpucores.m4 | 57 ---------------- - m4/lc_physmem.m4 | 84 ----------------------- - m4/tuklib_common.m4 | 22 ++++++ - m4/tuklib_cpucores.m4 | 72 ++++++++++++++++++++ - m4/tuklib_physmem.m4 | 119 ++++++++++++++++++++++++++++++++ - m4/tuklib_progname.m4 | 25 +++++++ - src/common/cpucores.h | 51 -------------- - src/common/open_stdxxx.h | 49 -------------- - src/common/physmem.h | 144 --------------------------------------- - src/common/sysdefs.h | 4 -- - src/common/tuklib_common.h | 67 ++++++++++++++++++ - src/common/tuklib_config.h | 1 + - src/common/tuklib_cpucores.c | 46 +++++++++++++ - src/common/tuklib_cpucores.h | 23 +++++++ - src/common/tuklib_exit.c | 57 ++++++++++++++++ - src/common/tuklib_exit.h | 25 +++++++ - src/common/tuklib_gettext.h | 44 ++++++++++++ - src/common/tuklib_open_stdxxx.c | 51 ++++++++++++++ - src/common/tuklib_open_stdxxx.h | 23 +++++++ - src/common/tuklib_physmem.c | 146 ++++++++++++++++++++++++++++++++++++++++ - src/common/tuklib_physmem.h | 28 ++++++++ - src/common/tuklib_progname.c | 50 ++++++++++++++ - src/common/tuklib_progname.h | 32 +++++++++ - src/lzmainfo/Makefile.am | 5 +- - src/lzmainfo/lzmainfo.c | 65 ++++++------------ - src/xz/Makefile.am | 7 +- - src/xz/args.c | 8 +-- - src/xz/file_io.c | 43 ++++++------ - src/xz/hardware.c | 8 +-- - src/xz/main.c | 100 ++++++--------------------- - src/xz/main.h | 7 -- - src/xz/message.c | 30 +++++---- - src/xz/message.h | 8 +-- - src/xz/private.h | 11 +-- - src/xz/signals.c | 2 + - src/xz/signals.h | 17 +++-- - src/xz/suffix.c | 2 +- - src/xzdec/Makefile.am | 13 +++- - src/xzdec/xzdec.c | 55 +++++---------- - 41 files changed, 974 insertions(+), 640 deletions(-) + THANKS | 1 + + configure.ac | 12 +-- + m4/lc_physmem.m4 | 84 --------------- + m4/tuklib_common.m4 | 22 ++++ + m4/{lc_cpucores.m4 => tuklib_cpucores.m4} | 83 ++++++++------ + m4/tuklib_physmem.m4 | 119 +++++++++++++++++++++ + m4/tuklib_progname.m4 | 25 +++++ + src/common/sysdefs.h | 4 - + src/common/tuklib_common.h | 67 ++++++++++++ + src/common/tuklib_config.h | 1 + + src/common/{cpucores.h => tuklib_cpucores.c} | 39 +++---- + src/common/tuklib_cpucores.h | 23 ++++ + src/common/tuklib_exit.c | 57 ++++++++++ + src/common/tuklib_exit.h | 25 +++++ + src/common/tuklib_gettext.h | 44 ++++++++ + src/common/{open_stdxxx.h => tuklib_open_stdxxx.c} | 24 +++-- + src/common/tuklib_open_stdxxx.h | 23 ++++ + src/common/{physmem.h => tuklib_physmem.c} | 58 +++++----- + src/common/tuklib_physmem.h | 28 +++++ + src/common/tuklib_progname.c | 50 +++++++++ + src/common/tuklib_progname.h | 32 ++++++ + src/lzmainfo/Makefile.am | 5 +- + src/lzmainfo/lzmainfo.c | 65 ++++------- + src/xz/Makefile.am | 7 +- + src/xz/args.c | 8 +- + src/xz/file_io.c | 43 ++++---- + src/xz/hardware.c | 8 +- + src/xz/main.c | 100 ++++------------- + src/xz/main.h | 7 -- + src/xz/message.c | 30 +++--- + src/xz/message.h | 8 +- + src/xz/private.h | 11 +- + src/xz/signals.c | 2 + + src/xz/signals.h | 17 ++- + src/xz/suffix.c | 2 +- + src/xzdec/Makefile.am | 13 ++- + src/xzdec/xzdec.c | 55 +++------- + 37 files changed, 768 insertions(+), 434 deletions(-) commit 49cfc8d392cf535f8dd10233225b1fc726fec9ef Author: Lasse Collin @@ -8268,11 +8816,11 @@ Date: 2009-08-09 13:22:12 -0500 It can be somewhat confusing that - less < some_file.txt + less < some_file.txt works fine, whereas - xzless < some_file.txt.xz + xzless < some_file.txt.xz does not. Since version 429, ‘less’ allows a filter specified in the LESSOPEN environment variable to preprocess its input even if @@ -8760,18 +9308,13 @@ Date: 2009-06-27 17:28:01 +0300 Moved the Windows resource files outside the windows directory to prepare for building them with Autotools. - src/common/common_w32res.rc | 46 +++++++++++++++++++++++++++++++++++++++++++ - src/liblzma/liblzma_w32res.rc | 5 +++++ - src/xz/xz_w32res.rc | 5 +++++ - src/xzdec/lzmadec_w32res.rc | 5 +++++ - src/xzdec/xzdec_w32res.rc | 5 +++++ - windows/Makefile | 35 +++++++++++++++++--------------- - windows/common.rc | 46 ------------------------------------------- - windows/liblzma.rc | 5 ----- - windows/lzmadec.rc | 5 ----- - windows/xz.rc | 5 ----- - windows/xzdec.rc | 5 ----- - 11 files changed, 85 insertions(+), 82 deletions(-) + windows/common.rc => src/common/common_w32res.rc | 0 + .../liblzma.rc => src/liblzma/liblzma_w32res.rc | 2 +- + windows/xz.rc => src/xz/xz_w32res.rc | 2 +- + windows/lzmadec.rc => src/xzdec/lzmadec_w32res.rc | 2 +- + windows/xzdec.rc => src/xzdec/xzdec_w32res.rc | 2 +- + windows/Makefile | 35 ++++++++++++---------- + 6 files changed, 23 insertions(+), 20 deletions(-) commit 449c634674f35336a4815d398172e447659a135e Author: Lasse Collin @@ -8853,19 +9396,15 @@ Date: 2009-06-26 20:49:54 +0300 to avoid problems on systems with system headers with those names. - dos/Makefile | 4 +- - src/xz/Makefile.am | 8 +- - src/xz/coder.c | 488 ++++++++++++++++++++++++++++++++++++ - src/xz/coder.h | 57 +++++ - src/xz/file_io.c | 716 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - src/xz/file_io.h | 86 +++++++ - src/xz/io.c | 716 ----------------------------------------------------- - src/xz/io.h | 86 ------- - src/xz/private.h | 4 +- - src/xz/process.c | 488 ------------------------------------ - src/xz/process.h | 57 ----- - windows/Makefile | 4 +- - 12 files changed, 1357 insertions(+), 1357 deletions(-) + dos/Makefile | 4 ++-- + src/xz/Makefile.am | 8 ++++---- + src/xz/{process.c => coder.c} | 0 + src/xz/{process.h => coder.h} | 0 + src/xz/{io.c => file_io.c} | 0 + src/xz/{io.h => file_io.h} | 0 + src/xz/private.h | 4 ++-- + windows/Makefile | 4 ++-- + 8 files changed, 10 insertions(+), 10 deletions(-) commit 5e1257466dcb66f1d7a3f71814a5ad885cba43e8 Author: Lasse Collin @@ -9247,9 +9786,8 @@ Date: 2009-05-01 11:20:23 +0300 Renamed the file format specification to xz-file-format.txt which is the filename used on the WWW. - doc/file-format.txt | 1127 ------------------------------------------------ - doc/xz-file-format.txt | 1127 ++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 1127 insertions(+), 1127 deletions(-) + doc/{file-format.txt => xz-file-format.txt} | 0 + 1 file changed, 0 insertions(+), 0 deletions(-) commit 21c6b94373d239d7e86bd480fcd558e30391712f Author: Lasse Collin @@ -9318,20 +9856,14 @@ Date: 2009-04-13 14:49:48 +0300 Quick & dirty update to support xz in diff/grep/more scripts. - src/scripts/Makefile.am | 38 +++++++++------ - src/scripts/lzdiff | 67 -------------------------- - src/scripts/lzdiff.1 | 51 -------------------- - src/scripts/lzgrep | 123 ------------------------------------------------ - src/scripts/lzgrep.1 | 61 ------------------------ - src/scripts/lzmore | 74 ----------------------------- - src/scripts/lzmore.1 | 55 ---------------------- - src/scripts/xzdiff | 67 ++++++++++++++++++++++++++ - src/scripts/xzdiff.1 | 58 +++++++++++++++++++++++ - src/scripts/xzgrep | 123 ++++++++++++++++++++++++++++++++++++++++++++++++ - src/scripts/xzgrep.1 | 77 ++++++++++++++++++++++++++++++ - src/scripts/xzmore | 74 +++++++++++++++++++++++++++++ - src/scripts/xzmore.1 | 66 ++++++++++++++++++++++++++ - 13 files changed, 489 insertions(+), 445 deletions(-) + src/scripts/Makefile.am | 38 +++++++++++++++++++----------- + src/scripts/{lzdiff => xzdiff} | 24 +++++++++---------- + src/scripts/{lzdiff.1 => xzdiff.1} | 29 ++++++++++++++--------- + src/scripts/{lzgrep => xzgrep} | 10 ++++---- + src/scripts/{lzgrep.1 => xzgrep.1} | 48 +++++++++++++++++++++++++------------- + src/scripts/{lzmore => xzmore} | 12 +++++----- + src/scripts/{lzmore.1 => xzmore.1} | 33 +++++++++++++++++--------- + 7 files changed, 119 insertions(+), 75 deletions(-) commit 02ddf09bc3079b3e17297729b9e43f14d407b8fc Author: Lasse Collin @@ -9675,16 +10207,15 @@ Date: 2009-02-17 10:43:00 +0200 pieces to avoid unneeded dependencies making statically linked applications bigger than needed. - dos/Makefile | 6 +- - src/liblzma/common/easy.c | 128 ----------------------------- - src/liblzma/common/easy_buffer_encoder.c | 34 ++++++++ - src/liblzma/common/easy_decoder_memusage.c | 31 +++++++ - src/liblzma/common/easy_encoder.c | 87 ++++++++++++++++++++ - src/liblzma/common/easy_encoder_memusage.c | 31 +++++++ - src/liblzma/common/easy_preset.c | 34 ++++++++ - src/liblzma/common/easy_preset.h | 39 +++++++++ - windows/Makefile | 6 +- - 9 files changed, 266 insertions(+), 130 deletions(-) + dos/Makefile | 6 ++- + src/liblzma/common/easy_buffer_encoder.c | 34 +++++++++++++++++ + src/liblzma/common/easy_decoder_memusage.c | 31 ++++++++++++++++ + src/liblzma/common/{easy.c => easy_encoder.c} | 53 +++------------------------ + src/liblzma/common/easy_encoder_memusage.c | 31 ++++++++++++++++ + src/liblzma/common/easy_preset.c | 34 +++++++++++++++++ + src/liblzma/common/easy_preset.h | 39 ++++++++++++++++++++ + windows/Makefile | 6 ++- + 8 files changed, 185 insertions(+), 49 deletions(-) commit 7494816ab08d82f4d6409788825930c4e43cfd0d Author: Lasse Collin @@ -10657,15 +11188,14 @@ Date: 2008-12-31 16:29:39 +0200 The internal implementation is still using the name "simple". It may need some cleanups, so I look at it later. - src/liblzma/api/Makefile.am | 2 +- - src/liblzma/api/lzma.h | 2 +- - src/liblzma/api/lzma/bcj.h | 94 +++++++++++++++++++++++++++++++++++++ - src/liblzma/api/lzma/simple.h | 94 ------------------------------------- - src/liblzma/simple/simple_coder.c | 2 +- - src/liblzma/simple/simple_decoder.c | 4 +- - src/liblzma/simple/simple_encoder.c | 4 +- - tests/test_filter_flags.c | 8 ++-- - 8 files changed, 105 insertions(+), 105 deletions(-) + src/liblzma/api/Makefile.am | 2 +- + src/liblzma/api/lzma.h | 2 +- + src/liblzma/api/lzma/{simple.h => bcj.h} | 22 +++++++++++----------- + src/liblzma/simple/simple_coder.c | 2 +- + src/liblzma/simple/simple_decoder.c | 4 ++-- + src/liblzma/simple/simple_encoder.c | 4 ++-- + tests/test_filter_flags.c | 8 ++++---- + 7 files changed, 22 insertions(+), 22 deletions(-) commit 7eea8bec3abfed883efba66264a1452a1c04f6b0 Author: Lasse Collin @@ -10719,47 +11249,44 @@ Date: 2008-12-31 00:30:49 +0200 as the more bloated uint32_t array on x86; hopefully it's not bad on other architectures. - configure.ac | 29 ++++++++-- - src/common/mythread.h | 34 ++++++++++++ - src/liblzma/api/Makefile.am | 1 - - src/liblzma/api/lzma.h | 1 - - src/liblzma/api/lzma/init.h | 85 ----------------------------- - src/liblzma/check/Makefile.am | 29 ++++------ - src/liblzma/check/check.c | 10 ++-- - src/liblzma/check/check.h | 25 ++++----- - src/liblzma/check/check_init.c | 37 ------------- - src/liblzma/check/crc32.c | 88 ------------------------------- - src/liblzma/check/crc32_fast.c | 88 +++++++++++++++++++++++++++++++ - src/liblzma/check/crc32_init.c | 55 ------------------- - src/liblzma/check/crc32_small.c | 54 +++++++++++++++++++ - src/liblzma/check/crc32_tablegen.c | 55 ++++++++++++++++--- - src/liblzma/check/crc64.c | 75 -------------------------- - src/liblzma/check/crc64_fast.c | 75 ++++++++++++++++++++++++++ - src/liblzma/check/crc64_small.c | 54 +++++++++++++++++++ - src/liblzma/check/crc64_tablegen.c | 55 ++++++++++++++++--- - src/liblzma/common/Makefile.am | 3 -- - src/liblzma/common/common.h | 1 + - src/liblzma/common/init.c | 39 -------------- - src/liblzma/common/init_decoder.c | 31 ----------- - src/liblzma/common/init_encoder.c | 40 -------------- - src/liblzma/liblzma.pc.in | 12 +++++ - src/liblzma/lz/lz_encoder.c | 6 +++ - src/liblzma/lzma.pc.in | 11 ---- - src/liblzma/rangecoder/Makefile.am | 8 +-- - src/liblzma/rangecoder/price.h | 16 +----- - src/liblzma/rangecoder/price_table.c | 2 +- - src/liblzma/rangecoder/price_table_init.c | 55 ------------------- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jan 20 06:43:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63C74CB92A4; Fri, 20 Jan 2017 06:43:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) (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 E49E0126B; Fri, 20 Jan 2017 06:43:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f65.google.com with SMTP id r126so4324632wmr.3; Thu, 19 Jan 2017 22:43:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=TN6e0m4WW6GIcNbV7B9BtXRrqIG6OKUjGfw4lkUo+TA=; b=fshRbIKg6afmx1RLSi3cvbuVIbr+FMwHZozEPMM7AmICEECwwYscHQOhpfilUvh50F v6QAxm0nMiLS6KXIKvnmWe69Xjcx3aOBrtVAuHDZ1C/UTU2X2CrI4vZpDD8usp68mxld EbEs916Auc/MMZQIb3Q0NPFgwfifQUGCweXQHf4LbuZ/YtX8QXur8NDnA4ret0F49WGM cXNcshUPEgE/9K4FX1LoAZkGf7aFPZZcWyi2xzbS+6fXKHT/C93jMWnZ3yr1eS/miE0T 9lVuyb3FL6ppzEd+bq31Wbbs5scYUjjdW7l/0EYbVvLbNuWABam4VUlOVMMq6kTjKZoa V42Q== X-Gm-Message-State: AIkVDXIcwKLJC0vsVCh4faE/e8/FMob4/rrMz/feRh/uvA2YrO9jksa0sELfCgfYaT5sVw== X-Received: by 10.28.34.194 with SMTP id i185mr1905677wmi.118.1484894217655; Thu, 19 Jan 2017 22:36:57 -0800 (PST) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com. [74.125.82.52]) by smtp.gmail.com with ESMTPSA id 191sm3765749wmo.21.2017.01.19.22.36.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jan 2017 22:36:57 -0800 (PST) Received: by mail-wm0-f52.google.com with SMTP id c206so28643674wme.0; Thu, 19 Jan 2017 22:36:57 -0800 (PST) X-Received: by 10.28.100.70 with SMTP id y67mr1840509wmb.45.1484894217406; Thu, 19 Jan 2017 22:36:57 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.194.29.72 with HTTP; Thu, 19 Jan 2017 22:36:56 -0800 (PST) In-Reply-To: References: <201701190801.v0J81ZG9008267@repo.freebsd.org> From: Conrad Meyer Date: Thu, 19 Jan 2017 22:36:56 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r312404 - head/usr.bin/sed To: Antoine Brodin Cc: 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: Fri, 20 Jan 2017 06:43:27 -0000 On Thu, Jan 19, 2017 at 10:29 PM, Antoine Brodin wrot= e: > On Thu, Jan 19, 2017 at 9:01 AM, Xin LI wrote: >> Author: delphij >> Date: Thu Jan 19 08:01:35 2017 >> New Revision: 312404 >> URL: https://svnweb.freebsd.org/changeset/base/312404 >> >> Log: >> Use S_ISREG instead of manual & (also it's better to compare the >> result from & and the pattern instead of just assuming it's one bit >> value). >> >> Pointed out by Tianjie Mao . >> >> MFC after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D4827 > > Hi, > > sed -i no longer works on symlinks which breaks lots of ports. > Please revert and request an exp-run. That is clearly the intent of the code in question. It was a bug that it worked before =E2=80=94 S_IFLNK and S_IFSOCK just happen to have the S_IFREG bit set. It seems like either such ports should be fixed to dereference the link manually, or the check should be removed entirely. Best, Conrad From owner-svn-src-all@freebsd.org Fri Jan 20 06:45:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CB39CB930F; Fri, 20 Jan 2017 06:45:07 +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 2B1BE13E5; Fri, 20 Jan 2017 06:45:07 +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 v0K6j6fG078907; Fri, 20 Jan 2017 06:45:06 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K6j6EK078906; Fri, 20 Jan 2017 06:45:06 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201701200645.v0K6j6EK078906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 20 Jan 2017 06:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312519 - head/usr.bin/sed 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, 20 Jan 2017 06:45:07 -0000 Author: delphij Date: Fri Jan 20 06:45:06 2017 New Revision: 312519 URL: https://svnweb.freebsd.org/changeset/base/312519 Log: Revert r312404 as we need to do an exp-run and fix existing ports that rely on the previous behavior. Requested by: antonie (portmgr) Modified: head/usr.bin/sed/main.c Modified: head/usr.bin/sed/main.c ============================================================================== --- head/usr.bin/sed/main.c Fri Jan 20 06:40:12 2017 (r312518) +++ head/usr.bin/sed/main.c Fri Jan 20 06:45:06 2017 (r312519) @@ -391,7 +391,7 @@ mf_fgets(SPACE *sp, enum e_spflag spflag if (inplace != NULL) { if (lstat(fname, &sb) != 0) err(1, "%s", fname); - if (!S_ISREG(sb.st_mode)) + if (!(sb.st_mode & S_IFREG)) errx(1, "%s: %s %s", fname, "in-place editing only", "works for regular files"); From owner-svn-src-all@freebsd.org Fri Jan 20 06:47:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 591BCCB9376; Fri, 20 Jan 2017 06:47:03 +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 27A0715F1; Fri, 20 Jan 2017 06:47:03 +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 v0K6l2k8079037; Fri, 20 Jan 2017 06:47:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K6l2Sj079036; Fri, 20 Jan 2017 06:47:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200647.v0K6l2Sj079036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 06:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312520 - head/usr.bin/sed/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: Fri, 20 Jan 2017 06:47:03 -0000 Author: ngie Date: Fri Jan 20 06:47:02 2017 New Revision: 312520 URL: https://svnweb.freebsd.org/changeset/base/312520 Log: Integrate contrib/netbsd-tests/usr.bin/sed/t_sed.sh into the FreeBSD test suite as usr.bin/sed/sed_test Don't expect :emptybackref to fail -- it succeeds on FreeBSD MFC after: 3 weeks Sponsored by: Dell EMC Isilon Modified: head/usr.bin/sed/tests/Makefile Modified: head/usr.bin/sed/tests/Makefile ============================================================================== --- head/usr.bin/sed/tests/Makefile Fri Jan 20 06:45:06 2017 (r312519) +++ head/usr.bin/sed/tests/Makefile Fri Jan 20 06:47:02 2017 (r312520) @@ -2,11 +2,15 @@ PACKAGE= tests +NETBSD_ATF_TESTS_SH+= sed_test TAP_TESTS_SH= legacy_test TAP_TESTS_SH+= multi_test TEST_METADATA.multi_test+= required_files="/usr/share/dict/words" TAP_TESTS_SH+= inplace_race_test +ATF_TESTS_SH_SED_sed_test+= -e 's,atf_expect_fail "PR bin/28126",,g' +${PACKAGE}FILES+= d_c2048.in + ${PACKAGE}FILES+= hanoi.sed ${PACKAGE}FILES+= math.sed ${PACKAGE}FILES+= regress.G.out @@ -35,4 +39,5 @@ ${PACKAGE}FILES+= regress.y.out SUBDIR= regress.multitest.out +.include .include From owner-svn-src-all@freebsd.org Fri Jan 20 06:59:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28B91CB95DF; Fri, 20 Jan 2017 06:59:57 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 DV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2A001BF6; Fri, 20 Jan 2017 06:59:56 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MBP.ut.rhv.delphij.net (unknown [IPv6:2601:646:8882:752a:389e:e35e:c4a4:70e1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 7861B2B95A; Thu, 19 Jan 2017 22:59:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1484895596; x=1484909996; bh=lqhSIIk6VI7QoHintmU6A2TpILACLjVHTD3ZQCZqw54=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=p/GuRXOsXHFpkttfY7xmFZji4MhSivm4ezAkbzKjLf6HJDuPaq6IAmj5X1cbNIpGz 4xGqD17ZFm8COgnUzZ9WToDWGuu8sMCVeX5xO6RICi/k/IOlMbsC2z4EUWM2ZhZ9f+ M2b0UAD05pnLB9v4pjK0VgaYDaG+L41newks/2PE= Subject: Re: svn commit: r312404 - head/usr.bin/sed To: cem@freebsd.org, Antoine Brodin References: <201701190801.v0J81ZG9008267@repo.freebsd.org> Cc: d@delphij.net, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Xin Li Message-ID: <2e5e7d42-9faa-957f-1a63-a10b91459985@delphij.net> Date: Thu, 19 Jan 2017 22:59:52 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="kSSRRilRWIw4ULATlBnMJ0m0iebqwGdgC" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2017 06:59:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kSSRRilRWIw4ULATlBnMJ0m0iebqwGdgC Content-Type: multipart/mixed; boundary="SuRItJcO1rFLU3g36HqQDilesvQueKFIa"; protected-headers="v1" From: Xin Li To: cem@freebsd.org, Antoine Brodin Cc: d@delphij.net, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <2e5e7d42-9faa-957f-1a63-a10b91459985@delphij.net> Subject: Re: svn commit: r312404 - head/usr.bin/sed References: <201701190801.v0J81ZG9008267@repo.freebsd.org> In-Reply-To: --SuRItJcO1rFLU3g36HqQDilesvQueKFIa Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 1/19/17 22:36, Conrad Meyer wrote: > On Thu, Jan 19, 2017 at 10:29 PM, Antoine Brodin = wrote: >> On Thu, Jan 19, 2017 at 9:01 AM, Xin LI wrote: >>> Author: delphij >>> Date: Thu Jan 19 08:01:35 2017 >>> New Revision: 312404 >>> URL: https://svnweb.freebsd.org/changeset/base/312404 >>> >>> Log: >>> Use S_ISREG instead of manual & (also it's better to compare the >>> result from & and the pattern instead of just assuming it's one bit= >>> value). >>> >>> Pointed out by Tianjie Mao . >>> >>> MFC after: 2 weeks >>> Differential Revision: https://reviews.freebsd.org/D4827 >> >> Hi, >> >> sed -i no longer works on symlinks which breaks lots of ports. >> Please revert and request an exp-run. >=20 > That is clearly the intent of the code in question. It was a bug that > it worked before =E2=80=94 S_IFLNK and S_IFSOCK just happen to have the= > S_IFREG bit set. It seems like either such ports should be fixed to > dereference the link manually, or the check should be removed > entirely. There are other issues with previous behavior, for instance, the file would inherit permissions from the symlink itself, while a more sensible behavior would be to use the permissions on the symlink target. But I think it's reasonable to revert for now and do a exp-run so we know what would be broken. Personally I have been running with this for a year and that made me thought it's safe :) Cheers, --SuRItJcO1rFLU3g36HqQDilesvQueKFIa-- --kSSRRilRWIw4ULATlBnMJ0m0iebqwGdgC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJYgbVrAAoJEJW2GBstM+ns1wcP/05NpskWm7rBiOOdvcEctDCF OGTyzt7N6YyAP5lka78MmpVOxAs+u1roAgRO64tre7QSFr7JcWSTkgDTiO+BmIew EF89DKO/NCOAoPmXX/LONZd3X8h4zbMPLx4M4MgxTBwwuMQlXRe104NXcuX+7wWf OSwE5EF/jwgO7iPjtaUZz5rNxqa8VYysLZdqhZJKPpW2qZyI1O4BXMi1hs5lK2ZG 7BtxN6n3qbmGY4Nnlh4r6EKPne1bBZg0/GPfjR1AaYGsszXYAPBYtc3wfcX+ODvj 2Zo5i0bmAWZKMYlS9vzROIQw6kmVBXVccvMbIn5eWblPDx48HhT7hLw7jkALySIR swjYq+1WVOlgdk64nDCFQr0PHFPeX8CU6V3b+nHj+XTlQvp/IVu2VkOvd9UVf1/d E27MI3XyxIZ4Iv7P54vOQ+oxa5KbsAV7nun7p9R1kTGKytJtnabKKpSCLLFswnPZ Gz8RHk1puA+2z4Ydc+uQWMDGpX+WDn6UH6MVqsAmA3V8ZtcNj+T+UsO0qjtoRKUy DpZW87nPMlSyykY0f9ZGGPCmpOjJURfsJApVP+0QOHgAhCh4OVIalIGOoQ8itKgG Iytf5l5z2KFb6ThQmfqelsFLFKhOeTc9EG1h9Tu7ICmET7WJ4BmBWwiiZA42z4OH PUMLXry6+fFEvkTg2R+P =oPGP -----END PGP SIGNATURE----- --kSSRRilRWIw4ULATlBnMJ0m0iebqwGdgC-- From owner-svn-src-all@freebsd.org Fri Jan 20 07:00:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83CF3CB9661; Fri, 20 Jan 2017 07:00:25 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 DV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 668B71D71; Fri, 20 Jan 2017 07:00:25 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MBP.ut.rhv.delphij.net (unknown [IPv6:2601:646:8882:752a:389e:e35e:c4a4:70e1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 1BAEA2B96F; Thu, 19 Jan 2017 23:00:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1484895625; x=1484910025; bh=1RHS7DyETlhMmgNXz6mHk2FZ7muuwMIqvPjO0HOzrHk=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=4QaKLDrLr3ImMJSz8d5XUEl1udu2xnYKBk5mmgB3SBymHbS3FC33+7tghsjq3hQ0D AQEZAmLF18JSYvVcsFtsCOe3C87R2P2nwuCsNzftVZe4BqdLvNQZmGylQQy1jC4RE4 JD8+EepjPxbfAsBfIsOA0ldkw6WQZzqcA8mQHDiU= Subject: Re: svn commit: r312404 - head/usr.bin/sed To: Antoine Brodin , Xin LI References: <201701190801.v0J81ZG9008267@repo.freebsd.org> Cc: d@delphij.net, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Xin Li Message-ID: <9ef03812-a23a-8cd0-d8a1-1568c468e882@delphij.net> Date: Thu, 19 Jan 2017 23:00:24 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SENJsW1H2Ed9QTL5T1dRhBvn3lc1L4fWC" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2017 07:00:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SENJsW1H2Ed9QTL5T1dRhBvn3lc1L4fWC Content-Type: multipart/mixed; boundary="d44b1ivlC1HxeatqxGkS12JbgLghNw6LD"; protected-headers="v1" From: Xin Li To: Antoine Brodin , Xin LI Cc: d@delphij.net, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <9ef03812-a23a-8cd0-d8a1-1568c468e882@delphij.net> Subject: Re: svn commit: r312404 - head/usr.bin/sed References: <201701190801.v0J81ZG9008267@repo.freebsd.org> In-Reply-To: --d44b1ivlC1HxeatqxGkS12JbgLghNw6LD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 1/19/17 22:29, Antoine Brodin wrote: > On Thu, Jan 19, 2017 at 9:01 AM, Xin LI wrote: >> Author: delphij >> Date: Thu Jan 19 08:01:35 2017 >> New Revision: 312404 >> URL: https://svnweb.freebsd.org/changeset/base/312404 >> >> Log: >> Use S_ISREG instead of manual & (also it's better to compare the >> result from & and the pattern instead of just assuming it's one bit >> value). >> >> Pointed out by Tianjie Mao . >> >> MFC after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D4827 >=20 > Hi, >=20 > sed -i no longer works on symlinks which breaks lots of ports. > Please revert and request an exp-run. Done. Requested as bug 216309. Cheers, --d44b1ivlC1HxeatqxGkS12JbgLghNw6LD-- --SENJsW1H2Ed9QTL5T1dRhBvn3lc1L4fWC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJYgbWIAAoJEJW2GBstM+nsil8P/2thGy73XAVRt6DFZmMMmCMy 5nRtCP9bqdBdEqVw6Xfu5/lyymhaH7oGgXiTQ8hGRKOGIvs0tGjTCr1MX23O8xkC Rp+M3JJVXNU82vidTgWeq6udiGOJ4VDTcRxvKna11LwakqDqgAVcUn3R+U7X+m/s hg2NXkEzyRWkB8qEgdTBGbW/YmHF8MFxKXuv/iV+TxlnyRFqI/JLHvSlS9MTGDri SczzIVZmkcO8vqWgPOxHB8AxYsUQu/g00BbIe7abvebYguDnnt6EUNnQJGVV9OVl jP1i8m4Yh09KxzFaJdEZL8Ld6AatBe2Gl3zRWByEKAlzFTnj0ELTD6z/gU7rmzry R38WBplt3GCHvNgjuUhZ9uiI+v7kkgchJHSHJbm9GCgpKovzm/1j41TSzHhC9p3w LXeIzIyyC0hIRJd/ThwVioIpxI44c0ZyW3xfy2x/oiMU89CZbK9272fr7rrrfFmK C4RMMu+xzNZHYgYz1UCAlmec4UOeq3IWl4/eRLabcaeKqbRbN6DaExxPLafaRxzw UNZQWxK4kigX5tNe1xzDDhHnmthFjj9AFCFtyRbJ7Yj4MB1eQurffam64yK9jJau woyBXn+CuH55ldf5o8fmOEvO0uGsWMv+TW/em9ctDD9sYIDM8pL2SlxQ+oX7v4y/ S0iYm/1+QtaJlfaXT5Mm =dTzG -----END PGP SIGNATURE----- --SENJsW1H2Ed9QTL5T1dRhBvn3lc1L4fWC-- From owner-svn-src-all@freebsd.org Fri Jan 20 07:11:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05513CB9851; Fri, 20 Jan 2017 07:11:23 +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 B228513A0; Fri, 20 Jan 2017 07:11:22 +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 v0K7BLXX090340; Fri, 20 Jan 2017 07:11:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K7BLEA090338; Fri, 20 Jan 2017 07:11:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200711.v0K7BLEA090338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 07:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312521 - head/usr.bin/sed/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: Fri, 20 Jan 2017 07:11:23 -0000 Author: ngie Date: Fri Jan 20 07:11:21 2017 New Revision: 312521 URL: https://svnweb.freebsd.org/changeset/base/312521 Log: Add testcases for -i with hardlinks and symlinks The symlink testcase is expected to fail, post-r312519 (the revert of r312404); mark it so. MFC after: 3 weeks Sponsored by: Dell EMC Isilon Added: head/usr.bin/sed/tests/sed2_test.sh (contents, props changed) Modified: head/usr.bin/sed/tests/Makefile Modified: head/usr.bin/sed/tests/Makefile ============================================================================== --- head/usr.bin/sed/tests/Makefile Fri Jan 20 06:47:02 2017 (r312520) +++ head/usr.bin/sed/tests/Makefile Fri Jan 20 07:11:21 2017 (r312521) @@ -2,6 +2,7 @@ PACKAGE= tests +ATF_TESTS_SH+= sed2_test NETBSD_ATF_TESTS_SH+= sed_test TAP_TESTS_SH= legacy_test TAP_TESTS_SH+= multi_test Added: head/usr.bin/sed/tests/sed2_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sed/tests/sed2_test.sh Fri Jan 20 07:11:21 2017 (r312521) @@ -0,0 +1,61 @@ +# +# Copyright 2017 Dell EMC. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * 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$ +# + +atf_test_case inplace_hardlink_src +inplace_hardlink_src_head() +{ + atf_set "descr" "Verify -i works with a symlinked source file" +} +inplace_hardlink_src_body() +{ + echo foo > a + atf_check ln a b + atf_check sed -i '' -e 's,foo,bar,g' b + atf_check -o 'inline:bar\n' -s exit:0 cat b +} + +atf_test_case inplace_symlink_src +inplace_symlink_src_head() +{ + atf_set "descr" "Verify -i works with a symlinked source file" +} +inplace_symlink_src_body() +{ + atf_expect_fail "Check for S_IFREG reverted in r312404" + + echo foo > a + atf_check ln -s a b + atf_check -e not-empty -s not-exit:0 sed -i '' -e 's,foo,bar,g' b +} + +atf_init_test_cases() +{ + atf_add_test_case inplace_hardlink_src + atf_add_test_case inplace_symlink_src +} From owner-svn-src-all@freebsd.org Fri Jan 20 07:14:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47914CB99EE; Fri, 20 Jan 2017 07:14:02 +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 13D731687; Fri, 20 Jan 2017 07:14:02 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id e4so4905033pfg.0; Thu, 19 Jan 2017 23:14:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Lr/52di4IRonJgEsx2nyqBywviGuhNDaQo+K3JxXZrk=; b=Mhty7x8f3aOKT1i/edKRS7vPbDvJQxC2nVpNssZ5DBRKDfIHLpWScLgs/CgmI8x5aH sg2/4Y0svbHr8sji+T5yDzRNp/JcTEyN1muMaYQpRL6vzlMsAGQIiM7KZ2o6OoJ5waFq eRpzyDMTShwsMVxNsGCgCsccD4Pp1otitWOT+L81rnm4bRKS2T8xxozkljF2EzZrWy8v uYzz8gdMySojSpkgEDCQ1ftdiqKujR2Y1hc3m7+oMNRowui9gQ6ed78hdhw4s8Ti5EHS o44o9fOhlW7+g8OB1OpVKEvx8Llo80HTDkgr8Y2GIA1ZgplUlUXyu5qFk/BW6BywohEf Ky8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Lr/52di4IRonJgEsx2nyqBywviGuhNDaQo+K3JxXZrk=; b=Wm3CUIFDkY0m69lXFrro+Hi0T9J5TW6N6csRF9mpoxEHYcgTnzFCuPeUsu9Y2ioXpk wOjmAKLHy5iDFQZdiaRwA9VC/bqzuOBYTLwrVw0humipGglrpFEKdjoAx+6boLm9/Hoy YQCRenbcm/EgIrQIb7p4yIo2JSdOr8kLBbpHhvLpgjQUcZ3nMn5O5rxu9Z/MIp0tN8nf bWzgf9/sRbIUE/yWdmMf7d3m0CpVr3EYZe5QFqa78u7in9DphNVAjvyVkvv/XK/8HkGe nxQHgLIidT0JExcNkPle09KiqD9YjsjsX4+yMXDwEvDLNxX3+FYzA4Z13dXn2zPZqyDw ub/g== X-Gm-Message-State: AIkVDXJvE67H/MxWOUwkIl9ZiGAsTWlgsglT1DBsbUdsaWt+dk09dujMyKa3dcdH7fjxgQ== X-Received: by 10.99.98.132 with SMTP id w126mr15268842pgb.59.1484896441524; Thu, 19 Jan 2017 23:14:01 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 143sm13739935pfu.58.2017.01.19.23.14.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Jan 2017 23:14:00 -0800 (PST) Subject: Re: svn commit: r312519 - head/usr.bin/sed Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_E8CA5559-A9A4-4CA8-8553-7343DC0A5F77"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701200645.v0K6j6EK078906@repo.freebsd.org> Date: Thu, 19 Jan 2017 23:13:59 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <35562B6D-E733-4CC8-97C0-81CC8EAC87A7@gmail.com> References: <201701200645.v0K6j6EK078906@repo.freebsd.org> To: Xin LI 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: Fri, 20 Jan 2017 07:14:02 -0000 --Apple-Mail=_E8CA5559-A9A4-4CA8-8553-7343DC0A5F77 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Jan 19, 2017, at 22:45, Xin LI wrote: >=20 > Author: delphij > Date: Fri Jan 20 06:45:06 2017 > New Revision: 312519 > URL: https://svnweb.freebsd.org/changeset/base/312519 >=20 > Log: > Revert r312404 as we need to do an exp-run and fix existing ports = that > rely on the previous behavior. >=20 > Requested by: antonie (portmgr) I added 2 testcases to help check for this behavior later in = r312521. All that needs to be done is remove this line: = https://svnweb.freebsd.org/base/head/usr.bin/sed/tests/sed2_test.sh?view=3D= markup&pathrev=3D312521#l50 . Cheers! -Ngie --Apple-Mail=_E8CA5559-A9A4-4CA8-8553-7343DC0A5F77 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 iQIcBAEBCgAGBQJYgbi3AAoJEPWDqSZpMIYVMxoQAJj0d5Kx6O+2KIZX0Xmc3jjw grOMCjB36oX2Jyi4DkogwtP3iRs3iqKbtL1H6pwTF1qjC1izOW1dCjAfR5R606tP dnJdnvUi3HMY5lOOTNB734Vxba1D0DFORA/KUOXLgYAe4d1GLB2GHj4WdxUPMEaX Z0R9jVefJGzp9NF8p4jfTGl41TAHwq2NtpJ9MnFOGFdc6PKixigtLVCTJOH96sbo oWBa4ZQ8JawNHfc3VKaLZPo6mZMi6WifkclRB3hRz2bG9g6wxnqZGTKV30Pj96gD iUm9WVLTSwFISjDbCxJBrx6Fz7osw7xr/HK39siVK0kI2xG8t7WdG36hfp8byum0 8Dd5QLMkp8NefM5QPTre3SGnbmIZMMMudgxifvwE0PaazWT2Iyrx5HKPljd+cXUR 8Q4kk5T80p/wXdzf7BqGOADshS8sJPsERHzaDABAqbyr4d+wCm0yoUqkalpSyk4O tBs3i0Fw/WJIQrNadlMoLDaEJ+LhvZNmv18pR+KEw9QOy3I+KenXAw1tAQh6EZ42 gdrvKzQvM4FxZN05iKdIkfhog3OuqMSz6AnADhaJwI4+cSlrqxe0wRch70ZXZ07/ oToKfVMMnS7+tg3DRJ2oQ7VPjfmW36weDDOXzRuBml6wZWAanhAVzJMOPHC+oarS +IloztkczeG0seZVKtGo =ur1K -----END PGP SIGNATURE----- --Apple-Mail=_E8CA5559-A9A4-4CA8-8553-7343DC0A5F77-- From owner-svn-src-all@freebsd.org Fri Jan 20 07:16:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D369ECB9A99; Fri, 20 Jan 2017 07:16:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 9BCB1191F; Fri, 20 Jan 2017 07:16:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id A8102D6945B; Fri, 20 Jan 2017 18:15:59 +1100 (AEDT) Date: Fri, 20 Jan 2017 18:15:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Antoine Brodin cc: Xin LI , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312404 - head/usr.bin/sed In-Reply-To: Message-ID: <20170120174258.X1938@besplex.bde.org> References: <201701190801.v0J81ZG9008267@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=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=7glOachtraqBiMcJk8MA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2017 07:16:07 -0000 On Fri, 20 Jan 2017, Antoine Brodin wrote: > On Thu, Jan 19, 2017 at 9:01 AM, Xin LI wrote: >> Author: delphij >> Date: Thu Jan 19 08:01:35 2017 >> New Revision: 312404 >> URL: https://svnweb.freebsd.org/changeset/base/312404 >> >> Log: >> Use S_ISREG instead of manual & (also it's better to compare the >> result from & and the pattern instead of just assuming it's one bit >> value). >> >> Pointed out by Tianjie Mao . >> >> MFC after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D4827 > > Hi, > > sed -i no longer works on symlinks which breaks lots of ports. > Please revert and request an exp-run. sed() doesn't seem to actually understand symlinks (it has no flag like -h to prevent following them when opening files), so its use of lstat() to classify them is wrong. This was harmless for symlinks but not for other irregular file types pointed to by symlinks. The buggy S_IFREG test accidentally classified symlinks, sockets and whiteouts as regular, but failed classify the file type of the target of symlinks that will actually be used. The fixed test limits sed to "regular" files (including highly irregular ones in /proc). It is a bug for sed to have any restrictions on file types. This breaks device indepedence. Even /dev/std* was supposed to not work, but worked accidentally since these files happen to be implemented as symlinks. Their targets /dev/fd/[0-2] didn't work accidentally, but it was possible to trick sed into working on them by pointing to them using symlinks. Similarly for all file types. POSIX only requires sed to work on text files. I couldn't find anywhere where it clearly defines what a text file is or any restriction to regular files. It requires sed to work on stdin which is often a pipe, so it must not restrict on the file type found by fstat(). So a text file should defined as "a file of any type containing text". Utilities shouldn't be restricted to text either, but that is a larger bug. It is now difficult to even define text. Non-ASCII encodings of text look like binary to me. Bruce From owner-svn-src-all@freebsd.org Fri Jan 20 07:27:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9217CCB9C78; Fri, 20 Jan 2017 07:27:40 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 DV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74A201E36; Fri, 20 Jan 2017 07:27:40 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MBP.ut.rhv.delphij.net (unknown [IPv6:2601:646:8882:752a:389e:e35e:c4a4:70e1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 480712BADC; Thu, 19 Jan 2017 23:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1484897254; x=1484911654; bh=ICddl4mGoxkwJmXj81XFhUpGFEP4VPbx1abC9t1oVxg=; h=Subject:To:References:Cc:From:Date:In-Reply-To; b=VSndp14cjjGnzr6G5JSRnJRdz8852hE9GG09+12iQEuLU9lgEFkkczACqGGJZNoVr WrghOPaJxIQH62Pm/JHx89icCXlqFzRIFFvVXUPyju7Ds2cX//l+4egoth2RrXdC39 w320B/KrkxjZU9AhmjuxAtp2Q2KMe1BrfzXHFJkA= Subject: Re: svn commit: r312519 - head/usr.bin/sed To: "Ngie Cooper (yaneurabeya)" , Xin LI References: <201701200645.v0K6j6EK078906@repo.freebsd.org> <35562B6D-E733-4CC8-97C0-81CC8EAC87A7@gmail.com> Cc: d@delphij.net, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Xin Li Message-ID: <0cf8edf5-ec3d-e6f1-9d55-1e286014d8f1@delphij.net> Date: Thu, 19 Jan 2017 23:27:31 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <35562B6D-E733-4CC8-97C0-81CC8EAC87A7@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KlL93I8QRuC1rb6IFxocOOGpMtwIwBfc1" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 20 Jan 2017 07:27:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KlL93I8QRuC1rb6IFxocOOGpMtwIwBfc1 Content-Type: multipart/mixed; boundary="mg3jPN5L3CIPvlsgSWmagSKphlLLGFW29"; protected-headers="v1" From: Xin Li To: "Ngie Cooper (yaneurabeya)" , Xin LI Cc: d@delphij.net, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <0cf8edf5-ec3d-e6f1-9d55-1e286014d8f1@delphij.net> Subject: Re: svn commit: r312519 - head/usr.bin/sed References: <201701200645.v0K6j6EK078906@repo.freebsd.org> <35562B6D-E733-4CC8-97C0-81CC8EAC87A7@gmail.com> In-Reply-To: <35562B6D-E733-4CC8-97C0-81CC8EAC87A7@gmail.com> --mg3jPN5L3CIPvlsgSWmagSKphlLLGFW29 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 1/19/17 23:13, Ngie Cooper (yaneurabeya) wrote: >=20 >> On Jan 19, 2017, at 22:45, Xin LI wrote: >> >> Author: delphij >> Date: Fri Jan 20 06:45:06 2017 >> New Revision: 312519 >> URL: https://svnweb.freebsd.org/changeset/base/312519 >> >> Log: >> Revert r312404 as we need to do an exp-run and fix existing ports tha= t >> rely on the previous behavior. >> >> Requested by: antonie (portmgr) >=20 > I added 2 testcases to help check for this behavior later in r312521. = All that needs to be done is remove this line: https://svnweb.freebsd.org= /base/head/usr.bin/sed/tests/sed2_test.sh?view=3Dmarkup&pathrev=3D312521#= l50 . Hmm to be honest I believe the old behavior is wrong and the intent is to reinstate the revision after we have fixed the ports. Cheers, --mg3jPN5L3CIPvlsgSWmagSKphlLLGFW29-- --KlL93I8QRuC1rb6IFxocOOGpMtwIwBfc1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJYgbvlAAoJEJW2GBstM+ns7yMP/3iOFYi/qi6W3njCu+s/Qnug 4dWOnkYPH7c3Y/YbQ2pQBocOSrQGvFN3MuX7nC2WNH8zkWbjthdh6C+T5tPKtUZ5 7KMXxispj9Uc6wHsPmD5KJIy3UGHeq8EMtVILuHcP4kLbSQ0vgAAU5HHL1AqlQCi zURtAhrn28ZtJHvJ9yOZMT3jENSbtVX51QyvIaTL2uBfyAf7MNcb/W0mCGG3XgF7 xcSFBFYf3AT7VqGpkslEAp+HpA/lr79EbGGbhsjfRqRkYR+PrQ2Y91HJJtcUzSfP EGoRpaPdeF0FJI/kGYTfRZUYqqLzmBNEyeKkugwMW0OACfUTRil2wYLcU8CQpFiI NKaptBHoLGeXCwD4/YZ1xtnn8AUKuniK0WUQoCbvn2SGm5a3B9bV/RRzZnN8kbii 0uog5biKjqC6ISrHbeAjQ7xKd/n08MkeBuEgYigLpaz+Ds8fXzhxTFYOlWFByhmQ g0QbN3ewAARXfAMu0R3vZwcFokFtQroE0iWTVPSBeihj80AnPFIPpXaweIZgAB6m KAGLvCLwW+yFoxS2EI0MLflVUEqh0GecXSLYIHTyEshEaj5hlUn/NIOJUl1KLAMI kuTHtZl0czRsx9q8w8hnEcbReRm5HuGMzTzl2iyeZjz/WjQmXSaVQydHrKcCP6El 5beaSBGaKs5OIacnGUXe =JcHQ -----END PGP SIGNATURE----- --KlL93I8QRuC1rb6IFxocOOGpMtwIwBfc1-- From owner-svn-src-all@freebsd.org Fri Jan 20 07:31:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF1D0CB9E84; Fri, 20 Jan 2017 07:31:58 +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 BB2451223; Fri, 20 Jan 2017 07:31:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id 204so6251445pge.2; Thu, 19 Jan 2017 23:31:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=pYg5XZ7sCEsedq86QtT2uC4eB12YaqXz++6rjBsy9Rc=; b=GcU0lqlM1BRVCmfbWAweS7GlII2vwfZuvJb/nZ/vMWV9KiMzaapNMOfNafEHEKPduj mJu3BI1t7T1CfgNy5Cfdc1E8f7TY1nIVvbNBFauqt5Eou2wAOWVeWDqHAvl50kliaGxl Vu1i+7Nhj8zWObSwsbtt28h40I+et3EXLx0wvTj/W92XB/SQ0LYM8BZrapUqsyiyA1jq k5XlWSK3YEmz++AHH2deqoVCgufS/MP2l6o50Hw5OyQvnmnm0tI0xcCanW7VmdsDVZuT b7+xCbiLE4wjmMe0IIX37RxXTqEfj523jxzbolWF4mrbjffIeuNJ2hePU31drLOf7mie /3EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=pYg5XZ7sCEsedq86QtT2uC4eB12YaqXz++6rjBsy9Rc=; b=AXUz1lZbbdJXY0JgeX2FNOMRXB/Pgv3IVkIcs+ecZa7GUCu6F7zHHCvNojS7wyqXJF wTQiYCLla2FtPpDkqaBeM19u/Q/LaoZSFbHjjgzbcthSamFcA9syEaszBlpAIu6pJ9ls nSANHQTzCL03mcv10dLQx+BL3oXZLF1DAORfIuDhcNj/w5bHraRowK0G+ztdXYvoom6H pj3C0uySz6j4aZPjSe6vWrjO9JvD942dui0LgBTDHLe82yk2fa0E/HCo9HTsjwagUbJ/ yqLbDYIE5Fhp4lIocN/OomFXrdFugfVvmQ9H39MTO0jcXLOYHWJ3YcxDqlELyb0JNpx8 LSow== X-Gm-Message-State: AIkVDXItg+pgWdzQhb2Yw41bK+Et/hkSvso92hOSlt5YguJSuVXQedwCoUMh9o3l2H5xuQ== X-Received: by 10.99.174.75 with SMTP id e11mr15153970pgp.89.1484897518321; Thu, 19 Jan 2017 23:31:58 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 66sm13964461pfx.29.2017.01.19.23.31.57 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Jan 2017 23:31:57 -0800 (PST) Subject: Re: svn commit: r312519 - head/usr.bin/sed Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_DDC87A2F-A6C1-49F1-B803-C1B5CCBB4516"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <0cf8edf5-ec3d-e6f1-9d55-1e286014d8f1@delphij.net> Date: Thu, 19 Jan 2017 23:31:56 -0800 Cc: Xin LI , d@delphij.net, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201701200645.v0K6j6EK078906@repo.freebsd.org> <35562B6D-E733-4CC8-97C0-81CC8EAC87A7@gmail.com> <0cf8edf5-ec3d-e6f1-9d55-1e286014d8f1@delphij.net> To: Xin Li 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: Fri, 20 Jan 2017 07:31:59 -0000 --Apple-Mail=_DDC87A2F-A6C1-49F1-B803-C1B5CCBB4516 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 > On Jan 19, 2017, at 23:27, Xin Li wrote: >=20 >=20 >=20 > On 1/19/17 23:13, Ngie Cooper (yaneurabeya) wrote: >>=20 >>> On Jan 19, 2017, at 22:45, Xin LI wrote: >>>=20 >>> Author: delphij >>> Date: Fri Jan 20 06:45:06 2017 >>> New Revision: 312519 >>> URL: https://svnweb.freebsd.org/changeset/base/312519 >>>=20 >>> Log: >>> Revert r312404 as we need to do an exp-run and fix existing ports = that >>> rely on the previous behavior. >>>=20 >>> Requested by: antonie (portmgr) >>=20 >> I added 2 testcases to help check for this behavior later in = r312521. All that needs to be done is remove this line: = https://svnweb.freebsd.org/base/head/usr.bin/sed/tests/sed2_test.sh?view=3D= markup&pathrev=3D312521#l50 . >=20 > Hmm to be honest I believe the old behavior is wrong and the intent is > to reinstate the revision after we have fixed the ports. I agree =97 once the revision is fixed and committed, it will = verify that sed again fails. If that=92s not correct per the designed fix, we can modify the = testcase further. Thanks :), -Ngie --Apple-Mail=_DDC87A2F-A6C1-49F1-B803-C1B5CCBB4516 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 iQIcBAEBCgAGBQJYgbzsAAoJEPWDqSZpMIYVBGMQALJFA2i5OOMNu9BHWmsepOX3 XWxUl/CwX5e9FdtOJxNMxhxKvOrQ7THGmY3LVeLbza7DlKfzSevlecl8vtFQpop6 N7LjH+J1TW+laQBK7JTAZgTSkkTLDSh09QW0z2De8eajKyOchpPTy6WcA4s/A1JF UsPsOXQh9d+ECeX0DR+EPccJgzrQ19BsnJzIZ/i+EgsrjZYiMZe5KYYPpvNYy746 2HJm5dP5aPJKjtd5PkXWa2vo/F9jlPkAIPax0rhxV39w638AVJvcIgBsnxPckNlr bgd0aifWscW9cTZf8aoQR9Ddvwtfb7fvmZDgTNAVunWh0+aYm/tj49q0Ia+8a9y2 jez6DoX0PU61dk0AbiiLYusqZHK0LWdqWNQzE3SzM3gOLSSdMnOKO2IBoYWJZgwh OBY5aJCUQ+/r22RyZO3A8whCzBk+oFPfExq9SXLlUsrrZPd9kAzKTn5RE7TPDkKb QtxAmX53Tdsb3BeQmK3LuuZ0J8WK5CJs9Utt42fVFqLU3eXQHOAIKWxW4f0as4QD sdGXky9lTmrRdt3ifCgMsSPyLwJQ/5vJ46YwitmcnFCA+Y+8sWJ3sXVhATn/1MQp +x+fEIL4yVI+VE2JcS3vxhzUvwzXmUMn4Wa5VBIWmBtGO4V+UK/6qW4byGoW/Grk sSE7jjJ3mTGLGZUn3d5M =2aK/ -----END PGP SIGNATURE----- --Apple-Mail=_DDC87A2F-A6C1-49F1-B803-C1B5CCBB4516-- From owner-svn-src-all@freebsd.org Fri Jan 20 07:35:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1675FCB9F1E; Fri, 20 Jan 2017 07:35: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 D598914AD; Fri, 20 Jan 2017 07:35:45 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id e4so4945054pfg.0; Thu, 19 Jan 2017 23:35:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=l6SIuiQZ9EBBl2UYiu8R+gZpnaJhYHgjcjbCdeLj3vE=; b=Y9y6efFS2BGKmOy+zmLR7cpKz6HU5uQ76vraQJnCxC9hk/P3WuhggqDexw3yVrLaY3 sqGkrzzwm9u/I5d9i98NKd8SWG/oXSqMDVWYCdCTgA9yNxKpK963Kn1WGXC/9EM7QGJu Pvr4yljMDjI2a3yEaVo4V2rFc+i5K+Fa9otDX8JXVom83Ft2ayuk1RdKCIOTejHyT8Av GFP7kyPVe2iry1l7T2cYkYiuN0Kz/bX6dOr+Vspr798NOwzfO2K8nrJQ4Wa1BmuFnA+1 5i2vQLXRGuEye6bTyfCAegOwWfUnPxHZybnk7fNbCxBFZHOoQjnc1yf37fx86MyZLqLz VXjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=l6SIuiQZ9EBBl2UYiu8R+gZpnaJhYHgjcjbCdeLj3vE=; b=r/P1nizhuX5Yyv7IYsWAw+1DGKyr705LzIwaRqZheM/1Gh7bkLTyW2RPr4+PSdxZV7 8modl6BmJgChvoFPBlqlj9Q3CvYWHbxmcqeGG1es5QjjHYB30s6bMPJ2VbaZ1DvUsmK8 bsZqWZHp/lh5eQk5JapOmmYFo+kE/L6/XIdXQjZfd0eHwimkHogVEAt0xY/d3PfkyYDW VMxGT1pfHpPPcay4C+xZmiqe8IJDEuBcuy/PVhcx6AcOFQaMxvk2fkXkbp8YoRQrOCBK 0JCJW6CtUau2uaBh2S3pFr3qc5+tJBUHT6EHSg0c87i9VdtBUdQ7YZ0oYQYhKij6+VU8 p3WA== X-Gm-Message-State: AIkVDXIhou+Z7u4gAaZ7pXRWMxgHligflpIp9rr6S7WI2RGvISTvl8TC5UVxe/VgqI/OEw== X-Received: by 10.99.65.1 with SMTP id o1mr14990938pga.93.1484897745518; Thu, 19 Jan 2017 23:35:45 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id y184sm13904163pfg.86.2017.01.19.23.35.44 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Jan 2017 23:35:44 -0800 (PST) Subject: Re: svn commit: r312404 - head/usr.bin/sed Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2533D595-5E8D-4E31-88BF-7748A70946BD"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <2e5e7d42-9faa-957f-1a63-a10b91459985@delphij.net> Date: Thu, 19 Jan 2017 23:35:44 -0800 Cc: cem@freebsd.org, Antoine Brodin , d@delphij.net, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <9518E870-57E8-47F8-ACEA-5BBDB3B6C0E0@gmail.com> References: <201701190801.v0J81ZG9008267@repo.freebsd.org> <2e5e7d42-9faa-957f-1a63-a10b91459985@delphij.net> To: Xin Li 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: Fri, 20 Jan 2017 07:35:46 -0000 --Apple-Mail=_2533D595-5E8D-4E31-88BF-7748A70946BD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jan 19, 2017, at 22:59, Xin Li wrote: =E2=80=A6 > There are other issues with previous behavior, for instance, the file > would inherit permissions from the symlink itself, while a more = sensible > behavior would be to use the permissions on the symlink target. >=20 > But I think it's reasonable to revert for now and do a exp-run so we > know what would be broken. Personally I have been running with this = for > a year and that made me thought it's safe :) I think the lstat=E2=80=99s the incorrect part now =E2=80=94 should open = with O_NONBLOCK|O_RDONLY and fstat be used instead? Thanks! -Ngie --Apple-Mail=_2533D595-5E8D-4E31-88BF-7748A70946BD 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 iQIcBAEBCgAGBQJYgb3QAAoJEPWDqSZpMIYVqF4QAKn/QYQUPafPTuBcluCoJmKW /3IycZByqWXf/COMO2sbOtdbuXtWQyLMuWhKSoIr+sdcNiz/Xwc+Bf2eAbsrB9h1 gR5AyMXppJEgjGuowj05+sxvtRhmB5t7U7wK4iLub5pO8CInBDXYD1U4DcqJBoMu sRtgUnDKBV4oozzV4lX/qvbiuVMhxnXV/sstpBjZ9cLag45wK9RJ/uBlKKgNmr/j hS9PUzhYRNQucC9rQo+goTVRfpH3RQqX8df7MZvs8E2BmRgDp0ky1suR9cV6YV9c y0QoGuWA0MIuOdn4Xnr0mvQH8h2CFjSTcMHpWCGl8RBa3+VjyV6NdMmDapFM4zcV 5BZGb1syWKSAuV4tGWSrAhBjvM69/9VXiO4u8WEJ726ENnkNvayhZDWdvprmB7OC Vb3Ce+xbpdhGR9mCrBpjwX50ET8qfQ/u7lJawjwEgwNW5CtF7UoLegNUzlIrRc55 GC4MDahUVTIbOINZRE+ZxNCg0cXEp7pAAMhPNDZFnn4o4an4q5Sz2C3GF0oWgiob +q1774f+sR4TU3c0/hn4TfmfMlseCrK7QDbKg5KV2zANk7B/RDfO6WQuliOtDBPe X5nIOBcnT+xHONelAiTmWNuv+0PofzO1gL4A62FJpnZfdlQH6UnzeNjWB2ia55W/ 8R6NUyzFy/DRGOLvCpdi =XYHI -----END PGP SIGNATURE----- --Apple-Mail=_2533D595-5E8D-4E31-88BF-7748A70946BD-- From owner-svn-src-all@freebsd.org Fri Jan 20 07:43:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D796CB9166; Fri, 20 Jan 2017 07:43:42 +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 D02551A15; Fri, 20 Jan 2017 07:43:41 +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 v0K7heeB003609; Fri, 20 Jan 2017 07:43:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K7heje003608; Fri, 20 Jan 2017 07:43:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701200743.v0K7heje003608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 20 Jan 2017 07:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312522 - 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: Fri, 20 Jan 2017 07:43:42 -0000 Author: adrian Date: Fri Jan 20 07:43:40 2017 New Revision: 312522 URL: https://svnweb.freebsd.org/changeset/base/312522 Log: [net80211] allow for MCS16-23 to be statically configured. Tested: * AR9380, STA mode Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Fri Jan 20 07:11:21 2017 (r312521) +++ head/sys/net80211/ieee80211_ioctl.c Fri Jan 20 07:43:40 2017 (r312522) @@ -2225,7 +2225,7 @@ checkmcs(int mcs) return 1; if ((mcs & IEEE80211_RATE_MCS) == 0) /* MCS always have 0x80 set */ return 0; - return (mcs & 0x7f) <= 15; /* XXX could search ht rate set */ + return (mcs & 0x7f) <= 31; /* XXX could search ht rate set */ } static int From owner-svn-src-all@freebsd.org Fri Jan 20 07:46:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26DB3CB91FE; Fri, 20 Jan 2017 07:46:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id E08F41BD8; Fri, 20 Jan 2017 07:46:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 7459AD4578F; Fri, 20 Jan 2017 18:46:32 +1100 (AEDT) Date: Fri, 20 Jan 2017 18:46:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Antoine Brodin , Xin LI , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312404 - head/usr.bin/sed In-Reply-To: <20170120174258.X1938@besplex.bde.org> Message-ID: <20170120182151.E2080@besplex.bde.org> References: <201701190801.v0J81ZG9008267@repo.freebsd.org> <20170120174258.X1938@besplex.bde.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=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=nsIxdVpnNxUyBZHfyOYA: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: Fri, 20 Jan 2017 07:46:41 -0000 On Fri, 20 Jan 2017, Bruce Evans wrote: > On Fri, 20 Jan 2017, Antoine Brodin wrote: >> sed -i no longer works on symlinks which breaks lots of ports. >> Please revert and request an exp-run. > > sed() doesn't seem to actually understand symlinks (it has no flag like > -h to prevent following them when opening files), so its use of lstat() > to classify them is wrong. This was harmless for symlinks but not for Oops. It only does the lstat() classification for the -I and -i cases, where restricting to regular files is not completely wrong, but I don't see any reason to do it. Just require the target of the symlink to be regular (and still be wrong when it is an irregular regular file in /proc). The check also has races. These may be hard to avoid if symlinks must not be followed, but since sed must follow symlinks the correct method is to open the file (following symlinks) and fstat() the fd. sed has special support for stdin and stdout and special checks to disallow -I and -i on stdin and stdout. The fstat() check on them wouldn't work right. Editing stdin is only impossible since you can't reopen it for both input and output. sed has related problems and races in its supported case whee reopening is possible since the file name is know. A non-racy version might open the file in r+ mode, then fstat() it, but sed actually uses separate streams and even a tempoary file, so it is not very in-place and has the usual races with temporary files. Bruce From owner-svn-src-all@freebsd.org Fri Jan 20 08:00:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14B4CCB9622; Fri, 20 Jan 2017 08:00:38 +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 C796A10C5; Fri, 20 Jan 2017 08:00:37 +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 v0K80ars007860; Fri, 20 Jan 2017 08:00:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0K80a37007858; Fri, 20 Jan 2017 08:00:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201701200800.v0K80a37007858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Fri, 20 Jan 2017 08:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312523 - head/usr.bin/cut/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: Fri, 20 Jan 2017 08:00:38 -0000 Author: ngie Date: Fri Jan 20 08:00:36 2017 New Revision: 312523 URL: https://svnweb.freebsd.org/changeset/base/312523 Log: Add some basic -s flag testcases for cut(1) The remaining functionality seems to be covered in one form or another via the NetBSD ATF testcase. MFC after: 3 weeks Sponsored by: Dell EMC Isilon Added: head/usr.bin/cut/tests/cut2_test.sh (contents, props changed) Modified: head/usr.bin/cut/tests/Makefile Modified: head/usr.bin/cut/tests/Makefile ============================================================================== --- head/usr.bin/cut/tests/Makefile Fri Jan 20 07:43:40 2017 (r312522) +++ head/usr.bin/cut/tests/Makefile Fri Jan 20 08:00:36 2017 (r312523) @@ -2,6 +2,7 @@ PACKAGE= tests +ATF_TESTS_SH+= cut2_test NETBSD_ATF_TESTS_SH= cut_test ${PACKAGE}FILES= d_basic.out Added: head/usr.bin/cut/tests/cut2_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/cut/tests/cut2_test.sh Fri Jan 20 08:00:36 2017 (r312523) @@ -0,0 +1,51 @@ +# +# Copyright (c) 2017 Dell EMC +# 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$ + +atf_test_case s_flag +s_flag_head() +{ + atf_set "descr" "Check -s flag" +} + +s_flag_body() +{ + cat >input< Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 339E8CB7FA2; Fri, 20 Jan 2017 10:13:41 +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 02FE41433; Fri, 20 Jan 2017 10:13:40 +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 v0KADep1065445; Fri, 20 Jan 2017 10:13:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KADewU065444; Fri, 20 Jan 2017 10:13:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701201013.v0KADewU065444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 20 Jan 2017 10:13: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: r312524 - stable/11/sys/dev/cxgbe/tom 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, 20 Jan 2017 10:13:41 -0000 Author: np Date: Fri Jan 20 10:13:39 2017 New Revision: 312524 URL: https://svnweb.freebsd.org/changeset/base/312524 Log: MFC r312368: cxgbe/tom: Fix a case where do_pass_accept_req wasn't properly restoring the VNET. Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_listen.c Fri Jan 20 08:00:36 2017 (r312523) +++ stable/11/sys/dev/cxgbe/tom/t4_listen.c Fri Jan 20 10:13:39 2017 (r312524) @@ -1418,6 +1418,7 @@ found: if (!(synqe->flags & TPF_SYNQE_EXPANDED)) send_reset_synqe(tod, synqe); INP_WUNLOCK(inp); + CURVNET_RESTORE(); release_synqe(synqe); /* extra hold */ return (__LINE__); From owner-svn-src-all@freebsd.org Fri Jan 20 10:13:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28041CB7FA8; Fri, 20 Jan 2017 10:13:42 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8D121434; Fri, 20 Jan 2017 10:13:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KADfne065491; Fri, 20 Jan 2017 10:13:41 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KADfJl065490; Fri, 20 Jan 2017 10:13:41 GMT (envelope-from np@FreeBSD.org) Message-Id: <201701201013.v0KADfJl065490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 20 Jan 2017 10:13: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: r312525 - 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, 20 Jan 2017 10:13:42 -0000 Author: np Date: Fri Jan 20 10:13:40 2017 New Revision: 312525 URL: https://svnweb.freebsd.org/changeset/base/312525 Log: MFC r312368: cxgbe/tom: Fix a case where do_pass_accept_req wasn't properly restoring the VNET. Modified: stable/10/sys/dev/cxgbe/tom/t4_listen.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_listen.c Fri Jan 20 10:13:39 2017 (r312524) +++ stable/10/sys/dev/cxgbe/tom/t4_listen.c Fri Jan 20 10:13:40 2017 (r312525) @@ -1473,6 +1473,7 @@ found: if (!(synqe->flags & TPF_SYNQE_EXPANDED)) send_reset_synqe(tod, synqe); INP_WUNLOCK(inp); + CURVNET_RESTORE(); release_synqe(synqe); /* extra hold */ return (__LINE__); From owner-svn-src-all@freebsd.org Fri Jan 20 10:47:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C198ACB96F8; Fri, 20 Jan 2017 10:47:33 +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 8D33F1485; Fri, 20 Jan 2017 10:47:33 +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 v0KAlWbq077925; Fri, 20 Jan 2017 10:47:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KAlWcj077924; Fri, 20 Jan 2017 10:47:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701201047.v0KAlWcj077924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 Jan 2017 10:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312526 - head/sys/dev/mlx5 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, 20 Jan 2017 10:47:33 -0000 Author: hselasky Date: Fri Jan 20 10:47:32 2017 New Revision: 312526 URL: https://svnweb.freebsd.org/changeset/base/312526 Log: Update firmware interface structures and definitions adding support for new features and commands. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ifc.h Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Fri Jan 20 10:13:40 2017 (r312525) +++ head/sys/dev/mlx5/mlx5_ifc.h Fri Jan 20 10:47:32 2017 (r312526) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,13 +23,8 @@ * SUCH DAMAGE. * * $FreeBSD$ + */ - Autogenerated file. - Date: 2015-04-13 14:59 - Source Document Name: Mellanox - Source Document Version: 0.28 - Generated by adb_to_c.py (EAT.ME Version: 1.0.70) -*/ #ifndef MLX5_IFC_H #define MLX5_IFC_H @@ -56,6 +51,8 @@ enum { MLX5_EVENT_TYPE_CODING_TEMP_WARNING_EVENT = 0x17, MLX5_EVENT_TYPE_REMOTE_CONFIG = 0x19, MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT = 0x1e, + MLX5_EVENT_TYPE_CODING_PPS_EVENT = 0x25, + MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT = 0x22, MLX5_EVENT_TYPE_DB_BF_CONGESTION = 0x1a, MLX5_EVENT_TYPE_STALL_EVENT = 0x1b, MLX5_EVENT_TYPE_DROPPED_PACKET_LOGGED_EVENT = 0x1f, @@ -89,6 +86,8 @@ enum { MLX5_CMD_OP_QUERY_ISSI = 0x10a, MLX5_CMD_OP_SET_ISSI = 0x10b, MLX5_CMD_OP_SET_DRIVER_VERSION = 0x10d, + MLX5_CMD_OP_QUERY_OTHER_HCA_CAP = 0x10e, + MLX5_CMD_OP_MODIFY_OTHER_HCA_CAP = 0x10f, MLX5_CMD_OP_CREATE_MKEY = 0x200, MLX5_CMD_OP_QUERY_MKEY = 0x201, MLX5_CMD_OP_DESTROY_MKEY = 0x202, @@ -190,6 +189,12 @@ enum { MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY = 0x82b, MLX5_CMD_OP_SET_WOL_ROL = 0x830, MLX5_CMD_OP_QUERY_WOL_ROL = 0x831, + MLX5_CMD_OP_CREATE_LAG = 0x840, + MLX5_CMD_OP_MODIFY_LAG = 0x841, + MLX5_CMD_OP_QUERY_LAG = 0x842, + MLX5_CMD_OP_DESTROY_LAG = 0x843, + MLX5_CMD_OP_CREATE_VPORT_LAG = 0x844, + MLX5_CMD_OP_DESTROY_VPORT_LAG = 0x845, MLX5_CMD_OP_CREATE_TIR = 0x900, MLX5_CMD_OP_MODIFY_TIR = 0x901, MLX5_CMD_OP_DESTROY_TIR = 0x902, @@ -206,6 +211,8 @@ enum { MLX5_CMD_OP_MODIFY_RMP = 0x90d, MLX5_CMD_OP_DESTROY_RMP = 0x90e, MLX5_CMD_OP_QUERY_RMP = 0x90f, + MLX5_CMD_OP_SET_DELAY_DROP_PARAMS = 0x910, + MLX5_CMD_OP_QUERY_DELAY_DROP_PARAMS = 0x911, MLX5_CMD_OP_CREATE_TIS = 0x912, MLX5_CMD_OP_MODIFY_TIS = 0x913, MLX5_CMD_OP_DESTROY_TIS = 0x914, @@ -226,7 +233,10 @@ enum { MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY = 0x938, MLX5_CMD_OP_ALLOC_FLOW_COUNTER = 0x939, MLX5_CMD_OP_DEALLOC_FLOW_COUNTER = 0x93a, - MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b + MLX5_CMD_OP_QUERY_FLOW_COUNTER = 0x93b, + MLX5_CMD_OP_MODIFY_FLOW_TABLE = 0x93c, + MLX5_CMD_OP_ALLOC_ENCAP_HEADER = 0x93d, + MLX5_CMD_OP_DEALLOC_ENCAP_HEADER = 0x93e, }; enum { @@ -271,7 +281,11 @@ struct mlx5_ifc_flow_table_fields_suppor u8 outer_gre_protocol[0x1]; u8 outer_gre_key[0x1]; u8 outer_vxlan_vni[0x1]; - u8 reserved_2[0x5]; + u8 outer_geneve_vni[0x1]; + u8 outer_geneve_oam[0x1]; + u8 outer_geneve_protocol_type[0x1]; + u8 outer_geneve_opt_len[0x1]; + u8 reserved_2[0x1]; u8 source_eswitch_port[0x1]; u8 inner_dmac[0x1]; @@ -299,10 +313,12 @@ struct mlx5_ifc_flow_table_fields_suppor u8 inner_tcp_flags[0x1]; u8 reserved_5[0x9]; - u8 reserved_6[0x1f]; + u8 reserved_6[0x1a]; + u8 bth_dst_qp[0x1]; + u8 reserved_7[0x4]; u8 source_sqn[0x1]; - u8 reserved_7[0x20]; + u8 reserved_8[0x20]; }; struct mlx5_ifc_eth_discard_cntrs_grp_bits { @@ -356,7 +372,11 @@ struct mlx5_ifc_eth_discard_cntrs_grp_bi u8 egress_stp_filter_low[0x20]; - u8 reserved_at_340[0x480]; + u8 egress_hoq_stall_high[0x20]; + + u8 egress_hoq_stall_low[0x20]; + + u8 reserved_at_340[0x440]; }; struct mlx5_ifc_flow_table_prop_layout_bits { u8 ft_support[0x1]; @@ -411,6 +431,7 @@ enum { MLX5_FLOW_CONTEXT_DEST_TYPE_VPORT = 0x0, MLX5_FLOW_CONTEXT_DEST_TYPE_FLOW_TABLE = 0x1, MLX5_FLOW_CONTEXT_DEST_TYPE_TIR = 0x2, + MLX5_FLOW_CONTEXT_DEST_TYPE_QP = 0x3, }; struct mlx5_ifc_dest_format_struct_bits { @@ -490,9 +511,14 @@ struct mlx5_ifc_fte_match_set_misc_bits u8 reserved_6[0xc]; u8 inner_ipv6_flow_label[0x14]; - u8 reserved7[0x10]; + u8 reserved_7[0xa]; + u8 geneve_opt_len[0x6]; u8 geneve_protocol_type[0x10]; - u8 reserved8[0xc0]; + + u8 reserved_8[0x8]; + u8 bth_dst_qp[0x18]; + + u8 reserved_9[0xa0]; }; struct mlx5_ifc_cmd_pas_bits { @@ -698,7 +724,8 @@ struct mlx5_ifc_per_protocol_networking_ u8 lro_psh_flag[0x1]; u8 lro_time_stamp[0x1]; u8 lro_max_msg_sz_mode[0x2]; - u8 reserved_0[0x2]; + u8 wqe_vlan_insert[0x1]; + u8 self_lb_en_modifiable[0x1]; u8 self_lb_mc[0x1]; u8 self_lb_uc[0x1]; u8 max_lso_cap[0x5]; @@ -715,7 +742,8 @@ struct mlx5_ifc_per_protocol_networking_ u8 swp[0x1]; u8 swp_csum[0x1]; u8 swp_lso[0x1]; - u8 reserved_2[0x1c]; + u8 reserved_2[0x1b]; + u8 max_geneve_opt_len[0x1]; u8 tunnel_stateless_geneve_rx[0x1]; u8 reserved_3[0x10]; @@ -910,7 +938,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 vport_counters[0x1]; u8 retransmission_q_counters[0x1]; u8 debug[0x1]; - u8 reserved_16[0x2]; + u8 modify_rq_counters_set_id[0x1]; + u8 rq_delay_drop[0x1]; u8 max_qp_cnt[0xa]; u8 pkey_table_size[0x10]; @@ -980,7 +1009,9 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 cq_oi[0x1]; u8 cq_resize[0x1]; u8 cq_moderation[0x1]; - u8 reserved_31[0x3]; + u8 cq_period_mode_modify[0x1]; + u8 cq_invalidate[0x1]; + u8 reserved_at_225[0x1]; u8 cq_eq_remap[0x1]; u8 pg[0x1]; u8 block_lb_mc[0x1]; @@ -1068,7 +1099,8 @@ struct mlx5_ifc_cmd_hca_cap_bits { u8 log_max_wq_sz[0x5]; u8 nic_vport_change_event[0x1]; - u8 reserved_59[0xa]; + u8 disable_local_lb[0x1]; + u8 reserved_59[0x9]; u8 log_max_vlan_list[0x5]; u8 reserved_60[0x3]; u8 log_max_current_mc_list[0x5]; @@ -1312,6 +1344,8 @@ enum { MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_MAX_COUNT = 0x2, MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_OI = 0x4, MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_C_EQN = 0x8, + MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_CQ_PERIOD_MODE = 0x10, + MLX5_MODIFY_FIELD_SELECT_MODIFY_FIELD_SELECT_STATUS = 0x20, }; struct mlx5_ifc_modify_field_select_bits { @@ -2239,9 +2273,15 @@ enum { MLX5_RQC_STATE_ERR = 0x3, }; +enum { + MLX5_RQC_DROPLESS_MODE_DISABLE = 0x0, + MLX5_RQC_DROPLESS_MODE_ENABLE = 0x1, +}; + struct mlx5_ifc_rqc_bits { - u8 rlky[0x1]; - u8 reserved_0[0x2]; + u8 rlkey[0x1]; + u8 delay_drop_en[0x1]; + u8 scatter_fcs[0x1]; u8 vlan_strip_disable[0x1]; u8 mem_rq_type[0x4]; u8 state[0x4]; @@ -2293,7 +2333,9 @@ enum { struct mlx5_ifc_nic_vport_context_bits { u8 reserved_0[0x5]; u8 min_wqe_inline_mode[0x3]; - u8 reserved_1[0x17]; + u8 reserved_1[0x15]; + u8 disable_mc_local_lb[0x1]; + u8 disable_uc_local_lb[0x1]; u8 roce_en[0x1]; u8 arm_change_event[0x1]; @@ -3075,6 +3117,50 @@ struct mlx5_ifc_teardown_hca_in_bits { u8 reserved_3[0x20]; }; +struct mlx5_ifc_set_delay_drop_params_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; +}; + +struct mlx5_ifc_set_delay_drop_params_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 delay_drop_timeout[0x10]; +}; + +struct mlx5_ifc_query_delay_drop_params_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x20]; + + u8 reserved_at_60[0x10]; + u8 delay_drop_timeout[0x10]; +}; + +struct mlx5_ifc_query_delay_drop_params_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x40]; +}; + struct mlx5_ifc_suspend_qp_out_bits { u8 status[0x8]; u8 reserved_0[0x18]; @@ -4076,31 +4162,39 @@ struct mlx5_ifc_query_q_counter_out_bits u8 out_of_buffer[0x20]; - u8 reserved_7[0x20]; + u8 reserved_7[0x20]; u8 out_of_sequence[0x20]; - u8 reserved_8[0x20]; + u8 reserved_8[0x20]; - u8 duplicate_request[0x20]; + u8 duplicate_request[0x20]; - u8 reserved_9[0x20]; + u8 reserved_9[0x20]; - u8 rnr_nak_retry_err[0x20]; + u8 rnr_nak_retry_err[0x20]; - u8 reserved_10[0x20]; + u8 reserved_10[0x20]; - u8 packet_seq_err[0x20]; + u8 packet_seq_err[0x20]; - u8 reserved_11[0x20]; + u8 reserved_11[0x20]; - u8 implied_nak_seq_err[0x20]; + u8 implied_nak_seq_err[0x20]; - u8 reserved_12[0x20]; + u8 reserved_12[0x20]; + + u8 local_ack_timeout_err[0x20]; + + u8 reserved_13[0x20]; + + u8 resp_rnr_nak[0x20]; + + u8 reserved_14[0x20]; - u8 local_ack_timeout_err[0x20]; + u8 req_rnr_retries_exceeded[0x20]; - u8 reserved_13[0x4e0]; + u8 reserved_15[0x460]; }; struct mlx5_ifc_query_q_counter_in_bits { @@ -5204,7 +5298,9 @@ struct mlx5_ifc_modify_nic_vport_context }; struct mlx5_ifc_modify_nic_vport_field_select_bits { - u8 reserved_0[0x16]; + u8 reserved_0[0x14]; + u8 disable_uc_local_lb[0x1]; + u8 disable_mc_local_lb[0x1]; u8 node_guid[0x1]; u8 port_guid[0x1]; u8 min_wqe_inline_mode[0x1]; @@ -7958,6 +8054,42 @@ struct mlx5_ifc_phys_layer_cntrs_bits { u8 reserved_0[0x180]; }; +struct mlx5_ifc_phys_layer_statistical_cntrs_bits { + u8 time_since_last_clear_high[0x20]; + + u8 time_since_last_clear_low[0x20]; + + u8 phy_received_bits_high[0x20]; + + u8 phy_received_bits_low[0x20]; + + u8 phy_symbol_errors_high[0x20]; + + u8 phy_symbol_errors_low[0x20]; + + u8 phy_corrected_bits_high[0x20]; + + u8 phy_corrected_bits_low[0x20]; + + u8 phy_corrected_bits_lane0_high[0x20]; + + u8 phy_corrected_bits_lane0_low[0x20]; + + u8 phy_corrected_bits_lane1_high[0x20]; + + u8 phy_corrected_bits_lane1_low[0x20]; + + u8 phy_corrected_bits_lane2_high[0x20]; + + u8 phy_corrected_bits_lane2_low[0x20]; + + u8 phy_corrected_bits_lane3_high[0x20]; + + u8 phy_corrected_bits_lane3_low[0x20]; + + u8 reserved_at_200[0x5c0]; +}; + struct mlx5_ifc_infiniband_port_cntrs_bits { u8 symbol_error_counter[0x10]; u8 link_error_recovery_counter[0x8]; @@ -9187,6 +9319,7 @@ union mlx5_ifc_eth_cntrs_grp_data_layout struct mlx5_ifc_eth_discard_cntrs_grp_bits eth_discard_cntrs_grp; struct mlx5_ifc_eth_per_prio_grp_data_layout_bits eth_per_prio_grp_data_layout; struct mlx5_ifc_phys_layer_cntrs_bits phys_layer_cntrs; + struct mlx5_ifc_phys_layer_statistical_cntrs_bits phys_layer_statistical_cntrs; struct mlx5_ifc_infiniband_port_cntrs_bits infiniband_port_cntrs; u8 reserved_0[0x7c0]; }; From owner-svn-src-all@freebsd.org Fri Jan 20 11:11:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 410CCCB9E9E; Fri, 20 Jan 2017 11:11:51 +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 1B74011F1; Fri, 20 Jan 2017 11:11:51 +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 v0KBBo52088055; Fri, 20 Jan 2017 11:11:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KBBngZ088051; Fri, 20 Jan 2017 11:11:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701201111.v0KBBngZ088051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 Jan 2017 11:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312527 - in head/sys/dev/mlx5: . mlx5_core 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, 20 Jan 2017 11:11:51 -0000 Author: hselasky Date: Fri Jan 20 11:11:49 2017 New Revision: 312527 URL: https://svnweb.freebsd.org/changeset/base/312527 Log: Add runtime support for modifying the SQ and RQ completion event moderation mode. The presence of this feature is indicated through the firmware capabilities. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/cq.h head/sys/dev/mlx5/mlx5_core/mlx5_cq.c head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/cq.h ============================================================================== --- head/sys/dev/mlx5/cq.h Fri Jan 20 10:47:32 2017 (r312526) +++ head/sys/dev/mlx5/cq.h Fri Jan 20 11:11:49 2017 (r312527) @@ -88,6 +88,7 @@ enum { MLX5_CQ_MODIFY_PERIOD = 1 << 0, MLX5_CQ_MODIFY_COUNT = 1 << 1, MLX5_CQ_MODIFY_OVERRUN = 1 << 2, + MLX5_CQ_MODIFY_PERIOD_MODE = 1 << 4, }; enum { @@ -165,6 +166,11 @@ int mlx5_core_modify_cq(struct mlx5_core int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, u16 cq_period, u16 cq_max_count); +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode); int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cq.c Fri Jan 20 10:47:32 2017 (r312526) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cq.c Fri Jan 20 11:11:49 2017 (r312527) @@ -266,6 +266,28 @@ int mlx5_core_modify_cq_moderation(struc return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); } +int mlx5_core_modify_cq_moderation_mode(struct mlx5_core_dev *dev, + struct mlx5_core_cq *cq, + u16 cq_period, + u16 cq_max_count, + u8 cq_mode) +{ + struct mlx5_modify_cq_mbox_in in; + + memset(&in, 0, sizeof(in)); + + in.cqn = cpu_to_be32(cq->cqn); + in.ctx.cq_period = cpu_to_be16(cq_period); + in.ctx.cq_max_count = cpu_to_be16(cq_max_count); + in.ctx.cqe_sz_flags = (cq_mode & 2) >> 1; + in.ctx.st = (cq_mode & 1) << 7; + in.field_select = cpu_to_be32(MLX5_CQ_MODIFY_PERIOD | + MLX5_CQ_MODIFY_COUNT | + MLX5_CQ_MODIFY_PERIOD_MODE); + + return mlx5_core_modify_cq(dev, cq, &in, sizeof(in)); +} + int mlx5_init_cq_table(struct mlx5_core_dev *dev) { struct mlx5_cq_table *table = &dev->priv.cq_table; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri Jan 20 10:47:32 2017 (r312526) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri Jan 20 11:11:49 2017 (r312527) @@ -92,6 +92,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG { struct mlx5e_priv *priv = arg1; uint64_t value; + int mode_modify; int was_opened; int error; @@ -114,6 +115,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG goto done; } was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state); + mode_modify = MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify); switch (MLX5_PARAM_OFFSET(arg[arg2])) { case MLX5_PARAM_OFFSET(rx_coalesce_usecs): @@ -266,7 +268,7 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG case MLX5_PARAM_OFFSET(rx_coalesce_mode): /* network interface must be down */ - if (was_opened) + if (was_opened != 0 && mode_modify == 0) mlx5e_close_locked(priv->ifp); /* import RX coalesce mode */ @@ -276,13 +278,17 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params_ethtool.rx_coalesce_mode; /* restart network interface, if any */ - if (was_opened) - mlx5e_open_locked(priv->ifp); + if (was_opened != 0) { + if (mode_modify == 0) + mlx5e_open_locked(priv->ifp); + else + error = mlx5e_refresh_channel_params(priv); + } break; case MLX5_PARAM_OFFSET(tx_coalesce_mode): /* network interface must be down */ - if (was_opened) + if (was_opened != 0 && mode_modify == 0) mlx5e_close_locked(priv->ifp); /* import TX coalesce mode */ @@ -292,8 +298,12 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params_ethtool.tx_coalesce_mode; /* restart network interface, if any */ - if (was_opened) - mlx5e_open_locked(priv->ifp); + if (was_opened != 0) { + if (mode_modify == 0) + mlx5e_open_locked(priv->ifp); + else + error = mlx5e_refresh_channel_params(priv); + } break; case MLX5_PARAM_OFFSET(hw_lro): Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Jan 20 10:47:32 2017 (r312526) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Jan 20 11:11:49 2017 (r312527) @@ -1766,6 +1766,25 @@ mlx5e_close_channels(struct mlx5e_priv * static int mlx5e_refresh_sq_params(struct mlx5e_priv *priv, struct mlx5e_sq *sq) { + + if (MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify)) { + uint8_t cq_mode; + + switch (priv->params.tx_cq_moderation_mode) { + case 0: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + break; + } + + return (mlx5_core_modify_cq_moderation_mode(priv->mdev, &sq->cq.mcq, + priv->params.tx_cq_moderation_usec, + priv->params.tx_cq_moderation_pkts, + cq_mode)); + } + return (mlx5_core_modify_cq_moderation(priv->mdev, &sq->cq.mcq, priv->params.tx_cq_moderation_usec, priv->params.tx_cq_moderation_pkts)); @@ -1774,6 +1793,28 @@ mlx5e_refresh_sq_params(struct mlx5e_pri static int mlx5e_refresh_rq_params(struct mlx5e_priv *priv, struct mlx5e_rq *rq) { + + if (MLX5_CAP_GEN(priv->mdev, cq_period_mode_modify)) { + uint8_t cq_mode; + int retval; + + switch (priv->params.rx_cq_moderation_mode) { + case 0: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + cq_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + break; + } + + retval = mlx5_core_modify_cq_moderation_mode(priv->mdev, &rq->cq.mcq, + priv->params.rx_cq_moderation_usec, + priv->params.rx_cq_moderation_pkts, + cq_mode); + + return (retval); + } + return (mlx5_core_modify_cq_moderation(priv->mdev, &rq->cq.mcq, priv->params.rx_cq_moderation_usec, priv->params.rx_cq_moderation_pkts)); From owner-svn-src-all@freebsd.org Fri Jan 20 12:02:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 365EDCB52F1; Fri, 20 Jan 2017 12:02:42 +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 EB19C1E05; Fri, 20 Jan 2017 12:02:41 +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 v0KC2fr1011119; Fri, 20 Jan 2017 12:02:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KC2euM011116; Fri, 20 Jan 2017 12:02:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701201202.v0KC2euM011116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 Jan 2017 12:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312528 - 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, 20 Jan 2017 12:02:42 -0000 Author: hselasky Date: Fri Jan 20 12:02:40 2017 New Revision: 312528 URL: https://svnweb.freebsd.org/changeset/base/312528 Log: Make draining a sendqueue more robust. Add own state variable to track if a sendqueue is stopped or not. This will prevent traffic from entering the sendqueue while it is being destroyed. Update drain function to wait for traffic to be transmitted before returning when the link state is active. Add extra checks in transmit path for stopped SQ's. While at it: - Use likely() for a mbuf pointer check. - Remove redundant IFF_DRV_RUNNING check. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Jan 20 11:11:49 2017 (r312527) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Jan 20 12:02:40 2017 (r312528) @@ -507,10 +507,11 @@ struct mlx5e_sq { u16 bf_offset; u16 cev_counter; /* completion event counter */ u16 cev_factor; /* completion event factor */ - u32 cev_next_state; /* next completion event state */ + u16 cev_next_state; /* next completion event state */ #define MLX5E_CEV_STATE_INITIAL 0 /* timer not started */ #define MLX5E_CEV_STATE_SEND_NOPS 1 /* send NOPs */ #define MLX5E_CEV_STATE_HOLD_NOPS 2 /* don't send NOPs yet */ + u16 stopped; /* set if SQ is stopped */ struct callout cev_callout; union { u32 d32[2]; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Jan 20 11:11:49 2017 (r312527) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Jan 20 12:02:40 2017 (r312528) @@ -1219,8 +1219,25 @@ mlx5e_sq_cev_timeout(void *arg) void mlx5e_drain_sq(struct mlx5e_sq *sq) { + int error; + + /* + * Check if already stopped. + * + * NOTE: The "stopped" variable is only written when both the + * priv's configuration lock and the SQ's lock is locked. It + * can therefore safely be read when only one of the two locks + * is locked. This function is always called when the priv's + * configuration lock is locked. + */ + if (sq->stopped != 0) + return; mtx_lock(&sq->lock); + + /* don't put more packets into the SQ */ + sq->stopped = 1; + /* teardown event factor timer, if any */ sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; callout_stop(&sq->cev_callout); @@ -1232,14 +1249,29 @@ mlx5e_drain_sq(struct mlx5e_sq *sq) /* make sure it is safe to free the callout */ callout_drain(&sq->cev_callout); + /* wait till SQ is empty or link is down */ + mtx_lock(&sq->lock); + while (sq->cc != sq->pc && + (sq->priv->media_status_last & IFM_ACTIVE) != 0) { + mtx_unlock(&sq->lock); + msleep(1); + sq->cq.mcq.comp(&sq->cq.mcq); + mtx_lock(&sq->lock); + } + mtx_unlock(&sq->lock); + /* error out remaining requests */ - mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + error = mlx5e_modify_sq(sq, MLX5_SQC_STATE_RDY, MLX5_SQC_STATE_ERR); + if (error != 0) { + if_printf(sq->ifp, + "mlx5e_modify_sq() from RDY to ERR failed: %d\n", error); + } /* wait till SQ is empty */ mtx_lock(&sq->lock); while (sq->cc != sq->pc) { mtx_unlock(&sq->lock); - msleep(4); + msleep(1); sq->cq.mcq.comp(&sq->cq.mcq); mtx_lock(&sq->lock); } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Jan 20 11:11:49 2017 (r312527) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Jan 20 12:02:40 2017 (r312528) @@ -81,11 +81,15 @@ static struct mlx5e_sq * mlx5e_select_queue(struct ifnet *ifp, struct mbuf *mb) { struct mlx5e_priv *priv = ifp->if_softc; + struct mlx5e_channel * volatile *ppch; + struct mlx5e_channel *pch; u32 ch; u32 tc; + ppch = priv->channel; + /* check if channels are successfully opened */ - if (unlikely(priv->channel == NULL)) + if (unlikely(ppch == NULL)) return (NULL); /* obtain VLAN information if present */ @@ -123,11 +127,11 @@ mlx5e_select_queue(struct ifnet *ifp, st #endif } - /* check if channel is allocated */ - if (unlikely(priv->channel[ch] == NULL)) - return (NULL); - - return (&priv->channel[ch]->sq[tc]); + /* check if channel is allocated and not stopped */ + pch = ppch[ch]; + if (likely(pch != NULL && pch->sq[tc].stopped == 0)) + return (&pch->sq[tc]); + return (NULL); } static inline u16 @@ -445,18 +449,21 @@ mlx5e_xmit_locked(struct ifnet *ifp, str struct mbuf *next; int err = 0; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - if (mb) - err = drbr_enqueue(ifp, sq->br, mb); - return (err); - } - - if (mb != NULL) + if (likely(mb != NULL)) { /* * If we can't insert mbuf into drbr, try to xmit anyway. * We keep the error we got so we could return that after xmit. */ err = drbr_enqueue(ifp, sq->br, mb); + } + + /* + * Check if the network interface is closed or if the SQ is + * being stopped: + */ + if (unlikely((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + sq->stopped != 0)) + return (err); /* Process the queue */ while ((next = drbr_peek(ifp, sq->br)) != NULL) { @@ -470,8 +477,6 @@ mlx5e_xmit_locked(struct ifnet *ifp, str break; } drbr_advance(ifp, sq->br); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) - break; } /* Check if we need to write the doorbell */ if (likely(sq->doorbell.d64 != 0)) { From owner-svn-src-all@freebsd.org Fri Jan 20 13:00:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24676CB769F; Fri, 20 Jan 2017 13:00:52 +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 E800A1DC9; Fri, 20 Jan 2017 13:00:51 +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 v0KD0pwN032099; Fri, 20 Jan 2017 13:00:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KD0pKb032098; Fri, 20 Jan 2017 13:00:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701201300.v0KD0pKb032098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 Jan 2017 13:00:51 +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: r312529 - stable/11/share/misc 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, 20 Jan 2017 13:00:52 -0000 Author: mav Date: Fri Jan 20 13:00:50 2017 New Revision: 312529 URL: https://svnweb.freebsd.org/changeset/base/312529 Log: MFC r311517: Add some more mode page fields. Modified: stable/11/share/misc/scsi_modes Directory Properties: stable/11/ (props changed) Modified: stable/11/share/misc/scsi_modes ============================================================================== --- stable/11/share/misc/scsi_modes Fri Jan 20 12:02:40 2017 (r312528) +++ stable/11/share/misc/scsi_modes Fri Jan 20 13:00:50 2017 (r312529) @@ -71,7 +71,7 @@ {TAS} t1 {ATMPE} t1 {RWWP} t1 - {Reserved} *t1 + {SBLP (Supported Block Lengths and Protection)} t1 {Autoload Mode} t3 {Ready AEN Holdoff Period} i2 {Busy Timeout Period} i2 @@ -148,6 +148,15 @@ {Minimum Pre-fetch} i2 {Maximum Pre-fetch} i2 {Maximum Pre-fetch Ceiling} i2 + {FSW (Force Sequential Write)} t1 + {LBCSS (Logical Block Cache Segment Size)} t1 + {DRA (Disable Read-Ahead)} t1 + {Vendor Specific} t2 + {SYNC_PROG} t1 + {NV_DIS} t1 + {Number of Cache Segments} i1 + {Cache Segment Size} i2 + {Reserved} *t4 } 0x05 "Flexible Disk Page" { @@ -224,7 +233,8 @@ {Head Offset Count} i1 {Data Strobe Offset Count} i1 {LBPERE (LBP Error Reporting Enabled)} t1 - {Reserved} *t7 + {MWR (Misaligned Write Reporting)} t2 + {Reserved} *t5 {Write Retry Count} i1 {Reserved} *i1 {Recovery Time Limit} i2 From owner-svn-src-all@freebsd.org Fri Jan 20 13:01:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE8B9CB7876; Fri, 20 Jan 2017 13:01:26 +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 AE2B41F98; Fri, 20 Jan 2017 13:01:26 +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 v0KD1P9F033043; Fri, 20 Jan 2017 13:01:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KD1POQ033042; Fri, 20 Jan 2017 13:01:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701201301.v0KD1POQ033042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 Jan 2017 13:01: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: r312530 - stable/10/share/misc 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, 20 Jan 2017 13:01:27 -0000 Author: mav Date: Fri Jan 20 13:01:25 2017 New Revision: 312530 URL: https://svnweb.freebsd.org/changeset/base/312530 Log: MFC r311517: Add some more mode page fields. Modified: stable/10/share/misc/scsi_modes Directory Properties: stable/10/ (props changed) Modified: stable/10/share/misc/scsi_modes ============================================================================== --- stable/10/share/misc/scsi_modes Fri Jan 20 13:00:50 2017 (r312529) +++ stable/10/share/misc/scsi_modes Fri Jan 20 13:01:25 2017 (r312530) @@ -71,7 +71,7 @@ {TAS} t1 {ATMPE} t1 {RWWP} t1 - {Reserved} *t1 + {SBLP (Supported Block Lengths and Protection)} t1 {Autoload Mode} t3 {Ready AEN Holdoff Period} i2 {Busy Timeout Period} i2 @@ -148,6 +148,15 @@ {Minimum Pre-fetch} i2 {Maximum Pre-fetch} i2 {Maximum Pre-fetch Ceiling} i2 + {FSW (Force Sequential Write)} t1 + {LBCSS (Logical Block Cache Segment Size)} t1 + {DRA (Disable Read-Ahead)} t1 + {Vendor Specific} t2 + {SYNC_PROG} t1 + {NV_DIS} t1 + {Number of Cache Segments} i1 + {Cache Segment Size} i2 + {Reserved} *t4 } 0x05 "Flexible Disk Page" { @@ -224,7 +233,8 @@ {Head Offset Count} i1 {Data Strobe Offset Count} i1 {LBPERE (LBP Error Reporting Enabled)} t1 - {Reserved} *t7 + {MWR (Misaligned Write Reporting)} t2 + {Reserved} *t5 {Write Retry Count} i1 {Reserved} *i1 {Recovery Time Limit} i2 From owner-svn-src-all@freebsd.org Fri Jan 20 13:21:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0516ACB7ECB; Fri, 20 Jan 2017 13:21:29 +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 C70EB1CE8; Fri, 20 Jan 2017 13:21:28 +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 v0KDLRGr040416; Fri, 20 Jan 2017 13:21:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KDLRRu040415; Fri, 20 Jan 2017 13:21:27 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201701201321.v0KDLRRu040415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 20 Jan 2017 13:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312531 - head/sys/amd64/vmm 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, 20 Jan 2017 13:21:29 -0000 Author: avg Date: Fri Jan 20 13:21:27 2017 New Revision: 312531 URL: https://svnweb.freebsd.org/changeset/base/312531 Log: vmm_dev: work around a bogus error with gcc 6.3.0 The error is: vmm_dev.c: In function 'alloc_memseg': vmm_dev.c:261:11: error: null argument where non-null required (argument 1) [-Werror=nonnull] Apparently, the gcc is unable to figure out that if a ternary operator produced a non-NULL value once, then the operator with exactly the same operands would produce the same value again. MFC after: 1 week Modified: head/sys/amd64/vmm/vmm_dev.c Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Fri Jan 20 13:01:25 2017 (r312530) +++ head/sys/amd64/vmm/vmm_dev.c Fri Jan 20 13:21:27 2017 (r312531) @@ -258,7 +258,7 @@ alloc_memseg(struct vmmdev_softc *sc, st if (VM_MEMSEG_NAME(mseg)) { sysmem = false; name = malloc(SPECNAMELEN + 1, M_VMMDEV, M_WAITOK); - error = copystr(VM_MEMSEG_NAME(mseg), name, SPECNAMELEN + 1, 0); + error = copystr(mseg->name, name, SPECNAMELEN + 1, 0); if (error) goto done; } From owner-svn-src-all@freebsd.org Fri Jan 20 13:39:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41568CB83B7; Fri, 20 Jan 2017 13:39:09 +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 0948715F7; Fri, 20 Jan 2017 13:39:08 +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 v0KDd8wb048767; Fri, 20 Jan 2017 13:39:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KDd87p048766; Fri, 20 Jan 2017 13:39:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201701201339.v0KDd87p048766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 20 Jan 2017 13:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312532 - 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, 20 Jan 2017 13:39:09 -0000 Author: avg Date: Fri Jan 20 13:39:07 2017 New Revision: 312532 URL: https://svnweb.freebsd.org/changeset/base/312532 Log: don't abort writing of a core dump after EFAULT It's possible to get EFAULT when writing a segment backed by a file if the segment extends beyond the file. The core dump could still be useful if we skip the rest of the segment and proceed to other segements. The skipped segment (or a portion of it) will be zero-filled. While there, use 'const' to signify that core_write() only reads the buffer and use __DECONST before calling vn_rdwr_inchunks() because it can be used for both reading and writing. Before the change: kernel: Failed to write core file for process mmap_trunc_core (error 14) kernel: pid 77718 (mmap_trunc_core), uid 1001: exited on signal 6 After the change: kernel: Failed to fully fault in a core file segment at VA 0x800645000 with size 0x4000 to be written at offset 0x29000 for process mmap_trunc_core kernel: pid 4901 (mmap_trunc_core), uid 1001: exited on signal 6 (core dumped) Reviewed by: julian, kib Obtained from: Panzura (older version of the change) MFC after: 5 days Sponsored by: Panzura Differential Revision: https://reviews.freebsd.org/D9233 Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Fri Jan 20 13:21:27 2017 (r312531) +++ head/sys/kern/imgact_elf.c Fri Jan 20 13:39:07 2017 (r312532) @@ -1160,7 +1160,7 @@ struct coredump_params { static void cb_put_phdr(vm_map_entry_t, void *); static void cb_size_segment(vm_map_entry_t, void *); -static int core_write(struct coredump_params *, void *, size_t, off_t, +static int core_write(struct coredump_params *, const void *, size_t, off_t, enum uio_seg); static void each_dumpable_segment(struct thread *, segment_callback, void *); static int __elfN(corehdr)(struct coredump_params *, int, void *, size_t, @@ -1202,7 +1202,14 @@ compress_chunk(struct coredump_params *p while (len > 0) { chunk_len = MIN(len, CORE_BUF_SIZE); - copyin(base, buf, chunk_len); + + /* + * We can get EFAULT error here. + * In that case zero out the current chunk of the segment. + */ + error = copyin(base, buf, chunk_len); + if (error != 0) + bzero(buf, chunk_len); error = gzio_write(p->gzs, buf, chunk_len); if (error != 0) break; @@ -1222,12 +1229,12 @@ core_gz_write(void *base, size_t len, of #endif /* GZIO */ static int -core_write(struct coredump_params *p, void *base, size_t len, off_t offset, - enum uio_seg seg) +core_write(struct coredump_params *p, const void *base, size_t len, + off_t offset, enum uio_seg seg) { - return (vn_rdwr_inchunks(UIO_WRITE, p->vp, base, len, offset, - seg, IO_UNIT | IO_DIRECT | IO_RANGELOCKED, + return (vn_rdwr_inchunks(UIO_WRITE, p->vp, __DECONST(void *, base), + len, offset, seg, IO_UNIT | IO_DIRECT | IO_RANGELOCKED, p->active_cred, p->file_cred, NULL, p->td)); } @@ -1235,12 +1242,32 @@ static int core_output(void *base, size_t len, off_t offset, struct coredump_params *p, void *tmpbuf) { + int error; #ifdef GZIO if (p->gzs != NULL) return (compress_chunk(p, base, tmpbuf, len)); #endif - return (core_write(p, base, len, offset, UIO_USERSPACE)); + /* + * EFAULT is a non-fatal error that we can get, for example, + * if the segment is backed by a file but extends beyond its + * end. + */ + error = core_write(p, base, len, offset, UIO_USERSPACE); + if (error == EFAULT) { + log(LOG_WARNING, "Failed to fully fault in a core file segment " + "at VA %p with size 0x%zx to be written at offset 0x%jx " + "for process %s\n", base, len, offset, curproc->p_comm); + + /* + * Write a "real" zero byte at the end of the target region + * in the case this is the last segment. + * The intermediate space will be implicitly zero-filled. + */ + error = core_write(p, zero_region, 1, offset + len - 1, + UIO_SYSSPACE); + } + return (error); } /* From owner-svn-src-all@freebsd.org Fri Jan 20 13:49:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 791C8CB8658; Fri, 20 Jan 2017 13:49:05 +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 3E0CE1B7B; Fri, 20 Jan 2017 13:49:05 +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 v0KDn4k8052729; Fri, 20 Jan 2017 13:49:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KDn4o1052728; Fri, 20 Jan 2017 13:49:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701201349.v0KDn4o1052728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 Jan 2017 13:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312533 - head/sys/geom/multipath 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, 20 Jan 2017 13:49:05 -0000 Author: mav Date: Fri Jan 20 13:49:04 2017 New Revision: 312533 URL: https://svnweb.freebsd.org/changeset/base/312533 Log: Report disk addition errors on `add` or `create` subcommand. MFC after: 1 week Modified: head/sys/geom/multipath/g_multipath.c Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Fri Jan 20 13:39:07 2017 (r312532) +++ head/sys/geom/multipath/g_multipath.c Fri Jan 20 13:49:04 2017 (r312533) @@ -923,6 +923,7 @@ g_multipath_ctl_add_name(struct gctl_req struct g_provider *pp; const char *mpname; static const char devpf[6] = "/dev/"; + int error; g_topology_assert(); @@ -972,10 +973,9 @@ g_multipath_ctl_add_name(struct gctl_req return; } - /* - * Now add.... - */ - (void) g_multipath_add_disk(gp, pp); + error = g_multipath_add_disk(gp, pp); + if (error != 0) + gctl_error(req, "Provider addition error: %d", error); } static void From owner-svn-src-all@freebsd.org Fri Jan 20 14:59:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 093B4CB9268; Fri, 20 Jan 2017 14:59:58 +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 D80A61947; Fri, 20 Jan 2017 14:59:57 +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 v0KExuap081494; Fri, 20 Jan 2017 14:59:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KExuLr081493; Fri, 20 Jan 2017 14:59:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701201459.v0KExuLr081493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 14:59:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312534 - 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, 20 Jan 2017 14:59:58 -0000 Author: emaste Date: Fri Jan 20 14:59:56 2017 New Revision: 312534 URL: https://svnweb.freebsd.org/changeset/base/312534 Log: ANSYfy kern_ktrace.c and remove archaic register keyword Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_ktrace.c Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Fri Jan 20 13:49:04 2017 (r312533) +++ head/sys/kern/kern_ktrace.c Fri Jan 20 14:59:56 2017 (r312534) @@ -437,9 +437,7 @@ ktr_freeproc(struct proc *p, struct ucre } void -ktrsyscall(code, narg, args) - int code, narg; - register_t args[]; +ktrsyscall(int code, int narg, register_t args[]) { struct ktr_request *req; struct ktr_syscall *ktp; @@ -468,9 +466,7 @@ ktrsyscall(code, narg, args) } void -ktrsysret(code, error, retval) - int code, error; - register_t retval; +ktrsysret(int code, int error, register_t retval) { struct ktr_request *req; struct ktr_sysret *ktp; @@ -637,9 +633,7 @@ ktrnamei(path) } void -ktrsysctl(name, namelen) - int *name; - u_int namelen; +ktrsysctl(int *name, u_int namelen) { struct ktr_request *req; u_int mib[CTL_MAXNAME + 2]; @@ -671,11 +665,7 @@ ktrsysctl(name, namelen) } void -ktrgenio(fd, rw, uio, error) - int fd; - enum uio_rw rw; - struct uio *uio; - int error; +ktrgenio(int fd, enum uio_rw rw, struct uio *uio, int error) { struct ktr_request *req; struct ktr_genio *ktg; @@ -710,11 +700,7 @@ ktrgenio(fd, rw, uio, error) } void -ktrpsig(sig, action, mask, code) - int sig; - sig_t action; - sigset_t *mask; - int code; +ktrpsig(int sig, sig_t action, sigset_t *mask, int code) { struct thread *td = curthread; struct ktr_request *req; @@ -733,9 +719,7 @@ ktrpsig(sig, action, mask, code) } void -ktrcsw(out, user, wmesg) - int out, user; - const char *wmesg; +ktrcsw(int out, int user, const char *wmesg) { struct thread *td = curthread; struct ktr_request *req; @@ -756,10 +740,7 @@ ktrcsw(out, user, wmesg) } void -ktrstruct(name, data, datalen) - const char *name; - void *data; - size_t datalen; +ktrstruct(const char *name, void *data, size_t datalen) { struct ktr_request *req; char *buf; @@ -782,10 +763,8 @@ ktrstruct(name, data, datalen) } void -ktrcapfail(type, needed, held) - enum ktr_cap_fail_type type; - const cap_rights_t *needed; - const cap_rights_t *held; +ktrcapfail(enum ktr_cap_fail_type type, const cap_rights_t *needed, + const cap_rights_t *held) { struct thread *td = curthread; struct ktr_request *req; @@ -809,9 +788,7 @@ ktrcapfail(type, needed, held) } void -ktrfault(vaddr, type) - vm_offset_t vaddr; - int type; +ktrfault(vm_offset_t vaddr, int type) { struct thread *td = curthread; struct ktr_request *req; @@ -828,8 +805,7 @@ ktrfault(vaddr, type) } void -ktrfaultend(result) - int result; +ktrfaultend(int result) { struct thread *td = curthread; struct ktr_request *req; @@ -857,13 +833,11 @@ struct ktrace_args { #endif /* ARGSUSED */ int -sys_ktrace(td, uap) - struct thread *td; - register struct ktrace_args *uap; +sys_ktrace(struct thread *td, struct ktrace_args *uap) { #ifdef KTRACE - register struct vnode *vp = NULL; - register struct proc *p; + struct vnode *vp = NULL; + struct proc *p; struct pgrp *pg; int facs = uap->facs & ~KTRFAC_ROOT; int ops = KTROP(uap->ops); @@ -1002,9 +976,7 @@ done: /* ARGSUSED */ int -sys_utrace(td, uap) - struct thread *td; - register struct utrace_args *uap; +sys_utrace(struct thread *td, struct utrace_args *uap) { #ifdef KTRACE @@ -1038,11 +1010,7 @@ sys_utrace(td, uap) #ifdef KTRACE static int -ktrops(td, p, ops, facs, vp) - struct thread *td; - struct proc *p; - int ops, facs; - struct vnode *vp; +ktrops(struct thread *td, struct proc *p, int ops, int facs, struct vnode *vp) { struct vnode *tracevp = NULL; struct ucred *tracecred = NULL; @@ -1093,14 +1061,11 @@ ktrops(td, p, ops, facs, vp) } static int -ktrsetchildren(td, top, ops, facs, vp) - struct thread *td; - struct proc *top; - int ops, facs; - struct vnode *vp; +ktrsetchildren(struct thread *td, struct proc *top, int ops, int facs, + struct vnode *vp) { - register struct proc *p; - register int ret = 0; + struct proc *p; + int ret = 0; p = top; PROC_LOCK_ASSERT(p, MA_OWNED); @@ -1260,9 +1225,7 @@ ktr_writerequest(struct thread *td, stru * so, only root may further change it. */ static int -ktrcanset(td, targetp) - struct thread *td; - struct proc *targetp; +ktrcanset(struct thread *td, struct proc *targetp) { PROC_LOCK_ASSERT(targetp, MA_OWNED); From owner-svn-src-all@freebsd.org Fri Jan 20 15:01:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEF39CB93AD; Fri, 20 Jan 2017 15:01:05 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0C181CA2; Fri, 20 Jan 2017 15:01:05 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KF14CT084441; Fri, 20 Jan 2017 15:01:04 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KF14QP084438; Fri, 20 Jan 2017 15:01:04 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201701201501.v0KF14QP084438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 20 Jan 2017 15:01:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312535 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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, 20 Jan 2017 15:01:06 -0000 Author: jpaetzel Date: Fri Jan 20 15:01:04 2017 New Revision: 312535 URL: https://svnweb.freebsd.org/changeset/base/312535 Log: MFV 312436 6569 large file delete can starve out write ops illumos/illumos-gate@ff5177ee8bf9a355131ce2cc61ae2da6a5a6fdd6 https://github.com/illumos/illumos-gate/commit/ff5177ee8bf9a355131ce2cc61ae2da6a5a6fdd6 https://www.illumos.org/issues/6569 The core issue I've found is that there is no throttle for how many deletes get assigned to one TXG. As a results when deleting large files we end up filling consecutive TXGs with deletes/frees, then write throttling other (more important) ops. There is an easy test case for this problem. Try deleting several large files (at least 1/2 TB) while you do write ops on the same pool. What we've seen is performance of these write ops (let's call it sideload I/O) would drop to zero. More specifically the problem is that dmu_free_long_range_impl() can/will fill up all of the dirty data in the pool "instantly", before many of the sideload ops can get in. So sideload performance will be impacted until all the files are freed. The solution we have tested at Nexenta (with positive results) creates a relatively simple throttle for how many "free" ops we let into one TXG. However this solution exposes other problems that should also be addressed. If we are to slow down freeing of data that means one has to wait even longer (assuming vnode ref count of 1) to get shell back after an rm or for NFS thread to finish the free-ing op. To avoid this the proposed solution is to call zfs_inactive() async for "large" files. Async freeing then begs for the reclaimed space to be accounted for in the zpool's "freeing" prop. The other issue with having a longer delete is the inability to export/unmount for a longer period of time. The proposed solution is to interrupt freeing of blocks when a fs is unmounted. Author: Alek Pinchuk Reviewed by: Matt Ahrens Reviewed by: Sanjay Nadkarni Reviewed by: Pavel Zakharov Approved by: Dan McDonald Reviewed by: avg Differential Revision: D9008 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Jan 20 14:59:56 2017 (r312534) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Jan 20 15:01:04 2017 (r312535) @@ -60,6 +60,16 @@ SYSCTL_DECL(_vfs_zfs); SYSCTL_INT(_vfs_zfs, OID_AUTO, nopwrite_enabled, CTLFLAG_RDTUN, &zfs_nopwrite_enabled, 0, "Enable nopwrite feature"); +/* + * Tunable to control percentage of dirtied blocks from frees in one TXG. + * After this threshold is crossed, additional dirty blocks from frees + * wait until the next TXG. + * A value of zero will disable this throttle. + */ +uint32_t zfs_per_txg_dirty_frees_percent = 30; +SYSCTL_INT(_vfs_zfs, OID_AUTO, per_txg_dirty_frees_percent, CTLFLAG_RWTUN, + &zfs_per_txg_dirty_frees_percent, 0, "Percentage of dirtied blocks from frees in one txg"); + const dmu_object_type_info_t dmu_ot[DMU_OT_NUMTYPES] = { { DMU_BSWAP_UINT8, TRUE, "unallocated" }, { DMU_BSWAP_ZAP, TRUE, "object directory" }, @@ -718,15 +728,25 @@ dmu_free_long_range_impl(objset_t *os, d { uint64_t object_size = (dn->dn_maxblkid + 1) * dn->dn_datablksz; int err; + uint64_t dirty_frees_threshold; + dsl_pool_t *dp = dmu_objset_pool(os); if (offset >= object_size) return (0); + if (zfs_per_txg_dirty_frees_percent <= 100) + dirty_frees_threshold = + zfs_per_txg_dirty_frees_percent * zfs_dirty_data_max / 100; + else + dirty_frees_threshold = zfs_dirty_data_max / 4; + if (length == DMU_OBJECT_END || offset + length > object_size) length = object_size - offset; while (length != 0) { - uint64_t chunk_end, chunk_begin; + uint64_t chunk_end, chunk_begin, chunk_len; + uint64_t long_free_dirty_all_txgs = 0; + dmu_tx_t *tx; chunk_end = chunk_begin = offset + length; @@ -737,9 +757,28 @@ dmu_free_long_range_impl(objset_t *os, d ASSERT3U(chunk_begin, >=, offset); ASSERT3U(chunk_begin, <=, chunk_end); - dmu_tx_t *tx = dmu_tx_create(os); - dmu_tx_hold_free(tx, dn->dn_object, - chunk_begin, chunk_end - chunk_begin); + chunk_len = chunk_end - chunk_begin; + + mutex_enter(&dp->dp_lock); + for (int t = 0; t < TXG_SIZE; t++) { + long_free_dirty_all_txgs += + dp->dp_long_free_dirty_pertxg[t]; + } + mutex_exit(&dp->dp_lock); + + /* + * To avoid filling up a TXG with just frees wait for + * the next TXG to open before freeing more chunks if + * we have reached the threshold of frees + */ + if (dirty_frees_threshold != 0 && + long_free_dirty_all_txgs >= dirty_frees_threshold) { + txg_wait_open(dp, 0); + continue; + } + + tx = dmu_tx_create(os); + dmu_tx_hold_free(tx, dn->dn_object, chunk_begin, chunk_len); /* * Mark this transaction as typically resulting in a net @@ -751,10 +790,18 @@ dmu_free_long_range_impl(objset_t *os, d dmu_tx_abort(tx); return (err); } - dnode_free_range(dn, chunk_begin, chunk_end - chunk_begin, tx); + + mutex_enter(&dp->dp_lock); + dp->dp_long_free_dirty_pertxg[dmu_tx_get_txg(tx) & TXG_MASK] += + chunk_len; + mutex_exit(&dp->dp_lock); + DTRACE_PROBE3(free__long__range, + uint64_t, long_free_dirty_all_txgs, uint64_t, chunk_len, + uint64_t, dmu_tx_get_txg(tx)); + dnode_free_range(dn, chunk_begin, chunk_len, tx); dmu_tx_commit(tx); - length -= chunk_end - chunk_begin; + length -= chunk_len; } return (0); } 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 Fri Jan 20 14:59:56 2017 (r312534) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Jan 20 15:01:04 2017 (r312535) @@ -24,6 +24,7 @@ * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Nexenta Systems, Inc. All rights reserved. */ #include @@ -593,6 +594,16 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t t dsl_pool_undirty_space(dp, dp->dp_dirty_pertxg[txg & TXG_MASK], txg); /* + * Update the long range free counter after + * we're done syncing user data + */ + mutex_enter(&dp->dp_lock); + ASSERT(spa_sync_pass(dp->dp_spa) == 1 || + dp->dp_long_free_dirty_pertxg[txg & TXG_MASK] == 0); + dp->dp_long_free_dirty_pertxg[txg & TXG_MASK] = 0; + mutex_exit(&dp->dp_lock); + + /* * After the data blocks have been written (ensured by the zio_wait() * above), update the user/group space accounting. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Fri Jan 20 14:59:56 2017 (r312534) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Fri Jan 20 15:01:04 2017 (r312535) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2016 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SYS_DSL_POOL_H @@ -103,6 +104,7 @@ typedef struct dsl_pool { kcondvar_t dp_spaceavail_cv; uint64_t dp_dirty_pertxg[TXG_SIZE]; uint64_t dp_dirty_total; + uint64_t dp_long_free_dirty_pertxg[TXG_SIZE]; uint64_t dp_mos_used_delta; uint64_t dp_mos_compressed_delta; uint64_t dp_mos_uncompressed_delta; From owner-svn-src-all@freebsd.org Fri Jan 20 15:45:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 651CCCB829B; Fri, 20 Jan 2017 15:45:23 +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 251991733; Fri, 20 Jan 2017 15:45: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 v0KFjMtX001855; Fri, 20 Jan 2017 15:45:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KFjLDw001850; Fri, 20 Jan 2017 15:45:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701201545.v0KFjLDw001850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 Jan 2017 15:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312536 - 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, 20 Jan 2017 15:45:23 -0000 Author: hselasky Date: Fri Jan 20 15:45:21 2017 New Revision: 312536 URL: https://svnweb.freebsd.org/changeset/base/312536 Log: Allow transmit packet bufring in software to be disabled. - Add new sysctl node to control the transmit packet bufring. - Add optimised version of the transmit routine which output packets directly to the DMA ring instead of using bufring in case the transmit lock is congested. This can reduce the number of taskswitches which in turn influence the overall system CPU usage, depending on the workload. - Add " TX" suffix to debug name for transmit mutexes to silence some witness warnings about aquiring duplicate locks having same name. MFC after: 1 week Sponsored by: Mellanox Technologies Suggested by: gallatin @ Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Fri Jan 20 15:01:04 2017 (r312535) +++ head/sys/dev/mlx5/mlx5_en/en.h Fri Jan 20 15:45:21 2017 (r312536) @@ -402,6 +402,7 @@ struct mlx5e_params { m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ + m(+1, u64 tx_bufring_disable, "tx_bufring_disable", "0: Enable bufring 1: Disable bufring") \ m(+1, u64 tx_completion_fact, "tx_completion_fact", "1..MAX: Completion event ratio") \ m(+1, u64 tx_completion_fact_max, "tx_completion_fact_max", "Maximum completion event ratio") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") \ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri Jan 20 15:01:04 2017 (r312535) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Fri Jan 20 15:45:21 2017 (r312536) @@ -352,6 +352,18 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG mlx5e_open_locked(priv->ifp); break; + case MLX5_PARAM_OFFSET(tx_bufring_disable): + /* rangecheck input value */ + priv->params_ethtool.tx_bufring_disable = + priv->params_ethtool.tx_bufring_disable ? 1 : 0; + + /* reconfigure the sendqueues, if any */ + if (was_opened) { + mlx5e_close_locked(priv->ifp); + mlx5e_open_locked(priv->ifp); + } + break; + case MLX5_PARAM_OFFSET(tx_completion_fact): /* network interface must be down */ if (was_opened) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Jan 20 15:01:04 2017 (r312535) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Jan 20 15:45:21 2017 (r312536) @@ -439,7 +439,8 @@ mlx5e_update_stats_work(struct work_stru tso_packets += sq_stats->tso_packets; tso_bytes += sq_stats->tso_bytes; tx_queue_dropped += sq_stats->dropped; - tx_queue_dropped += sq_br->br_drops; + if (sq_br != NULL) + tx_queue_dropped += sq_br->br_drops; tx_defragged += sq_stats->defragged; tx_offload_none += sq_stats->csum_offload_none; } @@ -987,34 +988,37 @@ mlx5e_create_sq(struct mlx5e_channel *c, sq->priv = priv; sq->tc = tc; - sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, - M_WAITOK, &sq->lock); - if (sq->br == NULL) { - if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", - __func__); - err = -ENOMEM; - goto err_free_sq_db; - } - - sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK, - taskqueue_thread_enqueue, &sq->sq_tq); - if (sq->sq_tq == NULL) { - if_printf(c->ifp, "%s: Failed allocating taskqueue\n", - __func__); - err = -ENOMEM; - goto err_free_drbr; - } + /* check if we should allocate a second packet buffer */ + if (priv->params_ethtool.tx_bufring_disable == 0) { + sq->br = buf_ring_alloc(MLX5E_SQ_TX_QUEUE_SIZE, M_MLX5EN, + M_WAITOK, &sq->lock); + if (sq->br == NULL) { + if_printf(c->ifp, "%s: Failed allocating sq drbr buffer\n", + __func__); + err = -ENOMEM; + goto err_free_sq_db; + } + + sq->sq_tq = taskqueue_create_fast("mlx5e_que", M_WAITOK, + taskqueue_thread_enqueue, &sq->sq_tq); + if (sq->sq_tq == NULL) { + if_printf(c->ifp, "%s: Failed allocating taskqueue\n", + __func__); + err = -ENOMEM; + goto err_free_drbr; + } - TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq); + TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq); #ifdef RSS - cpu_id = rss_getcpu(c->ix % rss_getnumbuckets()); - CPU_SETOF(cpu_id, &cpu_mask); - taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask, - "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id); + cpu_id = rss_getcpu(c->ix % rss_getnumbuckets()); + CPU_SETOF(cpu_id, &cpu_mask); + taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask, + "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id); #else - taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, - "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc); + taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, + "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc); #endif + } snprintf(buffer, sizeof(buffer), "txstat%dtc%d", c->ix, tc); mlx5e_create_stats(&sq->stats.ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), buffer, mlx5e_sq_stats_desc, MLX5E_SQ_STATS_NUM, @@ -1047,9 +1051,12 @@ mlx5e_destroy_sq(struct mlx5e_sq *sq) mlx5e_free_sq_db(sq); mlx5_wq_destroy(&sq->wq_ctrl); mlx5_unmap_free_uar(sq->priv->mdev, &sq->uar); - taskqueue_drain(sq->sq_tq, &sq->sq_task); - taskqueue_free(sq->sq_tq); - buf_ring_free(sq->br, M_MLX5EN); + if (sq->sq_tq != NULL) { + taskqueue_drain(sq->sq_tq, &sq->sq_task); + taskqueue_free(sq->sq_tq); + } + if (sq->br != NULL) + buf_ring_free(sq->br, M_MLX5EN); } int @@ -1497,9 +1504,10 @@ mlx5e_chan_mtx_init(struct mlx5e_channel for (tc = 0; tc < c->num_tc; tc++) { struct mlx5e_sq *sq = c->sq + tc; - mtx_init(&sq->lock, "mlx5tx", MTX_NETWORK_LOCK, MTX_DEF); - mtx_init(&sq->comp_lock, "mlx5comp", MTX_NETWORK_LOCK, - MTX_DEF); + mtx_init(&sq->lock, "mlx5tx", + MTX_NETWORK_LOCK " TX", MTX_DEF); + mtx_init(&sq->comp_lock, "mlx5comp", + MTX_NETWORK_LOCK " TX", MTX_DEF); callout_init_mtx(&sq->cev_callout, &sq->lock, 0); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Jan 20 15:01:04 2017 (r312535) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Fri Jan 20 15:45:21 2017 (r312536) @@ -439,7 +439,8 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, in sq->cc = sqcc; - if (atomic_cmpset_int(&sq->queue_state, MLX5E_SQ_FULL, MLX5E_SQ_READY)) + if (sq->sq_tq != NULL && + atomic_cmpset_int(&sq->queue_state, MLX5E_SQ_FULL, MLX5E_SQ_READY)) taskqueue_enqueue(sq->sq_tq, &sq->sq_task); } @@ -498,6 +499,45 @@ mlx5e_xmit_locked(struct ifnet *ifp, str return (err); } +static int +mlx5e_xmit_locked_no_br(struct ifnet *ifp, struct mlx5e_sq *sq, struct mbuf *mb) +{ + int err = 0; + + if (unlikely((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + sq->stopped != 0)) { + m_freem(mb); + return (ENETDOWN); + } + + /* Do transmit */ + if (mlx5e_sq_xmit(sq, &mb) != 0) { + /* NOTE: m_freem() is NULL safe */ + m_freem(mb); + err = ENOBUFS; + } + + /* Check if we need to write the doorbell */ + if (likely(sq->doorbell.d64 != 0)) { + mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); + sq->doorbell.d64 = 0; + } + + /* + * Check if we need to start the event timer which flushes the + * transmit ring on timeout: + */ + if (unlikely(sq->cev_next_state == MLX5E_CEV_STATE_INITIAL && + sq->cev_factor != 1)) { + /* start the timer */ + mlx5e_sq_cev_timeout(sq); + } else { + /* don't send NOPs yet */ + sq->cev_next_state = MLX5E_CEV_STATE_HOLD_NOPS; + } + return (err); +} + int mlx5e_xmit(struct ifnet *ifp, struct mbuf *mb) { @@ -510,7 +550,13 @@ mlx5e_xmit(struct ifnet *ifp, struct mbu m_freem(mb); return (ENXIO); } - if (mtx_trylock(&sq->lock)) { + + if (unlikely(sq->br == NULL)) { + /* rate limited traffic */ + mtx_lock(&sq->lock); + ret = mlx5e_xmit_locked_no_br(ifp, sq, mb); + mtx_unlock(&sq->lock); + } else if (mtx_trylock(&sq->lock)) { ret = mlx5e_xmit_locked(ifp, sq, mb); mtx_unlock(&sq->lock); } else { From owner-svn-src-all@freebsd.org Fri Jan 20 15:47:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1675CB8379; Fri, 20 Jan 2017 15:47:30 +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 A0C7718FF; Fri, 20 Jan 2017 15:47:30 +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 v0KFlT1b001961; Fri, 20 Jan 2017 15:47:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KFlTQn001960; Fri, 20 Jan 2017 15:47:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701201547.v0KFlTQn001960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 Jan 2017 15:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312537 - 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, 20 Jan 2017 15:47:30 -0000 Author: hselasky Date: Fri Jan 20 15:47:29 2017 New Revision: 312537 URL: https://svnweb.freebsd.org/changeset/base/312537 Log: Remove superfluous return statement. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Jan 20 15:45:21 2017 (r312536) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Jan 20 15:47:29 2017 (r312537) @@ -1191,7 +1191,6 @@ done: mlx5e_tx_notify_hw(sq, sq->doorbell.d32, 0); sq->doorbell.d64 = 0; } - return; } void From owner-svn-src-all@freebsd.org Fri Jan 20 15:56:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3D60CB8678; Fri, 20 Jan 2017 15:56:41 +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 A352B1F92; Fri, 20 Jan 2017 15:56:41 +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 v0KFuehd006168; Fri, 20 Jan 2017 15:56:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KFueQl006167; Fri, 20 Jan 2017 15:56:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201701201556.v0KFueQl006167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 20 Jan 2017 15:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312538 - 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, 20 Jan 2017 15:56:41 -0000 Author: pfg Date: Fri Jan 20 15:56:40 2017 New Revision: 312538 URL: https://svnweb.freebsd.org/changeset/base/312538 Log: Addition of clang nullability qualifiers. For consistency with the qualifiers added in r310977, define a new qualifier _Null_unspecified which is also defined in clang 3.7+. Add two new macros: __NULLABILITY_PRAGMA_PUSH __NULLABILITY_PRAGMA_POP These are for use in headers when we want avoid noisy warnings if some pointers are left without nullability annotations. These are added with way ahead of their first use to teach the GCC ports headers of their existance before their first use. Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Fri Jan 20 15:47:29 2017 (r312537) +++ head/sys/sys/cdefs.h Fri Jan 20 15:56:40 2017 (r312538) @@ -793,6 +793,13 @@ #if !(defined(__clang__) && __has_feature(nullability)) #define _Nonnull #define _Nullable +#define _Null_unspecified +#define __NULLABILITY_PRAGMA_PUSH +#define __NULLABILITY_PRAGMA_POP +#else +#define __NULLABILITY_PRAGMA_PUSH _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Wnullability-completeness\"") +#define __NULLABILITY_PRAGMA_POP _Pragma("clang diagnostic pop") #endif /* From owner-svn-src-all@freebsd.org Fri Jan 20 16:01:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6E11CB8897; Fri, 20 Jan 2017 16:01:02 +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 6CC3A155F; Fri, 20 Jan 2017 16:01:02 +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 v0KG11rq007248; Fri, 20 Jan 2017 16:01:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KG11kS007246; Fri, 20 Jan 2017 16:01:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701201601.v0KG11kS007246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 Jan 2017 16:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312539 - head/usr.bin/iscsictl 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, 20 Jan 2017 16:01:02 -0000 Author: mav Date: Fri Jan 20 16:01:01 2017 New Revision: 312539 URL: https://svnweb.freebsd.org/changeset/base/312539 Log: Remove some unused code. MFC after: 2 weeks Modified: head/usr.bin/iscsictl/iscsictl.c head/usr.bin/iscsictl/iscsictl.h Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Fri Jan 20 15:56:40 2017 (r312538) +++ head/usr.bin/iscsictl/iscsictl.c Fri Jan 20 16:01:01 2017 (r312539) @@ -704,17 +704,6 @@ usage(void) exit(1); } -char * -checked_strdup(const char *s) -{ - char *c; - - c = strdup(s); - if (c == NULL) - xo_err(1, "strdup"); - return (c); -} - int main(int argc, char **argv) { Modified: head/usr.bin/iscsictl/iscsictl.h ============================================================================== --- head/usr.bin/iscsictl/iscsictl.h Fri Jan 20 15:56:40 2017 (r312538) +++ head/usr.bin/iscsictl/iscsictl.h Fri Jan 20 16:01:01 2017 (r312539) @@ -40,7 +40,6 @@ #define DEFAULT_IQN "iqn.1994-09.org.freebsd:" #define MAX_NAME_LEN 223 -#define MAX_DATA_SEGMENT_LENGTH 65536 #define AUTH_METHOD_UNSPECIFIED 0 #define AUTH_METHOD_NONE 1 @@ -88,23 +87,6 @@ struct conf { TAILQ_HEAD(, target) conf_targets; }; -#define CONN_SESSION_TYPE_NONE 0 -#define CONN_SESSION_TYPE_DISCOVERY 1 -#define CONN_SESSION_TYPE_NORMAL 2 - -struct connection { - struct target *conn_target; - int conn_socket; - int conn_session_type; - uint32_t conn_cmdsn; - uint32_t conn_statsn; - size_t conn_max_data_segment_length; - size_t conn_max_burst_length; - size_t conn_max_outstanding_r2t; - int conn_header_digest; - int conn_data_digest; -}; - struct conf *conf_new(void); struct conf *conf_new_from_file(const char *path); void conf_delete(struct conf *conf); @@ -116,7 +98,6 @@ void target_delete(struct target *ic); void print_periphs(int session_id); -char *checked_strdup(const char *); bool valid_iscsi_name(const char *name); int parse_enable(const char *enable); From owner-svn-src-all@freebsd.org Fri Jan 20 16:04:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D67A6CB8B74; Fri, 20 Jan 2017 16:04:40 +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 A462B1982; Fri, 20 Jan 2017 16:04:40 +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 v0KG4dQ2010297; Fri, 20 Jan 2017 16:04:39 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KG4d6x010296; Fri, 20 Jan 2017 16:04:39 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701201604.v0KG4d6x010296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 20 Jan 2017 16:04: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: r312540 - stable/10/sys/boot/forth 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, 20 Jan 2017 16:04:40 -0000 Author: asomers Date: Fri Jan 20 16:04:39 2017 New Revision: 312540 URL: https://svnweb.freebsd.org/changeset/base/312540 Log: MFC r310417 Add a dumpdev example to /boot/defaults/loader.conf Modified: stable/10/sys/boot/forth/loader.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/forth/loader.conf ============================================================================== --- stable/10/sys/boot/forth/loader.conf Fri Jan 20 16:01:01 2017 (r312539) +++ stable/10/sys/boot/forth/loader.conf Fri Jan 20 16:04:39 2017 (r312540) @@ -84,6 +84,7 @@ module_path="/boot/modules" # Set the mo #prompt="\\${interpret}" # Set the command prompt #root_disk_unit="0" # Force the root disk unit number #rootdev="disk1s1a" # Set the root filesystem +#dumpdev="disk1s1b" # Set a dump device early in the boot process #tftp.blksize="1428" # Set the RFC 2348 TFTP block size. # If the TFTP server does not support RFC 2348, # the block size is set to 512. If the value From owner-svn-src-all@freebsd.org Fri Jan 20 17:14:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE38ACB9AE2; Fri, 20 Jan 2017 17:14:11 +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 93FD61DE1; Fri, 20 Jan 2017 17:14:11 +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 v0KHEAGL039039; Fri, 20 Jan 2017 17:14:10 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHEA1N039038; Fri, 20 Jan 2017 17:14:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701201714.v0KHEA1N039038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 Jan 2017 17:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312543 - head/usr.sbin/iscsid 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, 20 Jan 2017 17:14:12 -0000 Author: mav Date: Fri Jan 20 17:14:10 2017 New Revision: 312543 URL: https://svnweb.freebsd.org/changeset/base/312543 Log: Remove ISCSI_MAX_DATA_SEGMENT_LENGTH, using negotiated value. MFC after: 2 weeks Modified: head/usr.sbin/iscsid/pdu.c Modified: head/usr.sbin/iscsid/pdu.c ============================================================================== --- head/usr.sbin/iscsid/pdu.c Fri Jan 20 17:03:44 2017 (r312542) +++ head/usr.sbin/iscsid/pdu.c Fri Jan 20 17:14:10 2017 (r312543) @@ -106,13 +106,15 @@ pdu_new_response(struct pdu *request) static void pdu_receive_proxy(struct pdu *pdu) { + struct connection *conn; struct iscsi_daemon_receive *idr; size_t len; int error; - assert(pdu->pdu_connection->conn_conf.isc_iser != 0); + conn = pdu->pdu_connection; + assert(conn->conn_conf.isc_iser != 0); - pdu->pdu_data = malloc(ISCSI_MAX_DATA_SEGMENT_LENGTH); + pdu->pdu_data = malloc(conn->conn_max_recv_data_segment_length); if (pdu->pdu_data == NULL) log_err(1, "malloc"); @@ -120,12 +122,12 @@ pdu_receive_proxy(struct pdu *pdu) if (idr == NULL) log_err(1, "calloc"); - idr->idr_session_id = pdu->pdu_connection->conn_session_id; + idr->idr_session_id = conn->conn_session_id; idr->idr_bhs = pdu->pdu_bhs; - idr->idr_data_segment_len = ISCSI_MAX_DATA_SEGMENT_LENGTH; + idr->idr_data_segment_len = conn->conn_max_recv_data_segment_length; idr->idr_data_segment = pdu->pdu_data; - error = ioctl(pdu->pdu_connection->conn_iscsi_fd, ISCSIDRECEIVE, idr); + error = ioctl(conn->conn_iscsi_fd, ISCSIDRECEIVE, idr); if (error != 0) log_err(1, "ISCSIDRECEIVE"); @@ -134,7 +136,7 @@ pdu_receive_proxy(struct pdu *pdu) log_errx(1, "protocol error: non-empty AHS"); len = pdu_data_segment_length(pdu); - assert(len <= ISCSI_MAX_DATA_SEGMENT_LENGTH); + assert(len <= (size_t)conn->conn_max_recv_data_segment_length); pdu->pdu_data_len = len; free(idr); @@ -143,10 +145,12 @@ pdu_receive_proxy(struct pdu *pdu) static void pdu_send_proxy(struct pdu *pdu) { + struct connection *conn; struct iscsi_daemon_send *ids; int error; - assert(pdu->pdu_connection->conn_conf.isc_iser != 0); + conn = pdu->pdu_connection; + assert(conn->conn_conf.isc_iser != 0); pdu_set_data_segment_length(pdu, pdu->pdu_data_len); @@ -154,12 +158,12 @@ pdu_send_proxy(struct pdu *pdu) if (ids == NULL) log_err(1, "calloc"); - ids->ids_session_id = pdu->pdu_connection->conn_session_id; + ids->ids_session_id = conn->conn_session_id; ids->ids_bhs = pdu->pdu_bhs; ids->ids_data_segment_len = pdu->pdu_data_len; ids->ids_data_segment = pdu->pdu_data; - error = ioctl(pdu->pdu_connection->conn_iscsi_fd, ISCSIDSEND, ids); + error = ioctl(conn->conn_iscsi_fd, ISCSIDSEND, ids); if (error != 0) log_err(1, "ISCSIDSEND"); @@ -204,18 +208,18 @@ pdu_read(const struct connection *conn, void pdu_receive(struct pdu *pdu) { + struct connection *conn; size_t len, padding; char dummy[4]; + conn = pdu->pdu_connection; #ifdef ICL_KERNEL_PROXY - if (pdu->pdu_connection->conn_conf.isc_iser != 0) + if (conn->conn_conf.isc_iser != 0) return (pdu_receive_proxy(pdu)); #endif + assert(conn->conn_conf.isc_iser == 0); - assert(pdu->pdu_connection->conn_conf.isc_iser == 0); - - pdu_read(pdu->pdu_connection, - (char *)pdu->pdu_bhs, sizeof(*pdu->pdu_bhs)); + pdu_read(conn, (char *)pdu->pdu_bhs, sizeof(*pdu->pdu_bhs)); len = pdu_ahs_length(pdu); if (len > 0) @@ -223,10 +227,10 @@ pdu_receive(struct pdu *pdu) len = pdu_data_segment_length(pdu); if (len > 0) { - if (len > ISCSI_MAX_DATA_SEGMENT_LENGTH) { + if (len > (size_t)conn->conn_max_recv_data_segment_length) { log_errx(1, "protocol error: received PDU " "with DataSegmentLength exceeding %d", - ISCSI_MAX_DATA_SEGMENT_LENGTH); + conn->conn_max_recv_data_segment_length); } pdu->pdu_data_len = len; @@ -234,14 +238,12 @@ pdu_receive(struct pdu *pdu) if (pdu->pdu_data == NULL) log_err(1, "malloc"); - pdu_read(pdu->pdu_connection, - (char *)pdu->pdu_data, pdu->pdu_data_len); + pdu_read(conn, (char *)pdu->pdu_data, pdu->pdu_data_len); padding = pdu_padding(pdu); if (padding != 0) { assert(padding < sizeof(dummy)); - pdu_read(pdu->pdu_connection, - (char *)dummy, padding); + pdu_read(conn, (char *)dummy, padding); } } } @@ -249,18 +251,20 @@ pdu_receive(struct pdu *pdu) void pdu_send(struct pdu *pdu) { + struct connection *conn; ssize_t ret, total_len; size_t padding; uint32_t zero = 0; struct iovec iov[3]; int iovcnt; + conn = pdu->pdu_connection; #ifdef ICL_KERNEL_PROXY - if (pdu->pdu_connection->conn_conf.isc_iser != 0) + if (conn->conn_conf.isc_iser != 0) return (pdu_send_proxy(pdu)); #endif - assert(pdu->pdu_connection->conn_conf.isc_iser == 0); + assert(conn->conn_conf.isc_iser == 0); pdu_set_data_segment_length(pdu, pdu->pdu_data_len); iov[0].iov_base = pdu->pdu_bhs; @@ -284,7 +288,7 @@ pdu_send(struct pdu *pdu) } } - ret = writev(pdu->pdu_connection->conn_socket, iov, iovcnt); + ret = writev(conn->conn_socket, iov, iovcnt); if (ret < 0) { if (timed_out()) log_errx(1, "exiting due to timeout"); From owner-svn-src-all@freebsd.org Fri Jan 20 17:16:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF00ECB9C04; Fri, 20 Jan 2017 17:16:49 +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 7228E1FBE; Fri, 20 Jan 2017 17:16:49 +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 v0KHGm8D039163; Fri, 20 Jan 2017 17:16:48 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHGmSF039161; Fri, 20 Jan 2017 17:16:48 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201701201716.v0KHGmSF039161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Fri, 20 Jan 2017 17:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312544 - in head/sys: dev/ixgbe net 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, 20 Jan 2017 17:16:49 -0000 Author: rstone Date: Fri Jan 20 17:16:48 2017 New Revision: 312544 URL: https://svnweb.freebsd.org/changeset/base/312544 Log: Fix reference to free memory in ixgbe/if_media.c When ixgbe receives an interrupt indicating that a new optical module may have been inserted, it discards all of its current media types by calling ifmedia_removeall() and then creates a new set of media types for the supported media on the new module. However, ifmedia_removeall() was maintaining a pointer to whatever the current media type was before the call to ifmedia_removealL(). The result of this was that any attempt to read the current media type of the interface (e.g. via ifconfig) would return potentially garbage data from free memory (or if one were particularly unlucky on an architecture that does not malloc() from a direct map, page fault the kernel). Fix this by NULL'ing out the current media field in if_media.c, and have ixgbe update the current media type after recreating them. Submitted by: Matt Joras Reviewed by: sbruno, erj MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9164 Modified: head/sys/dev/ixgbe/if_ix.c head/sys/net/if_media.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Fri Jan 20 17:14:10 2017 (r312543) +++ head/sys/dev/ixgbe/if_ix.c Fri Jan 20 17:16:48 2017 (r312544) @@ -3878,6 +3878,7 @@ ixgbe_handle_msf(void *context, int pend /* Adjust media types shown in ifconfig */ ifmedia_removeall(&adapter->media); ixgbe_add_media_types(adapter); + ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); IXGBE_CORE_UNLOCK(adapter); return; } Modified: head/sys/net/if_media.c ============================================================================== --- head/sys/net/if_media.c Fri Jan 20 17:14:10 2017 (r312543) +++ head/sys/net/if_media.c Fri Jan 20 17:16:48 2017 (r312544) @@ -107,6 +107,7 @@ ifmedia_removeall(ifm) LIST_REMOVE(entry, ifm_list); free(entry, M_IFADDR); } + ifm->ifm_cur = NULL; } /* From owner-svn-src-all@freebsd.org Fri Jan 20 17:30:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43E0ACB9FE6; Fri, 20 Jan 2017 17:30:01 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 130631891; Fri, 20 Jan 2017 17:30:01 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KHU0AS043466; Fri, 20 Jan 2017 17:30:00 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHU0dK043465; Fri, 20 Jan 2017 17:30:00 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201701201730.v0KHU0dK043465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 20 Jan 2017 17:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312547 - head/lib/libc/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, 20 Jan 2017 17:30:01 -0000 Author: wblock (doc committer) Date: Fri Jan 20 17:29:59 2017 New Revision: 312547 URL: https://svnweb.freebsd.org/changeset/base/312547 Log: Mention sendfile(2) by popular demand. Submitted by: alc, kib MFC after: 1 week Sponsored by: iXsystems Differential Revision: https://reviews.freebsd.org/D9259 Modified: head/lib/libc/sys/shm_open.2 Modified: head/lib/libc/sys/shm_open.2 ============================================================================== --- head/lib/libc/sys/shm_open.2 Fri Jan 20 17:28:52 2017 (r312546) +++ head/lib/libc/sys/shm_open.2 Fri Jan 20 17:29:59 2017 (r312547) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 13, 2017 +.Dd January 20, 2017 .Dt SHM_OPEN 2 .Os .Sh NAME @@ -187,6 +187,11 @@ kernel implementation explicitly include and .Xr write 2 . .Pp +.Fx +also supports zero-copy transmission of data from shared memory +objects with +.Xr sendfile 2 . +.Pp Neither shared memory objects nor their contents persist across reboots. .Pp Writes do not extend shared memory objects, so @@ -281,7 +286,8 @@ requires write permission to the shared .Xr fstat 2 , .Xr ftruncate 2 , .Xr mmap 2 , -.Xr munmap 2 +.Xr munmap 2 , +.Xr sendfile 2 .Sh STANDARDS The .Fn shm_open From owner-svn-src-all@freebsd.org Fri Jan 20 17:35:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAC20CB8327; Fri, 20 Jan 2017 17:35:32 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 99A7C100A; Fri, 20 Jan 2017 17:35:32 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KHZV9v047612; Fri, 20 Jan 2017 17:35:31 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHZVFe047611; Fri, 20 Jan 2017 17:35:31 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201701201735.v0KHZVFe047611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 20 Jan 2017 17:35:31 +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: r312548 - stable/11/usr.sbin/crunch/crunchgen 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, 20 Jan 2017 17:35:32 -0000 Author: wblock (doc committer) Date: Fri Jan 20 17:35:31 2017 New Revision: 312548 URL: https://svnweb.freebsd.org/changeset/base/312548 Log: MFC 311527: Show that the crunchgen configuration file name is not optional. Sponsored by: iXsystems Modified: stable/11/usr.sbin/crunch/crunchgen/crunchgen.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/crunch/crunchgen/crunchgen.1 ============================================================================== --- stable/11/usr.sbin/crunch/crunchgen/crunchgen.1 Fri Jan 20 17:29:59 2017 (r312547) +++ stable/11/usr.sbin/crunch/crunchgen/crunchgen.1 Fri Jan 20 17:35:31 2017 (r312548) @@ -24,7 +24,7 @@ .\" University of Maryland at College Park .\" $FreeBSD$ .\" -.Dd December 23, 2005 +.Dd January 6, 2017 .Dt CRUNCHGEN 1 .Os .Sh NAME @@ -39,7 +39,7 @@ .Op Fl p Ar obj-prefix .Op Fl c Ar c-file-name .Op Fl e Ar exec-file-name -.Op Ar conf-file +.Ar conf-file .Ek .Sh DESCRIPTION A crunched binary is a program made up of many other programs linked @@ -308,7 +308,7 @@ This is normally but some .Pa Makefile Ns s might like to use other conventions or -prepend the program's name to the variable, e.g.\& +prepend the program's name to the variable, e.g., .Va SSHD_OBJS . .It Ic special Ar progname Ic lib Ar library-name ... Specifies libraries to be linked with object files to produce From owner-svn-src-all@freebsd.org Fri Jan 20 17:38:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88118CB84D4; Fri, 20 Jan 2017 17:38:13 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A8D61285; Fri, 20 Jan 2017 17:38:13 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KHcCE3047772; Fri, 20 Jan 2017 17:38:12 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHcChh047771; Fri, 20 Jan 2017 17:38:12 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201701201738.v0KHcChh047771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 20 Jan 2017 17:38: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: r312549 - stable/11/lib/libc/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, 20 Jan 2017 17:38:13 -0000 Author: wblock (doc committer) Date: Fri Jan 20 17:38:12 2017 New Revision: 312549 URL: https://svnweb.freebsd.org/changeset/base/312549 Log: MFC 312083: Update the shm_open.2 man page to reflect objective reality. Sponsored by: iXsystems Modified: stable/11/lib/libc/sys/shm_open.2 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/shm_open.2 ============================================================================== --- stable/11/lib/libc/sys/shm_open.2 Fri Jan 20 17:35:31 2017 (r312548) +++ stable/11/lib/libc/sys/shm_open.2 Fri Jan 20 17:38:12 2017 (r312549) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2013 +.Dd January 13, 2017 .Dt SHM_OPEN 2 .Os .Sh NAME @@ -171,7 +171,8 @@ and .Dv O_TRUNC flags may be used in portable programs. .Pp -The result of using +.Tn POSIX +specifications state that the result of using .Xr open 2 , .Xr read 2 , or @@ -179,19 +180,43 @@ or on a shared memory object, or on the descriptor returned by .Fn shm_open , is undefined. -It is also undefined whether the shared memory object itself, or its -contents, persist across reboots. -.Pp -In FreeBSD, +However, the +.Fx +kernel implementation explicitly includes support for .Xr read 2 and -.Xr write 2 -on a shared memory object will fail with -.Er EOPNOTSUPP -and neither shared memory objects nor their contents persist across reboots. +.Xr write 2 . +.Pp +Neither shared memory objects nor their contents persist across reboots. +.Pp +Writes do not extend shared memory objects, so +.Xr ftruncate 2 +must be called before any data can be written. +See +.Sx EXAMPLES . +.Sh EXAMPLES +This example fails without the call to +.Xr ftruncate 2 : +.Bd -literal -compact + + uint8_t buffer[getpagesize()]; + ssize_t len; + int fd; + + fd = shm_open(SHM_ANON, O_RDWR | O_CREAT, 0600); + if (fd < 0) + err(EX_OSERR, "%s: shm_open", __func__); + if (ftruncate(fd, getpagesize()) < 0) + err(EX_IOERR, "%s: ftruncate", __func__); + len = pwrite(fd, buffer, getpagesize(), 0); + if (len < 0) + err(EX_IOERR, "%s: pwrite", __func__); + if (len != getpagesize()) + errx(EX_IOERR, "%s: pwrite length mismatch", __func__); +.Ed .Sh ERRORS -The following errors are defined for -.Fn shm_open : +.Fn shm_open +fails with these error codes for these conditions: .Bl -tag -width Er .It Bq Er EINVAL A flag other than @@ -235,8 +260,8 @@ are specified and the named shared memor The required permissions (for reading or reading and writing) are denied. .El .Pp -The following errors are defined for -.Fn shm_unlink : +.Fn shm_unlink +fails with these error codes for these conditions: .Bl -tag -width Er .It Bq Er EFAULT The From owner-svn-src-all@freebsd.org Fri Jan 20 17:39:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 338CECB8575; Fri, 20 Jan 2017 17:39:40 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02B94142A; Fri, 20 Jan 2017 17:39:39 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KHddhd047874; Fri, 20 Jan 2017 17:39:39 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHddqB047873; Fri, 20 Jan 2017 17:39:39 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201701201739.v0KHddqB047873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Fri, 20 Jan 2017 17:39: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: r312550 - stable/11/usr.bin/seq 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, 20 Jan 2017 17:39:40 -0000 Author: wblock (doc committer) Date: Fri Jan 20 17:39:38 2017 New Revision: 312550 URL: https://svnweb.freebsd.org/changeset/base/312550 Log: MFC 305887: Update history. Patch supplied by Sevan Janiyan . Sponsored by: iXsystems Modified: stable/11/usr.bin/seq/seq.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/seq/seq.1 ============================================================================== --- stable/11/usr.bin/seq/seq.1 Fri Jan 20 17:38:12 2017 (r312549) +++ stable/11/usr.bin/seq/seq.1 Fri Jan 20 17:39:38 2017 (r312550) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2013 +.Dd August 12, 2016 .Dt SEQ 1 .Os .Sh NAME @@ -156,13 +156,13 @@ the default conversion is changed to .Sh HISTORY The .Nm -command first appeared in -.Tn "Plan 9 from Bell Labs" . +command first appeared in Version\~8 +.At . A .Nm command appeared in .Nx 3.0 , -and ported to +and was ported to .Fx 9.0 . This command was based on the command of the same name in .Tn "Plan 9 from Bell Labs" @@ -180,9 +180,4 @@ option does not handle the transition fr to exponent representation very well. The .Nm -command is not bug for bug compatible with the -.Tn "Plan 9 from Bell Labs" -or -.Tn GNU -versions of -.Nm . +command is not bug for bug compatible with other implementations. From owner-svn-src-all@freebsd.org Fri Jan 20 17:40:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BEEACB8608; Fri, 20 Jan 2017 17:40:32 +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 3CC8A15DB; Fri, 20 Jan 2017 17:40:32 +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 v0KHeV8a047969; Fri, 20 Jan 2017 17:40:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHeVNT047968; Fri, 20 Jan 2017 17:40:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201701201740.v0KHeVNT047968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 20 Jan 2017 17:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312551 - 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, 20 Jan 2017 17:40:32 -0000 Author: hselasky Date: Fri Jan 20 17:40:31 2017 New Revision: 312551 URL: https://svnweb.freebsd.org/changeset/base/312551 Log: Fix for race leading to endless timer interrupts related to configtimer(). During normal operation "state->nextcallopt" will always be less than or equal to "state->nextcall" and checking only "state->nextcallopt" before calling "callout_process()" is sufficient. However when "configtimer()" is called a race might happen requiring both of these binary times to be checked. Short description of race: 1) A configtimer() call will reset both "state->nextcall" and "state->nextcallopt" to the same binary time. 2) If a "callout_reset()" call happens between "configtimer()" and the next "callout_process()" call, "state->nextcallopt" will get updated and "state->nextcall" will remain at the current time. Refer to logic inside cpu_new_callout(). 3) getnextcpuevent() only respects "state->nextcall" and returns this value over and over again, even if it is in the past, until "now >= state->nextcallopt" becomes true. Then these two time variables are corrected by a "callout_process()" call and the situation goes back to normal. The problem manifests itself in different ways. The common factor is the timer process(es) consume all CPU on one or more CPU cores for a long time, blocking other kernel processes from getting execution time. This can be seen by very high interrupt counts as displayed by "vmstat -i | grep timer" right after boot. When EARLY_AP_STARTUP was enabled in r310177 the likelyhood of hitting this bug apparently increased. Example output from "vmstat -i" before patch: cpu0:timer 7591 69 cpu9:timer 39031773 358089 cpu4:timer 9359 85 cpu3:timer 9100 83 cpu2:timer 9620 88 Example output from "vmstat -i" after patch: cpu0:timer 4242 34 cpu6:timer 5531 44 cpu3:timer 6450 52 cpu1:timer 4545 36 cpu9:timer 7153 58 Before the patch cpu9 in the example above, was spinning in a loop in order to reach 39 million interrupts just a few seconds after bootup. After the patch the timer interrupt counts are more or less consistent. Discussed with: mav @ Reported by: several people MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/kern_clocksource.c Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Fri Jan 20 17:39:38 2017 (r312550) +++ head/sys/kern/kern_clocksource.c Fri Jan 20 17:40:31 2017 (r312551) @@ -207,7 +207,7 @@ handleevents(sbintime_t now, int fake) } } else state->nextprof = state->nextstat; - if (now >= state->nextcallopt) { + if (now >= state->nextcallopt || now >= state->nextcall) { state->nextcall = state->nextcallopt = SBT_MAX; callout_process(now); } From owner-svn-src-all@freebsd.org Fri Jan 20 17:43:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBFEFCB8878; Fri, 20 Jan 2017 17:43: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 8B3701B60; Fri, 20 Jan 2017 17:43: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 v0KHhatX051789; Fri, 20 Jan 2017 17:43:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHhaVv051788; Fri, 20 Jan 2017 17:43:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701201743.v0KHhaVv051788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 Jan 2017 17:43:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312552 - 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: Fri, 20 Jan 2017 17:43:37 -0000 Author: mav Date: Fri Jan 20 17:43:36 2017 New Revision: 312552 URL: https://svnweb.freebsd.org/changeset/base/312552 Log: Fix build with ICL_KERNEL_PROXY. MFC after: 2 weeks Modified: head/usr.sbin/ctld/pdu.c Modified: head/usr.sbin/ctld/pdu.c ============================================================================== --- head/usr.sbin/ctld/pdu.c Fri Jan 20 17:40:31 2017 (r312551) +++ head/usr.sbin/ctld/pdu.c Fri Jan 20 17:43:36 2017 (r312552) @@ -106,9 +106,11 @@ pdu_new_response(struct pdu *request) static void pdu_receive_proxy(struct pdu *pdu) { + struct connection *conn; size_t len; assert(proxy_mode); + conn = pdu->pdu_connection; kernel_receive(pdu); @@ -117,7 +119,7 @@ pdu_receive_proxy(struct pdu *pdu) log_errx(1, "protocol error: non-empty AHS"); len = pdu_data_segment_length(pdu); - assert(len <= pdu->pdu_connection->conn_max_recv_data_segment_length); + assert(len <= (size_t)conn->conn_max_recv_data_segment_length); pdu->pdu_data_len = len; } @@ -185,7 +187,7 @@ pdu_receive(struct pdu *pdu) len = pdu_data_segment_length(pdu); if (len > 0) { - if ((int)len > conn->conn_max_recv_data_segment_length) { + if (len > (size_t)conn->conn_max_recv_data_segment_length) { log_errx(1, "protocol error: received PDU " "with DataSegmentLength exceeding %d", conn->conn_max_recv_data_segment_length); From owner-svn-src-all@freebsd.org Fri Jan 20 17:54:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C335BCB8D42; Fri, 20 Jan 2017 17:54:25 +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 92B9C12F8; Fri, 20 Jan 2017 17:54:25 +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 v0KHsO23056082; Fri, 20 Jan 2017 17:54:24 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KHsORL056081; Fri, 20 Jan 2017 17:54:24 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701201754.v0KHsORL056081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 20 Jan 2017 17:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312553 - 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: Fri, 20 Jan 2017 17:54:25 -0000 Author: asomers Date: Fri Jan 20 17:54:24 2017 New Revision: 312553 URL: https://svnweb.freebsd.org/changeset/base/312553 Log: Fix "camcontrol timestamp -s" with LTO-7 drives The length of the scsi_set_timestamp_parameters struct was incorrect. LTO-5 drives don't care, but LTO-7 drives do. Reviewed by: Sam Klopsch MFC after: 2 weeks Sponsored by: Spectra Logic Corp Modified: head/sys/cam/scsi/scsi_all.h Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Fri Jan 20 17:43:36 2017 (r312552) +++ head/sys/cam/scsi/scsi_all.h Fri Jan 20 17:54:24 2017 (r312553) @@ -3039,7 +3039,7 @@ struct scsi_set_timestamp_parameters { uint8_t reserved1[4]; uint8_t timestamp[6]; - uint8_t reserved2[4]; + uint8_t reserved2[2]; }; struct scsi_report_timestamp_parameter_data From owner-svn-src-all@freebsd.org Fri Jan 20 18:37:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4603ECB9275; Fri, 20 Jan 2017 18:37:16 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1583B1F24; Fri, 20 Jan 2017 18:37:16 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0KIbFnl072660; Fri, 20 Jan 2017 18:37:15 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KIbFuC072659; Fri, 20 Jan 2017 18:37:15 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201701201837.v0KIbFuC072659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Fri, 20 Jan 2017 18:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312554 - head/lib/libc/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, 20 Jan 2017 18:37:16 -0000 Author: sobomax Date: Fri Jan 20 18:37:14 2017 New Revision: 312554 URL: https://svnweb.freebsd.org/changeset/base/312554 Log: Improve wording around SO_TS_CLOCK documentation. Submitted by: wblock Differential Revision: https://reviews.freebsd.org/D9171 Modified: head/lib/libc/sys/getsockopt.2 Modified: head/lib/libc/sys/getsockopt.2 ============================================================================== --- head/lib/libc/sys/getsockopt.2 Fri Jan 20 17:54:24 2017 (r312553) +++ head/lib/libc/sys/getsockopt.2 Fri Jan 20 18:37:14 2017 (r312554) @@ -456,10 +456,10 @@ Additional timestamp types are available .Dv SO_TIMESTAMP with .Dv SO_TS_CLOCK , -which requests specific timestamp format to be returned instead of +which requests a specific timestamp format to be returned instead of .Dv SCM_TIMESTAMP when .Dv SO_TIMESTAMP is enabled. -The following +These .Dv SO_TS_CLOCK values are recognized in .Fx : From owner-svn-src-all@freebsd.org Fri Jan 20 19:08:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F070CB9D3F; Fri, 20 Jan 2017 19:08:46 +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 40BB510AA; Fri, 20 Jan 2017 19:08:46 +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 v0KJ8jqk084708; Fri, 20 Jan 2017 19:08:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KJ8jms084704; Fri, 20 Jan 2017 19:08:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701201908.v0KJ8jms084704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 20 Jan 2017 19:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312555 - in head/sys: amd64/amd64 amd64/include i386/i386 i386/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: Fri, 20 Jan 2017 19:08:46 -0000 Author: kib Date: Fri Jan 20 19:08:44 2017 New Revision: 312555 URL: https://svnweb.freebsd.org/changeset/base/312555 Log: Use SFENCE for ordering CLFLUSHOPT. SDM states that CLFLUSHOPT instructions can be ordered with other writes by SFENCE, heavier MFENCE is not required. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/include/cpufunc.h head/sys/i386/i386/pmap.c head/sys/i386/include/cpufunc.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Jan 20 18:37:14 2017 (r312554) +++ head/sys/amd64/amd64/pmap.c Fri Jan 20 19:08:44 2017 (r312555) @@ -1862,16 +1862,16 @@ pmap_invalidate_cache_range(vm_offset_t return; /* - * Otherwise, do per-cache line flush. Use the mfence + * Otherwise, do per-cache line flush. Use the sfence * instruction to insure that previous stores are * included in the write-back. The processor * propagates flush to other processors in the cache * coherence domain. */ - mfence(); + sfence(); for (; sva < eva; sva += cpu_clflush_line_size) clflushopt(sva); - mfence(); + sfence(); } else if ((cpu_feature & CPUID_CLFSH) != 0 && eva - sva < PMAP_CLFLUSH_THRESHOLD) { if (pmap_kextract(sva) == lapic_paddr) @@ -1915,7 +1915,9 @@ pmap_invalidate_cache_pages(vm_page_t *p ((cpu_feature & CPUID_CLFSH) == 0 && !useclflushopt)) pmap_invalidate_cache(); else { - if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL) + if (useclflushopt) + sfence(); + else if (cpu_vendor_id != CPU_VENDOR_INTEL) mfence(); for (i = 0; i < count; i++) { daddr = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pages[i])); @@ -1927,7 +1929,9 @@ pmap_invalidate_cache_pages(vm_page_t *p clflush(daddr); } } - if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL) + if (useclflushopt) + sfence(); + else if (cpu_vendor_id != CPU_VENDOR_INTEL) mfence(); } } Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Fri Jan 20 18:37:14 2017 (r312554) +++ head/sys/amd64/include/cpufunc.h Fri Jan 20 19:08:44 2017 (r312555) @@ -327,6 +327,13 @@ mfence(void) } static __inline void +sfence(void) +{ + + __asm __volatile("sfence" : : : "memory"); +} + +static __inline void ia32_pause(void) { __asm __volatile("pause"); Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Fri Jan 20 18:37:14 2017 (r312554) +++ head/sys/i386/i386/pmap.c Fri Jan 20 19:08:44 2017 (r312555) @@ -1283,16 +1283,16 @@ pmap_invalidate_cache_range(vm_offset_t return; #endif /* - * Otherwise, do per-cache line flush. Use the mfence + * Otherwise, do per-cache line flush. Use the sfence * instruction to insure that previous stores are * included in the write-back. The processor * propagates flush to other processors in the cache * coherence domain. */ - mfence(); + sfence(); for (; sva < eva; sva += cpu_clflush_line_size) clflushopt(sva); - mfence(); + sfence(); } else if ((cpu_feature & CPUID_CLFSH) != 0 && eva - sva < PMAP_CLFLUSH_THRESHOLD) { #ifdef DEV_APIC @@ -5300,12 +5300,14 @@ pmap_flush_page(vm_page_t m) eva = sva + PAGE_SIZE; /* - * Use mfence despite the ordering implied by + * Use mfence or sfence despite the ordering implied by * mtx_{un,}lock() because clflush on non-Intel CPUs * and clflushopt are not guaranteed to be ordered by * any other instruction. */ - if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL) + if (useclflushopt) + sfence(); + else if (cpu_vendor_id != CPU_VENDOR_INTEL) mfence(); for (; sva < eva; sva += cpu_clflush_line_size) { if (useclflushopt) @@ -5313,7 +5315,9 @@ pmap_flush_page(vm_page_t m) else clflush(sva); } - if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL) + if (useclflushopt) + sfence(); + else if (cpu_vendor_id != CPU_VENDOR_INTEL) mfence(); *cmap_pte2 = 0; sched_unpin(); Modified: head/sys/i386/include/cpufunc.h ============================================================================== --- head/sys/i386/include/cpufunc.h Fri Jan 20 18:37:14 2017 (r312554) +++ head/sys/i386/include/cpufunc.h Fri Jan 20 19:08:44 2017 (r312555) @@ -158,6 +158,13 @@ mfence(void) __asm __volatile("mfence" : : : "memory"); } +static __inline void +sfence(void) +{ + + __asm __volatile("sfence" : : : "memory"); +} + #ifdef _KERNEL #define HAVE_INLINE_FFS From owner-svn-src-all@freebsd.org Fri Jan 20 21:10:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3D51CB9C63; Fri, 20 Jan 2017 21:10:39 +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 908D11505; Fri, 20 Jan 2017 21:10:39 +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 v0KLAcrF041211; Fri, 20 Jan 2017 21:10:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KLAbAL041198; Fri, 20 Jan 2017 21:10:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701202110.v0KLAbAL041198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 21:10: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: r312556 - in stable/11/sys/boot: arm/uboot common efi/loader i386/loader mips/beri/loader mips/uboot pc98/loader powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userb... 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, 20 Jan 2017 21:10:39 -0000 Author: emaste Date: Fri Jan 20 21:10:37 2017 New Revision: 312556 URL: https://svnweb.freebsd.org/changeset/base/312556 Log: MFC r310267: Deduplicate loader vers.c Makefile rules The Makefile rule to create vers.c for loader version info was previously duplicated in each of the various loader Makefiles. Instead, share a common rule in Makefile.inc. Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/boot/arm/uboot/Makefile stable/11/sys/boot/common/Makefile.inc stable/11/sys/boot/efi/loader/Makefile stable/11/sys/boot/i386/loader/Makefile stable/11/sys/boot/mips/beri/loader/Makefile stable/11/sys/boot/mips/uboot/Makefile stable/11/sys/boot/pc98/loader/Makefile stable/11/sys/boot/powerpc/kboot/Makefile stable/11/sys/boot/powerpc/ofw/Makefile stable/11/sys/boot/powerpc/ps3/Makefile stable/11/sys/boot/powerpc/uboot/Makefile stable/11/sys/boot/sparc64/loader/Makefile stable/11/sys/boot/userboot/userboot/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/11/sys/boot/arm/uboot/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/arm/uboot/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -90,7 +90,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float @@ -117,9 +117,6 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/common/Makefile.inc ============================================================================== --- stable/11/sys/boot/common/Makefile.inc Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/common/Makefile.inc Fri Jan 20 21:10:37 2017 (r312556) @@ -70,3 +70,8 @@ CFLAGS+= -DBOOT_PROMPT_123 SRCS+= install.c CFLAGS+=-I${.CURDIR}/../../../../lib/libstand .endif + +CLEANFILES+= vers.c +VERSION_FILE?= ${.CURDIR}/version +vers.c: ${SRCTOP}/sys/boot/common/newvers.sh ${VERSION_FILE} + sh ${SRCTOP}/sys/boot/common/newvers.sh ${VERSION_FILE} ${NEWVERSWHAT} Modified: stable/11/sys/boot/efi/loader/Makefile ============================================================================== --- stable/11/sys/boot/efi/loader/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/efi/loader/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -110,13 +110,10 @@ FILESMODE_loader.efi= ${BINMODE} LDSCRIPT= ${.CURDIR}/arch/${MACHINE}/ldscript.${MACHINE} LDFLAGS+= -Wl,-T${LDSCRIPT} -Wl,-Bsymbolic -shared -CLEANFILES+= vers.c loader.efi +CLEANFILES+= loader.efi NEWVERSWHAT= "EFI loader" ${MACHINE} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../efi/loader/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - NM?= nm OBJCOPY?= objcopy Modified: stable/11/sys/boot/i386/loader/Makefile ============================================================================== --- stable/11/sys/boot/i386/loader/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/i386/loader/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -8,6 +8,7 @@ PROG= ${LOADER}.sym MAN= INTERNALPROG= NEWVERSWHAT?= "bootstrap loader" x86 +VERSION_FILE= ${.CURDIR}/../loader/version # architecture-specific loader code SRCS= main.c conf.c vers.c @@ -72,7 +73,7 @@ CFLAGS+= -I${.CURDIR}/../../.. -D_STAND CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES= vers.c ${LOADER} ${LOADER}.bin loader.help +CLEANFILES= ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall LDFLAGS= -static -Ttext 0x0 @@ -93,10 +94,6 @@ CFLAGS+= -I${.CURDIR}/../btx/lib # Pick up ../Makefile.inc early. .include -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ - ${NEWVERSWHAT} - ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ -b ${BTXKERN} ${LOADER}.bin Modified: stable/11/sys/boot/mips/beri/loader/Makefile ============================================================================== --- stable/11/sys/boot/mips/beri/loader/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/mips/beri/loader/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -92,7 +92,7 @@ CFLAGS+= -I${.CURDIR}/../common # Loader-specific MD headers CFLAGS+= -I${.CURDIR} -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help # Generate code appropriate for the loader environment CFLAGS+= -G0 \ @@ -114,10 +114,6 @@ LIBSTAND= ${.OBJDIR}/../../../../../lib/ DPADD= ${LIBFICL} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBSTAND} -vers.c: ${.CURDIR}/../../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../../common/newvers.sh ${.CURDIR}/version \ - ${NEWVERSWHAT} - loader.help: help.common help.mips cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/mips/uboot/Makefile ============================================================================== --- stable/11/sys/boot/mips/uboot/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/mips/uboot/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -99,7 +99,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float -g @@ -128,9 +128,6 @@ LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/pc98/loader/Makefile ============================================================================== --- stable/11/sys/boot/pc98/loader/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/pc98/loader/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -8,6 +8,7 @@ LOADER?= loader PROG= ${LOADER}.sym INTERNALPROG= NEWVERSWHAT= "bootstrap loader" pc98 +VERSION_FILE= ${.CURDIR}/../../i386/loader/version # architecture-specific loader code SRCS= main.c conf.c vers.c @@ -48,7 +49,7 @@ CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../i386 CFLAGS+= -I. -CLEANFILES= vers.c ${LOADER} ${LOADER}.bin loader.help +CLEANFILES= ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall LDFLAGS= -static -Ttext 0x0 @@ -69,9 +70,6 @@ CFLAGS+= -I${.CURDIR}/../btx/lib # Pick up ../Makefile.inc early. .include -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT} - ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ -b ${BTXKERN} ${LOADER}.bin Modified: stable/11/sys/boot/powerpc/kboot/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/kboot/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/powerpc/kboot/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -76,7 +76,7 @@ CFLAGS+= -mcpu=powerpc64 CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script @@ -99,9 +99,6 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.kboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/powerpc/ofw/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/ofw/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/powerpc/ofw/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -73,7 +73,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help CFLAGS+= -ffreestanding -msoft-float # load address. set in linker script @@ -97,9 +97,6 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.ofw ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/powerpc/ps3/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/ps3/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/powerpc/ps3/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -76,7 +76,7 @@ CFLAGS+= -mcpu=powerpc64 CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM # load address. set in linker script @@ -101,9 +101,6 @@ SC_DFLT_FONT=cp437 font.h: uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x16.fnt && file2c 'u_char dflt_font_16[16*256] = {' '};' < ${SC_DFLT_FONT}-8x16 > font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x14.fnt && file2c 'u_char dflt_font_14[14*256] = {' '};' < ${SC_DFLT_FONT}-8x14 >> font.h && uudecode < /usr/share/syscons/fonts/${SC_DFLT_FONT}-8x8.fnt && file2c 'u_char dflt_font_8[8*256] = {' '};' < ${SC_DFLT_FONT}-8x8 >> font.h -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.ps3 ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/powerpc/uboot/Makefile ============================================================================== --- stable/11/sys/boot/powerpc/uboot/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/powerpc/uboot/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -79,7 +79,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. CFLAGS+= -I. -CLEANFILES+= vers.c ${PROG}.help +CLEANFILES+= ${PROG}.help CFLAGS+= -ffreestanding @@ -102,9 +102,6 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/sparc64/loader/Makefile ============================================================================== --- stable/11/sys/boot/sparc64/loader/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/sparc64/loader/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -6,6 +6,7 @@ MAN= PROG?= loader NEWVERSWHAT?= "bootstrap loader" sparc64 +VERSION_FILE= ${.CURDIR}/../loader/version INSTALLFLAGS= -b # Architecture-specific loader code @@ -70,7 +71,7 @@ LIBFICL= ${.OBJDIR}/../../ficl/libficl.a CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -CLEANFILES+= vers.c loader.help +CLEANFILES+= loader.help LDFLAGS= -static @@ -84,10 +85,6 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../loader/version \ - ${NEWVERSWHAT} - loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} Modified: stable/11/sys/boot/userboot/userboot/Makefile ============================================================================== --- stable/11/sys/boot/userboot/userboot/Makefile Fri Jan 20 19:08:44 2017 (r312555) +++ stable/11/sys/boot/userboot/userboot/Makefile Fri Jan 20 21:10:37 2017 (r312556) @@ -39,11 +39,6 @@ LDFLAGS+= -nostdlib -Wl,-Bsymbolic NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} -vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version - sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} - -CLEANFILES= vers.c - .if ${MK_FORTH} != "no" BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 From owner-svn-src-all@freebsd.org Fri Jan 20 21:15:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12D1CCBA05C; Fri, 20 Jan 2017 21:15:24 +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 D3B171BFC; Fri, 20 Jan 2017 21:15:23 +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 v0KLFMTk045180; Fri, 20 Jan 2017 21:15:22 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KLFMEQ045179; Fri, 20 Jan 2017 21:15:22 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201701202115.v0KLFMEQ045179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 20 Jan 2017 21:15: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: r312557 - stable/11/sys/crypto/skein/amd64 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, 20 Jan 2017 21:15:24 -0000 Author: emaste Date: Fri Jan 20 21:15:22 2017 New Revision: 312557 URL: https://svnweb.freebsd.org/changeset/base/312557 Log: MFC r311655: libmd: add noexec stack annotation in skein_block_asm.s Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/crypto/skein/amd64/skein_block_asm.s (contents, props changed) Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/crypto/skein/amd64/skein_block_asm.s ============================================================================== --- stable/11/sys/crypto/skein/amd64/skein_block_asm.s Fri Jan 20 21:10:37 2017 (r312556) +++ stable/11/sys/crypto/skein/amd64/skein_block_asm.s Fri Jan 20 21:15:22 2017 (r312557) @@ -1325,4 +1325,6 @@ _SP_OFFS_ = _SP_OFFS_-8 ret .endif #---------------------------------------------------------------- + .section .note.GNU-stack,"",@progbits + .end From owner-svn-src-all@freebsd.org Fri Jan 20 21:21:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96102CBA32E; Fri, 20 Jan 2017 21:21:43 +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 56FD3115F; Fri, 20 Jan 2017 21:21:43 +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 v0KLLgRx046867; Fri, 20 Jan 2017 21:21:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KLLgm0046863; Fri, 20 Jan 2017 21:21:42 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701202121.v0KLLgm0046863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 20 Jan 2017 21:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312558 - 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: Fri, 20 Jan 2017 21:21:43 -0000 Author: asomers Date: Fri Jan 20 21:21:41 2017 New Revision: 312558 URL: https://svnweb.freebsd.org/changeset/base/312558 Log: Misc Coverity fixes in camcontrol(8) CID 1229913 Fix output of "camcontrol persist -i report_capabilities". The reported Persistent Reservation Types were wrong in all cases. CID 1356029 Annotate the code so Coverity will know that this is a false positive. CID 1366830 Fix a memory leak in "camcontrol timestamp -s" CID 1366832 Fix a segfault that could be caused by bad drive firmware Also, fix the man page entry for the "camcontrol epc state" command to match what the code does. Reviewed by: ken, wblock MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9239 Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/epc.c head/sbin/camcontrol/persist.c head/sbin/camcontrol/timestamp.c Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Fri Jan 20 21:15:22 2017 (r312557) +++ head/sbin/camcontrol/camcontrol.8 Fri Jan 20 21:21:41 2017 (r312558) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2017 +.Dd January 20, 2017 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -2374,6 +2374,20 @@ this power condition will be affected. .It state Enable or disable a particular power condition. .Bl -tag -width 7n +.It Fl e +Enable the power condition. +One of +.Fl e +or +.Fl d +is required. +.It Fl d +Disable the power condition. +One of +.Fl d +or +.Fl e +is required. .It Fl p Ar cond Specify the power condition: Idle_a, Idle_b, Idle_c, Standby_y, Standby_z. This argument is required. Modified: head/sbin/camcontrol/epc.c ============================================================================== --- head/sbin/camcontrol/epc.c Fri Jan 20 21:15:22 2017 (r312557) +++ head/sbin/camcontrol/epc.c Fri Jan 20 21:21:41 2017 (r312558) @@ -783,6 +783,7 @@ epc(struct cam_device *device, int argc, warnx("Must specify a timer value (-T time)"); error = 1; } + /* FALLTHROUGH */ case ATA_SF_EPC_SET_STATE: if (enable == -1) { warnx("Must specify enable (-e) or disable (-d)"); Modified: head/sbin/camcontrol/persist.c ============================================================================== --- head/sbin/camcontrol/persist.c Fri Jan 20 21:15:22 2017 (r312557) +++ head/sbin/camcontrol/persist.c Fri Jan 20 21:21:41 2017 (r312558) @@ -241,9 +241,11 @@ persist_print_cap(struct scsi_per_res_ca { uint32_t length; int check_type_mask = 0; + uint32_t type_mask; length = scsi_2btoul(cap->length); length = MIN(length, valid_len); + type_mask = scsi_2btoul(cap->type_mask); if (length < __offsetof(struct scsi_per_res_cap, type_mask)) { fprintf(stdout, "Insufficient data (%u bytes) to report " @@ -345,20 +347,20 @@ persist_print_cap(struct scsi_per_res_ca fprintf(stdout, "Supported Persistent Reservation Types:\n"); fprintf(stdout, " Write Exclusive - All Registrants " "(WR_EX_AR): %d\n", - (cap->type_mask[0] & SPRI_TM_WR_EX_AR)? 1 : 0); + (type_mask & SPRI_TM_WR_EX_AR)? 1 : 0); fprintf(stdout, " Exclusive Access - Registrants Only " "(EX_AC_RO): %d\n", - (cap->type_mask[0] & SPRI_TM_EX_AC_RO) ? 1 : 0); + (type_mask & SPRI_TM_EX_AC_RO) ? 1 : 0); fprintf(stdout, " Write Exclusive - Registrants Only " "(WR_EX_RO): %d\n", - (cap->type_mask[0] & SPRI_TM_WR_EX_RO)? 1 : 0); + (type_mask & SPRI_TM_WR_EX_RO)? 1 : 0); fprintf(stdout, " Exclusive Access (EX_AC): %d\n", - (cap->type_mask[0] & SPRI_TM_EX_AC) ? 1 : 0); + (type_mask & SPRI_TM_EX_AC) ? 1 : 0); fprintf(stdout, " Write Exclusive (WR_EX): %d\n", - (cap->type_mask[0] & SPRI_TM_WR_EX) ? 1 : 0); + (type_mask & SPRI_TM_WR_EX) ? 1 : 0); fprintf(stdout, " Exclusive Access - All Registrants " "(EX_AC_AR): %d\n", - (cap->type_mask[1] & SPRI_TM_EX_AC_AR) ? 1 : 0); + (type_mask & SPRI_TM_EX_AC_AR) ? 1 : 0); } else { fprintf(stdout, "Persistent Reservation Type Mask is NOT " "valid\n"); Modified: head/sbin/camcontrol/timestamp.c ============================================================================== --- head/sbin/camcontrol/timestamp.c Fri Jan 20 21:15:22 2017 (r312557) +++ head/sbin/camcontrol/timestamp.c Fri Jan 20 21:21:41 2017 (r312558) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -138,6 +139,8 @@ set_restore_flags(struct cam_device *dev * Create the control page at the correct point in the mode_buf, it * starts after the header and the blk description. */ + assert(hdr_and_blk_length <= + sizeof(mode_buf) - sizeof(struct scsi_control_ext_page)); control_page = (struct scsi_control_ext_page *)&mode_buf [hdr_and_blk_length]; if (set_flag != 0) { @@ -240,6 +243,7 @@ report_timestamp(struct cam_device *devi bailout: if (ccb != NULL) cam_freeccb(ccb); + free(report_buf); return error; } From owner-svn-src-all@freebsd.org Fri Jan 20 21:40:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1944CBA8A1; Fri, 20 Jan 2017 21:40:05 +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 AC5981A40; Fri, 20 Jan 2017 21:40:05 +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 v0KLe4i8053253; Fri, 20 Jan 2017 21:40:04 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KLe4aK053252; Fri, 20 Jan 2017 21:40:04 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201701202140.v0KLe4aK053252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 20 Jan 2017 21:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312559 - head/usr.sbin/camdd 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, 20 Jan 2017 21:40:05 -0000 Author: asomers Date: Fri Jan 20 21:40:04 2017 New Revision: 312559 URL: https://svnweb.freebsd.org/changeset/base/312559 Log: Fix misc Coverity defects in camdd(8) CID 1341620 Fix a small memory leak CID 1341630 Though this is technically a false positive, rearrange the code for clarity. CID 1341635 Eliminate dead code CID 1368663 Fix a double mutex unlock in the error path Also: * Use sig_atomic_t for variables accessed from signal handlers * Don't conditionalize free(3) on its argument being non-null Reported by: Coverity CID: 1341620 1341630 1341635 1368663 Reviewed by: ken MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9237 Modified: head/usr.sbin/camdd/camdd.c Modified: head/usr.sbin/camdd/camdd.c ============================================================================== --- head/usr.sbin/camdd/camdd.c Fri Jan 20 21:21:41 2017 (r312558) +++ head/usr.sbin/camdd/camdd.c Fri Jan 20 21:40:04 2017 (r312559) @@ -420,9 +420,9 @@ struct camdd_dev { }; static sem_t camdd_sem; -static int need_exit = 0; -static int error_exit = 0; -static int need_status = 0; +static sig_atomic_t need_exit = 0; +static sig_atomic_t error_exit = 0; +static sig_atomic_t need_status = 0; #ifndef min #define min(a, b) (a < b) ? a : b @@ -712,11 +712,7 @@ camdd_alloc_buf(struct camdd_dev *dev, c return (buf); bailout_error: - if (data_ptr != NULL) - free(data_ptr); - - if (buf != NULL) - free(buf); + free(data_ptr); return (NULL); } @@ -2262,6 +2258,7 @@ camdd_file_run(struct camdd_dev *dev) if (file_dev->tmp_buf == NULL) { buf->status = CAMDD_STATUS_ERROR; error_count++; + pthread_mutex_lock(&dev->mutex); goto bailout; } for (i = 0, cur_offset = 0; i < data->sg_count; i++) { @@ -2984,7 +2981,6 @@ int camdd_rw(struct camdd_io_opts *io_opts, int num_io_opts, uint64_t max_io, int retry_count, int timeout) { - char *device = NULL; struct cam_device *new_cam_dev = NULL; struct camdd_dev *devs[2]; struct timespec start_time; @@ -3004,12 +3000,11 @@ camdd_rw(struct camdd_io_opts *io_opts, for (i = 0; i < num_io_opts; i++) { switch (io_opts[i].dev_type) { case CAMDD_DEV_PASS: { - camdd_argmask new_arglist = CAMDD_ARG_NONE; - int bus = 0, target = 0, lun = 0; - char name[30]; - int rv; - if (isdigit(io_opts[i].dev_name[0])) { + camdd_argmask new_arglist = CAMDD_ARG_NONE; + int bus = 0, target = 0, lun = 0; + int rv; + /* device specified as bus:target[:lun] */ rv = parse_btl(io_opts[i].dev_name, &bus, &target, &lun, &new_arglist); @@ -3025,23 +3020,21 @@ camdd_rw(struct camdd_io_opts *io_opts, lun = 0; new_arglist |= CAMDD_ARG_LUN; } + new_cam_dev = cam_open_btl(bus, target, lun, + O_RDWR, NULL); } else { + char name[30]; + if (cam_get_device(io_opts[i].dev_name, name, sizeof name, &unit) == -1) { warnx("%s", cam_errbuf); error = 1; goto bailout; } - device = strdup(name); - new_arglist |= CAMDD_ARG_DEVICE |CAMDD_ARG_UNIT; + new_cam_dev = cam_open_spec_device(name, unit, + O_RDWR, NULL); } - if (new_arglist & (CAMDD_ARG_BUS | CAMDD_ARG_TARGET)) - new_cam_dev = cam_open_btl(bus, target, lun, - O_RDWR, NULL); - else - new_cam_dev = cam_open_spec_device(device, unit, - O_RDWR, NULL); if (new_cam_dev == NULL) { warnx("%s", cam_errbuf); error = 1; From owner-svn-src-all@freebsd.org Fri Jan 20 22:41:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C444ACB9DD0; Fri, 20 Jan 2017 22:41:17 +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 93EE91E12; Fri, 20 Jan 2017 22:41:17 +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 v0KMfGwY078906; Fri, 20 Jan 2017 22:41:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0KMfGSm078905; Fri, 20 Jan 2017 22:41:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701202241.v0KMfGSm078905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 20 Jan 2017 22:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312560 - head/sbin/ifconfig 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, 20 Jan 2017 22:41:17 -0000 Author: avos Date: Fri Jan 20 22:41:16 2017 New Revision: 312560 URL: https://svnweb.freebsd.org/changeset/base/312560 Log: ifconfig(8): fix '-stbc' parameter name. MFC after: 5 days Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Fri Jan 20 21:40:04 2017 (r312559) +++ head/sbin/ifconfig/ifieee80211.c Fri Jan 20 22:41:16 2017 (r312560) @@ -5602,7 +5602,7 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("stbctx", 1, set80211stbc), DEF_CMD("-stbctx", -1, set80211stbc), DEF_CMD("stbc", 3, set80211stbc), /* NB: tx+rx */ - DEF_CMD("-ampdu", -3, set80211stbc), + DEF_CMD("-stbc", -3, set80211stbc), DEF_CMD("puren", 1, set80211puren), DEF_CMD("-puren", 0, set80211puren), DEF_CMD("doth", 1, set80211doth), From owner-svn-src-all@freebsd.org Fri Jan 20 23:03:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB57CBA1F6; Fri, 20 Jan 2017 23:03:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::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 5652318A7; Fri, 20 Jan 2017 23:03:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id r144so66651904wme.1; Fri, 20 Jan 2017 15:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=OGuLehhYy85RboQ2AgoR3aGChMynbGWo/YJuXVp1w68=; b=sWq8ptuFTFa5dhBpmRsV8GgDoPcO+0B9W41oMkCPc9pWx8FLdQsDx2dB/HTC7oUTeE pfDm8PLm2KZsrUc5jcE1jnoi9cQXMI+C7ULw4Fge4Bs/Tw6QCc6boLuAE85reUdQVY5H Wlakeik8I9bUonAqaH3Gc+tTJOQ1Atdo9Jna6YOsh/hS4TaxiRgknBCuOYogRJVGMekF TyjON87y8LvvlIDyVGuRXSr8mR+jB1k9BVFDK7lQZvDlF+6OD390cJWTKTbnPx/FQv76 uQrwCOECqaW+RsJxk3DVacy1UHz9HKiSjUgCFNEZUXYTALdilBUqUbl2XlpkbSK311ox cyRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=OGuLehhYy85RboQ2AgoR3aGChMynbGWo/YJuXVp1w68=; b=odbsl2dGr3DKpk70SucYedzWmM0vDe7eKMbPVujYFMAM+BM1uymrkBviSatJ9nHSET NFcBahDCPklMw4xz31hfqcA7vM3Xd9wL4qyz94EGxX9mgrHxVfCYLZFWhktthwHOsG8R vnrBynGwXR87LYJ7JBpFzN3Pm/X4waKNhkF3ox76YrfvF1Xy6IkEsWCPsMaqMZb1uK8V /Bu36LJgC02MaGygNu3E3WYDb51iksNZThpi3BVh4RJGUh+X2JY7LkflhJHiT3AjTsZJ EAHEsbJKQPbQDp3RIVeE4BgUdajGB2iLMs/B1IunjzkYazyF9VBfhhaBf2xpYISyuKZJ Avng== X-Gm-Message-State: AIkVDXK13J57LZ3/mdcm9fCxPU1I1x5WSBZZie4Ix4JeNw2qaqFvX0cywiznDPTHUpwFhdgWT/hqlDrMhrjq8g== X-Received: by 10.223.173.80 with SMTP id p74mr13211931wrc.168.1484953417744; Fri, 20 Jan 2017 15:03:37 -0800 (PST) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.194.82.162 with HTTP; Fri, 20 Jan 2017 15:03:36 -0800 (PST) In-Reply-To: <201701200743.v0K7heje003608@repo.freebsd.org> References: <201701200743.v0K7heje003608@repo.freebsd.org> From: Adrian Chadd Date: Fri, 20 Jan 2017 15:03:36 -0800 X-Google-Sender-Auth: P-LgKbwDCbf11rPUeYg4xiUz1fg Message-ID: Subject: Re: svn commit: r312522 - head/sys/net80211 To: "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, 20 Jan 2017 23:03:40 -0000 ... MCS16-31. God, don't commit late at night adrian. -a On 19 January 2017 at 23:43, Adrian Chadd wrote: > Author: adrian > Date: Fri Jan 20 07:43:40 2017 > New Revision: 312522 > URL: https://svnweb.freebsd.org/changeset/base/312522 > > Log: > [net80211] allow for MCS16-23 to be statically configured. > > Tested: > > * AR9380, STA mode > > Modified: > head/sys/net80211/ieee80211_ioctl.c > > Modified: head/sys/net80211/ieee80211_ioctl.c > ============================================================================== > --- head/sys/net80211/ieee80211_ioctl.c Fri Jan 20 07:11:21 2017 (r312521) > +++ head/sys/net80211/ieee80211_ioctl.c Fri Jan 20 07:43:40 2017 (r312522) > @@ -2225,7 +2225,7 @@ checkmcs(int mcs) > return 1; > if ((mcs & IEEE80211_RATE_MCS) == 0) /* MCS always have 0x80 set */ > return 0; > - return (mcs & 0x7f) <= 15; /* XXX could search ht rate set */ > + return (mcs & 0x7f) <= 31; /* XXX could search ht rate set */ > } > > static int > From owner-svn-src-all@freebsd.org Sat Jan 21 02:37:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B40ECBA3C3; Sat, 21 Jan 2017 02:37:29 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp002.me.com (mr11p00im-asmtp002.me.com [17.110.69.253]) (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 0CF9D191B; Sat, 21 Jan 2017 02:37:29 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp002.me.com by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OK300100Z8AC800@mr11p00im-asmtp002.me.com>; Sat, 21 Jan 2017 02:37:22 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1484966242; bh=PgUnH2YQsIJ1jTVH59xewH6rc7YBt+pY+E+ZHxF2LJ4=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=KPBN2OPT86M9oFBmXPdiBGK6numugkfRsjiUmv6OCsQYiGMDykiRh09hKcd8h9Qdu FFdYx7qGmWub5N4g3PhnRiwZxYadaa/vViaqrDwIzEv3VY/x1VFkEqEvZtAcOjKreW qNgrD0yeVVmCgc4DUT+GSIMvPw1Ahn00o4p8KfqbEvaFj0UYpUrhqq4UyM74IsGvHg alWJdfjGnyCTAWyoxLtmXoBS095k6U+o/2mzKUW5u1RcHfAfD5Z0kSh9BgTAK/q64G r1ODjbVU4sif0k5zpusAFXjZAvKBJ6kZ9qVLdqTb+ZEdtc/TYshnxX4yWMefVGagA8 u/f0DioRoNmNQ== Received: from [172.17.133.77] (unknown [12.202.168.51]) by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OK3005RJZA9KH20@mr11p00im-asmtp002.me.com>; Sat, 21 Jan 2017 02:37:22 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-01-20_16:,, 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-1701210037 User-Agent: Microsoft-MacOutlook/f.1e.0.170107 Date: Fri, 20 Jan 2017 18:37:20 -0800 Subject: Re: svn commit: r286700 - in head: sbin/ifconfig sys/net From: Ravi Pokala Sender: "Pokala, Ravi" To: Hiren Panchasara , Alan Somers , lakshmi.n@msystechnologies.com, smh@FreeBSD.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-id: Thread-topic: svn commit: r286700 - in head: sbin/ifconfig sys/net References: <201508122021.t7CKL5wk016750@repo.freebsd.org> <20170118223827.GJ86256@strugglingcoder.info> In-reply-to: <20170118223827.GJ86256@strugglingcoder.info> 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, 21 Jan 2017 02:37:29 -0000 -----Original Message----- > From: on behalf of Hiren Panchasara > Date: 2017-01-18, Wednesday at 14:38 > To: Alan Somers , , , > Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" > Subject: Re: svn commit: r286700 - in head: sbin/ifconfig sys/net > > Adding the submitter and other reviewers for their comments. > > On 01/18/17 at 03:03P, Alan Somers wrote: >> Is the change to lacp_port_create correct? The comment indicates that >> fast is configurable, but it's actually constant. Later on, there's >> some dead code that depends on the value of fast (it was dead before >> this commit, too). >> >> CID: 1305734 >> CID: 1305692 You're right that in lacp_port_create(), "fast" (and "active") are both constant. I think the comment intended to indicate that "fast" could be changed via ioctl *after create*. It seems to me that the right thing to do would be to remove both "fast" and "active" from lacp_port_create(), and have it unconditionally set "lp->lp_state" to LACP_STATE_ACTIVITY. That would eliminate the unclear comments and fix both Coverity issues, without changing any behavior. -Ravi (rpokala@) >> -Alan >> >> On Wed, Aug 12, 2015 at 2:21 PM, Hiren Panchasara wrote: >>> Author: hiren >>> Date: Wed Aug 12 20:21:04 2015 >>> New Revision: 286700 >>> URL: https://svnweb.freebsd.org/changeset/base/286700 >>> >>> Log: >>> Make LAG LACP fast timeout tunable through IOCTL. >>> >>> Differential Revision: D3300 >>> Submitted by: LN Sundararajan >>> Reviewed by: wblock, smh, gnn, hiren, rpokala at panasas >>> MFC after: 2 weeks >>> Sponsored by: Panasas >>> >>> Modified: >>> head/sbin/ifconfig/ifconfig.8 >>> head/sbin/ifconfig/iflagg.c >>> head/sys/net/ieee8023ad_lacp.c >>> head/sys/net/ieee8023ad_lacp.h >>> head/sys/net/if_lagg.c >>> head/sys/net/if_lagg.h >>> >>> Modified: head/sbin/ifconfig/ifconfig.8 >>> ============================================================================== >>> --- head/sbin/ifconfig/ifconfig.8 Wed Aug 12 20:16:13 2015 (r286699) >>> +++ head/sbin/ifconfig/ifconfig.8 Wed Aug 12 20:21:04 2015 (r286700) >>> @@ -28,7 +28,7 @@ >>> .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 >>> .\" $FreeBSD$ >>> .\" >>> -.Dd May 15, 2015 >>> +.Dd Aug 12, 2015 >>> .Dt IFCONFIG 8 >>> .Os >>> .Sh NAME >>> @@ -2396,6 +2396,10 @@ Disable local hash computation for RSS h >>> Set a shift parameter for RSS local hash computation. >>> Hash is calculated by using flowid bits in a packet header mbuf >>> which are shifted by the number of this parameter. >>> +.It Cm lacp_fast_timeout >>> +Enable lacp fast-timeout on the interface. >>> +.It Cm -lacp_fast_timeout >>> +Disable lacp fast-timeout on the interface. >>> .El >>> .Pp >>> The following parameters are specific to IP tunnel interfaces, >>> >>> Modified: head/sbin/ifconfig/iflagg.c >>> ============================================================================== >>> --- head/sbin/ifconfig/iflagg.c Wed Aug 12 20:16:13 2015 (r286699) >>> +++ head/sbin/ifconfig/iflagg.c Wed Aug 12 20:21:04 2015 (r286700) >>> @@ -115,6 +115,8 @@ setlaggsetopt(const char *val, int d, in >>> case -LAGG_OPT_LACP_TXTEST: >>> case LAGG_OPT_LACP_RXTEST: >>> case -LAGG_OPT_LACP_RXTEST: >>> + case LAGG_OPT_LACP_TIMEOUT: >>> + case -LAGG_OPT_LACP_TIMEOUT: >>> break; >>> default: >>> err(1, "Invalid lagg option"); >>> @@ -293,6 +295,8 @@ static struct cmd lagg_cmds[] = { >>> DEF_CMD("-lacp_txtest", -LAGG_OPT_LACP_TXTEST, setlaggsetopt), >>> DEF_CMD("lacp_rxtest", LAGG_OPT_LACP_RXTEST, setlaggsetopt), >>> DEF_CMD("-lacp_rxtest", -LAGG_OPT_LACP_RXTEST, setlaggsetopt), >>> + DEF_CMD("lacp_fast_timeout", LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), >>> + DEF_CMD("-lacp_fast_timeout", -LAGG_OPT_LACP_TIMEOUT, setlaggsetopt), >>> DEF_CMD_ARG("flowid_shift", setlaggflowidshift), >>> }; >>> static struct afswtch af_lagg = { >>> >>> Modified: head/sys/net/ieee8023ad_lacp.c >>> ============================================================================== >>> --- head/sys/net/ieee8023ad_lacp.c Wed Aug 12 20:16:13 2015 (r286699) >>> +++ head/sys/net/ieee8023ad_lacp.c Wed Aug 12 20:21:04 2015 (r286700) >>> @@ -522,7 +522,7 @@ lacp_port_create(struct lagg_port *lgp) >>> int error; >>> >>> boolean_t active = TRUE; /* XXX should be configurable */ >>> - boolean_t fast = FALSE; /* XXX should be configurable */ >>> + boolean_t fast = FALSE; /* Configurable via ioctl */ >>> >>> link_init_sdl(ifp, (struct sockaddr *)&sdl, IFT_ETHER); >>> sdl.sdl_alen = ETHER_ADDR_LEN; >>> >>> Modified: head/sys/net/ieee8023ad_lacp.h >>> ============================================================================== >>> --- head/sys/net/ieee8023ad_lacp.h Wed Aug 12 20:16:13 2015 (r286699) >>> +++ head/sys/net/ieee8023ad_lacp.h Wed Aug 12 20:21:04 2015 (r286700) >>> @@ -251,6 +251,7 @@ struct lacp_softc { >>> u_int32_t lsc_tx_test; >>> } lsc_debug; >>> u_int32_t lsc_strict_mode; >>> + boolean_t lsc_fast_timeout; /* if set, fast timeout */ >>> }; >>> >>> #define LACP_TYPE_ACTORINFO 1 >>> >>> Modified: head/sys/net/if_lagg.c >>> ============================================================================== >>> --- head/sys/net/if_lagg.c Wed Aug 12 20:16:13 2015 (r286699) >>> +++ head/sys/net/if_lagg.c Wed Aug 12 20:21:04 2015 (r286700) >>> @@ -1257,6 +1257,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd >>> ro->ro_opts |= LAGG_OPT_LACP_RXTEST; >>> if (lsc->lsc_strict_mode != 0) >>> ro->ro_opts |= LAGG_OPT_LACP_STRICT; >>> + if (lsc->lsc_fast_timeout != 0) >>> + ro->ro_opts |= LAGG_OPT_LACP_TIMEOUT; >>> >>> ro->ro_active = sc->sc_active; >>> } else { >>> @@ -1292,6 +1294,8 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd >>> case -LAGG_OPT_LACP_RXTEST: >>> case LAGG_OPT_LACP_STRICT: >>> case -LAGG_OPT_LACP_STRICT: >>> + case LAGG_OPT_LACP_TIMEOUT: >>> + case -LAGG_OPT_LACP_TIMEOUT: >>> valid = lacp = 1; >>> break; >>> default: >>> @@ -1320,6 +1324,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd >>> sc->sc_opts &= ~ro->ro_opts; >>> } else { >>> struct lacp_softc *lsc; >>> + struct lacp_port *lp; >>> >>> lsc = (struct lacp_softc *)sc->sc_psc; >>> >>> @@ -1342,6 +1347,20 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd >>> case -LAGG_OPT_LACP_STRICT: >>> lsc->lsc_strict_mode = 0; >>> break; >>> + case LAGG_OPT_LACP_TIMEOUT: >>> + LACP_LOCK(lsc); >>> + LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) >>> + lp->lp_state |= LACP_STATE_TIMEOUT; >>> + LACP_UNLOCK(lsc); >>> + lsc->lsc_fast_timeout = 1; >>> + break; >>> + case -LAGG_OPT_LACP_TIMEOUT: >>> + LACP_LOCK(lsc); >>> + LIST_FOREACH(lp, &lsc->lsc_ports, lp_next) >>> + lp->lp_state &= ~LACP_STATE_TIMEOUT; >>> + LACP_UNLOCK(lsc); >>> + lsc->lsc_fast_timeout = 0; >>> + break; >>> } >>> } >>> LAGG_WUNLOCK(sc); >>> >>> Modified: head/sys/net/if_lagg.h >>> ============================================================================== >>> --- head/sys/net/if_lagg.h Wed Aug 12 20:16:13 2015 (r286699) >>> +++ head/sys/net/if_lagg.h Wed Aug 12 20:21:04 2015 (r286700) >>> @@ -150,6 +150,7 @@ struct lagg_reqopts { >>> #define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ >>> #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ >>> #define LAGG_OPT_LACP_RXTEST 0x40 /* LACP debug: rxtest */ >>> +#define LAGG_OPT_LACP_TIMEOUT 0x80 /* LACP timeout */ >>> u_int ro_count; /* number of ports */ >>> u_int ro_active; /* active port count */ >>> u_int ro_flapping; /* number of flapping */ >>> From owner-svn-src-all@freebsd.org Sat Jan 21 06:48:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC16ACBBB5E; Sat, 21 Jan 2017 06:48:53 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77AF41C80; Sat, 21 Jan 2017 06:48:53 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0L6mqkw076451; Sat, 21 Jan 2017 06:48:52 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L6mqil076450; Sat, 21 Jan 2017 06:48:52 GMT (envelope-from jah@FreeBSD.org) Message-Id: <201701210648.v0L6mqil076450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sat, 21 Jan 2017 06:48: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: r312561 - stable/11/sys/i386/i386 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, 21 Jan 2017 06:48:53 -0000 Author: jah Date: Sat Jan 21 06:48:52 2017 New Revision: 312561 URL: https://svnweb.freebsd.org/changeset/base/312561 Log: MFC r312153, r312191 r312153: For i386 temporary mappings, unpin the thread before releasing the cmap lock. Releasing the lock first may result in the thread being immediately rescheduled and bound to the same CPU, only to unpin itself upon resuming execution. Noted by: skra (in review for armv6 equivalent) r312191: Add comment explaining relative order of sched_unpin() and mtx_unlock(). Suggested by: alc Modified: stable/11/sys/i386/i386/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/i386/i386/pmap.c ============================================================================== --- stable/11/sys/i386/i386/pmap.c Fri Jan 20 22:41:16 2017 (r312560) +++ stable/11/sys/i386/i386/pmap.c Sat Jan 21 06:48:52 2017 (r312561) @@ -4231,8 +4231,14 @@ pmap_zero_page(vm_page_t m) invlcaddr(pc->pc_cmap_addr2); pagezero(pc->pc_cmap_addr2); *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); + + /* + * Unpin the thread before releasing the lock. Otherwise the thread + * could be rescheduled while still bound to the current CPU, only + * to unpin itself immediately upon resuming execution. + */ sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* @@ -4261,8 +4267,8 @@ pmap_zero_page_area(vm_page_t m, int off else bzero(pc->pc_cmap_addr2 + off, size); *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* @@ -4316,8 +4322,8 @@ pmap_copy_page(vm_page_t src, vm_page_t bcopy(pc->pc_cmap_addr1, pc->pc_cmap_addr2, PAGE_SIZE); *cmap_pte1 = 0; *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } int unmapped_buf_allowed = 1; @@ -4364,8 +4370,8 @@ pmap_copy_pages(vm_page_t ma[], vm_offse } *cmap_pte1 = 0; *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } /* @@ -5349,8 +5355,8 @@ pmap_flush_page(vm_page_t m) if (useclflushopt || cpu_vendor_id != CPU_VENDOR_INTEL) mfence(); *cmap_pte2 = 0; - mtx_unlock(&pc->pc_cmap_lock); sched_unpin(); + mtx_unlock(&pc->pc_cmap_lock); } else pmap_invalidate_cache(); } From owner-svn-src-all@freebsd.org Sat Jan 21 06:53:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46E5BCBBD11; Sat, 21 Jan 2017 06:53:32 +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 10E991078; Sat, 21 Jan 2017 06:53:31 +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 v0L6rVcL080345; Sat, 21 Jan 2017 06:53:31 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L6rVoS080344; Sat, 21 Jan 2017 06:53:31 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701210653.v0L6rVoS080344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 21 Jan 2017 06:53:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312562 - 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, 21 Jan 2017 06:53:32 -0000 Author: adrian Date: Sat Jan 21 06:53:30 2017 New Revision: 312562 URL: https://svnweb.freebsd.org/changeset/base/312562 Log: [ath] ensure both iv_ampdu_limit and iv_ampdu_rxmax is set. A recent change enforced the VAP limit as well as the peer limit. I now need to actually set iv_ampdu_limit or we don't transmit more than 8K sized aggregates. This restores the expected (suboptimal, but still much faster) behaviour. Tested: * AR9380, STA mode Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Jan 21 06:48:52 2017 (r312561) +++ head/sys/dev/ath/if_ath.c Sat Jan 21 06:53:30 2017 (r312562) @@ -1638,6 +1638,7 @@ ath_vap_create(struct ieee80211com *ic, * However, for now that's enforced by the TX path. */ vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_64K; + vap->iv_ampdu_limit = IEEE80211_HTCAP_MAXRXAMPDU_64K; avp->av_bslot = -1; if (needbeacon) { From owner-svn-src-all@freebsd.org Sat Jan 21 07:07:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5541CBBF41; Sat, 21 Jan 2017 07:07:51 +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 74EEC157F; Sat, 21 Jan 2017 07:07:51 +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 v0L77o8d084372; Sat, 21 Jan 2017 07:07:50 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L77o0Q084371; Sat, 21 Jan 2017 07:07:50 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201701210707.v0L77o0Q084371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sat, 21 Jan 2017 07:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312563 - head/share/man/man7 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, 21 Jan 2017 07:07:51 -0000 Author: kevlo Date: Sat Jan 21 07:07:50 2017 New Revision: 312563 URL: https://svnweb.freebsd.org/changeset/base/312563 Log: Mention softfloat and hardfloat supports for RISC-V. Reviewed by: br Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Sat Jan 21 06:53:30 2017 (r312562) +++ head/share/man/man7/arch.7 Sat Jan 21 07:07:50 2017 (r312563) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2016 +.Dd January 21, 2017 .Dt ARCH 7 .Os .Sh NAME @@ -135,7 +135,8 @@ On all supported architectures, .It mips64hf Ta hard Ta identical to double .It powerpc Ta hard Ta hard, double precision .It powerpc64 Ta hard Ta hard, double precision -.It riscv Ta +.It riscv64 Ta hard Ta hard, double precision +.It riscv64sf Ta soft Ta soft, double precision .It sparc64 Ta hard Ta hard, quad precision .El .Ss Predefined Macros From owner-svn-src-all@freebsd.org Sat Jan 21 08:15:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD5C1CBB7FA; Sat, 21 Jan 2017 08:15:20 +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 8DFFD16AC; Sat, 21 Jan 2017 08:15:20 +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 v0L8FJnL012301; Sat, 21 Jan 2017 08:15:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8FJRj012299; Sat, 21 Jan 2017 08:15:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210815.v0L8FJRj012299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:15: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: r312564 - in stable/11: lib/libcam sbin/camcontrol 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, 21 Jan 2017 08:15:20 -0000 Author: mav Date: Sat Jan 21 08:15:19 2017 New Revision: 312564 URL: https://svnweb.freebsd.org/changeset/base/312564 Log: MFC r311623: Make do_buff_decode() not read past the end of the buffer. Abort format processing as soon as we have no enough data. Modified: stable/11/lib/libcam/scsi_cmdparse.c stable/11/sbin/camcontrol/modeedit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcam/scsi_cmdparse.c ============================================================================== --- stable/11/lib/libcam/scsi_cmdparse.c Sat Jan 21 07:07:50 2017 (r312563) +++ stable/11/lib/libcam/scsi_cmdparse.c Sat Jan 21 08:15:19 2017 (r312564) @@ -100,10 +100,11 @@ __FBSDID("$FreeBSD$"); */ static int -do_buff_decode(u_int8_t *databuf, size_t len, +do_buff_decode(u_int8_t *buff, size_t len, void (*arg_put)(void *, int , void *, int, char *), void *puthook, const char *fmt, va_list *ap) { + int ind = 0; int assigned = 0; int width; int suppress; @@ -112,21 +113,17 @@ do_buff_decode(u_int8_t *databuf, size_t static u_char mask[] = {0, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; int value; - u_char *base = databuf; char *intendp; char letter; char field_name[80]; -# define ARG_PUT(ARG) \ - do \ - { \ - if (!suppress) \ - { \ +#define ARG_PUT(ARG) \ + do { \ + if (!suppress) { \ if (arg_put) \ - (*arg_put)(puthook, (letter == 't' ? \ - 'b' : letter), \ - (void *)((long)(ARG)), width, \ - field_name); \ + (*arg_put)(puthook, (letter == 't' ? 'b' : \ + letter), (void *)((long)(ARG)), width, \ + field_name); \ else \ *(va_arg(*ap, int *)) = (ARG); \ assigned++; \ @@ -187,7 +184,11 @@ do_buff_decode(u_int8_t *databuf, size_t done = 1; else { if (shift <= 0) { - bits = *databuf++; + if (ind >= len) { + done = 1; + break; + } + bits = buff[ind++]; shift = 8; } value = (bits >> (shift - width)) & @@ -209,29 +210,31 @@ do_buff_decode(u_int8_t *databuf, size_t fmt++; width = strtol(fmt, &intendp, 10); fmt = intendp; + if (ind + width > len) { + done = 1; + break; + } switch(width) { case 1: - ARG_PUT(*databuf); - databuf++; + ARG_PUT(buff[ind]); + ind++; break; case 2: - ARG_PUT((*databuf) << 8 | *(databuf + 1)); - databuf += 2; + ARG_PUT(buff[ind] << 8 | buff[ind + 1]); + ind += 2; break; case 3: - ARG_PUT((*databuf) << 16 | - (*(databuf + 1)) << 8 | *(databuf + 2)); - databuf += 3; + ARG_PUT(buff[ind] << 16 | + buff[ind + 1] << 8 | buff[ind + 2]); + ind += 3; break; case 4: - ARG_PUT((*databuf) << 24 | - (*(databuf + 1)) << 16 | - (*(databuf + 2)) << 8 | - *(databuf + 3)); - databuf += 4; + ARG_PUT(buff[ind] << 24 | buff[ind + 1] << 16 | + buff[ind + 2] << 8 | buff[ind + 3]); + ind += 4; break; default: @@ -242,32 +245,35 @@ do_buff_decode(u_int8_t *databuf, size_t break; case 'c': /* Characters (i.e., not swapped) */ - case 'z': /* Characters with zeroed trailing - spaces */ + case 'z': /* Characters with zeroed trailing spaces */ shift = 0; fmt++; width = strtol(fmt, &intendp, 10); fmt = intendp; + if (ind + width > len) { + done = 1; + break; + } if (!suppress) { if (arg_put) (*arg_put)(puthook, - (letter == 't' ? 'b' : letter), - databuf, width, field_name); + (letter == 't' ? 'b' : letter), + &buff[ind], width, field_name); else { char *dest; dest = va_arg(*ap, char *); - bcopy(databuf, dest, width); + bcopy(&buff[ind], dest, width); if (letter == 'z') { char *p; for (p = dest + width - 1; - (p >= (char *)dest) - && (*p == ' '); p--) + p >= dest && *p == ' '; + p--) *p = 0; } } assigned++; } - databuf += width; + ind += width; field_name[0] = 0; suppress = 0; break; @@ -295,9 +301,9 @@ do_buff_decode(u_int8_t *databuf, size_t } if (plus) - databuf += width; /* Relative seek */ + ind += width; /* Relative seek */ else - databuf = base + width; /* Absolute seek */ + ind = width; /* Absolute seek */ break; Modified: stable/11/sbin/camcontrol/modeedit.c ============================================================================== --- stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 07:07:50 2017 (r312563) +++ stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 08:15:19 2017 (r312564) @@ -193,7 +193,14 @@ editentry_save(void *hook __unused, char struct editentry *src; /* Entry value to save. */ src = editentry_lookup(name); - assert(src != NULL); + if (src == 0) { + /* + * This happens if field does not fit into read page size. + * It also means that this field won't be written, so the + * returned value does not really matter. + */ + return (0); + } switch (src->type) { case 'i': /* Byte-sized integral type. */ From owner-svn-src-all@freebsd.org Sat Jan 21 08:15:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05E4DCBB85C; Sat, 21 Jan 2017 08:15:53 +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 BAB4C1823; Sat, 21 Jan 2017 08:15:52 +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 v0L8Fpaw012376; Sat, 21 Jan 2017 08:15:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8FpQ5012374; Sat, 21 Jan 2017 08:15:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210815.v0L8FpQ5012374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:15: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: r312565 - in stable/10: lib/libcam sbin/camcontrol 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, 21 Jan 2017 08:15:53 -0000 Author: mav Date: Sat Jan 21 08:15:51 2017 New Revision: 312565 URL: https://svnweb.freebsd.org/changeset/base/312565 Log: MFC r311623: Make do_buff_decode() not read past the end of the buffer. Abort format processing as soon as we have no enough data. Modified: stable/10/lib/libcam/scsi_cmdparse.c stable/10/sbin/camcontrol/modeedit.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/scsi_cmdparse.c ============================================================================== --- stable/10/lib/libcam/scsi_cmdparse.c Sat Jan 21 08:15:19 2017 (r312564) +++ stable/10/lib/libcam/scsi_cmdparse.c Sat Jan 21 08:15:51 2017 (r312565) @@ -100,10 +100,11 @@ __FBSDID("$FreeBSD$"); */ static int -do_buff_decode(u_int8_t *databuf, size_t len, +do_buff_decode(u_int8_t *buff, size_t len, void (*arg_put)(void *, int , void *, int, char *), void *puthook, const char *fmt, va_list *ap) { + int ind = 0; int assigned = 0; int width; int suppress; @@ -112,21 +113,17 @@ do_buff_decode(u_int8_t *databuf, size_t static u_char mask[] = {0, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; int value; - u_char *base = databuf; char *intendp; char letter; char field_name[80]; -# define ARG_PUT(ARG) \ - do \ - { \ - if (!suppress) \ - { \ +#define ARG_PUT(ARG) \ + do { \ + if (!suppress) { \ if (arg_put) \ - (*arg_put)(puthook, (letter == 't' ? \ - 'b' : letter), \ - (void *)((long)(ARG)), width, \ - field_name); \ + (*arg_put)(puthook, (letter == 't' ? 'b' : \ + letter), (void *)((long)(ARG)), width, \ + field_name); \ else \ *(va_arg(*ap, int *)) = (ARG); \ assigned++; \ @@ -187,7 +184,11 @@ do_buff_decode(u_int8_t *databuf, size_t done = 1; else { if (shift <= 0) { - bits = *databuf++; + if (ind >= len) { + done = 1; + break; + } + bits = buff[ind++]; shift = 8; } value = (bits >> (shift - width)) & @@ -209,29 +210,31 @@ do_buff_decode(u_int8_t *databuf, size_t fmt++; width = strtol(fmt, &intendp, 10); fmt = intendp; + if (ind + width > len) { + done = 1; + break; + } switch(width) { case 1: - ARG_PUT(*databuf); - databuf++; + ARG_PUT(buff[ind]); + ind++; break; case 2: - ARG_PUT((*databuf) << 8 | *(databuf + 1)); - databuf += 2; + ARG_PUT(buff[ind] << 8 | buff[ind + 1]); + ind += 2; break; case 3: - ARG_PUT((*databuf) << 16 | - (*(databuf + 1)) << 8 | *(databuf + 2)); - databuf += 3; + ARG_PUT(buff[ind] << 16 | + buff[ind + 1] << 8 | buff[ind + 2]); + ind += 3; break; case 4: - ARG_PUT((*databuf) << 24 | - (*(databuf + 1)) << 16 | - (*(databuf + 2)) << 8 | - *(databuf + 3)); - databuf += 4; + ARG_PUT(buff[ind] << 24 | buff[ind + 1] << 16 | + buff[ind + 2] << 8 | buff[ind + 3]); + ind += 4; break; default: @@ -242,32 +245,35 @@ do_buff_decode(u_int8_t *databuf, size_t break; case 'c': /* Characters (i.e., not swapped) */ - case 'z': /* Characters with zeroed trailing - spaces */ + case 'z': /* Characters with zeroed trailing spaces */ shift = 0; fmt++; width = strtol(fmt, &intendp, 10); fmt = intendp; + if (ind + width > len) { + done = 1; + break; + } if (!suppress) { if (arg_put) (*arg_put)(puthook, - (letter == 't' ? 'b' : letter), - databuf, width, field_name); + (letter == 't' ? 'b' : letter), + &buff[ind], width, field_name); else { char *dest; dest = va_arg(*ap, char *); - bcopy(databuf, dest, width); + bcopy(&buff[ind], dest, width); if (letter == 'z') { char *p; for (p = dest + width - 1; - (p >= (char *)dest) - && (*p == ' '); p--) + p >= dest && *p == ' '; + p--) *p = 0; } } assigned++; } - databuf += width; + ind += width; field_name[0] = 0; suppress = 0; break; @@ -295,9 +301,9 @@ do_buff_decode(u_int8_t *databuf, size_t } if (plus) - databuf += width; /* Relative seek */ + ind += width; /* Relative seek */ else - databuf = base + width; /* Absolute seek */ + ind = width; /* Absolute seek */ break; Modified: stable/10/sbin/camcontrol/modeedit.c ============================================================================== --- stable/10/sbin/camcontrol/modeedit.c Sat Jan 21 08:15:19 2017 (r312564) +++ stable/10/sbin/camcontrol/modeedit.c Sat Jan 21 08:15:51 2017 (r312565) @@ -193,7 +193,14 @@ editentry_save(void *hook __unused, char struct editentry *src; /* Entry value to save. */ src = editentry_lookup(name); - assert(src != NULL); + if (src == 0) { + /* + * This happens if field does not fit into read page size. + * It also means that this field won't be written, so the + * returned value does not really matter. + */ + return (0); + } switch (src->type) { case 'i': /* Byte-sized integral type. */ From owner-svn-src-all@freebsd.org Sat Jan 21 08:16:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3E2CBB8CB; Sat, 21 Jan 2017 08:16:43 +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 6681F1997; Sat, 21 Jan 2017 08:16:43 +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 v0L8Gg1T012469; Sat, 21 Jan 2017 08:16:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8Gg5k012462; Sat, 21 Jan 2017 08:16:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210816.v0L8Gg5k012462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:16:42 +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: r312566 - in stable/11: sbin/camcontrol share/misc 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: Sat, 21 Jan 2017 08:16:43 -0000 Author: mav Date: Sat Jan 21 08:16:41 2017 New Revision: 312566 URL: https://svnweb.freebsd.org/changeset/base/312566 Log: MFC r311636: Make 'camcontrol modepage' support subpages. Modified: stable/11/sbin/camcontrol/camcontrol.8 stable/11/sbin/camcontrol/camcontrol.c stable/11/sbin/camcontrol/camcontrol.h stable/11/sbin/camcontrol/modeedit.c stable/11/share/misc/scsi_modes stable/11/sys/cam/scsi/scsi_all.c stable/11/sys/cam/scsi/scsi_all.h stable/11/sys/cam/scsi/scsi_ch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.8 Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/sbin/camcontrol/camcontrol.8 Sat Jan 21 08:16:41 2017 (r312566) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2016 +.Dd January 6, 2017 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -121,7 +121,7 @@ .Ic modepage .Op device id .Op generic args -.Aq Fl m Ar page | Fl l +.Aq Fl m Ar page[,subpage] | Fl l .Op Fl P Ar pgctl .Op Fl b | Fl e .Op Fl d @@ -702,9 +702,10 @@ The editor will be invoked if detects that standard input is terminal. .It Fl l Lists all available mode pages. -.It Fl m Ar mode_page -This specifies the number of the mode page the user would like to view -and/or edit. +If specified more then once, also lists subpages. +.It Fl m Ar page[,subpage] +This specifies the number of the mode page and optionally subpage the user +would like to view and/or edit. This argument is mandatory unless .Fl l is specified. Modified: stable/11/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.c Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/sbin/camcontrol/camcontrol.c Sat Jan 21 08:16:41 2017 (r312566) @@ -125,12 +125,9 @@ typedef enum { CAM_ARG_GET_STDINQ = 0x00002000, CAM_ARG_GET_XFERRATE = 0x00004000, CAM_ARG_INQ_MASK = 0x00007000, - CAM_ARG_MODE_EDIT = 0x00008000, - CAM_ARG_PAGE_CNTL = 0x00010000, CAM_ARG_TIMEOUT = 0x00020000, CAM_ARG_CMD_IN = 0x00040000, CAM_ARG_CMD_OUT = 0x00080000, - CAM_ARG_DBD = 0x00100000, CAM_ARG_ERR_RECOVER = 0x00200000, CAM_ARG_RETRIES = 0x00400000, CAM_ARG_START_UNIT = 0x00800000, @@ -3987,8 +3984,8 @@ reassignblocks(struct cam_device *device #ifndef MINIMALISTIC 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) +mode_sense(struct cam_device *device, int dbd, int pc, int page, int subpage, + int retry_count, int timeout, u_int8_t *data, int datalen) { union ccb *ccb; int retval; @@ -4000,15 +3997,17 @@ mode_sense(struct cam_device *device, in CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - scsi_mode_sense(&ccb->csio, + scsi_mode_sense_subpage(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, /* tag_action */ MSG_SIMPLE_Q_TAG, /* dbd */ dbd, - /* page_code */ page_control << 6, - /* page */ mode_page, + /* pc */ pc << 6, + /* page */ page, + /* subpage */ subpage, /* param_buf */ data, /* param_len */ datalen, + /* minimum_cmd_size */ 0, /* sense_len */ SSD_FULL_SIZE, /* timeout */ timeout ? timeout : 5000); @@ -4089,8 +4088,9 @@ void modepage(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout) { - int c, mode_page = -1, page_control = 0; - int binary = 0, list = 0; + char *str_subpage; + int c, page = -1, subpage = -1, pc = 0; + int binary = 0, dbd = 0, edit = 0, list = 0; while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { @@ -4098,40 +4098,44 @@ modepage(struct cam_device *device, int binary = 1; break; case 'd': - arglist |= CAM_ARG_DBD; + dbd = 1; break; case 'e': - arglist |= CAM_ARG_MODE_EDIT; + edit = 1; break; case 'l': - list = 1; + list++; break; case 'm': - mode_page = strtol(optarg, NULL, 0); - if (mode_page < 0) - errx(1, "invalid mode page %d", mode_page); + str_subpage = optarg; + strsep(&str_subpage, ","); + page = strtol(optarg, NULL, 0); + if (str_subpage) + subpage = strtol(str_subpage, NULL, 0); + else + subpage = 0; + if (page < 0) + errx(1, "invalid mode page %d", page); + if (subpage < 0) + errx(1, "invalid mode subpage %d", subpage); break; case 'P': - page_control = strtol(optarg, NULL, 0); - if ((page_control < 0) || (page_control > 3)) - errx(1, "invalid page control field %d", - page_control); - arglist |= CAM_ARG_PAGE_CNTL; + pc = strtol(optarg, NULL, 0); + if ((pc < 0) || (pc > 3)) + errx(1, "invalid page control field %d", pc); break; default: break; } } - if (mode_page == -1 && list == 0) + if (page == -1 && list == 0) errx(1, "you must specify a mode page!"); - if (list) { - mode_list(device, page_control, arglist & CAM_ARG_DBD, - retry_count, timeout); + if (list != 0) { + mode_list(device, dbd, pc, list > 1, retry_count, timeout); } else { - mode_edit(device, mode_page, page_control, - arglist & CAM_ARG_DBD, arglist & CAM_ARG_MODE_EDIT, binary, + mode_edit(device, dbd, pc, page, subpage, edit, binary, retry_count, timeout); } } Modified: stable/11/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/11/sbin/camcontrol/camcontrol.h Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/sbin/camcontrol/camcontrol.h Sat Jan 21 08:16:41 2017 (r312566) @@ -84,14 +84,14 @@ int epc(struct cam_device *device, int a 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, +void mode_sense(struct cam_device *device, int dbd, int pc, int page, + int subpage, int retry_count, int timeout, uint8_t *data, int datalen); void mode_select(struct cam_device *device, int save_pages, int retry_count, int timeout, u_int8_t *data, int datalen); -void mode_edit(struct cam_device *device, int page, int page_control, int dbd, +void mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, int edit, int binary, int retry_count, int timeout); -void mode_list(struct cam_device *device, int page_control, int dbd, +void mode_list(struct cam_device *device, int dbd, int pc, int subpages, int retry_count, int timeout); int scsidoinquiry(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); Modified: stable/11/sbin/camcontrol/modeedit.c ============================================================================== --- stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 08:16:41 2017 (r312566) @@ -66,9 +66,6 @@ __FBSDID("$FreeBSD$"); #define MODE_PAGE_HEADER(mh) \ (struct scsi_mode_page_header *)find_mode_page_6(mh) -#define MODE_PAGE_DATA(mph) \ - (u_int8_t *)(mph) + sizeof(struct scsi_mode_page_header) - struct editentry { STAILQ_ENTRY(editentry) link; @@ -86,7 +83,8 @@ static int editlist_changed = 0; /* Whet struct pagename { SLIST_ENTRY(pagename) link; - int pagenum; + int page; + int subpage; char *name; }; static SLIST_HEAD(, pagename) namelist; /* Page number to name mappings. */ @@ -106,21 +104,22 @@ static int editentry_save(void *hook, static struct editentry *editentry_lookup(char *name); static int editentry_set(char *name, char *newvalue, int editonly); -static void editlist_populate(struct cam_device *device, - int modepage, int page_control, - int dbd, int retries, int timeout); -static void editlist_save(struct cam_device *device, int modepage, - int page_control, int dbd, int retries, - int timeout); -static void nameentry_create(int pagenum, char *name); -static struct pagename *nameentry_lookup(int pagenum); -static int load_format(const char *pagedb_path, int page); +static void editlist_populate(struct cam_device *device, int dbd, + int pc, int page, int subpage, + int retries, int timeout); +static void editlist_save(struct cam_device *device, int dbd, + int pc, int page, int subpage, + int retries, int timeout); +static void nameentry_create(int page, int subpage, char *name); +static struct pagename *nameentry_lookup(int page, int subpage); +static int load_format(const char *pagedb_path, int lpage, + int lsubpage); static int modepage_write(FILE *file, int editonly); static int modepage_read(FILE *file); static void modepage_edit(void); -static void modepage_dump(struct cam_device *device, int page, - int page_control, int dbd, int retries, - int timeout); +static void modepage_dump(struct cam_device *device, int dbd, + int pc, int page, int subpage, int retries, + int timeout); static void cleanup_editfile(void); @@ -325,10 +324,10 @@ editentry_set(char *name, char *newvalue } static void -nameentry_create(int pagenum, char *name) { +nameentry_create(int page, int subpage, char *name) { struct pagename *newentry; - if (pagenum < 0 || name == NULL || name[0] == '\0') + if (page < 0 || subpage < 0 || name == NULL || name[0] == '\0') return; /* Allocate memory for the new entry and a copy of the entry name. */ @@ -339,16 +338,17 @@ nameentry_create(int pagenum, char *name /* Trim any trailing whitespace for the page name. */ RTRIM(newentry->name); - newentry->pagenum = pagenum; + newentry->page = page; + newentry->subpage = subpage; SLIST_INSERT_HEAD(&namelist, newentry, link); } static struct pagename * -nameentry_lookup(int pagenum) { +nameentry_lookup(int page, int subpage) { struct pagename *scan; SLIST_FOREACH(scan, &namelist, link) { - if (pagenum == scan->pagenum) + if (page == scan->page && subpage == scan->subpage) return (scan); } @@ -357,12 +357,14 @@ nameentry_lookup(int pagenum) { } static int -load_format(const char *pagedb_path, int page) +load_format(const char *pagedb_path, int lpage, int lsubpage) { FILE *pagedb; - char str_pagenum[MAX_PAGENUM_LEN]; + char str_page[MAX_PAGENUM_LEN]; + char *str_subpage; char str_pagename[MAX_PAGENAME_LEN]; - int pagenum; + int page; + int subpage; int depth; /* Quoting depth. */ int found; int lineno; @@ -371,9 +373,10 @@ load_format(const char *pagedb_path, int char c; #define SETSTATE_LOCATE do { \ - str_pagenum[0] = '\0'; \ + str_page[0] = '\0'; \ str_pagename[0] = '\0'; \ - pagenum = -1; \ + page = -1; \ + subpage = -1; \ state = LOCATE; \ } while (0) @@ -450,32 +453,46 @@ load_format(const char *pagedb_path, int * modes without providing a mode definition). */ /* Record the name of this page. */ - pagenum = strtol(str_pagenum, NULL, 0); - nameentry_create(pagenum, str_pagename); + str_subpage = str_page; + strsep(&str_subpage, ","); + page = strtol(str_page, NULL, 0); + if (str_subpage) + subpage = strtol(str_subpage, NULL, 0); + else + subpage = 0; + nameentry_create(page, subpage, str_pagename); SETSTATE_LOCATE; } else if (depth == 0 && c == PAGENAME_START) { SETSTATE_PAGENAME; } else if (c == PAGEDEF_START) { - pagenum = strtol(str_pagenum, NULL, 0); + str_subpage = str_page; + strsep(&str_subpage, ","); + page = strtol(str_page, NULL, 0); + if (str_subpage) + subpage = strtol(str_subpage, NULL, 0); + else + subpage = 0; if (depth == 1) { /* Record the name of this page. */ - nameentry_create(pagenum, str_pagename); + nameentry_create(page, subpage, + str_pagename); /* * Only record the format if this is * the page we are interested in. */ - if (page == pagenum && !found) + if (lpage == page && + lsubpage == subpage && !found) SETSTATE_PAGEDEF; } } else if (c == PAGEDEF_END) { /* Reset the processor state. */ SETSTATE_LOCATE; - } else if (depth == 0 && ! BUFFERFULL(str_pagenum)) { - strncat(str_pagenum, &c, 1); + } else if (depth == 0 && ! BUFFERFULL(str_page)) { + strncat(str_page, &c, 1); } else if (depth == 0) { errx(EX_OSFILE, "%s:%d: %s %zd %s", pagedb_path, lineno, "page identifier exceeds", - sizeof(str_pagenum) - 1, "characters"); + sizeof(str_page) - 1, "characters"); } break; @@ -491,7 +508,7 @@ load_format(const char *pagedb_path, int } else { errx(EX_OSFILE, "%s:%d: %s %zd %s", pagedb_path, lineno, "page name exceeds", - sizeof(str_pagenum) - 1, "characters"); + sizeof(str_page) - 1, "characters"); } break; @@ -532,88 +549,95 @@ load_format(const char *pagedb_path, int } static void -editlist_populate(struct cam_device *device, int modepage, int page_control, - int dbd, int retries, int timeout) +editlist_populate(struct cam_device *device, int dbd, int pc, int page, + int subpage, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; + struct scsi_mode_page_header_sp *mphsp; + int len; STAILQ_INIT(&editlist); /* Fetch changeable values; use to build initial editlist. */ - mode_sense(device, modepage, 1, dbd, retries, timeout, data, + mode_sense(device, dbd, 1, page, subpage, retries, timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); + if ((mph->page_code & SMPH_SPF) == 0) { + mode_pars = (uint8_t *)(mph + 1); + len = mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + mode_pars = (uint8_t *)(mphsp + 1); + len = scsi_2btoul(mphsp->page_length); + } /* Decode the value data, creating edit_entries for each value. */ - buff_decode_visit(mode_pars, mh->data_length, format, - editentry_create, 0); + buff_decode_visit(mode_pars, len, format, editentry_create, 0); /* Fetch the current/saved values; use to set editentry values. */ - mode_sense(device, modepage, page_control, dbd, retries, timeout, data, - sizeof(data)); - buff_decode_visit(mode_pars, mh->data_length, format, - editentry_update, 0); + mode_sense(device, dbd, pc, page, subpage, retries, timeout, + data, sizeof(data)); + buff_decode_visit(mode_pars, len, format, editentry_update, 0); } static void -editlist_save(struct cam_device *device, int modepage, int page_control, - int dbd, int retries, int timeout) +editlist_save(struct cam_device *device, int dbd, int pc, int page, + int subpage, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; + struct scsi_mode_page_header_sp *mphsp; + int len, hlen; /* Make sure that something changed before continuing. */ if (! editlist_changed) return; - /* - * Preload the CDB buffer with the current mode page data. - * XXX If buff_encode_visit would return the number of bytes encoded - * we *should* use that to build a header from scratch. As it is - * now, we need mode_sense to find out the page length. - */ - mode_sense(device, modepage, page_control, dbd, retries, timeout, data, - sizeof(data)); + /* Preload the CDB buffer with the current mode page data. */ + mode_sense(device, dbd, pc, page, subpage, retries, timeout, + data, sizeof(data)); /* Initial headers & offsets. */ mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); + if ((mph->page_code & SMPH_SPF) == 0) { + hlen = sizeof(*mph); + mode_pars = (uint8_t *)(mph + 1); + len = mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + hlen = sizeof(*mphsp); + mode_pars = (uint8_t *)(mphsp + 1); + len = scsi_2btoul(mphsp->page_length); + } /* Encode the value data to be passed back to the device. */ - buff_encode_visit(mode_pars, mh->data_length, format, - editentry_save, 0); + buff_encode_visit(mode_pars, len, format, editentry_save, 0); /* Eliminate block descriptors. */ - bcopy(mph, ((u_int8_t *)mh) + sizeof(*mh), - sizeof(*mph) + mph->page_length); + bcopy(mph, mh + 1, hlen + len); /* Recalculate headers & offsets. */ - mh->blk_desc_len = 0; /* No block descriptors. */ + mh->data_length = 0; /* Reserved for MODE SELECT command. */ mh->dev_spec = 0; /* Clear device-specific parameters. */ + mh->blk_desc_len = 0; /* No block descriptors. */ mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); - - mph->page_code &= SMS_PAGE_CODE;/* Isolate just the page code. */ - mh->data_length = 0; /* Reserved for MODE SELECT command. */ + mph->page_code &= ~SMPH_PS; /* Reserved for MODE SELECT command. */ /* * Write the changes back to the device. If the user editted control * page 3 (saved values) then request the changes be permanently * recorded. */ - mode_select(device, - (page_control << PAGE_CTRL_SHIFT == SMS_PAGE_CTRL_SAVED), - retries, timeout, (u_int8_t *)mh, - sizeof(*mh) + mh->blk_desc_len + sizeof(*mph) + mph->page_length); + mode_select(device, (pc << PAGE_CTRL_SHIFT == SMS_PAGE_CTRL_SAVED), + retries, timeout, (u_int8_t *)mh, sizeof(*mh) + hlen + len); } static int @@ -782,24 +806,32 @@ modepage_edit(void) } static void -modepage_dump(struct cam_device *device, int page, int page_control, int dbd, +modepage_dump(struct cam_device *device, int dbd, int pc, int page, int subpage, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; - int indx; /* Index for scanning mode params. */ + struct scsi_mode_page_header_sp *mphsp; + int indx, len; - mode_sense(device, page, page_control, dbd, retries, timeout, data, - sizeof(data)); + mode_sense(device, dbd, pc, page, subpage, retries, timeout, + data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); + if ((mph->page_code & SMPH_SPF) == 0) { + mode_pars = (uint8_t *)(mph + 1); + len = mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + mode_pars = (uint8_t *)(mphsp + 1); + len = scsi_2btoul(mphsp->page_length); + } /* Print the raw mode page data with newlines each 8 bytes. */ - for (indx = 0; indx < mph->page_length; indx++) { + for (indx = 0; indx < len; indx++) { printf("%02x%c",mode_pars[indx], (((indx + 1) % 8) == 0) ? '\n' : ' '); } @@ -817,7 +849,7 @@ cleanup_editfile(void) } void -mode_edit(struct cam_device *device, int page, int page_control, int dbd, +mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, int edit, int binary, int retry_count, int timeout) { const char *pagedb_path; /* Path to modepage database. */ @@ -829,15 +861,17 @@ mode_edit(struct cam_device *device, int if ((pagedb_path = getenv("SCSI_MODES")) == NULL) pagedb_path = DEFAULT_SCSI_MODE_DB; - if (load_format(pagedb_path, page) != 0 && (edit || verbose)) { + if (load_format(pagedb_path, page, subpage) != 0 && + (edit || verbose)) { if (errno == ENOENT) { /* Modepage database file not found. */ warn("cannot open modepage database \"%s\"", pagedb_path); } else if (errno == ESRCH) { /* Modepage entry not found in database. */ - warnx("modepage %d not found in database" - "\"%s\"", page, pagedb_path); + warnx("modepage 0x%02x,0x%02x not found in " + "database \"%s\"", page, subpage, + pagedb_path); } /* We can recover in display mode, otherwise we exit. */ if (!edit) { @@ -847,22 +881,20 @@ mode_edit(struct cam_device *device, int exit(EX_OSFILE); } - editlist_populate(device, page, page_control, dbd, retry_count, + editlist_populate(device, dbd, pc, page, subpage, retry_count, timeout); } if (edit) { - if (page_control << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_CURRENT && - page_control << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_SAVED) + if (pc << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_CURRENT && + pc << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_SAVED) errx(EX_USAGE, "it only makes sense to edit page 0 " "(current) or page 3 (saved values)"); modepage_edit(); - editlist_save(device, page, page_control, dbd, retry_count, - timeout); + editlist_save(device, dbd, pc, page, subpage, retry_count, timeout); } else if (binary || STAILQ_EMPTY(&editlist)) { /* Display without formatting information. */ - modepage_dump(device, page, page_control, dbd, retry_count, - timeout); + modepage_dump(device, dbd, pc, page, subpage, retry_count, timeout); } else { /* Display with format. */ modepage_write(stdout, 0); @@ -870,44 +902,55 @@ mode_edit(struct cam_device *device, int } void -mode_list(struct cam_device *device, int page_control, int dbd, +mode_list(struct cam_device *device, int dbd, int pc, int subpages, int retry_count, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; + struct scsi_mode_page_header_sp *mphsp; struct pagename *nameentry; const char *pagedb_path; - int len; + int len, page, subpage; if ((pagedb_path = getenv("SCSI_MODES")) == NULL) pagedb_path = DEFAULT_SCSI_MODE_DB; - if (load_format(pagedb_path, 0) != 0 && verbose && errno == ENOENT) { + if (load_format(pagedb_path, 0, 0) != 0 && verbose && errno == ENOENT) { /* Modepage database file not found. */ warn("cannot open modepage database \"%s\"", pagedb_path); } /* Build the list of all mode pages by querying the "all pages" page. */ - mode_sense(device, SMS_ALL_PAGES_PAGE, page_control, dbd, retry_count, - timeout, data, sizeof(data)); + mode_sense(device, dbd, pc, SMS_ALL_PAGES_PAGE, + subpages ? SMS_SUBPAGE_ALL : 0, + retry_count, timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; len = sizeof(*mh) + mh->blk_desc_len; /* Skip block descriptors. */ /* Iterate through the pages in the reply. */ while (len < mh->data_length) { /* Locate the next mode page header. */ - mph = (struct scsi_mode_page_header *) - ((intptr_t)mh + len); + mph = (struct scsi_mode_page_header *)((intptr_t)mh + len); - mph->page_code &= SMS_PAGE_CODE; - nameentry = nameentry_lookup(mph->page_code); + if ((mph->page_code & SMPH_SPF) == 0) { + page = mph->page_code & SMS_PAGE_CODE; + subpage = 0; + len += sizeof(*mph) + mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + page = mphsp->page_code & SMS_PAGE_CODE; + subpage = mphsp->subpage; + len += sizeof(*mphsp) + scsi_2btoul(mphsp->page_length); + } - if (nameentry == NULL || nameentry->name == NULL) - printf("0x%02x\n", mph->page_code); - else - printf("0x%02x\t%s\n", mph->page_code, - nameentry->name); - len += mph->page_length + sizeof(*mph); + nameentry = nameentry_lookup(page, subpage); + if (subpage == 0) { + printf("0x%02x\t%s\n", page, + nameentry ? nameentry->name : ""); + } else { + printf("0x%02x,0x%02x\t%s\n", page, subpage, + nameentry ? nameentry->name : ""); + } } } Modified: stable/11/share/misc/scsi_modes ============================================================================== --- stable/11/share/misc/scsi_modes Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/share/misc/scsi_modes Sat Jan 21 08:16:41 2017 (r312566) @@ -49,7 +49,11 @@ # ALL DEVICE TYPES -0x0a "Control Mode Page" { +0x0a,0x03 "Command Duration Limit A"; + +0x0a,0x04 "Command Duration Limit B"; + +0x0a "Control" { {TST} t3 {TMF_ONLY} t1 {DPICZ} t1 @@ -78,7 +82,18 @@ {Extended Self-Test Completion Time} i2 } -0x02 "Disconnect-Reconnect Page" { +0x0a,0x01 "Control Extension" { + {Reserved} *t4 + {DLC} t1 + {TCMOS} t1 + {SCSIP} t1 + {IALUAE} t1 + {Reserved} *t4 + {Initial Command Priority} t4 + {Maximum Sense Data Length} i1 +} + +0x02 "Disconnect-Reconnect" { {Buffer Full Ratio} i1 {Buffer Empty Ratio} i1 {Bus Inactivity Limit} i2 @@ -92,26 +107,11 @@ {Reserved} *i1 } -0x15 "Extended Page"; +0x15 "Extended"; -0x16 "Extended Device-Type Specific Page"; +0x16 "Extended Device-Type Specific"; -0x1c "Informational Exceptions Control Page" { - {PERF} t1 - {Reserved} *t1 - {EBF} t1 - {EWasc} t1 - {DExcpt} t1 - {TEST} t1 - {EBACKERR} t1 - {LogErr} t1 - {Reserved} *t4 - {MRIE} t4 - {Interval Timer} i4 - {Report Count} i4 -} - -0x09 "Peripheral Device Page" { +0x09 "Peripheral Device" { {Interface Identifier} i2 {Reserved} *i1 {Reserved} *i1 @@ -119,21 +119,69 @@ {Reserved} *i1 } -0x1a "Power Condition Page" { - {Reserved} *i1 +0x1a "Power Condition" { + {PM_BG_PRECEDENCE} t1 + {Reserved} *t6 + {STANDBY_Y} t1 + {Reserved} *t4 + {IDLE_C} t1 + {IDLE_B} t1 + {IDLE_A} t1 + {STANDBY_Z} t1 + {IDLE_A Condition Timer} i4 + {STANDBY_Z Condition Timer} i4 + {IDLE_B Condition Timer} i4 + {IDLE_C Condition Timer} i4 + {STANDBY_Y Condition Timer} i4 + {Reserved} *i4 + {Reserved} *i4 + {Reserved} *i4 + {Reserved} *i3 + {CCF Idle} t2 + {CCF Standby} t2 + {CCF Stopped} t2 + {Reserved} *t2 +} + +0x1a,0x01 "Power Consumption" { + {Reserved} *i2 {Reserved} *t6 - {Idle} t1 - {Standby} t1 - {Idle Condition Timer} i4 - {Standby Condition Timer} i4 + {Active Level} t2 + {Power Consumption Identifier} i1 + {Reserved} *i4 + {Reserved} *i4 } -0x18 "Protocol-Specific LUN Page"; +0x18 "Protocol-Specific Logical Unit"; -0x19 "Protocol-Specific Port Page"; +0x19 "Protocol-Specific Port"; # DIRECT ACCESS DEVICES -0x08 "Caching Page" { + +0x0a,0x02 "Application Tag"; + +0x1a,0xf1 "ATA Power Condition"; + +0x1c,0x01 "Background Control" { + {Reserved} *t5 + {S_L_FULL} *t1 + {LOWIR} *t1 + {EN_BMS} *t1 + {Reserved} *t7 + {EN_PS} *t1 + {Background Medium Scan Interval Time} i2 + {Background Pre-Scan Time Limit} i2 + {Minimum Idle Time Before Background Scan} i2 + {Maximum Time To Suspend Background Scan} i2 + {Reserved} *i2 +} + +0x0a,0x06 "Background Operation Control" { + {BO_MODE} t2 + {Reserved} *t6 +} + +0x08 "Caching" { {IC} t1 {ABPF} t1 {CAP} t1 @@ -159,7 +207,7 @@ {Reserved} *t4 } -0x05 "Flexible Disk Page" { +0x05 "Flexible Disk" { {Transfer rate} i2 {Number of heads} i1 {Sectors per track} i1 @@ -190,7 +238,7 @@ {Reserved} *i1 } -0x03 "Format Device Page" { +0x03 "Format Device" { {Tracks per Zone} i2 {Alternate Sectors per Zone} i2 {Alternate Tracks per Zone} i2 @@ -207,7 +255,34 @@ {Reserved} *t4 } -0x0b "Medium Types Supported Page" { +0x0a,0x05 "I/O Advice Hints Grouping"; + +0x1c "Informational Exceptions Control" { + {PERF} t1 + {Reserved} *t1 + {EBF} t1 + {EWasc} t1 + {DExcpt} t1 + {TEST} t1 + {EBACKERR} t1 + {LogErr} t1 + {Reserved} *t4 + {MRIE} t4 + {Interval Timer} i4 + {Report Count} i4 +} + +0x1c,0x02 "Logical Block Provisioning" { + {Reserved} *t7 + {SITUA} t1 + {Reserved} *i1 + {Reserved} *i1 + {Reserved} *i1 + {Reserved} *i4 + {Reserved} *i4 +} + +0x0b "Medium Types Supported" { {Reserved} *i1 {Reserved} *i1 {Medium type one supported} i1 @@ -216,10 +291,11 @@ {Medium type four supported} i1 } -# Notch page (0x0c) -0x0c "Notch and Partition Page"; +0x0c "Notch and Partition"; + +0x0a,0xf1 "PATA Control"; -0x01 "Read-Write Error Recovery Page" { +0x01 "Read-Write Error Recovery" { {AWRE (Auto Write Reallocation Enbld)} t1 {ARRE (Auto Read Reallocation Enbld)} t1 {TB (Transfer Block)} t1 @@ -240,7 +316,7 @@ {Recovery Time Limit} i2 } -0x04 "Rigid Disk Drive Geometry Page" { +0x04 "Rigid Disk Drive Geometry" { {Number of Cylinders} i3 {Number of Heads} i1 {Starting Cylinder-Write Precompensation} i3 @@ -256,7 +332,7 @@ {Reserved} *i1 } -0x07 "Verify Error Recovery Page" { +0x07 "Verify Error Recovery" { {Reserved} *t4 {EER} t1 {PER} t1 @@ -272,7 +348,7 @@ {Verify Recovery Time Limit} i2 } -0x0E "CD-ROM Audio Control Parameters Page" { +0x0E "CD-ROM Audio Control Parameters" { {Reserved} *t5 {Immed} t1 {SOTC} t1 @@ -297,7 +373,7 @@ } # SEQUENTIAL ACCESS DEVICES -0x10 "Device Configuration Page" { +0x10 "Device Configuration" { {Reserved} *t1 {Change Active Partition} t1 {Change Active Format} t1 @@ -326,7 +402,7 @@ {SCSI-3 Permanent Write Protect} t1 } -0x0f "Data Compression Page" { +0x0f "Data Compression" { {Data Compression Enabled} t1 {Date Compression Capable} t1 {Reserved} *t6 @@ -339,7 +415,7 @@ } # Removable devices -0x1b "Removable Block Access Capacities Page" { +0x1b "Removable Block Access Capacities" { {System Floppy Type Device} t1 {Supports Reporting Format Progress} t1 {Reserved} *t6 @@ -351,7 +427,7 @@ } # CD-ROM (and CD-R[W]) devices -0x2a "CD capabilities and mechanical status page" { +0x2a "CD capabilities and mechanical status" { {Reserved} *t4 {Method 2} t1 {CD-RW Read} t1 Modified: stable/11/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.c Sat Jan 21 08:15:51 2017 (r312565) +++ stable/11/sys/cam/scsi/scsi_all.c Sat Jan 21 08:16:41 2017 (r312566) @@ -7622,24 +7622,34 @@ scsi_inquiry(struct ccb_scsiio *csio, u_ } void -scsi_mode_sense(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int8_t tag_action, int dbd, u_int8_t page_code, - u_int8_t page, u_int8_t *param_buf, u_int32_t param_len, - u_int8_t sense_len, u_int32_t timeout) +scsi_mode_sense(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, + int dbd, uint8_t pc, uint8_t page, uint8_t *param_buf, uint32_t param_len, + uint8_t sense_len, uint32_t timeout) { - scsi_mode_sense_len(csio, retries, cbfcnp, tag_action, dbd, - page_code, page, param_buf, param_len, 0, - sense_len, timeout); + scsi_mode_sense_subpage(csio, retries, cbfcnp, tag_action, dbd, + pc, page, 0, param_buf, param_len, 0, sense_len, timeout); } void -scsi_mode_sense_len(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int8_t tag_action, int dbd, u_int8_t page_code, - u_int8_t page, u_int8_t *param_buf, u_int32_t param_len, - int minimum_cmd_size, u_int8_t sense_len, u_int32_t timeout) +scsi_mode_sense_len(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, + int dbd, uint8_t pc, uint8_t page, uint8_t *param_buf, uint32_t param_len, + int minimum_cmd_size, uint8_t sense_len, uint32_t timeout) +{ + + scsi_mode_sense_subpage(csio, retries, cbfcnp, tag_action, dbd, + pc, page, 0, param_buf, param_len, minimum_cmd_size, + sense_len, timeout); +} + +void +scsi_mode_sense_subpage(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, + int dbd, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t *param_buf, + uint32_t param_len, int minimum_cmd_size, uint8_t sense_len, + uint32_t timeout) { u_int8_t cdb_len; @@ -7658,7 +7668,8 @@ scsi_mode_sense_len(struct ccb_scsiio *c scsi_cmd->opcode = MODE_SENSE_6; if (dbd != 0) scsi_cmd->byte2 |= SMS_DBD; - scsi_cmd->page = page_code | page; + scsi_cmd->page = pc | page; + scsi_cmd->subpage = subpage; scsi_cmd->length = param_len; cdb_len = sizeof(*scsi_cmd); } else { @@ -7672,7 +7683,8 @@ scsi_mode_sense_len(struct ccb_scsiio *c scsi_cmd->opcode = MODE_SENSE_10; if (dbd != 0) scsi_cmd->byte2 |= SMS_DBD; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 21 08:17:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0793CBB928; Sat, 21 Jan 2017 08:17:31 +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 B8E4B1AF1; Sat, 21 Jan 2017 08:17:31 +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 v0L8HUDE012562; Sat, 21 Jan 2017 08:17:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8HUch012555; Sat, 21 Jan 2017 08:17:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210817.v0L8HUch012555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:17: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: r312567 - in stable/10: sbin/camcontrol share/misc sys/cam/scsi 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, 21 Jan 2017 08:17:32 -0000 Author: mav Date: Sat Jan 21 08:17:30 2017 New Revision: 312567 URL: https://svnweb.freebsd.org/changeset/base/312567 Log: MFC r311636: Make 'camcontrol modepage' support subpages. Modified: stable/10/sbin/camcontrol/camcontrol.8 stable/10/sbin/camcontrol/camcontrol.c stable/10/sbin/camcontrol/camcontrol.h stable/10/sbin/camcontrol/modeedit.c stable/10/share/misc/scsi_modes stable/10/sys/cam/scsi/scsi_all.c stable/10/sys/cam/scsi/scsi_all.h stable/10/sys/cam/scsi/scsi_ch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.8 Sat Jan 21 08:16:41 2017 (r312566) +++ stable/10/sbin/camcontrol/camcontrol.8 Sat Jan 21 08:17:30 2017 (r312567) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2016 +.Dd January 6, 2017 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -121,7 +121,7 @@ .Ic modepage .Op device id .Op generic args -.Aq Fl m Ar page | Fl l +.Aq Fl m Ar page[,subpage] | Fl l .Op Fl P Ar pgctl .Op Fl b | Fl e .Op Fl d @@ -678,9 +678,10 @@ The editor will be invoked if detects that standard input is terminal. .It Fl l Lists all available mode pages. -.It Fl m Ar mode_page -This specifies the number of the mode page the user would like to view -and/or edit. +If specified more then once, also lists subpages. +.It Fl m Ar page[,subpage] +This specifies the number of the mode page and optionally subpage the user +would like to view and/or edit. This argument is mandatory unless .Fl l is specified. Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Sat Jan 21 08:16:41 2017 (r312566) +++ stable/10/sbin/camcontrol/camcontrol.c Sat Jan 21 08:17:30 2017 (r312567) @@ -122,12 +122,9 @@ typedef enum { CAM_ARG_GET_STDINQ = 0x00002000, CAM_ARG_GET_XFERRATE = 0x00004000, CAM_ARG_INQ_MASK = 0x00007000, - CAM_ARG_MODE_EDIT = 0x00008000, - CAM_ARG_PAGE_CNTL = 0x00010000, CAM_ARG_TIMEOUT = 0x00020000, CAM_ARG_CMD_IN = 0x00040000, CAM_ARG_CMD_OUT = 0x00080000, - CAM_ARG_DBD = 0x00100000, CAM_ARG_ERR_RECOVER = 0x00200000, CAM_ARG_RETRIES = 0x00400000, CAM_ARG_START_UNIT = 0x00800000, @@ -3982,8 +3979,8 @@ reassignblocks(struct cam_device *device #ifndef MINIMALISTIC 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) +mode_sense(struct cam_device *device, int dbd, int pc, int page, int subpage, + int retry_count, int timeout, u_int8_t *data, int datalen) { union ccb *ccb; int retval; @@ -3995,15 +3992,17 @@ mode_sense(struct cam_device *device, in CCB_CLEAR_ALL_EXCEPT_HDR(&ccb->csio); - scsi_mode_sense(&ccb->csio, + scsi_mode_sense_subpage(&ccb->csio, /* retries */ retry_count, /* cbfcnp */ NULL, /* tag_action */ MSG_SIMPLE_Q_TAG, /* dbd */ dbd, - /* page_code */ page_control << 6, - /* page */ mode_page, + /* pc */ pc << 6, + /* page */ page, + /* subpage */ subpage, /* param_buf */ data, /* param_len */ datalen, + /* minimum_cmd_size */ 0, /* sense_len */ SSD_FULL_SIZE, /* timeout */ timeout ? timeout : 5000); @@ -4084,8 +4083,9 @@ void modepage(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout) { - int c, mode_page = -1, page_control = 0; - int binary = 0, list = 0; + char *str_subpage; + int c, page = -1, subpage = -1, pc = 0; + int binary = 0, dbd = 0, edit = 0, list = 0; while ((c = getopt(argc, argv, combinedopt)) != -1) { switch(c) { @@ -4093,40 +4093,44 @@ modepage(struct cam_device *device, int binary = 1; break; case 'd': - arglist |= CAM_ARG_DBD; + dbd = 1; break; case 'e': - arglist |= CAM_ARG_MODE_EDIT; + edit = 1; break; case 'l': - list = 1; + list++; break; case 'm': - mode_page = strtol(optarg, NULL, 0); - if (mode_page < 0) - errx(1, "invalid mode page %d", mode_page); + str_subpage = optarg; + strsep(&str_subpage, ","); + page = strtol(optarg, NULL, 0); + if (str_subpage) + subpage = strtol(str_subpage, NULL, 0); + else + subpage = 0; + if (page < 0) + errx(1, "invalid mode page %d", page); + if (subpage < 0) + errx(1, "invalid mode subpage %d", subpage); break; case 'P': - page_control = strtol(optarg, NULL, 0); - if ((page_control < 0) || (page_control > 3)) - errx(1, "invalid page control field %d", - page_control); - arglist |= CAM_ARG_PAGE_CNTL; + pc = strtol(optarg, NULL, 0); + if ((pc < 0) || (pc > 3)) + errx(1, "invalid page control field %d", pc); break; default: break; } } - if (mode_page == -1 && list == 0) + if (page == -1 && list == 0) errx(1, "you must specify a mode page!"); - if (list) { - mode_list(device, page_control, arglist & CAM_ARG_DBD, - retry_count, timeout); + if (list != 0) { + mode_list(device, dbd, pc, list > 1, retry_count, timeout); } else { - mode_edit(device, mode_page, page_control, - arglist & CAM_ARG_DBD, arglist & CAM_ARG_MODE_EDIT, binary, + mode_edit(device, dbd, pc, page, subpage, edit, binary, retry_count, timeout); } } Modified: stable/10/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.h Sat Jan 21 08:16:41 2017 (r312566) +++ stable/10/sbin/camcontrol/camcontrol.h Sat Jan 21 08:17:30 2017 (r312567) @@ -73,14 +73,14 @@ int camxferrate(struct cam_device *devic int fwdownload(struct cam_device *device, int argc, char **argv, char *combinedopt, int printerrors, int retry_count, int timeout); -void mode_sense(struct cam_device *device, int mode_page, int page_control, - int dbd, int retry_count, int timeout, u_int8_t *data, +void mode_sense(struct cam_device *device, int dbd, int pc, int page, + int subpage, int retry_count, int timeout, uint8_t *data, int datalen); void mode_select(struct cam_device *device, int save_pages, int retry_count, int timeout, u_int8_t *data, int datalen); -void mode_edit(struct cam_device *device, int page, int page_control, int dbd, +void mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, int edit, int binary, int retry_count, int timeout); -void mode_list(struct cam_device *device, int page_control, int dbd, +void mode_list(struct cam_device *device, int dbd, int pc, int subpages, int retry_count, int timeout); int scsidoinquiry(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout); Modified: stable/10/sbin/camcontrol/modeedit.c ============================================================================== --- stable/10/sbin/camcontrol/modeedit.c Sat Jan 21 08:16:41 2017 (r312566) +++ stable/10/sbin/camcontrol/modeedit.c Sat Jan 21 08:17:30 2017 (r312567) @@ -66,9 +66,6 @@ __FBSDID("$FreeBSD$"); #define MODE_PAGE_HEADER(mh) \ (struct scsi_mode_page_header *)find_mode_page_6(mh) -#define MODE_PAGE_DATA(mph) \ - (u_int8_t *)(mph) + sizeof(struct scsi_mode_page_header) - struct editentry { STAILQ_ENTRY(editentry) link; @@ -86,7 +83,8 @@ static int editlist_changed = 0; /* Whet struct pagename { SLIST_ENTRY(pagename) link; - int pagenum; + int page; + int subpage; char *name; }; static SLIST_HEAD(, pagename) namelist; /* Page number to name mappings. */ @@ -106,21 +104,22 @@ static int editentry_save(void *hook, static struct editentry *editentry_lookup(char *name); static int editentry_set(char *name, char *newvalue, int editonly); -static void editlist_populate(struct cam_device *device, - int modepage, int page_control, - int dbd, int retries, int timeout); -static void editlist_save(struct cam_device *device, int modepage, - int page_control, int dbd, int retries, - int timeout); -static void nameentry_create(int pagenum, char *name); -static struct pagename *nameentry_lookup(int pagenum); -static int load_format(const char *pagedb_path, int page); +static void editlist_populate(struct cam_device *device, int dbd, + int pc, int page, int subpage, + int retries, int timeout); +static void editlist_save(struct cam_device *device, int dbd, + int pc, int page, int subpage, + int retries, int timeout); +static void nameentry_create(int page, int subpage, char *name); +static struct pagename *nameentry_lookup(int page, int subpage); +static int load_format(const char *pagedb_path, int lpage, + int lsubpage); static int modepage_write(FILE *file, int editonly); static int modepage_read(FILE *file); static void modepage_edit(void); -static void modepage_dump(struct cam_device *device, int page, - int page_control, int dbd, int retries, - int timeout); +static void modepage_dump(struct cam_device *device, int dbd, + int pc, int page, int subpage, int retries, + int timeout); static void cleanup_editfile(void); @@ -325,10 +324,10 @@ editentry_set(char *name, char *newvalue } static void -nameentry_create(int pagenum, char *name) { +nameentry_create(int page, int subpage, char *name) { struct pagename *newentry; - if (pagenum < 0 || name == NULL || name[0] == '\0') + if (page < 0 || subpage < 0 || name == NULL || name[0] == '\0') return; /* Allocate memory for the new entry and a copy of the entry name. */ @@ -339,16 +338,17 @@ nameentry_create(int pagenum, char *name /* Trim any trailing whitespace for the page name. */ RTRIM(newentry->name); - newentry->pagenum = pagenum; + newentry->page = page; + newentry->subpage = subpage; SLIST_INSERT_HEAD(&namelist, newentry, link); } static struct pagename * -nameentry_lookup(int pagenum) { +nameentry_lookup(int page, int subpage) { struct pagename *scan; SLIST_FOREACH(scan, &namelist, link) { - if (pagenum == scan->pagenum) + if (page == scan->page && subpage == scan->subpage) return (scan); } @@ -357,12 +357,14 @@ nameentry_lookup(int pagenum) { } static int -load_format(const char *pagedb_path, int page) +load_format(const char *pagedb_path, int lpage, int lsubpage) { FILE *pagedb; - char str_pagenum[MAX_PAGENUM_LEN]; + char str_page[MAX_PAGENUM_LEN]; + char *str_subpage; char str_pagename[MAX_PAGENAME_LEN]; - int pagenum; + int page; + int subpage; int depth; /* Quoting depth. */ int found; int lineno; @@ -371,9 +373,10 @@ load_format(const char *pagedb_path, int char c; #define SETSTATE_LOCATE do { \ - str_pagenum[0] = '\0'; \ + str_page[0] = '\0'; \ str_pagename[0] = '\0'; \ - pagenum = -1; \ + page = -1; \ + subpage = -1; \ state = LOCATE; \ } while (0) @@ -450,32 +453,46 @@ load_format(const char *pagedb_path, int * modes without providing a mode definition). */ /* Record the name of this page. */ - pagenum = strtol(str_pagenum, NULL, 0); - nameentry_create(pagenum, str_pagename); + str_subpage = str_page; + strsep(&str_subpage, ","); + page = strtol(str_page, NULL, 0); + if (str_subpage) + subpage = strtol(str_subpage, NULL, 0); + else + subpage = 0; + nameentry_create(page, subpage, str_pagename); SETSTATE_LOCATE; } else if (depth == 0 && c == PAGENAME_START) { SETSTATE_PAGENAME; } else if (c == PAGEDEF_START) { - pagenum = strtol(str_pagenum, NULL, 0); + str_subpage = str_page; + strsep(&str_subpage, ","); + page = strtol(str_page, NULL, 0); + if (str_subpage) + subpage = strtol(str_subpage, NULL, 0); + else + subpage = 0; if (depth == 1) { /* Record the name of this page. */ - nameentry_create(pagenum, str_pagename); + nameentry_create(page, subpage, + str_pagename); /* * Only record the format if this is * the page we are interested in. */ - if (page == pagenum && !found) + if (lpage == page && + lsubpage == subpage && !found) SETSTATE_PAGEDEF; } } else if (c == PAGEDEF_END) { /* Reset the processor state. */ SETSTATE_LOCATE; - } else if (depth == 0 && ! BUFFERFULL(str_pagenum)) { - strncat(str_pagenum, &c, 1); + } else if (depth == 0 && ! BUFFERFULL(str_page)) { + strncat(str_page, &c, 1); } else if (depth == 0) { errx(EX_OSFILE, "%s:%d: %s %zd %s", pagedb_path, lineno, "page identifier exceeds", - sizeof(str_pagenum) - 1, "characters"); + sizeof(str_page) - 1, "characters"); } break; @@ -491,7 +508,7 @@ load_format(const char *pagedb_path, int } else { errx(EX_OSFILE, "%s:%d: %s %zd %s", pagedb_path, lineno, "page name exceeds", - sizeof(str_pagenum) - 1, "characters"); + sizeof(str_page) - 1, "characters"); } break; @@ -532,88 +549,95 @@ load_format(const char *pagedb_path, int } static void -editlist_populate(struct cam_device *device, int modepage, int page_control, - int dbd, int retries, int timeout) +editlist_populate(struct cam_device *device, int dbd, int pc, int page, + int subpage, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; + struct scsi_mode_page_header_sp *mphsp; + int len; STAILQ_INIT(&editlist); /* Fetch changeable values; use to build initial editlist. */ - mode_sense(device, modepage, 1, dbd, retries, timeout, data, + mode_sense(device, dbd, 1, page, subpage, retries, timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); + if ((mph->page_code & SMPH_SPF) == 0) { + mode_pars = (uint8_t *)(mph + 1); + len = mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + mode_pars = (uint8_t *)(mphsp + 1); + len = scsi_2btoul(mphsp->page_length); + } /* Decode the value data, creating edit_entries for each value. */ - buff_decode_visit(mode_pars, mh->data_length, format, - editentry_create, 0); + buff_decode_visit(mode_pars, len, format, editentry_create, 0); /* Fetch the current/saved values; use to set editentry values. */ - mode_sense(device, modepage, page_control, dbd, retries, timeout, data, - sizeof(data)); - buff_decode_visit(mode_pars, mh->data_length, format, - editentry_update, 0); + mode_sense(device, dbd, pc, page, subpage, retries, timeout, + data, sizeof(data)); + buff_decode_visit(mode_pars, len, format, editentry_update, 0); } static void -editlist_save(struct cam_device *device, int modepage, int page_control, - int dbd, int retries, int timeout) +editlist_save(struct cam_device *device, int dbd, int pc, int page, + int subpage, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; + struct scsi_mode_page_header_sp *mphsp; + int len, hlen; /* Make sure that something changed before continuing. */ if (! editlist_changed) return; - /* - * Preload the CDB buffer with the current mode page data. - * XXX If buff_encode_visit would return the number of bytes encoded - * we *should* use that to build a header from scratch. As it is - * now, we need mode_sense to find out the page length. - */ - mode_sense(device, modepage, page_control, dbd, retries, timeout, data, - sizeof(data)); + /* Preload the CDB buffer with the current mode page data. */ + mode_sense(device, dbd, pc, page, subpage, retries, timeout, + data, sizeof(data)); /* Initial headers & offsets. */ mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); + if ((mph->page_code & SMPH_SPF) == 0) { + hlen = sizeof(*mph); + mode_pars = (uint8_t *)(mph + 1); + len = mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + hlen = sizeof(*mphsp); + mode_pars = (uint8_t *)(mphsp + 1); + len = scsi_2btoul(mphsp->page_length); + } /* Encode the value data to be passed back to the device. */ - buff_encode_visit(mode_pars, mh->data_length, format, - editentry_save, 0); + buff_encode_visit(mode_pars, len, format, editentry_save, 0); /* Eliminate block descriptors. */ - bcopy(mph, ((u_int8_t *)mh) + sizeof(*mh), - sizeof(*mph) + mph->page_length); + bcopy(mph, mh + 1, hlen + len); /* Recalculate headers & offsets. */ - mh->blk_desc_len = 0; /* No block descriptors. */ + mh->data_length = 0; /* Reserved for MODE SELECT command. */ mh->dev_spec = 0; /* Clear device-specific parameters. */ + mh->blk_desc_len = 0; /* No block descriptors. */ mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); - - mph->page_code &= SMS_PAGE_CODE;/* Isolate just the page code. */ - mh->data_length = 0; /* Reserved for MODE SELECT command. */ + mph->page_code &= ~SMPH_PS; /* Reserved for MODE SELECT command. */ /* * Write the changes back to the device. If the user editted control * page 3 (saved values) then request the changes be permanently * recorded. */ - mode_select(device, - (page_control << PAGE_CTRL_SHIFT == SMS_PAGE_CTRL_SAVED), - retries, timeout, (u_int8_t *)mh, - sizeof(*mh) + mh->blk_desc_len + sizeof(*mph) + mph->page_length); + mode_select(device, (pc << PAGE_CTRL_SHIFT == SMS_PAGE_CTRL_SAVED), + retries, timeout, (u_int8_t *)mh, sizeof(*mh) + hlen + len); } static int @@ -782,24 +806,32 @@ modepage_edit(void) } static void -modepage_dump(struct cam_device *device, int page, int page_control, int dbd, +modepage_dump(struct cam_device *device, int dbd, int pc, int page, int subpage, int retries, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; - int indx; /* Index for scanning mode params. */ + struct scsi_mode_page_header_sp *mphsp; + int indx, len; - mode_sense(device, page, page_control, dbd, retries, timeout, data, - sizeof(data)); + mode_sense(device, dbd, pc, page, subpage, retries, timeout, + data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; mph = MODE_PAGE_HEADER(mh); - mode_pars = MODE_PAGE_DATA(mph); + if ((mph->page_code & SMPH_SPF) == 0) { + mode_pars = (uint8_t *)(mph + 1); + len = mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + mode_pars = (uint8_t *)(mphsp + 1); + len = scsi_2btoul(mphsp->page_length); + } /* Print the raw mode page data with newlines each 8 bytes. */ - for (indx = 0; indx < mph->page_length; indx++) { + for (indx = 0; indx < len; indx++) { printf("%02x%c",mode_pars[indx], (((indx + 1) % 8) == 0) ? '\n' : ' '); } @@ -817,7 +849,7 @@ cleanup_editfile(void) } void -mode_edit(struct cam_device *device, int page, int page_control, int dbd, +mode_edit(struct cam_device *device, int dbd, int pc, int page, int subpage, int edit, int binary, int retry_count, int timeout) { const char *pagedb_path; /* Path to modepage database. */ @@ -829,15 +861,17 @@ mode_edit(struct cam_device *device, int if ((pagedb_path = getenv("SCSI_MODES")) == NULL) pagedb_path = DEFAULT_SCSI_MODE_DB; - if (load_format(pagedb_path, page) != 0 && (edit || verbose)) { + if (load_format(pagedb_path, page, subpage) != 0 && + (edit || verbose)) { if (errno == ENOENT) { /* Modepage database file not found. */ warn("cannot open modepage database \"%s\"", pagedb_path); } else if (errno == ESRCH) { /* Modepage entry not found in database. */ - warnx("modepage %d not found in database" - "\"%s\"", page, pagedb_path); + warnx("modepage 0x%02x,0x%02x not found in " + "database \"%s\"", page, subpage, + pagedb_path); } /* We can recover in display mode, otherwise we exit. */ if (!edit) { @@ -847,22 +881,20 @@ mode_edit(struct cam_device *device, int exit(EX_OSFILE); } - editlist_populate(device, page, page_control, dbd, retry_count, + editlist_populate(device, dbd, pc, page, subpage, retry_count, timeout); } if (edit) { - if (page_control << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_CURRENT && - page_control << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_SAVED) + if (pc << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_CURRENT && + pc << PAGE_CTRL_SHIFT != SMS_PAGE_CTRL_SAVED) errx(EX_USAGE, "it only makes sense to edit page 0 " "(current) or page 3 (saved values)"); modepage_edit(); - editlist_save(device, page, page_control, dbd, retry_count, - timeout); + editlist_save(device, dbd, pc, page, subpage, retry_count, timeout); } else if (binary || STAILQ_EMPTY(&editlist)) { /* Display without formatting information. */ - modepage_dump(device, page, page_control, dbd, retry_count, - timeout); + modepage_dump(device, dbd, pc, page, subpage, retry_count, timeout); } else { /* Display with format. */ modepage_write(stdout, 0); @@ -870,44 +902,55 @@ mode_edit(struct cam_device *device, int } void -mode_list(struct cam_device *device, int page_control, int dbd, +mode_list(struct cam_device *device, int dbd, int pc, int subpages, int retry_count, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; + struct scsi_mode_page_header_sp *mphsp; struct pagename *nameentry; const char *pagedb_path; - int len; + int len, page, subpage; if ((pagedb_path = getenv("SCSI_MODES")) == NULL) pagedb_path = DEFAULT_SCSI_MODE_DB; - if (load_format(pagedb_path, 0) != 0 && verbose && errno == ENOENT) { + if (load_format(pagedb_path, 0, 0) != 0 && verbose && errno == ENOENT) { /* Modepage database file not found. */ warn("cannot open modepage database \"%s\"", pagedb_path); } /* Build the list of all mode pages by querying the "all pages" page. */ - mode_sense(device, SMS_ALL_PAGES_PAGE, page_control, dbd, retry_count, - timeout, data, sizeof(data)); + mode_sense(device, dbd, pc, SMS_ALL_PAGES_PAGE, + subpages ? SMS_SUBPAGE_ALL : 0, + retry_count, timeout, data, sizeof(data)); mh = (struct scsi_mode_header_6 *)data; len = sizeof(*mh) + mh->blk_desc_len; /* Skip block descriptors. */ /* Iterate through the pages in the reply. */ while (len < mh->data_length) { /* Locate the next mode page header. */ - mph = (struct scsi_mode_page_header *) - ((intptr_t)mh + len); + mph = (struct scsi_mode_page_header *)((intptr_t)mh + len); - mph->page_code &= SMS_PAGE_CODE; - nameentry = nameentry_lookup(mph->page_code); + if ((mph->page_code & SMPH_SPF) == 0) { + page = mph->page_code & SMS_PAGE_CODE; + subpage = 0; + len += sizeof(*mph) + mph->page_length; + } else { + mphsp = (struct scsi_mode_page_header_sp *)mph; + page = mphsp->page_code & SMS_PAGE_CODE; + subpage = mphsp->subpage; + len += sizeof(*mphsp) + scsi_2btoul(mphsp->page_length); + } - if (nameentry == NULL || nameentry->name == NULL) - printf("0x%02x\n", mph->page_code); - else - printf("0x%02x\t%s\n", mph->page_code, - nameentry->name); - len += mph->page_length + sizeof(*mph); + nameentry = nameentry_lookup(page, subpage); + if (subpage == 0) { + printf("0x%02x\t%s\n", page, + nameentry ? nameentry->name : ""); + } else { + printf("0x%02x,0x%02x\t%s\n", page, subpage, + nameentry ? nameentry->name : ""); + } } } Modified: stable/10/share/misc/scsi_modes ============================================================================== --- stable/10/share/misc/scsi_modes Sat Jan 21 08:16:41 2017 (r312566) +++ stable/10/share/misc/scsi_modes Sat Jan 21 08:17:30 2017 (r312567) @@ -49,7 +49,11 @@ # ALL DEVICE TYPES -0x0a "Control Mode Page" { +0x0a,0x03 "Command Duration Limit A"; + +0x0a,0x04 "Command Duration Limit B"; + +0x0a "Control" { {TST} t3 {TMF_ONLY} t1 {DPICZ} t1 @@ -78,7 +82,18 @@ {Extended Self-Test Completion Time} i2 } -0x02 "Disconnect-Reconnect Page" { +0x0a,0x01 "Control Extension" { + {Reserved} *t4 + {DLC} t1 + {TCMOS} t1 + {SCSIP} t1 + {IALUAE} t1 + {Reserved} *t4 + {Initial Command Priority} t4 + {Maximum Sense Data Length} i1 +} + +0x02 "Disconnect-Reconnect" { {Buffer Full Ratio} i1 {Buffer Empty Ratio} i1 {Bus Inactivity Limit} i2 @@ -92,26 +107,11 @@ {Reserved} *i1 } -0x15 "Extended Page"; +0x15 "Extended"; -0x16 "Extended Device-Type Specific Page"; +0x16 "Extended Device-Type Specific"; -0x1c "Informational Exceptions Control Page" { - {PERF} t1 - {Reserved} *t1 - {EBF} t1 - {EWasc} t1 - {DExcpt} t1 - {TEST} t1 - {EBACKERR} t1 - {LogErr} t1 - {Reserved} *t4 - {MRIE} t4 - {Interval Timer} i4 - {Report Count} i4 -} - -0x09 "Peripheral Device Page" { +0x09 "Peripheral Device" { {Interface Identifier} i2 {Reserved} *i1 {Reserved} *i1 @@ -119,21 +119,69 @@ {Reserved} *i1 } -0x1a "Power Condition Page" { - {Reserved} *i1 +0x1a "Power Condition" { + {PM_BG_PRECEDENCE} t1 + {Reserved} *t6 + {STANDBY_Y} t1 + {Reserved} *t4 + {IDLE_C} t1 + {IDLE_B} t1 + {IDLE_A} t1 + {STANDBY_Z} t1 + {IDLE_A Condition Timer} i4 + {STANDBY_Z Condition Timer} i4 + {IDLE_B Condition Timer} i4 + {IDLE_C Condition Timer} i4 + {STANDBY_Y Condition Timer} i4 + {Reserved} *i4 + {Reserved} *i4 + {Reserved} *i4 + {Reserved} *i3 + {CCF Idle} t2 + {CCF Standby} t2 + {CCF Stopped} t2 + {Reserved} *t2 +} + +0x1a,0x01 "Power Consumption" { + {Reserved} *i2 {Reserved} *t6 - {Idle} t1 - {Standby} t1 - {Idle Condition Timer} i4 - {Standby Condition Timer} i4 + {Active Level} t2 + {Power Consumption Identifier} i1 + {Reserved} *i4 + {Reserved} *i4 } -0x18 "Protocol-Specific LUN Page"; +0x18 "Protocol-Specific Logical Unit"; -0x19 "Protocol-Specific Port Page"; +0x19 "Protocol-Specific Port"; # DIRECT ACCESS DEVICES -0x08 "Caching Page" { + +0x0a,0x02 "Application Tag"; + +0x1a,0xf1 "ATA Power Condition"; + +0x1c,0x01 "Background Control" { + {Reserved} *t5 + {S_L_FULL} *t1 + {LOWIR} *t1 + {EN_BMS} *t1 + {Reserved} *t7 + {EN_PS} *t1 + {Background Medium Scan Interval Time} i2 + {Background Pre-Scan Time Limit} i2 + {Minimum Idle Time Before Background Scan} i2 + {Maximum Time To Suspend Background Scan} i2 + {Reserved} *i2 +} + +0x0a,0x06 "Background Operation Control" { + {BO_MODE} t2 + {Reserved} *t6 +} + +0x08 "Caching" { {IC} t1 {ABPF} t1 {CAP} t1 @@ -159,7 +207,7 @@ {Reserved} *t4 } -0x05 "Flexible Disk Page" { +0x05 "Flexible Disk" { {Transfer rate} i2 {Number of heads} i1 {Sectors per track} i1 @@ -190,7 +238,7 @@ {Reserved} *i1 } -0x03 "Format Device Page" { +0x03 "Format Device" { {Tracks per Zone} i2 {Alternate Sectors per Zone} i2 {Alternate Tracks per Zone} i2 @@ -207,7 +255,34 @@ {Reserved} *t4 } -0x0b "Medium Types Supported Page" { +0x0a,0x05 "I/O Advice Hints Grouping"; + +0x1c "Informational Exceptions Control" { + {PERF} t1 + {Reserved} *t1 + {EBF} t1 + {EWasc} t1 + {DExcpt} t1 + {TEST} t1 + {EBACKERR} t1 + {LogErr} t1 + {Reserved} *t4 + {MRIE} t4 + {Interval Timer} i4 + {Report Count} i4 +} + +0x1c,0x02 "Logical Block Provisioning" { + {Reserved} *t7 + {SITUA} t1 + {Reserved} *i1 + {Reserved} *i1 + {Reserved} *i1 + {Reserved} *i4 + {Reserved} *i4 +} + +0x0b "Medium Types Supported" { {Reserved} *i1 {Reserved} *i1 {Medium type one supported} i1 @@ -216,10 +291,11 @@ {Medium type four supported} i1 } -# Notch page (0x0c) -0x0c "Notch and Partition Page"; +0x0c "Notch and Partition"; + +0x0a,0xf1 "PATA Control"; -0x01 "Read-Write Error Recovery Page" { +0x01 "Read-Write Error Recovery" { {AWRE (Auto Write Reallocation Enbld)} t1 {ARRE (Auto Read Reallocation Enbld)} t1 {TB (Transfer Block)} t1 @@ -240,7 +316,7 @@ {Recovery Time Limit} i2 } -0x04 "Rigid Disk Drive Geometry Page" { +0x04 "Rigid Disk Drive Geometry" { {Number of Cylinders} i3 {Number of Heads} i1 {Starting Cylinder-Write Precompensation} i3 @@ -256,7 +332,7 @@ {Reserved} *i1 } -0x07 "Verify Error Recovery Page" { +0x07 "Verify Error Recovery" { {Reserved} *t4 {EER} t1 {PER} t1 @@ -272,7 +348,7 @@ {Verify Recovery Time Limit} i2 } -0x0E "CD-ROM Audio Control Parameters Page" { +0x0E "CD-ROM Audio Control Parameters" { {Reserved} *t5 {Immed} t1 {SOTC} t1 @@ -297,7 +373,7 @@ } # SEQUENTIAL ACCESS DEVICES -0x10 "Device Configuration Page" { +0x10 "Device Configuration" { {Reserved} *t1 {Change Active Partition} t1 {Change Active Format} t1 @@ -326,7 +402,7 @@ {SCSI-3 Permanent Write Protect} t1 } -0x0f "Data Compression Page" { +0x0f "Data Compression" { {Data Compression Enabled} t1 {Date Compression Capable} t1 {Reserved} *t6 @@ -339,7 +415,7 @@ } # Removable devices -0x1b "Removable Block Access Capacities Page" { +0x1b "Removable Block Access Capacities" { {System Floppy Type Device} t1 {Supports Reporting Format Progress} t1 {Reserved} *t6 @@ -351,7 +427,7 @@ } # CD-ROM (and CD-R[W]) devices -0x2a "CD capabilities and mechanical status page" { +0x2a "CD capabilities and mechanical status" { {Reserved} *t4 {Method 2} t1 {CD-RW Read} t1 Modified: stable/10/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.c Sat Jan 21 08:16:41 2017 (r312566) +++ stable/10/sys/cam/scsi/scsi_all.c Sat Jan 21 08:17:30 2017 (r312567) @@ -7622,24 +7622,34 @@ scsi_inquiry(struct ccb_scsiio *csio, u_ } void -scsi_mode_sense(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int8_t tag_action, int dbd, u_int8_t page_code, - u_int8_t page, u_int8_t *param_buf, u_int32_t param_len, - u_int8_t sense_len, u_int32_t timeout) +scsi_mode_sense(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, + int dbd, uint8_t pc, uint8_t page, uint8_t *param_buf, uint32_t param_len, + uint8_t sense_len, uint32_t timeout) { - scsi_mode_sense_len(csio, retries, cbfcnp, tag_action, dbd, - page_code, page, param_buf, param_len, 0, - sense_len, timeout); + scsi_mode_sense_subpage(csio, retries, cbfcnp, tag_action, dbd, + pc, page, 0, param_buf, param_len, 0, sense_len, timeout); } void -scsi_mode_sense_len(struct ccb_scsiio *csio, u_int32_t retries, - void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int8_t tag_action, int dbd, u_int8_t page_code, - u_int8_t page, u_int8_t *param_buf, u_int32_t param_len, - int minimum_cmd_size, u_int8_t sense_len, u_int32_t timeout) +scsi_mode_sense_len(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, + int dbd, uint8_t pc, uint8_t page, uint8_t *param_buf, uint32_t param_len, + int minimum_cmd_size, uint8_t sense_len, uint32_t timeout) +{ + + scsi_mode_sense_subpage(csio, retries, cbfcnp, tag_action, dbd, + pc, page, 0, param_buf, param_len, minimum_cmd_size, + sense_len, timeout); +} + +void +scsi_mode_sense_subpage(struct ccb_scsiio *csio, uint32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, + int dbd, uint8_t pc, uint8_t page, uint8_t subpage, uint8_t *param_buf, + uint32_t param_len, int minimum_cmd_size, uint8_t sense_len, + uint32_t timeout) { u_int8_t cdb_len; @@ -7658,7 +7668,8 @@ scsi_mode_sense_len(struct ccb_scsiio *c scsi_cmd->opcode = MODE_SENSE_6; if (dbd != 0) scsi_cmd->byte2 |= SMS_DBD; - scsi_cmd->page = page_code | page; + scsi_cmd->page = pc | page; + scsi_cmd->subpage = subpage; scsi_cmd->length = param_len; cdb_len = sizeof(*scsi_cmd); } else { @@ -7672,7 +7683,8 @@ scsi_mode_sense_len(struct ccb_scsiio *c scsi_cmd->opcode = MODE_SENSE_10; if (dbd != 0) scsi_cmd->byte2 |= SMS_DBD; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 21 08:19:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3BA7CBB9C7; Sat, 21 Jan 2017 08:19:14 +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 AA85E1CAB; Sat, 21 Jan 2017 08:19:14 +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 v0L8JDMd012681; Sat, 21 Jan 2017 08:19:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8JDfc012680; Sat, 21 Jan 2017 08:19:13 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210819.v0L8JDfc012680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:19: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: r312568 - stable/11/sbin/camcontrol 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, 21 Jan 2017 08:19:15 -0000 Author: mav Date: Sat Jan 21 08:19:13 2017 New Revision: 312568 URL: https://svnweb.freebsd.org/changeset/base/312568 Log: MFC r311897: Add checks for received mode page length. If our buffer is too small, we may receive part of the page, and should not try read/write past the end of the buffer. Reported by: Coverity CID: 1368374, 1368375 Modified: stable/11/sbin/camcontrol/modeedit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/camcontrol/modeedit.c ============================================================================== --- stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 08:17:30 2017 (r312567) +++ stable/11/sbin/camcontrol/modeedit.c Sat Jan 21 08:19:13 2017 (r312568) @@ -557,7 +557,7 @@ editlist_populate(struct cam_device *dev struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int len; + size_t len; STAILQ_INIT(&editlist); @@ -575,6 +575,7 @@ editlist_populate(struct cam_device *dev mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Decode the value data, creating edit_entries for each value. */ buff_decode_visit(mode_pars, len, format, editentry_create, 0); @@ -594,7 +595,7 @@ editlist_save(struct cam_device *device, struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int len, hlen; + size_t len, hlen; /* Make sure that something changed before continuing. */ if (! editlist_changed) @@ -617,6 +618,7 @@ editlist_save(struct cam_device *device, mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Encode the value data to be passed back to the device. */ buff_encode_visit(mode_pars, len, format, editentry_save, 0); @@ -814,7 +816,7 @@ modepage_dump(struct cam_device *device, struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int indx, len; + size_t indx, len; mode_sense(device, dbd, pc, page, subpage, retries, timeout, data, sizeof(data)); @@ -829,6 +831,7 @@ modepage_dump(struct cam_device *device, mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Print the raw mode page data with newlines each 8 bytes. */ for (indx = 0; indx < len; indx++) { From owner-svn-src-all@freebsd.org Sat Jan 21 08:19:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 356BDCBBA2F; Sat, 21 Jan 2017 08:19: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 DF02D1E01; Sat, 21 Jan 2017 08:19:43 +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 v0L8JhBc012756; Sat, 21 Jan 2017 08:19:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8Jhwd012755; Sat, 21 Jan 2017 08:19:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210819.v0L8Jhwd012755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:19:43 +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: r312569 - stable/10/sbin/camcontrol 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, 21 Jan 2017 08:19:44 -0000 Author: mav Date: Sat Jan 21 08:19:42 2017 New Revision: 312569 URL: https://svnweb.freebsd.org/changeset/base/312569 Log: MFC r311897: Add checks for received mode page length. If our buffer is too small, we may receive part of the page, and should not try read/write past the end of the buffer. Reported by: Coverity CID: 1368374, 1368375 Modified: stable/10/sbin/camcontrol/modeedit.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/camcontrol/modeedit.c ============================================================================== --- stable/10/sbin/camcontrol/modeedit.c Sat Jan 21 08:19:13 2017 (r312568) +++ stable/10/sbin/camcontrol/modeedit.c Sat Jan 21 08:19:42 2017 (r312569) @@ -557,7 +557,7 @@ editlist_populate(struct cam_device *dev struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int len; + size_t len; STAILQ_INIT(&editlist); @@ -575,6 +575,7 @@ editlist_populate(struct cam_device *dev mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Decode the value data, creating edit_entries for each value. */ buff_decode_visit(mode_pars, len, format, editentry_create, 0); @@ -594,7 +595,7 @@ editlist_save(struct cam_device *device, struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int len, hlen; + size_t len, hlen; /* Make sure that something changed before continuing. */ if (! editlist_changed) @@ -617,6 +618,7 @@ editlist_save(struct cam_device *device, mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Encode the value data to be passed back to the device. */ buff_encode_visit(mode_pars, len, format, editentry_save, 0); @@ -814,7 +816,7 @@ modepage_dump(struct cam_device *device, struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct scsi_mode_page_header_sp *mphsp; - int indx, len; + size_t indx, len; mode_sense(device, dbd, pc, page, subpage, retries, timeout, data, sizeof(data)); @@ -829,6 +831,7 @@ modepage_dump(struct cam_device *device, mode_pars = (uint8_t *)(mphsp + 1); len = scsi_2btoul(mphsp->page_length); } + len = MIN(len, sizeof(data) - (mode_pars - data)); /* Print the raw mode page data with newlines each 8 bytes. */ for (indx = 0; indx < len; indx++) { From owner-svn-src-all@freebsd.org Sat Jan 21 08:29:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D079CBBC2A; Sat, 21 Jan 2017 08:29:42 +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 3E5D8128F; Sat, 21 Jan 2017 08:29:42 +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 v0L8Tf8U016813; Sat, 21 Jan 2017 08:29:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8TfDL016809; Sat, 21 Jan 2017 08:29:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210829.v0L8TfDL016809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:29: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: r312570 - 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, 21 Jan 2017 08:29:42 -0000 Author: mav Date: Sat Jan 21 08:29:40 2017 New Revision: 312570 URL: https://svnweb.freebsd.org/changeset/base/312570 Log: MFC r310539: Remove CTL_MAX_LUNS from places where it is not required. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl_frontend.c stable/11/sys/cam/ctl/ctl_tpc.c stable/11/sys/cam/ctl/ctl_tpc_local.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:19:42 2017 (r312569) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:29:40 2017 (r312570) @@ -1218,7 +1218,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); @@ -2906,18 +2906,18 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } case CTL_DUMP_STRUCTS: { - int i, j, k; + int j, k; struct ctl_port *port; struct ctl_frontend *fe; mtx_lock(&softc->ctl_lock); printf("CTL Persistent Reservation information start:\n"); - for (i = 0; i < CTL_MAX_LUNS; i++) { - lun = softc->ctl_luns[i]; - - if ((lun == NULL) - || ((lun->flags & CTL_LUN_DISABLED) != 0)) + STAILQ_FOREACH(lun, &softc->lun_list, links) { + mtx_lock(&lun->lun_lock); + if ((lun->flags & CTL_LUN_DISABLED) != 0) { + mtx_unlock(&lun->lun_lock); continue; + } for (j = 0; j < CTL_MAX_PORTS; j++) { if (lun->pr_keys[j] == NULL) @@ -2925,11 +2925,12 @@ ctl_ioctl(struct cdev *dev, u_long cmd, for (k = 0; k < CTL_MAX_INIT_PER_PORT; k++){ if (lun->pr_keys[j][k] == 0) continue; - printf(" LUN %d port %d iid %d key " - "%#jx\n", i, j, k, + printf(" LUN %ju port %d iid %d key " + "%#jx\n", lun->lun, j, k, (uintmax_t)lun->pr_keys[j][k]); } } + mtx_unlock(&lun->lun_lock); } printf("CTL Persistent Reservation information end\n"); printf("CTL Ports:\n"); @@ -3312,7 +3313,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, sbuf_printf(sb, "\ton\n"); for (j = 0; j < CTL_MAX_LUNS; j++) { plun = ctl_lun_map_from_port(port, j); - if (plun >= CTL_MAX_LUNS) + if (plun == UINT32_MAX) continue; sbuf_printf(sb, "\t%u\n", @@ -3380,8 +3381,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } if (port->status & CTL_PORT_STATUS_ONLINE) { STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= - CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == + UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_port(lun, lm->port, -1, @@ -3509,7 +3510,7 @@ ctl_lun_map_set(struct ctl_port *port, u } old = port->lun_map[plun]; port->lun_map[plun] = glun; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old >= CTL_MAX_LUNS) { + if ((port->status & CTL_PORT_STATUS_ONLINE) && old == UINT32_MAX) { if (port->lun_enable != NULL) port->lun_enable(port->targ_lun_arg, plun); ctl_isc_announce_port(port); @@ -3526,7 +3527,7 @@ ctl_lun_map_unset(struct ctl_port *port, return (0); old = port->lun_map[plun]; port->lun_map[plun] = UINT32_MAX; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old < CTL_MAX_LUNS) { + if ((port->status & CTL_PORT_STATUS_ONLINE) && old != UINT32_MAX) { if (port->lun_disable != NULL) port->lun_disable(port->targ_lun_arg, plun); ctl_isc_announce_port(port); @@ -3540,7 +3541,7 @@ ctl_lun_map_from_port(struct ctl_port *p if (port == NULL) return (UINT32_MAX); - if (port->lun_map == NULL || lun_id >= CTL_MAX_LUNS) + if (port->lun_map == NULL || lun_id == UINT32_MAX) return (lun_id); return (port->lun_map[lun_id]); } @@ -7142,7 +7143,7 @@ ctl_report_tagret_port_groups(struct ctl STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; num_target_ports++; if (port->status & CTL_PORT_STATUS_HA_SHARED) @@ -7234,7 +7235,7 @@ ctl_report_tagret_port_groups(struct ctl if (!softc->is_single && (port->status & CTL_PORT_STATUS_HA_SHARED) == 0) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, tpg_desc->descriptors[pc]. relative_target_port_identifier); @@ -7259,7 +7260,7 @@ ctl_report_tagret_port_groups(struct ctl continue; if (port->status & CTL_PORT_STATUS_HA_SHARED) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, tpg_desc->descriptors[pc]. relative_target_port_identifier); @@ -9078,7 +9079,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_lock(&softc->ctl_lock); num_luns = 0; for (targ_lun_id = 0; targ_lun_id < CTL_MAX_LUNS; targ_lun_id++) { - if (ctl_lun_map_from_port(port, targ_lun_id) < CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, targ_lun_id) != UINT32_MAX) num_luns++; } mtx_unlock(&softc->ctl_lock); @@ -9138,7 +9139,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_lock(&softc->ctl_lock); for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { lun_id = ctl_lun_map_from_port(port, targ_lun_id); - if (lun_id >= CTL_MAX_LUNS) + if (lun_id == UINT32_MAX) continue; lun = softc->ctl_luns[lun_id]; if (lun == NULL) @@ -9774,7 +9775,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; num_target_ports++; if (port->init_devid) @@ -9825,7 +9826,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, pd->relative_port_id); if (port->init_devid) { @@ -11882,7 +11883,7 @@ ctl_target_reset(struct ctl_softc *softc port = ctl_io_port(&io->io_hdr); STAILQ_FOREACH(lun, &softc->lun_list, links) { if (port != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; retval += ctl_do_lun_reset(lun, io, ua_type); } Modified: stable/11/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:19:42 2017 (r312569) +++ stable/11/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:29:40 2017 (r312570) @@ -316,8 +316,8 @@ ctl_port_online(struct ctl_port *port) if (port->lun_enable != NULL) { if (port->lun_map) { for (l = 0; l < CTL_MAX_LUNS; l++) { - if (ctl_lun_map_from_port(port, l) >= - CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, l) == + UINT32_MAX) continue; port->lun_enable(port->targ_lun_arg, l); } @@ -338,7 +338,7 @@ ctl_port_online(struct ctl_port *port) } port->status |= CTL_PORT_STATUS_ONLINE; STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); @@ -360,8 +360,8 @@ ctl_port_offline(struct ctl_port *port) if (port->lun_disable != NULL) { if (port->lun_map) { for (l = 0; l < CTL_MAX_LUNS; l++) { - if (ctl_lun_map_from_port(port, l) >= - CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, l) == + UINT32_MAX) continue; port->lun_disable(port->targ_lun_arg, l); } @@ -373,7 +373,7 @@ ctl_port_offline(struct ctl_port *port) mtx_lock(&softc->ctl_lock); port->status &= ~CTL_PORT_STATUS_ONLINE; STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); Modified: stable/11/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_tpc.c Sat Jan 21 08:19:42 2017 (r312569) +++ stable/11/sys/cam/ctl/ctl_tpc.c Sat Jan 21 08:29:40 2017 (r312570) @@ -894,7 +894,7 @@ tpc_process_b2b(struct tpc_list *list) dcscd = scsi_2btoul(seg->dst_cscd); sl = tpc_resolve(list, scscd, &srcblock, NULL, NULL); dl = tpc_resolve(list, dcscd, &dstblock, &pb, &pbo); - if (sl >= CTL_MAX_LUNS || dl >= CTL_MAX_LUNS) { + if (sl == UINT64_MAX || dl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, @@ -1042,7 +1042,7 @@ tpc_process_verify(struct tpc_list *list seg = (struct scsi_ec_segment_verify *)list->seg[list->curseg]; cscd = scsi_2btoul(seg->src_cscd); sl = tpc_resolve(list, cscd, NULL, NULL, NULL); - if (sl >= CTL_MAX_LUNS) { + if (sl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, @@ -1106,7 +1106,7 @@ tpc_process_register_key(struct tpc_list seg = (struct scsi_ec_segment_register_key *)list->seg[list->curseg]; cscd = scsi_2btoul(seg->dst_cscd); dl = tpc_resolve(list, cscd, NULL, NULL, NULL); - if (dl >= CTL_MAX_LUNS) { + if (dl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, Modified: stable/11/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_tpc_local.c Sat Jan 21 08:19:42 2017 (r312569) +++ stable/11/sys/cam/ctl/ctl_tpc_local.c Sat Jan 21 08:29:40 2017 (r312570) @@ -290,7 +290,7 @@ tpcl_resolve(struct ctl_softc *softc, in port = NULL; STAILQ_FOREACH(lun, &softc->lun_list, links) { if (port != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; if (lun->lun_devid == NULL) continue; From owner-svn-src-all@freebsd.org Sat Jan 21 08:30:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A683CBBC98; Sat, 21 Jan 2017 08:30:12 +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 DF7AF13DD; Sat, 21 Jan 2017 08:30:11 +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 v0L8UBh2016911; Sat, 21 Jan 2017 08:30:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8UA2a016907; Sat, 21 Jan 2017 08:30:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210830.v0L8UA2a016907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:30: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: r312571 - stable/10/sys/cam/ctl 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, 21 Jan 2017 08:30:12 -0000 Author: mav Date: Sat Jan 21 08:30:10 2017 New Revision: 312571 URL: https://svnweb.freebsd.org/changeset/base/312571 Log: MFC r310539: Remove CTL_MAX_LUNS from places where it is not required. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_tpc.c stable/10/sys/cam/ctl/ctl_tpc_local.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:29:40 2017 (r312570) +++ stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:30:10 2017 (r312571) @@ -1220,7 +1220,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); @@ -2897,18 +2897,18 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } case CTL_DUMP_STRUCTS: { - int i, j, k; + int j, k; struct ctl_port *port; struct ctl_frontend *fe; mtx_lock(&softc->ctl_lock); printf("CTL Persistent Reservation information start:\n"); - for (i = 0; i < CTL_MAX_LUNS; i++) { - lun = softc->ctl_luns[i]; - - if ((lun == NULL) - || ((lun->flags & CTL_LUN_DISABLED) != 0)) + STAILQ_FOREACH(lun, &softc->lun_list, links) { + mtx_lock(&lun->lun_lock); + if ((lun->flags & CTL_LUN_DISABLED) != 0) { + mtx_unlock(&lun->lun_lock); continue; + } for (j = 0; j < CTL_MAX_PORTS; j++) { if (lun->pr_keys[j] == NULL) @@ -2916,11 +2916,12 @@ ctl_ioctl(struct cdev *dev, u_long cmd, for (k = 0; k < CTL_MAX_INIT_PER_PORT; k++){ if (lun->pr_keys[j][k] == 0) continue; - printf(" LUN %d port %d iid %d key " - "%#jx\n", i, j, k, + printf(" LUN %ju port %d iid %d key " + "%#jx\n", lun->lun, j, k, (uintmax_t)lun->pr_keys[j][k]); } } + mtx_unlock(&lun->lun_lock); } printf("CTL Persistent Reservation information end\n"); printf("CTL Ports:\n"); @@ -3303,7 +3304,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, sbuf_printf(sb, "\ton\n"); for (j = 0; j < CTL_MAX_LUNS; j++) { plun = ctl_lun_map_from_port(port, j); - if (plun >= CTL_MAX_LUNS) + if (plun == UINT32_MAX) continue; sbuf_printf(sb, "\t%u\n", @@ -3371,8 +3372,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } if (port->status & CTL_PORT_STATUS_ONLINE) { STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= - CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == + UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_port(lun, lm->port, -1, @@ -3500,7 +3501,7 @@ ctl_lun_map_set(struct ctl_port *port, u } old = port->lun_map[plun]; port->lun_map[plun] = glun; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old >= CTL_MAX_LUNS) { + if ((port->status & CTL_PORT_STATUS_ONLINE) && old == UINT32_MAX) { if (port->lun_enable != NULL) port->lun_enable(port->targ_lun_arg, plun); ctl_isc_announce_port(port); @@ -3517,7 +3518,7 @@ ctl_lun_map_unset(struct ctl_port *port, return (0); old = port->lun_map[plun]; port->lun_map[plun] = UINT32_MAX; - if ((port->status & CTL_PORT_STATUS_ONLINE) && old < CTL_MAX_LUNS) { + if ((port->status & CTL_PORT_STATUS_ONLINE) && old != UINT32_MAX) { if (port->lun_disable != NULL) port->lun_disable(port->targ_lun_arg, plun); ctl_isc_announce_port(port); @@ -3531,7 +3532,7 @@ ctl_lun_map_from_port(struct ctl_port *p if (port == NULL) return (UINT32_MAX); - if (port->lun_map == NULL || lun_id >= CTL_MAX_LUNS) + if (port->lun_map == NULL || lun_id == UINT32_MAX) return (lun_id); return (port->lun_map[lun_id]); } @@ -7133,7 +7134,7 @@ ctl_report_tagret_port_groups(struct ctl STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; num_target_ports++; if (port->status & CTL_PORT_STATUS_HA_SHARED) @@ -7225,7 +7226,7 @@ ctl_report_tagret_port_groups(struct ctl if (!softc->is_single && (port->status & CTL_PORT_STATUS_HA_SHARED) == 0) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, tpg_desc->descriptors[pc]. relative_target_port_identifier); @@ -7250,7 +7251,7 @@ ctl_report_tagret_port_groups(struct ctl continue; if (port->status & CTL_PORT_STATUS_HA_SHARED) continue; - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, tpg_desc->descriptors[pc]. relative_target_port_identifier); @@ -9069,7 +9070,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_lock(&softc->ctl_lock); num_luns = 0; for (targ_lun_id = 0; targ_lun_id < CTL_MAX_LUNS; targ_lun_id++) { - if (ctl_lun_map_from_port(port, targ_lun_id) < CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, targ_lun_id) != UINT32_MAX) num_luns++; } mtx_unlock(&softc->ctl_lock); @@ -9129,7 +9130,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio mtx_lock(&softc->ctl_lock); for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { lun_id = ctl_lun_map_from_port(port, targ_lun_id); - if (lun_id >= CTL_MAX_LUNS) + if (lun_id == UINT32_MAX) continue; lun = softc->ctl_luns[lun_id]; if (lun == NULL) @@ -9765,7 +9766,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; num_target_ports++; if (port->init_devid) @@ -9816,7 +9817,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) continue; if (lun != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; scsi_ulto2b(port->targ_port, pd->relative_port_id); if (port->init_devid) { @@ -11873,7 +11874,7 @@ ctl_target_reset(struct ctl_softc *softc port = ctl_io_port(&io->io_hdr); STAILQ_FOREACH(lun, &softc->lun_list, links) { if (port != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; retval += ctl_do_lun_reset(lun, io, ua_type); } Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:29:40 2017 (r312570) +++ stable/10/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:30:10 2017 (r312571) @@ -316,8 +316,8 @@ ctl_port_online(struct ctl_port *port) if (port->lun_enable != NULL) { if (port->lun_map) { for (l = 0; l < CTL_MAX_LUNS; l++) { - if (ctl_lun_map_from_port(port, l) >= - CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, l) == + UINT32_MAX) continue; port->lun_enable(port->targ_lun_arg, l); } @@ -338,7 +338,7 @@ ctl_port_online(struct ctl_port *port) } port->status |= CTL_PORT_STATUS_ONLINE; STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); @@ -360,8 +360,8 @@ ctl_port_offline(struct ctl_port *port) if (port->lun_disable != NULL) { if (port->lun_map) { for (l = 0; l < CTL_MAX_LUNS; l++) { - if (ctl_lun_map_from_port(port, l) >= - CTL_MAX_LUNS) + if (ctl_lun_map_from_port(port, l) == + UINT32_MAX) continue; port->lun_disable(port->targ_lun_arg, l); } @@ -373,7 +373,7 @@ ctl_port_offline(struct ctl_port *port) mtx_lock(&softc->ctl_lock); port->status &= ~CTL_PORT_STATUS_ONLINE; STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + if (ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; mtx_lock(&lun->lun_lock); ctl_est_ua_all(lun, -1, CTL_UA_INQ_CHANGE); Modified: stable/10/sys/cam/ctl/ctl_tpc.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc.c Sat Jan 21 08:29:40 2017 (r312570) +++ stable/10/sys/cam/ctl/ctl_tpc.c Sat Jan 21 08:30:10 2017 (r312571) @@ -894,7 +894,7 @@ tpc_process_b2b(struct tpc_list *list) dcscd = scsi_2btoul(seg->dst_cscd); sl = tpc_resolve(list, scscd, &srcblock, NULL, NULL); dl = tpc_resolve(list, dcscd, &dstblock, &pb, &pbo); - if (sl >= CTL_MAX_LUNS || dl >= CTL_MAX_LUNS) { + if (sl == UINT64_MAX || dl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, @@ -1042,7 +1042,7 @@ tpc_process_verify(struct tpc_list *list seg = (struct scsi_ec_segment_verify *)list->seg[list->curseg]; cscd = scsi_2btoul(seg->src_cscd); sl = tpc_resolve(list, cscd, NULL, NULL, NULL); - if (sl >= CTL_MAX_LUNS) { + if (sl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, @@ -1106,7 +1106,7 @@ tpc_process_register_key(struct tpc_list seg = (struct scsi_ec_segment_register_key *)list->seg[list->curseg]; cscd = scsi_2btoul(seg->dst_cscd); dl = tpc_resolve(list, cscd, NULL, NULL, NULL); - if (dl >= CTL_MAX_LUNS) { + if (dl == UINT64_MAX) { ctl_set_sense(list->ctsio, /*current_error*/ 1, /*sense_key*/ SSD_KEY_COPY_ABORTED, /*asc*/ 0x08, /*ascq*/ 0x04, Modified: stable/10/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc_local.c Sat Jan 21 08:29:40 2017 (r312570) +++ stable/10/sys/cam/ctl/ctl_tpc_local.c Sat Jan 21 08:30:10 2017 (r312571) @@ -290,7 +290,7 @@ tpcl_resolve(struct ctl_softc *softc, in port = NULL; STAILQ_FOREACH(lun, &softc->lun_list, links) { if (port != NULL && - ctl_lun_map_to_port(port, lun->lun) >= CTL_MAX_LUNS) + ctl_lun_map_to_port(port, lun->lun) == UINT32_MAX) continue; if (lun->lun_devid == NULL) continue; From owner-svn-src-all@freebsd.org Sat Jan 21 08:31:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B72DCBBD27; Sat, 21 Jan 2017 08:31:21 +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 2A5891759; Sat, 21 Jan 2017 08:31:21 +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 v0L8VK9R017680; Sat, 21 Jan 2017 08:31:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8VK6K017679; Sat, 21 Jan 2017 08:31:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210831.v0L8VK6K017679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:31:20 +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: r312572 - 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, 21 Jan 2017 08:31:21 -0000 Author: mav Date: Sat Jan 21 08:31:20 2017 New Revision: 312572 URL: https://svnweb.freebsd.org/changeset/base/312572 Log: MFC r310555: Some random code cleaning. - Reduce indentation. - Remove extra braces. - Add few missing savety checks. Modified: stable/11/sys/cam/ctl/ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:30:10 2017 (r312571) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:31:20 2017 (r312572) @@ -424,7 +424,7 @@ static int ctl_init(void); void ctl_shutdown(void); static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td); static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td); -static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio); +static void ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio); static void ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_fill_num, struct ctl_ooa *ooa_hdr, struct ctl_ooa_entry *kern_entries); @@ -1024,27 +1024,27 @@ ctl_isc_ua(struct ctl_softc *softc, unio uint32_t iid = ctl_get_initindex(&msg->hdr.nexus); mtx_lock(&softc->ctl_lock); - if (msg->hdr.nexus.targ_lun < CTL_MAX_LUNS && - (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) != NULL) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - if (msg->ua.ua_type == CTL_UA_THIN_PROV_THRES && - msg->ua.ua_set) - memcpy(lun->ua_tpt_info, msg->ua.ua_info, 8); - if (msg->ua.ua_all) { - if (msg->ua.ua_set) - ctl_est_ua_all(lun, iid, msg->ua.ua_type); - else - ctl_clr_ua_all(lun, iid, msg->ua.ua_type); - } else { - if (msg->ua.ua_set) - ctl_est_ua(lun, iid, msg->ua.ua_type); - else - ctl_clr_ua(lun, iid, msg->ua.ua_type); - } - mtx_unlock(&lun->lun_lock); - } else + if (msg->hdr.nexus.targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); + return; + } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + if (msg->ua.ua_type == CTL_UA_THIN_PROV_THRES && msg->ua.ua_set) + memcpy(lun->ua_tpt_info, msg->ua.ua_info, 8); + if (msg->ua.ua_all) { + if (msg->ua.ua_set) + ctl_est_ua_all(lun, iid, msg->ua.ua_type); + else + ctl_clr_ua_all(lun, iid, msg->ua.ua_type); + } else { + if (msg->ua.ua_set) + ctl_est_ua(lun, iid, msg->ua.ua_type); + else + ctl_clr_ua(lun, iid, msg->ua.ua_type); + } + mtx_unlock(&lun->lun_lock); } static void @@ -1058,8 +1058,8 @@ ctl_isc_lun_sync(struct ctl_softc *softc targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -1289,8 +1289,8 @@ ctl_isc_mode_sync(struct ctl_softc *soft targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -2193,7 +2193,7 @@ ctl_create_iid(struct ctl_port *port, in * command on this side (XFER mode) or tell the other side to execute it * (SER_ONLY mode). */ -static int +static void ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) { struct ctl_softc *softc = control_softc; @@ -2201,7 +2201,6 @@ ctl_serialize_other_sc_cmd(struct ctl_sc struct ctl_port *port; struct ctl_lun *lun; const struct ctl_cmd_entry *entry; - int retval = 0; uint32_t targ_lun; targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; @@ -2216,24 +2215,10 @@ ctl_serialize_other_sc_cmd(struct ctl_sc } /* Make sure that we know about this LUN. */ - if ((targ_lun < CTL_MAX_LUNS) && - ((lun = softc->ctl_luns[targ_lun]) != NULL)) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - /* - * If the LUN is invalid, pretend that it doesn't exist. - * It will go away as soon as all pending I/O has been - * completed. - */ - if (lun->flags & CTL_LUN_DISABLED) { - mtx_unlock(&lun->lun_lock); - lun = NULL; - } - } else { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); - lun = NULL; - } - if (lun == NULL) { + /* * The other node would not send this request to us unless * received announce that we are primary node for this LUN. @@ -2243,6 +2228,18 @@ ctl_serialize_other_sc_cmd(struct ctl_sc ctl_set_busy(ctsio); goto badjuju; } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + + /* + * If the LUN is invalid, pretend that it doesn't exist. + * It will go away as soon as all pending I/Os completed. + */ + if (lun->flags & CTL_LUN_DISABLED) { + mtx_unlock(&lun->lun_lock); + ctl_set_busy(ctsio); + goto badjuju; + } entry = ctl_get_cmd_entry(ctsio, NULL); if (ctl_scsiio_lun_check(lun, entry, ctsio) != 0) { @@ -2314,10 +2311,9 @@ badjuju: msg_info.hdr.msg_type = CTL_MSG_BAD_JUJU; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, sizeof(msg_info.scsi), M_WAITOK); - retval = 1; + ctl_free_io((union ctl_io *)ctsio); break; } - return (retval); } /* @@ -2685,9 +2681,9 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } mtx_lock(&softc->ctl_lock); - if (((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0) - && ((ooa_hdr->lun_num >= CTL_MAX_LUNS) - || (softc->ctl_luns[ooa_hdr->lun_num] == NULL))) { + if ((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0 && + (ooa_hdr->lun_num >= CTL_MAX_LUNS || + softc->ctl_luns[ooa_hdr->lun_num] == NULL)) { mtx_unlock(&softc->ctl_lock); free(entries, M_CTL); printf("%s: CTL_GET_OOA: invalid LUN %ju\n", @@ -2739,49 +2735,37 @@ ctl_ioctl(struct cdev *dev, u_long cmd, #ifdef CTL_IO_DELAY mtx_lock(&softc->ctl_lock); - - if ((delay_info->lun_id >= CTL_MAX_LUNS) - || (softc->ctl_luns[delay_info->lun_id] == NULL)) { + if (delay_info->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[delay_info->lun_id]) == NULL) { + mtx_unlock(&softc->ctl_lock); delay_info->status = CTL_DELAY_STATUS_INVALID_LUN; - } else { - lun = softc->ctl_luns[delay_info->lun_id]; - mtx_lock(&lun->lun_lock); - - delay_info->status = CTL_DELAY_STATUS_OK; - - switch (delay_info->delay_type) { - case CTL_DELAY_TYPE_CONT: - break; - case CTL_DELAY_TYPE_ONESHOT: - break; - default: - delay_info->status = - CTL_DELAY_STATUS_INVALID_TYPE; - break; - } - - switch (delay_info->delay_loc) { - case CTL_DELAY_LOC_DATAMOVE: - lun->delay_info.datamove_type = - delay_info->delay_type; - lun->delay_info.datamove_delay = - delay_info->delay_secs; - break; - case CTL_DELAY_LOC_DONE: - lun->delay_info.done_type = - delay_info->delay_type; - lun->delay_info.done_delay = - delay_info->delay_secs; - break; - default: - delay_info->status = - CTL_DELAY_STATUS_INVALID_LOC; - break; - } - mtx_unlock(&lun->lun_lock); + break; } - + mtx_lock(&lun->lun_lock); mtx_unlock(&softc->ctl_lock); + delay_info->status = CTL_DELAY_STATUS_OK; + switch (delay_info->delay_type) { + case CTL_DELAY_TYPE_CONT: + case CTL_DELAY_TYPE_ONESHOT: + break; + default: + delay_info->status = CTL_DELAY_STATUS_INVALID_TYPE; + break; + } + switch (delay_info->delay_loc) { + case CTL_DELAY_LOC_DATAMOVE: + lun->delay_info.datamove_type = delay_info->delay_type; + lun->delay_info.datamove_delay = delay_info->delay_secs; + break; + case CTL_DELAY_LOC_DONE: + lun->delay_info.done_type = delay_info->delay_type; + lun->delay_info.done_delay = delay_info->delay_secs; + break; + default: + delay_info->status = CTL_DELAY_STATUS_INVALID_LOC; + break; + } + mtx_unlock(&lun->lun_lock); #else delay_info->status = CTL_DELAY_STATUS_NOT_IMPLEMENTED; #endif /* CTL_IO_DELAY */ @@ -2832,8 +2816,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, bcopy(err_desc, new_err_desc, sizeof(*new_err_desc)); mtx_lock(&softc->ctl_lock); - lun = softc->ctl_luns[err_desc->lun_id]; - if (lun == NULL) { + if (err_desc->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[err_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); free(new_err_desc, M_CTL); printf("%s: CTL_ERROR_INJECT: invalid LUN %ju\n", @@ -2876,8 +2860,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, delete_done = 0; mtx_lock(&softc->ctl_lock); - lun = softc->ctl_luns[delete_desc->lun_id]; - if (lun == NULL) { + if (delete_desc->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[delete_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); printf("%s: CTL_ERROR_INJECT_DELETE: invalid LUN %ju\n", __func__, (uintmax_t)delete_desc->lun_id); @@ -8540,8 +8524,8 @@ ctl_hndl_per_res_out_on_other_sc(union c targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -11436,18 +11420,17 @@ ctl_failover_lun(union ctl_io *rio) /* Find and lock the LUN. */ mtx_lock(&softc->ctl_lock); - if ((targ_lun < CTL_MAX_LUNS) && - ((lun = softc->ctl_luns[targ_lun]) != NULL)) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - if (lun->flags & CTL_LUN_DISABLED) { - mtx_unlock(&lun->lun_lock); - return; - } - } else { + if (targ_lun > CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + if (lun->flags & CTL_LUN_DISABLED) { + mtx_unlock(&lun->lun_lock); + return; + } if (softc->ha_mode == CTL_HA_MODE_XFER) { TAILQ_FOREACH_SAFE(io, &lun->ooa_queue, ooa_links, next_io) { @@ -11515,15 +11498,13 @@ ctl_scsiio_precheck(struct ctl_softc *so struct ctl_lun *lun; const struct ctl_cmd_entry *entry; uint32_t initidx, targ_lun; - int retval; - - retval = 0; + int retval = 0; lun = NULL; - targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; - if ((targ_lun < CTL_MAX_LUNS) - && ((lun = softc->ctl_luns[targ_lun]) != NULL)) { + if (targ_lun < CTL_MAX_LUNS) + lun = softc->ctl_luns[targ_lun]; + if (lun) { /* * If the LUN is invalid, pretend that it doesn't exist. * It will go away as soon as all pending I/O has been @@ -11533,29 +11514,22 @@ ctl_scsiio_precheck(struct ctl_softc *so if (lun->flags & CTL_LUN_DISABLED) { mtx_unlock(&lun->lun_lock); lun = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = NULL; - } else { - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = lun; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = - lun->be_lun; + } + } + ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = lun; + if (lun) { + ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = + lun->be_lun; - /* - * Every I/O goes into the OOA queue for a - * particular LUN, and stays there until completion. - */ + /* + * Every I/O goes into the OOA queue for a particular LUN, + * and stays there until completion. + */ #ifdef CTL_TIME_IO - if (TAILQ_EMPTY(&lun->ooa_queue)) { - lun->idle_time += getsbinuptime() - - lun->last_busy; - } + if (TAILQ_EMPTY(&lun->ooa_queue)) + lun->idle_time += getsbinuptime() - lun->last_busy; #endif - TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, - ooa_links); - } - } else { - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = NULL; + TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links); } /* Get command entry and return error if it is unsuppotyed. */ @@ -11972,7 +11946,7 @@ ctl_lun_reset(struct ctl_softc *softc, u targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12051,7 +12025,7 @@ ctl_abort_task_set(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12136,7 +12110,7 @@ ctl_abort_task(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12261,7 +12235,7 @@ ctl_query_task(union ctl_io *io, int tas softc = control_softc; targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12301,7 +12275,7 @@ ctl_query_async_event(union ctl_io *io) softc = control_softc; targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12384,29 +12358,25 @@ ctl_run_task(union ctl_io *io) static void ctl_handle_isc(union ctl_io *io) { - int free_io; - struct ctl_lun *lun; struct ctl_softc *softc = control_softc; + struct ctl_lun *lun; + const struct ctl_cmd_entry *entry; uint32_t targ_lun; targ_lun = io->io_hdr.nexus.targ_mapped_lun; - lun = softc->ctl_luns[targ_lun]; - switch (io->io_hdr.msg_type) { case CTL_MSG_SERIALIZE: - free_io = ctl_serialize_other_sc_cmd(&io->scsiio); + ctl_serialize_other_sc_cmd(&io->scsiio); break; - case CTL_MSG_R2R: { - const struct ctl_cmd_entry *entry; - - /* - * This is only used in SER_ONLY mode. - */ - free_io = 0; + case CTL_MSG_R2R: /* Only used in SER_ONLY mode. */ entry = ctl_get_cmd_entry(&io->scsiio, NULL); + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + ctl_done(io); + break; + } mtx_lock(&lun->lun_lock); - if (ctl_scsiio_lun_check(lun, - entry, (struct ctl_scsiio *)io) != 0) { + if (ctl_scsiio_lun_check(lun, entry, &io->scsiio) != 0) { mtx_unlock(&lun->lun_lock); ctl_done(io); break; @@ -12415,51 +12385,46 @@ ctl_handle_isc(union ctl_io *io) mtx_unlock(&lun->lun_lock); ctl_enqueue_rtr(io); break; - } case CTL_MSG_FINISH_IO: if (softc->ha_mode == CTL_HA_MODE_XFER) { - free_io = 0; ctl_done(io); - } else { - free_io = 1; - mtx_lock(&lun->lun_lock); - TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, - ooa_links); - ctl_check_blocked(lun); - mtx_unlock(&lun->lun_lock); + break; } + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + ctl_free_io(io); + break; + } + mtx_lock(&lun->lun_lock); + TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links); + ctl_check_blocked(lun); + mtx_unlock(&lun->lun_lock); + ctl_free_io(io); break; case CTL_MSG_PERS_ACTION: ctl_hndl_per_res_out_on_other_sc( (union ctl_ha_msg *)&io->presio.pr_msg); - free_io = 1; + ctl_free_io(io); break; case CTL_MSG_BAD_JUJU: - free_io = 0; ctl_done(io); break; - case CTL_MSG_DATAMOVE: - /* Only used in XFER mode */ - free_io = 0; + case CTL_MSG_DATAMOVE: /* Only used in XFER mode */ ctl_datamove_remote(io); break; - case CTL_MSG_DATAMOVE_DONE: - /* Only used in XFER mode */ - free_io = 0; + case CTL_MSG_DATAMOVE_DONE: /* Only used in XFER mode */ io->scsiio.be_move_done(io); break; case CTL_MSG_FAILOVER: ctl_failover_lun(io); - free_io = 1; + ctl_free_io(io); break; default: - free_io = 1; printf("%s: Invalid message type %d\n", __func__, io->io_hdr.msg_type); + ctl_free_io(io); break; } - if (free_io) - ctl_free_io(io); } @@ -13360,37 +13325,33 @@ ctl_queue_sense(union ctl_io *io) struct ctl_softc *softc; uint32_t initidx, targ_lun; - softc = control_softc; - CTL_DEBUG_PRINT(("ctl_queue_sense\n")); + softc = control_softc; + port = ctl_io_port(&ctsio->io_hdr); + targ_lun = ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun); + /* * LUN lookup will likely move to the ctl_work_thread() once we * have our new queueing infrastructure (that doesn't put things on * a per-LUN queue initially). That is so that we can handle * things like an INQUIRY to a LUN that we don't have enabled. We * can't deal with that right now. + * If we don't have a LUN for this, just toss the sense information. */ mtx_lock(&softc->ctl_lock); - - /* - * If we don't have a LUN for this, just toss the sense - * information. - */ - port = ctl_io_port(&ctsio->io_hdr); - targ_lun = ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun); - if ((targ_lun < CTL_MAX_LUNS) - && (softc->ctl_luns[targ_lun] != NULL)) - lun = softc->ctl_luns[targ_lun]; - else + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + mtx_unlock(&softc->ctl_lock); goto bailout; - - initidx = ctl_get_initindex(&io->io_hdr.nexus); - + } mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + /* * Already have CA set for this LUN...toss the sense information. */ + initidx = ctl_get_initindex(&io->io_hdr.nexus); if (ctl_is_set(lun->have_ca, initidx)) { mtx_unlock(&lun->lun_lock); goto bailout; @@ -13403,10 +13364,7 @@ ctl_queue_sense(union ctl_io *io) mtx_unlock(&lun->lun_lock); bailout: - mtx_unlock(&softc->ctl_lock); - ctl_free_io(io); - return (CTL_RETVAL_COMPLETE); } #endif From owner-svn-src-all@freebsd.org Sat Jan 21 08:31:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1008CCBBE95; Sat, 21 Jan 2017 08:31:51 +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 D3233195B; Sat, 21 Jan 2017 08:31:50 +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 v0L8Vo2u018480; Sat, 21 Jan 2017 08:31:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8Vonw018479; Sat, 21 Jan 2017 08:31:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210831.v0L8Vonw018479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:31: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: r312573 - stable/10/sys/cam/ctl 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, 21 Jan 2017 08:31:51 -0000 Author: mav Date: Sat Jan 21 08:31:49 2017 New Revision: 312573 URL: https://svnweb.freebsd.org/changeset/base/312573 Log: MFC r310555: Some random code cleaning. - Reduce indentation. - Remove extra braces. - Add few missing savety checks. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:31:20 2017 (r312572) +++ stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:31:49 2017 (r312573) @@ -426,7 +426,7 @@ static int ctl_init(void); void ctl_shutdown(void); static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td); static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td); -static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio); +static void ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio); static void ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_fill_num, struct ctl_ooa *ooa_hdr, struct ctl_ooa_entry *kern_entries); @@ -1026,27 +1026,27 @@ ctl_isc_ua(struct ctl_softc *softc, unio uint32_t iid = ctl_get_initindex(&msg->hdr.nexus); mtx_lock(&softc->ctl_lock); - if (msg->hdr.nexus.targ_lun < CTL_MAX_LUNS && - (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) != NULL) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - if (msg->ua.ua_type == CTL_UA_THIN_PROV_THRES && - msg->ua.ua_set) - memcpy(lun->ua_tpt_info, msg->ua.ua_info, 8); - if (msg->ua.ua_all) { - if (msg->ua.ua_set) - ctl_est_ua_all(lun, iid, msg->ua.ua_type); - else - ctl_clr_ua_all(lun, iid, msg->ua.ua_type); - } else { - if (msg->ua.ua_set) - ctl_est_ua(lun, iid, msg->ua.ua_type); - else - ctl_clr_ua(lun, iid, msg->ua.ua_type); - } - mtx_unlock(&lun->lun_lock); - } else + if (msg->hdr.nexus.targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); + return; + } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + if (msg->ua.ua_type == CTL_UA_THIN_PROV_THRES && msg->ua.ua_set) + memcpy(lun->ua_tpt_info, msg->ua.ua_info, 8); + if (msg->ua.ua_all) { + if (msg->ua.ua_set) + ctl_est_ua_all(lun, iid, msg->ua.ua_type); + else + ctl_clr_ua_all(lun, iid, msg->ua.ua_type); + } else { + if (msg->ua.ua_set) + ctl_est_ua(lun, iid, msg->ua.ua_type); + else + ctl_clr_ua(lun, iid, msg->ua.ua_type); + } + mtx_unlock(&lun->lun_lock); } static void @@ -1060,8 +1060,8 @@ ctl_isc_lun_sync(struct ctl_softc *softc targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -1291,8 +1291,8 @@ ctl_isc_mode_sync(struct ctl_softc *soft targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -2197,7 +2197,7 @@ ctl_create_iid(struct ctl_port *port, in * command on this side (XFER mode) or tell the other side to execute it * (SER_ONLY mode). */ -static int +static void ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio) { struct ctl_softc *softc = control_softc; @@ -2205,7 +2205,6 @@ ctl_serialize_other_sc_cmd(struct ctl_sc struct ctl_port *port; struct ctl_lun *lun; const struct ctl_cmd_entry *entry; - int retval = 0; uint32_t targ_lun; targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; @@ -2220,24 +2219,10 @@ ctl_serialize_other_sc_cmd(struct ctl_sc } /* Make sure that we know about this LUN. */ - if ((targ_lun < CTL_MAX_LUNS) && - ((lun = softc->ctl_luns[targ_lun]) != NULL)) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - /* - * If the LUN is invalid, pretend that it doesn't exist. - * It will go away as soon as all pending I/O has been - * completed. - */ - if (lun->flags & CTL_LUN_DISABLED) { - mtx_unlock(&lun->lun_lock); - lun = NULL; - } - } else { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); - lun = NULL; - } - if (lun == NULL) { + /* * The other node would not send this request to us unless * received announce that we are primary node for this LUN. @@ -2247,6 +2232,18 @@ ctl_serialize_other_sc_cmd(struct ctl_sc ctl_set_busy(ctsio); goto badjuju; } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + + /* + * If the LUN is invalid, pretend that it doesn't exist. + * It will go away as soon as all pending I/Os completed. + */ + if (lun->flags & CTL_LUN_DISABLED) { + mtx_unlock(&lun->lun_lock); + ctl_set_busy(ctsio); + goto badjuju; + } entry = ctl_get_cmd_entry(ctsio, NULL); if (ctl_scsiio_lun_check(lun, entry, ctsio) != 0) { @@ -2318,10 +2315,9 @@ badjuju: msg_info.hdr.msg_type = CTL_MSG_BAD_JUJU; ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg_info, sizeof(msg_info.scsi), M_WAITOK); - retval = 1; + ctl_free_io((union ctl_io *)ctsio); break; } - return (retval); } /* @@ -2676,9 +2672,9 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } mtx_lock(&softc->ctl_lock); - if (((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0) - && ((ooa_hdr->lun_num >= CTL_MAX_LUNS) - || (softc->ctl_luns[ooa_hdr->lun_num] == NULL))) { + if ((ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) == 0 && + (ooa_hdr->lun_num >= CTL_MAX_LUNS || + softc->ctl_luns[ooa_hdr->lun_num] == NULL)) { mtx_unlock(&softc->ctl_lock); free(entries, M_CTL); printf("%s: CTL_GET_OOA: invalid LUN %ju\n", @@ -2730,49 +2726,37 @@ ctl_ioctl(struct cdev *dev, u_long cmd, #ifdef CTL_IO_DELAY mtx_lock(&softc->ctl_lock); - - if ((delay_info->lun_id >= CTL_MAX_LUNS) - || (softc->ctl_luns[delay_info->lun_id] == NULL)) { + if (delay_info->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[delay_info->lun_id]) == NULL) { + mtx_unlock(&softc->ctl_lock); delay_info->status = CTL_DELAY_STATUS_INVALID_LUN; - } else { - lun = softc->ctl_luns[delay_info->lun_id]; - mtx_lock(&lun->lun_lock); - - delay_info->status = CTL_DELAY_STATUS_OK; - - switch (delay_info->delay_type) { - case CTL_DELAY_TYPE_CONT: - break; - case CTL_DELAY_TYPE_ONESHOT: - break; - default: - delay_info->status = - CTL_DELAY_STATUS_INVALID_TYPE; - break; - } - - switch (delay_info->delay_loc) { - case CTL_DELAY_LOC_DATAMOVE: - lun->delay_info.datamove_type = - delay_info->delay_type; - lun->delay_info.datamove_delay = - delay_info->delay_secs; - break; - case CTL_DELAY_LOC_DONE: - lun->delay_info.done_type = - delay_info->delay_type; - lun->delay_info.done_delay = - delay_info->delay_secs; - break; - default: - delay_info->status = - CTL_DELAY_STATUS_INVALID_LOC; - break; - } - mtx_unlock(&lun->lun_lock); + break; } - + mtx_lock(&lun->lun_lock); mtx_unlock(&softc->ctl_lock); + delay_info->status = CTL_DELAY_STATUS_OK; + switch (delay_info->delay_type) { + case CTL_DELAY_TYPE_CONT: + case CTL_DELAY_TYPE_ONESHOT: + break; + default: + delay_info->status = CTL_DELAY_STATUS_INVALID_TYPE; + break; + } + switch (delay_info->delay_loc) { + case CTL_DELAY_LOC_DATAMOVE: + lun->delay_info.datamove_type = delay_info->delay_type; + lun->delay_info.datamove_delay = delay_info->delay_secs; + break; + case CTL_DELAY_LOC_DONE: + lun->delay_info.done_type = delay_info->delay_type; + lun->delay_info.done_delay = delay_info->delay_secs; + break; + default: + delay_info->status = CTL_DELAY_STATUS_INVALID_LOC; + break; + } + mtx_unlock(&lun->lun_lock); #else delay_info->status = CTL_DELAY_STATUS_NOT_IMPLEMENTED; #endif /* CTL_IO_DELAY */ @@ -2823,8 +2807,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, bcopy(err_desc, new_err_desc, sizeof(*new_err_desc)); mtx_lock(&softc->ctl_lock); - lun = softc->ctl_luns[err_desc->lun_id]; - if (lun == NULL) { + if (err_desc->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[err_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); free(new_err_desc, M_CTL); printf("%s: CTL_ERROR_INJECT: invalid LUN %ju\n", @@ -2867,8 +2851,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, delete_done = 0; mtx_lock(&softc->ctl_lock); - lun = softc->ctl_luns[delete_desc->lun_id]; - if (lun == NULL) { + if (delete_desc->lun_id >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[delete_desc->lun_id]) == NULL) { mtx_unlock(&softc->ctl_lock); printf("%s: CTL_ERROR_INJECT_DELETE: invalid LUN %ju\n", __func__, (uintmax_t)delete_desc->lun_id); @@ -8531,8 +8515,8 @@ ctl_hndl_per_res_out_on_other_sc(union c targ_lun = msg->hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || - ((lun = softc->ctl_luns[targ_lun]) == NULL)) { + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } @@ -11427,18 +11411,17 @@ ctl_failover_lun(union ctl_io *rio) /* Find and lock the LUN. */ mtx_lock(&softc->ctl_lock); - if ((targ_lun < CTL_MAX_LUNS) && - ((lun = softc->ctl_luns[targ_lun]) != NULL)) { - mtx_lock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - if (lun->flags & CTL_LUN_DISABLED) { - mtx_unlock(&lun->lun_lock); - return; - } - } else { + if (targ_lun > CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; } + mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + if (lun->flags & CTL_LUN_DISABLED) { + mtx_unlock(&lun->lun_lock); + return; + } if (softc->ha_mode == CTL_HA_MODE_XFER) { TAILQ_FOREACH_SAFE(io, &lun->ooa_queue, ooa_links, next_io) { @@ -11506,15 +11489,13 @@ ctl_scsiio_precheck(struct ctl_softc *so struct ctl_lun *lun; const struct ctl_cmd_entry *entry; uint32_t initidx, targ_lun; - int retval; - - retval = 0; + int retval = 0; lun = NULL; - targ_lun = ctsio->io_hdr.nexus.targ_mapped_lun; - if ((targ_lun < CTL_MAX_LUNS) - && ((lun = softc->ctl_luns[targ_lun]) != NULL)) { + if (targ_lun < CTL_MAX_LUNS) + lun = softc->ctl_luns[targ_lun]; + if (lun) { /* * If the LUN is invalid, pretend that it doesn't exist. * It will go away as soon as all pending I/O has been @@ -11524,29 +11505,22 @@ ctl_scsiio_precheck(struct ctl_softc *so if (lun->flags & CTL_LUN_DISABLED) { mtx_unlock(&lun->lun_lock); lun = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = NULL; - } else { - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = lun; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = - lun->be_lun; + } + } + ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = lun; + if (lun) { + ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = + lun->be_lun; - /* - * Every I/O goes into the OOA queue for a - * particular LUN, and stays there until completion. - */ + /* + * Every I/O goes into the OOA queue for a particular LUN, + * and stays there until completion. + */ #ifdef CTL_TIME_IO - if (TAILQ_EMPTY(&lun->ooa_queue)) { - lun->idle_time += getsbinuptime() - - lun->last_busy; - } + if (TAILQ_EMPTY(&lun->ooa_queue)) + lun->idle_time += getsbinuptime() - lun->last_busy; #endif - TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, - ooa_links); - } - } else { - ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr = NULL; - ctsio->io_hdr.ctl_private[CTL_PRIV_BACKEND_LUN].ptr = NULL; + TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr, ooa_links); } /* Get command entry and return error if it is unsuppotyed. */ @@ -11963,7 +11937,7 @@ ctl_lun_reset(struct ctl_softc *softc, u targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12042,7 +12016,7 @@ ctl_abort_task_set(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12127,7 +12101,7 @@ ctl_abort_task(union ctl_io *io) */ targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12252,7 +12226,7 @@ ctl_query_task(union ctl_io *io, int tas softc = control_softc; targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12292,7 +12266,7 @@ ctl_query_async_event(union ctl_io *io) softc = control_softc; targ_lun = io->io_hdr.nexus.targ_mapped_lun; mtx_lock(&softc->ctl_lock); - if ((targ_lun >= CTL_MAX_LUNS) || + if (targ_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[targ_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); io->taskio.task_status = CTL_TASK_LUN_DOES_NOT_EXIST; @@ -12375,29 +12349,25 @@ ctl_run_task(union ctl_io *io) static void ctl_handle_isc(union ctl_io *io) { - int free_io; - struct ctl_lun *lun; struct ctl_softc *softc = control_softc; + struct ctl_lun *lun; + const struct ctl_cmd_entry *entry; uint32_t targ_lun; targ_lun = io->io_hdr.nexus.targ_mapped_lun; - lun = softc->ctl_luns[targ_lun]; - switch (io->io_hdr.msg_type) { case CTL_MSG_SERIALIZE: - free_io = ctl_serialize_other_sc_cmd(&io->scsiio); + ctl_serialize_other_sc_cmd(&io->scsiio); break; - case CTL_MSG_R2R: { - const struct ctl_cmd_entry *entry; - - /* - * This is only used in SER_ONLY mode. - */ - free_io = 0; + case CTL_MSG_R2R: /* Only used in SER_ONLY mode. */ entry = ctl_get_cmd_entry(&io->scsiio, NULL); + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + ctl_done(io); + break; + } mtx_lock(&lun->lun_lock); - if (ctl_scsiio_lun_check(lun, - entry, (struct ctl_scsiio *)io) != 0) { + if (ctl_scsiio_lun_check(lun, entry, &io->scsiio) != 0) { mtx_unlock(&lun->lun_lock); ctl_done(io); break; @@ -12406,51 +12376,46 @@ ctl_handle_isc(union ctl_io *io) mtx_unlock(&lun->lun_lock); ctl_enqueue_rtr(io); break; - } case CTL_MSG_FINISH_IO: if (softc->ha_mode == CTL_HA_MODE_XFER) { - free_io = 0; ctl_done(io); - } else { - free_io = 1; - mtx_lock(&lun->lun_lock); - TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, - ooa_links); - ctl_check_blocked(lun); - mtx_unlock(&lun->lun_lock); + break; } + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + ctl_free_io(io); + break; + } + mtx_lock(&lun->lun_lock); + TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links); + ctl_check_blocked(lun); + mtx_unlock(&lun->lun_lock); + ctl_free_io(io); break; case CTL_MSG_PERS_ACTION: ctl_hndl_per_res_out_on_other_sc( (union ctl_ha_msg *)&io->presio.pr_msg); - free_io = 1; + ctl_free_io(io); break; case CTL_MSG_BAD_JUJU: - free_io = 0; ctl_done(io); break; - case CTL_MSG_DATAMOVE: - /* Only used in XFER mode */ - free_io = 0; + case CTL_MSG_DATAMOVE: /* Only used in XFER mode */ ctl_datamove_remote(io); break; - case CTL_MSG_DATAMOVE_DONE: - /* Only used in XFER mode */ - free_io = 0; + case CTL_MSG_DATAMOVE_DONE: /* Only used in XFER mode */ io->scsiio.be_move_done(io); break; case CTL_MSG_FAILOVER: ctl_failover_lun(io); - free_io = 1; + ctl_free_io(io); break; default: - free_io = 1; printf("%s: Invalid message type %d\n", __func__, io->io_hdr.msg_type); + ctl_free_io(io); break; } - if (free_io) - ctl_free_io(io); } @@ -13351,37 +13316,33 @@ ctl_queue_sense(union ctl_io *io) struct ctl_softc *softc; uint32_t initidx, targ_lun; - softc = control_softc; - CTL_DEBUG_PRINT(("ctl_queue_sense\n")); + softc = control_softc; + port = ctl_io_port(&ctsio->io_hdr); + targ_lun = ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun); + /* * LUN lookup will likely move to the ctl_work_thread() once we * have our new queueing infrastructure (that doesn't put things on * a per-LUN queue initially). That is so that we can handle * things like an INQUIRY to a LUN that we don't have enabled. We * can't deal with that right now. + * If we don't have a LUN for this, just toss the sense information. */ mtx_lock(&softc->ctl_lock); - - /* - * If we don't have a LUN for this, just toss the sense - * information. - */ - port = ctl_io_port(&ctsio->io_hdr); - targ_lun = ctl_lun_map_from_port(port, io->io_hdr.nexus.targ_lun); - if ((targ_lun < CTL_MAX_LUNS) - && (softc->ctl_luns[targ_lun] != NULL)) - lun = softc->ctl_luns[targ_lun]; - else + if (targ_lun >= CTL_MAX_LUNS || + (lun = softc->ctl_luns[targ_lun]) == NULL) { + mtx_unlock(&softc->ctl_lock); goto bailout; - - initidx = ctl_get_initindex(&io->io_hdr.nexus); - + } mtx_lock(&lun->lun_lock); + mtx_unlock(&softc->ctl_lock); + /* * Already have CA set for this LUN...toss the sense information. */ + initidx = ctl_get_initindex(&io->io_hdr.nexus); if (ctl_is_set(lun->have_ca, initidx)) { mtx_unlock(&lun->lun_lock); goto bailout; @@ -13394,10 +13355,7 @@ ctl_queue_sense(union ctl_io *io) mtx_unlock(&lun->lun_lock); bailout: - mtx_unlock(&softc->ctl_lock); - ctl_free_io(io); - return (CTL_RETVAL_COMPLETE); } #endif From owner-svn-src-all@freebsd.org Sat Jan 21 08:32:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60BF0CBBEFF; Sat, 21 Jan 2017 08:32:28 +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 2D3AD1B1F; Sat, 21 Jan 2017 08:32:28 +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 v0L8WRSH020646; Sat, 21 Jan 2017 08:32:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8WRAa020645; Sat, 21 Jan 2017 08:32:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210832.v0L8WRAa020645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:32:27 +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: r312574 - 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, 21 Jan 2017 08:32:28 -0000 Author: mav Date: Sat Jan 21 08:32:27 2017 New Revision: 312574 URL: https://svnweb.freebsd.org/changeset/base/312574 Log: MFC r310575: Fix improperly used nexus.targ_lun. Modified: stable/11/sys/cam/ctl/ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:31:49 2017 (r312573) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:32:27 2017 (r312574) @@ -1024,7 +1024,7 @@ ctl_isc_ua(struct ctl_softc *softc, unio uint32_t iid = ctl_get_initindex(&msg->hdr.nexus); mtx_lock(&softc->ctl_lock); - if (msg->hdr.nexus.targ_lun >= CTL_MAX_LUNS || + if (msg->hdr.nexus.targ_mapped_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -1074,7 +1074,7 @@ ctl_isc_lun_sync(struct ctl_softc *softc memcmp(&msg->lun.data[0], lun->lun_devid->data, i) != 0)) { mtx_unlock(&lun->lun_lock); printf("%s: Received conflicting HA LUN %d\n", - __func__, msg->hdr.nexus.targ_lun); + __func__, targ_lun); return; } else { /* Record whether peer is primary. */ @@ -1108,7 +1108,7 @@ ctl_isc_lun_sync(struct ctl_softc *softc mtx_unlock(&lun->lun_lock); CTL_DEBUG_PRINT(("%s: Known LUN %d, peer is %s\n", - __func__, msg->hdr.nexus.targ_lun, + __func__, targ_lun, (msg->lun.flags & CTL_LUN_PRIMARY_SC) ? "primary" : "secondary")); From owner-svn-src-all@freebsd.org Sat Jan 21 08:32:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB332CBBF6B; Sat, 21 Jan 2017 08:32:57 +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 7A6F21CB6; Sat, 21 Jan 2017 08:32:57 +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 v0L8WuSn020717; Sat, 21 Jan 2017 08:32:56 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8Wunq020716; Sat, 21 Jan 2017 08:32:56 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210832.v0L8Wunq020716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:32:56 +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: r312575 - stable/10/sys/cam/ctl 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, 21 Jan 2017 08:32:57 -0000 Author: mav Date: Sat Jan 21 08:32:56 2017 New Revision: 312575 URL: https://svnweb.freebsd.org/changeset/base/312575 Log: MFC r310575: Fix improperly used nexus.targ_lun. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:32:27 2017 (r312574) +++ stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:32:56 2017 (r312575) @@ -1026,7 +1026,7 @@ ctl_isc_ua(struct ctl_softc *softc, unio uint32_t iid = ctl_get_initindex(&msg->hdr.nexus); mtx_lock(&softc->ctl_lock); - if (msg->hdr.nexus.targ_lun >= CTL_MAX_LUNS || + if (msg->hdr.nexus.targ_mapped_lun >= CTL_MAX_LUNS || (lun = softc->ctl_luns[msg->hdr.nexus.targ_mapped_lun]) == NULL) { mtx_unlock(&softc->ctl_lock); return; @@ -1076,7 +1076,7 @@ ctl_isc_lun_sync(struct ctl_softc *softc memcmp(&msg->lun.data[0], lun->lun_devid->data, i) != 0)) { mtx_unlock(&lun->lun_lock); printf("%s: Received conflicting HA LUN %d\n", - __func__, msg->hdr.nexus.targ_lun); + __func__, targ_lun); return; } else { /* Record whether peer is primary. */ @@ -1110,7 +1110,7 @@ ctl_isc_lun_sync(struct ctl_softc *softc mtx_unlock(&lun->lun_lock); CTL_DEBUG_PRINT(("%s: Known LUN %d, peer is %s\n", - __func__, msg->hdr.nexus.targ_lun, + __func__, targ_lun, (msg->lun.flags & CTL_LUN_PRIMARY_SC) ? "primary" : "secondary")); From owner-svn-src-all@freebsd.org Sat Jan 21 08:33:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78BF9CBBFD1; Sat, 21 Jan 2017 08:33:46 +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 3A9451E0C; Sat, 21 Jan 2017 08:33:46 +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 v0L8Xj71020819; Sat, 21 Jan 2017 08:33:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8XjFN020815; Sat, 21 Jan 2017 08:33:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210833.v0L8XjFN020815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:33: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: r312576 - 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, 21 Jan 2017 08:33:46 -0000 Author: mav Date: Sat Jan 21 08:33:44 2017 New Revision: 312576 URL: https://svnweb.freebsd.org/changeset/base/312576 Log: MFC r310635: Decouple limits on number of LUNs per port and LUs per CTL. Those two values are not directly related, so make them independent. This does not change any limits immediately, but makes number of LUNs per port controllable via tunable/sysctl kern.cam.ctl.lun_map_size. After this change increasing CTL_MAX_LUNS should be pretty cheap, and even making it tunable should be easy. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl_frontend.c stable/11/sys/cam/ctl/ctl_frontend.h stable/11/sys/cam/ctl/ctl_io.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:32:56 2017 (r312575) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:33:44 2017 (r312576) @@ -407,6 +407,9 @@ SYSCTL_INT(_kern_cam_ctl, OID_AUTO, work static int ctl_debug = CTL_DEBUG_NONE; SYSCTL_INT(_kern_cam_ctl, OID_AUTO, debug, CTLFLAG_RWTUN, &ctl_debug, 0, "Enabled debug flags"); +static int ctl_lun_map_size = 1024; +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, lun_map_size, CTLFLAG_RWTUN, + &ctl_lun_map_size, 0, "Size of per-port LUN map (max LUN + 1)"); /* * Supported pages (0x00), Serial number (0x80), Device ID (0x83), @@ -826,7 +829,7 @@ ctl_isc_announce_port(struct ctl_port *p return; i = sizeof(msg->port) + strlen(port->port_name) + 1; if (port->lun_map) - i += sizeof(uint32_t) * CTL_MAX_LUNS; + i += port->lun_map_size * sizeof(uint32_t); if (port->port_devid) i += port->port_devid->len; if (port->target_devid) @@ -846,7 +849,7 @@ ctl_isc_announce_port(struct ctl_port *p "%d:%s", softc->ha_id, port->port_name) + 1; i += msg->port.name_len; if (port->lun_map) { - msg->port.lun_map_len = sizeof(uint32_t) * CTL_MAX_LUNS; + msg->port.lun_map_len = port->lun_map_size * sizeof(uint32_t); memcpy(&msg->port.data[i], port->lun_map, msg->port.lun_map_len); i += msg->port.lun_map_len; @@ -1155,19 +1158,25 @@ ctl_isc_port_sync(struct ctl_softc *soft M_CTL); i += msg->port.name_len; if (msg->port.lun_map_len != 0) { - if (port->lun_map == NULL) - port->lun_map = malloc(sizeof(uint32_t) * CTL_MAX_LUNS, + if (port->lun_map == NULL || + port->lun_map_size * sizeof(uint32_t) < + msg->port.lun_map_len) { + port->lun_map_size = 0; + free(port->lun_map, M_CTL); + port->lun_map = malloc(msg->port.lun_map_len, M_CTL, M_WAITOK); - memcpy(port->lun_map, &msg->port.data[i], - sizeof(uint32_t) * CTL_MAX_LUNS); + } + memcpy(port->lun_map, &msg->port.data[i], msg->port.lun_map_len); + port->lun_map_size = msg->port.lun_map_len / sizeof(uint32_t); i += msg->port.lun_map_len; } else { + port->lun_map_size = 0; free(port->lun_map, M_CTL); port->lun_map = NULL; } if (msg->port.port_devid_len != 0) { if (port->port_devid == NULL || - port->port_devid->len != msg->port.port_devid_len) { + port->port_devid->len < msg->port.port_devid_len) { free(port->port_devid, M_CTL); port->port_devid = malloc(sizeof(struct ctl_devid) + msg->port.port_devid_len, M_CTL, M_WAITOK); @@ -1182,7 +1191,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } if (msg->port.target_devid_len != 0) { if (port->target_devid == NULL || - port->target_devid->len != msg->port.target_devid_len) { + port->target_devid->len < msg->port.target_devid_len) { free(port->target_devid, M_CTL); port->target_devid = malloc(sizeof(struct ctl_devid) + msg->port.target_devid_len, M_CTL, M_WAITOK); @@ -1197,7 +1206,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } if (msg->port.init_devid_len != 0) { if (port->init_devid == NULL || - port->init_devid->len != msg->port.init_devid_len) { + port->init_devid->len < msg->port.init_devid_len) { free(port->init_devid, M_CTL); port->init_devid = malloc(sizeof(struct ctl_devid) + msg->port.init_devid_len, M_CTL, M_WAITOK); @@ -3295,7 +3304,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (port->lun_map != NULL) { sbuf_printf(sb, "\ton\n"); - for (j = 0; j < CTL_MAX_LUNS; j++) { + for (j = 0; j < port->lun_map_size; j++) { plun = ctl_lun_map_from_port(port, j); if (plun == UINT32_MAX) continue; @@ -3375,7 +3384,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } } mtx_unlock(&softc->ctl_lock); // XXX: port_enable sleeps - if (lm->plun < CTL_MAX_LUNS) { + if (lm->plun != UINT32_MAX) { if (lm->lun == UINT32_MAX) retval = ctl_lun_map_unset(port, lm->plun); else if (lm->lun < CTL_MAX_LUNS && @@ -3383,13 +3392,12 @@ ctl_ioctl(struct cdev *dev, u_long cmd, retval = ctl_lun_map_set(port, lm->plun, lm->lun); else return (ENXIO); - } else if (lm->plun == UINT32_MAX) { + } else { if (lm->lun == UINT32_MAX) retval = ctl_lun_map_deinit(port); else retval = ctl_lun_map_init(port); - } else - return (ENXIO); + } if (port->status & CTL_PORT_STATUS_ONLINE) ctl_isc_announce_port(port); break; @@ -3442,15 +3450,20 @@ ctl_lun_map_init(struct ctl_port *port) { struct ctl_softc *softc = port->ctl_softc; struct ctl_lun *lun; + int size = ctl_lun_map_size; uint32_t i; - if (port->lun_map == NULL) - port->lun_map = malloc(sizeof(uint32_t) * CTL_MAX_LUNS, + if (port->lun_map == NULL || port->lun_map_size < size) { + port->lun_map_size = 0; + free(port->lun_map, M_CTL); + port->lun_map = malloc(size * sizeof(uint32_t), M_CTL, M_NOWAIT); + } if (port->lun_map == NULL) return (ENOMEM); - for (i = 0; i < CTL_MAX_LUNS; i++) + for (i = 0; i < size; i++) port->lun_map[i] = UINT32_MAX; + port->lun_map_size = size; if (port->status & CTL_PORT_STATUS_ONLINE) { if (port->lun_disable != NULL) { STAILQ_FOREACH(lun, &softc->lun_list, links) @@ -3469,6 +3482,7 @@ ctl_lun_map_deinit(struct ctl_port *port if (port->lun_map == NULL) return (0); + port->lun_map_size = 0; free(port->lun_map, M_CTL); port->lun_map = NULL; if (port->status & CTL_PORT_STATUS_ONLINE) { @@ -3492,6 +3506,8 @@ ctl_lun_map_set(struct ctl_port *port, u if (status != 0) return (status); } + if (plun >= port->lun_map_size) + return (EINVAL); old = port->lun_map[plun]; port->lun_map[plun] = glun; if ((port->status & CTL_PORT_STATUS_ONLINE) && old == UINT32_MAX) { @@ -3507,7 +3523,7 @@ ctl_lun_map_unset(struct ctl_port *port, { uint32_t old; - if (port->lun_map == NULL) + if (port->lun_map == NULL || plun >= port->lun_map_size) return (0); old = port->lun_map[plun]; port->lun_map[plun] = UINT32_MAX; @@ -3525,8 +3541,10 @@ ctl_lun_map_from_port(struct ctl_port *p if (port == NULL) return (UINT32_MAX); - if (port->lun_map == NULL || lun_id == UINT32_MAX) + if (port->lun_map == NULL) return (lun_id); + if (lun_id > port->lun_map_size) + return (UINT32_MAX); return (port->lun_map[lun_id]); } @@ -3539,7 +3557,7 @@ ctl_lun_map_to_port(struct ctl_port *por return (UINT32_MAX); if (port->lun_map == NULL) return (lun_id); - for (i = 0; i < CTL_MAX_LUNS; i++) { + for (i = 0; i < port->lun_map_size; i++) { if (port->lun_map[i] == lun_id) return (i); } @@ -9048,9 +9066,8 @@ ctl_report_luns(struct ctl_scsiio *ctsio struct scsi_report_luns_data *lun_data; struct ctl_lun *lun, *request_lun; struct ctl_port *port; - int num_luns, retval; + int num_filled, num_luns, num_port_luns, retval; uint32_t alloc_len, lun_datalen; - int num_filled; uint32_t initidx, targ_lun_id, lun_id; retval = CTL_RETVAL_COMPLETE; @@ -9060,9 +9077,10 @@ ctl_report_luns(struct ctl_scsiio *ctsio CTL_DEBUG_PRINT(("ctl_report_luns\n")); - mtx_lock(&softc->ctl_lock); num_luns = 0; - for (targ_lun_id = 0; targ_lun_id < CTL_MAX_LUNS; targ_lun_id++) { + num_port_luns = port->lun_map ? port->lun_map_size : CTL_MAX_LUNS; + mtx_lock(&softc->ctl_lock); + for (targ_lun_id = 0; targ_lun_id < num_port_luns; targ_lun_id++) { if (ctl_lun_map_from_port(port, targ_lun_id) != UINT32_MAX) num_luns++; } @@ -9121,7 +9139,9 @@ ctl_report_luns(struct ctl_scsiio *ctsio initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); mtx_lock(&softc->ctl_lock); - for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { + for (targ_lun_id = 0, num_filled = 0; + targ_lun_id < num_port_luns && num_filled < num_luns; + targ_lun_id++) { lun_id = ctl_lun_map_from_port(port, targ_lun_id); if (lun_id == UINT32_MAX) continue; Modified: stable/11/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:32:56 2017 (r312575) +++ stable/11/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:33:44 2017 (r312576) @@ -315,7 +315,7 @@ ctl_port_online(struct ctl_port *port) if (port->lun_enable != NULL) { if (port->lun_map) { - for (l = 0; l < CTL_MAX_LUNS; l++) { + for (l = 0; l < port->lun_map_size; l++) { if (ctl_lun_map_from_port(port, l) == UINT32_MAX) continue; @@ -359,7 +359,7 @@ ctl_port_offline(struct ctl_port *port) port->port_offline(port->onoff_arg); if (port->lun_disable != NULL) { if (port->lun_map) { - for (l = 0; l < CTL_MAX_LUNS; l++) { + for (l = 0; l < port->lun_map_size; l++) { if (ctl_lun_map_from_port(port, l) == UINT32_MAX) continue; Modified: stable/11/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/11/sys/cam/ctl/ctl_frontend.h Sat Jan 21 08:32:56 2017 (r312575) +++ stable/11/sys/cam/ctl/ctl_frontend.h Sat Jan 21 08:33:44 2017 (r312576) @@ -225,6 +225,7 @@ struct ctl_port { void *onoff_arg; /* passed to CTL */ lun_func_t lun_enable; /* passed to CTL */ lun_func_t lun_disable; /* passed to CTL */ + int lun_map_size; /* passed to CTL */ uint32_t *lun_map; /* passed to CTL */ void *targ_lun_arg; /* passed to CTL */ void (*fe_datamove)(union ctl_io *io); /* passed to CTL */ Modified: stable/11/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/11/sys/cam/ctl/ctl_io.h Sat Jan 21 08:32:56 2017 (r312575) +++ stable/11/sys/cam/ctl/ctl_io.h Sat Jan 21 08:33:44 2017 (r312576) @@ -365,7 +365,7 @@ struct ctl_taskio { /* * HA link messages. */ -#define CTL_HA_VERSION 1 +#define CTL_HA_VERSION 2 /* * Used for CTL_MSG_LOGIN. From owner-svn-src-all@freebsd.org Sat Jan 21 08:34:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B11A0CB705D; Sat, 21 Jan 2017 08:34:28 +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 722641F6A; Sat, 21 Jan 2017 08:34:28 +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 v0L8YRnn020902; Sat, 21 Jan 2017 08:34:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8YRo8020897; Sat, 21 Jan 2017 08:34:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210834.v0L8YRo8020897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:34:27 +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: r312577 - stable/10/sys/cam/ctl 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, 21 Jan 2017 08:34:28 -0000 Author: mav Date: Sat Jan 21 08:34:27 2017 New Revision: 312577 URL: https://svnweb.freebsd.org/changeset/base/312577 Log: MFC r310635: Decouple limits on number of LUNs per port and LUs per CTL. Those two values are not directly related, so make them independent. This does not change any limits immediately, but makes number of LUNs per port controllable via tunable/sysctl kern.cam.ctl.lun_map_size. After this change increasing CTL_MAX_LUNS should be pretty cheap, and even making it tunable should be easy. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_frontend.h stable/10/sys/cam/ctl/ctl_io.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:33:44 2017 (r312576) +++ stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:34:27 2017 (r312577) @@ -409,6 +409,9 @@ static int ctl_debug = CTL_DEBUG_NONE; TUNABLE_INT("kern.cam.ctl.debug", &ctl_debug); SYSCTL_INT(_kern_cam_ctl, OID_AUTO, debug, CTLFLAG_RWTUN, &ctl_debug, 0, "Enabled debug flags"); +static int ctl_lun_map_size = 1024; +SYSCTL_INT(_kern_cam_ctl, OID_AUTO, lun_map_size, CTLFLAG_RWTUN, + &ctl_lun_map_size, 0, "Size of per-port LUN map (max LUN + 1)"); /* * Supported pages (0x00), Serial number (0x80), Device ID (0x83), @@ -828,7 +831,7 @@ ctl_isc_announce_port(struct ctl_port *p return; i = sizeof(msg->port) + strlen(port->port_name) + 1; if (port->lun_map) - i += sizeof(uint32_t) * CTL_MAX_LUNS; + i += port->lun_map_size * sizeof(uint32_t); if (port->port_devid) i += port->port_devid->len; if (port->target_devid) @@ -848,7 +851,7 @@ ctl_isc_announce_port(struct ctl_port *p "%d:%s", softc->ha_id, port->port_name) + 1; i += msg->port.name_len; if (port->lun_map) { - msg->port.lun_map_len = sizeof(uint32_t) * CTL_MAX_LUNS; + msg->port.lun_map_len = port->lun_map_size * sizeof(uint32_t); memcpy(&msg->port.data[i], port->lun_map, msg->port.lun_map_len); i += msg->port.lun_map_len; @@ -1157,19 +1160,25 @@ ctl_isc_port_sync(struct ctl_softc *soft M_CTL); i += msg->port.name_len; if (msg->port.lun_map_len != 0) { - if (port->lun_map == NULL) - port->lun_map = malloc(sizeof(uint32_t) * CTL_MAX_LUNS, + if (port->lun_map == NULL || + port->lun_map_size * sizeof(uint32_t) < + msg->port.lun_map_len) { + port->lun_map_size = 0; + free(port->lun_map, M_CTL); + port->lun_map = malloc(msg->port.lun_map_len, M_CTL, M_WAITOK); - memcpy(port->lun_map, &msg->port.data[i], - sizeof(uint32_t) * CTL_MAX_LUNS); + } + memcpy(port->lun_map, &msg->port.data[i], msg->port.lun_map_len); + port->lun_map_size = msg->port.lun_map_len / sizeof(uint32_t); i += msg->port.lun_map_len; } else { + port->lun_map_size = 0; free(port->lun_map, M_CTL); port->lun_map = NULL; } if (msg->port.port_devid_len != 0) { if (port->port_devid == NULL || - port->port_devid->len != msg->port.port_devid_len) { + port->port_devid->len < msg->port.port_devid_len) { free(port->port_devid, M_CTL); port->port_devid = malloc(sizeof(struct ctl_devid) + msg->port.port_devid_len, M_CTL, M_WAITOK); @@ -1184,7 +1193,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } if (msg->port.target_devid_len != 0) { if (port->target_devid == NULL || - port->target_devid->len != msg->port.target_devid_len) { + port->target_devid->len < msg->port.target_devid_len) { free(port->target_devid, M_CTL); port->target_devid = malloc(sizeof(struct ctl_devid) + msg->port.target_devid_len, M_CTL, M_WAITOK); @@ -1199,7 +1208,7 @@ ctl_isc_port_sync(struct ctl_softc *soft } if (msg->port.init_devid_len != 0) { if (port->init_devid == NULL || - port->init_devid->len != msg->port.init_devid_len) { + port->init_devid->len < msg->port.init_devid_len) { free(port->init_devid, M_CTL); port->init_devid = malloc(sizeof(struct ctl_devid) + msg->port.init_devid_len, M_CTL, M_WAITOK); @@ -3286,7 +3295,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (port->lun_map != NULL) { sbuf_printf(sb, "\ton\n"); - for (j = 0; j < CTL_MAX_LUNS; j++) { + for (j = 0; j < port->lun_map_size; j++) { plun = ctl_lun_map_from_port(port, j); if (plun == UINT32_MAX) continue; @@ -3366,7 +3375,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, } } mtx_unlock(&softc->ctl_lock); // XXX: port_enable sleeps - if (lm->plun < CTL_MAX_LUNS) { + if (lm->plun != UINT32_MAX) { if (lm->lun == UINT32_MAX) retval = ctl_lun_map_unset(port, lm->plun); else if (lm->lun < CTL_MAX_LUNS && @@ -3374,13 +3383,12 @@ ctl_ioctl(struct cdev *dev, u_long cmd, retval = ctl_lun_map_set(port, lm->plun, lm->lun); else return (ENXIO); - } else if (lm->plun == UINT32_MAX) { + } else { if (lm->lun == UINT32_MAX) retval = ctl_lun_map_deinit(port); else retval = ctl_lun_map_init(port); - } else - return (ENXIO); + } if (port->status & CTL_PORT_STATUS_ONLINE) ctl_isc_announce_port(port); break; @@ -3433,15 +3441,20 @@ ctl_lun_map_init(struct ctl_port *port) { struct ctl_softc *softc = port->ctl_softc; struct ctl_lun *lun; + int size = ctl_lun_map_size; uint32_t i; - if (port->lun_map == NULL) - port->lun_map = malloc(sizeof(uint32_t) * CTL_MAX_LUNS, + if (port->lun_map == NULL || port->lun_map_size < size) { + port->lun_map_size = 0; + free(port->lun_map, M_CTL); + port->lun_map = malloc(size * sizeof(uint32_t), M_CTL, M_NOWAIT); + } if (port->lun_map == NULL) return (ENOMEM); - for (i = 0; i < CTL_MAX_LUNS; i++) + for (i = 0; i < size; i++) port->lun_map[i] = UINT32_MAX; + port->lun_map_size = size; if (port->status & CTL_PORT_STATUS_ONLINE) { if (port->lun_disable != NULL) { STAILQ_FOREACH(lun, &softc->lun_list, links) @@ -3460,6 +3473,7 @@ ctl_lun_map_deinit(struct ctl_port *port if (port->lun_map == NULL) return (0); + port->lun_map_size = 0; free(port->lun_map, M_CTL); port->lun_map = NULL; if (port->status & CTL_PORT_STATUS_ONLINE) { @@ -3483,6 +3497,8 @@ ctl_lun_map_set(struct ctl_port *port, u if (status != 0) return (status); } + if (plun >= port->lun_map_size) + return (EINVAL); old = port->lun_map[plun]; port->lun_map[plun] = glun; if ((port->status & CTL_PORT_STATUS_ONLINE) && old == UINT32_MAX) { @@ -3498,7 +3514,7 @@ ctl_lun_map_unset(struct ctl_port *port, { uint32_t old; - if (port->lun_map == NULL) + if (port->lun_map == NULL || plun >= port->lun_map_size) return (0); old = port->lun_map[plun]; port->lun_map[plun] = UINT32_MAX; @@ -3516,8 +3532,10 @@ ctl_lun_map_from_port(struct ctl_port *p if (port == NULL) return (UINT32_MAX); - if (port->lun_map == NULL || lun_id == UINT32_MAX) + if (port->lun_map == NULL) return (lun_id); + if (lun_id > port->lun_map_size) + return (UINT32_MAX); return (port->lun_map[lun_id]); } @@ -3530,7 +3548,7 @@ ctl_lun_map_to_port(struct ctl_port *por return (UINT32_MAX); if (port->lun_map == NULL) return (lun_id); - for (i = 0; i < CTL_MAX_LUNS; i++) { + for (i = 0; i < port->lun_map_size; i++) { if (port->lun_map[i] == lun_id) return (i); } @@ -9039,9 +9057,8 @@ ctl_report_luns(struct ctl_scsiio *ctsio struct scsi_report_luns_data *lun_data; struct ctl_lun *lun, *request_lun; struct ctl_port *port; - int num_luns, retval; + int num_filled, num_luns, num_port_luns, retval; uint32_t alloc_len, lun_datalen; - int num_filled; uint32_t initidx, targ_lun_id, lun_id; retval = CTL_RETVAL_COMPLETE; @@ -9051,9 +9068,10 @@ ctl_report_luns(struct ctl_scsiio *ctsio CTL_DEBUG_PRINT(("ctl_report_luns\n")); - mtx_lock(&softc->ctl_lock); num_luns = 0; - for (targ_lun_id = 0; targ_lun_id < CTL_MAX_LUNS; targ_lun_id++) { + num_port_luns = port->lun_map ? port->lun_map_size : CTL_MAX_LUNS; + mtx_lock(&softc->ctl_lock); + for (targ_lun_id = 0; targ_lun_id < num_port_luns; targ_lun_id++) { if (ctl_lun_map_from_port(port, targ_lun_id) != UINT32_MAX) num_luns++; } @@ -9112,7 +9130,9 @@ ctl_report_luns(struct ctl_scsiio *ctsio initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); mtx_lock(&softc->ctl_lock); - for (targ_lun_id = 0, num_filled = 0; targ_lun_id < CTL_MAX_LUNS && num_filled < num_luns; targ_lun_id++) { + for (targ_lun_id = 0, num_filled = 0; + targ_lun_id < num_port_luns && num_filled < num_luns; + targ_lun_id++) { lun_id = ctl_lun_map_from_port(port, targ_lun_id); if (lun_id == UINT32_MAX) continue; Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:33:44 2017 (r312576) +++ stable/10/sys/cam/ctl/ctl_frontend.c Sat Jan 21 08:34:27 2017 (r312577) @@ -315,7 +315,7 @@ ctl_port_online(struct ctl_port *port) if (port->lun_enable != NULL) { if (port->lun_map) { - for (l = 0; l < CTL_MAX_LUNS; l++) { + for (l = 0; l < port->lun_map_size; l++) { if (ctl_lun_map_from_port(port, l) == UINT32_MAX) continue; @@ -359,7 +359,7 @@ ctl_port_offline(struct ctl_port *port) port->port_offline(port->onoff_arg); if (port->lun_disable != NULL) { if (port->lun_map) { - for (l = 0; l < CTL_MAX_LUNS; l++) { + for (l = 0; l < port->lun_map_size; l++) { if (ctl_lun_map_from_port(port, l) == UINT32_MAX) continue; Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Sat Jan 21 08:33:44 2017 (r312576) +++ stable/10/sys/cam/ctl/ctl_frontend.h Sat Jan 21 08:34:27 2017 (r312577) @@ -225,6 +225,7 @@ struct ctl_port { void *onoff_arg; /* passed to CTL */ lun_func_t lun_enable; /* passed to CTL */ lun_func_t lun_disable; /* passed to CTL */ + int lun_map_size; /* passed to CTL */ uint32_t *lun_map; /* passed to CTL */ void *targ_lun_arg; /* passed to CTL */ void (*fe_datamove)(union ctl_io *io); /* passed to CTL */ Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Sat Jan 21 08:33:44 2017 (r312576) +++ stable/10/sys/cam/ctl/ctl_io.h Sat Jan 21 08:34:27 2017 (r312577) @@ -365,7 +365,7 @@ struct ctl_taskio { /* * HA link messages. */ -#define CTL_HA_VERSION 1 +#define CTL_HA_VERSION 2 /* * Used for CTL_MSG_LOGIN. From owner-svn-src-all@freebsd.org Sat Jan 21 08:35:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7C8ACB70E8; Sat, 21 Jan 2017 08:35:30 +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 6852810D1; Sat, 21 Jan 2017 08:35:30 +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 v0L8ZTmA021002; Sat, 21 Jan 2017 08:35:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8ZTFj020997; Sat, 21 Jan 2017 08:35:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210835.v0L8ZTFj020997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:35:29 +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: r312578 - in stable/11/sys/cam: ctl 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: Sat, 21 Jan 2017 08:35:30 -0000 Author: mav Date: Sat Jan 21 08:35:28 2017 New Revision: 312578 URL: https://svnweb.freebsd.org/changeset/base/312578 Log: MFC r310640, r310643: Add support for revert to defaults (RTD) bit in MODE SELECT. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl.h stable/11/sys/cam/ctl/ctl_cmd_table.c stable/11/sys/cam/scsi/scsi_all.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:34:27 2017 (r312577) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:35:28 2017 (r312578) @@ -6158,10 +6158,13 @@ bailout_no_done: int ctl_mode_select(struct ctl_scsiio *ctsio) { - int param_len, pf, sp; - int header_size, bd_len; + struct ctl_lun *lun; union ctl_modepage_info *modepage_info; + int bd_len, i, header_size, param_len, pf, rtd, sp; + uint32_t initidx; + lun = ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); switch (ctsio->cdb[0]) { case MODE_SELECT_6: { struct scsi_mode_select_6 *cdb; @@ -6169,6 +6172,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio cdb = (struct scsi_mode_select_6 *)ctsio->cdb; pf = (cdb->byte2 & SMS_PF) ? 1 : 0; + rtd = (cdb->byte2 & SMS_RTD) ? 1 : 0; sp = (cdb->byte2 & SMS_SP) ? 1 : 0; param_len = cdb->length; header_size = sizeof(struct scsi_mode_header_6); @@ -6180,6 +6184,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio cdb = (struct scsi_mode_select_10 *)ctsio->cdb; pf = (cdb->byte2 & SMS_PF) ? 1 : 0; + rtd = (cdb->byte2 & SMS_RTD) ? 1 : 0; sp = (cdb->byte2 & SMS_SP) ? 1 : 0; param_len = scsi_2btoul(cdb->length); header_size = sizeof(struct scsi_mode_header_10); @@ -6191,6 +6196,30 @@ ctl_mode_select(struct ctl_scsiio *ctsio return (CTL_RETVAL_COMPLETE); } + if (rtd) { + if (param_len != 0) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 0, + /*command*/ 1, /*field*/ 0, + /*bit_valid*/ 0, /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + /* Revert to defaults. */ + ctl_init_page_index(lun); + mtx_lock(&lun->lun_lock); + ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE); + mtx_unlock(&lun->lun_lock); + for (i = 0; i < CTL_NUM_MODE_PAGES; i++) { + ctl_isc_announce_mode(lun, -1, + lun->mode_pages.index[i].page_code & SMPH_PC_MASK, + lun->mode_pages.index[i].subpage); + } + ctl_set_success(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + /* * From SPC-3: * "A parameter list length of zero indicates that the Data-Out Buffer @@ -9563,6 +9592,11 @@ ctl_inquiry_evpd_eid(struct ctl_scsiio * eid_ptr->flags4 = SVPD_EID_LUICLR; /* + * We support revert to defaults (RTD) bit in MODE SELECT. + */ + eid_ptr->flags5 = SVPD_EID_RTD_SUP; + + /* * XXX KDM in order to correctly answer this, we would need * information from the SIM to determine how much sense data it * can send. So this would really be a path inquiry field, most Modified: stable/11/sys/cam/ctl/ctl.h ============================================================================== --- stable/11/sys/cam/ctl/ctl.h Sat Jan 21 08:34:27 2017 (r312577) +++ stable/11/sys/cam/ctl/ctl.h Sat Jan 21 08:35:28 2017 (r312578) @@ -78,14 +78,8 @@ struct ctl_modepage_header { int32_t len_left; }; -struct ctl_modepage_aps { - struct ctl_modepage_header header; - uint8_t lock_active; -}; - union ctl_modepage_info { struct ctl_modepage_header header; - struct ctl_modepage_aps aps; }; /* Modified: stable/11/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_cmd_table.c Sat Jan 21 08:34:27 2017 (r312577) +++ stable/11/sys/cam/ctl/ctl_cmd_table.c Sat Jan 21 08:35:28 2017 (r312578) @@ -990,7 +990,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_NO_MEDIA | CTL_CMD_FLAG_OK_ON_STANDBY | CTL_FLAG_DATA_OUT, - CTL_LUN_PAT_NONE, 6, {0x11, 0, 0, 0xff, 0x07}}, + CTL_LUN_PAT_NONE, 6, {0x13, 0, 0, 0xff, 0x07}}, /* 16 RESERVE(6) */ {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | @@ -1260,7 +1260,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_NO_MEDIA | CTL_CMD_FLAG_OK_ON_STANDBY | CTL_FLAG_DATA_OUT, - CTL_LUN_PAT_NONE, 10, {0x11, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07} }, + CTL_LUN_PAT_NONE, 10, {0x13, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07} }, /* 56 RESERVE(10) */ {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | Modified: stable/11/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/11/sys/cam/scsi/scsi_all.h Sat Jan 21 08:34:27 2017 (r312577) +++ stable/11/sys/cam/scsi/scsi_all.h Sat Jan 21 08:35:28 2017 (r312578) @@ -228,6 +228,7 @@ struct scsi_mode_select_6 u_int8_t opcode; u_int8_t byte2; #define SMS_SP 0x01 +#define SMS_RTD 0x02 #define SMS_PF 0x10 u_int8_t unused[2]; u_int8_t length; From owner-svn-src-all@freebsd.org Sat Jan 21 08:36:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAF04CB716E; Sat, 21 Jan 2017 08:36: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 8B9EA1236; Sat, 21 Jan 2017 08:36: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 v0L8a5Yp021080; Sat, 21 Jan 2017 08:36:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8a5hE021076; Sat, 21 Jan 2017 08:36:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210836.v0L8a5hE021076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:36: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: r312579 - in stable/10/sys/cam: ctl scsi 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, 21 Jan 2017 08:36:06 -0000 Author: mav Date: Sat Jan 21 08:36:05 2017 New Revision: 312579 URL: https://svnweb.freebsd.org/changeset/base/312579 Log: MFC r310640, r310643: Add support for revert to defaults (RTD) bit in MODE SELECT. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/scsi/scsi_all.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:35:28 2017 (r312578) +++ stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:36:05 2017 (r312579) @@ -6149,10 +6149,13 @@ bailout_no_done: int ctl_mode_select(struct ctl_scsiio *ctsio) { - int param_len, pf, sp; - int header_size, bd_len; + struct ctl_lun *lun; union ctl_modepage_info *modepage_info; + int bd_len, i, header_size, param_len, pf, rtd, sp; + uint32_t initidx; + lun = ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); switch (ctsio->cdb[0]) { case MODE_SELECT_6: { struct scsi_mode_select_6 *cdb; @@ -6160,6 +6163,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio cdb = (struct scsi_mode_select_6 *)ctsio->cdb; pf = (cdb->byte2 & SMS_PF) ? 1 : 0; + rtd = (cdb->byte2 & SMS_RTD) ? 1 : 0; sp = (cdb->byte2 & SMS_SP) ? 1 : 0; param_len = cdb->length; header_size = sizeof(struct scsi_mode_header_6); @@ -6171,6 +6175,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio cdb = (struct scsi_mode_select_10 *)ctsio->cdb; pf = (cdb->byte2 & SMS_PF) ? 1 : 0; + rtd = (cdb->byte2 & SMS_RTD) ? 1 : 0; sp = (cdb->byte2 & SMS_SP) ? 1 : 0; param_len = scsi_2btoul(cdb->length); header_size = sizeof(struct scsi_mode_header_10); @@ -6182,6 +6187,30 @@ ctl_mode_select(struct ctl_scsiio *ctsio return (CTL_RETVAL_COMPLETE); } + if (rtd) { + if (param_len != 0) { + ctl_set_invalid_field(ctsio, /*sks_valid*/ 0, + /*command*/ 1, /*field*/ 0, + /*bit_valid*/ 0, /*bit*/ 0); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + /* Revert to defaults. */ + ctl_init_page_index(lun); + mtx_lock(&lun->lun_lock); + ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE); + mtx_unlock(&lun->lun_lock); + for (i = 0; i < CTL_NUM_MODE_PAGES; i++) { + ctl_isc_announce_mode(lun, -1, + lun->mode_pages.index[i].page_code & SMPH_PC_MASK, + lun->mode_pages.index[i].subpage); + } + ctl_set_success(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + /* * From SPC-3: * "A parameter list length of zero indicates that the Data-Out Buffer @@ -9554,6 +9583,11 @@ ctl_inquiry_evpd_eid(struct ctl_scsiio * eid_ptr->flags4 = SVPD_EID_LUICLR; /* + * We support revert to defaults (RTD) bit in MODE SELECT. + */ + eid_ptr->flags5 = SVPD_EID_RTD_SUP; + + /* * XXX KDM in order to correctly answer this, we would need * information from the SIM to determine how much sense data it * can send. So this would really be a path inquiry field, most Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Sat Jan 21 08:35:28 2017 (r312578) +++ stable/10/sys/cam/ctl/ctl.h Sat Jan 21 08:36:05 2017 (r312579) @@ -78,14 +78,8 @@ struct ctl_modepage_header { int32_t len_left; }; -struct ctl_modepage_aps { - struct ctl_modepage_header header; - uint8_t lock_active; -}; - union ctl_modepage_info { struct ctl_modepage_header header; - struct ctl_modepage_aps aps; }; /* Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Sat Jan 21 08:35:28 2017 (r312578) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Sat Jan 21 08:36:05 2017 (r312579) @@ -990,7 +990,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_NO_MEDIA | CTL_CMD_FLAG_OK_ON_STANDBY | CTL_FLAG_DATA_OUT, - CTL_LUN_PAT_NONE, 6, {0x11, 0, 0, 0xff, 0x07}}, + CTL_LUN_PAT_NONE, 6, {0x13, 0, 0, 0xff, 0x07}}, /* 16 RESERVE(6) */ {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | @@ -1260,7 +1260,7 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_CMD_FLAG_OK_ON_NO_MEDIA | CTL_CMD_FLAG_OK_ON_STANDBY | CTL_FLAG_DATA_OUT, - CTL_LUN_PAT_NONE, 10, {0x11, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07} }, + CTL_LUN_PAT_NONE, 10, {0x13, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07} }, /* 56 RESERVE(10) */ {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV | Modified: stable/10/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/10/sys/cam/scsi/scsi_all.h Sat Jan 21 08:35:28 2017 (r312578) +++ stable/10/sys/cam/scsi/scsi_all.h Sat Jan 21 08:36:05 2017 (r312579) @@ -228,6 +228,7 @@ struct scsi_mode_select_6 u_int8_t opcode; u_int8_t byte2; #define SMS_SP 0x01 +#define SMS_RTD 0x02 #define SMS_PF 0x10 u_int8_t unused[2]; u_int8_t length; From owner-svn-src-all@freebsd.org Sat Jan 21 08:37:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C10A0CB7214; Sat, 21 Jan 2017 08:37:00 +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 9044F13B3; Sat, 21 Jan 2017 08:37:00 +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 v0L8ax5h021164; Sat, 21 Jan 2017 08:36:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8axg5021162; Sat, 21 Jan 2017 08:36:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210836.v0L8axg5021162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:36: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: r312580 - 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, 21 Jan 2017 08:37:00 -0000 Author: mav Date: Sat Jan 21 08:36:59 2017 New Revision: 312580 URL: https://svnweb.freebsd.org/changeset/base/312580 Log: MFC r310644: Fix/synchronize field types in struct ctl_modepage_header. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:36:05 2017 (r312579) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:36:59 2017 (r312580) @@ -5939,7 +5939,7 @@ ctl_do_mode_select(union ctl_io *io) int page_len, page_len_offset, page_len_size; union ctl_modepage_info *modepage_info; struct ctl_lun *lun; - int *len_left, *len_used; + uint16_t *len_left, *len_used; int retval, i; ctsio = &io->scsiio; Modified: stable/11/sys/cam/ctl/ctl.h ============================================================================== --- stable/11/sys/cam/ctl/ctl.h Sat Jan 21 08:36:05 2017 (r312579) +++ stable/11/sys/cam/ctl/ctl.h Sat Jan 21 08:36:59 2017 (r312580) @@ -74,8 +74,8 @@ struct ctl_port_entry { struct ctl_modepage_header { uint8_t page_code; uint8_t subpage; - int32_t len_used; - int32_t len_left; + uint16_t len_used; + uint16_t len_left; }; union ctl_modepage_info { From owner-svn-src-all@freebsd.org Sat Jan 21 08:37:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 663E3CB729A; Sat, 21 Jan 2017 08:37:54 +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 359321592; Sat, 21 Jan 2017 08:37:54 +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 v0L8brZ8021251; Sat, 21 Jan 2017 08:37:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8brKN021249; Sat, 21 Jan 2017 08:37:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210837.v0L8brKN021249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:37: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: r312581 - stable/10/sys/cam/ctl 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, 21 Jan 2017 08:37:54 -0000 Author: mav Date: Sat Jan 21 08:37:53 2017 New Revision: 312581 URL: https://svnweb.freebsd.org/changeset/base/312581 Log: MFC r310644: Fix/synchronize field types in struct ctl_modepage_header. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:36:59 2017 (r312580) +++ stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:37:53 2017 (r312581) @@ -5930,7 +5930,7 @@ ctl_do_mode_select(union ctl_io *io) int page_len, page_len_offset, page_len_size; union ctl_modepage_info *modepage_info; struct ctl_lun *lun; - int *len_left, *len_used; + uint16_t *len_left, *len_used; int retval, i; ctsio = &io->scsiio; Modified: stable/10/sys/cam/ctl/ctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl.h Sat Jan 21 08:36:59 2017 (r312580) +++ stable/10/sys/cam/ctl/ctl.h Sat Jan 21 08:37:53 2017 (r312581) @@ -74,8 +74,8 @@ struct ctl_port_entry { struct ctl_modepage_header { uint8_t page_code; uint8_t subpage; - int32_t len_used; - int32_t len_left; + uint16_t len_used; + uint16_t len_left; }; union ctl_modepage_info { From owner-svn-src-all@freebsd.org Sat Jan 21 08:39:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE37BCB7328; Sat, 21 Jan 2017 08:39:02 +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 9D8311705; Sat, 21 Jan 2017 08:39:02 +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 v0L8d1k6021346; Sat, 21 Jan 2017 08:39:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8d18g021345; Sat, 21 Jan 2017 08:39:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210839.v0L8d18g021345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:39:01 +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: r312582 - 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, 21 Jan 2017 08:39:02 -0000 Author: mav Date: Sat Jan 21 08:39:01 2017 New Revision: 312582 URL: https://svnweb.freebsd.org/changeset/base/312582 Log: MFC r310646: Do not update "saved" mode page on every MODE SELECT. We do not have non-volatile memory to really save those values, so we neither report nor support this capability. Also saved mode pages are not replicated between HA peers now. Modified: stable/11/sys/cam/ctl/ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:37:53 2017 (r312581) +++ stable/11/sys/cam/ctl/ctl.c Sat Jan 21 08:39:01 2017 (r312582) @@ -5833,7 +5833,7 @@ ctl_default_page_handler(struct ctl_scsi struct ctl_page_index *page_index, uint8_t *page_ptr) { struct ctl_lun *lun; - uint8_t *current_cp, *saved_cp; + uint8_t *current_cp; int set_ua; uint32_t initidx; @@ -5843,13 +5843,10 @@ ctl_default_page_handler(struct ctl_scsi current_cp = (page_index->page_data + (page_index->page_len * CTL_PAGE_CURRENT)); - saved_cp = (page_index->page_data + (page_index->page_len * - CTL_PAGE_SAVED)); mtx_lock(&lun->lun_lock); if (memcmp(current_cp, page_ptr, page_index->page_len)) { memcpy(current_cp, page_ptr, page_index->page_len); - memcpy(saved_cp, page_ptr, page_index->page_len); set_ua = 1; } if (set_ua != 0) From owner-svn-src-all@freebsd.org Sat Jan 21 08:39:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6C4FCB73AF; Sat, 21 Jan 2017 08:39:40 +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 B6367188F; Sat, 21 Jan 2017 08:39:40 +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 v0L8ddi5021420; Sat, 21 Jan 2017 08:39:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8ddZJ021419; Sat, 21 Jan 2017 08:39:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210839.v0L8ddZJ021419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:39: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: r312583 - stable/10/sys/cam/ctl 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, 21 Jan 2017 08:39:41 -0000 Author: mav Date: Sat Jan 21 08:39:39 2017 New Revision: 312583 URL: https://svnweb.freebsd.org/changeset/base/312583 Log: MFC r310646: Do not update "saved" mode page on every MODE SELECT. We do not have non-volatile memory to really save those values, so we neither report nor support this capability. Also saved mode pages are not replicated between HA peers now. Modified: stable/10/sys/cam/ctl/ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:39:01 2017 (r312582) +++ stable/10/sys/cam/ctl/ctl.c Sat Jan 21 08:39:39 2017 (r312583) @@ -5824,7 +5824,7 @@ ctl_default_page_handler(struct ctl_scsi struct ctl_page_index *page_index, uint8_t *page_ptr) { struct ctl_lun *lun; - uint8_t *current_cp, *saved_cp; + uint8_t *current_cp; int set_ua; uint32_t initidx; @@ -5834,13 +5834,10 @@ ctl_default_page_handler(struct ctl_scsi current_cp = (page_index->page_data + (page_index->page_len * CTL_PAGE_CURRENT)); - saved_cp = (page_index->page_data + (page_index->page_len * - CTL_PAGE_SAVED)); mtx_lock(&lun->lun_lock); if (memcmp(current_cp, page_ptr, page_index->page_len)) { memcpy(current_cp, page_ptr, page_index->page_len); - memcpy(saved_cp, page_ptr, page_index->page_len); set_ua = 1; } if (set_ua != 0) From owner-svn-src-all@freebsd.org Sat Jan 21 08:40:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8740FCB7441; Sat, 21 Jan 2017 08:40:31 +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 61CF619F5; Sat, 21 Jan 2017 08:40:31 +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 v0L8eUFB021526; Sat, 21 Jan 2017 08:40:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8eUt5021524; Sat, 21 Jan 2017 08:40:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210840.v0L8eUt5021524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:40:30 +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: r312584 - 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, 21 Jan 2017 08:40:31 -0000 Author: mav Date: Sat Jan 21 08:40:30 2017 New Revision: 312584 URL: https://svnweb.freebsd.org/changeset/base/312584 Log: MFC r310649: Allow more efficient use of private area. There are 16 bytes of space, so we may store two pointers in one. Modified: stable/11/sys/cam/ctl/ctl_io.h stable/11/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/11/sys/cam/ctl/ctl_io.h Sat Jan 21 08:39:39 2017 (r312583) +++ stable/11/sys/cam/ctl/ctl_io.h Sat Jan 21 08:40:30 2017 (r312584) @@ -145,7 +145,9 @@ struct ctl_ptr_len_flags { union ctl_priv { uint8_t bytes[sizeof(uint64_t) * 2]; uint64_t integer; + uint64_t integers[2]; void *ptr; + void *ptrs[2]; }; /* Modified: stable/11/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/11/sys/cam/ctl/scsi_ctl.c Sat Jan 21 08:39:39 2017 (r312583) +++ stable/11/sys/cam/ctl/scsi_ctl.c Sat Jan 21 08:40:30 2017 (r312584) @@ -185,6 +185,9 @@ MALLOC_DEFINE(M_CTLFE, "CAM CTL FE", "CA /* This is only used in the CTIO */ #define ccb_atio ppriv_ptr1 +#define PRIV_CCB(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[0]) +#define PRIV_INFO(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[1]) + int ctlfeinitialize(void); void ctlfeshutdown(void); static periph_init_t ctlfeperiphinit; @@ -554,7 +557,7 @@ ctlferegister(struct cam_periph *periph, status = CAM_RESRC_UNAVAIL; break; } - new_io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr = cmd_info; + PRIV_INFO(new_io) = cmd_info; softc->atios_alloced++; new_ccb->ccb_h.io_ptr = new_io; @@ -702,7 +705,7 @@ ctlfedata(struct ctlfe_lun_softc *softc, size_t off; int i, idx; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); bus_softc = softc->parent_softc; /* @@ -806,7 +809,7 @@ ctlfestart(struct cam_periph *periph, un flags = atio->ccb_h.flags & (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK); - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); cmd_info->cur_transfer_index = 0; cmd_info->cur_transfer_off = 0; cmd_info->flags = 0; @@ -987,7 +990,7 @@ ctlfe_free_ccb(struct cam_periph *periph switch (ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: softc->atios_freed++; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); free(cmd_info, M_CTLFE); break; case XPT_IMMEDIATE_NOTIFY: @@ -1154,12 +1157,12 @@ ctlfedone(struct cam_periph *periph, uni */ mtx_unlock(mtx); io = done_ccb->ccb_h.io_ptr; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); ctl_zero_io(io); /* Save pointers on both sides */ - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = done_ccb; - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr = cmd_info; + PRIV_CCB(io) = done_ccb; + PRIV_INFO(io) = cmd_info; done_ccb->ccb_h.io_ptr = io; /* @@ -1315,7 +1318,7 @@ ctlfedone(struct cam_periph *periph, uni struct ccb_scsiio *csio; csio = &done_ccb->csio; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG; @@ -1444,7 +1447,7 @@ ctlfedone(struct cam_periph *periph, uni send_ctl_io = 1; io->io_hdr.io_type = CTL_IO_TASK; - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr =done_ccb; + PRIV_CCB(io) = done_ccb; inot->ccb_h.io_ptr = io; io->io_hdr.nexus.initid = inot->initiator_id; io->io_hdr.nexus.targ_port = bus_softc->port.targ_port; @@ -2002,7 +2005,7 @@ ctlfe_datamove(union ctl_io *io) KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, ("Unexpected io_type (%d) in ctlfe_datamove", io->io_hdr.io_type)); - ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + ccb = PRIV_CCB(io); periph = xpt_path_periph(ccb->ccb_h.path); cam_periph_lock(periph); softc = (struct ctlfe_lun_softc *)periph->softc; @@ -2022,7 +2025,7 @@ ctlfe_done(union ctl_io *io) struct cam_periph *periph; struct ctlfe_lun_softc *softc; - ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + ccb = PRIV_CCB(io); periph = xpt_path_periph(ccb->ccb_h.path); cam_periph_lock(periph); softc = (struct ctlfe_lun_softc *)periph->softc; From owner-svn-src-all@freebsd.org Sat Jan 21 08:41:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97A3FCB7607; Sat, 21 Jan 2017 08:41:01 +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 724221BC0; Sat, 21 Jan 2017 08:41:01 +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 v0L8f0ec022470; Sat, 21 Jan 2017 08:41:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8f0Nr022468; Sat, 21 Jan 2017 08:41:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210841.v0L8f0Nr022468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:41:00 +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: r312585 - stable/10/sys/cam/ctl 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, 21 Jan 2017 08:41:01 -0000 Author: mav Date: Sat Jan 21 08:41:00 2017 New Revision: 312585 URL: https://svnweb.freebsd.org/changeset/base/312585 Log: MFC r310649: Allow more efficient use of private area. There are 16 bytes of space, so we may store two pointers in one. Modified: stable/10/sys/cam/ctl/ctl_io.h stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_io.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_io.h Sat Jan 21 08:40:30 2017 (r312584) +++ stable/10/sys/cam/ctl/ctl_io.h Sat Jan 21 08:41:00 2017 (r312585) @@ -145,7 +145,9 @@ struct ctl_ptr_len_flags { union ctl_priv { uint8_t bytes[sizeof(uint64_t) * 2]; uint64_t integer; + uint64_t integers[2]; void *ptr; + void *ptrs[2]; }; /* Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Sat Jan 21 08:40:30 2017 (r312584) +++ stable/10/sys/cam/ctl/scsi_ctl.c Sat Jan 21 08:41:00 2017 (r312585) @@ -185,6 +185,9 @@ MALLOC_DEFINE(M_CTLFE, "CAM CTL FE", "CA /* This is only used in the CTIO */ #define ccb_atio ppriv_ptr1 +#define PRIV_CCB(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[0]) +#define PRIV_INFO(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[1]) + int ctlfeinitialize(void); void ctlfeshutdown(void); static periph_init_t ctlfeperiphinit; @@ -554,7 +557,7 @@ ctlferegister(struct cam_periph *periph, status = CAM_RESRC_UNAVAIL; break; } - new_io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr = cmd_info; + PRIV_INFO(new_io) = cmd_info; softc->atios_alloced++; new_ccb->ccb_h.io_ptr = new_io; @@ -702,7 +705,7 @@ ctlfedata(struct ctlfe_lun_softc *softc, size_t off; int i, idx; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); bus_softc = softc->parent_softc; /* @@ -806,7 +809,7 @@ ctlfestart(struct cam_periph *periph, un flags = atio->ccb_h.flags & (CAM_DIS_DISCONNECT|CAM_TAG_ACTION_VALID|CAM_DIR_MASK); - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); cmd_info->cur_transfer_index = 0; cmd_info->cur_transfer_off = 0; cmd_info->flags = 0; @@ -987,7 +990,7 @@ ctlfe_free_ccb(struct cam_periph *periph switch (ccb->ccb_h.func_code) { case XPT_ACCEPT_TARGET_IO: softc->atios_freed++; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); free(cmd_info, M_CTLFE); break; case XPT_IMMEDIATE_NOTIFY: @@ -1154,12 +1157,12 @@ ctlfedone(struct cam_periph *periph, uni */ mtx_unlock(mtx); io = done_ccb->ccb_h.io_ptr; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); ctl_zero_io(io); /* Save pointers on both sides */ - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr = done_ccb; - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr = cmd_info; + PRIV_CCB(io) = done_ccb; + PRIV_INFO(io) = cmd_info; done_ccb->ccb_h.io_ptr = io; /* @@ -1315,7 +1318,7 @@ ctlfedone(struct cam_periph *periph, uni struct ccb_scsiio *csio; csio = &done_ccb->csio; - cmd_info = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND2].ptr; + cmd_info = PRIV_INFO(io); io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG; @@ -1444,7 +1447,7 @@ ctlfedone(struct cam_periph *periph, uni send_ctl_io = 1; io->io_hdr.io_type = CTL_IO_TASK; - io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr =done_ccb; + PRIV_CCB(io) = done_ccb; inot->ccb_h.io_ptr = io; io->io_hdr.nexus.initid = inot->initiator_id; io->io_hdr.nexus.targ_port = bus_softc->port.targ_port; @@ -2001,7 +2004,7 @@ ctlfe_datamove(union ctl_io *io) KASSERT(io->io_hdr.io_type == CTL_IO_SCSI, ("Unexpected io_type (%d) in ctlfe_datamove", io->io_hdr.io_type)); - ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + ccb = PRIV_CCB(io); periph = xpt_path_periph(ccb->ccb_h.path); cam_periph_lock(periph); softc = (struct ctlfe_lun_softc *)periph->softc; @@ -2021,7 +2024,7 @@ ctlfe_done(union ctl_io *io) struct cam_periph *periph; struct ctlfe_lun_softc *softc; - ccb = io->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptr; + ccb = PRIV_CCB(io); periph = xpt_path_periph(ccb->ccb_h.path); cam_periph_lock(periph); softc = (struct ctlfe_lun_softc *)periph->softc; From owner-svn-src-all@freebsd.org Sat Jan 21 08:43:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87C29CB76AC; Sat, 21 Jan 2017 08:43:12 +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 5741E1F4E; Sat, 21 Jan 2017 08:43:12 +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 v0L8hBdI025702; Sat, 21 Jan 2017 08:43:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8hBFk025701; Sat, 21 Jan 2017 08:43:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210843.v0L8hBFk025701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08: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: r312586 - 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, 21 Jan 2017 08:43:12 -0000 Author: mav Date: Sat Jan 21 08:43:11 2017 New Revision: 312586 URL: https://svnweb.freebsd.org/changeset/base/312586 Log: MFC r311892: Do not wait for HA thread shutdown if scheduler is stopped. This wait loop made system hang on panic instead of reboot. Modified: stable/11/sys/cam/ctl/ctl_ha.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_ha.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_ha.c Sat Jan 21 08:41:00 2017 (r312585) +++ stable/11/sys/cam/ctl/ctl_ha.c Sat Jan 21 08:43:11 2017 (r312586) @@ -1001,7 +1001,7 @@ ctl_ha_msg_shutdown(struct ctl_softc *ct softc->ha_shutdown = 1; softc->ha_wakeup = 1; wakeup(&softc->ha_wakeup); - while (softc->ha_shutdown < 2) { + while (softc->ha_shutdown < 2 && !SCHEDULER_STOPPED()) { msleep(&softc->ha_wakeup, &softc->ha_lock, 0, "shutdown", hz); } From owner-svn-src-all@freebsd.org Sat Jan 21 08:43:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01790CB7738; Sat, 21 Jan 2017 08:43:43 +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 C4F1E10BB; Sat, 21 Jan 2017 08:43:42 +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 v0L8hf7m025773; Sat, 21 Jan 2017 08:43:41 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L8hfJR025772; Sat, 21 Jan 2017 08:43:41 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701210843.v0L8hfJR025772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 08:43: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: r312587 - stable/10/sys/cam/ctl 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, 21 Jan 2017 08:43:43 -0000 Author: mav Date: Sat Jan 21 08:43:41 2017 New Revision: 312587 URL: https://svnweb.freebsd.org/changeset/base/312587 Log: MFC r311892: Do not wait for HA thread shutdown if scheduler is stopped. This wait loop made system hang on panic instead of reboot. Modified: stable/10/sys/cam/ctl/ctl_ha.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_ha.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_ha.c Sat Jan 21 08:43:11 2017 (r312586) +++ stable/10/sys/cam/ctl/ctl_ha.c Sat Jan 21 08:43:41 2017 (r312587) @@ -1001,7 +1001,7 @@ ctl_ha_msg_shutdown(struct ctl_softc *ct softc->ha_shutdown = 1; softc->ha_wakeup = 1; wakeup(&softc->ha_wakeup); - while (softc->ha_shutdown < 2) { + while (softc->ha_shutdown < 2 && !SCHEDULER_STOPPED()) { msleep(&softc->ha_wakeup, &softc->ha_lock, 0, "shutdown", hz); } From owner-svn-src-all@freebsd.org Sat Jan 21 09:08:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E37ECB91E4; Sat, 21 Jan 2017 09:08:29 +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 130E41CE4; Sat, 21 Jan 2017 09:08:29 +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 v0L98S5W033736; Sat, 21 Jan 2017 09:08:28 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0L98SQp033735; Sat, 21 Jan 2017 09:08:28 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201701210908.v0L98SQp033735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 21 Jan 2017 09:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312588 - head/sys/mips/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: Sat, 21 Jan 2017 09:08:29 -0000 Author: brooks Date: Sat Jan 21 09:08:27 2017 New Revision: 312588 URL: https://svnweb.freebsd.org/changeset/base/312588 Log: Enable TMPFS on MALTA so we can use it on minimalist disk images without modules. Sponsored by: DARPA, AFRL Modified: head/sys/mips/conf/std.MALTA Modified: head/sys/mips/conf/std.MALTA ============================================================================== --- head/sys/mips/conf/std.MALTA Sat Jan 21 08:43:41 2017 (r312587) +++ head/sys/mips/conf/std.MALTA Sat Jan 21 09:08:27 2017 (r312588) @@ -27,6 +27,8 @@ options NFS_ROOT #NFS usable as /, req options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options TMPFS #Efficient memory filesystem + options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists From owner-svn-src-all@freebsd.org Sat Jan 21 11:41:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1867BCBA185; Sat, 21 Jan 2017 11:41:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A484F1D93; Sat, 21 Jan 2017 11:41:25 +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 v0LBfK95032669 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 21 Jan 2017 13:41:20 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v0LBfK95032669 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v0LBfKkG032668; Sat, 21 Jan 2017 13:41:20 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 21 Jan 2017 13:41:20 +0200 From: Konstantin Belousov To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312588 - head/sys/mips/conf Message-ID: <20170121114120.GU2349@kib.kiev.ua> References: <201701210908.v0L98SQp033735@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701210908.v0L98SQp033735@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) 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: Sat, 21 Jan 2017 11:41:26 -0000 On Sat, Jan 21, 2017 at 09:08:28AM +0000, Brooks Davis wrote: > +options TMPFS #Efficient memory filesystem Is the word 'efficient' copied from somewhere ? Yes, I see it in sys/conf/NOTES. I do not see what useful meaning the word has there, applied to the tmpfs. In my opinion, it should be removed from comments. From owner-svn-src-all@freebsd.org Sat Jan 21 11:47:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97E3ACBA2B9; Sat, 21 Jan 2017 11:47:32 +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 7285B106C; Sat, 21 Jan 2017 11:47:32 +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 v0LBlVfL098738; Sat, 21 Jan 2017 11:47:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LBlVEt098732; Sat, 21 Jan 2017 11:47:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701211147.v0LBlVEt098732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 Jan 2017 11:47:31 +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: r312589 - in stable/11/lib/libc: include stdlib 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, 21 Jan 2017 11:47:32 -0000 Author: kib Date: Sat Jan 21 11:47:30 2017 New Revision: 312589 URL: https://svnweb.freebsd.org/changeset/base/312589 Log: MFC r311651: Export __cxa_thread_atexit_impl as an alias for __cxa_thread_atexit. Added: stable/11/lib/libc/stdlib/cxa_thread_atexit_impl.c - copied unchanged from r311651, head/lib/libc/stdlib/cxa_thread_atexit_impl.c Modified: stable/11/lib/libc/include/libc_private.h stable/11/lib/libc/stdlib/Makefile.inc stable/11/lib/libc/stdlib/Symbol.map stable/11/lib/libc/stdlib/cxa_thread_atexit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/include/libc_private.h ============================================================================== --- stable/11/lib/libc/include/libc_private.h Sat Jan 21 09:08:27 2017 (r312588) +++ stable/11/lib/libc/include/libc_private.h Sat Jan 21 11:47:30 2017 (r312589) @@ -272,6 +272,8 @@ void _malloc_thread_cleanup(void); * thread is exiting, so its thread-local dtors should be called. */ void __cxa_thread_call_dtors(void); +int __cxa_thread_atexit_hidden(void (*dtor_func)(void *), void *obj, + void *dso_symbol) __hidden; /* * These functions are used by the threading libraries in order to protect Modified: stable/11/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/11/lib/libc/stdlib/Makefile.inc Sat Jan 21 09:08:27 2017 (r312588) +++ stable/11/lib/libc/stdlib/Makefile.inc Sat Jan 21 11:47:30 2017 (r312589) @@ -5,7 +5,9 @@ .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/stdlib ${LIBC_SRCTOP}/stdlib MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ - bsearch.c cxa_thread_atexit.c div.c exit.c getenv.c getopt.c getopt_long.c \ + bsearch.c \ + cxa_thread_atexit.c cxa_thread_atexit_impl.c \ + div.c exit.c getenv.c getopt.c getopt_long.c \ getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \ hsearch_r.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \ Modified: stable/11/lib/libc/stdlib/Symbol.map ============================================================================== --- stable/11/lib/libc/stdlib/Symbol.map Sat Jan 21 09:08:27 2017 (r312588) +++ stable/11/lib/libc/stdlib/Symbol.map Sat Jan 21 11:47:30 2017 (r312589) @@ -118,6 +118,7 @@ FBSD_1.4 { FBSD_1.5 { __cxa_thread_atexit; + __cxa_thread_atexit_impl; }; FBSDprivate_1.0 { Modified: stable/11/lib/libc/stdlib/cxa_thread_atexit.c ============================================================================== --- stable/11/lib/libc/stdlib/cxa_thread_atexit.c Sat Jan 21 09:08:27 2017 (r312588) +++ stable/11/lib/libc/stdlib/cxa_thread_atexit.c Sat Jan 21 11:47:30 2017 (r312589) @@ -1,7 +1,10 @@ /*- - * Copyright (c) 2016 Mahdi Mokhtari + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,114 +30,11 @@ #include __FBSDID("$FreeBSD$"); -#include -#include "namespace.h" -#include -#include -#include -#include -#include -#include -#include "un-namespace.h" #include "libc_private.h" -/* - * C++11 introduces the thread_local scope (like __thread with some - * additions). As a key-feature it should support non-trivial - * destructors, registered with __cxa_thread_atexit() to be executed - * at the thread termination. - * - * The implemention keeps a _Thread_local list of destructors per each - * thread, and calls __cxa_thread_call_dtors() on each thread's exit - * to do cleanup. For a thread calling exit(3), in particular, for - * the initial thread returning from main(), we call - * __cxa_thread_call_dtors() inside exit(). - * - * It could be possible that a dynamically loaded library, use - * thread_local variable but is dlclose()'d before thread exit. The - * destructor of this variable will then try to access the address, - * for calling it but it's unloaded, so it'll crash. We're using - * __elf_phdr_match_addr() to detect and prevent such cases and so - * prevent the crash. - */ - -#define CXA_DTORS_ITERATIONS 4 - -struct cxa_thread_dtor { - void *obj; - void (*func)(void *); - void *dso; - LIST_ENTRY(cxa_thread_dtor) entry; -}; -static _Thread_local LIST_HEAD(dtor_list, cxa_thread_dtor) dtors = - LIST_HEAD_INITIALIZER(dtors); - int __cxa_thread_atexit(void (*dtor_func)(void *), void *obj, void *dso_symbol) { - struct cxa_thread_dtor *new_dtor; - - new_dtor = malloc(sizeof(*new_dtor)); - if (new_dtor == NULL) { - errno = ENOMEM; /* forcibly override malloc(3) error */ - return (-1); - } - - new_dtor->obj = obj; - new_dtor->func = dtor_func; - new_dtor->dso = dso_symbol; - LIST_INSERT_HEAD(&dtors, new_dtor, entry); - return (0); -} - -static void -walk_cb_call(struct cxa_thread_dtor *dtor) -{ - struct dl_phdr_info phdr_info; - - if (_rtld_addr_phdr(dtor->dso, &phdr_info) && - __elf_phdr_match_addr(&phdr_info, dtor->func)) - dtor->func(dtor->obj); - else - fprintf(stderr, "__cxa_thread_call_dtors: dtr %p from " - "unloaded dso, skipping\n", (void *)(dtor->func)); -} - -static void -walk_cb_nocall(struct cxa_thread_dtor *dtor __unused) -{ -} - -static void -cxa_thread_walk(void (*cb)(struct cxa_thread_dtor *)) -{ - struct cxa_thread_dtor *dtor, *tdtor; - - LIST_FOREACH_SAFE(dtor, &dtors, entry, tdtor) { - LIST_REMOVE(dtor, entry); - cb(dtor); - free(dtor); - } -} - -/* - * This is the callback function we use to call destructors, once for - * each thread. It is called in exit(3) in libc/stdlib/exit.c and - * before exit_thread() in libthr/thread/thr_exit.c. - */ -void -__cxa_thread_call_dtors(void) -{ - int i; - - for (i = 0; i < CXA_DTORS_ITERATIONS && !LIST_EMPTY(&dtors); i++) - cxa_thread_walk(walk_cb_call); - if (!LIST_EMPTY(&dtors)) { - fprintf(stderr, "Thread %p is exiting with more " - "thread-specific dtors created after %d iterations " - "of destructor calls\n", - _pthread_self(), i); - cxa_thread_walk(walk_cb_nocall); - } + return (__cxa_thread_atexit_hidden(dtor_func, obj, dso_symbol)); } Copied: stable/11/lib/libc/stdlib/cxa_thread_atexit_impl.c (from r311651, head/lib/libc/stdlib/cxa_thread_atexit_impl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/stdlib/cxa_thread_atexit_impl.c Sat Jan 21 11:47:30 2017 (r312589, copy of r311651, head/lib/libc/stdlib/cxa_thread_atexit_impl.c) @@ -0,0 +1,153 @@ +/*- + * Copyright (c) 2016 Mahdi Mokhtari + * Copyright (c) 2016, 2017 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * 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 +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" + +/* + * C++11 introduces the thread_local scope (like __thread with some + * additions). As a key-feature it should support non-trivial + * destructors, registered with __cxa_thread_atexit() to be executed + * at the thread termination. + * + * The implemention keeps a _Thread_local list of destructors per each + * thread, and calls __cxa_thread_call_dtors() on each thread's exit + * to do cleanup. For a thread calling exit(3), in particular, for + * the initial thread returning from main(), we call + * __cxa_thread_call_dtors() inside exit(). + * + * It could be possible that a dynamically loaded library, use + * thread_local variable but is dlclose()'d before thread exit. The + * destructor of this variable will then try to access the address, + * for calling it but it's unloaded, so it'll crash. We're using + * __elf_phdr_match_addr() to detect and prevent such cases and so + * prevent the crash. + */ + +#define CXA_DTORS_ITERATIONS 4 + +struct cxa_thread_dtor { + void *obj; + void (*func)(void *); + void *dso; + LIST_ENTRY(cxa_thread_dtor) entry; +}; +static _Thread_local LIST_HEAD(dtor_list, cxa_thread_dtor) dtors = + LIST_HEAD_INITIALIZER(dtors); + +int +__cxa_thread_atexit_impl(void (*dtor_func)(void *), void *obj, + void *dso_symbol) +{ + + return (__cxa_thread_atexit_hidden(dtor_func, obj, dso_symbol)); +} + +int +__cxa_thread_atexit_hidden(void (*dtor_func)(void *), void *obj, + void *dso_symbol) +{ + struct cxa_thread_dtor *new_dtor; + + new_dtor = malloc(sizeof(*new_dtor)); + if (new_dtor == NULL) { + errno = ENOMEM; /* forcibly override malloc(3) error */ + return (-1); + } + + new_dtor->obj = obj; + new_dtor->func = dtor_func; + new_dtor->dso = dso_symbol; + LIST_INSERT_HEAD(&dtors, new_dtor, entry); + return (0); +} + +static void +walk_cb_call(struct cxa_thread_dtor *dtor) +{ + struct dl_phdr_info phdr_info; + + if (_rtld_addr_phdr(dtor->dso, &phdr_info) && + __elf_phdr_match_addr(&phdr_info, dtor->func)) + dtor->func(dtor->obj); + else + fprintf(stderr, "__cxa_thread_call_dtors: dtr %p from " + "unloaded dso, skipping\n", (void *)(dtor->func)); +} + +static void +walk_cb_nocall(struct cxa_thread_dtor *dtor __unused) +{ +} + +static void +cxa_thread_walk(void (*cb)(struct cxa_thread_dtor *)) +{ + struct cxa_thread_dtor *dtor, *tdtor; + + LIST_FOREACH_SAFE(dtor, &dtors, entry, tdtor) { + LIST_REMOVE(dtor, entry); + cb(dtor); + free(dtor); + } +} + +/* + * This is the callback function we use to call destructors, once for + * each thread. It is called in exit(3) in libc/stdlib/exit.c and + * before exit_thread() in libthr/thread/thr_exit.c. + */ +void +__cxa_thread_call_dtors(void) +{ + int i; + + for (i = 0; i < CXA_DTORS_ITERATIONS && !LIST_EMPTY(&dtors); i++) + cxa_thread_walk(walk_cb_call); + + if (!LIST_EMPTY(&dtors)) { + fprintf(stderr, "Thread %p is exiting with more " + "thread-specific dtors created after %d iterations " + "of destructor calls\n", + _pthread_self(), i); + cxa_thread_walk(walk_cb_nocall); + } +} From owner-svn-src-all@freebsd.org Sat Jan 21 12:30:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EE86CB8EAC; Sat, 21 Jan 2017 12:30:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 093E21CEE; Sat, 21 Jan 2017 12:30:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0LCU8mk015755; Sat, 21 Jan 2017 12:30:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LCU7ad015750; Sat, 21 Jan 2017 12:30:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701211230.v0LCU7ad015750@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 21 Jan 2017 12:30:07 +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: r312590 - in stable/10/lib/libc: include stdlib 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, 21 Jan 2017 12:30:09 -0000 Author: kib Date: Sat Jan 21 12:30:07 2017 New Revision: 312590 URL: https://svnweb.freebsd.org/changeset/base/312590 Log: MFC r311651: Export __cxa_thread_atexit_impl as an alias for __cxa_thread_atexit. Added: stable/10/lib/libc/stdlib/cxa_thread_atexit_impl.c - copied unchanged from r311651, head/lib/libc/stdlib/cxa_thread_atexit_impl.c Modified: stable/10/lib/libc/include/libc_private.h stable/10/lib/libc/stdlib/Makefile.inc stable/10/lib/libc/stdlib/Symbol.map stable/10/lib/libc/stdlib/cxa_thread_atexit.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/include/libc_private.h ============================================================================== --- stable/10/lib/libc/include/libc_private.h Sat Jan 21 11:47:30 2017 (r312589) +++ stable/10/lib/libc/include/libc_private.h Sat Jan 21 12:30:07 2017 (r312590) @@ -268,6 +268,8 @@ void _malloc_thread_cleanup(void); * thread is exiting, so its thread-local dtors should be called. */ void __cxa_thread_call_dtors(void); +int __cxa_thread_atexit_hidden(void (*dtor_func)(void *), void *obj, + void *dso_symbol) __hidden; /* * These functions are used by the threading libraries in order to protect Modified: stable/10/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/10/lib/libc/stdlib/Makefile.inc Sat Jan 21 11:47:30 2017 (r312589) +++ stable/10/lib/libc/stdlib/Makefile.inc Sat Jan 21 12:30:07 2017 (r312590) @@ -5,7 +5,9 @@ .PATH: ${.CURDIR}/${LIBC_ARCH}/stdlib ${.CURDIR}/stdlib MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ - bsearch.c cxa_thread_atexit.c div.c exit.c getenv.c getopt.c getopt_long.c \ + bsearch.c \ + cxa_thread_atexit.c cxa_thread_atexit_impl.c \ + div.c exit.c getenv.c getopt.c getopt_long.c \ getsubopt.c hcreate.c heapsort.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \ merge.c ptsname.c qsort.c qsort_r.c quick_exit.c radixsort.c rand.c \ Modified: stable/10/lib/libc/stdlib/Symbol.map ============================================================================== --- stable/10/lib/libc/stdlib/Symbol.map Sat Jan 21 11:47:30 2017 (r312589) +++ stable/10/lib/libc/stdlib/Symbol.map Sat Jan 21 12:30:07 2017 (r312590) @@ -106,6 +106,7 @@ FBSD_1.3 { FBSD_1.5 { __cxa_thread_atexit; + __cxa_thread_atexit_impl; }; FBSDprivate_1.0 { Modified: stable/10/lib/libc/stdlib/cxa_thread_atexit.c ============================================================================== --- stable/10/lib/libc/stdlib/cxa_thread_atexit.c Sat Jan 21 11:47:30 2017 (r312589) +++ stable/10/lib/libc/stdlib/cxa_thread_atexit.c Sat Jan 21 12:30:07 2017 (r312590) @@ -1,7 +1,10 @@ /*- - * Copyright (c) 2016 Mahdi Mokhtari + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,114 +30,11 @@ #include __FBSDID("$FreeBSD$"); -#include -#include "namespace.h" -#include -#include -#include -#include -#include -#include -#include "un-namespace.h" #include "libc_private.h" -/* - * C++11 introduces the thread_local scope (like __thread with some - * additions). As a key-feature it should support non-trivial - * destructors, registered with __cxa_thread_atexit() to be executed - * at the thread termination. - * - * The implemention keeps a _Thread_local list of destructors per each - * thread, and calls __cxa_thread_call_dtors() on each thread's exit - * to do cleanup. For a thread calling exit(3), in particular, for - * the initial thread returning from main(), we call - * __cxa_thread_call_dtors() inside exit(). - * - * It could be possible that a dynamically loaded library, use - * thread_local variable but is dlclose()'d before thread exit. The - * destructor of this variable will then try to access the address, - * for calling it but it's unloaded, so it'll crash. We're using - * __elf_phdr_match_addr() to detect and prevent such cases and so - * prevent the crash. - */ - -#define CXA_DTORS_ITERATIONS 4 - -struct cxa_thread_dtor { - void *obj; - void (*func)(void *); - void *dso; - LIST_ENTRY(cxa_thread_dtor) entry; -}; -static _Thread_local LIST_HEAD(dtor_list, cxa_thread_dtor) dtors = - LIST_HEAD_INITIALIZER(dtors); - int __cxa_thread_atexit(void (*dtor_func)(void *), void *obj, void *dso_symbol) { - struct cxa_thread_dtor *new_dtor; - - new_dtor = malloc(sizeof(*new_dtor)); - if (new_dtor == NULL) { - errno = ENOMEM; /* forcibly override malloc(3) error */ - return (-1); - } - - new_dtor->obj = obj; - new_dtor->func = dtor_func; - new_dtor->dso = dso_symbol; - LIST_INSERT_HEAD(&dtors, new_dtor, entry); - return (0); -} - -static void -walk_cb_call(struct cxa_thread_dtor *dtor) -{ - struct dl_phdr_info phdr_info; - - if (_rtld_addr_phdr(dtor->dso, &phdr_info) && - __elf_phdr_match_addr(&phdr_info, dtor->func)) - dtor->func(dtor->obj); - else - fprintf(stderr, "__cxa_thread_call_dtors: dtr %p from " - "unloaded dso, skipping\n", (void *)(dtor->func)); -} - -static void -walk_cb_nocall(struct cxa_thread_dtor *dtor __unused) -{ -} - -static void -cxa_thread_walk(void (*cb)(struct cxa_thread_dtor *)) -{ - struct cxa_thread_dtor *dtor, *tdtor; - - LIST_FOREACH_SAFE(dtor, &dtors, entry, tdtor) { - LIST_REMOVE(dtor, entry); - cb(dtor); - free(dtor); - } -} - -/* - * This is the callback function we use to call destructors, once for - * each thread. It is called in exit(3) in libc/stdlib/exit.c and - * before exit_thread() in libthr/thread/thr_exit.c. - */ -void -__cxa_thread_call_dtors(void) -{ - int i; - - for (i = 0; i < CXA_DTORS_ITERATIONS && !LIST_EMPTY(&dtors); i++) - cxa_thread_walk(walk_cb_call); - if (!LIST_EMPTY(&dtors)) { - fprintf(stderr, "Thread %p is exiting with more " - "thread-specific dtors created after %d iterations " - "of destructor calls\n", - _pthread_self(), i); - cxa_thread_walk(walk_cb_nocall); - } + return (__cxa_thread_atexit_hidden(dtor_func, obj, dso_symbol)); } Copied: stable/10/lib/libc/stdlib/cxa_thread_atexit_impl.c (from r311651, head/lib/libc/stdlib/cxa_thread_atexit_impl.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/stdlib/cxa_thread_atexit_impl.c Sat Jan 21 12:30:07 2017 (r312590, copy of r311651, head/lib/libc/stdlib/cxa_thread_atexit_impl.c) @@ -0,0 +1,153 @@ +/*- + * Copyright (c) 2016 Mahdi Mokhtari + * Copyright (c) 2016, 2017 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * 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 +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" + +/* + * C++11 introduces the thread_local scope (like __thread with some + * additions). As a key-feature it should support non-trivial + * destructors, registered with __cxa_thread_atexit() to be executed + * at the thread termination. + * + * The implemention keeps a _Thread_local list of destructors per each + * thread, and calls __cxa_thread_call_dtors() on each thread's exit + * to do cleanup. For a thread calling exit(3), in particular, for + * the initial thread returning from main(), we call + * __cxa_thread_call_dtors() inside exit(). + * + * It could be possible that a dynamically loaded library, use + * thread_local variable but is dlclose()'d before thread exit. The + * destructor of this variable will then try to access the address, + * for calling it but it's unloaded, so it'll crash. We're using + * __elf_phdr_match_addr() to detect and prevent such cases and so + * prevent the crash. + */ + +#define CXA_DTORS_ITERATIONS 4 + +struct cxa_thread_dtor { + void *obj; + void (*func)(void *); + void *dso; + LIST_ENTRY(cxa_thread_dtor) entry; +}; +static _Thread_local LIST_HEAD(dtor_list, cxa_thread_dtor) dtors = + LIST_HEAD_INITIALIZER(dtors); + +int +__cxa_thread_atexit_impl(void (*dtor_func)(void *), void *obj, + void *dso_symbol) +{ + + return (__cxa_thread_atexit_hidden(dtor_func, obj, dso_symbol)); +} + +int +__cxa_thread_atexit_hidden(void (*dtor_func)(void *), void *obj, + void *dso_symbol) +{ + struct cxa_thread_dtor *new_dtor; + + new_dtor = malloc(sizeof(*new_dtor)); + if (new_dtor == NULL) { + errno = ENOMEM; /* forcibly override malloc(3) error */ + return (-1); + } + + new_dtor->obj = obj; + new_dtor->func = dtor_func; + new_dtor->dso = dso_symbol; + LIST_INSERT_HEAD(&dtors, new_dtor, entry); + return (0); +} + +static void +walk_cb_call(struct cxa_thread_dtor *dtor) +{ + struct dl_phdr_info phdr_info; + + if (_rtld_addr_phdr(dtor->dso, &phdr_info) && + __elf_phdr_match_addr(&phdr_info, dtor->func)) + dtor->func(dtor->obj); + else + fprintf(stderr, "__cxa_thread_call_dtors: dtr %p from " + "unloaded dso, skipping\n", (void *)(dtor->func)); +} + +static void +walk_cb_nocall(struct cxa_thread_dtor *dtor __unused) +{ +} + +static void +cxa_thread_walk(void (*cb)(struct cxa_thread_dtor *)) +{ + struct cxa_thread_dtor *dtor, *tdtor; + + LIST_FOREACH_SAFE(dtor, &dtors, entry, tdtor) { + LIST_REMOVE(dtor, entry); + cb(dtor); + free(dtor); + } +} + +/* + * This is the callback function we use to call destructors, once for + * each thread. It is called in exit(3) in libc/stdlib/exit.c and + * before exit_thread() in libthr/thread/thr_exit.c. + */ +void +__cxa_thread_call_dtors(void) +{ + int i; + + for (i = 0; i < CXA_DTORS_ITERATIONS && !LIST_EMPTY(&dtors); i++) + cxa_thread_walk(walk_cb_call); + + if (!LIST_EMPTY(&dtors)) { + fprintf(stderr, "Thread %p is exiting with more " + "thread-specific dtors created after %d iterations " + "of destructor calls\n", + _pthread_self(), i); + cxa_thread_walk(walk_cb_nocall); + } +} From owner-svn-src-all@freebsd.org Sat Jan 21 13:01:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87FD1CB9807; Sat, 21 Jan 2017 13:01:41 +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 2482E1CF3; Sat, 21 Jan 2017 13:01:41 +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 v0LD1emw030157; Sat, 21 Jan 2017 13:01:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LD1dho029814; Sat, 21 Jan 2017 13:01:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201701211301.v0LD1dho029814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 21 Jan 2017 13:01:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312591 - vendor/mdocml/dist 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: Sat, 21 Jan 2017 13:01:41 -0000 Author: bapt Date: Sat Jan 21 13:01:39 2017 New Revision: 312591 URL: https://svnweb.freebsd.org/changeset/base/312591 Log: Import mandoc cvs snapshot 20170121 (pre 1.14) Added: vendor/mdocml/dist/dba.c (contents, props changed) vendor/mdocml/dist/dba.h (contents, props changed) vendor/mdocml/dist/dba_array.c (contents, props changed) vendor/mdocml/dist/dba_array.h (contents, props changed) vendor/mdocml/dist/dba_read.c (contents, props changed) vendor/mdocml/dist/dba_write.c (contents, props changed) vendor/mdocml/dist/dba_write.h (contents, props changed) vendor/mdocml/dist/dbm.c (contents, props changed) vendor/mdocml/dist/dbm.h (contents, props changed) vendor/mdocml/dist/dbm_map.c (contents, props changed) vendor/mdocml/dist/dbm_map.h (contents, props changed) vendor/mdocml/dist/test-EFTYPE.c (contents, props changed) vendor/mdocml/dist/test-PATH_MAX.c (contents, props changed) vendor/mdocml/dist/test-be32toh.c (contents, props changed) vendor/mdocml/dist/test-nanosleep.c (contents, props changed) vendor/mdocml/dist/test-ntohl.c (contents, props changed) vendor/mdocml/dist/test-sandbox_init.c (contents, props changed) Deleted: vendor/mdocml/dist/compat_sqlite3_errstr.c vendor/mdocml/dist/config.log vendor/mdocml/dist/mansearch_const.c vendor/mdocml/dist/test-mmap.c vendor/mdocml/dist/test-sqlite3.c vendor/mdocml/dist/test-sqlite3_errstr.c Modified: vendor/mdocml/dist/INSTALL vendor/mdocml/dist/LICENSE vendor/mdocml/dist/Makefile vendor/mdocml/dist/Makefile.depend vendor/mdocml/dist/TODO vendor/mdocml/dist/cgi.c vendor/mdocml/dist/compat_fts.c vendor/mdocml/dist/compat_fts.h vendor/mdocml/dist/configure vendor/mdocml/dist/configure.local.example vendor/mdocml/dist/demandoc.c vendor/mdocml/dist/eqn_html.c vendor/mdocml/dist/html.c vendor/mdocml/dist/html.h vendor/mdocml/dist/lib.in vendor/mdocml/dist/libmandoc.h vendor/mdocml/dist/main.c vendor/mdocml/dist/main.h vendor/mdocml/dist/makewhatis.8 vendor/mdocml/dist/man.1 vendor/mdocml/dist/man.c vendor/mdocml/dist/man.conf.5 vendor/mdocml/dist/man_hash.c vendor/mdocml/dist/man_html.c vendor/mdocml/dist/man_macro.c vendor/mdocml/dist/man_term.c vendor/mdocml/dist/mandoc.1 vendor/mdocml/dist/mandoc.3 vendor/mdocml/dist/mandoc.css vendor/mdocml/dist/mandoc.db.5 vendor/mdocml/dist/mandoc.h vendor/mdocml/dist/mandoc_aux.h vendor/mdocml/dist/mandoc_html.3 vendor/mdocml/dist/mandocdb.c vendor/mdocml/dist/manpath.c vendor/mdocml/dist/mansearch.c vendor/mdocml/dist/mansearch.h vendor/mdocml/dist/mdoc.7 vendor/mdocml/dist/mdoc.c vendor/mdocml/dist/mdoc_argv.c vendor/mdocml/dist/mdoc_hash.c vendor/mdocml/dist/mdoc_html.c vendor/mdocml/dist/mdoc_macro.c vendor/mdocml/dist/mdoc_man.c vendor/mdocml/dist/mdoc_state.c vendor/mdocml/dist/mdoc_term.c vendor/mdocml/dist/mdoc_validate.c vendor/mdocml/dist/read.c vendor/mdocml/dist/roff.c vendor/mdocml/dist/roff.h vendor/mdocml/dist/tag.c vendor/mdocml/dist/tbl_html.c vendor/mdocml/dist/term.c vendor/mdocml/dist/term_ascii.c vendor/mdocml/dist/term_ps.c vendor/mdocml/dist/test-fts.c vendor/mdocml/dist/test-ohash.c vendor/mdocml/dist/test-vasprintf.c vendor/mdocml/dist/test-wchar.c vendor/mdocml/dist/tree.c Modified: vendor/mdocml/dist/INSTALL ============================================================================== --- vendor/mdocml/dist/INSTALL Sat Jan 21 12:30:07 2017 (r312590) +++ vendor/mdocml/dist/INSTALL Sat Jan 21 13:01:39 2017 (r312591) @@ -1,4 +1,4 @@ -$Id: INSTALL,v 1.15 2016/07/14 11:09:06 schwarze Exp $ +$Id: INSTALL,v 1.17 2016/07/19 22:40:33 schwarze Exp $ About mdocml, the portable mandoc distribution ---------------------------------------------- @@ -35,7 +35,11 @@ To install mandoc manually, the followin command "echo BUILD_CGI=1 > configure.local". Then run "cp cgi.h.examples cgi.h" and edit cgi.h as desired. -2. Run "./configure". +2. Define MANPATH_DEFAULT in configure.local +if /usr/share/man:/usr/X11R6/man:/usr/local/man is not appropriate +for your operating system. + +3. Run "./configure". This script attempts autoconfiguration of mandoc for your system. Read both its standard output and the file "Makefile.local" it generates. If anything looks wrong or different from what you @@ -45,28 +49,21 @@ result seems right to you. On Solaris 10 and earlier, you may have to run "ksh ./configure" because the native /bin/sh lacks some POSIX features. -3. Run "make". +4. Run "make". Any POSIX-compatible make, in particular both BSD make and GNU make, should work. If the build fails, look at "configure.local.example" and go back to step 2. -4. Run "make -n install" and check whether everything will be +5. Run "make -n install" and check whether everything will be installed to the intended places. Otherwise, put some *DIR or *NM* -variables into "configure.local" and go back to step 2. +variables into "configure.local" and go back to step 3. -5. Run "sudo make install". If you intend to build a binary +6. Run "sudo make install". If you intend to build a binary package using some kind of fake root mechanism, you may need a command like "make DESTDIR=... install". Read the *-install targets in the "Makefile" to understand how DESTDIR is used. -6. If you want to use the integrated man(1) and your system uses -manpath(1), make sure it is configured correctly, in particular, -it returns all directory trees where manual pages are installed. -Otherwise, if your system uses man.conf(5), make sure it contains -a "manpath" line for each directory tree, and the order of these -lines meets your wishes. - -7. If you compiled with database support, run the command "sudo +7. Run the command "sudo makewhatis" to build mandoc.db(5) databases in all the directory trees configured in step 6. Whenever installing new manual pages, re-run makewhatis(8) to update the databases, or apropos(1) will @@ -84,20 +81,9 @@ manual page source. Understanding mandoc dependencies --------------------------------- -The mandoc(1), man(1), and demandoc(1) utilities only depend -on the zlib library for decompressing gzipped manual pages, -but makewhatis(8) and apropos(1) depend on the following -additional software: - -1. The SQLite database system, see . -The recommended version of SQLite is 3.8.4.3 or newer. The mandoc -toolset is known to work with version 3.7.5 or newer. Versions -older than 3.8.3 may not achieve full performance due to the -missing SQLITE_DETERMINISTIC optimization flag. Versions older -than 3.8.0 may not show full error information if opening a database -fails due to the missing sqlite3_errstr() API. Both are very minor -problems, apropos(1) is fully usable with SQLite 3.7.5. Versions -older than 3.7.5 may or may not work, they have not been tested. +The following libraries are required: + +1. zlib for decompressing gzipped manual pages. 2. The fts(3) directory traversion functions. If your system does not have them, the bundled compatibility version Modified: vendor/mdocml/dist/LICENSE ============================================================================== --- vendor/mdocml/dist/LICENSE Sat Jan 21 12:30:07 2017 (r312590) +++ vendor/mdocml/dist/LICENSE Sat Jan 21 13:01:39 2017 (r312591) @@ -1,4 +1,4 @@ -$Id: LICENSE,v 1.12 2016/07/07 23:46:36 schwarze Exp $ +$Id: LICENSE,v 1.13 2016/10/18 14:15:33 schwarze Exp $ With the exceptions noted below, all code and documentation contained in the mdocml toolkit is protected by the Copyright @@ -8,7 +8,8 @@ Copyright (c) 2008-2012, 2014 Kristaps D Copyright (c) 2010-2016 Ingo Schwarze Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger Copyright (c) 2013 Franco Fichtner -Copyright (c) 2014 Baptiste Daroussin +Copyright (c) 2014 Baptiste Daroussin +Copyright (c) 2016 Ed Maste Copyright (c) 1999, 2004 Marc Espie Copyright (c) 1998, 2004, 2010 Todd C. Miller Copyright (c) 2008 Otto Moerbeek @@ -41,7 +42,7 @@ other people's Copyright and are distrib and 3-clause BSD licenses; see these individual files for details. soelim.c, soelim.1: -Copyright (c) 2014 Baptiste Daroussin +Copyright (c) 2014 Baptiste Daroussin compat_err.c, compat_fts.c, compat_fts.h, compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c, Modified: vendor/mdocml/dist/Makefile ============================================================================== --- vendor/mdocml/dist/Makefile Sat Jan 21 12:30:07 2017 (r312590) +++ vendor/mdocml/dist/Makefile Sat Jan 21 13:01:39 2017 (r312591) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.488 2016/07/12 05:18:38 kristaps Exp $ +# $Id: Makefile,v 1.493 2016/11/19 15:24:51 schwarze Exp $ # # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # Copyright (c) 2011, 2013-2016 Ingo Schwarze @@ -15,27 +15,29 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -VERSION = 1.13.4 +VERSION = 1.14.0 # === LIST OF FILES ==================================================== -TESTSRCS = test-dirent-namlen.c \ +TESTSRCS = test-be32toh.c \ + test-dirent-namlen.c \ + test-EFTYPE.c \ test-err.c \ test-fts.c \ test-getline.c \ test-getsubopt.c \ test-isblank.c \ test-mkdtemp.c \ - test-mmap.c \ + test-nanosleep.c \ + test-ntohl.c \ test-ohash.c \ + test-PATH_MAX.c \ test-pledge.c \ test-progname.c \ test-reallocarray.c \ test-rewb-bsd.c \ test-rewb-sysv.c \ test-sandbox_init.c \ - test-sqlite3.c \ - test-sqlite3_errstr.c \ test-strcasestr.c \ test-stringlist.c \ test-strlcat.c \ @@ -58,7 +60,6 @@ SRCS = att.c \ compat_ohash.c \ compat_progname.c \ compat_reallocarray.c \ - compat_sqlite3_errstr.c \ compat_strcasestr.c \ compat_stringlist.c \ compat_strlcat.c \ @@ -66,6 +67,12 @@ SRCS = att.c \ compat_strsep.c \ compat_strtonum.c \ compat_vasprintf.c \ + dba.c \ + dba_array.c \ + dba_read.c \ + dba_write.c \ + dbm.c \ + dbm_map.c \ demandoc.c \ eqn.c \ eqn_html.c \ @@ -86,7 +93,6 @@ SRCS = att.c \ manpage.c \ manpath.c \ mansearch.c \ - mansearch_const.c \ mdoc.c \ mdoc_argv.c \ mdoc_hash.c \ @@ -128,6 +134,11 @@ DISTFILES = INSTALL \ compat_stringlist.h \ configure \ configure.local.example \ + dba.h \ + dba_array.h \ + dba_write.h \ + dbm.h \ + dbm_map.h \ demandoc.1 \ eqn.7 \ gmdiff \ @@ -220,7 +231,6 @@ COMPAT_OBJS = compat_err.o \ compat_ohash.o \ compat_progname.o \ compat_reallocarray.o \ - compat_sqlite3_errstr.o \ compat_strcasestr.o \ compat_strlcat.o \ compat_strlcpy.o \ @@ -244,28 +254,35 @@ MANDOC_TERM_OBJS = eqn_term.o \ term_ps.o \ tbl_term.o -BASE_OBJS = $(MANDOC_HTML_OBJS) \ +DBM_OBJS = dbm.o \ + dbm_map.o \ + mansearch.o + +DBA_OBJS = dba.o \ + dba_array.o \ + dba_read.o \ + dba_write.o \ + mandocdb.o + +MAIN_OBJS = $(MANDOC_HTML_OBJS) \ $(MANDOC_MAN_OBJS) \ $(MANDOC_TERM_OBJS) \ + $(DBM_OBJS) \ + $(DBA_OBJS) \ main.o \ manpath.o \ out.o \ tag.o \ tree.o -MAIN_OBJS = $(BASE_OBJS) - -DB_OBJS = mandocdb.o \ - mansearch.o \ - mansearch_const.o - CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(DBM_OBJS) \ cgi.o \ - mansearch.o \ - mansearch_const.o \ out.o -MANPAGE_OBJS = manpage.o mansearch.o mansearch_const.o manpath.o +MANPAGE_OBJS = $(DBM_OBJS) \ + manpage.o \ + manpath.o DEMANDOC_OBJS = demandoc.o @@ -329,7 +346,7 @@ www: $(WWW_OBJS) $(WWW_MANS) $(WWW_MANS): mandoc -.PHONY: base-install cgi-install db-install install www-install +.PHONY: base-install cgi-install install www-install .PHONY: clean distclean depend include Makefile.depend @@ -341,7 +358,7 @@ distclean: clean clean: rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS) - rm -f mandoc $(BASE_OBJS) $(DB_OBJS) + rm -f mandoc $(MAIN_OBJS) rm -f man.cgi $(CGI_OBJS) rm -f manpage $(MANPAGE_OBJS) rm -f demandoc $(DEMANDOC_OBJS) @@ -351,50 +368,45 @@ clean: base-install: base-build mkdir -p $(DESTDIR)$(BINDIR) - mkdir -p $(DESTDIR)$(LIBDIR) - mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(SBINDIR) mkdir -p $(DESTDIR)$(MANDIR)/man1 - mkdir -p $(DESTDIR)$(MANDIR)/man3 mkdir -p $(DESTDIR)$(MANDIR)/man5 mkdir -p $(DESTDIR)$(MANDIR)/man7 + mkdir -p $(DESTDIR)$(MANDIR)/man8 $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR) $(INSTALL_PROGRAM) soelim $(DESTDIR)$(BINDIR)/$(BINM_SOELIM) ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN) - $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) - $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h roff.h \ - $(DESTDIR)$(INCLUDEDIR) + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_APROPOS) + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_WHATIS) + ln -f $(DESTDIR)$(BINDIR)/mandoc \ + $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS) $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 $(INSTALL_MAN) soelim.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1 $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 - $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ - mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 + ln -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 \ + $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1 $(INSTALL_MAN) man.conf.5 $(DESTDIR)$(MANDIR)/man5/${MANM_MANCONF}.5 + $(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5 $(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MAN}.7 $(INSTALL_MAN) mdoc.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MDOC}.7 $(INSTALL_MAN) roff.7 $(DESTDIR)$(MANDIR)/man7/${MANM_ROFF}.7 $(INSTALL_MAN) eqn.7 $(DESTDIR)$(MANDIR)/man7/${MANM_EQN}.7 $(INSTALL_MAN) tbl.7 $(DESTDIR)$(MANDIR)/man7/${MANM_TBL}.7 $(INSTALL_MAN) mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 - -db-install: base-build - mkdir -p $(DESTDIR)$(BINDIR) - mkdir -p $(DESTDIR)$(SBINDIR) - mkdir -p $(DESTDIR)$(MANDIR)/man1 - mkdir -p $(DESTDIR)$(MANDIR)/man3 - mkdir -p $(DESTDIR)$(MANDIR)/man5 - mkdir -p $(DESTDIR)$(MANDIR)/man8 - ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_APROPOS) - ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_WHATIS) - ln -f $(DESTDIR)$(BINDIR)/mandoc \ - $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS) - $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 - ln -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 \ - $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1 - $(INSTALL_MAN) mansearch.3 $(DESTDIR)$(MANDIR)/man3 - $(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5 $(INSTALL_MAN) makewhatis.8 \ $(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8 +lib-install: base-build + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h roff.h \ + $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ + mansearch.3 mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 + cgi-install: cgi-build mkdir -p $(DESTDIR)$(CGIBINDIR) mkdir -p $(DESTDIR)$(HTDOCDIR) Modified: vendor/mdocml/dist/Makefile.depend ============================================================================== --- vendor/mdocml/dist/Makefile.depend Sat Jan 21 12:30:07 2017 (r312590) +++ vendor/mdocml/dist/Makefile.depend Sat Jan 21 13:01:39 2017 (r312591) @@ -10,7 +10,6 @@ compat_mkdtemp.o: compat_mkdtemp.c confi compat_ohash.o: compat_ohash.c config.h compat_ohash.h compat_progname.o: compat_progname.c config.h compat_reallocarray.o: compat_reallocarray.c config.h -compat_sqlite3_errstr.o: compat_sqlite3_errstr.c config.h compat_strcasestr.o: compat_strcasestr.c config.h compat_stringlist.o: compat_stringlist.c config.h compat_stringlist.h compat_strlcat.o: compat_strlcat.c config.h @@ -18,6 +17,12 @@ compat_strlcpy.o: compat_strlcpy.c confi compat_strsep.o: compat_strsep.c config.h compat_strtonum.o: compat_strtonum.c config.h compat_vasprintf.o: compat_vasprintf.c config.h +dba.o: dba.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mansearch.h dba_write.h dba_array.h dba.h +dba_array.o: dba_array.c mandoc_aux.h dba_write.h dba_array.h +dba_read.o: dba_read.c mandoc_aux.h mansearch.h dba_array.h dba.h dbm.h +dba_write.o: dba_write.c config.h dba_write.h +dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h +dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h demandoc.o: demandoc.c config.h roff.h man.h mdoc.h mandoc.h eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h @@ -26,7 +31,7 @@ html.o: html.c config.h mandoc.h mandoc_ lib.o: lib.c config.h roff.h mdoc.h libmdoc.h lib.in main.o: main.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h tag.h main.h manconf.h mansearch.h man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h -man_hash.o: man_hash.c config.h roff.h man.h libman.h +man_hash.o: man_hash.c config.h mandoc.h roff.h man.h libmandoc.h libman.h man_html.o: man_html.c config.h mandoc_aux.h roff.h man.h out.h html.h main.h man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h main.h @@ -34,14 +39,13 @@ man_validate.o: man_validate.c config.h mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h -mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h +mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h dba_array.h dba.h manpage.o: manpage.c config.h manconf.h mansearch.h manpath.o: manpath.c config.h mandoc_aux.h manconf.h -mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h -mansearch_const.o: mansearch_const.c config.h mansearch.h +mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h -mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h -mdoc_hash.o: mdoc_hash.c config.h roff.h mdoc.h libmdoc.h +mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_hash.o: mdoc_hash.c config.h mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h mdoc_html.o: mdoc_html.c config.h mandoc_aux.h roff.h mdoc.h out.h html.h main.h mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h Modified: vendor/mdocml/dist/TODO ============================================================================== --- vendor/mdocml/dist/TODO Sat Jan 21 12:30:07 2017 (r312590) +++ vendor/mdocml/dist/TODO Sat Jan 21 13:01:39 2017 (r312591) @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.218 2016/06/05 21:06:04 schwarze Exp $ +* $Id: TODO,v 1.223 2017/01/17 15:32:43 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: @@ -33,15 +33,6 @@ Obviously, as the issues have not been s are mere guesses, and some may be wrong. ************************************************************************ -* crashes -************************************************************************ - -- The abort() in bufcat(), html.c, can be triggered via buffmt_includes() - by running -Thtml -Oincludes on a file containing a long .In argument. - Fixing this will probably require reworking the whole bufcat() concept. - loc ** exist * algo * size ** imp ** - -************************************************************************ * missing features ************************************************************************ @@ -213,6 +204,13 @@ are mere guesses, and some may be wrong. synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 loc ** exist ** algo ** size ** imp *** +- break long text into lines inside cells + net/lftp(1) from jirib via bentley@ Sep 13, 2016 + +- layout l1 for a column of max text width 3 reduces the following + inter-column spacing for groff, but not for mandoc + net/lftp(1) from jirib via bentley@ Sep 13, 2016 + - the "w" layout option is ignored synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 loc * exist * algo * size * imp ** @@ -529,16 +527,6 @@ are mere guesses, and some may be wrong. loc ** exist ** algo ** size * imp ** ************************************************************************ -* portability -************************************************************************ - -- systems having UTF-8 but not en_US.UTF-8 - call locale(1) from ./configure, select a UTF-8-locale, - and use that for test-wchar.c and term_ascii.c - to Markus Waldeck Sat, 18 Jul 2015 01:55:37 +0200 - loc * exist * algo * size * imp * - -************************************************************************ * warning issues ************************************************************************ @@ -612,7 +600,6 @@ are mere guesses, and some may be wrong. ************************************************************************ - Why are we using MAP_SHARED, not MAP_PRIVATE for mmap(2)? - How does SQLITE_CONFIG_PAGECACHE actually work? Document it! from kristaps@ Sat, 09 Aug 2014 13:51:36 +0200 Several areas can be cleaned up to make mandoc even faster. These are @@ -631,6 +618,13 @@ Several areas can be cleaned up to make * structural issues ************************************************************************ +- POSIX says in the documentation of sysconf(3) that PATH_MAX + is allowed to be so large that it is a bad idea to use it + for sizing static buffers. So use dynamic buffers throughout. + See the file test-PATH_MAX.c for details. + Found by Aaron M. Ucko in the GNU Hurd via Bdale Garbee, + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829624 + - We use the input line number at several places to distinguish same-line from different-line input. That plainly doesn't work with user-defined macros, leading to random breakage. @@ -646,11 +640,6 @@ Several areas can be cleaned up to make - struct mparse refactoring Steffen Nurpmeso Thu, 04 Sep 2014 12:50:00 +0200 -- Consider creating some views that will make the database more - readable from the sqlite3 shell. Consider using them to - abstract from the database structure, too. - suggested by espie@ Sat, 19 Apr 2014 14:52:57 +0200 - ************************************************************************ * CGI issues ************************************************************************ Modified: vendor/mdocml/dist/cgi.c ============================================================================== --- vendor/mdocml/dist/cgi.c Sat Jan 21 12:30:07 2017 (r312590) +++ vendor/mdocml/dist/cgi.c Sat Jan 21 13:01:39 2017 (r312591) @@ -1,7 +1,7 @@ -/* $Id: cgi.c,v 1.135 2016/07/11 22:48:37 schwarze Exp $ */ +/* $Id: cgi.c,v 1.144 2017/01/21 01:20:31 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons - * Copyright (c) 2014, 2015, 2016 Ingo Schwarze + * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -113,17 +113,18 @@ static const char *const sec_names[] = { static const int sec_MAX = sizeof(sec_names) / sizeof(char *); static const char *const arch_names[] = { - "amd64", "alpha", "armish", "armv7", - "hppa", "hppa64", "i386", "landisk", + "amd64", "alpha", "armv7", + "hppa", "i386", "landisk", "loongson", "luna88k", "macppc", "mips64", - "octeon", "sgi", "socppc", "sparc", - "sparc64", "zaurus", - "amiga", "arc", "arm32", "atari", - "aviion", "beagle", "cats", "hp300", + "octeon", "sgi", "socppc", "sparc64", + "amiga", "arc", "armish", "arm32", + "atari", "aviion", "beagle", "cats", + "hppa64", "hp300", "ia64", "mac68k", "mvme68k", "mvme88k", "mvmeppc", "palm", "pc532", "pegasos", - "pmax", "powerpc", "solbourne", "sun3", - "vax", "wgrisc", "x68k" + "pmax", "powerpc", "solbourne", "sparc", + "sun3", "vax", "wgrisc", "x68k", + "zaurus" }; static const int arch_MAX = sizeof(arch_names) / sizeof(char *); @@ -137,7 +138,7 @@ html_putchar(char c) switch (c) { case ('"'): - printf(""e;"); + printf("""); break; case ('&'): printf("&"); @@ -337,6 +338,7 @@ resp_copy(const char *filename) fflush(stdout); while ((sz = read(fd, buf, sizeof(buf))) > 0) write(STDOUT_FILENO, buf, sz); + close(fd); } } @@ -349,13 +351,12 @@ resp_begin_html(int code, const char *ms printf("\n" "\n" "\n" - "\n" - "\n" + " \n" - "%s\n" + " %s\n" "\n" - "\n" - "\n", + "\n", CSS_DIR, CUSTOMIZE_TITLE); resp_copy(MAN_DIR "/header.html"); @@ -376,16 +377,14 @@ resp_searchform(const struct req *req, e { int i; - puts(""); - printf("

"); - puts(""); + puts(" \n" + ""); } static int @@ -496,9 +494,9 @@ pg_index(const struct req *req) resp_searchform(req, FOCUS_QUERY); printf("

\n" "This web interface is documented in the\n" - "man.cgi(8)\n" + "man.cgi(8)\n" "manual, and the\n" - "apropos(1)\n" + "apropos(1)\n" "manual explains the query syntax.\n" "

\n", scriptname, *scriptname == '\0' ? "" : "/", @@ -578,27 +576,21 @@ pg_searchres(const struct req *req, stru req->q.equal || sz == 1 ? FOCUS_NONE : FOCUS_QUERY); if (sz > 1) { - puts("
"); - puts(""); - + puts("
"); for (i = 0; i < sz; i++) { - printf("\n" - "\n" - "\n" + " \n" - ""); + puts("\n" + " "); } - - puts("
\n" - "\n" + " " + "", scriptname, *scriptname == '\0' ? "" : "/", req->q.manpath, r[i].file); - printf("\">"); html_print(r[i].names); - printf("\n" - ""); + printf(""); html_print(r[i].output); - puts("
\n" - "
"); + puts(""); } /* @@ -800,7 +792,8 @@ resp_format(const struct req *req, const } mchars_alloc(); - mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_BADARG, NULL, req->q.manpath); + mp = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1, + MANDOCLEVEL_BADARG, NULL, req->q.manpath); mparse_readfd(mp, fd, file); close(fd); Modified: vendor/mdocml/dist/compat_fts.c ============================================================================== --- vendor/mdocml/dist/compat_fts.c Sat Jan 21 12:30:07 2017 (r312590) +++ vendor/mdocml/dist/compat_fts.c Sat Jan 21 13:01:39 2017 (r312591) @@ -6,8 +6,8 @@ int dummy; #else -/* $Id: compat_fts.c,v 1.9 2015/03/18 19:29:48 schwarze Exp $ */ -/* $OpenBSD: fts.c,v 1.50 2015/01/16 16:48:51 deraadt Exp $ */ +/* $Id: compat_fts.c,v 1.12 2016/10/18 23:58:12 schwarze Exp $ */ +/* $OpenBSD: fts.c,v 1.56 2016/09/21 04:38:56 guenther Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -59,6 +59,7 @@ static void fts_load(FTS *, FTSENT *); static size_t fts_maxarglen(char * const *); static void fts_padjust(FTS *, FTSENT *); static int fts_palloc(FTS *, size_t); +static FTSENT *fts_sort(FTS *, FTSENT *, int); static unsigned short fts_stat(FTS *, FTSENT *); #define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) @@ -68,19 +69,22 @@ static unsigned short fts_stat(FTS *, F #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif #define CLR(opt) (sp->fts_options &= ~(opt)) #define ISSET(opt) (sp->fts_options & (opt)) #define SET(opt) (sp->fts_options |= (opt)) FTS * -fts_open(char * const *argv, int options, void *dummy) +fts_open(char * const *argv, int options, + int (*compar)(const FTSENT **, const FTSENT **)) { FTS *sp; FTSENT *p, *root; int nitems; FTSENT *parent, *tmp; - size_t len; /* Options check. */ if (options & ~FTS_OPTIONMASK) { @@ -88,9 +92,16 @@ fts_open(char * const *argv, int options return (NULL); } + /* At least one path must be specified. */ + if (*argv == NULL) { + errno = EINVAL; + return (NULL); + } + /* Allocate/initialize the stream */ if ((sp = calloc(1, sizeof(FTS))) == NULL) return (NULL); + sp->fts_compar = compar; sp->fts_options = options; /* @@ -107,13 +118,7 @@ fts_open(char * const *argv, int options /* Allocate/initialize root(s). */ for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) { - /* Don't allow zero-length paths. */ - if ((len = strlen(*argv)) == 0) { - errno = ENOENT; - goto mem3; - } - - if ((p = fts_alloc(sp, *argv, len)) == NULL) + if ((p = fts_alloc(sp, *argv, strlen(*argv))) == NULL) goto mem3; p->fts_level = FTS_ROOTLEVEL; p->fts_parent = parent; @@ -124,14 +129,25 @@ fts_open(char * const *argv, int options if (p->fts_info == FTS_DOT) p->fts_info = FTS_D; - p->fts_link = NULL; - if (root == NULL) - tmp = root = p; - else { - tmp->fts_link = p; - tmp = p; + /* + * If comparison routine supplied, traverse in sorted + * order; otherwise traverse in the order specified. + */ + if (compar) { + p->fts_link = root; + root = p; + } else { + p->fts_link = NULL; + if (root == NULL) + tmp = root = p; + else { + tmp->fts_link = p; + tmp = p; + } } } + if (compar && nitems > 1) + root = fts_sort(sp, root, nitems); /* * Allocate a dummy pointer and make fts_read think that we've just @@ -201,6 +217,7 @@ fts_close(FTS *sp) /* Free up child linked list, sort array, path buffer, stream ptr.*/ if (sp->fts_child) fts_lfree(sp->fts_child); + free(sp->fts_array); free(sp->fts_path); free(sp); @@ -317,7 +334,6 @@ name: t = sp->fts_path + NAPPEND(p->fts * semantics to fts using fts_set. An error return is allowed for similar * reasons. */ -/* ARGSUSED */ int fts_set(FTS *sp, FTSENT *p, int instr) { @@ -416,8 +432,7 @@ fts_build(FTS *sp) * structures already allocated. */ mem1: saved_errno = errno; - if (p) - free(p); + free(p); fts_lfree(head); (void)closedir(dirp); cur->fts_info = FTS_ERR; @@ -490,6 +505,10 @@ mem1: saved_errno = errno; cur->fts_info = FTS_DP; return (NULL); } + + /* Sort the entries. */ + if (sp->fts_compar && nitems > 1) + head = fts_sort(sp, head, nitems); return (head); } @@ -547,6 +566,40 @@ fts_stat(FTS *sp, FTSENT *p) } static FTSENT * +fts_sort(FTS *sp, FTSENT *head, int nitems) +{ + FTSENT **ap, *p; + + /* + * Construct an array of pointers to the structures and call qsort(3). + * Reassemble the array in the order returned by qsort. If unable to + * sort for memory reasons, return the directory entries in their + * current order. Allocate enough space for the current needs plus + * 40 so don't realloc one entry at a time. + */ + if (nitems > sp->fts_nitems) { + struct _ftsent **a; + + sp->fts_nitems = nitems + 40; + if ((a = reallocarray(sp->fts_array, + sp->fts_nitems, sizeof(FTSENT *))) == NULL) { + free(sp->fts_array); + sp->fts_array = NULL; + sp->fts_nitems = 0; + return (head); + } + sp->fts_array = a; + } + for (ap = sp->fts_array, p = head; p; p = p->fts_link) + *ap++ = p; + qsort(sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar); + for (head = *(ap = sp->fts_array); --nitems; ++ap) + ap[0]->fts_link = ap[1]; + ap[0]->fts_link = NULL; + return (head); +} + +static FTSENT * fts_alloc(FTS *sp, const char *name, size_t namelen) { FTSENT *p; @@ -597,8 +650,7 @@ fts_palloc(FTS *sp, size_t more) */ more += 256; if (sp->fts_pathlen + more < sp->fts_pathlen) { - if (sp->fts_path) - free(sp->fts_path); + free(sp->fts_path); sp->fts_path = NULL; errno = ENAMETOOLONG; return (1); @@ -606,8 +658,7 @@ fts_palloc(FTS *sp, size_t more) sp->fts_pathlen += more; p = realloc(sp->fts_path, sp->fts_pathlen); if (p == NULL) { - if (sp->fts_path) - free(sp->fts_path); + free(sp->fts_path); sp->fts_path = NULL; return (1); } Modified: vendor/mdocml/dist/compat_fts.h ============================================================================== --- vendor/mdocml/dist/compat_fts.h Sat Jan 21 12:30:07 2017 (r312590) +++ vendor/mdocml/dist/compat_fts.h Sat Jan 21 13:01:39 2017 (r312591) @@ -38,9 +38,12 @@ typedef struct { struct _ftsent *fts_cur; /* current node */ struct _ftsent *fts_child; /* linked list of children */ + struct _ftsent **fts_array; /* sort array */ dev_t fts_dev; /* starting device # */ char *fts_path; /* path for this descent */ size_t fts_pathlen; /* sizeof(path) */ + int fts_nitems; /* elements in the sort array */ + int (*fts_compar)(); /* compare function */ #define FTS_NOCHDIR 0x0004 /* don't change directories */ #define FTS_PHYSICAL 0x0010 /* physical walk */ @@ -94,7 +97,8 @@ typedef struct _ftsent { int fts_close(FTS *); -FTS *fts_open(char * const *, int, void *); +FTS *fts_open(char * const *, int, + int (*)(const FTSENT **, const FTSENT **)); FTSENT *fts_read(FTS *); int fts_set(FTS *, FTSENT *, int); Modified: vendor/mdocml/dist/configure ============================================================================== --- vendor/mdocml/dist/configure Sat Jan 21 12:30:07 2017 (r312590) +++ vendor/mdocml/dist/configure Sat Jan 21 13:01:39 2017 (r312591) @@ -1,5 +1,7 @@ #!/bin/sh # +# $Id: configure,v 1.55 2017/01/12 15:45:05 schwarze Exp $ +# # Copyright (c) 2014, 2015, 2016 Ingo Schwarze # # Permission to use, copy, modify, and distribute this software for any @@ -33,26 +35,34 @@ echo "config.log: writing..." MANPATH_DEFAULT="/usr/share/man:/usr/X11R6/man:/usr/local/man" OSNAME= +UTF8_LOCALE= -CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | make -f -` -CFLAGS="-g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings" +CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | env -i make -sf -` +CFLAGS="-g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings" +CFLAGS="${CFLAGS} -Wno-unused-parameter" LDADD= LDFLAGS= +LD_NANOSLEEP= LD_OHASH= -LD_SQLITE3= STATIC="-static" -BUILD_DB=1 BUILD_CGI=0 +INSTALL_LIBMANDOC=0 HAVE_DIRENT_NAMLEN= +HAVE_EFTYPE= +HAVE_ENDIAN= HAVE_ERR= HAVE_FTS= +HAVE_FTS_COMPARE_CONST= HAVE_GETLINE= HAVE_GETSUBOPT= HAVE_ISBLANK= HAVE_MKDTEMP= -HAVE_MMAP= +HAVE_NANOSLEEP= +HAVE_NTOHL= +HAVE_OHASH= +HAVE_PATH_MAX= HAVE_PLEDGE= HAVE_PROGNAME= HAVE_REALLOCARRAY= @@ -66,14 +76,10 @@ HAVE_STRLCPY= HAVE_STRPTIME= HAVE_STRSEP= HAVE_STRTONUM= +HAVE_SYS_ENDIAN= HAVE_VASPRINTF= HAVE_WCHAR= -HAVE_SQLITE3= -HAVE_SQLITE3_ERRSTR= -HAVE_OHASH= -HAVE_MANPATH= *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 21 13:02:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 596EDCB9880; Sat, 21 Jan 2017 13:02:55 +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 F225B1EE9; Sat, 21 Jan 2017 13:02:54 +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 v0LD2s3Q032018; Sat, 21 Jan 2017 13:02:54 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LD2r2E032012; Sat, 21 Jan 2017 13:02:53 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201701211302.v0LD2r2E032012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 21 Jan 2017 13:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r312592 - vendor/mdocml/20170121 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: Sat, 21 Jan 2017 13:02:55 -0000 Author: bapt Date: Sat Jan 21 13:02:53 2017 New Revision: 312592 URL: https://svnweb.freebsd.org/changeset/base/312592 Log: Tag import of mandoc cvs snapshot 20170121 Added: vendor/mdocml/20170121/ - copied from r312590, vendor/mdocml/dist/ vendor/mdocml/20170121/dba.c - copied unchanged from r312591, vendor/mdocml/dist/dba.c vendor/mdocml/20170121/dba.h - copied unchanged from r312591, vendor/mdocml/dist/dba.h vendor/mdocml/20170121/dba_array.c - copied unchanged from r312591, vendor/mdocml/dist/dba_array.c vendor/mdocml/20170121/dba_array.h - copied unchanged from r312591, vendor/mdocml/dist/dba_array.h vendor/mdocml/20170121/dba_read.c - copied unchanged from r312591, vendor/mdocml/dist/dba_read.c vendor/mdocml/20170121/dba_write.c - copied unchanged from r312591, vendor/mdocml/dist/dba_write.c vendor/mdocml/20170121/dba_write.h - copied unchanged from r312591, vendor/mdocml/dist/dba_write.h vendor/mdocml/20170121/dbm.c - copied unchanged from r312591, vendor/mdocml/dist/dbm.c vendor/mdocml/20170121/dbm.h - copied unchanged from r312591, vendor/mdocml/dist/dbm.h vendor/mdocml/20170121/dbm_map.c - copied unchanged from r312591, vendor/mdocml/dist/dbm_map.c vendor/mdocml/20170121/dbm_map.h - copied unchanged from r312591, vendor/mdocml/dist/dbm_map.h vendor/mdocml/20170121/test-EFTYPE.c - copied unchanged from r312591, vendor/mdocml/dist/test-EFTYPE.c vendor/mdocml/20170121/test-PATH_MAX.c - copied unchanged from r312591, vendor/mdocml/dist/test-PATH_MAX.c vendor/mdocml/20170121/test-be32toh.c - copied unchanged from r312591, vendor/mdocml/dist/test-be32toh.c vendor/mdocml/20170121/test-nanosleep.c - copied unchanged from r312591, vendor/mdocml/dist/test-nanosleep.c vendor/mdocml/20170121/test-ntohl.c - copied unchanged from r312591, vendor/mdocml/dist/test-ntohl.c vendor/mdocml/20170121/test-sandbox_init.c - copied unchanged from r312591, vendor/mdocml/dist/test-sandbox_init.c Replaced: vendor/mdocml/20170121/INSTALL - copied unchanged from r312591, vendor/mdocml/dist/INSTALL vendor/mdocml/20170121/LICENSE - copied unchanged from r312591, vendor/mdocml/dist/LICENSE vendor/mdocml/20170121/Makefile - copied unchanged from r312591, vendor/mdocml/dist/Makefile vendor/mdocml/20170121/Makefile.depend - copied unchanged from r312591, vendor/mdocml/dist/Makefile.depend vendor/mdocml/20170121/TODO - copied unchanged from r312591, vendor/mdocml/dist/TODO vendor/mdocml/20170121/cgi.c - copied unchanged from r312591, vendor/mdocml/dist/cgi.c vendor/mdocml/20170121/compat_fts.c - copied unchanged from r312591, vendor/mdocml/dist/compat_fts.c vendor/mdocml/20170121/compat_fts.h - copied unchanged from r312591, vendor/mdocml/dist/compat_fts.h vendor/mdocml/20170121/configure - copied unchanged from r312591, vendor/mdocml/dist/configure vendor/mdocml/20170121/configure.local.example - copied unchanged from r312591, vendor/mdocml/dist/configure.local.example vendor/mdocml/20170121/demandoc.c - copied unchanged from r312591, vendor/mdocml/dist/demandoc.c vendor/mdocml/20170121/eqn_html.c - copied unchanged from r312591, vendor/mdocml/dist/eqn_html.c vendor/mdocml/20170121/html.c - copied unchanged from r312591, vendor/mdocml/dist/html.c vendor/mdocml/20170121/html.h - copied unchanged from r312591, vendor/mdocml/dist/html.h vendor/mdocml/20170121/lib.in - copied unchanged from r312591, vendor/mdocml/dist/lib.in vendor/mdocml/20170121/libmandoc.h - copied unchanged from r312591, vendor/mdocml/dist/libmandoc.h vendor/mdocml/20170121/main.c - copied unchanged from r312591, vendor/mdocml/dist/main.c vendor/mdocml/20170121/main.h - copied unchanged from r312591, vendor/mdocml/dist/main.h vendor/mdocml/20170121/makewhatis.8 - copied unchanged from r312591, vendor/mdocml/dist/makewhatis.8 vendor/mdocml/20170121/man.1 - copied unchanged from r312591, vendor/mdocml/dist/man.1 vendor/mdocml/20170121/man.c - copied unchanged from r312591, vendor/mdocml/dist/man.c vendor/mdocml/20170121/man.conf.5 - copied unchanged from r312591, vendor/mdocml/dist/man.conf.5 vendor/mdocml/20170121/man_hash.c - copied unchanged from r312591, vendor/mdocml/dist/man_hash.c vendor/mdocml/20170121/man_html.c - copied unchanged from r312591, vendor/mdocml/dist/man_html.c vendor/mdocml/20170121/man_macro.c - copied unchanged from r312591, vendor/mdocml/dist/man_macro.c vendor/mdocml/20170121/man_term.c - copied unchanged from r312591, vendor/mdocml/dist/man_term.c vendor/mdocml/20170121/mandoc.1 - copied unchanged from r312591, vendor/mdocml/dist/mandoc.1 vendor/mdocml/20170121/mandoc.3 - copied unchanged from r312591, vendor/mdocml/dist/mandoc.3 vendor/mdocml/20170121/mandoc.css - copied unchanged from r312591, vendor/mdocml/dist/mandoc.css vendor/mdocml/20170121/mandoc.db.5 - copied unchanged from r312591, vendor/mdocml/dist/mandoc.db.5 vendor/mdocml/20170121/mandoc.h - copied unchanged from r312591, vendor/mdocml/dist/mandoc.h vendor/mdocml/20170121/mandoc_aux.h - copied unchanged from r312591, vendor/mdocml/dist/mandoc_aux.h vendor/mdocml/20170121/mandoc_html.3 - copied unchanged from r312591, vendor/mdocml/dist/mandoc_html.3 vendor/mdocml/20170121/mandocdb.c - copied unchanged from r312591, vendor/mdocml/dist/mandocdb.c vendor/mdocml/20170121/manpath.c - copied unchanged from r312591, vendor/mdocml/dist/manpath.c vendor/mdocml/20170121/mansearch.c - copied unchanged from r312591, vendor/mdocml/dist/mansearch.c vendor/mdocml/20170121/mansearch.h - copied unchanged from r312591, vendor/mdocml/dist/mansearch.h vendor/mdocml/20170121/mdoc.7 - copied unchanged from r312591, vendor/mdocml/dist/mdoc.7 vendor/mdocml/20170121/mdoc.c - copied unchanged from r312591, vendor/mdocml/dist/mdoc.c vendor/mdocml/20170121/mdoc_argv.c - copied unchanged from r312591, vendor/mdocml/dist/mdoc_argv.c vendor/mdocml/20170121/mdoc_hash.c - copied unchanged from r312591, vendor/mdocml/dist/mdoc_hash.c vendor/mdocml/20170121/mdoc_html.c - copied unchanged from r312591, vendor/mdocml/dist/mdoc_html.c vendor/mdocml/20170121/mdoc_macro.c - copied unchanged from r312591, vendor/mdocml/dist/mdoc_macro.c vendor/mdocml/20170121/mdoc_man.c - copied unchanged from r312591, vendor/mdocml/dist/mdoc_man.c vendor/mdocml/20170121/mdoc_state.c - copied unchanged from r312591, vendor/mdocml/dist/mdoc_state.c vendor/mdocml/20170121/mdoc_term.c - copied unchanged from r312591, vendor/mdocml/dist/mdoc_term.c vendor/mdocml/20170121/mdoc_validate.c - copied unchanged from r312591, vendor/mdocml/dist/mdoc_validate.c vendor/mdocml/20170121/read.c - copied unchanged from r312591, vendor/mdocml/dist/read.c vendor/mdocml/20170121/roff.c - copied unchanged from r312591, vendor/mdocml/dist/roff.c vendor/mdocml/20170121/roff.h - copied unchanged from r312591, vendor/mdocml/dist/roff.h vendor/mdocml/20170121/tag.c - copied unchanged from r312591, vendor/mdocml/dist/tag.c vendor/mdocml/20170121/tbl_html.c - copied unchanged from r312591, vendor/mdocml/dist/tbl_html.c vendor/mdocml/20170121/term.c - copied unchanged from r312591, vendor/mdocml/dist/term.c vendor/mdocml/20170121/term_ascii.c - copied unchanged from r312591, vendor/mdocml/dist/term_ascii.c vendor/mdocml/20170121/term_ps.c - copied unchanged from r312591, vendor/mdocml/dist/term_ps.c vendor/mdocml/20170121/test-fts.c - copied unchanged from r312591, vendor/mdocml/dist/test-fts.c vendor/mdocml/20170121/test-ohash.c - copied unchanged from r312591, vendor/mdocml/dist/test-ohash.c vendor/mdocml/20170121/test-vasprintf.c - copied unchanged from r312591, vendor/mdocml/dist/test-vasprintf.c vendor/mdocml/20170121/test-wchar.c - copied unchanged from r312591, vendor/mdocml/dist/test-wchar.c vendor/mdocml/20170121/tree.c - copied unchanged from r312591, vendor/mdocml/dist/tree.c Deleted: vendor/mdocml/20170121/compat_sqlite3_errstr.c vendor/mdocml/20170121/config.log vendor/mdocml/20170121/mansearch_const.c vendor/mdocml/20170121/test-mmap.c vendor/mdocml/20170121/test-sqlite3.c vendor/mdocml/20170121/test-sqlite3_errstr.c Copied: vendor/mdocml/20170121/INSTALL (from r312591, vendor/mdocml/dist/INSTALL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20170121/INSTALL Sat Jan 21 13:02:53 2017 (r312592, copy of r312591, vendor/mdocml/dist/INSTALL) @@ -0,0 +1,146 @@ +$Id: INSTALL,v 1.17 2016/07/19 22:40:33 schwarze Exp $ + +About mdocml, the portable mandoc distribution +---------------------------------------------- +The mandoc manpage compiler toolset is a suite of tools compiling +mdoc(7), the roff(7) macro language of choice for BSD manual pages, +and man(7), the predominant historical language for UNIX manuals. +It includes a man(1) manual viewer and additional tools. +For general information, see . + +In case you have questions or want to provide feedback, read +. Consider subscribing to the +discuss@ mailing list mentioned on that page. If you intend to +help with the development of mandoc, consider subscribing to the +tech@ mailing list, too. + +Enjoy using the mandoc toolset! + +Ingo Schwarze, Karlsruhe, July 2016 + + +Installation +------------ +Before manually installing mandoc on your system, please check +whether the newest version of mandoc is already installed by default +or available via a binary package or a ports system. A list of the +latest bundled and ported versions of mandoc for various operating +systems is maintained at . + +Regarding how packages and ports are maintained for your operating +system, please consult your operating system documentation. +To install mandoc manually, the following steps are needed: + +1. If you want to build the CGI program, man.cgi(8), too, run the +command "echo BUILD_CGI=1 > configure.local". Then run "cp +cgi.h.examples cgi.h" and edit cgi.h as desired. + +2. Define MANPATH_DEFAULT in configure.local +if /usr/share/man:/usr/X11R6/man:/usr/local/man is not appropriate +for your operating system. + +3. Run "./configure". +This script attempts autoconfiguration of mandoc for your system. +Read both its standard output and the file "Makefile.local" it +generates. If anything looks wrong or different from what you +wish, read the file "configure.local.example", create and edit +a file "configure.local", and re-run "./configure" until the +result seems right to you. +On Solaris 10 and earlier, you may have to run "ksh ./configure" +because the native /bin/sh lacks some POSIX features. + +4. Run "make". +Any POSIX-compatible make, in particular both BSD make and GNU make, +should work. If the build fails, look at "configure.local.example" +and go back to step 2. + +5. Run "make -n install" and check whether everything will be +installed to the intended places. Otherwise, put some *DIR or *NM* +variables into "configure.local" and go back to step 3. + +6. Run "sudo make install". If you intend to build a binary +package using some kind of fake root mechanism, you may need a +command like "make DESTDIR=... install". Read the *-install targets +in the "Makefile" to understand how DESTDIR is used. + +7. Run the command "sudo +makewhatis" to build mandoc.db(5) databases in all the directory +trees configured in step 6. Whenever installing new manual pages, +re-run makewhatis(8) to update the databases, or apropos(1) will +not find the new pages. + +8. To set up a man.cgi(8) server, read its manual page. + +Note that some man(7) pages may contain low-level roff(7) markup +that mandoc does not yet understand. On some BSD systems using +mandoc, third-party software is vetted on whether it may be formatted +with mandoc. If not, groff(1) is pulled in as a dependency and +used to install a pre-formatted "catpage" instead of directly as +manual page source. + + +Understanding mandoc dependencies +--------------------------------- +The following libraries are required: + +1. zlib for decompressing gzipped manual pages. + +2. The fts(3) directory traversion functions. +If your system does not have them, the bundled compatibility version +will be used, so you need not worry in that case. But be careful: the +glibc version of fts(3) is known to be broken on 32bit platforms, +see . +If you run into that problem, set "HAVE_FTS=0" in configure.local. + +3. Marc Espie's ohash(3) library. +If your system does not have it, the bundled compatibility version +will be used, so you probably need not worry about it. + +One of the chief design goals of the mandoc toolbox is to make +sure that nothing related to documentation requires C++. +Consequently, linking mandoc against any kind of C++ program +would defeat the purpose and is not supported. + + +Checking autoconfiguration quality +---------------------------------- +If you want to check whether automatic configuration works well +on your platform, consider the following: + +The mandoc package intentionally does not use GNU autoconf because +we consider that toolset a blatant example of overengineering that +is obsolete nowadays, since all modern operating systems are now +reasonably close to POSIX and do not need arcane shell magic any +longer. If your system does need such magic, consider upgrading +to reasonably modern POSIX-compliant tools rather than asking for +autoconf-style workarounds. + +As far as mandoc is using any features not mandated by ANSI X3.159-1989 +("ANSI C") or IEEE Std 1003.1-2008 ("POSIX") that some modern systems +do not have, we intend to provide autoconfiguration tests and +compat_*.c implementations. Please report any that turn out to be +missing. Note that while we do strive to produce portable code, +we do not slavishly restrict ourselves to POSIX-only interfaces. +For improved security and readability, we do use well-designed, +modern interfaces like reallocarray(3) even if they are still rather +uncommon, of course bundling compat_*.c implementations as needed. + +Where mandoc is using ANSI C or POSIX features that some systems +still lack and that compat_*.c implementations can be provided for +without too much hassle, we will consider adding them, too, so +please report whatever is missing on your platform. + +The following steps can be used to manually check the automatic +configuration on your platform: + +1. Run "make distclean". + +2. Run "./configure" + +3. Read the file "config.log". It shows the compiler commands used +to test the libraries installed on your system and the standard +output and standard error output these commands produce. Watch out +for unexpected failures. Those are most likely to happen if headers +or libraries are installed in unusual places or interfaces defined +in unusual headers. You can also look at the file "config.h" and +check that no "#define HAVE_*" differ from your expectations. Copied: vendor/mdocml/20170121/LICENSE (from r312591, vendor/mdocml/dist/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20170121/LICENSE Sat Jan 21 13:02:53 2017 (r312592, copy of r312591, vendor/mdocml/dist/LICENSE) @@ -0,0 +1,53 @@ +$Id: LICENSE,v 1.13 2016/10/18 14:15:33 schwarze Exp $ + +With the exceptions noted below, all code and documentation +contained in the mdocml toolkit is protected by the Copyright +of the following developers: + +Copyright (c) 2008-2012, 2014 Kristaps Dzonsons +Copyright (c) 2010-2016 Ingo Schwarze +Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger +Copyright (c) 2013 Franco Fichtner +Copyright (c) 2014 Baptiste Daroussin +Copyright (c) 2016 Ed Maste +Copyright (c) 1999, 2004 Marc Espie +Copyright (c) 1998, 2004, 2010 Todd C. Miller +Copyright (c) 2008 Otto Moerbeek +Copyright (c) 2004 Ted Unangst +Copyright (c) 1994 Christos Zoulas +Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre + +See the individual source files for information about who contributed +to which file during which years. + + +The mdocml distribution as a whole is distributed by its developers +under the following license: + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +The following files included from outside sources are protected by +other people's Copyright and are distributed under various 2-clause +and 3-clause BSD licenses; see these individual files for details. + +soelim.c, soelim.1: +Copyright (c) 2014 Baptiste Daroussin + +compat_err.c, compat_fts.c, compat_fts.h, +compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c, +man.1: +Copyright (c) 1989,1990,1993,1994 The Regents of the University of California + +compat_stringlist.c, compat_stringlist.h: +Copyright (c) 1994 Christos Zoulas Copied: vendor/mdocml/20170121/Makefile (from r312591, vendor/mdocml/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20170121/Makefile Sat Jan 21 13:02:53 2017 (r312592, copy of r312591, vendor/mdocml/dist/Makefile) @@ -0,0 +1,478 @@ +# $Id: Makefile,v 1.493 2016/11/19 15:24:51 schwarze Exp $ +# +# Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons +# Copyright (c) 2011, 2013-2016 Ingo Schwarze +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +VERSION = 1.14.0 + +# === LIST OF FILES ==================================================== + +TESTSRCS = test-be32toh.c \ + test-dirent-namlen.c \ + test-EFTYPE.c \ + test-err.c \ + test-fts.c \ + test-getline.c \ + test-getsubopt.c \ + test-isblank.c \ + test-mkdtemp.c \ + test-nanosleep.c \ + test-ntohl.c \ + test-ohash.c \ + test-PATH_MAX.c \ + test-pledge.c \ + test-progname.c \ + test-reallocarray.c \ + test-rewb-bsd.c \ + test-rewb-sysv.c \ + test-sandbox_init.c \ + test-strcasestr.c \ + test-stringlist.c \ + test-strlcat.c \ + test-strlcpy.c \ + test-strptime.c \ + test-strsep.c \ + test-strtonum.c \ + test-vasprintf.c \ + test-wchar.c + +SRCS = att.c \ + cgi.c \ + chars.c \ + compat_err.c \ + compat_fts.c \ + compat_getline.c \ + compat_getsubopt.c \ + compat_isblank.c \ + compat_mkdtemp.c \ + compat_ohash.c \ + compat_progname.c \ + compat_reallocarray.c \ + compat_strcasestr.c \ + compat_stringlist.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + compat_strsep.c \ + compat_strtonum.c \ + compat_vasprintf.c \ + dba.c \ + dba_array.c \ + dba_read.c \ + dba_write.c \ + dbm.c \ + dbm_map.c \ + demandoc.c \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + html.c \ + lib.c \ + main.c \ + man.c \ + man_hash.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.c \ + mandoc_aux.c \ + mandoc_ohash.c \ + mandocdb.c \ + manpage.c \ + manpath.c \ + mansearch.c \ + mdoc.c \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_state.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + out.c \ + preconv.c \ + read.c \ + roff.c \ + soelim.c \ + st.c \ + tag.c \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term_ascii.c \ + term_ps.c \ + tree.c + +DISTFILES = INSTALL \ + LICENSE \ + Makefile \ + Makefile.depend \ + NEWS \ + TODO \ + apropos.1 \ + cgi.h.example \ + compat_fts.h \ + compat_ohash.h \ + compat_stringlist.h \ + configure \ + configure.local.example \ + dba.h \ + dba_array.h \ + dba_write.h \ + dbm.h \ + dbm_map.h \ + demandoc.1 \ + eqn.7 \ + gmdiff \ + html.h \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.h \ + makewhatis.8 \ + man.1 \ + man.7 \ + man.cgi.3 \ + man.cgi.8 \ + man.conf.5 \ + man.h \ + manconf.h \ + mandoc.1 \ + mandoc.3 \ + mandoc.css \ + mandoc.db.5 \ + mandoc.h \ + mandoc_aux.h \ + mandoc_char.7 \ + mandoc_escape.3 \ + mandoc_headers.3 \ + mandoc_html.3 \ + mandoc_malloc.3 \ + mandoc_ohash.h \ + mansearch.3 \ + mansearch.h \ + mchars_alloc.3 \ + mdoc.7 \ + mdoc.h \ + msec.in \ + out.h \ + predefs.in \ + roff.7 \ + roff.h \ + roff_int.h \ + soelim.1 \ + st.in \ + tag.h \ + tbl.3 \ + tbl.7 \ + term.h \ + $(SRCS) \ + $(TESTSRCS) + +LIBMAN_OBJS = man.o \ + man_hash.o \ + man_macro.o \ + man_validate.o + +LIBMDOC_OBJS = att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_hash.o \ + mdoc_macro.o \ + mdoc_state.o \ + mdoc_validate.o \ + st.o + +LIBROFF_OBJS = eqn.o \ + roff.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + mandoc.o \ + mandoc_aux.o \ + mandoc_ohash.o \ + msec.o \ + preconv.o \ + read.o + +COMPAT_OBJS = compat_err.o \ + compat_fts.o \ + compat_getline.o \ + compat_getsubopt.o \ + compat_isblank.o \ + compat_mkdtemp.o \ + compat_ohash.o \ + compat_progname.o \ + compat_reallocarray.o \ + compat_strcasestr.o \ + compat_strlcat.o \ + compat_strlcpy.o \ + compat_strsep.o \ + compat_strtonum.o \ + compat_vasprintf.o + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + tbl_html.o + +MANDOC_MAN_OBJS = mdoc_man.o + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + tbl_term.o + +DBM_OBJS = dbm.o \ + dbm_map.o \ + mansearch.o + +DBA_OBJS = dba.o \ + dba_array.o \ + dba_read.o \ + dba_write.o \ + mandocdb.o + +MAIN_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + $(DBM_OBJS) \ + $(DBA_OBJS) \ + main.o \ + manpath.o \ + out.o \ + tag.o \ + tree.o + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(DBM_OBJS) \ + cgi.o \ + out.o + +MANPAGE_OBJS = $(DBM_OBJS) \ + manpage.o \ + manpath.o + +DEMANDOC_OBJS = demandoc.o + +SOELIM_OBJS = soelim.o \ + compat_err.o \ + compat_getline.o \ + compat_progname.o \ + compat_reallocarray.o \ + compat_stringlist.o + +WWW_MANS = apropos.1.html \ + demandoc.1.html \ + man.1.html \ + mandoc.1.html \ + soelim.1.html \ + mandoc.3.html \ + mandoc_escape.3.html \ + mandoc_headers.3.html \ + mandoc_html.3.html \ + mandoc_malloc.3.html \ + mansearch.3.html \ + mchars_alloc.3.html \ + tbl.3.html \ + man.conf.5.html \ + mandoc.db.5.html \ + eqn.7.html \ + man.7.html \ + mandoc_char.7.html \ + mdoc.7.html \ + roff.7.html \ + tbl.7.html \ + makewhatis.8.html \ + man.cgi.3.html \ + man.cgi.8.html \ + man.h.html \ + manconf.h.html \ + mandoc.h.html \ + mandoc_aux.h.html \ + mansearch.h.html \ + mdoc.h.html \ + roff.h.html + +WWW_OBJS = mdocml.tar.gz \ + mdocml.sha256 + +# === USER CONFIGURATION =============================================== + +include Makefile.local + +# === DEPENDENCY HANDLING ============================================== + +all: base-build $(BUILD_TARGETS) Makefile.local + +base-build: mandoc demandoc soelim + +cgi-build: man.cgi + +install: base-install $(INSTALL_TARGETS) + +www: $(WWW_OBJS) $(WWW_MANS) + +$(WWW_MANS): mandoc + +.PHONY: base-install cgi-install install www-install +.PHONY: clean distclean depend + +include Makefile.depend + +# === TARGETS CONTAINING SHELL COMMANDS ================================ + +distclean: clean + rm -f Makefile.local config.h config.h.old config.log config.log.old + +clean: + rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS) + rm -f mandoc $(MAIN_OBJS) + rm -f man.cgi $(CGI_OBJS) + rm -f manpage $(MANPAGE_OBJS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f soelim $(SOELIM_OBJS) + rm -f $(WWW_MANS) $(WWW_OBJS) + rm -rf *.dSYM + +base-install: base-build + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(SBINDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man5 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + mkdir -p $(DESTDIR)$(MANDIR)/man8 + $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR) + $(INSTALL_PROGRAM) soelim $(DESTDIR)$(BINDIR)/$(BINM_SOELIM) + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN) + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_APROPOS) + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_WHATIS) + ln -f $(DESTDIR)$(BINDIR)/mandoc \ + $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS) + $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) soelim.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1 + $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 + $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 + ln -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 \ + $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1 + $(INSTALL_MAN) man.conf.5 $(DESTDIR)$(MANDIR)/man5/${MANM_MANCONF}.5 + $(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5 + $(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MAN}.7 + $(INSTALL_MAN) mdoc.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MDOC}.7 + $(INSTALL_MAN) roff.7 $(DESTDIR)$(MANDIR)/man7/${MANM_ROFF}.7 + $(INSTALL_MAN) eqn.7 $(DESTDIR)$(MANDIR)/man7/${MANM_EQN}.7 + $(INSTALL_MAN) tbl.7 $(DESTDIR)$(MANDIR)/man7/${MANM_TBL}.7 + $(INSTALL_MAN) mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_MAN) makewhatis.8 \ + $(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8 + +lib-install: base-build + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h roff.h \ + $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ + mansearch.3 mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 + +cgi-install: cgi-build + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) mandoc.css $(DESTDIR)$(HTDOCDIR) + +Makefile.local config.h: configure ${TESTSRCS} + @echo "$@ is out of date; please run ./configure" + @exit 1 + +libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + ar rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) + +mandoc: $(MAIN_OBJS) libmandoc.a + $(CC) -o $@ $(LDFLAGS) $(MAIN_OBJS) libmandoc.a $(LDADD) + +manpage: $(MANPAGE_OBJS) libmandoc.a + $(CC) -o $@ $(LDFLAGS) $(MANPAGE_OBJS) libmandoc.a $(LDADD) + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(STATIC) -o $@ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD) + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) -o $@ $(LDFLAGS) $(DEMANDOC_OBJS) libmandoc.a $(LDADD) + +soelim: $(SOELIM_OBJS) + $(CC) -o $@ $(LDFLAGS) $(SOELIM_OBJS) + +# --- maintainer targets --- + +www-install: www + mkdir -p $(HTDOCDIR)/snapshots + $(INSTALL_DATA) $(WWW_MANS) mandoc.css $(HTDOCDIR) + $(INSTALL_DATA) $(WWW_OBJS) $(HTDOCDIR)/snapshots + $(INSTALL_DATA) mdocml.tar.gz \ + $(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz + $(INSTALL_DATA) mdocml.sha256 \ + $(HTDOCDIR)/snapshots/mdocml-$(VERSION).sha256 + +depend: config.h + mkdep -f Makefile.depend $(CFLAGS) $(SRCS) + perl -e 'undef $$/; $$_ = <>; s|/usr/include/\S+||g; \ + s|\\\n||g; s| +| |g; s| $$||mg; print;' \ + Makefile.depend > Makefile.tmp + mv Makefile.tmp Makefile.depend + +dist: mdocml.sha256 + +mdocml.sha256: mdocml.tar.gz + sha256 mdocml.tar.gz > $@ + +mdocml.tar.gz: $(DISTFILES) + mkdir -p .dist/mdocml-$(VERSION)/ + $(INSTALL) -m 0644 $(DISTFILES) .dist/mdocml-$(VERSION) + chmod 755 .dist/mdocml-$(VERSION)/configure + ( cd .dist/ && tar zcf ../$@ mdocml-$(VERSION) ) + rm -rf .dist/ + +# === SUFFIX RULES ===================================================== + +.SUFFIXES: .1 .3 .5 .7 .8 .h +.SUFFIXES: .1.html .3.html .5.html .7.html .8.html .h.html + +.h.h.html: + highlight -I $< > $@ + +.1.1.html .3.3.html .5.5.html .7.7.html .8.8.html: mandoc + ./mandoc -Thtml -Wall,stop \ + -Ostyle=mandoc.css,man=%N.%S.html,includes=%I.html $< > $@ Copied: vendor/mdocml/20170121/Makefile.depend (from r312591, vendor/mdocml/dist/Makefile.depend) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20170121/Makefile.depend Sat Jan 21 13:02:53 2017 (r312592, copy of r312591, vendor/mdocml/dist/Makefile.depend) @@ -0,0 +1,72 @@ +att.o: att.c config.h roff.h mdoc.h libmdoc.h +cgi.o: cgi.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h main.h manconf.h mansearch.h cgi.h +chars.o: chars.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h libmandoc.h +compat_err.o: compat_err.c config.h +compat_fts.o: compat_fts.c config.h compat_fts.h +compat_getline.o: compat_getline.c config.h +compat_getsubopt.o: compat_getsubopt.c config.h +compat_isblank.o: compat_isblank.c config.h +compat_mkdtemp.o: compat_mkdtemp.c config.h +compat_ohash.o: compat_ohash.c config.h compat_ohash.h +compat_progname.o: compat_progname.c config.h +compat_reallocarray.o: compat_reallocarray.c config.h +compat_strcasestr.o: compat_strcasestr.c config.h +compat_stringlist.o: compat_stringlist.c config.h compat_stringlist.h +compat_strlcat.o: compat_strlcat.c config.h +compat_strlcpy.o: compat_strlcpy.c config.h +compat_strsep.o: compat_strsep.c config.h +compat_strtonum.o: compat_strtonum.c config.h +compat_vasprintf.o: compat_vasprintf.c config.h +dba.o: dba.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mansearch.h dba_write.h dba_array.h dba.h +dba_array.o: dba_array.c mandoc_aux.h dba_write.h dba_array.h +dba_read.o: dba_read.c mandoc_aux.h mansearch.h dba_array.h dba.h dbm.h +dba_write.o: dba_write.c config.h dba_write.h +dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h +dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h +demandoc.o: demandoc.c config.h roff.h man.h mdoc.h mandoc.h +eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h +eqn_term.o: eqn_term.c config.h mandoc.h out.h term.h +html.o: html.c config.h mandoc.h mandoc_aux.h out.h html.h manconf.h main.h +lib.o: lib.c config.h roff.h mdoc.h libmdoc.h lib.in +main.o: main.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h tag.h main.h manconf.h mansearch.h +man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h +man_hash.o: man_hash.c config.h mandoc.h roff.h man.h libmandoc.h libman.h +man_html.o: man_html.c config.h mandoc_aux.h roff.h man.h out.h html.h main.h +man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h +man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h main.h +man_validate.o: man_validate.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h +mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h +mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h +mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h +mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h dba_array.h dba.h +manpage.o: manpage.c config.h manconf.h mansearch.h +manpath.o: manpath.c config.h mandoc_aux.h manconf.h +mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h +mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_hash.o: mdoc_hash.c config.h mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h +mdoc_html.o: mdoc_html.c config.h mandoc_aux.h roff.h mdoc.h out.h html.h main.h +mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h +mdoc_state.o: mdoc_state.c mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h +mdoc_term.o: mdoc_term.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h out.h term.h tag.h main.h +mdoc_validate.o: mdoc_validate.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +msec.o: msec.c config.h mandoc.h libmandoc.h msec.in +out.o: out.c config.h mandoc_aux.h mandoc.h out.h +preconv.o: preconv.c config.h mandoc.h libmandoc.h +read.o: read.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h libmandoc.h roff_int.h +roff.o: roff.c config.h mandoc.h mandoc_aux.h roff.h libmandoc.h roff_int.h libroff.h predefs.in +soelim.o: soelim.c config.h compat_stringlist.h +st.o: st.c config.h roff.h mdoc.h libmdoc.h st.in +tag.o: tag.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h tag.h +tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_data.o: tbl_data.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_html.o: tbl_html.c config.h mandoc.h out.h html.h +tbl_layout.o: tbl_layout.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_opts.o: tbl_opts.c config.h mandoc.h libmandoc.h libroff.h +tbl_term.o: tbl_term.c config.h mandoc.h out.h term.h +term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h +term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h manconf.h main.h +term_ps.o: term_ps.c config.h mandoc_aux.h out.h term.h manconf.h main.h +tree.o: tree.c config.h mandoc.h roff.h mdoc.h man.h main.h Copied: vendor/mdocml/20170121/TODO (from r312591, vendor/mdocml/dist/TODO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20170121/TODO Sat Jan 21 13:02:53 2017 (r312592, copy of r312591, vendor/mdocml/dist/TODO) @@ -0,0 +1,662 @@ +************************************************************************ +* Official mandoc TODO. +* $Id: TODO,v 1.223 2017/01/17 15:32:43 schwarze Exp $ +************************************************************************ + +Many issues are annotated for difficulty as follows: + + - loc = locality of the issue + * single file issue, affects file only, or very few + ** single module issue, affects several files of one module + *** cross-module issue, significantly impacts multiple modules + and may require substantial changes to internal interfaces + - exist = difficulty of the existing code in this area + * affected code is straightforward and easy to read and change + ** affected code is somewhat complex, but once you understand + the design, not particularly difficult to understand + *** affected code uses a special, exceptionally tricky design + - algo = difficulty of the new algorithm to be written + * the required logic and code is straightforward + ** the required logic is somewhat complex and needs a careful design + *** the required logic is exceptionally tricky, + maybe an approach to solve that is not even known yet + - size = the amount of code to be written or changed + * a small number of lines (at most 100, usually much less) + ** a considerable amount of code (several dozen to a few hundred) + *** a large amount of code (many hundreds, maybe thousands) + - imp = importance of the issue + * mostly for completeness + ** would be nice to have + *** issue causes considerable inconvenience + +Obviously, as the issues have not been solved yet, these annotations +are mere guesses, and some may be wrong. + +************************************************************************ +* missing features +************************************************************************ + +--- missing roff features ---------------------------------------------- + +- .ad (adjust margins) + .ad l -- adjust left margin only (flush left) + .ad r -- adjust right margin only (flush right) + .ad c -- center text on line + .ad b -- adjust both margins (alias: .ad n) + .na -- temporarily disable adjustment without changing the mode + .ad -- re-enable adjustment without changing the mode + Adjustment mode is ignored while in no-fill mode (.nf). + loc *** exist *** algo ** size ** imp ** (parser reorg would help) + +- .fc (field control) + found by naddy@ in xloadimage(1) + loc ** exist *** algo * size * imp * + +- .nr third argument (auto-increment step size, requires \n+) + found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 + loc * exist * algo * size * imp ** + +- .ns (no-space mode) occurs in xine-config(1) + when implementing this, also let .TH set it + reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + loc *** exist *** algo *** size ** imp * + +- .ta (tab settings) + #1 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100 + ircbug(1) gnats(1) reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 + also Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 + also posix2time(3) Carsten Kunze Mon, 1 Dec 2014 13:03:10 +0100 + loc ** exist *** algo ** size ** imp *** + +- .ti (temporary indent) + found by naddy@ in xloadimage(1) [devel/libvstr] vstr(3) + found by bentley@ in nmh(1) Mon, 23 Apr 2012 13:38:28 -0600 + loc ** exist ** algo ** size * imp ** (parser reorg helps a lot) + +- .while and .shift + found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200 + loc * exist ** algo ** size ** imp ** + +- \h horizontal move + #2 most important issue naddy@ Mon, 16 Feb 2015 20:59:17 +0100 + found in cclive(1) nasm(1) bogofilter(1) asciidoc/DocBook output + bentley@ on discuss@ Sat, 21 Sep 2013 22:29:34 -0600 + naddy@ Thu, 4 Dec 2014 16:26:41 +0100 + loc ** exist ** algo ** size * imp *** (parser reorg helps a lot) + +- \n+ and \n- numerical register increment and decrement + found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 + loc * exist * algo * size * imp ** + +- \n(.$ macro argument count number register; ocserv(8) by autogen + found by sthen@ Thu, 19 Feb 2015 22:03:01 +0000 + loc * exist ** algo * size * imp ** + +- \w'' improve width measurements + would not be very useful without an expression parser, see below + needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 + loc ** exist *** algo *** size * imp *** + +- \\ in high-level macro arguments + Currently, \\ is expanded in two situations: + 1) macro and string definition (roff.c setstrn()) + 2) macro argument parsing (mandoc.c mandoc_getarg()) + For user defined macros, the second happens in time because of ROFF_REPARSE. + But for standard high-level macros, it only happens after entering the + high level parsers, which is too late because the code doesn't get + back to roff.c roff_res() from that point. Because this requires + distinguishing requests, user-defined macros and standard macros + on the roff_res() level, it is hard to solve without the parser reorg. + Found by naddy@ in devel/cutils cobfusc(1) Mon, 16 Feb 2015 19:10:52 +0100 + loc *** exist *** algo *** size ** imp * + +- using undefined strings or macros defines them to be empty + wl@ Mon, 14 Nov 2011 14:37:01 +0000 + loc * exist * algo * size * imp * + +--- missing mdoc features ---------------------------------------------- + +- .Bl -column .Xo support is missing + ultimate goal: + restore .Xr and .Dv to + lib/libc/compat-43/sigvec.3 + lib/libc/gen/signal.3 + lib/libc/sys/sigaction.2 + loc * exist *** algo *** size * imp ** + +- edge case: decide how to deal with blk_full bad nesting, e.g. + .Sh .Nm .Bk .Nm .Ek .Sh found by jmc@ in ssh-keygen(1) + from jmc@ Wed, 14 Jul 2010 18:10:32 +0100 + loc * exist *** algo *** size ** imp ** + +- .Bd -centered implies -filled, not -unfilled, which is not + easy to implement; it requires code similar to .ce, which + we don't have either. + Besides, groff has bug causing text right *before* .Bd -centered + to be centered as well. + loc *** exist *** algo ** size ** imp ** (parser reorg would help) + +- .Bd -filled should not be the same as .Bd -ragged, but align both + the left and right margin. In groff, it is implemented in terms + of .ad b, which we don't have either. Found in cksum(1). + loc *** exist *** algo ** size ** imp ** (parser reorg would help) + +- implement blank `Bl -column', such as + .Bl -column + .It foo Ta bar + .El + loc * exist *** algo *** size * imp * + +- explicitly disallow nested `Bl -column', which would clobber internal + flags defined for struct mdoc_macro + loc * exist * algo * size * imp ** + +- In .Bl -column .It, the end of the line probably has to be regarded + as an implicit .Ta, if there could be one, see the following mildly + ugly code from login.conf(5): + .Bl -column minpasswordlen program xetcxmotd + .It path Ta path Ta value of Dv _PATH_DEFPATH + .br + Default search path. + reported by Michal Mazurek + via jmc@ Thu, 7 Apr 2011 16:00:53 +0059 + loc * exist *** algo ** size * imp ** + +- inside `.Bl -column' phrases, punctuation is handled like normal + text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -." + +- inside `.Bl -column' phrases, TERMP_IGNDELIM handling by `Pf' + is not safe, e.g. `.Bl -column .It Pf a b .' gives "ab." + but should give "ab ." + +- check whether it is correct that `D1' uses INDENT+1; + does it need its own constant? + loc * exist ** algo ** size * imp ** + +- prohibit `Nm' from having non-text HEAD children + (e.g., NetBSD mDNSShared/dns-sd.1) + (mdoc_html.c and mdoc_term.c `Nm' handlers can be slightly simplified) + +- support translated section names + e.g. x11/scrotwm scrotwm_es.1:21:2: error: NAME section must be first + that one uses NOMBRE because it is spanish... + deraadt tends to think that section-dependent macro behaviour + is a bad idea in the first place, so this may be irrelevant + loc ** exist ** algo ** size * imp ** + +- When there is free text in the SYNOPSIS and that free text contains + the .Nm macro, groff somehow understands to treat the .Nm as an in-line + macro, while mandoc treats it as a block macro and breaks the line. + No idea how the logic for distinguishing in-line and block instances + should be, needs investigation. + uqs@ Thu, 2 Jun 2011 11:03:51 +0200 + uqs@ Thu, 2 Jun 2011 11:33:35 +0200 + loc * exist ** algo *** size * imp ** + +--- missing man features ----------------------------------------------- + +- -T[x]html doesn't stipulate non-collapsing spaces in literal mode + +--- missing tbl features ----------------------------------------------- + +- horizontal lines in the layout still consume data cells + and can be mixed with actual data on the same table line + synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 + loc ** exist ** algo ** size ** imp *** + +- break long text into lines inside cells + net/lftp(1) from jirib via bentley@ Sep 13, 2016 + +- layout l1 for a column of max text width 3 reduces the following + inter-column spacing for groff, but not for mandoc + net/lftp(1) from jirib via bentley@ Sep 13, 2016 + +- the "w" layout option is ignored + synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 + loc * exist * algo * size * imp ** + +- the "s" layout column specifier is used for placement of data + into columns, but ignored during column width calculations + synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 + loc * exist ** algo *** size * imp ** + +- support mdoc(7) and man(7) macros inside tbl(7) code; + probably requires the parser reorg and letting tbl(7) + use roff_node such that macro sets can mix; + informed by bapt@ that FreeBSD needs this. + loc *** exist ** algo *** size ** imp *** + +- look at the POSIX manuals in the books/man-pages-posix port, + they use some unsupported tbl(7) features. + loc * exist ** algo ** size ** imp *** + +- use Unicode U+2500 to U+256C for table borders + in tbl(7) -Tutf-8 output + suggested by bentley@ Tue, 14 Oct 2014 04:10:55 -0600 + loc * exist ** algo * size * imp ** *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 21 13:17:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78C0ECB9D6E; Sat, 21 Jan 2017 13:17:27 +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 412711753; Sat, 21 Jan 2017 13:17:27 +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 v0LDHQin036933; Sat, 21 Jan 2017 13:17:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LDHPkm036923; Sat, 21 Jan 2017 13:17:25 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201701211317.v0LDHPkm036923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 21 Jan 2017 13:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312593 - in head: . contrib/mdocml usr.bin/mandoc 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, 21 Jan 2017 13:17:27 -0000 Author: bapt Date: Sat Jan 21 13:17:25 2017 New Revision: 312593 URL: https://svnweb.freebsd.org/changeset/base/312593 Log: Import mandoc cvs snapshot 20170121 (pre 1.14) Note that mandoc does not use anymore sqlite3 but a home made database format An important improvement has been made as well in makewhatis performance: Tests on my laptop shows makewhatis on the entire system goes from 26s to 12s Added: head/contrib/mdocml/dba.c - copied unchanged from r312592, vendor/mdocml/dist/dba.c head/contrib/mdocml/dba.h - copied unchanged from r312592, vendor/mdocml/dist/dba.h head/contrib/mdocml/dba_array.c - copied unchanged from r312592, vendor/mdocml/dist/dba_array.c head/contrib/mdocml/dba_array.h - copied unchanged from r312592, vendor/mdocml/dist/dba_array.h head/contrib/mdocml/dba_read.c - copied unchanged from r312592, vendor/mdocml/dist/dba_read.c head/contrib/mdocml/dba_write.c - copied unchanged from r312592, vendor/mdocml/dist/dba_write.c head/contrib/mdocml/dba_write.h - copied unchanged from r312592, vendor/mdocml/dist/dba_write.h head/contrib/mdocml/dbm.c - copied unchanged from r312592, vendor/mdocml/dist/dbm.c head/contrib/mdocml/dbm.h - copied unchanged from r312592, vendor/mdocml/dist/dbm.h head/contrib/mdocml/dbm_map.c - copied unchanged from r312592, vendor/mdocml/dist/dbm_map.c head/contrib/mdocml/dbm_map.h - copied unchanged from r312592, vendor/mdocml/dist/dbm_map.h head/contrib/mdocml/test-EFTYPE.c - copied unchanged from r312592, vendor/mdocml/dist/test-EFTYPE.c head/contrib/mdocml/test-PATH_MAX.c - copied unchanged from r312592, vendor/mdocml/dist/test-PATH_MAX.c head/contrib/mdocml/test-be32toh.c - copied unchanged from r312592, vendor/mdocml/dist/test-be32toh.c head/contrib/mdocml/test-nanosleep.c - copied unchanged from r312592, vendor/mdocml/dist/test-nanosleep.c head/contrib/mdocml/test-ntohl.c - copied unchanged from r312592, vendor/mdocml/dist/test-ntohl.c head/contrib/mdocml/test-sandbox_init.c - copied unchanged from r312592, vendor/mdocml/dist/test-sandbox_init.c Deleted: head/contrib/mdocml/compat_sqlite3_errstr.c head/contrib/mdocml/config.log head/contrib/mdocml/mansearch_const.c head/contrib/mdocml/test-mmap.c head/contrib/mdocml/test-sqlite3.c head/contrib/mdocml/test-sqlite3_errstr.c Modified: head/Makefile.inc1 head/contrib/mdocml/INSTALL head/contrib/mdocml/LICENSE head/contrib/mdocml/Makefile head/contrib/mdocml/Makefile.depend head/contrib/mdocml/TODO head/contrib/mdocml/cgi.c head/contrib/mdocml/compat_fts.c head/contrib/mdocml/compat_fts.h head/contrib/mdocml/config.h head/contrib/mdocml/configure head/contrib/mdocml/configure.local.example head/contrib/mdocml/demandoc.c head/contrib/mdocml/eqn_html.c head/contrib/mdocml/html.c head/contrib/mdocml/html.h head/contrib/mdocml/lib.in head/contrib/mdocml/libmandoc.h head/contrib/mdocml/main.c head/contrib/mdocml/main.h head/contrib/mdocml/makewhatis.8 head/contrib/mdocml/man.1 head/contrib/mdocml/man.c head/contrib/mdocml/man.conf.5 head/contrib/mdocml/man_hash.c head/contrib/mdocml/man_html.c head/contrib/mdocml/man_macro.c head/contrib/mdocml/man_term.c head/contrib/mdocml/mandoc.1 head/contrib/mdocml/mandoc.3 head/contrib/mdocml/mandoc.css head/contrib/mdocml/mandoc.db.5 head/contrib/mdocml/mandoc.h head/contrib/mdocml/mandoc_aux.h head/contrib/mdocml/mandoc_html.3 head/contrib/mdocml/mandocdb.c head/contrib/mdocml/manpath.c head/contrib/mdocml/mansearch.c head/contrib/mdocml/mansearch.h head/contrib/mdocml/mdoc.7 head/contrib/mdocml/mdoc.c head/contrib/mdocml/mdoc_argv.c head/contrib/mdocml/mdoc_hash.c head/contrib/mdocml/mdoc_html.c head/contrib/mdocml/mdoc_macro.c head/contrib/mdocml/mdoc_man.c head/contrib/mdocml/mdoc_state.c head/contrib/mdocml/mdoc_term.c head/contrib/mdocml/mdoc_validate.c head/contrib/mdocml/read.c head/contrib/mdocml/roff.c head/contrib/mdocml/roff.h head/contrib/mdocml/tag.c head/contrib/mdocml/tbl_html.c head/contrib/mdocml/term.c head/contrib/mdocml/term_ascii.c head/contrib/mdocml/term_ps.c head/contrib/mdocml/test-fts.c head/contrib/mdocml/test-ohash.c head/contrib/mdocml/test-vasprintf.c head/contrib/mdocml/test-wchar.c head/contrib/mdocml/tree.c head/usr.bin/mandoc/Makefile head/usr.bin/mandoc/Makefile.depend Directory Properties: head/contrib/mdocml/ (props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat Jan 21 13:02:53 2017 (r312592) +++ head/Makefile.inc1 Sat Jan 21 13:17:25 2017 (r312593) @@ -1694,11 +1694,10 @@ _kerberos5_bootstrap_tools= \ .endif # r283777 makewhatis(1) replaced with mandoc version which builds a database. -.if ${MK_MANDOCDB} != "no" && ${BOOTSTRAPPING} < 1100075 +.if ${MK_MANDOCDB} != "no" _libopenbsd?= lib/libopenbsd -_makewhatis= lib/libsqlite3 \ - usr.bin/mandoc -${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd ${_bt}-lib/libsqlite3 +_makewhatis= usr.bin/mandoc +${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd .endif bootstrap-tools: .PHONY Modified: head/contrib/mdocml/INSTALL ============================================================================== --- head/contrib/mdocml/INSTALL Sat Jan 21 13:02:53 2017 (r312592) +++ head/contrib/mdocml/INSTALL Sat Jan 21 13:17:25 2017 (r312593) @@ -1,4 +1,4 @@ -$Id: INSTALL,v 1.15 2016/07/14 11:09:06 schwarze Exp $ +$Id: INSTALL,v 1.17 2016/07/19 22:40:33 schwarze Exp $ About mdocml, the portable mandoc distribution ---------------------------------------------- @@ -35,7 +35,11 @@ To install mandoc manually, the followin command "echo BUILD_CGI=1 > configure.local". Then run "cp cgi.h.examples cgi.h" and edit cgi.h as desired. -2. Run "./configure". +2. Define MANPATH_DEFAULT in configure.local +if /usr/share/man:/usr/X11R6/man:/usr/local/man is not appropriate +for your operating system. + +3. Run "./configure". This script attempts autoconfiguration of mandoc for your system. Read both its standard output and the file "Makefile.local" it generates. If anything looks wrong or different from what you @@ -45,28 +49,21 @@ result seems right to you. On Solaris 10 and earlier, you may have to run "ksh ./configure" because the native /bin/sh lacks some POSIX features. -3. Run "make". +4. Run "make". Any POSIX-compatible make, in particular both BSD make and GNU make, should work. If the build fails, look at "configure.local.example" and go back to step 2. -4. Run "make -n install" and check whether everything will be +5. Run "make -n install" and check whether everything will be installed to the intended places. Otherwise, put some *DIR or *NM* -variables into "configure.local" and go back to step 2. +variables into "configure.local" and go back to step 3. -5. Run "sudo make install". If you intend to build a binary +6. Run "sudo make install". If you intend to build a binary package using some kind of fake root mechanism, you may need a command like "make DESTDIR=... install". Read the *-install targets in the "Makefile" to understand how DESTDIR is used. -6. If you want to use the integrated man(1) and your system uses -manpath(1), make sure it is configured correctly, in particular, -it returns all directory trees where manual pages are installed. -Otherwise, if your system uses man.conf(5), make sure it contains -a "manpath" line for each directory tree, and the order of these -lines meets your wishes. - -7. If you compiled with database support, run the command "sudo +7. Run the command "sudo makewhatis" to build mandoc.db(5) databases in all the directory trees configured in step 6. Whenever installing new manual pages, re-run makewhatis(8) to update the databases, or apropos(1) will @@ -84,20 +81,9 @@ manual page source. Understanding mandoc dependencies --------------------------------- -The mandoc(1), man(1), and demandoc(1) utilities only depend -on the zlib library for decompressing gzipped manual pages, -but makewhatis(8) and apropos(1) depend on the following -additional software: - -1. The SQLite database system, see . -The recommended version of SQLite is 3.8.4.3 or newer. The mandoc -toolset is known to work with version 3.7.5 or newer. Versions -older than 3.8.3 may not achieve full performance due to the -missing SQLITE_DETERMINISTIC optimization flag. Versions older -than 3.8.0 may not show full error information if opening a database -fails due to the missing sqlite3_errstr() API. Both are very minor -problems, apropos(1) is fully usable with SQLite 3.7.5. Versions -older than 3.7.5 may or may not work, they have not been tested. +The following libraries are required: + +1. zlib for decompressing gzipped manual pages. 2. The fts(3) directory traversion functions. If your system does not have them, the bundled compatibility version Modified: head/contrib/mdocml/LICENSE ============================================================================== --- head/contrib/mdocml/LICENSE Sat Jan 21 13:02:53 2017 (r312592) +++ head/contrib/mdocml/LICENSE Sat Jan 21 13:17:25 2017 (r312593) @@ -1,4 +1,4 @@ -$Id: LICENSE,v 1.12 2016/07/07 23:46:36 schwarze Exp $ +$Id: LICENSE,v 1.13 2016/10/18 14:15:33 schwarze Exp $ With the exceptions noted below, all code and documentation contained in the mdocml toolkit is protected by the Copyright @@ -8,7 +8,8 @@ Copyright (c) 2008-2012, 2014 Kristaps D Copyright (c) 2010-2016 Ingo Schwarze Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger Copyright (c) 2013 Franco Fichtner -Copyright (c) 2014 Baptiste Daroussin +Copyright (c) 2014 Baptiste Daroussin +Copyright (c) 2016 Ed Maste Copyright (c) 1999, 2004 Marc Espie Copyright (c) 1998, 2004, 2010 Todd C. Miller Copyright (c) 2008 Otto Moerbeek @@ -41,7 +42,7 @@ other people's Copyright and are distrib and 3-clause BSD licenses; see these individual files for details. soelim.c, soelim.1: -Copyright (c) 2014 Baptiste Daroussin +Copyright (c) 2014 Baptiste Daroussin compat_err.c, compat_fts.c, compat_fts.h, compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c, Modified: head/contrib/mdocml/Makefile ============================================================================== --- head/contrib/mdocml/Makefile Sat Jan 21 13:02:53 2017 (r312592) +++ head/contrib/mdocml/Makefile Sat Jan 21 13:17:25 2017 (r312593) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.488 2016/07/12 05:18:38 kristaps Exp $ +# $Id: Makefile,v 1.493 2016/11/19 15:24:51 schwarze Exp $ # # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # Copyright (c) 2011, 2013-2016 Ingo Schwarze @@ -15,27 +15,29 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -VERSION = 1.13.4 +VERSION = 1.14.0 # === LIST OF FILES ==================================================== -TESTSRCS = test-dirent-namlen.c \ +TESTSRCS = test-be32toh.c \ + test-dirent-namlen.c \ + test-EFTYPE.c \ test-err.c \ test-fts.c \ test-getline.c \ test-getsubopt.c \ test-isblank.c \ test-mkdtemp.c \ - test-mmap.c \ + test-nanosleep.c \ + test-ntohl.c \ test-ohash.c \ + test-PATH_MAX.c \ test-pledge.c \ test-progname.c \ test-reallocarray.c \ test-rewb-bsd.c \ test-rewb-sysv.c \ test-sandbox_init.c \ - test-sqlite3.c \ - test-sqlite3_errstr.c \ test-strcasestr.c \ test-stringlist.c \ test-strlcat.c \ @@ -58,7 +60,6 @@ SRCS = att.c \ compat_ohash.c \ compat_progname.c \ compat_reallocarray.c \ - compat_sqlite3_errstr.c \ compat_strcasestr.c \ compat_stringlist.c \ compat_strlcat.c \ @@ -66,6 +67,12 @@ SRCS = att.c \ compat_strsep.c \ compat_strtonum.c \ compat_vasprintf.c \ + dba.c \ + dba_array.c \ + dba_read.c \ + dba_write.c \ + dbm.c \ + dbm_map.c \ demandoc.c \ eqn.c \ eqn_html.c \ @@ -86,7 +93,6 @@ SRCS = att.c \ manpage.c \ manpath.c \ mansearch.c \ - mansearch_const.c \ mdoc.c \ mdoc_argv.c \ mdoc_hash.c \ @@ -128,6 +134,11 @@ DISTFILES = INSTALL \ compat_stringlist.h \ configure \ configure.local.example \ + dba.h \ + dba_array.h \ + dba_write.h \ + dbm.h \ + dbm_map.h \ demandoc.1 \ eqn.7 \ gmdiff \ @@ -220,7 +231,6 @@ COMPAT_OBJS = compat_err.o \ compat_ohash.o \ compat_progname.o \ compat_reallocarray.o \ - compat_sqlite3_errstr.o \ compat_strcasestr.o \ compat_strlcat.o \ compat_strlcpy.o \ @@ -244,28 +254,35 @@ MANDOC_TERM_OBJS = eqn_term.o \ term_ps.o \ tbl_term.o -BASE_OBJS = $(MANDOC_HTML_OBJS) \ +DBM_OBJS = dbm.o \ + dbm_map.o \ + mansearch.o + +DBA_OBJS = dba.o \ + dba_array.o \ + dba_read.o \ + dba_write.o \ + mandocdb.o + +MAIN_OBJS = $(MANDOC_HTML_OBJS) \ $(MANDOC_MAN_OBJS) \ $(MANDOC_TERM_OBJS) \ + $(DBM_OBJS) \ + $(DBA_OBJS) \ main.o \ manpath.o \ out.o \ tag.o \ tree.o -MAIN_OBJS = $(BASE_OBJS) - -DB_OBJS = mandocdb.o \ - mansearch.o \ - mansearch_const.o - CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(DBM_OBJS) \ cgi.o \ - mansearch.o \ - mansearch_const.o \ out.o -MANPAGE_OBJS = manpage.o mansearch.o mansearch_const.o manpath.o +MANPAGE_OBJS = $(DBM_OBJS) \ + manpage.o \ + manpath.o DEMANDOC_OBJS = demandoc.o @@ -329,7 +346,7 @@ www: $(WWW_OBJS) $(WWW_MANS) $(WWW_MANS): mandoc -.PHONY: base-install cgi-install db-install install www-install +.PHONY: base-install cgi-install install www-install .PHONY: clean distclean depend include Makefile.depend @@ -341,7 +358,7 @@ distclean: clean clean: rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS) - rm -f mandoc $(BASE_OBJS) $(DB_OBJS) + rm -f mandoc $(MAIN_OBJS) rm -f man.cgi $(CGI_OBJS) rm -f manpage $(MANPAGE_OBJS) rm -f demandoc $(DEMANDOC_OBJS) @@ -351,50 +368,45 @@ clean: base-install: base-build mkdir -p $(DESTDIR)$(BINDIR) - mkdir -p $(DESTDIR)$(LIBDIR) - mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(SBINDIR) mkdir -p $(DESTDIR)$(MANDIR)/man1 - mkdir -p $(DESTDIR)$(MANDIR)/man3 mkdir -p $(DESTDIR)$(MANDIR)/man5 mkdir -p $(DESTDIR)$(MANDIR)/man7 + mkdir -p $(DESTDIR)$(MANDIR)/man8 $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR) $(INSTALL_PROGRAM) soelim $(DESTDIR)$(BINDIR)/$(BINM_SOELIM) ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_MAN) - $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) - $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h roff.h \ - $(DESTDIR)$(INCLUDEDIR) + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_APROPOS) + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_WHATIS) + ln -f $(DESTDIR)$(BINDIR)/mandoc \ + $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS) $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 $(INSTALL_MAN) soelim.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1 $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1 - $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ - mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 + ln -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 \ + $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1 $(INSTALL_MAN) man.conf.5 $(DESTDIR)$(MANDIR)/man5/${MANM_MANCONF}.5 + $(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5 $(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MAN}.7 $(INSTALL_MAN) mdoc.7 $(DESTDIR)$(MANDIR)/man7/${MANM_MDOC}.7 $(INSTALL_MAN) roff.7 $(DESTDIR)$(MANDIR)/man7/${MANM_ROFF}.7 $(INSTALL_MAN) eqn.7 $(DESTDIR)$(MANDIR)/man7/${MANM_EQN}.7 $(INSTALL_MAN) tbl.7 $(DESTDIR)$(MANDIR)/man7/${MANM_TBL}.7 $(INSTALL_MAN) mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 - -db-install: base-build - mkdir -p $(DESTDIR)$(BINDIR) - mkdir -p $(DESTDIR)$(SBINDIR) - mkdir -p $(DESTDIR)$(MANDIR)/man1 - mkdir -p $(DESTDIR)$(MANDIR)/man3 - mkdir -p $(DESTDIR)$(MANDIR)/man5 - mkdir -p $(DESTDIR)$(MANDIR)/man8 - ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_APROPOS) - ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/$(BINM_WHATIS) - ln -f $(DESTDIR)$(BINDIR)/mandoc \ - $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS) - $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 - ln -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1 \ - $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1 - $(INSTALL_MAN) mansearch.3 $(DESTDIR)$(MANDIR)/man3 - $(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5 $(INSTALL_MAN) makewhatis.8 \ $(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8 +lib-install: base-build + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h roff.h \ + $(DESTDIR)$(INCLUDEDIR) + $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ + mansearch.3 mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 + cgi-install: cgi-build mkdir -p $(DESTDIR)$(CGIBINDIR) mkdir -p $(DESTDIR)$(HTDOCDIR) Modified: head/contrib/mdocml/Makefile.depend ============================================================================== --- head/contrib/mdocml/Makefile.depend Sat Jan 21 13:02:53 2017 (r312592) +++ head/contrib/mdocml/Makefile.depend Sat Jan 21 13:17:25 2017 (r312593) @@ -10,7 +10,6 @@ compat_mkdtemp.o: compat_mkdtemp.c confi compat_ohash.o: compat_ohash.c config.h compat_ohash.h compat_progname.o: compat_progname.c config.h compat_reallocarray.o: compat_reallocarray.c config.h -compat_sqlite3_errstr.o: compat_sqlite3_errstr.c config.h compat_strcasestr.o: compat_strcasestr.c config.h compat_stringlist.o: compat_stringlist.c config.h compat_stringlist.h compat_strlcat.o: compat_strlcat.c config.h @@ -18,6 +17,12 @@ compat_strlcpy.o: compat_strlcpy.c confi compat_strsep.o: compat_strsep.c config.h compat_strtonum.o: compat_strtonum.c config.h compat_vasprintf.o: compat_vasprintf.c config.h +dba.o: dba.c config.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mansearch.h dba_write.h dba_array.h dba.h +dba_array.o: dba_array.c mandoc_aux.h dba_write.h dba_array.h +dba_read.o: dba_read.c mandoc_aux.h mansearch.h dba_array.h dba.h dbm.h +dba_write.o: dba_write.c config.h dba_write.h +dbm.o: dbm.c config.h mansearch.h dbm_map.h dbm.h +dbm_map.o: dbm_map.c config.h mansearch.h dbm_map.h dbm.h demandoc.o: demandoc.c config.h roff.h man.h mdoc.h mandoc.h eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h @@ -26,7 +31,7 @@ html.o: html.c config.h mandoc.h mandoc_ lib.o: lib.c config.h roff.h mdoc.h libmdoc.h lib.in main.o: main.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h tag.h main.h manconf.h mansearch.h man.o: man.c config.h mandoc_aux.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h -man_hash.o: man_hash.c config.h roff.h man.h libman.h +man_hash.o: man_hash.c config.h mandoc.h roff.h man.h libmandoc.h libman.h man_html.o: man_html.c config.h mandoc_aux.h roff.h man.h out.h html.h main.h man_macro.o: man_macro.c config.h mandoc.h roff.h man.h libmandoc.h roff_int.h libman.h man_term.o: man_term.c config.h mandoc_aux.h mandoc.h roff.h man.h out.h term.h main.h @@ -34,14 +39,13 @@ man_validate.o: man_validate.c config.h mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h mandoc_ohash.o: mandoc_ohash.c mandoc_aux.h mandoc_ohash.h compat_ohash.h -mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h +mandocdb.o: mandocdb.c config.h compat_fts.h mandoc_aux.h mandoc_ohash.h compat_ohash.h mandoc.h roff.h mdoc.h man.h manconf.h mansearch.h dba_array.h dba.h manpage.o: manpage.c config.h manconf.h mansearch.h manpath.o: manpath.c config.h mandoc_aux.h manconf.h -mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h -mansearch_const.o: mansearch_const.c config.h mansearch.h +mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h mandoc_ohash.h compat_ohash.h manconf.h mansearch.h dbm.h mdoc.o: mdoc.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h -mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h -mdoc_hash.o: mdoc_hash.c config.h roff.h mdoc.h libmdoc.h +mdoc_argv.o: mdoc_argv.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h +mdoc_hash.o: mdoc_hash.c config.h mandoc.h roff.h mdoc.h libmandoc.h libmdoc.h mdoc_html.o: mdoc_html.c config.h mandoc_aux.h roff.h mdoc.h out.h html.h main.h mdoc_macro.o: mdoc_macro.c config.h mandoc.h roff.h mdoc.h libmandoc.h roff_int.h libmdoc.h mdoc_man.o: mdoc_man.c config.h mandoc_aux.h mandoc.h roff.h mdoc.h man.h out.h main.h Modified: head/contrib/mdocml/TODO ============================================================================== --- head/contrib/mdocml/TODO Sat Jan 21 13:02:53 2017 (r312592) +++ head/contrib/mdocml/TODO Sat Jan 21 13:17:25 2017 (r312593) @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.218 2016/06/05 21:06:04 schwarze Exp $ +* $Id: TODO,v 1.223 2017/01/17 15:32:43 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: @@ -33,15 +33,6 @@ Obviously, as the issues have not been s are mere guesses, and some may be wrong. ************************************************************************ -* crashes -************************************************************************ - -- The abort() in bufcat(), html.c, can be triggered via buffmt_includes() - by running -Thtml -Oincludes on a file containing a long .In argument. - Fixing this will probably require reworking the whole bufcat() concept. - loc ** exist * algo * size ** imp ** - -************************************************************************ * missing features ************************************************************************ @@ -213,6 +204,13 @@ are mere guesses, and some may be wrong. synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 loc ** exist ** algo ** size ** imp *** +- break long text into lines inside cells + net/lftp(1) from jirib via bentley@ Sep 13, 2016 + +- layout l1 for a column of max text width 3 reduces the following + inter-column spacing for groff, but not for mandoc + net/lftp(1) from jirib via bentley@ Sep 13, 2016 + - the "w" layout option is ignored synaptics(4) found by tedu@ Mon, 17 Aug 2015 21:17:42 -0400 loc * exist * algo * size * imp ** @@ -529,16 +527,6 @@ are mere guesses, and some may be wrong. loc ** exist ** algo ** size * imp ** ************************************************************************ -* portability -************************************************************************ - -- systems having UTF-8 but not en_US.UTF-8 - call locale(1) from ./configure, select a UTF-8-locale, - and use that for test-wchar.c and term_ascii.c - to Markus Waldeck Sat, 18 Jul 2015 01:55:37 +0200 - loc * exist * algo * size * imp * - -************************************************************************ * warning issues ************************************************************************ @@ -612,7 +600,6 @@ are mere guesses, and some may be wrong. ************************************************************************ - Why are we using MAP_SHARED, not MAP_PRIVATE for mmap(2)? - How does SQLITE_CONFIG_PAGECACHE actually work? Document it! from kristaps@ Sat, 09 Aug 2014 13:51:36 +0200 Several areas can be cleaned up to make mandoc even faster. These are @@ -631,6 +618,13 @@ Several areas can be cleaned up to make * structural issues ************************************************************************ +- POSIX says in the documentation of sysconf(3) that PATH_MAX + is allowed to be so large that it is a bad idea to use it + for sizing static buffers. So use dynamic buffers throughout. + See the file test-PATH_MAX.c for details. + Found by Aaron M. Ucko in the GNU Hurd via Bdale Garbee, + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829624 + - We use the input line number at several places to distinguish same-line from different-line input. That plainly doesn't work with user-defined macros, leading to random breakage. @@ -646,11 +640,6 @@ Several areas can be cleaned up to make - struct mparse refactoring Steffen Nurpmeso Thu, 04 Sep 2014 12:50:00 +0200 -- Consider creating some views that will make the database more - readable from the sqlite3 shell. Consider using them to - abstract from the database structure, too. - suggested by espie@ Sat, 19 Apr 2014 14:52:57 +0200 - ************************************************************************ * CGI issues ************************************************************************ Modified: head/contrib/mdocml/cgi.c ============================================================================== --- head/contrib/mdocml/cgi.c Sat Jan 21 13:02:53 2017 (r312592) +++ head/contrib/mdocml/cgi.c Sat Jan 21 13:17:25 2017 (r312593) @@ -1,7 +1,7 @@ -/* $Id: cgi.c,v 1.135 2016/07/11 22:48:37 schwarze Exp $ */ +/* $Id: cgi.c,v 1.144 2017/01/21 01:20:31 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons - * Copyright (c) 2014, 2015, 2016 Ingo Schwarze + * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -113,17 +113,18 @@ static const char *const sec_names[] = { static const int sec_MAX = sizeof(sec_names) / sizeof(char *); static const char *const arch_names[] = { - "amd64", "alpha", "armish", "armv7", - "hppa", "hppa64", "i386", "landisk", + "amd64", "alpha", "armv7", + "hppa", "i386", "landisk", "loongson", "luna88k", "macppc", "mips64", - "octeon", "sgi", "socppc", "sparc", - "sparc64", "zaurus", - "amiga", "arc", "arm32", "atari", - "aviion", "beagle", "cats", "hp300", + "octeon", "sgi", "socppc", "sparc64", + "amiga", "arc", "armish", "arm32", + "atari", "aviion", "beagle", "cats", + "hppa64", "hp300", "ia64", "mac68k", "mvme68k", "mvme88k", "mvmeppc", "palm", "pc532", "pegasos", - "pmax", "powerpc", "solbourne", "sun3", - "vax", "wgrisc", "x68k" + "pmax", "powerpc", "solbourne", "sparc", + "sun3", "vax", "wgrisc", "x68k", + "zaurus" }; static const int arch_MAX = sizeof(arch_names) / sizeof(char *); @@ -137,7 +138,7 @@ html_putchar(char c) switch (c) { case ('"'): - printf(""e;"); + printf("""); break; case ('&'): printf("&"); @@ -337,6 +338,7 @@ resp_copy(const char *filename) fflush(stdout); while ((sz = read(fd, buf, sizeof(buf))) > 0) write(STDOUT_FILENO, buf, sz); + close(fd); } } @@ -349,13 +351,12 @@ resp_begin_html(int code, const char *ms printf("\n" "\n" "\n" - "\n" - "\n" + " \n" - "%s\n" + " %s\n" "\n" - "\n" - "\n", + "\n", CSS_DIR, CUSTOMIZE_TITLE); resp_copy(MAN_DIR "/header.html"); @@ -376,16 +377,14 @@ resp_searchform(const struct req *req, e { int i; - puts(""); - printf("
\n" - "
\n" - "
\n" - "Manual Page Search Parameters\n", + printf("\n" + "
\n" + " Manual Page Search Parameters\n", scriptname); /* Write query input box. */ - printf("q.query != NULL) html_print(req->q.query); printf( "\" size=\"40\""); @@ -395,45 +394,46 @@ resp_searchform(const struct req *req, e /* Write submission buttons. */ - printf( "\n" - "\n
\n"); + " \n" + "
\n"); /* Write section selector. */ - puts(""); for (i = 0; i < sec_MAX; i++) { - printf("\n", sec_names[i]); } - puts(""); + puts(" "); /* Write architecture selector. */ - printf( ""); + puts(" "); /* Write manpath selector. */ if (req->psz > 1) { - puts(""); for (i = 0; i < (int)req->psz; i++) { - printf(""); } - puts(""); + puts(" "); } - puts("
\n" - "\n" - "
"); - puts(""); + puts(" \n" + ""); } static int @@ -496,9 +494,9 @@ pg_index(const struct req *req) resp_searchform(req, FOCUS_QUERY); printf("

\n" "This web interface is documented in the\n" - "man.cgi(8)\n" + "man.cgi(8)\n" "manual, and the\n" - "apropos(1)\n" + "apropos(1)\n" "manual explains the query syntax.\n" "

\n", scriptname, *scriptname == '\0' ? "" : "/", @@ -578,27 +576,21 @@ pg_searchres(const struct req *req, stru req->q.equal || sz == 1 ? FOCUS_NONE : FOCUS_QUERY); if (sz > 1) { - puts("
"); - puts(""); - + puts("
"); for (i = 0; i < sz; i++) { - printf("\n" - "\n" - "\n" + " \n" - ""); + puts("\n" + " "); } - - puts("
\n" - "\n" + " " + "", scriptname, *scriptname == '\0' ? "" : "/", req->q.manpath, r[i].file); - printf("\">"); html_print(r[i].names); - printf("\n" - ""); + printf(""); html_print(r[i].output); - puts("
\n" - "
"); + puts(""); } /* @@ -800,7 +792,8 @@ resp_format(const struct req *req, const } mchars_alloc(); - mp = mparse_alloc(MPARSE_SO, MANDOCLEVEL_BADARG, NULL, req->q.manpath); + mp = mparse_alloc(MPARSE_SO | MPARSE_UTF8 | MPARSE_LATIN1, + MANDOCLEVEL_BADARG, NULL, req->q.manpath); mparse_readfd(mp, fd, file); close(fd); Modified: head/contrib/mdocml/compat_fts.c ============================================================================== --- head/contrib/mdocml/compat_fts.c Sat Jan 21 13:02:53 2017 (r312592) +++ head/contrib/mdocml/compat_fts.c Sat Jan 21 13:17:25 2017 (r312593) @@ -6,8 +6,8 @@ int dummy; #else -/* $Id: compat_fts.c,v 1.9 2015/03/18 19:29:48 schwarze Exp $ */ -/* $OpenBSD: fts.c,v 1.50 2015/01/16 16:48:51 deraadt Exp $ */ +/* $Id: compat_fts.c,v 1.12 2016/10/18 23:58:12 schwarze Exp $ */ +/* $OpenBSD: fts.c,v 1.56 2016/09/21 04:38:56 guenther Exp $ */ /*- * Copyright (c) 1990, 1993, 1994 @@ -59,6 +59,7 @@ static void fts_load(FTS *, FTSENT *); static size_t fts_maxarglen(char * const *); static void fts_padjust(FTS *, FTSENT *); static int fts_palloc(FTS *, size_t); +static FTSENT *fts_sort(FTS *, FTSENT *, int); static unsigned short fts_stat(FTS *, FTSENT *); #define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2]))) @@ -68,19 +69,22 @@ static unsigned short fts_stat(FTS *, F #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif #define CLR(opt) (sp->fts_options &= ~(opt)) #define ISSET(opt) (sp->fts_options & (opt)) #define SET(opt) (sp->fts_options |= (opt)) FTS * -fts_open(char * const *argv, int options, void *dummy) +fts_open(char * const *argv, int options, + int (*compar)(const FTSENT **, const FTSENT **)) { FTS *sp; FTSENT *p, *root; int nitems; FTSENT *parent, *tmp; - size_t len; /* Options check. */ if (options & ~FTS_OPTIONMASK) { @@ -88,9 +92,16 @@ fts_open(char * const *argv, int options return (NULL); } + /* At least one path must be specified. */ + if (*argv == NULL) { + errno = EINVAL; + return (NULL); + } + /* Allocate/initialize the stream */ if ((sp = calloc(1, sizeof(FTS))) == NULL) return (NULL); + sp->fts_compar = compar; sp->fts_options = options; /* @@ -107,13 +118,7 @@ fts_open(char * const *argv, int options /* Allocate/initialize root(s). */ for (root = NULL, nitems = 0; *argv; ++argv, ++nitems) { - /* Don't allow zero-length paths. */ - if ((len = strlen(*argv)) == 0) { - errno = ENOENT; - goto mem3; - } - - if ((p = fts_alloc(sp, *argv, len)) == NULL) + if ((p = fts_alloc(sp, *argv, strlen(*argv))) == NULL) goto mem3; p->fts_level = FTS_ROOTLEVEL; p->fts_parent = parent; @@ -124,14 +129,25 @@ fts_open(char * const *argv, int options if (p->fts_info == FTS_DOT) p->fts_info = FTS_D; - p->fts_link = NULL; - if (root == NULL) - tmp = root = p; - else { - tmp->fts_link = p; - tmp = p; + /* + * If comparison routine supplied, traverse in sorted + * order; otherwise traverse in the order specified. + */ + if (compar) { + p->fts_link = root; + root = p; + } else { + p->fts_link = NULL; + if (root == NULL) + tmp = root = p; + else { + tmp->fts_link = p; + tmp = p; + } } } + if (compar && nitems > 1) + root = fts_sort(sp, root, nitems); /* * Allocate a dummy pointer and make fts_read think that we've just @@ -201,6 +217,7 @@ fts_close(FTS *sp) /* Free up child linked list, sort array, path buffer, stream ptr.*/ if (sp->fts_child) fts_lfree(sp->fts_child); + free(sp->fts_array); free(sp->fts_path); free(sp); @@ -317,7 +334,6 @@ name: t = sp->fts_path + NAPPEND(p->fts * semantics to fts using fts_set. An error return is allowed for similar * reasons. */ -/* ARGSUSED */ int fts_set(FTS *sp, FTSENT *p, int instr) { @@ -416,8 +432,7 @@ fts_build(FTS *sp) * structures already allocated. */ mem1: saved_errno = errno; - if (p) - free(p); + free(p); fts_lfree(head); (void)closedir(dirp); cur->fts_info = FTS_ERR; @@ -490,6 +505,10 @@ mem1: saved_errno = errno; cur->fts_info = FTS_DP; return (NULL); } + + /* Sort the entries. */ + if (sp->fts_compar && nitems > 1) + head = fts_sort(sp, head, nitems); return (head); } @@ -547,6 +566,40 @@ fts_stat(FTS *sp, FTSENT *p) } static FTSENT * +fts_sort(FTS *sp, FTSENT *head, int nitems) +{ + FTSENT **ap, *p; + + /* + * Construct an array of pointers to the structures and call qsort(3). + * Reassemble the array in the order returned by qsort. If unable to + * sort for memory reasons, return the directory entries in their + * current order. Allocate enough space for the current needs plus + * 40 so don't realloc one entry at a time. + */ + if (nitems > sp->fts_nitems) { + struct _ftsent **a; + + sp->fts_nitems = nitems + 40; + if ((a = reallocarray(sp->fts_array, + sp->fts_nitems, sizeof(FTSENT *))) == NULL) { + free(sp->fts_array); + sp->fts_array = NULL; + sp->fts_nitems = 0; + return (head); + } + sp->fts_array = a; + } + for (ap = sp->fts_array, p = head; p; p = p->fts_link) + *ap++ = p; + qsort(sp->fts_array, nitems, sizeof(FTSENT *), sp->fts_compar); + for (head = *(ap = sp->fts_array); --nitems; ++ap) + ap[0]->fts_link = ap[1]; + ap[0]->fts_link = NULL; + return (head); +} + +static FTSENT * fts_alloc(FTS *sp, const char *name, size_t namelen) { FTSENT *p; @@ -597,8 +650,7 @@ fts_palloc(FTS *sp, size_t more) */ more += 256; if (sp->fts_pathlen + more < sp->fts_pathlen) { - if (sp->fts_path) - free(sp->fts_path); + free(sp->fts_path); sp->fts_path = NULL; errno = ENAMETOOLONG; return (1); @@ -606,8 +658,7 @@ fts_palloc(FTS *sp, size_t more) sp->fts_pathlen += more; p = realloc(sp->fts_path, sp->fts_pathlen); if (p == NULL) { - if (sp->fts_path) - free(sp->fts_path); + free(sp->fts_path); sp->fts_path = NULL; return (1); } Modified: head/contrib/mdocml/compat_fts.h ============================================================================== --- head/contrib/mdocml/compat_fts.h Sat Jan 21 13:02:53 2017 (r312592) +++ head/contrib/mdocml/compat_fts.h Sat Jan 21 13:17:25 2017 (r312593) @@ -38,9 +38,12 @@ typedef struct { struct _ftsent *fts_cur; /* current node */ struct _ftsent *fts_child; /* linked list of children */ + struct _ftsent **fts_array; /* sort array */ dev_t fts_dev; /* starting device # */ char *fts_path; /* path for this descent */ size_t fts_pathlen; /* sizeof(path) */ + int fts_nitems; /* elements in the sort array */ + int (*fts_compar)(); /* compare function */ #define FTS_NOCHDIR 0x0004 /* don't change directories */ #define FTS_PHYSICAL 0x0010 /* physical walk */ @@ -94,7 +97,8 @@ typedef struct _ftsent { int fts_close(FTS *); -FTS *fts_open(char * const *, int, void *); +FTS *fts_open(char * const *, int, + int (*)(const FTSENT **, const FTSENT **)); FTSENT *fts_read(FTS *); int fts_set(FTS *, FTSENT *, int); Modified: head/contrib/mdocml/config.h ============================================================================== --- head/contrib/mdocml/config.h Sat Jan 21 13:02:53 2017 (r312592) +++ head/contrib/mdocml/config.h Sat Jan 21 13:17:25 2017 (r312593) @@ -2,30 +2,33 @@ #error "Do not use C++. See the INSTALL file." #endif -#ifndef MANDOC_CONFIG_H -#define MANDOC_CONFIG_H +#if !defined(__GNUC__) || (__GNUC__ < 4) +#define __attribute__(x) +#endif #if defined(__linux__) || defined(__MINT__) #define _GNU_SOURCE /* See test-*.c what needs this. */ #endif -#include -#include #define MAN_CONF_FILE "/etc/man.conf" +#define MANPATH_DEFAULT "/usr/share/man:/usr/local/man" +#define UTF8_LOCALE "en_US.UTF-8" #define HAVE_DIRENT_NAMLEN 1 +#define HAVE_ENDIAN 0 #define HAVE_ERR 1 #define HAVE_FTS 1 #define HAVE_GETLINE 1 #define HAVE_GETSUBOPT 1 #define HAVE_ISBLANK 1 #define HAVE_MKDTEMP 1 -#define HAVE_MMAP 1 +#define HAVE_NTOHL 1 #define HAVE_PLEDGE 0 #define HAVE_PROGNAME 1 #define HAVE_REALLOCARRAY 1 -#define HAVE_REWB_BSD 0 -#define HAVE_REWB_SYSV 0 +#define HAVE_REWB_BSD 1 +#define HAVE_REWB_SYSV 1 +#define HAVE_SANDBOX_INIT 0 #define HAVE_STRCASESTR 1 #define HAVE_STRINGLIST 1 #define HAVE_STRLCAT 1 @@ -33,20 +36,14 @@ #define HAVE_STRPTIME 1 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Jan 21 13:17:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F5EDCB9DE6; Sat, 21 Jan 2017 13:17:55 +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 D02B51905; Sat, 21 Jan 2017 13:17:54 +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 v0LDHruV037003; Sat, 21 Jan 2017 13:17:53 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LDHrRA037002; Sat, 21 Jan 2017 13:17:53 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201701211317.v0LDHrRA037002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Sat, 21 Jan 2017 13:17:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r312594 - 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: Sat, 21 Jan 2017 13:17:55 -0000 Author: matthew (ports committer) Date: Sat Jan 21 13:17:53 2017 New Revision: 312594 URL: https://svnweb.freebsd.org/changeset/base/312594 Log: Take in commit bits for the following nine people who have been inactive for more than 18 months and have agreed they are unlikely to begin contributing again in the near future. bschmidt Bernhard Schmidt dmarion Damjan Marion ghelmer Guy Helmer jfv Jack Vogel jh Jaakko Heinonen kensmith Ken Smith rmh Robert Millan trociny Mikolaj Golub versus Konrad Jankowski We wish them well in their future endeavors and hope to see them return to FreeBSD development in the future. Approved by: core (implicit) Modified: svnadmin/conf/access Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sat Jan 21 13:17:25 2017 (r312593) +++ svnadmin/conf/access Sat Jan 21 13:17:53 2017 (r312594) @@ -49,7 +49,6 @@ br brooks brueffer bryanv -bschmidt bz cem charnier @@ -71,7 +70,6 @@ des dexuan dfr dim -dmarion dteske dumbbell dwmalone dwmalone=freebsd-committers@maths.tcd.ie @@ -90,7 +88,6 @@ gad gallatin ganbold gavin -ghelmer gibbs gjb glebius @@ -114,8 +111,6 @@ jceel jch jchandra jeff -jfv -jh jhay jhb jhibbits @@ -139,7 +134,6 @@ kaiw kan karels ken -kensmith kevlo kib kp @@ -194,7 +188,6 @@ raj ray remko rmacklem -rmh rnoland roberto rodrigc @@ -232,7 +225,6 @@ thompsa tijl torek trasz -trociny truckman tsoome tuexen @@ -242,7 +234,6 @@ ups ups_old@stups.com uqs vangyzen venkat -versus whu will wkoszek From owner-svn-src-all@freebsd.org Sat Jan 21 13:25:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1E25CBB272; Sat, 21 Jan 2017 13:25:58 +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 C1978111C; Sat, 21 Jan 2017 13:25:58 +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 v0LDPvPY041339; Sat, 21 Jan 2017 13:25:57 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LDPvAi041338; Sat, 21 Jan 2017 13:25:57 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201701211325.v0LDPvAi041338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Sat, 21 Jan 2017 13:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r312595 - 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: Sat, 21 Jan 2017 13:25:59 -0000 Author: matthew (ports committer) Date: Sat Jan 21 13:25:57 2017 New Revision: 312595 URL: https://svnweb.freebsd.org/changeset/base/312595 Log: versus has given up his commit bit, so it makes no sense to have him under mentorship. Approved by: core (implicit) Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sat Jan 21 13:17:53 2017 (r312594) +++ svnadmin/conf/mentors Sat Jan 21 13:25:57 2017 (r312595) @@ -40,4 +40,3 @@ stevek sjg torek rpaulo tsoome allanjude Co-mentor: imp venkat delphij Co-mentor: luigi, jhb -versus gavin Co-mentor: fjoe From owner-svn-src-all@freebsd.org Sat Jan 21 14:19:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D445CBBF2D; Sat, 21 Jan 2017 14:19:08 +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 57D22CC7; Sat, 21 Jan 2017 14:19:08 +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 v0LEJ7df063381; Sat, 21 Jan 2017 14:19:07 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LEJ67H063374; Sat, 21 Jan 2017 14:19:06 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701211419.v0LEJ67H063374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 21 Jan 2017 14:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312596 - in head: sbin/ifconfig 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, 21 Jan 2017 14:19:08 -0000 Author: avos Date: Sat Jan 21 14:19:06 2017 New Revision: 312596 URL: https://svnweb.freebsd.org/changeset/base/312596 Log: net80211: allow to configure LDPC support Tested with RTL8821AU, STA mode (Tx support only) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D9268 Modified: head/sbin/ifconfig/ifieee80211.c head/sys/net80211/_ieee80211.h head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_ht.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_node.h head/sys/net80211/ieee80211_var.h Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sat Jan 21 13:25:57 2017 (r312595) +++ head/sbin/ifconfig/ifieee80211.c Sat Jan 21 14:19:06 2017 (r312596) @@ -1787,6 +1787,21 @@ set80211stbc(const char *val, int d, int set80211(s, IEEE80211_IOC_STBC, stbc, 0, NULL); } +static void +set80211ldpc(const char *val, int d, int s, const struct afswtch *rafp) +{ + int ldpc; + + if (get80211val(s, IEEE80211_IOC_LDPC, &ldpc) < 0) + errx(-1, "cannot set LDPC setting"); + if (d < 0) { + d = -d; + ldpc &= ~d; + } else + ldpc |= d; + set80211(s, IEEE80211_IOC_LDPC, ldpc, 0, NULL); +} + static DECL_CMD_FUNC(set80211ampdulimit, val, d) { @@ -5030,6 +5045,23 @@ end: break; } } + if (get80211val(s, IEEE80211_IOC_LDPC, &val) != -1) { + switch (val) { + case 0: + LINE_CHECK("-ldpc"); + break; + case 1: + LINE_CHECK("ldpctx -ldpcrx"); + break; + case 2: + LINE_CHECK("-ldpctx ldpcrx"); + break; + case 3: + if (verbose) + LINE_CHECK("ldpc"); + break; + } + } } if (IEEE80211_IS_CHAN_VHT(c) || verbose) { @@ -5603,6 +5635,12 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("-stbctx", -1, set80211stbc), DEF_CMD("stbc", 3, set80211stbc), /* NB: tx+rx */ DEF_CMD("-stbc", -3, set80211stbc), + DEF_CMD("ldpcrx", 2, set80211ldpc), + DEF_CMD("-ldpcrx", -2, set80211ldpc), + DEF_CMD("ldpctx", 1, set80211ldpc), + DEF_CMD("-ldpctx", -1, set80211ldpc), + DEF_CMD("ldpc", 3, set80211ldpc), /* NB: tx+rx */ + DEF_CMD("-ldpc", -3, set80211ldpc), DEF_CMD("puren", 1, set80211puren), DEF_CMD("-puren", 0, set80211puren), DEF_CMD("doth", 1, set80211doth), Modified: head/sys/net80211/_ieee80211.h ============================================================================== --- head/sys/net80211/_ieee80211.h Sat Jan 21 13:25:57 2017 (r312595) +++ head/sys/net80211/_ieee80211.h Sat Jan 21 14:19:06 2017 (r312596) @@ -517,9 +517,10 @@ struct ieee80211_mimo_info { #define IEEE80211_HTC_RXMCS32 0x00400000 /* CAPABILITY: MCS32 support */ #define IEEE80211_HTC_TXUNEQUAL 0x00800000 /* CAPABILITY: TX unequal MCS */ #define IEEE80211_HTC_TXMCS32 0x01000000 /* CAPABILITY: MCS32 support */ +#define IEEE80211_HTC_TXLDPC 0x02000000 /* CAPABILITY: TX using LDPC */ #define IEEE80211_C_HTCAP_BITS \ "\20\1LDPC\2CHWIDTH40\5GREENFIELD\6SHORTGI20\7SHORTGI40\10TXSTBC" \ - "\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS" + "\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS\32TXLDPC" #endif /* _NET80211__IEEE80211_H_ */ Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Sat Jan 21 13:25:57 2017 (r312595) +++ head/sys/net80211/ieee80211.h Sat Jan 21 14:19:06 2017 (r312596) @@ -617,7 +617,7 @@ struct ieee80211_ie_htcap { } __packed; /* HT capability flags (ht_cap) */ -#define IEEE80211_HTCAP_LDPC 0x0001 /* LDPC supported */ +#define IEEE80211_HTCAP_LDPC 0x0001 /* LDPC rx supported */ #define IEEE80211_HTCAP_CHWIDTH40 0x0002 /* 20/40 supported */ #define IEEE80211_HTCAP_SMPS 0x000c /* SM Power Save mode */ #define IEEE80211_HTCAP_SMPS_OFF 0x000c /* disabled */ Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sat Jan 21 13:25:57 2017 (r312595) +++ head/sys/net80211/ieee80211_ht.c Sat Jan 21 14:19:06 2017 (r312596) @@ -298,6 +298,11 @@ ieee80211_ht_vattach(struct ieee80211vap vap->iv_flags_ht |= IEEE80211_FHT_STBC_TX; if (vap->iv_htcaps & IEEE80211_HTCAP_RXSTBC) vap->iv_flags_ht |= IEEE80211_FHT_STBC_RX; + + if (vap->iv_htcaps & IEEE80211_HTCAP_LDPC) + vap->iv_flags_ht |= IEEE80211_FHT_LDPC_RX; + if (vap->iv_htcaps & IEEE80211_HTC_TXLDPC) + vap->iv_flags_ht |= IEEE80211_FHT_LDPC_TX; } /* NB: disable default legacy WDS, too many issues right now */ if (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) @@ -1650,6 +1655,20 @@ htcap_update_shortgi(struct ieee80211_no } /* + * Update LDPC state according to received htcap + * and local settings. + */ +static __inline void +htcap_update_ldpc(struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = ni->ni_vap; + + if ((ni->ni_htcap & IEEE80211_HTCAP_LDPC) && + (vap->iv_flags_ht & IEEE80211_FHT_LDPC_TX)) + ni->ni_flags |= IEEE80211_NODE_LDPC; +} + +/* * Parse and update HT-related state extracted from * the HT cap and info ie's. * @@ -1669,6 +1688,7 @@ ieee80211_ht_updateparams(struct ieee802 if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS) htcap_update_mimo_ps(ni); htcap_update_shortgi(ni); + htcap_update_ldpc(ni); if (htinfoie[0] == IEEE80211_ELEMID_VENDOR) htinfoie += 4; @@ -1821,6 +1841,7 @@ ieee80211_ht_updatehtcap(struct ieee8021 if (vap->iv_htcaps & IEEE80211_HTCAP_SMPS) htcap_update_mimo_ps(ni); htcap_update_shortgi(ni); + htcap_update_ldpc(ni); } /* @@ -3027,7 +3048,9 @@ ieee80211_add_htcap_body(uint8_t *frm, s if ((vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) == 0) caps &= ~IEEE80211_HTCAP_RXSTBC; - /* XXX TODO: adjust LDPC based on receive capabilities */ + /* adjust LDPC based on receive capabilites */ + if ((vap->iv_flags_ht & IEEE80211_FHT_LDPC_RX) == 0) + caps &= ~IEEE80211_HTCAP_LDPC; ADDSHORT(frm, caps); Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sat Jan 21 13:25:57 2017 (r312595) +++ head/sys/net80211/ieee80211_ioctl.c Sat Jan 21 14:19:06 2017 (r312596) @@ -1136,6 +1136,13 @@ ieee80211_ioctl_get80211(struct ieee8021 if (vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) ireq->i_val |= 2; break; + case IEEE80211_IOC_LDPC: + ireq->i_val = 0; + if (vap->iv_flags_ht & IEEE80211_FHT_LDPC_TX) + ireq->i_val |= 1; + if (vap->iv_flags_ht & IEEE80211_FHT_LDPC_RX) + ireq->i_val |= 2; + break; /* VHT */ case IEEE80211_IOC_VHTCONF: @@ -3372,6 +3379,31 @@ ieee80211_ioctl_set80211(struct ieee8021 if (isvapht(vap)) error = ERESTART; break; + case IEEE80211_IOC_LDPC: + /* Check if we can do LDPC TX/RX before changing the setting */ + if ((ireq->i_val & 1) && + (vap->iv_htcaps & IEEE80211_HTC_TXLDPC) == 0) + return EOPNOTSUPP; + if ((ireq->i_val & 2) && + (vap->iv_htcaps & IEEE80211_HTCAP_LDPC) == 0) + return EOPNOTSUPP; + + /* TX */ + if (ireq->i_val & 1) + vap->iv_flags_ht |= IEEE80211_FHT_LDPC_TX; + else + vap->iv_flags_ht &= ~IEEE80211_FHT_LDPC_TX; + + /* RX */ + if (ireq->i_val & 2) + vap->iv_flags_ht |= IEEE80211_FHT_LDPC_RX; + else + vap->iv_flags_ht &= ~IEEE80211_FHT_LDPC_RX; + + /* NB: reset only if we're operating on an 11n channel */ + if (isvapht(vap)) + error = ERESTART; + break; /* VHT */ case IEEE80211_IOC_VHTCONF: Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Sat Jan 21 13:25:57 2017 (r312595) +++ head/sys/net80211/ieee80211_node.h Sat Jan 21 14:19:06 2017 (r312596) @@ -143,6 +143,7 @@ struct ieee80211_node { #define IEEE80211_NODE_AMSDU_RX 0x040000 /* AMSDU rx enabled */ #define IEEE80211_NODE_AMSDU_TX 0x080000 /* AMSDU tx enabled */ #define IEEE80211_NODE_VHT 0x100000 /* VHT enabled */ +#define IEEE80211_NODE_LDPC 0x200000 /* LDPC enabled */ uint16_t ni_associd; /* association ID */ uint16_t ni_vlan; /* vlan tag */ uint16_t ni_txpower; /* current transmit power */ Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sat Jan 21 13:25:57 2017 (r312595) +++ head/sys/net80211/ieee80211_var.h Sat Jan 21 14:19:06 2017 (r312596) @@ -641,6 +641,8 @@ MALLOC_DECLARE(M_80211_VAP); /* ic_flags_ht/iv_flags_ht */ #define IEEE80211_FHT_NONHT_PR 0x00000001 /* STATUS: non-HT sta present */ +#define IEEE80211_FHT_LDPC_TX 0x00010000 /* CONF: LDPC tx enabled */ +#define IEEE80211_FHT_LDPC_RX 0x00020000 /* CONF: LDPC rx enabled */ #define IEEE80211_FHT_GF 0x00040000 /* CONF: Greenfield enabled */ #define IEEE80211_FHT_HT 0x00080000 /* CONF: HT supported */ #define IEEE80211_FHT_AMPDU_TX 0x00100000 /* CONF: A-MPDU tx supported */ From owner-svn-src-all@freebsd.org Sat Jan 21 15:03:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB2EACBBB57; Sat, 21 Jan 2017 15:03: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 85D757BC; Sat, 21 Jan 2017 15:03: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 v0LF3wcN084221; Sat, 21 Jan 2017 15:03:58 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LF3wtD084216; Sat, 21 Jan 2017 15:03:58 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701211503.v0LF3wtD084216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 21 Jan 2017 15:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312597 - in head/sys/dev/rtwn: . rtl8812a rtl8812a/usb rtl8821a/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, 21 Jan 2017 15:03:59 -0000 Author: avos Date: Sat Jan 21 15:03:58 2017 New Revision: 312597 URL: https://svnweb.freebsd.org/changeset/base/312597 Log: rtwn: enable LDPC support where possible Tested with RTL8821AU, STA mode. Modified: head/sys/dev/rtwn/if_rtwn.c head/sys/dev/rtwn/rtl8812a/r12a_rx.c head/sys/dev/rtwn/rtl8812a/r12a_tx.c head/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Sat Jan 21 14:19:06 2017 (r312596) +++ head/sys/dev/rtwn/if_rtwn.c Sat Jan 21 15:03:58 2017 (r312597) @@ -695,6 +695,7 @@ rtwn_ioctl_reset(struct ieee80211vap *va case IEEE80211_IOC_RTSTHRESHOLD: case IEEE80211_IOC_PROTMODE: case IEEE80211_IOC_HTPROTMODE: + case IEEE80211_IOC_LDPC: error = 0; break; default: Modified: head/sys/dev/rtwn/rtl8812a/r12a_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_rx.c Sat Jan 21 14:19:06 2017 (r312596) +++ head/sys/dev/rtwn/rtl8812a/r12a_rx.c Sat Jan 21 15:03:58 2017 (r312597) @@ -252,7 +252,9 @@ r12a_get_rx_stats(struct rtwn_softc *sc, rxdw4 = le32toh(stat->rxdw4); rate = MS(rxdw3, R12A_RXDW3_RATE); - /* TODO: STBC, LDPC */ + /* TODO: STBC */ + if (rxdw4 & R12A_RXDW4_LDPC) + rxs->c_pktflags |= IEEE80211_RX_F_LDPC; if (rxdw1 & R12A_RXDW1_AMPDU) { if (rxdw0 & R92C_RXDW0_PHYST) rxs->c_pktflags |= IEEE80211_RX_F_AMPDU; Modified: head/sys/dev/rtwn/rtl8812a/r12a_tx.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_tx.c Sat Jan 21 14:19:06 2017 (r312596) +++ head/sys/dev/rtwn/rtl8812a/r12a_tx.c Sat Jan 21 15:03:58 2017 (r312597) @@ -214,6 +214,17 @@ r12a_tx_set_sgi(struct rtwn_softc *sc, v txd->txdw5 |= htole32(R12A_TXDW5_DATA_SHORT); } +static void +r12a_tx_set_ldpc(struct rtwn_softc *sc, struct r12a_tx_desc *txd, + struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = ni->ni_vap; + + if ((vap->iv_flags_ht & IEEE80211_FHT_LDPC_TX) && + (ni->ni_htcap & IEEE80211_HTCAP_LDPC)) + txd->txdw5 |= htole32(R12A_TXDW5_DATA_LDPC); +} + void r12a_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m, void *buf, uint8_t ridx, int maxretry) @@ -284,6 +295,7 @@ r12a_fill_tx_desc(struct rtwn_softc *sc, if (ridx >= RTWN_RIDX_MCS(0)) { r12a_tx_set_ht40(sc, txd, ni); r12a_tx_set_sgi(sc, txd, ni); + r12a_tx_set_ldpc(sc, txd, ni); prot = ic->ic_htprotmode; } else if (ic->ic_flags & IEEE80211_F_USEPROT) prot = ic->ic_protmode; Modified: head/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c Sat Jan 21 14:19:06 2017 (r312596) +++ head/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c Sat Jan 21 15:03:58 2017 (r312597) @@ -168,7 +168,15 @@ r12a_read_chipid_vendor(struct rtwn_soft static void r12au_adj_devcaps(struct rtwn_softc *sc) { - /* TODO: LDPC, STBC etc */ + struct r12a_softc *rs = sc->sc_priv; + struct ieee80211com *ic = &sc->sc_ic; + + if (rs->chip & R12A_CHIP_C_CUT) { + ic->ic_htcaps |= IEEE80211_HTCAP_LDPC | + IEEE80211_HTC_TXLDPC; + } + + /* TODO: STBC, VHT etc */ } void Modified: head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c Sat Jan 21 14:19:06 2017 (r312596) +++ head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c Sat Jan 21 15:03:58 2017 (r312597) @@ -157,10 +157,11 @@ r21au_adj_devcaps(struct rtwn_softc *sc) struct ieee80211com *ic = &sc->sc_ic; struct r12a_softc *rs = sc->sc_priv; + ic->ic_htcaps |= IEEE80211_HTC_TXLDPC; if (rs->rs_radar != 0) ic->ic_caps |= IEEE80211_C_DFS; - /* TODO: LDPC etc */ + /* TODO: VHT */ } void From owner-svn-src-all@freebsd.org Sat Jan 21 16:59:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29785CBB45A; Sat, 21 Jan 2017 16:59:52 +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 ED5631FD2; Sat, 21 Jan 2017 16:59:51 +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 v0LGxpZd030786; Sat, 21 Jan 2017 16:59:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LGxpDr030785; Sat, 21 Jan 2017 16:59:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701211659.v0LGxpDr030785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 21 Jan 2017 16:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312598 - 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: Sat, 21 Jan 2017 16:59:52 -0000 Author: mjg Date: Sat Jan 21 16:59:50 2017 New Revision: 312598 URL: https://svnweb.freebsd.org/changeset/base/312598 Log: vfs: hide the getvnode NULL mp message behind DIAGNOSTIC Since crossmp vnode changes the message was being printed on each boot. Reported by: trasz Discussed with: kib Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat Jan 21 15:03:58 2017 (r312597) +++ head/sys/kern/vfs_subr.c Sat Jan 21 16:59:50 2017 (r312598) @@ -1489,12 +1489,14 @@ alloc: vp->v_op = vops; v_init_counters(vp); vp->v_bufobj.bo_ops = &buf_ops_bio; +#ifdef DIAGNOSTIC + if (mp == NULL && vops != &dead_vnodeops) + printf("NULL mp in getnewvnode()\n"); +#endif #ifdef MAC mac_vnode_init(vp); if (mp != NULL && (mp->mnt_flag & MNT_MULTILABEL) == 0) mac_vnode_associate_singlelabel(mp, vp); - else if (mp == NULL && vops != &dead_vnodeops) - printf("NULL mp in getnewvnode()\n"); #endif if (mp != NULL) { vp->v_bufobj.bo_bsize = mp->mnt_stat.f_iosize; From owner-svn-src-all@freebsd.org Sat Jan 21 17:39:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52ED7CBBFA3; Sat, 21 Jan 2017 17:39:12 +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 0909616F2; Sat, 21 Jan 2017 17:39:11 +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 v0LHdBC8048195; Sat, 21 Jan 2017 17:39:11 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LHdAjY048192; Sat, 21 Jan 2017 17:39:10 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201701211739.v0LHdAjY048192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sat, 21 Jan 2017 17:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312599 - 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: Sat, 21 Jan 2017 17:39:12 -0000 Author: cem Date: Sat Jan 21 17:39:10 2017 New Revision: 312599 URL: https://svnweb.freebsd.org/changeset/base/312599 Log: Add remaining ELF compression definitions and structs A follow-up to r300231. Sponsored by: Dell EMC Isilon Modified: head/sys/sys/elf32.h head/sys/sys/elf64.h head/sys/sys/elf_common.h Modified: head/sys/sys/elf32.h ============================================================================== --- head/sys/sys/elf32.h Sat Jan 21 16:59:50 2017 (r312598) +++ head/sys/sys/elf32.h Sat Jan 21 17:39:10 2017 (r312599) @@ -254,4 +254,10 @@ typedef struct { Elf32_Half si_flags; /* per symbol flags */ } Elf32_Syminfo; +typedef struct { + Elf32_Word ch_type; + Elf32_Word ch_size; + Elf32_Word ch_addralign; +} Elf32_Chdr; + #endif /* !_SYS_ELF32_H_ */ Modified: head/sys/sys/elf64.h ============================================================================== --- head/sys/sys/elf64.h Sat Jan 21 16:59:50 2017 (r312598) +++ head/sys/sys/elf64.h Sat Jan 21 17:39:10 2017 (r312599) @@ -257,4 +257,11 @@ typedef struct { Elf64_Half si_flags; /* per symbol flags */ } Elf64_Syminfo; +typedef struct { + Elf64_Word ch_type; + Elf64_Word ch_reserved; + Elf64_Xword ch_size; + Elf64_Xword ch_addralign; +} Elf64_Chdr; + #endif /* !_SYS_ELF64_H_ */ Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Sat Jan 21 16:59:50 2017 (r312598) +++ head/sys/sys/elf_common.h Sat Jan 21 17:39:10 2017 (r312599) @@ -849,6 +849,13 @@ typedef struct { #define SYMINFO_CURRENT 1 #define SYMINFO_NUM 2 +/* Values for ch_type (compressed section headers). */ +#define ELFCOMPRESS_ZLIB 1 /* ZLIB/DEFLATE */ +#define ELFCOMPRESS_LOOS 0x60000000 /* OS-specific */ +#define ELFCOMPRESS_HIOS 0x6fffffff +#define ELFCOMPRESS_LOPROC 0x70000000 /* Processor-specific */ +#define ELFCOMPRESS_HIPROC 0x7fffffff + /* * Relocation types. * From owner-svn-src-all@freebsd.org Sat Jan 21 17:51:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0E47CBB2D1 for ; Sat, 21 Jan 2017 17:51:02 +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 A763A1F98 for ; Sat, 21 Jan 2017 17:51:02 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 3a474350-e002-11e6-8c89-112185c90658 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 3a474350-e002-11e6-8c89-112185c90658; Sat, 21 Jan 2017 17:51:25 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v0LHosE9006761; Sat, 21 Jan 2017 10:50:54 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1485021054.34897.180.camel@freebsd.org> Subject: Re: svn commit: r312588 - head/sys/mips/conf From: Ian Lepore To: Konstantin Belousov , Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 21 Jan 2017 10:50:54 -0700 In-Reply-To: <20170121114120.GU2349@kib.kiev.ua> References: <201701210908.v0L98SQp033735@repo.freebsd.org> <20170121114120.GU2349@kib.kiev.ua> 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: Sat, 21 Jan 2017 17:51:02 -0000 On Sat, 2017-01-21 at 13:41 +0200, Konstantin Belousov wrote: > On Sat, Jan 21, 2017 at 09:08:28AM +0000, Brooks Davis wrote: > > > > +options  TMPFS #Efficient memory > > filesystem > Is the word 'efficient' copied from somewhere ? Yes, I see it in > sys/conf/NOTES. I do not see what useful meaning the word has there, > applied to the tmpfs. In my opinion, it should be removed from > comments. > Is it not more efficient than the alternatives based on md(4)? -- Ian From owner-svn-src-all@freebsd.org Sat Jan 21 18:13:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E592CBBAAD; Sat, 21 Jan 2017 18:13:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF4B7CF9; Sat, 21 Jan 2017 18:13:11 +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 v0LID6Yx045454 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 21 Jan 2017 20:13:06 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v0LID6Yx045454 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v0LID6G6045453; Sat, 21 Jan 2017 20:13:06 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 21 Jan 2017 20:13:06 +0200 From: Konstantin Belousov To: Ian Lepore Cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312588 - head/sys/mips/conf Message-ID: <20170121181306.GX2349@kib.kiev.ua> References: <201701210908.v0L98SQp033735@repo.freebsd.org> <20170121114120.GU2349@kib.kiev.ua> <1485021054.34897.180.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1485021054.34897.180.camel@freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) 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: Sat, 21 Jan 2017 18:13:12 -0000 On Sat, Jan 21, 2017 at 10:50:54AM -0700, Ian Lepore wrote: > On Sat, 2017-01-21 at 13:41 +0200, Konstantin Belousov wrote: > > On Sat, Jan 21, 2017 at 09:08:28AM +0000, Brooks Davis wrote: > > > > > > +optionsš TMPFS #Efficient memory > > > filesystem > > Is the word 'efficient' copied from somewhere ? Yes, I see it in > > sys/conf/NOTES. I do not see what useful meaning the word has there, > > applied to the tmpfs. In my opinion, it should be removed from > > comments. > > > > Is it not more efficient than the alternatives based on md(4)? If UFS on a swap-backed md(4) is configured without SU and with trim enabled, then it should be very similar to tmpfs. Even more similar if the UFS mount is sync. Except in the case when the files from such mount are mmaped, in which case UFS inherently performs double-copy. From owner-svn-src-all@freebsd.org Sat Jan 21 18:38:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 515BACBB103; Sat, 21 Jan 2017 18:38:18 +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 165A21A02; Sat, 21 Jan 2017 18:38:18 +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 v0LIcHwV072627; Sat, 21 Jan 2017 18:38:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LIcHIv072626; Sat, 21 Jan 2017 18:38:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701211838.v0LIcHIv072626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 21 Jan 2017 18:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312600 - 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: Sat, 21 Jan 2017 18:38:18 -0000 Author: mjg Date: Sat Jan 21 18:38:16 2017 New Revision: 312600 URL: https://svnweb.freebsd.org/changeset/base/312600 Log: vfs: refactor _vn_lock Stop testing for LK_RETRY and error multiple times. Also postpone the VI_DOOMED until after LK_RETRY was seen as it reads from the vnode. No functional changes. Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat Jan 21 17:39:10 2017 (r312599) +++ head/sys/kern/vfs_vnops.c Sat Jan 21 18:38:16 2017 (r312600) @@ -1539,27 +1539,24 @@ _vn_lock(struct vnode *vp, int flags, ch VNASSERT((flags & LK_TYPE_MASK) != 0, vp, ("vn_lock called with no locktype.")); - do { #ifdef DEBUG_VFS_LOCKS - KASSERT(vp->v_holdcnt != 0, - ("vn_lock %p: zero hold count", vp)); + KASSERT(vp->v_holdcnt != 0, + ("vn_lock %p: zero hold count", vp)); #endif - error = VOP_LOCK1(vp, flags, file, line); - flags &= ~LK_INTERLOCK; /* Interlock is always dropped. */ - KASSERT((flags & LK_RETRY) == 0 || error == 0, - ("LK_RETRY set with incompatible flags (0x%x) or an error occurred (%d)", - flags, error)); - /* - * Callers specify LK_RETRY if they wish to get dead vnodes. - * If RETRY is not set, we return ENOENT instead. - */ - if (error == 0 && vp->v_iflag & VI_DOOMED && - (flags & LK_RETRY) == 0) { +retry: + error = VOP_LOCK1(vp, flags, file, line); + flags &= ~LK_INTERLOCK; /* Interlock is always dropped. */ + KASSERT((flags & LK_RETRY) == 0 || error == 0, + ("LK_RETRY set with incompatible flags (0x%x) or an error occurred (%d)", + flags, error)); + if (flags & LK_RETRY) { + if ((error != 0)) + goto retry; + if ((vp->v_iflag & VI_DOOMED)) { VOP_UNLOCK(vp, 0); error = ENOENT; - break; } - } while (flags & LK_RETRY && error != 0); + } return (error); } From owner-svn-src-all@freebsd.org Sat Jan 21 18:56:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA2B9CBB72B; Sat, 21 Jan 2017 18:56:59 +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 7A15388D; Sat, 21 Jan 2017 18:56:59 +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 v0LIuwIo080823; Sat, 21 Jan 2017 18:56:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LIuwgM080819; Sat, 21 Jan 2017 18:56:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701211856.v0LIuwgM080819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 21 Jan 2017 18:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312601 - 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: Sat, 21 Jan 2017 18:56:59 -0000 Author: mjg Date: Sat Jan 21 18:56:58 2017 New Revision: 312601 URL: https://svnweb.freebsd.org/changeset/base/312601 Log: vfs: fix whitespace damage in r312600 While here wrap the previously overly long line so that it fits 80 chars. Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat Jan 21 18:38:16 2017 (r312600) +++ head/sys/kern/vfs_vnops.c Sat Jan 21 18:56:58 2017 (r312601) @@ -1547,8 +1547,8 @@ retry: error = VOP_LOCK1(vp, flags, file, line); flags &= ~LK_INTERLOCK; /* Interlock is always dropped. */ KASSERT((flags & LK_RETRY) == 0 || error == 0, - ("LK_RETRY set with incompatible flags (0x%x) or an error occurred (%d)", - flags, error)); + ("LK_RETRY set with incompatible flags (0x%x) or " + " an error occurred (%d)", flags, error)); if (flags & LK_RETRY) { if ((error != 0)) goto retry; From owner-svn-src-all@freebsd.org Sat Jan 21 19:01:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E55ACBB839; Sat, 21 Jan 2017 19:01:44 +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 E27CFCEB; Sat, 21 Jan 2017 19:01:43 +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 v0LJ1hgh081830; Sat, 21 Jan 2017 19:01:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LJ1hft081829; Sat, 21 Jan 2017 19:01:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701211901.v0LJ1hft081829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 21 Jan 2017 19:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312602 - 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: Sat, 21 Jan 2017 19:01:44 -0000 Author: mjg Date: Sat Jan 21 19:01:42 2017 New Revision: 312602 URL: https://svnweb.freebsd.org/changeset/base/312602 Log: vfs: __predict_false the need to handle F_HASLOCK Also reorder the check with DTYPE_VNODE. Passed files are vnodes vast majority of the time, so it is typically true. Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat Jan 21 18:56:58 2017 (r312601) +++ head/sys/kern/vfs_vnops.c Sat Jan 21 19:01:42 2017 (r312602) @@ -1575,12 +1575,12 @@ vn_closefile(fp, td) vp = fp->f_vnode; fp->f_ops = &badfileops; - if (fp->f_type == DTYPE_VNODE && fp->f_flag & FHASLOCK) - vref(vp); + if (__predict_false(fp->f_flag & FHASLOCK) && fp->f_type == DTYPE_VNODE) + vrefact(vp); error = vn_close(vp, fp->f_flag, fp->f_cred, td); - if (fp->f_type == DTYPE_VNODE && fp->f_flag & FHASLOCK) { + if (__predict_false(fp->f_flag & FHASLOCK) && fp->f_type == DTYPE_VNODE) { lf.l_whence = SEEK_SET; lf.l_start = 0; lf.l_len = 0; From owner-svn-src-all@freebsd.org Sat Jan 21 19:38:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55C1FCBB7A2; Sat, 21 Jan 2017 19:38:29 +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 02A2AEAE; Sat, 21 Jan 2017 19:38:28 +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 v0LJcSJT097479; Sat, 21 Jan 2017 19:38:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LJcQOV097466; Sat, 21 Jan 2017 19:38:26 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201701211938.v0LJcQOV097466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 21 Jan 2017 19:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312603 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages 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, 21 Jan 2017 19:38:29 -0000 Author: mav Date: Sat Jan 21 19:38:26 2017 New Revision: 312603 URL: https://svnweb.freebsd.org/changeset/base/312603 Log: Add initial support for CTL module unloading. It is only a first step and not perfect, but better then nothing. The main blocker is CAM target frontend, that can not be unloaded, since CAM does not have mechanism to unregister periph driver now. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend.c head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c head/sys/cam/ctl/ctl_frontend.c head/sys/cam/ctl/ctl_frontend.h head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/ctl_frontend_ioctl.c head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_private.h head/sys/cam/ctl/ctl_tpc_local.c head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl.c Sat Jan 21 19:38:26 2017 (r312603) @@ -424,7 +424,7 @@ static void ctl_isc_event_handler(ctl_ha static void ctl_copy_sense_data(union ctl_ha_msg *src, union ctl_io *dest); static void ctl_copy_sense_data_back(union ctl_io *src, union ctl_ha_msg *dest); static int ctl_init(void); -void ctl_shutdown(void); +static int ctl_shutdown(void); static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td); static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td); static void ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio); @@ -520,6 +520,8 @@ static const struct ctl_cmd_entry * ctl_validate_command(struct ctl_scsiio *ctsio); static int ctl_cmd_applicable(uint8_t lun_type, const struct ctl_cmd_entry *entry); +static int ctl_ha_init(void); +static int ctl_ha_shutdown(void); static uint64_t ctl_get_prkey(struct ctl_lun *lun, uint32_t residx); static void ctl_clr_prkey(struct ctl_lun *lun, uint32_t residx); @@ -561,6 +563,49 @@ MODULE_VERSION(ctl, 1); static struct ctl_frontend ha_frontend = { .name = "ha", + .init = ctl_ha_init, + .shutdown = ctl_ha_shutdown, +}; + +static int +ctl_ha_init(void) +{ + struct ctl_softc *softc = control_softc; + + if (ctl_pool_create(softc, "othersc", CTL_POOL_ENTRIES_OTHER_SC, + &softc->othersc_pool) != 0) + return (ENOMEM); + if (ctl_ha_msg_init(softc) != CTL_HA_STATUS_SUCCESS) { + ctl_pool_free(softc->othersc_pool); + return (EIO); + } + if (ctl_ha_msg_register(CTL_HA_CHAN_CTL, ctl_isc_event_handler) + != CTL_HA_STATUS_SUCCESS) { + ctl_ha_msg_destroy(softc); + ctl_pool_free(softc->othersc_pool); + return (EIO); + } + return (0); +}; + +static int +ctl_ha_shutdown(void) +{ + struct ctl_softc *softc = control_softc; + struct ctl_port *port; + + ctl_ha_msg_shutdown(softc); + if (ctl_ha_msg_deregister(CTL_HA_CHAN_CTL) != CTL_HA_STATUS_SUCCESS) + return (EIO); + if (ctl_ha_msg_destroy(softc) != CTL_HA_STATUS_SUCCESS) + return (EIO); + ctl_pool_free(softc->othersc_pool); + while ((port = STAILQ_FIRST(&ha_frontend.port_list)) != NULL) { + ctl_port_deregister(port); + free(port->port_name, M_CTL); + free(port, M_CTL); + } + return (0); }; static void @@ -1782,7 +1827,6 @@ ctl_init(void) { struct make_dev_args args; struct ctl_softc *softc; - void *other_pool; int i, error; softc = control_softc = malloc(sizeof(*control_softc), M_DEVBUF, @@ -1855,15 +1899,6 @@ ctl_init(void) STAILQ_INIT(&softc->be_list); ctl_tpc_init(softc); - if (ctl_pool_create(softc, "othersc", CTL_POOL_ENTRIES_OTHER_SC, - &other_pool) != 0) - { - printf("ctl: can't allocate %d entry other SC pool, " - "exiting\n", CTL_POOL_ENTRIES_OTHER_SC); - return (ENOMEM); - } - softc->othersc_pool = other_pool; - if (worker_threads <= 0) worker_threads = max(1, mp_ncpus / 4); if (worker_threads > CTL_MAX_THREADS) @@ -1883,22 +1918,19 @@ ctl_init(void) &softc->ctl_proc, &thr->thread, 0, 0, "ctl", "work%d", i); if (error != 0) { printf("error creating CTL work thread!\n"); - ctl_pool_free(other_pool); return (error); } } error = kproc_kthread_add(ctl_lun_thread, softc, - &softc->ctl_proc, NULL, 0, 0, "ctl", "lun"); + &softc->ctl_proc, &softc->lun_thread, 0, 0, "ctl", "lun"); if (error != 0) { printf("error creating CTL lun thread!\n"); - ctl_pool_free(other_pool); return (error); } error = kproc_kthread_add(ctl_thresh_thread, softc, - &softc->ctl_proc, NULL, 0, 0, "ctl", "thresh"); + &softc->ctl_proc, &softc->thresh_thread, 0, 0, "ctl", "thresh"); if (error != 0) { printf("error creating CTL threshold thread!\n"); - ctl_pool_free(other_pool); return (error); } @@ -1907,58 +1939,54 @@ ctl_init(void) softc, 0, ctl_ha_role_sysctl, "I", "HA role for this head"); if (softc->is_single == 0) { - ctl_frontend_register(&ha_frontend); - if (ctl_ha_msg_init(softc) != CTL_HA_STATUS_SUCCESS) { - printf("ctl_init: ctl_ha_msg_init failed.\n"); + if (ctl_frontend_register(&ha_frontend) != 0) softc->is_single = 1; - } else - if (ctl_ha_msg_register(CTL_HA_CHAN_CTL, ctl_isc_event_handler) - != CTL_HA_STATUS_SUCCESS) { - printf("ctl_init: ctl_ha_msg_register failed.\n"); - softc->is_single = 1; - } } return (0); } -void +static int ctl_shutdown(void) { struct ctl_softc *softc = control_softc; - struct ctl_lun *lun, *next_lun; + int i; - if (softc->is_single == 0) { - ctl_ha_msg_shutdown(softc); - if (ctl_ha_msg_deregister(CTL_HA_CHAN_CTL) - != CTL_HA_STATUS_SUCCESS) - printf("%s: ctl_ha_msg_deregister failed.\n", __func__); - if (ctl_ha_msg_destroy(softc) != CTL_HA_STATUS_SUCCESS) - printf("%s: ctl_ha_msg_destroy failed.\n", __func__); + if (softc->is_single == 0) ctl_frontend_deregister(&ha_frontend); - } - - mtx_lock(&softc->ctl_lock); - - STAILQ_FOREACH_SAFE(lun, &softc->lun_list, links, next_lun) - ctl_free_lun(lun); - mtx_unlock(&softc->ctl_lock); + destroy_dev(softc->dev); -#if 0 - ctl_shutdown_thread(softc->work_thread); - mtx_destroy(&softc->queue_lock); -#endif + /* Shutdown CTL threads. */ + softc->shutdown = 1; + for (i = 0; i < worker_threads; i++) { + struct ctl_thread *thr = &softc->threads[i]; + while (thr->thread != NULL) { + wakeup(thr); + if (thr->thread != NULL) + pause("CTL thr shutdown", 1); + } + mtx_destroy(&thr->queue_lock); + } + while (softc->lun_thread != NULL) { + wakeup(&softc->pending_lun_queue); + if (softc->lun_thread != NULL) + pause("CTL thr shutdown", 1); + } + while (softc->thresh_thread != NULL) { + wakeup(softc->thresh_thread); + if (softc->thresh_thread != NULL) + pause("CTL thr shutdown", 1); + } ctl_tpc_shutdown(softc); uma_zdestroy(softc->io_zone); mtx_destroy(&softc->ctl_lock); - destroy_dev(softc->dev); - sysctl_ctx_free(&softc->sysctl_ctx); free(softc, M_DEVBUF); control_softc = NULL; + return (0); } static int @@ -1969,7 +1997,7 @@ ctl_module_event_handler(module_t mod, i case MOD_LOAD: return (ctl_init()); case MOD_UNLOAD: - return (EBUSY); + return (ctl_shutdown()); default: return (EOPNOTSUPP); } @@ -13268,7 +13296,7 @@ ctl_work_thread(void *arg) CTL_DEBUG_PRINT(("ctl_work_thread starting\n")); - for (;;) { + while (!softc->shutdown) { /* * We handle the queues in this order: * - ISC @@ -13318,6 +13346,8 @@ ctl_work_thread(void *arg) /* Sleep until we have something to do. */ mtx_sleep(thr, &thr->queue_lock, PDROP | PRIBIO, "-", 0); } + thr->thread = NULL; + kthread_exit(); } static void @@ -13328,7 +13358,7 @@ ctl_lun_thread(void *arg) CTL_DEBUG_PRINT(("ctl_lun_thread starting\n")); - for (;;) { + while (!softc->shutdown) { mtx_lock(&softc->ctl_lock); be_lun = STAILQ_FIRST(&softc->pending_lun_queue); if (be_lun != NULL) { @@ -13342,6 +13372,8 @@ ctl_lun_thread(void *arg) mtx_sleep(&softc->pending_lun_queue, &softc->ctl_lock, PDROP | PRIBIO, "-", 0); } + softc->lun_thread = NULL; + kthread_exit(); } static void @@ -13357,7 +13389,7 @@ ctl_thresh_thread(void *arg) CTL_DEBUG_PRINT(("ctl_thresh_thread starting\n")); - for (;;) { + while (!softc->shutdown) { mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(lun, &softc->lun_list, links) { if ((lun->flags & CTL_LUN_DISABLED) || @@ -13442,9 +13474,11 @@ ctl_thresh_thread(void *arg) mtx_lock(&softc->ctl_lock); } } - mtx_unlock(&softc->ctl_lock); - pause("-", CTL_LBP_PERIOD * hz); + mtx_sleep(&softc->thresh_thread, &softc->ctl_lock, + PDROP | PRIBIO, "-", CTL_LBP_PERIOD * hz); } + softc->thresh_thread = NULL; + kthread_exit(); } static void Modified: head/sys/cam/ctl/ctl_backend.c ============================================================================== --- head/sys/cam/ctl/ctl_backend.c Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl_backend.c Sat Jan 21 19:38:26 2017 (r312603) @@ -67,11 +67,10 @@ ctl_backend_register(struct ctl_backend_ { struct ctl_softc *softc = control_softc; struct ctl_backend_driver *be_tmp; + int error; + /* Sanity check, make sure this isn't a duplicate registration. */ mtx_lock(&softc->ctl_lock); - /* - * Sanity check, make sure this isn't a duplicate registration. - */ STAILQ_FOREACH(be_tmp, &softc->be_list, links) { if (strcmp(be_tmp->name, be->name) == 0) { mtx_unlock(&softc->ctl_lock); @@ -79,39 +78,24 @@ ctl_backend_register(struct ctl_backend_ } } mtx_unlock(&softc->ctl_lock); - - /* - * Call the backend's initialization routine. - */ - be->init(); - - mtx_lock(&softc->ctl_lock); - - STAILQ_INSERT_TAIL(&softc->be_list, be, links); - - softc->num_backends++; - - /* - * Don't want to increment the usage count for internal consumers, - * we won't be able to unload otherwise. - */ - /* XXX KDM find a substitute for this? */ -#if 0 - if ((be->flags & CTL_BE_FLAG_INTERNAL) == 0) - MOD_INC_USE_COUNT; -#endif - #ifdef CS_BE_CONFIG_MOVE_DONE_IS_NOT_USED be->config_move_done = ctl_config_move_done; #endif - /* XXX KDM fix this! */ be->num_luns = 0; -#if 0 - atomic_set(&be->num_luns, 0); -#endif - mtx_unlock(&softc->ctl_lock); + /* Call the backend's initialization routine. */ + if (be->init != NULL) { + if ((error = be->init()) != 0) { + printf("%s backend init error: %d\n", + be->name, error); + return (error); + } + } + mtx_lock(&softc->ctl_lock); + STAILQ_INSERT_TAIL(&softc->be_list, be, links); + softc->num_backends++; + mtx_unlock(&softc->ctl_lock); return (0); } @@ -119,30 +103,21 @@ int ctl_backend_deregister(struct ctl_backend_driver *be) { struct ctl_softc *softc = control_softc; + int error; - mtx_lock(&softc->ctl_lock); - -#if 0 - if (atomic_read(&be->num_luns) != 0) { -#endif - /* XXX KDM fix this! */ - if (be->num_luns != 0) { - mtx_unlock(&softc->ctl_lock); - return (-1); + /* Call the backend's shutdown routine. */ + if (be->shutdown != NULL) { + if ((error = be->shutdown()) != 0) { + printf("%s backend shutdown error: %d\n", + be->name, error); + return (error); + } } + mtx_lock(&softc->ctl_lock); STAILQ_REMOVE(&softc->be_list, be, ctl_backend_driver, links); - softc->num_backends--; - - /* XXX KDM find a substitute for this? */ -#if 0 - if ((be->flags & CTL_BE_FLAG_INTERNAL) == 0) - MOD_DEC_USE_COUNT; -#endif - mtx_unlock(&softc->ctl_lock); - return (0); } Modified: head/sys/cam/ctl/ctl_backend.h ============================================================================== --- head/sys/cam/ctl/ctl_backend.h Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl_backend.h Sat Jan 21 19:38:26 2017 (r312603) @@ -55,12 +55,13 @@ typedef enum { { \ switch (type) { \ case MOD_LOAD: \ - ctl_backend_register( \ - (struct ctl_backend_driver *)data); \ + return (ctl_backend_register( \ + (struct ctl_backend_driver *)data)); \ break; \ case MOD_UNLOAD: \ - printf(#name " module unload - not possible for this module type\n"); \ - return EINVAL; \ + return (ctl_backend_deregister( \ + (struct ctl_backend_driver *)data)); \ + break; \ default: \ return EOPNOTSUPP; \ } \ @@ -179,10 +180,10 @@ struct ctl_be_lun { typedef enum { CTL_BE_FLAG_NONE = 0x00, /* no flags */ CTL_BE_FLAG_HAS_CONFIG = 0x01, /* can do config reads, writes */ - CTL_BE_FLAG_INTERNAL = 0x02 /* don't inc mod refcount */ } ctl_backend_flags; typedef int (*be_init_t)(void); +typedef int (*be_shutdown_t)(void); typedef int (*be_func_t)(union ctl_io *io); typedef void (*be_vfunc_t)(union ctl_io *io); typedef int (*be_ioctl_t)(struct cdev *dev, u_long cmd, caddr_t addr, int flag, @@ -194,6 +195,7 @@ struct ctl_backend_driver { char name[CTL_BE_NAME_LEN]; /* passed to CTL */ ctl_backend_flags flags; /* passed to CTL */ be_init_t init; /* passed to CTL */ + be_shutdown_t shutdown; /* passed to CTL */ be_func_t data_submit; /* passed to CTL */ be_func_t data_move_done; /* passed to CTL */ be_func_t config_read; /* passed to CTL */ Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl_backend_block.c Sat Jan 21 19:38:26 2017 (r312603) @@ -183,6 +183,7 @@ struct ctl_be_block_lun { */ struct ctl_be_block_softc { struct mtx lock; + uma_zone_t beio_zone; int num_luns; STAILQ_HEAD(, ctl_be_block_lun) lun_list; }; @@ -273,13 +274,15 @@ static int ctl_be_block_config_write(uni static int ctl_be_block_config_read(union ctl_io *io); static int ctl_be_block_lun_info(void *be_lun, struct sbuf *sb); static uint64_t ctl_be_block_lun_attr(void *be_lun, const char *attrname); -int ctl_be_block_init(void); +static int ctl_be_block_init(void); +static int ctl_be_block_shutdown(void); static struct ctl_backend_driver ctl_be_block_driver = { .name = "block", .flags = CTL_BE_FLAG_HAS_CONFIG, .init = ctl_be_block_init, + .shutdown = ctl_be_block_shutdown, .data_submit = ctl_be_block_submit, .data_move_done = ctl_be_block_move_done, .config_read = ctl_be_block_config_read, @@ -292,14 +295,12 @@ static struct ctl_backend_driver ctl_be_ MALLOC_DEFINE(M_CTLBLK, "ctlblk", "Memory used for CTL block backend"); CTL_BACKEND_DECLARE(cbb, ctl_be_block_driver); -static uma_zone_t beio_zone; - static struct ctl_be_block_io * ctl_alloc_beio(struct ctl_be_block_softc *softc) { struct ctl_be_block_io *beio; - beio = uma_zalloc(beio_zone, M_WAITOK | M_ZERO); + beio = uma_zalloc(softc->beio_zone, M_WAITOK | M_ZERO); beio->softc = softc; return (beio); } @@ -332,7 +333,7 @@ ctl_free_beio(struct ctl_be_block_io *be duplicate_free, beio->num_segs); } - uma_zfree(beio_zone, beio); + uma_zfree(beio->softc->beio_zone, beio); } static void @@ -2859,19 +2860,40 @@ ctl_be_block_lun_attr(void *be_lun, cons return (lun->getattr(lun, attrname)); } -int +static int ctl_be_block_init(void) { - struct ctl_be_block_softc *softc; - int retval; - - softc = &backend_block_softc; - retval = 0; + struct ctl_be_block_softc *softc = &backend_block_softc; mtx_init(&softc->lock, "ctlblock", NULL, MTX_DEF); - beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io), + softc->beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); STAILQ_INIT(&softc->lun_list); + return (0); +} - return (retval); + +static int +ctl_be_block_shutdown(void) +{ + struct ctl_be_block_softc *softc = &backend_block_softc; + struct ctl_be_block_lun *lun, *next_lun; + + mtx_lock(&softc->lock); + STAILQ_FOREACH_SAFE(lun, &softc->lun_list, links, next_lun) { + /* + * Drop our lock here. Since ctl_invalidate_lun() can call + * back into us, this could potentially lead to a recursive + * lock of the same mutex, which would cause a hang. + */ + mtx_unlock(&softc->lock); + ctl_disable_lun(&lun->cbe_lun); + ctl_invalidate_lun(&lun->cbe_lun); + mtx_lock(&softc->lock); + } + mtx_unlock(&softc->lock); + + uma_zdestroy(softc->beio_zone); + mtx_destroy(&softc->lock); + return (0); } Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Sat Jan 21 19:38:26 2017 (r312603) @@ -108,8 +108,8 @@ struct ctl_be_ramdisk_softc { static struct ctl_be_ramdisk_softc rd_softc; extern struct ctl_softc *control_softc; -int ctl_backend_ramdisk_init(void); -void ctl_backend_ramdisk_shutdown(void); +static int ctl_backend_ramdisk_init(void); +static int ctl_backend_ramdisk_shutdown(void); static int ctl_backend_ramdisk_move_done(union ctl_io *io); static int ctl_backend_ramdisk_submit(union ctl_io *io); static void ctl_backend_ramdisk_continue(union ctl_io *io); @@ -133,6 +133,7 @@ static struct ctl_backend_driver ctl_be_ .name = "ramdisk", .flags = CTL_BE_FLAG_HAS_CONFIG, .init = ctl_backend_ramdisk_init, + .shutdown = ctl_backend_ramdisk_shutdown, .data_submit = ctl_backend_ramdisk_submit, .data_move_done = ctl_backend_ramdisk_move_done, .config_read = ctl_backend_ramdisk_config_read, @@ -170,7 +171,7 @@ ctl_backend_ramdisk_init(void) return (0); } -void +static int ctl_backend_ramdisk_shutdown(void) { struct ctl_be_ramdisk_softc *softc = &rd_softc; @@ -192,20 +193,16 @@ ctl_backend_ramdisk_shutdown(void) mtx_lock(&softc->lock); } mtx_unlock(&softc->lock); - + #ifdef CTL_RAMDISK_PAGES for (i = 0; i < softc->num_pages; i++) free(softc->ramdisk_pages[i], M_RAMDISK); - free(softc->ramdisk_pages, M_RAMDISK); #else free(softc->ramdisk_buffer, M_RAMDISK); #endif - - if (ctl_backend_deregister(&ctl_be_ramdisk_driver) != 0) { - printf("ctl_backend_ramdisk_shutdown: " - "ctl_backend_deregister() failed!\n"); - } + mtx_destroy(&softc->lock); + return (0); } static int Modified: head/sys/cam/ctl/ctl_frontend.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend.c Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl_frontend.c Sat Jan 21 19:38:26 2017 (r312603) @@ -70,12 +70,11 @@ ctl_frontend_register(struct ctl_fronten { struct ctl_softc *softc = control_softc; struct ctl_frontend *fe_tmp; + int error; KASSERT(softc != NULL, ("CTL is not initialized")); - /* - * Sanity check, make sure this isn't a duplicate registration. - */ + /* Sanity check, make sure this isn't a duplicate registration. */ mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(fe_tmp, &softc->fe_list, links) { if (strcmp(fe_tmp->name, fe->name) == 0) { @@ -86,11 +85,14 @@ ctl_frontend_register(struct ctl_fronten mtx_unlock(&softc->ctl_lock); STAILQ_INIT(&fe->port_list); - /* - * Call the frontend's initialization routine. - */ - if (fe->init != NULL) - fe->init(); + /* Call the frontend's initialization routine. */ + if (fe->init != NULL) { + if ((error = fe->init()) != 0) { + printf("%s frontend init error: %d\n", + fe->name, error); + return (error); + } + } mtx_lock(&softc->ctl_lock); softc->num_frontends++; @@ -103,20 +105,21 @@ int ctl_frontend_deregister(struct ctl_frontend *fe) { struct ctl_softc *softc = control_softc; + int error; - if (!STAILQ_EMPTY(&fe->port_list)) - return (-1); + /* Call the frontend's shutdown routine.*/ + if (fe->shutdown != NULL) { + if ((error = fe->shutdown()) != 0) { + printf("%s frontend shutdown error: %d\n", + fe->name, error); + return (error); + } + } mtx_lock(&softc->ctl_lock); STAILQ_REMOVE(&softc->fe_list, fe, ctl_frontend, links); softc->num_frontends--; mtx_unlock(&softc->ctl_lock); - - /* - * Call the frontend's shutdown routine. - */ - if (fe->shutdown != NULL) - fe->shutdown(); return (0); } Modified: head/sys/cam/ctl/ctl_frontend.h ============================================================================== --- head/sys/cam/ctl/ctl_frontend.h Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl_frontend.h Sat Jan 21 19:38:26 2017 (r312603) @@ -49,7 +49,7 @@ typedef enum { } ctl_port_status; typedef int (*fe_init_t)(void); -typedef void (*fe_shutdown_t)(void); +typedef int (*fe_shutdown_t)(void); typedef void (*port_func_t)(void *onoff_arg); typedef int (*port_info_func_t)(void *onoff_arg, struct sbuf *sb); typedef int (*lun_func_t)(void *arg, int lun_id); @@ -61,12 +61,13 @@ typedef int (*fe_ioctl_t)(struct cdev *d { \ switch (type) { \ case MOD_LOAD: \ - ctl_frontend_register( \ - (struct ctl_frontend *)data); \ + return (ctl_frontend_register( \ + (struct ctl_frontend *)data)); \ break; \ case MOD_UNLOAD: \ - printf(#name " module unload - not possible for this module type\n"); \ - return EINVAL; \ + return (ctl_frontend_deregister( \ + (struct ctl_frontend *)data)); \ + break; \ default: \ return EOPNOTSUPP; \ } \ Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Sat Jan 21 19:38:26 2017 (r312603) @@ -94,15 +94,14 @@ struct cfcs_softc { CAM_SNS_BUF_PHYS | CAM_CDB_PHYS | CAM_SENSE_PTR | \ CAM_SENSE_PHYS) -int cfcs_init(void); +static int cfcs_init(void); +static int cfcs_shutdown(void); static void cfcs_poll(struct cam_sim *sim); static void cfcs_online(void *arg); static void cfcs_offline(void *arg); static void cfcs_datamove(union ctl_io *io); static void cfcs_done(union ctl_io *io); void cfcs_action(struct cam_sim *sim, union ccb *ccb); -static void cfcs_async(void *callback_arg, uint32_t code, - struct cam_path *path, void *arg); struct cfcs_softc cfcs_softc; /* @@ -121,14 +120,14 @@ static struct ctl_frontend cfcs_frontend { .name = "camsim", .init = cfcs_init, + .shutdown = cfcs_shutdown, }; CTL_FRONTEND_DECLARE(ctlcfcs, cfcs_frontend); -int +static int cfcs_init(void) { struct cfcs_softc *softc; - struct ccb_setasync csa; struct ctl_port *port; int retval; @@ -214,13 +213,6 @@ cfcs_init(void) goto bailout; } - xpt_setup_ccb(&csa.ccb_h, softc->path, CAM_PRIORITY_NONE); - csa.ccb_h.func_code = XPT_SASYNC_CB; - csa.event_enable = AC_LOST_DEVICE; - csa.callback = cfcs_async; - csa.callback_arg = softc->sim; - xpt_action((union ccb *)&csa); - mtx_unlock(&softc->lock); return (retval); @@ -236,6 +228,27 @@ bailout: return (retval); } +static int +cfcs_shutdown(void) +{ + struct cfcs_softc *softc = &cfcs_softc; + struct ctl_port *port = &softc->port; + int error; + + ctl_port_offline(port); + + mtx_lock(&softc->lock); + xpt_free_path(softc->path); + xpt_bus_deregister(cam_sim_path(softc->sim)); + cam_sim_free(softc->sim, /*free_devq*/ TRUE); + mtx_unlock(&softc->lock); + mtx_destroy(&softc->lock); + + if ((error = ctl_port_deregister(port)) != 0) + printf("%s: cam_sim port deregistration failed\n", __func__); + return (error); +} + static void cfcs_poll(struct cam_sim *sim) { @@ -801,9 +814,3 @@ cfcs_action(struct cam_sim *sim, union c break; } } - -static void -cfcs_async(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) -{ - -} Modified: head/sys/cam/ctl/ctl_frontend_ioctl.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_ioctl.c Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl_frontend_ioctl.c Sat Jan 21 19:38:26 2017 (r312603) @@ -76,7 +76,7 @@ struct cfi_softc { static struct cfi_softc cfi_softc; static int cfi_init(void); -static void cfi_shutdown(void); +static int cfi_shutdown(void); static void cfi_datamove(union ctl_io *io); static void cfi_done(union ctl_io *io); @@ -93,6 +93,7 @@ cfi_init(void) { struct cfi_softc *isoftc = &cfi_softc; struct ctl_port *port; + int error = 0; memset(isoftc, 0, sizeof(*isoftc)); @@ -108,24 +109,25 @@ cfi_init(void) port->targ_port = -1; port->max_initiators = 1; - if (ctl_port_register(port) != 0) { + if ((error = ctl_port_register(port)) != 0) { printf("%s: ioctl port registration failed\n", __func__); - return (0); + return (error); } ctl_port_online(port); return (0); } -void +static int cfi_shutdown(void) { struct cfi_softc *isoftc = &cfi_softc; - struct ctl_port *port; + struct ctl_port *port = &isoftc->port; + int error = 0; - port = &isoftc->port; ctl_port_offline(port); - if (ctl_port_deregister(&isoftc->port) != 0) - printf("%s: ctl_frontend_deregister() failed\n", __func__); + if ((error = ctl_port_deregister(port)) != 0) + printf("%s: ioctl port deregistration failed\n", __func__); + return (error); } /* Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Sat Jan 21 19:38:26 2017 (r312603) @@ -144,7 +144,8 @@ SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO #define PDU_TOTAL_TRANSFER_LEN(X) (X)->ip_prv1 #define PDU_R2TSN(X) (X)->ip_prv2 -int cfiscsi_init(void); +static int cfiscsi_init(void); +static int cfiscsi_shutdown(void); static void cfiscsi_online(void *arg); static void cfiscsi_offline(void *arg); static int cfiscsi_info(void *arg, struct sbuf *sb); @@ -182,6 +183,7 @@ static struct ctl_frontend cfiscsi_front .name = "iscsi", .init = cfiscsi_init, .ioctl = cfiscsi_ioctl, + .shutdown = cfiscsi_shutdown, }; CTL_FRONTEND_DECLARE(ctlcfiscsi, cfiscsi_frontend); MODULE_DEPEND(ctlcfiscsi, icl, 1, 1, 1); @@ -1321,7 +1323,7 @@ cfiscsi_session_delete(struct cfiscsi_se free(cs, M_CFISCSI); } -int +static int cfiscsi_init(void) { struct cfiscsi_softc *softc; @@ -1344,6 +1346,23 @@ cfiscsi_init(void) return (0); } +static int +cfiscsi_shutdown(void) +{ + struct cfiscsi_softc *softc = &cfiscsi_softc; + + if (!TAILQ_EMPTY(&softc->sessions) || !TAILQ_EMPTY(&softc->targets)) + return (EBUSY); + + uma_zdestroy(cfiscsi_data_wait_zone); +#ifdef ICL_KERNEL_PROXY + cv_destroy(&softc->accept_cv); +#endif + cv_destroy(&softc->sessions_cv); + mtx_destroy(&softc->lock); + return (0); +} + #ifdef ICL_KERNEL_PROXY static void cfiscsi_accept(struct socket *so, struct sockaddr *sa, int portal_id) Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl_private.h Sat Jan 21 19:38:26 2017 (r312603) @@ -470,7 +470,10 @@ struct ctl_softc { STAILQ_HEAD(, ctl_backend_driver) be_list; struct uma_zone *io_zone; uint32_t cur_pool_id; + int shutdown; struct ctl_thread threads[CTL_MAX_THREADS]; + struct thread *lun_thread; + struct thread *thresh_thread; TAILQ_HEAD(tpc_tokens, tpc_token) tpc_tokens; struct callout tpc_timeout; struct mtx tpc_lock; Modified: head/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc_local.c Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/ctl_tpc_local.c Sat Jan 21 19:38:26 2017 (r312603) @@ -65,7 +65,7 @@ struct tpcl_softc { static struct tpcl_softc tpcl_softc; static int tpcl_init(void); -static void tpcl_shutdown(void); +static int tpcl_shutdown(void); static void tpcl_datamove(union ctl_io *io); static void tpcl_done(union ctl_io *io); @@ -84,7 +84,7 @@ tpcl_init(void) struct tpcl_softc *tsoftc = &tpcl_softc; struct ctl_port *port; struct scsi_transportid_spi *tid; - int len; + int error, len; memset(tsoftc, 0, sizeof(*tsoftc)); @@ -100,9 +100,9 @@ tpcl_init(void) port->targ_port = -1; port->max_initiators = 1; - if (ctl_port_register(port) != 0) { - printf("%s: ctl_port_register() failed with error\n", __func__); - return (0); + if ((error = ctl_port_register(port)) != 0) { + printf("%s: tpc port registration failed\n", __func__); + return (error); } len = sizeof(struct scsi_transportid_spi); @@ -118,16 +118,17 @@ tpcl_init(void) return (0); } -void +static int tpcl_shutdown(void) { struct tpcl_softc *tsoftc = &tpcl_softc; - struct ctl_port *port; + struct ctl_port *port = &tsoftc->port; + int error; - port = &tsoftc->port; ctl_port_offline(port); - if (ctl_port_deregister(&tsoftc->port) != 0) - printf("%s: ctl_frontend_deregister() failed\n", __func__); + if ((error = ctl_port_deregister(port)) != 0) + printf("%s: tpc port deregistration failed\n", __func__); + return (error); } static void Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Sat Jan 21 19:01:42 2017 (r312602) +++ head/sys/cam/ctl/scsi_ctl.c Sat Jan 21 19:38:26 2017 (r312603) @@ -188,8 +188,8 @@ MALLOC_DEFINE(M_CTLFE, "CAM CTL FE", "CA #define PRIV_CCB(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[0]) #define PRIV_INFO(io) ((io)->io_hdr.ctl_private[CTL_PRIV_FRONTEND].ptrs[1]) -int ctlfeinitialize(void); -void ctlfeshutdown(void); +static int ctlfeinitialize(void); +static int ctlfeshutdown(void); static periph_init_t ctlfeperiphinit; static void ctlfeasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg); @@ -227,13 +227,15 @@ static struct ctl_frontend ctlfe_fronten }; CTL_FRONTEND_DECLARE(ctlfe, ctlfe_frontend); -void +static int ctlfeshutdown(void) { - return; + + /* CAM does not support periph driver unregister now. */ + return (EBUSY); } -int +static int ctlfeinitialize(void) { @@ -243,7 +245,7 @@ ctlfeinitialize(void) return (0); } -void +static void ctlfeperiphinit(void) { cam_status status; From owner-svn-src-all@freebsd.org Sat Jan 21 19:49:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6BF6CBBB51; Sat, 21 Jan 2017 19:49:40 +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 7072F1589; Sat, 21 Jan 2017 19:49:40 +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 v0LJndEG001975; Sat, 21 Jan 2017 19:49:39 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LJndW4001974; Sat, 21 Jan 2017 19:49:39 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701211949.v0LJndW4001974@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, 21 Jan 2017 19:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312604 - 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: Sat, 21 Jan 2017 19:49:40 -0000 Author: loos Date: Sat Jan 21 19:49:39 2017 New Revision: 312604 URL: https://svnweb.freebsd.org/changeset/base/312604 Log: Simplify the handling of small packets padding in cpsw: - Pad small packets to 60 bytes and not 64 (exclude the CRC bytes); - Pad the packet using m_append(9), if the packet has enough space for padding, which is usually true, it will not be necessary append a newly allocated mbuf to the chain. Suggested by: yongari MFC after: 3 days 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 Sat Jan 21 19:38:26 2017 (r312603) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sat Jan 21 19:49:39 2017 (r312604) @@ -783,8 +783,7 @@ cpsw_get_fdt_data(struct cpsw_softc *sc, static int cpsw_attach(device_t dev) { - bus_dma_segment_t segs[1]; - int error, i, nsegs; + int error, i; struct cpsw_softc *sc; uint32_t reg; @@ -859,15 +858,8 @@ cpsw_attach(device_t dev) return (error); } - /* Allocate the null mbuf and pre-sync it. */ - sc->null_mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); - memset(sc->null_mbuf->m_data, 0, sc->null_mbuf->m_ext.ext_size); - bus_dmamap_create(sc->mbuf_dtag, 0, &sc->null_mbuf_dmamap); - bus_dmamap_load_mbuf_sg(sc->mbuf_dtag, sc->null_mbuf_dmamap, - sc->null_mbuf, segs, &nsegs, BUS_DMA_NOWAIT); - bus_dmamap_sync(sc->mbuf_dtag, sc->null_mbuf_dmamap, - BUS_DMASYNC_PREWRITE); - sc->null_mbuf_paddr = segs[0].ds_addr; + /* Allocate a NULL buffer for padding. */ + sc->nullpad = malloc(ETHER_MIN_LEN, M_DEVBUF, M_WAITOK | M_ZERO); cpsw_init_slots(sc); @@ -946,13 +938,9 @@ cpsw_detach(device_t dev) for (i = 0; i < nitems(sc->_slots); ++i) cpsw_free_slot(sc, &sc->_slots[i]); - /* Free null mbuf. */ - if (sc->null_mbuf_dmamap) { - bus_dmamap_unload(sc->mbuf_dtag, sc->null_mbuf_dmamap); - error = bus_dmamap_destroy(sc->mbuf_dtag, sc->null_mbuf_dmamap); - KASSERT(error == 0, ("Mapping still active")); - m_freem(sc->null_mbuf); - } + /* Free null padding buffer. */ + if (sc->nullpad) + free(sc->nullpad, M_DEVBUF); /* Free DMA tag */ if (sc->mbuf_dtag) { @@ -1829,21 +1817,19 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) break; slot->mbuf = m0; - padlen = ETHER_MIN_LEN - slot->mbuf->m_pkthdr.len; + padlen = ETHER_MIN_LEN - ETHER_CRC_LEN - m0->m_pkthdr.len; if (padlen < 0) padlen = 0; + else if (padlen > 0) + m_append(slot->mbuf, padlen, sc->swsc->nullpad); /* Create mapping in DMA memory */ error = bus_dmamap_load_mbuf_sg(sc->swsc->mbuf_dtag, slot->dmamap, slot->mbuf, segs, &nsegs, BUS_DMA_NOWAIT); /* If the packet is too fragmented, try to simplify. */ if (error == EFBIG || - (error == 0 && - nsegs + (padlen > 0 ? 1 : 0) > sc->swsc->tx.avail_queue_len)) { + (error == 0 && nsegs > sc->swsc->tx.avail_queue_len)) { bus_dmamap_unload(sc->swsc->mbuf_dtag, slot->dmamap); - if (padlen > 0) /* May as well add padding. */ - m_append(slot->mbuf, padlen, - sc->swsc->null_mbuf->m_data); m0 = m_defrag(slot->mbuf, M_NOWAIT); if (m0 == NULL) { device_printf(sc->dev, @@ -1895,7 +1881,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) bd.bufptr = segs[0].ds_addr; bd.bufoff = 0; bd.buflen = segs[0].ds_len; - bd.pktlen = m_length(slot->mbuf, NULL) + padlen; + bd.pktlen = m_length(slot->mbuf, NULL); bd.flags = CPDMA_BD_SOP | CPDMA_BD_OWNER; if (sc->swsc->dualemac) { bd.flags |= CPDMA_BD_TO_PORT; @@ -1920,42 +1906,18 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) bd.pktlen = 0; bd.flags = CPDMA_BD_OWNER; } + /* Save the final buffer. */ - if (padlen <= 0) - bd.flags |= CPDMA_BD_EOP; - else { - next = STAILQ_NEXT(slot, next); - bd.next = cpsw_cpdma_bd_paddr(sc->swsc, next); - } + bd.flags |= CPDMA_BD_EOP; cpsw_cpdma_write_bd(sc->swsc, slot, &bd); STAILQ_REMOVE_HEAD(&sc->swsc->tx.avail, next); STAILQ_INSERT_TAIL(&sc->swsc->tx.active, slot, next); - if (padlen > 0) { - slot = STAILQ_FIRST(&sc->swsc->tx.avail); - - /* Setup buffer of null pad bytes (definitely EOP). */ - bd.next = 0; - bd.bufptr = sc->swsc->null_mbuf_paddr; - bd.bufoff = 0; - bd.buflen = padlen; - bd.pktlen = 0; - bd.flags = CPDMA_BD_EOP | CPDMA_BD_OWNER; - cpsw_cpdma_write_bd(sc->swsc, slot, &bd); - ++nsegs; - - STAILQ_REMOVE_HEAD(&sc->swsc->tx.avail, next); - STAILQ_INSERT_TAIL(&sc->swsc->tx.active, slot, next); - } - last = slot; - added += nsegs; if (nsegs > sc->swsc->tx.longest_chain) sc->swsc->tx.longest_chain = nsegs; - // TODO: Should we defer the BPF tap until - // after all packets are queued? BPF_MTAP(sc->ifp, m0); } From owner-svn-src-all@freebsd.org Sat Jan 21 19:51:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6DE7CBBD19; Sat, 21 Jan 2017 19:51:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 706D51797; Sat, 21 Jan 2017 19:51:19 +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 v0LJpEgc070262 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 21 Jan 2017 21:51:14 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v0LJpEgc070262 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v0LJpEdM070261; Sat, 21 Jan 2017 21:51:14 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 21 Jan 2017 21:51:14 +0200 From: Konstantin Belousov To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312600 - head/sys/kern Message-ID: <20170121195114.GA2349@kib.kiev.ua> References: <201701211838.v0LIcHIv072626@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201701211838.v0LIcHIv072626@repo.freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) 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: Sat, 21 Jan 2017 19:51:19 -0000 On Sat, Jan 21, 2017 at 06:38:17PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Sat Jan 21 18:38:16 2017 > New Revision: 312600 > URL: https://svnweb.freebsd.org/changeset/base/312600 > > Log: > vfs: refactor _vn_lock > > Stop testing for LK_RETRY and error multiple times. Also postpone the > VI_DOOMED until after LK_RETRY was seen as it reads from the vnode. > > No functional changes. > > Modified: > head/sys/kern/vfs_vnops.c > > Modified: head/sys/kern/vfs_vnops.c > ============================================================================== > --- head/sys/kern/vfs_vnops.c Sat Jan 21 17:39:10 2017 (r312599) > +++ head/sys/kern/vfs_vnops.c Sat Jan 21 18:38:16 2017 (r312600) > @@ -1539,27 +1539,24 @@ _vn_lock(struct vnode *vp, int flags, ch > > VNASSERT((flags & LK_TYPE_MASK) != 0, vp, > ("vn_lock called with no locktype.")); > - do { > #ifdef DEBUG_VFS_LOCKS > - KASSERT(vp->v_holdcnt != 0, > - ("vn_lock %p: zero hold count", vp)); > + KASSERT(vp->v_holdcnt != 0, > + ("vn_lock %p: zero hold count", vp)); This line also has wrong inde seems to not be fixed by later commit. > #endif > - error = VOP_LOCK1(vp, flags, file, line); > - flags &= ~LK_INTERLOCK; /* Interlock is always dropped. */ > - KASSERT((flags & LK_RETRY) == 0 || error == 0, > - ("LK_RETRY set with incompatible flags (0x%x) or an error occurred (%d)", > - flags, error)); > - /* > - * Callers specify LK_RETRY if they wish to get dead vnodes. > - * If RETRY is not set, we return ENOENT instead. > - */ > - if (error == 0 && vp->v_iflag & VI_DOOMED && > - (flags & LK_RETRY) == 0) { > +retry: > + error = VOP_LOCK1(vp, flags, file, line); > + flags &= ~LK_INTERLOCK; /* Interlock is always dropped. */ > + KASSERT((flags & LK_RETRY) == 0 || error == 0, > + ("LK_RETRY set with incompatible flags (0x%x) or an error occurred (%d)", > + flags, error)); > + if (flags & LK_RETRY) { Stylish test is if ((flags & LK_RETRY) != 0) { > + if ((error != 0)) Too many (). > + goto retry; > + if ((vp->v_iflag & VI_DOOMED)) { Too many braces again, or missed != 0. > VOP_UNLOCK(vp, 0); > error = ENOENT; > - break; Also, this does the functional change, it seems to completely break LK_RERY logic. If LK_RETRY is specified, VI_DOOMED must not result in ENOENT. > } > - } while (flags & LK_RETRY && error != 0); > + } > return (error); > } > From owner-svn-src-all@freebsd.org Sat Jan 21 19:56:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F29B1CBBDD9; Sat, 21 Jan 2017 19:56:29 +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 C23AC1B7A; Sat, 21 Jan 2017 19:56:29 +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 v0LJuS6e005849; Sat, 21 Jan 2017 19:56:28 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LJuSTZ005848; Sat, 21 Jan 2017 19:56:28 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701211956.v0LJuSTZ005848@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, 21 Jan 2017 19:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312605 - 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: Sat, 21 Jan 2017 19:56:30 -0000 Author: loos Date: Sat Jan 21 19:56:28 2017 New Revision: 312605 URL: https://svnweb.freebsd.org/changeset/base/312605 Log: Commit the struture changes for the padding of small packets on if_cpsw. Should have been committed together with r312604. MFC with: r312604 Modified: head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpswvar.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswvar.h Sat Jan 21 19:49:39 2017 (r312604) +++ head/sys/arm/ti/cpsw/if_cpswvar.h Sat Jan 21 19:56:28 2017 (r312605) @@ -104,10 +104,8 @@ struct cpsw_softc { struct resource *irq_res[CPSW_INTR_COUNT]; void *ih_cookie[CPSW_INTR_COUNT]; - /* An mbuf full of nulls for TX padding. */ - bus_dmamap_t null_mbuf_dmamap; - struct mbuf *null_mbuf; - bus_addr_t null_mbuf_paddr; + /* A buffer full of nulls for TX padding. */ + void *nullpad; bus_dma_tag_t mbuf_dtag; From owner-svn-src-all@freebsd.org Sat Jan 21 20:14:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1243CCBB2D4; Sat, 21 Jan 2017 20:14:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::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 D3E0F789; Sat, 21 Jan 2017 20:14:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id 194so9868193pgd.0; Sat, 21 Jan 2017 12:14:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=wAyJ0lkVChKwr2nsJoH/vlvXuzRooHEDdttt9fDyWJg=; b=rg/rW9xbSyiNYRYvbgpiJxTp4Zrj2RgKg2s5GwC2LjGqlSa6UHDsLGoaUKxFBUkCJZ byQkXjvvF67g9GlGA7KRr/AVzv1L5lwR7kZU5oTK9s9XQQaeNc4XlGxgbQZmKOvA6OPe vjFIzSOavIHfRMhE0yz0OdwtlmLd59qQOgbkS2zeYhlZZLh3ukylx1f8L45jYGx3lLdM Eg3x0rpT/8Nfb24uqXWPHELlM2fR4oDEVux4rB2Afq6+4jIc2jwnZrHE1MydIVOrNQ2B yvADjzi4F664+JtTKLC74SXEeQjONYYSHxBUVMwCvzqAaM/feYfVWxNQRGb8RC8xk33x Bjog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=wAyJ0lkVChKwr2nsJoH/vlvXuzRooHEDdttt9fDyWJg=; b=rm/Z3EBPRyI4myG6J7gOLu4ZN1glPHmPezk3mbXDIRQxoa/jK/p0o2PhSCGK38Iz8Q q8QMQ2EsilWYcfwQ4qELjyBIPwPk9zWmk9nJ2KZGpD1OHVQXoJqvbQFYnNSolFJdyqox 5mSyTz6S3I0nt76UgkY4T+vMdWU/6Uu0aGVlyA09nL+thCKNKrsEVhLEqMtH9DediSkV mC1vGZEjiAArIRaLdRwqsDEL8De/++Syw7Zo3H6LBUyJzPvoxUj2sZOxmLANe5M3iLE5 oyVdF2Jpe18scfuay1ZcsKCTYna0rLvBH91WzvbPiYgXxIpud+pfC1xKvlha9zvF+ujX QSEw== X-Gm-Message-State: AIkVDXKwgGt3wRdXb6JRjFrJliBNBJV++ZvelFsUzA3IrHRX54rFVil2ZpmU7Sf3xEz7Ag== X-Received: by 10.99.117.8 with SMTP id q8mr24430545pgc.9.1485029697225; Sat, 21 Jan 2017 12:14:57 -0800 (PST) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id r74sm25853107pfb.67.2017.01.21.12.14.56 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 21 Jan 2017 12:14:56 -0800 (PST) Subject: Re: svn commit: r312598 - head/sys/kern Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_FC3BAA41-ACB3-49B2-B442-74099C38EC20"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201701211659.v0LGxpDr030785@repo.freebsd.org> Date: Sat, 21 Jan 2017 12:14:55 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201701211659.v0LGxpDr030785@repo.freebsd.org> To: Mateusz Guzik 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, 21 Jan 2017 20:14:58 -0000 --Apple-Mail=_FC3BAA41-ACB3-49B2-B442-74099C38EC20 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Jan 21, 2017, at 08:59, Mateusz Guzik wrote: > > Author: mjg > Date: Sat Jan 21 16:59:50 2017 > New Revision: 312598 > URL: https://svnweb.freebsd.org/changeset/base/312598 > > Log: > vfs: hide the getvnode NULL mp message behind DIAGNOSTIC > > Since crossmp vnode changes the message was being printed on each boot. > > Reported by: trasz > Discussed with: kib Thank you, -Ngie --Apple-Mail=_FC3BAA41-ACB3-49B2-B442-74099C38EC20 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 iQIcBAEBCgAGBQJYg8E/AAoJEPWDqSZpMIYV3kEQANPvzB9tnTF8M/rvcoGLJ7tI h1vlcz4EElBT/LvDRSR+E88nglwNbcPAzNio8udOuSuY5l4FzPxM4j4ZGQJ/1hZN RmEsvnVywx/skeJuSICjl2jv81C67GlS12IEF8eAboybTXnRkDOEF0a94EOcPy09 Vxdb9FffNegro/eFo9+/OsXbrAQ2WQm3icyOzUzlsmi3iAyrp5yOdtpxdJpl/aAt QOrzK01YTkXWwFH3oYVEnwmnxBwsMz6Nygdcv762HcTA8WGkoXsFkaYMYcqx3qLr SMxVB0/2WFDQUvDDsajRIpFqn7qh/jjyzH2o3ptgyT4iJcLdkIub8MkYCgo8by4p jG6gaSrEQ/nAonQ7R+k9PzaKH9OLZxTbfGTNkSXr1Tce0SulMk1v1pB3DvrAqaCW 4WbK8k+LaRNsXucazFySqmSt1h6AkA1BJ8zdasij7cdXEZu37A94YT0ygJ5+MUSo eM6nB63bQEes5CMOb+CsYQiKCq7516DGMrO6JrWckraXT1i+QPOBKWTmN/emkfWd qfJtr4TS3LwZwYFodFUDVXUsg9Z/N0ZpVbfUQs6xa9DQefHLAmUXh7/oq0a7yR2c KAA5Utw+mXI3ov9JIrrBjJFEgF6m8Nrknly4RATsP/s3+//yUGyAT4Pa1clW8uEG lqjcCw/IG5/HidqUG8uM =WfpJ -----END PGP SIGNATURE----- --Apple-Mail=_FC3BAA41-ACB3-49B2-B442-74099C38EC20-- From owner-svn-src-all@freebsd.org Sat Jan 21 20:34:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 583D3CBBA52; Sat, 21 Jan 2017 20:34:21 +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 2222B10F8; Sat, 21 Jan 2017 20:34:21 +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 v0LKYKJa021808; Sat, 21 Jan 2017 20:34:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LKYKA9021807; Sat, 21 Jan 2017 20:34:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201701212034.v0LKYKA9021807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 21 Jan 2017 20:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312606 - 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: Sat, 21 Jan 2017 20:34:21 -0000 Author: mjg Date: Sat Jan 21 20:34:20 2017 New Revision: 312606 URL: https://svnweb.freebsd.org/changeset/base/312606 Log: vfs: fix LK_RETRY logic braino in r312600 Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat Jan 21 19:56:28 2017 (r312605) +++ head/sys/kern/vfs_vnops.c Sat Jan 21 20:34:20 2017 (r312606) @@ -1549,13 +1549,15 @@ retry: KASSERT((flags & LK_RETRY) == 0 || error == 0, ("LK_RETRY set with incompatible flags (0x%x) or " " an error occurred (%d)", flags, error)); - if (flags & LK_RETRY) { - if ((error != 0)) - goto retry; - if ((vp->v_iflag & VI_DOOMED)) { + + if ((flags & LK_RETRY) == 0) { + if (error == 0 && vp->v_iflag & VI_DOOMED) { VOP_UNLOCK(vp, 0); error = ENOENT; } + } else { + if (error != 0) + goto retry; } return (error); } From owner-svn-src-all@freebsd.org Sat Jan 21 21:03:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE06CBA182; Sat, 21 Jan 2017 21:03:28 +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 1B8541E4F; Sat, 21 Jan 2017 21:03:28 +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 v0LL3Ri8033833; Sat, 21 Jan 2017 21:03:27 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LL3RMm033831; Sat, 21 Jan 2017 21:03:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201701212103.v0LL3RMm033831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 21 Jan 2017 21:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312607 - 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, 21 Jan 2017 21:03:28 -0000 Author: avos Date: Sat Jan 21 21:03:26 2017 New Revision: 312607 URL: https://svnweb.freebsd.org/changeset/base/312607 Log: ath: adapt LDPC support checks Set both IEEE80211_HTCAP_LDPC and IEEE80211_HTC_TXLDPC capability flags if LDPC is supported + set 'do_ldpc = 1' only when it is not disabled, not just supported. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D9277 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Jan 21 20:34:20 2017 (r312606) +++ head/sys/dev/ath/if_ath.c Sat Jan 21 21:03:26 2017 (r312607) @@ -1178,7 +1178,8 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_has_ldpc = 1; device_printf(sc->sc_dev, "[HT] LDPC transmit/receive enabled\n"); - ic->ic_htcaps |= IEEE80211_HTCAP_LDPC; + ic->ic_htcaps |= IEEE80211_HTCAP_LDPC | + IEEE80211_HTC_TXLDPC; } Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Sat Jan 21 20:34:20 2017 (r312606) +++ head/sys/dev/ath/if_ath_tx_ht.c Sat Jan 21 21:03:26 2017 (r312607) @@ -239,7 +239,7 @@ ath_tx_rate_fill_rcflags(struct ath_soft * it if any of the rate entries aren't 11n. */ do_ldpc = 0; - if ((ni->ni_vap->iv_htcaps & IEEE80211_HTCAP_LDPC) && + if ((ni->ni_vap->iv_flags_ht & IEEE80211_FHT_LDPC_TX) && (ni->ni_htcap & IEEE80211_HTCAP_LDPC)) do_ldpc = 1; From owner-svn-src-all@freebsd.org Sat Jan 21 21:36:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B880CBAB23; Sat, 21 Jan 2017 21:36:22 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::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 B6A55120D; Sat, 21 Jan 2017 21:36:21 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id r126so15927932wmr.3; Sat, 21 Jan 2017 13:36:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0whhwIqH+H2+J8SVr7slJuEqP0Y3rth1cuZUk3MPRvc=; b=K8aEcx6BP5b8GBO33PWHATQp+SdeWxy1qJ2pzIqWZ7sC+nJk8Fn297DqntYX0AB1j7 OUxZCQJFGTrmuyOROPIYFItTxKGpPIFbWQn1iaA9ucaR7ay+2NRVeugJ7MUj2x89mA82 pob00k/62oQejhyvEpxebovkHIV8esOzbjB8IjXxnoPBPrK2kpsot6k/p5QYmd0JshTl 89HFlsmjo/ejPaMdIJ5QfDaxSPdsG/8W9tXhByhogp6vbeKCNcs5XaPuRBYNS0vjkIMd jw3A+mh/FJz/H/wl9cy4W+tXKq57C2G8lG0H9EtXjBFx6gxKkMdNOU7S03w/pztADrZ4 P/wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0whhwIqH+H2+J8SVr7slJuEqP0Y3rth1cuZUk3MPRvc=; b=P1ejX4CMqKOCXV09XePL7dj3pxEjP1MyEhXsLzUmgGKZXyIYSTIyLNTODvkLRe+TeR eWXSWG8FBvgeEbwppLxxFSy58cTipO3zajP/Bw/jvtfK8Nop/WvFYWxZO3e+UN5ol6wJ 2heG088FARB38eGb4T0ab4AIkYTygYtNuMOE3o+G7sS4VaPylPzWDi0SkghnJ0alZq7A NaG9Y9n1BgTQ+0u8O2bW4CL4lA2iqwdNglW6ghNpzsPVe4XywCRAeUGuuvR5h4sV+fqu br3wHjE61Mw0Jy2VzhVy1UJLgYHdQ49fSQeEIukdc3puZ0OHqVxNI4ihpzr90zDtjYwn z/hQ== X-Gm-Message-State: AIkVDXLCmSiPus0VFLZLR+cXAlrOorwUsP7LXx6/d8kw0V/Z0tCDGmfBkO83PQa/m+ZbWA== X-Received: by 10.28.191.139 with SMTP id o11mr8949837wmi.97.1485034579201; Sat, 21 Jan 2017 13:36:19 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id a35sm6248065wra.21.2017.01.21.13.36.17 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 21 Jan 2017 13:36:17 -0800 (PST) Date: Sat, 21 Jan 2017 22:36:15 +0100 From: Mateusz Guzik To: Konstantin Belousov Cc: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r312600 - head/sys/kern Message-ID: <20170121213614.GB20930@dft-labs.eu> References: <201701211838.v0LIcHIv072626@repo.freebsd.org> <20170121195114.GA2349@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170121195114.GA2349@kib.kiev.ua> 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: Sat, 21 Jan 2017 21:36:22 -0000 On Sat, Jan 21, 2017 at 09:51:14PM +0200, Konstantin Belousov wrote: > On Sat, Jan 21, 2017 at 06:38:17PM +0000, Mateusz Guzik wrote: > > + if (flags & LK_RETRY) { > Stylish test is > if ((flags & LK_RETRY) != 0) { > > + if ((error != 0)) > Too many (). > > > + goto retry; > > + if ((vp->v_iflag & VI_DOOMED)) { > Too many braces again, or missed != 0. This was a side effect of putting these into __predict_false and then removing it, albeit not fully. > > VOP_UNLOCK(vp, 0); > > error = ENOENT; > > - break; > Also, this does the functional change, it seems to completely break LK_RERY > logic. If LK_RETRY is specified, VI_DOOMED must not result in ENOENT. > Yea, this was a weird-ass brainfart on my part. Fixed in r312606 The gist of the actual change I wanted to make is postponing the read from the vnode. > > } > > - } while (flags & LK_RETRY && error != 0); > > + } > > return (error); > > } > > -- Mateusz Guzik From owner-svn-src-all@freebsd.org Sat Jan 21 23:07:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FB59CBBE65; Sat, 21 Jan 2017 23:07:17 +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 D963CFA6; Sat, 21 Jan 2017 23:07: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 v0LN7Ff4083913; Sat, 21 Jan 2017 23:07:15 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LN7FpS083912; Sat, 21 Jan 2017 23:07:15 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701212307.v0LN7FpS083912@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, 21 Jan 2017 23:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312608 - 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: Sat, 21 Jan 2017 23:07:17 -0000 Author: loos Date: Sat Jan 21 23:07:15 2017 New Revision: 312608 URL: https://svnweb.freebsd.org/changeset/base/312608 Log: Handle the rx queue stall while reading the packets from NIC (when the descriptor state will not change anymore). This seems to eliminate the race where we can miss a stalled queue under high load. While here remove the unnecessary curly brackets. Reported by: Konstantin Kormashev MFC after: 3 days 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 Sat Jan 21 21:03:26 2017 (r312607) +++ head/sys/arm/ti/cpsw/if_cpsw.c Sat Jan 21 23:07:15 2017 (r312608) @@ -1652,6 +1652,14 @@ cpsw_rx_dequeue(struct cpsw_softc *sc) } } + if (STAILQ_FIRST(&sc->rx.active) != NULL && + (bd.flags & (CPDMA_BD_EOP | CPDMA_BD_EOQ)) == + (CPDMA_BD_EOP | CPDMA_BD_EOQ)) { + cpsw_write_hdp_slot(sc, &sc->rx, + STAILQ_FIRST(&sc->rx.active)); + sc->rx.queue_restart++; + } + /* Add mbuf to packet list to be returned. */ if (mb_tail) { mb_tail->m_nextpkt = slot->mbuf; @@ -1684,7 +1692,6 @@ cpsw_rx_enqueue(struct cpsw_softc *sc) struct cpsw_cpdma_bd bd; struct cpsw_slot *first_new_slot, *last_old_slot, *next, *slot; int error, nsegs, added = 0; - uint32_t flags; /* Register new mbufs with hardware. */ first_new_slot = NULL; @@ -1750,22 +1757,13 @@ cpsw_rx_enqueue(struct cpsw_softc *sc) } else { /* Add buffers to end of current queue. */ cpsw_cpdma_write_bd_next(sc, last_old_slot, first_new_slot); - /* If underrun, restart queue. */ - if ((flags = cpsw_cpdma_read_bd_flags(sc, last_old_slot)) & - CPDMA_BD_EOQ) { - flags &= ~CPDMA_BD_EOQ; - cpsw_cpdma_write_bd_flags(sc, last_old_slot, flags); - cpsw_write_hdp_slot(sc, &sc->rx, first_new_slot); - sc->rx.queue_restart++; - } } 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), added); - if (sc->rx.active_queue_len > sc->rx.max_active_queue_len) { + if (sc->rx.active_queue_len > sc->rx.max_active_queue_len) sc->rx.max_active_queue_len = sc->rx.active_queue_len; - } } static void From owner-svn-src-all@freebsd.org Sat Jan 21 23:35:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A237BCBBB83; Sat, 21 Jan 2017 23:35:55 +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 71DC787B; Sat, 21 Jan 2017 23:35:55 +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 v0LNZsAj095946; Sat, 21 Jan 2017 23:35:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0LNZsHe095945; Sat, 21 Jan 2017 23:35:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701212335.v0LNZsHe095945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 21 Jan 2017 23:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312609 - 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, 21 Jan 2017 23:35:55 -0000 Author: adrian Date: Sat Jan 21 23:35:54 2017 New Revision: 312609 URL: https://svnweb.freebsd.org/changeset/base/312609 Log: [ath] improve the debugging when looking into the maximum A-MPDU size being chosen. This is how I caught the "why are we only sending 8K aggregates?" problem. 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 Jan 21 23:07:15 2017 (r312608) +++ head/sys/dev/ath/if_ath_tx_ht.c Sat Jan 21 23:35:54 2017 (r312609) @@ -589,8 +589,14 @@ ath_get_aggr_limit(struct ath_softc *sc, amin = MIN(amin, bf->bf_state.bfs_rc[i].max4msframelen); } - DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: max frame len= %d\n", - __func__, amin); + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, + "%s: aggr_limit=%d, iv_ampdu_limit=%d, " + "peer maxrxampdu=%d, max frame len=%d\n", + __func__, + sc->sc_aggr_limit, + vap->iv_ampdu_limit, + MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU), + amin); return amin; #undef MS