svn commit: r304984 - stable/11/sys/ufs/ffs

2016-08-28 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 29 05:53:59 2016
New Revision: 304984
URL: https://svnweb.freebsd.org/changeset/base/304984

Log:
  MFC r304180:
  Implement VOP_FDATASYNC() for UFS.

Modified:
  stable/11/sys/ufs/ffs/ffs_extern.h
  stable/11/sys/ufs/ffs/ffs_vnops.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/ufs/ffs/ffs_extern.h
==
--- stable/11/sys/ufs/ffs/ffs_extern.h  Mon Aug 29 05:51:27 2016
(r304983)
+++ stable/11/sys/ufs/ffs/ffs_extern.h  Mon Aug 29 05:53:59 2016
(r304984)
@@ -174,6 +174,11 @@ void   softdep_freework(struct workhead *)
  * deadlock when flushing snapshot inodes while holding snaplk.
  */
 #defineNO_INO_UPDT 0x0001
+/*
+ * Request data sync only from ffs_syncvnode(), not touching even more
+ * metadata than NO_INO_UPDT.
+ */
+#defineDATA_ONLY   0x0002
 
 intffs_rdonly(struct inode *);
 

Modified: stable/11/sys/ufs/ffs/ffs_vnops.c
==
--- stable/11/sys/ufs/ffs/ffs_vnops.c   Mon Aug 29 05:51:27 2016
(r304983)
+++ stable/11/sys/ufs/ffs/ffs_vnops.c   Mon Aug 29 05:53:59 2016
(r304984)
@@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$");
 extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone);
 #endif
 static vop_fsync_t ffs_fsync;
+static vop_fdatasync_t ffs_fdatasync;
 static vop_lock1_t ffs_lock;
 static vop_read_t  ffs_read;
 static vop_write_t ffs_write;
@@ -123,6 +124,7 @@ static vop_vptofh_t ffs_vptofh;
 struct vop_vector ffs_vnodeops1 = {
.vop_default =  _vnodeops,
.vop_fsync =ffs_fsync,
+   .vop_fdatasync =ffs_fdatasync,
.vop_getpages = vnode_pager_local_getpages,
.vop_getpages_async =   vnode_pager_local_getpages_async,
.vop_lock1 =ffs_lock,
@@ -135,6 +137,7 @@ struct vop_vector ffs_vnodeops1 = {
 struct vop_vector ffs_fifoops1 = {
.vop_default =  _fifoops,
.vop_fsync =ffs_fsync,
+   .vop_fdatasync =ffs_fdatasync,
.vop_reallocblks =  ffs_reallocblks, /* XXX: really ??? */
.vop_vptofh =   ffs_vptofh,
 };
@@ -143,6 +146,7 @@ struct vop_vector ffs_fifoops1 = {
 struct vop_vector ffs_vnodeops2 = {
.vop_default =  _vnodeops,
.vop_fsync =ffs_fsync,
+   .vop_fdatasync =ffs_fdatasync,
.vop_getpages = vnode_pager_local_getpages,
.vop_getpages_async =   vnode_pager_local_getpages_async,
.vop_lock1 =ffs_lock,
@@ -161,6 +165,7 @@ struct vop_vector ffs_vnodeops2 = {
 struct vop_vector ffs_fifoops2 = {
.vop_default =  _fifoops,
.vop_fsync =ffs_fsync,
+   .vop_fdatasync =ffs_fdatasync,
.vop_lock1 =ffs_lock,
.vop_reallocblks =  ffs_reallocblks,
.vop_strategy = ffsext_strategy,
@@ -216,10 +221,10 @@ ffs_syncvnode(struct vnode *vp, int wait
 {
struct inode *ip;
struct bufobj *bo;
-   struct buf *bp;
-   struct buf *nbp;
+   struct buf *bp, *nbp;
ufs_lbn_t lbn;
-   int error, wait, passes;
+   int error, passes;
+   bool still_dirty, wait;
 
ip = VTOI(vp);
ip->i_flag &= ~IN_NEEDSYNC;
@@ -238,7 +243,7 @@ ffs_syncvnode(struct vnode *vp, int wait
 */
error = 0;
passes = 0;
-   wait = 0;   /* Always do an async pass first. */
+   wait = false;   /* Always do an async pass first. */
lbn = lblkno(ip->i_fs, (ip->i_size + ip->i_fs->fs_bsize - 1));
BO_LOCK(bo);
 loop:
@@ -254,15 +259,23 @@ loop:
if ((bp->b_vflags & BV_SCANNED) != 0)
continue;
bp->b_vflags |= BV_SCANNED;
-   /* Flush indirects in order. */
+   /*
+* Flush indirects in order, if requested.
+*
+* Note that if only datasync is requested, we can
+* skip indirect blocks when softupdates are not
+* active.  Otherwise we must flush them with data,
+* since dependencies prevent data block writes.
+*/
if (waitfor == MNT_WAIT && bp->b_lblkno <= -NDADDR &&
-   lbn_level(bp->b_lblkno) >= passes)
+   (lbn_level(bp->b_lblkno) >= passes ||
+   ((flags & DATA_ONLY) != 0 && !DOINGSOFTDEP(vp
continue;
if (bp->b_lblkno > lbn)
panic("ffs_syncvnode: syncing truncated data.");
if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0) {
BO_UNLOCK(bo);
-   } else if (wait != 0) {
+   } else if (wait) {
if 

svn commit: r304983 - in stable/11/sys: fs/smbfs fs/unionfs kern sys ufs/ffs ufs/ufs vm

2016-08-28 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 29 05:51:27 2016
New Revision: 304983
URL: https://svnweb.freebsd.org/changeset/base/304983

Log:
  MFC r303924 (by trasz):
  Eliminate vprint().

Modified:
  stable/11/sys/fs/smbfs/smbfs_node.c
  stable/11/sys/fs/unionfs/union_vnops.c
  stable/11/sys/kern/vfs_default.c
  stable/11/sys/kern/vfs_lookup.c
  stable/11/sys/kern/vfs_mount.c
  stable/11/sys/kern/vfs_subr.c
  stable/11/sys/sys/vnode.h
  stable/11/sys/ufs/ffs/ffs_snapshot.c
  stable/11/sys/ufs/ffs/ffs_vnops.c
  stable/11/sys/ufs/ufs/ufs_lookup.c
  stable/11/sys/ufs/ufs/ufs_quota.c
  stable/11/sys/vm/vm_object.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/smbfs/smbfs_node.c
==
--- stable/11/sys/fs/smbfs/smbfs_node.c Mon Aug 29 05:46:35 2016
(r304982)
+++ stable/11/sys/fs/smbfs/smbfs_node.c Mon Aug 29 05:51:27 2016
(r304983)
@@ -132,7 +132,7 @@ smbfs_node_alloc(struct mount *mp, struc
}
dnp = dvp ? VTOSMB(dvp) : NULL;
if (dnp == NULL && dvp != NULL) {
-   vprint("smbfs_node_alloc: dead parent vnode", dvp);
+   vn_printf(dvp, "smbfs_node_alloc: dead parent vnode ");
return EINVAL;
}
error = vfs_hash_get(mp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, td,

Modified: stable/11/sys/fs/unionfs/union_vnops.c
==
--- stable/11/sys/fs/unionfs/union_vnops.c  Mon Aug 29 05:46:35 2016
(r304982)
+++ stable/11/sys/fs/unionfs/union_vnops.c  Mon Aug 29 05:51:27 2016
(r304983)
@@ -1753,9 +1753,9 @@ unionfs_print(struct vop_print_args *ap)
*/
 
if (unp->un_uppervp != NULLVP)
-   vprint("unionfs: upper", unp->un_uppervp);
+   vn_printf(unp->un_uppervp, "unionfs: upper ");
if (unp->un_lowervp != NULLVP)
-   vprint("unionfs: lower", unp->un_lowervp);
+   vn_printf(unp->un_lowervp, "unionfs: lower ");
 
return (0);
 }

Modified: stable/11/sys/kern/vfs_default.c
==
--- stable/11/sys/kern/vfs_default.cMon Aug 29 05:46:35 2016
(r304982)
+++ stable/11/sys/kern/vfs_default.cMon Aug 29 05:51:27 2016
(r304983)
@@ -258,7 +258,7 @@ static int
 vop_nostrategy (struct vop_strategy_args *ap)
 {
printf("No strategy for buffer at %p\n", ap->a_bp);
-   vprint("vnode", ap->a_vp);
+   vn_printf(ap->a_vp, "vnode ");
ap->a_bp->b_ioflags |= BIO_ERROR;
ap->a_bp->b_error = EOPNOTSUPP;
bufdone(ap->a_bp);
@@ -723,7 +723,7 @@ loop2:
}
BO_UNLOCK(bo);
if (error == EAGAIN)
-   vprint("fsync: giving up on dirty", vp);
+   vn_printf(vp, "fsync: giving up on dirty ");
 
return (error);
 }

Modified: stable/11/sys/kern/vfs_lookup.c
==
--- stable/11/sys/kern/vfs_lookup.c Mon Aug 29 05:46:35 2016
(r304982)
+++ stable/11/sys/kern/vfs_lookup.c Mon Aug 29 05:51:27 2016
(r304983)
@@ -721,7 +721,7 @@ unionlookup:
if (needs_exclusive_leaf(dp->v_mount, cnp->cn_flags))
cnp->cn_lkflags = LK_EXCLUSIVE;
 #ifdef NAMEI_DIAGNOSTIC
-   vprint("lookup in", dp);
+   vn_printf(dp, "lookup in ");
 #endif
lkflags_save = cnp->cn_lkflags;
cnp->cn_lkflags = compute_cn_lkflags(dp->v_mount, cnp->cn_lkflags,
@@ -1007,7 +1007,7 @@ relookup(struct vnode *dvp, struct vnode
 * We now have a segment name to search for, and a directory to search.
 */
 #ifdef NAMEI_DIAGNOSTIC
-   vprint("search in:", dp);
+   vn_printf(dp, "search in ");
 #endif
if ((error = VOP_LOOKUP(dp, vpp, cnp)) != 0) {
KASSERT(*vpp == NULL, ("leaf should be empty"));

Modified: stable/11/sys/kern/vfs_mount.c
==
--- stable/11/sys/kern/vfs_mount.c  Mon Aug 29 05:46:35 2016
(r304982)
+++ stable/11/sys/kern/vfs_mount.c  Mon Aug 29 05:51:27 2016
(r304983)
@@ -510,7 +510,7 @@ vfs_mount_destroy(struct mount *mp)
struct vnode *vp;
 
TAILQ_FOREACH(vp, >mnt_nvnodelist, v_nmntvnodes)
-   vprint("", vp);
+   vn_printf(vp, "dangling vnode ");
panic("unmount: dangling vnode");
}
KASSERT(TAILQ_EMPTY(>mnt_uppers), ("mnt_uppers"));

Modified: stable/11/sys/kern/vfs_subr.c
==
--- stable/11/sys/kern/vfs_subr.c   Mon Aug 29 05:46:35 2016
(r304982)
+++ stable/11/sys/kern/vfs_subr.c   Mon Aug 29 05:51:27 2016
(r304983)
@@ -2645,7 +2645,7 @@ vputx(struct vnode *vp, int func)
error = 0;
 
  

svn commit: r304982 - stable/10/lib/libc/net

2016-08-28 Thread Ngie Cooper
Author: ngie
Date: Mon Aug 29 05:46:35 2016
New Revision: 304982
URL: https://svnweb.freebsd.org/changeset/base/304982

Log:
  MFstable/11 r304945:
  
  MFC r304034:
  
  Initialize `ai` to NULL and test for `ai` with type-appropriate values
  
  Depending on the address family and ai_flags containing AI_V4MAPPED,
  it might not do a proper DNS lookup on the provided DNS address
  
  Convert some `ai` boolean true/false checks to NULL/non-NULL while here.
  
  PR:   211790

Modified:
  stable/10/lib/libc/net/getaddrinfo.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/net/getaddrinfo.c
==
--- stable/10/lib/libc/net/getaddrinfo.cMon Aug 29 05:40:21 2016
(r304981)
+++ stable/10/lib/libc/net/getaddrinfo.cMon Aug 29 05:46:35 2016
(r304982)
@@ -2251,6 +2251,8 @@ _dns_getaddrinfo(void *rv, void *cb_data
struct res_target q, q2;
res_state res;
 
+   ai = NULL;
+
hostname = va_arg(ap, char *);
pai = va_arg(ap, const struct addrinfo *);
 
@@ -2329,16 +2331,16 @@ _dns_getaddrinfo(void *rv, void *cb_data
/* prefer IPv6 */
if (q.next) {
ai = getanswer(buf2, q2.n, q2.name, q2.qtype, pai, res);
-   if (ai) {
+   if (ai != NULL) {
cur->ai_next = ai;
while (cur && cur->ai_next)
cur = cur->ai_next;
}
}
-   if (!ai || pai->ai_family != AF_UNSPEC ||
+   if (ai == NULL || pai->ai_family != AF_UNSPEC ||
(pai->ai_flags & (AI_ALL | AI_V4MAPPED)) != AI_V4MAPPED) {
ai = getanswer(buf, q.n, q.name, q.qtype, pai, res);
-   if (ai)
+   if (ai != NULL)
cur->ai_next = ai;
}
free(buf);
___
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-unsubscr...@freebsd.org"


svn commit: r304981 - in stable/11/sys: fs/msdosfs kern sys

2016-08-28 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 29 05:40:21 2016
New Revision: 304981
URL: https://svnweb.freebsd.org/changeset/base/304981

Log:
  MFC r304178:
  Implement VOP_FDATASYNC() for msdosfs.

Modified:
  stable/11/sys/fs/msdosfs/msdosfs_vnops.c
  stable/11/sys/kern/vfs_default.c
  stable/11/sys/sys/vnode.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/msdosfs/msdosfs_vnops.c
==
--- stable/11/sys/fs/msdosfs/msdosfs_vnops.cMon Aug 29 05:37:03 2016
(r304980)
+++ stable/11/sys/fs/msdosfs/msdosfs_vnops.cMon Aug 29 05:40:21 2016
(r304981)
@@ -1897,6 +1897,7 @@ struct vop_vector msdosfs_vnodeops = {
.vop_close =msdosfs_close,
.vop_create =   msdosfs_create,
.vop_fsync =msdosfs_fsync,
+   .vop_fdatasync =vop_stdfdatasync_buf,
.vop_getattr =  msdosfs_getattr,
.vop_inactive = msdosfs_inactive,
.vop_link = msdosfs_link,

Modified: stable/11/sys/kern/vfs_default.c
==
--- stable/11/sys/kern/vfs_default.cMon Aug 29 05:37:03 2016
(r304980)
+++ stable/11/sys/kern/vfs_default.cMon Aug 29 05:40:21 2016
(r304981)
@@ -735,6 +735,17 @@ vop_stdfdatasync(struct vop_fdatasync_ar
return (VOP_FSYNC(ap->a_vp, MNT_WAIT, ap->a_td));
 }
 
+int
+vop_stdfdatasync_buf(struct vop_fdatasync_args *ap)
+{
+   struct vop_fsync_args apf;
+
+   apf.a_vp = ap->a_vp;
+   apf.a_waitfor = MNT_WAIT;
+   apf.a_td = ap->a_td;
+   return (vop_stdfsync());
+}
+
 /* XXX Needs good comment and more info in the manpage (VOP_GETPAGES(9)). */
 int
 vop_stdgetpages(ap)

Modified: stable/11/sys/sys/vnode.h
==
--- stable/11/sys/sys/vnode.h   Mon Aug 29 05:37:03 2016(r304980)
+++ stable/11/sys/sys/vnode.h   Mon Aug 29 05:40:21 2016(r304981)
@@ -741,6 +741,7 @@ int vfs_write_suspend(struct mount *mp, 
 intvfs_write_suspend_umnt(struct mount *mp);
 void   vnlru_free(int, struct vfsops *);
 intvop_stdbmap(struct vop_bmap_args *);
+intvop_stdfdatasync_buf(struct vop_fdatasync_args *);
 intvop_stdfsync(struct vop_fsync_args *);
 intvop_stdgetwritemount(struct vop_getwritemount_args *);
 intvop_stdgetpages(struct vop_getpages_args *);
___
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-unsubscr...@freebsd.org"


svn commit: r304980 - in stable/11: lib/libc/include lib/libc/sys lib/libthr/thread share/man/man3

2016-08-28 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 29 05:37:03 2016
New Revision: 304980
URL: https://svnweb.freebsd.org/changeset/base/304980

Log:
  MFC r304209:
  The fdatasync(2) call must be cancellation point.

Added:
  stable/11/lib/libc/sys/fdatasync.c
 - copied unchanged from r304209, head/lib/libc/sys/fdatasync.c
Modified:
  stable/11/lib/libc/include/libc_private.h
  stable/11/lib/libc/sys/Makefile.inc
  stable/11/lib/libc/sys/interposing_table.c
  stable/11/lib/libthr/thread/thr_syscalls.c
  stable/11/share/man/man3/pthread_testcancel.3
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/include/libc_private.h
==
--- stable/11/lib/libc/include/libc_private.h   Mon Aug 29 05:35:35 2016
(r304979)
+++ stable/11/lib/libc/include/libc_private.h   Mon Aug 29 05:37:03 2016
(r304980)
@@ -228,6 +228,7 @@ enum {
INTERPOS_wait6,
INTERPOS_ppoll,
INTERPOS_map_stacks_exec,
+   INTERPOS_fdatasync,
INTERPOS_MAX
 };
 
@@ -318,6 +319,7 @@ int __sys_clock_gettime(__clockid_t, st
 int__sys_close(int);
 int__sys_connect(int, const struct sockaddr *, __socklen_t);
 int__sys_fcntl(int, int, ...);
+int__sys_fdatasync(int);
 int__sys_fsync(int);
 __pid_t__sys_fork(void);
 int__sys_ftruncate(int, __off_t);

Modified: stable/11/lib/libc/sys/Makefile.inc
==
--- stable/11/lib/libc/sys/Makefile.inc Mon Aug 29 05:35:35 2016
(r304979)
+++ stable/11/lib/libc/sys/Makefile.inc Mon Aug 29 05:37:03 2016
(r304980)
@@ -37,6 +37,7 @@ INTERPOSED = \
close \
connect \
fcntl \
+   fdatasync \
fsync \
fork \
kevent \

Copied: stable/11/lib/libc/sys/fdatasync.c (from r304209, 
head/lib/libc/sys/fdatasync.c)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/lib/libc/sys/fdatasync.c  Mon Aug 29 05:37:03 2016
(r304980, copy of r304209, head/lib/libc/sys/fdatasync.c)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2016 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(s), this list of conditions and the following disclaimer as
+ *the first lines of this file unmodified other than the possible
+ *addition of one or more copyright notices.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice(s), 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 HOLDER(S) ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include "libc_private.h"
+
+int
+fdatasync(int fd)
+{
+
+   return (((int (*)(int))__libc_interposing[INTERPOS_fdatasync])(fd));
+}

Modified: stable/11/lib/libc/sys/interposing_table.c
==
--- stable/11/lib/libc/sys/interposing_table.c  Mon Aug 29 05:35:35 2016
(r304979)
+++ stable/11/lib/libc/sys/interposing_table.c  Mon Aug 29 05:37:03 2016
(r304980)
@@ -79,6 +79,7 @@ interpos_func_t __libc_interposing[INTER
SLOT(wait6, __sys_wait6),
SLOT(ppoll, __sys_ppoll),
SLOT(map_stacks_exec, __libc_map_stacks_exec),
+   SLOT(fdatasync, __sys_fdatasync),
 };
 #undef SLOT
 

Modified: stable/11/lib/libthr/thread/thr_syscalls.c
==
--- stable/11/lib/libthr/thread/thr_syscalls.c  Mon Aug 29 05:35:35 2016
(r304979)
+++ stable/11/lib/libthr/thread/thr_syscalls.c  Mon Aug 29 05:37:03 2016

svn commit: r304979 - head/sys/dev/hyperv/netvsc

2016-08-28 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Aug 29 05:35:35 2016
New Revision: 304979
URL: https://svnweb.freebsd.org/changeset/base/304979

Log:
  hyperv/hn: Switch to new RNDIS set for RSS parameters.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7658

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.h
  head/sys/dev/hyperv/netvsc/hv_rndis.h
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
  head/sys/dev/hyperv/netvsc/ndis.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Aug 29 05:17:44 2016
(r304978)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Mon Aug 29 05:35:35 2016
(r304979)
@@ -62,6 +62,8 @@
 #include 
 #include 
 
+#include 
+
 #define HN_USE_TXDESC_BUFRING
 
 MALLOC_DECLARE(M_NETVSC);
@@ -383,6 +385,8 @@ typedef struct hn_softc {
 
uint32_thn_rndis_rid;
uint32_thn_ndis_ver;
+
+   struct ndis_rssprm_toeplitz hn_rss;
 } hn_softc_t;
 
 #define HN_FLAG_RXBUF_CONNECTED0x0001

Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h
==
--- head/sys/dev/hyperv/netvsc/hv_rndis.h   Mon Aug 29 05:17:44 2016
(r304978)
+++ head/sys/dev/hyperv/netvsc/hv_rndis.h   Mon Aug 29 05:35:35 2016
(r304979)
@@ -536,20 +536,6 @@ struct rndis_hash_info {
uint32_thash_info;
 } __packed;
 
-#define NDIS_HASH_FUNCTION_MASK0x00FF  /* see hash 
function */
-#define NDIS_HASH_TYPE_MASK0x0000  /* see hash type */
-
-/* hash function */
-#define NDIS_HASH_FUNCTION_TOEPLITZ0x0001
-
-/* hash type */
-#define NDIS_HASH_IPV4 0x0100
-#define NDIS_HASH_TCP_IPV4 0x0200
-#define NDIS_HASH_IPV6 0x0400
-#define NDIS_HASH_IPV6_EX  0x0800
-#define NDIS_HASH_TCP_IPV6 0x1000
-#define NDIS_HASH_TCP_IPV6_EX  0x2000
-
 typedef struct rndis_tcp_tso_info_ {
union {
struct {

Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.cMon Aug 29 05:17:44 
2016(r304978)
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.cMon Aug 29 05:35:35 
2016(r304979)
@@ -101,6 +101,7 @@ static int hn_rndis_set(struct hn_softc 
 size_t dlen);
 static int hn_rndis_conf_offload(struct hn_softc *sc);
 static int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt);
+static int hn_rndis_conf_rss(struct hn_softc *sc, int nchan);
 
 static __inline uint32_t
 hn_rndis_rid(struct hn_softc *sc)
@@ -670,7 +671,7 @@ hv_rf_query_device_link_status(rndis_dev
return (0);
 }
 
-static uint8_t netvsc_hash_key[HASH_KEYLEN] = {
+static uint8_t netvsc_hash_key[NDIS_HASH_KEYSIZE_TOEPLITZ] = {
0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
@@ -679,106 +680,6 @@ static uint8_t netvsc_hash_key[HASH_KEYL
 };
 
 /*
- * RNDIS set vRSS parameters
- */
-static int
-hv_rf_set_rss_param(rndis_device *device, int num_queue)
-{
-   rndis_request *request;
-   rndis_set_request *set;
-   rndis_set_complete *set_complete;
-   rndis_recv_scale_param *rssp;
-   uint32_t extlen = sizeof(rndis_recv_scale_param) +
-   (4 * ITAB_NUM) + HASH_KEYLEN;
-   uint32_t *itab, status;
-   uint8_t *keyp;
-   int i, ret;
-
-
-   request = hv_rndis_request(device, REMOTE_NDIS_SET_MSG,
-   RNDIS_MESSAGE_SIZE(rndis_set_request) + extlen);
-   if (request == NULL) {
-   if (bootverbose)
-   printf("Netvsc: No memory to set vRSS parameters.\n");
-   ret = -1;
-   goto cleanup;
-   }
-
-   set = >request_msg.msg.set_request;
-   set->oid = RNDIS_OID_GEN_RSS_PARAMETERS;
-   set->info_buffer_length = extlen;
-   set->info_buffer_offset = sizeof(rndis_set_request);
-   set->device_vc_handle = 0;
-
-   /* Fill out the rssp parameter structure */
-   rssp = (rndis_recv_scale_param *)(set + 1);
-   rssp->hdr.type = RNDIS_OBJECT_TYPE_RSS_PARAMETERS;
-   rssp->hdr.rev = RNDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2;
-   rssp->hdr.size = sizeof(rndis_recv_scale_param);
-   rssp->flag = 0;
-   rssp->hashinfo = RNDIS_HASH_FUNC_TOEPLITZ | RNDIS_HASH_IPV4 |
-   RNDIS_HASH_TCP_IPV4 | RNDIS_HASH_IPV6 | RNDIS_HASH_TCP_IPV6;
-   rssp->indirect_tabsize = 4 * ITAB_NUM;
-   rssp->indirect_taboffset = sizeof(rndis_recv_scale_param);
-   rssp->hashkey_size = HASH_KEYLEN;
-   rssp->hashkey_offset = rssp->indirect_taboffset +
-   

svn commit: r304978 - in stable/11/sys: compat/freebsd32 kern sys

2016-08-28 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 29 05:17:44 2016
New Revision: 304978
URL: https://svnweb.freebsd.org/changeset/base/304978

Log:
  Regen

Modified:
  stable/11/sys/compat/freebsd32/freebsd32_proto.h
  stable/11/sys/compat/freebsd32/freebsd32_syscall.h
  stable/11/sys/compat/freebsd32/freebsd32_syscalls.c
  stable/11/sys/compat/freebsd32/freebsd32_sysent.c
  stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c
  stable/11/sys/kern/init_sysent.c
  stable/11/sys/kern/syscalls.c
  stable/11/sys/kern/systrace_args.c
  stable/11/sys/sys/syscall.h
  stable/11/sys/sys/syscall.mk
  stable/11/sys/sys/sysproto.h

Modified: stable/11/sys/compat/freebsd32/freebsd32_proto.h
==
--- stable/11/sys/compat/freebsd32/freebsd32_proto.hMon Aug 29 05:15:43 
2016(r304977)
+++ stable/11/sys/compat/freebsd32/freebsd32_proto.hMon Aug 29 05:17:44 
2016(r304978)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 302094 
2016-06-22 21:15:59Z brooks 
+ * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 
2016-08-29 05:15:43Z kib 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_

Modified: stable/11/sys/compat/freebsd32/freebsd32_syscall.h
==
--- stable/11/sys/compat/freebsd32/freebsd32_syscall.h  Mon Aug 29 05:15:43 
2016(r304977)
+++ stable/11/sys/compat/freebsd32/freebsd32_syscall.h  Mon Aug 29 05:17:44 
2016(r304978)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 302094 
2016-06-22 21:15:59Z brooks 
+ * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 
2016-08-29 05:15:43Z kib 
  */
 
 #defineFREEBSD32_SYS_syscall   0
@@ -457,4 +457,5 @@
 #defineFREEBSD32_SYS_freebsd32_utimensat   547
 #defineFREEBSD32_SYS_numa_getaffinity  548
 #defineFREEBSD32_SYS_numa_setaffinity  549
-#defineFREEBSD32_SYS_MAXSYSCALL550
+#defineFREEBSD32_SYS_fdatasync 550
+#defineFREEBSD32_SYS_MAXSYSCALL551

Modified: stable/11/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- stable/11/sys/compat/freebsd32/freebsd32_syscalls.c Mon Aug 29 05:15:43 
2016(r304977)
+++ stable/11/sys/compat/freebsd32/freebsd32_syscalls.c Mon Aug 29 05:17:44 
2016(r304978)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 302094 
2016-06-22 21:15:59Z brooks 
+ * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 
2016-08-29 05:15:43Z kib 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -583,4 +583,5 @@ const char *freebsd32_syscallnames[] = {
"freebsd32_utimensat",  /* 547 = freebsd32_utimensat */
"numa_getaffinity", /* 548 = numa_getaffinity */
"numa_setaffinity", /* 549 = numa_setaffinity */
+   "fdatasync",/* 550 = fdatasync */
 };

Modified: stable/11/sys/compat/freebsd32/freebsd32_sysent.c
==
--- stable/11/sys/compat/freebsd32/freebsd32_sysent.c   Mon Aug 29 05:15:43 
2016(r304977)
+++ stable/11/sys/compat/freebsd32/freebsd32_sysent.c   Mon Aug 29 05:17:44 
2016(r304978)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 302094 
2016-06-22 21:15:59Z brooks 
+ * created from FreeBSD: stable/11/sys/compat/freebsd32/syscalls.master 304977 
2016-08-29 05:15:43Z kib 
  */
 
 #include "opt_compat.h"
@@ -626,4 +626,5 @@ struct sysent freebsd32_sysent[] = {
{ AS(freebsd32_utimensat_args), (sy_call_t *)freebsd32_utimensat, 
AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC },/* 547 = 
freebsd32_utimensat */
{ AS(numa_getaffinity_args), (sy_call_t *)sys_numa_getaffinity, 
AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },   /* 548 = numa_getaffinity */
{ AS(numa_setaffinity_args), (sy_call_t *)sys_numa_setaffinity, 
AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },   /* 549 = numa_setaffinity */
+   { AS(fdatasync_args), (sy_call_t *)sys_fdatasync, AUE_FSYNC, NULL, 0, 
0, 0, SY_THR_STATIC },/* 550 = fdatasync */
 };

Modified: stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c
==
--- stable/11/sys/compat/freebsd32/freebsd32_systrace_args.cMon Aug 29 
05:15:43 2016(r304977)
+++ 

svn commit: r304977 - in stable/11: include lib/libc/sys sys/compat/freebsd32 sys/kern

2016-08-28 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 29 05:15:43 2016
New Revision: 304977
URL: https://svnweb.freebsd.org/changeset/base/304977

Log:
  MFC r304176:
  Add a trivial implementation of fdatasync(2).

Modified:
  stable/11/include/unistd.h
  stable/11/lib/libc/sys/Symbol.map
  stable/11/sys/compat/freebsd32/syscalls.master
  stable/11/sys/kern/syscalls.master
  stable/11/sys/kern/vfs_default.c
  stable/11/sys/kern/vfs_syscalls.c
  stable/11/sys/kern/vnode_if.src
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/include/unistd.h
==
--- stable/11/include/unistd.h  Mon Aug 29 05:08:53 2016(r304976)
+++ stable/11/include/unistd.h  Mon Aug 29 05:15:43 2016(r304977)
@@ -384,6 +384,7 @@ extern int optind, opterr, optopt;
 /* ISO/IEC 9945-1: 1996 */
 #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
 int fsync(int);
+int fdatasync(int);
 
 /*
  * ftruncate() was in the POSIX Realtime Extension (it's used for shared

Modified: stable/11/lib/libc/sys/Symbol.map
==
--- stable/11/lib/libc/sys/Symbol.map   Mon Aug 29 05:08:53 2016
(r304976)
+++ stable/11/lib/libc/sys/Symbol.map   Mon Aug 29 05:15:43 2016
(r304977)
@@ -398,6 +398,10 @@ FBSD_1.4 {
recvmmsg;
 };
 
+FBSD_1.5 {
+fdatasync;
+};
+
 FBSDprivate_1.0 {
___acl_aclcheck_fd;
__sys___acl_aclcheck_fd;
@@ -588,6 +592,8 @@ FBSDprivate_1.0 {
__sys_fstatfs;
_fsync;
__sys_fsync;
+   _fdatasync;
+   __sys_fdatasync;
_futimes;
__sys_futimes;
_getaudit;

Modified: stable/11/sys/compat/freebsd32/syscalls.master
==
--- stable/11/sys/compat/freebsd32/syscalls.master  Mon Aug 29 05:08:53 
2016(r304976)
+++ stable/11/sys/compat/freebsd32/syscalls.master  Mon Aug 29 05:15:43 
2016(r304977)
@@ -1081,3 +1081,4 @@
 549AUE_NULLNOPROTO { int numa_setaffinity(cpuwhich_t which, \
id_t id, \
const struct vm_domain_policy *policy); }
+550AUE_FSYNC   NOPROTO { int fdatasync(int fd); }

Modified: stable/11/sys/kern/syscalls.master
==
--- stable/11/sys/kern/syscalls.master  Mon Aug 29 05:08:53 2016
(r304976)
+++ stable/11/sys/kern/syscalls.master  Mon Aug 29 05:15:43 2016
(r304977)
@@ -993,8 +993,9 @@
id_t id, \
struct vm_domain_policy_entry *policy); }
 549AUE_NULLSTD { int numa_setaffinity(cpuwhich_t which, \
-   id_t id, \
-   const struct vm_domain_policy_entry 
*policy); }
+   id_t id, const struct \
+   vm_domain_policy_entry *policy); }
+550AUE_FSYNC   STD { int fdatasync(int fd); }
 
 ; Please copy any additions and changes to the following compatability tables:
 ; sys/compat/freebsd32/syscalls.master

Modified: stable/11/sys/kern/vfs_default.c
==
--- stable/11/sys/kern/vfs_default.cMon Aug 29 05:08:53 2016
(r304976)
+++ stable/11/sys/kern/vfs_default.cMon Aug 29 05:15:43 2016
(r304977)
@@ -83,6 +83,7 @@ static int vop_stdset_text(struct vop_se
 static int vop_stdunset_text(struct vop_unset_text_args *ap);
 static int vop_stdget_writecount(struct vop_get_writecount_args *ap);
 static int vop_stdadd_writecount(struct vop_add_writecount_args *ap);
+static int vop_stdfdatasync(struct vop_fdatasync_args *ap);
 static int vop_stdgetpages_async(struct vop_getpages_async_args *ap);
 
 /*
@@ -111,6 +112,7 @@ struct vop_vector default_vnodeops = {
.vop_bmap = vop_stdbmap,
.vop_close =VOP_NULL,
.vop_fsync =VOP_NULL,
+   .vop_fdatasync =vop_stdfdatasync,
.vop_getpages = vop_stdgetpages,
.vop_getpages_async =   vop_stdgetpages_async,
.vop_getwritemount =vop_stdgetwritemount,
@@ -726,6 +728,13 @@ loop2:
return (error);
 }
 
+static int
+vop_stdfdatasync(struct vop_fdatasync_args *ap)
+{
+
+   return (VOP_FSYNC(ap->a_vp, MNT_WAIT, ap->a_td));
+}
+
 /* XXX Needs good comment and more info in the manpage (VOP_GETPAGES(9)). */
 int
 vop_stdgetpages(ap)

Modified: stable/11/sys/kern/vfs_syscalls.c
==
--- stable/11/sys/kern/vfs_syscalls.c   Mon Aug 29 05:08:53 2016
(r304976)
+++ stable/11/sys/kern/vfs_syscalls.c   Mon Aug 29 05:15:43 2016
(r304977)
@@ -3354,20 +3354,8 @@ freebsd6_ftruncate(struct thread *td, st
 

svn commit: r304976 - head/sys/dev/hyperv/netvsc

2016-08-28 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Aug 29 05:08:53 2016
New Revision: 304976
URL: https://svnweb.freebsd.org/changeset/base/304976

Log:
  hyperv/hn: Fix # of channels setting, if RSS is not available.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7657

Modified:
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.c

Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.cMon Aug 29 04:54:13 
2016(r304975)
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.cMon Aug 29 05:08:53 
2016(r304976)
@@ -1377,8 +1377,14 @@ hv_rf_on_device_add(struct hn_softc *sc,

dev_info->link_state = rndis_dev->link_status;
 
-   if (sc->hn_ndis_ver < NDIS_VERSION_6_30 || nchan == 1)
+   if (sc->hn_ndis_ver < NDIS_VERSION_6_30 || nchan == 1) {
+   /*
+* Either RSS is not supported, or multiple RX/TX rings
+* are not requested.
+*/
+   *nchan0 = 1;
return (0);
+   }
 
/*
 * Get RSS capabilities, e.g. # of RX rings, and # of indirect
@@ -1386,9 +1392,9 @@ hv_rf_on_device_add(struct hn_softc *sc,
 */
ret = hn_rndis_get_rsscaps(sc, _cnt);
if (ret) {
-   /* This is benign. */
-   ret = 0;
-   goto out;
+   /* No RSS; this is benign. */
+   *nchan0 = 1;
+   return (0);
}
if (nchan > rxr_cnt)
nchan = rxr_cnt;
___
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-unsubscr...@freebsd.org"


svn commit: r304975 - head/sys/dev/hyperv/netvsc

2016-08-28 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Aug 29 04:54:13 2016
New Revision: 304975
URL: https://svnweb.freebsd.org/changeset/base/304975

Log:
  hyperv/hn: Switch to new RNDIS query for RSS capabilities extraction.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7656

Modified:
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
  head/sys/dev/hyperv/netvsc/ndis.h

Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.cMon Aug 29 04:45:58 
2016(r304974)
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.cMon Aug 29 04:54:13 
2016(r304975)
@@ -79,8 +79,6 @@ static void hv_rf_receive_indicate_statu
 const rndis_msg *response);
 static void hv_rf_receive_data(struct hn_rx_ring *rxr,
 const void *data, int dlen);
-static int  hv_rf_query_device(rndis_device *device, uint32_t oid,
-  void *result, uint32_t *result_size);
 static inline int hv_rf_query_device_mac(rndis_device *device);
 static inline int hv_rf_query_device_link_status(rndis_device *device);
 static int  hv_rf_set_packet_filter(rndis_device *device, uint32_t new_filter);
@@ -102,6 +100,7 @@ static int hn_rndis_query(struct hn_soft
 static int hn_rndis_set(struct hn_softc *sc, uint32_t oid, const void *data,
 size_t dlen);
 static int hn_rndis_conf_offload(struct hn_softc *sc);
+static int hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt);
 
 static __inline uint32_t
 hn_rndis_rid(struct hn_softc *sc)
@@ -628,77 +627,6 @@ hv_rf_on_receive(struct hn_softc *sc, st
 }
 
 /*
- * RNDIS filter query device
- */
-static int
-hv_rf_query_device(rndis_device *device, uint32_t oid, void *result,
-  uint32_t *result_size)
-{
-   rndis_request *request;
-   uint32_t in_result_size = *result_size;
-   rndis_query_request *query;
-   rndis_query_complete *query_complete;
-   int ret = 0;
-
-   *result_size = 0;
-   request = hv_rndis_request(device, REMOTE_NDIS_QUERY_MSG,
-   RNDIS_MESSAGE_SIZE(rndis_query_request));
-   if (request == NULL) {
-   ret = -1;
-   goto cleanup;
-   }
-
-   /* Set up the rndis query */
-   query = >request_msg.msg.query_request;
-   query->oid = oid;
-   query->info_buffer_offset = sizeof(rndis_query_request); 
-   query->info_buffer_length = 0;
-   query->device_vc_handle = 0;
-
-   if (oid == RNDIS_OID_GEN_RSS_CAPABILITIES) {
-   struct rndis_recv_scale_cap *cap;
-
-   request->request_msg.msg_len += 
-   sizeof(struct rndis_recv_scale_cap);
-   query->info_buffer_length = sizeof(struct rndis_recv_scale_cap);
-   cap = (struct rndis_recv_scale_cap *)((unsigned long)query + 
-   query->info_buffer_offset);
-   cap->hdr.type = RNDIS_OBJECT_TYPE_RSS_CAPABILITIES;
-   cap->hdr.rev = RNDIS_RECEIVE_SCALE_CAPABILITIES_REVISION_2;
-   cap->hdr.size = sizeof(struct rndis_recv_scale_cap);
-   }
-
-   ret = hv_rf_send_request(device, request, REMOTE_NDIS_QUERY_MSG);
-   if (ret != 0) {
-   /* Fixme:  printf added */
-   printf("RNDISFILTER request failed to Send!\n");
-   goto cleanup;
-   }
-
-   sema_wait(>wait_sema);
-
-   /* Copy the response back */
-   query_complete = >response_msg.msg.query_complete;
-   
-   if (query_complete->info_buffer_length > in_result_size) {
-   ret = EINVAL;
-   goto cleanup;
-   }
-
-   memcpy(result, (void *)((unsigned long)query_complete +
-   query_complete->info_buffer_offset),
-   query_complete->info_buffer_length);
-
-   *result_size = query_complete->info_buffer_length;
-
-cleanup:
-   if (request != NULL)
-   hv_put_rndis_request(device, request);
-
-   return (ret);
-}
-
-/*
  * RNDIS filter query device MAC address
  */
 static int
@@ -1093,6 +1021,51 @@ done:
 }
 
 static int
+hn_rndis_get_rsscaps(struct hn_softc *sc, int *rxr_cnt)
+{
+   struct ndis_rss_caps in, caps;
+   size_t caps_len;
+   int error;
+
+   /*
+* Only NDIS 6.30+ is supported.
+*/
+   KASSERT(sc->hn_ndis_ver >= NDIS_VERSION_6_30,
+   ("NDIS 6.30+ is required, NDIS version 0x%08x", sc->hn_ndis_ver));
+   *rxr_cnt = 0;
+
+   memset(, 0, sizeof(in));
+   in.ndis_hdr.ndis_type = NDIS_OBJTYPE_RSS_CAPS;
+   in.ndis_hdr.ndis_rev = NDIS_RSS_CAPS_REV_2;
+   in.ndis_hdr.ndis_size = NDIS_RSS_CAPS_SIZE;
+
+   caps_len = NDIS_RSS_CAPS_SIZE;
+   error = hn_rndis_query(sc, OID_GEN_RSS_CAPABILITIES,
+   , NDIS_RSS_CAPS_SIZE, , _len);
+   if (error)
+   return (error);
+   if (caps_len < 

svn commit: r304974 - stable/11/sys/kern

2016-08-28 Thread Konstantin Belousov
Author: kib
Date: Mon Aug 29 04:45:58 2016
New Revision: 304974
URL: https://svnweb.freebsd.org/changeset/base/304974

Log:
  MFC r303548:
  Cache getbintime(9) answer in timehands.

Modified:
  stable/11/sys/kern/kern_tc.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_tc.c
==
--- stable/11/sys/kern/kern_tc.cMon Aug 29 04:44:24 2016
(r304973)
+++ stable/11/sys/kern/kern_tc.cMon Aug 29 04:45:58 2016
(r304974)
@@ -68,6 +68,7 @@ struct timehands {
uint64_tth_scale;
u_int   th_offset_count;
struct bintime  th_offset;
+   struct bintime  th_bintime;
struct timeval  th_microtime;
struct timespec th_nanotime;
struct bintime  th_boottime;
@@ -235,9 +236,8 @@ fbclock_bintime(struct bintime *bt)
do {
th = timehands;
gen = atomic_load_acq_int(>th_generation);
-   *bt = th->th_offset;
+   *bt = th->th_bintime;
bintime_addx(bt, th->th_scale * tc_delta(th));
-   bintime_add(bt, >th_boottime);
atomic_thread_fence_acq();
} while (gen == 0 || gen != th->th_generation);
 }
@@ -311,8 +311,7 @@ fbclock_getbintime(struct bintime *bt)
do {
th = timehands;
gen = atomic_load_acq_int(>th_generation);
-   *bt = th->th_offset;
-   bintime_add(bt, >th_boottime);
+   *bt = th->th_bintime;
atomic_thread_fence_acq();
} while (gen == 0 || gen != th->th_generation);
 }
@@ -387,9 +386,8 @@ bintime(struct bintime *bt)
do {
th = timehands;
gen = atomic_load_acq_int(>th_generation);
-   *bt = th->th_offset;
+   *bt = th->th_bintime;
bintime_addx(bt, th->th_scale * tc_delta(th));
-   bintime_add(bt, >th_boottime);
atomic_thread_fence_acq();
} while (gen == 0 || gen != th->th_generation);
 }
@@ -463,8 +461,7 @@ getbintime(struct bintime *bt)
do {
th = timehands;
gen = atomic_load_acq_int(>th_generation);
-   *bt = th->th_offset;
-   bintime_add(bt, >th_boottime);
+   *bt = th->th_bintime;
atomic_thread_fence_acq();
} while (gen == 0 || gen != th->th_generation);
 }
@@ -1389,6 +1386,8 @@ tc_windup(struct bintime *new_boottimebi
if (bt.sec != t)
th->th_boottime.sec += bt.sec - t;
}
+   th->th_bintime = th->th_offset;
+   bintime_add(>th_bintime, >th_boottime);
/* Update the UTC timestamps used by the get*() functions. */
/* XXX shouldn't do this here.  Should force non-`get' versions. */
bintime2timeval(, >th_microtime);
@@ -1808,9 +1807,8 @@ pps_event(struct pps_state *pps, int eve
/* Convert the count to a timespec. */
tcount = pps->capcount - pps->capth->th_offset_count;
tcount &= pps->capth->th_counter->tc_counter_mask;
-   bt = pps->capth->th_offset;
+   bt = pps->capth->th_bintime;
bintime_addx(, pps->capth->th_scale * tcount);
-   bintime_add(, >capth->th_boottime);
bintime2timespec(, );
 
/* If the timecounter was wound up underneath us, bail out. */
___
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-unsubscr...@freebsd.org"


svn commit: r304973 - head/sys/dev/hyperv/netvsc

2016-08-28 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Aug 29 04:44:24 2016
New Revision: 304973
URL: https://svnweb.freebsd.org/changeset/base/304973

Log:
  hyperv/hn: Switch to new RNDIS query for link status extraction.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7654

Modified:
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.c

Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.cMon Aug 29 03:22:56 
2016(r304972)
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.cMon Aug 29 04:44:24 
2016(r304973)
@@ -712,12 +712,12 @@ hv_rf_query_device_mac(rndis_device *dev
error = hn_rndis_query(sc, OID_802_3_PERMANENT_ADDRESS, NULL, 0,
device->hw_mac_addr, _len);
if (error)
-   return error;
+   return (error);
if (hwaddr_len != ETHER_ADDR_LEN) {
if_printf(sc->hn_ifp, "invalid hwaddr len %zu\n", hwaddr_len);
-   return EINVAL;
+   return (EINVAL);
}
-   return 0;
+   return (0);
 }
 
 /*
@@ -726,10 +726,20 @@ hv_rf_query_device_mac(rndis_device *dev
 static inline int
 hv_rf_query_device_link_status(rndis_device *device)
 {
-   uint32_t size = sizeof(uint32_t);
+   struct hn_softc *sc = device->sc;
+   size_t size;
+   int error;
 
-   return (hv_rf_query_device(device,
-   RNDIS_OID_GEN_MEDIA_CONNECT_STATUS, >link_status, ));
+   size = sizeof(uint32_t);
+   error = hn_rndis_query(sc, OID_GEN_MEDIA_CONNECT_STATUS, NULL, 0,
+   >link_status, );
+   if (error)
+   return (error);
+   if (size != sizeof(uint32_t)) {
+   if_printf(sc->hn_ifp, "invalid link status len %zu\n", size);
+   return (EINVAL);
+   }
+   return (0);
 }
 
 static uint8_t netvsc_hash_key[HASH_KEYLEN] = {
___
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-unsubscr...@freebsd.org"


svn commit: r304972 - head/sys/dev/hyperv/netvsc

2016-08-28 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Aug 29 03:22:56 2016
New Revision: 304972
URL: https://svnweb.freebsd.org/changeset/base/304972

Log:
  hyperv/hn: Add definition for NDIS media state.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7652

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
  head/sys/dev/hyperv/netvsc/ndis.h

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Mon Aug 29 01:59:18 
2016(r304971)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Mon Aug 29 03:22:56 
2016(r304972)
@@ -117,9 +117,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include "hv_net_vsc.h"
-#include "hv_rndis.h"
-#include "hv_rndis_filter.h"
+#include 
+#include 
+#include 
+#include 
+
 #include "vmbus_if.h"
 
 /* Short for Hyper-V network interface */
@@ -584,7 +586,7 @@ netvsc_attach(device_t dev)
}
 #endif
 
-   if (device_info.link_state == 0) {
+   if (device_info.link_state == NDIS_MEDIA_STATE_CONNECTED) {
sc->hn_carrier = 1;
}
 

Modified: head/sys/dev/hyperv/netvsc/ndis.h
==
--- head/sys/dev/hyperv/netvsc/ndis.h   Mon Aug 29 01:59:18 2016
(r304971)
+++ head/sys/dev/hyperv/netvsc/ndis.h   Mon Aug 29 03:22:56 2016
(r304972)
@@ -29,6 +29,9 @@
 #ifndef _NET_NDIS_H_
 #define _NET_NDIS_H_
 
+#define NDIS_MEDIA_STATE_CONNECTED 0
+#define NDIS_MEDIA_STATE_DISCONNECTED  1
+
 #define OID_TCP_OFFLOAD_PARAMETERS 0xFC01020C
 
 #define NDIS_OBJTYPE_DEFAULT   0x80
___
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-unsubscr...@freebsd.org"


svn commit: r304971 - head/sys/dev/mfi

2016-08-28 Thread John Baldwin
Author: jhb
Date: Mon Aug 29 01:59:18 2016
New Revision: 304971
URL: https://svnweb.freebsd.org/changeset/base/304971

Log:
  Add missing array subscript.
  
  This fixes a tautological pointer comparison warning, but would also a
  real bug for a platform where bus_dmamap_unload of a static allocation
  is not a no-op.

Modified:
  head/sys/dev/mfi/mfi.c

Modified: head/sys/dev/mfi/mfi.c
==
--- head/sys/dev/mfi/mfi.c  Sun Aug 28 21:31:21 2016(r304970)
+++ head/sys/dev/mfi/mfi.c  Mon Aug 29 01:59:18 2016(r304971)
@@ -3361,7 +3361,7 @@ out:
if (cm->cm_frame->header.cmd == MFI_CMD_STP) {
for (i = 0; i < 2; i++) {
if (sc->kbuff_arr[i]) {
-   if (sc->mfi_kbuff_arr_busaddr != 0)
+   if (sc->mfi_kbuff_arr_busaddr[i] != 0)
bus_dmamap_unload(
sc->mfi_kbuff_arr_dmat[i],
sc->mfi_kbuff_arr_dmamap[i]
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys

2016-08-28 Thread John Baldwin
On Sunday, August 28, 2016 04:52:10 AM Konstantin Belousov wrote:
> On Sun, Aug 28, 2016 at 04:25:46AM +0300, Andrey Chernov wrote:
> > On 28.08.2016 4:15, Konstantin Belousov wrote:
> > >> POSIX: "No function in this volume of POSIX.1-2008 shall set errno to 
> > >> zero."
> > > I am quite curious where ptrace(2) is defined by POSIX.
> > 
> > POSIX just repeats C99 statement for its own functions, supporting this
> > rule too, but C99 rule is more general and related to any library functions.
> > 
> > >> POSIX: "For each thread of a process, the value of errno shall not be
> > >> affected by function calls or assignments to errno by other threads."
> > > And ?  What should the citation add new to the substance
> > > of the code change ?
> > 
> > This is for your comment "On both i386 and amd64, the errno symbol was
> > directly  referenced, which only works correctly in single-threaded
> > process."
> I still do not understand what you want to say there. Errno as the
> symbol existing in the symbol table of libc, gives 'POSIX errno' value
> for the main thread. Preprocessor definition converts C language
> accesses to errno into some indirections which result in accesses to
> per-thread errno location. The bug in x86 asm code was due to direct
> usage of errno.
> 
> What POSIX requires from the C-level errno symbol does not define a
> semantic for the memory location pointed to by the errno sym-table
> symbol.
> 
> And amusingly, all other arches did it right, except aarch64 and risc-v
> copied from aarch64.  They lack the wrapper at all, I wrote aarch64
> ptrace.S already.

OTOH, given that we explicitly documented it as not being true, I suspect
any applications that are using ptrace() are going off the documentation, not
the implementation artifact.  Note that Linux's ptrace() documents the same
requirement as before this change (caller is required to clear errno), so I
doubt there is any actual software out there that expects the
FreeBSD-specific behavior.  Given that and the extra maintenance overhead of
having to dink with errno in assembly on X architectures, I'd rather we keep
the old language in the manpage and remove the 'errno' frobbing in the system
call wrappers.  To be honest, my first response to this commit was one of
surprise that we modify errno directly as that is inconsistent with other
system calls.  (I haven't looked to see if any other system call wrappers
modify errno for non-error cases.)

-- 
John Baldwin
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304963 - in head/sys/dev/bhnd: . bcma siba

2016-08-28 Thread Adrian Chadd
Heh. Make a free function too. ;)

On Aug 28, 2016 12:34 PM, "Landon J. Fuller"  wrote:

> Author: landonf
> Date: Sun Aug 28 19:34:22 2016
> New Revision: 304963
> URL: https://svnweb.freebsd.org/changeset/base/304963
>
> Log:
>   bhnd(4): Add a bhnd bus method for fetching the device's core table.
>
>   This will allow us to perform bhndb(4) bridge configuration based on
>   the identified hardware, prior to performing full enumeration of the
>   child bhnd bus.
>
>   Approved by:  adrian (mentor, implicit)
>
> Modified:
>   head/sys/dev/bhnd/bcma/bcma.c
>   head/sys/dev/bhnd/bhnd.h
>   head/sys/dev/bhnd/bhnd_bus_if.m
>   head/sys/dev/bhnd/siba/siba.c
>
> Modified: head/sys/dev/bhnd/bcma/bcma.c
> 
> ==
> --- head/sys/dev/bhnd/bcma/bcma.c   Sun Aug 28 19:33:09 2016
> (r304962)
> +++ head/sys/dev/bhnd/bcma/bcma.c   Sun Aug 28 19:34:22 2016
> (r304963)
> @@ -492,6 +492,42 @@ bcma_free_bhnd_dinfo(device_t dev, struc
> bcma_free_dinfo(dev, (struct bcma_devinfo *)dinfo);
>  }
>
> +
> +static int
> +bcma_get_core_table(device_t dev, device_t child, struct bhnd_core_info
> **cores,
> +u_int *num_cores)
> +{
> +   struct bcma_softc   *sc;
> +   struct bcma_erom erom;
> +   const struct bhnd_chipid*cid;
> +   struct resource *r;
> +   int  error;
> +   int  rid;
> +
> +   sc = device_get_softc(dev);
> +
> +   /* Map the EROM table. */
> +   cid = BHND_BUS_GET_CHIPID(dev, dev);
> +   rid = 0;
> +   r = bus_alloc_resource(dev, SYS_RES_MEMORY, , cid->enum_addr,
> +   cid->enum_addr + BCMA_EROM_TABLE_SIZE, BCMA_EROM_TABLE_SIZE,
> +   RF_ACTIVE);
> +   if (r == NULL) {
> +   device_printf(dev, "failed to allocate EROM resource\n");
> +   return (ENXIO);
> +   }
> +
> +   /* Enumerate all declared cores */
> +   if ((error = bcma_erom_open(, r, BCMA_EROM_TABLE_START)))
> +   goto cleanup;
> +
> +   error = bcma_erom_get_core_info(, cores, num_cores);
> +
> +cleanup:
> +   bus_release_resource(dev, SYS_RES_MEMORY, rid, r);
> +   return (error);
> +}
> +
>  /**
>   * Scan a device enumeration ROM table, adding all valid discovered cores
> to
>   * the bus.
> @@ -577,6 +613,7 @@ static device_method_t bcma_methods[] =
> DEVMETHOD(bhnd_bus_find_hostb_device,   bcma_find_hostb_device),
> DEVMETHOD(bhnd_bus_alloc_devinfo,   bcma_alloc_bhnd_dinfo),
> DEVMETHOD(bhnd_bus_free_devinfo,bcma_free_bhnd_dinfo),
> +   DEVMETHOD(bhnd_bus_get_core_table,  bcma_get_core_table),
> DEVMETHOD(bhnd_bus_reset_core,  bcma_reset_core),
> DEVMETHOD(bhnd_bus_suspend_core,bcma_suspend_core),
> DEVMETHOD(bhnd_bus_read_config, bcma_read_config),
>
> Modified: head/sys/dev/bhnd/bhnd.h
> 
> ==
> --- head/sys/dev/bhnd/bhnd.hSun Aug 28 19:33:09 2016(r304962)
> +++ head/sys/dev/bhnd/bhnd.hSun Aug 28 19:34:22 2016(r304963)
> @@ -425,6 +425,32 @@ bhnd_get_chipid(device_t dev) {
>  };
>
>  /**
> + * Get a list of all cores discoverable on the bhnd bus.
> + *
> + * Enumerates all cores discoverable on @p dev, returning the list in
> + * @p cores and the count in @p num_cores.
> + *
> + * The memory allocated for the list should be freed using
> + * `free(*cores, M_BHND)`. @p cores and @p num_cores are not changed
> + * when an error is returned.
> + *
> + * @param  dev A bhnd bus child device.
> + * @param[out] cores   The table of core descriptors.
> + * @param[out] num_cores   The number of core descriptors in @p cores.
> + *
> + * @retval 0   success
> + * @retval non-zeroif an error occurs enumerating @p dev, a regular
> UNIX
> + * error code should be returned.
> + */
> +static inline int
> +bhnd_get_core_table(device_t dev, struct bhnd_core_info **cores,
> +u_int *num_cores)
> +{
> +   return (BHND_BUS_GET_CORE_TABLE(device_get_parent(dev), dev,
> cores,
> +   num_cores));
> +}
> +
> +/**
>   * If supported by the chipset, return the clock source for the given
> clock.
>   *
>   * This function is only supported on early PWRCTL-equipped chipsets
>
> Modified: head/sys/dev/bhnd/bhnd_bus_if.m
> 
> ==
> --- head/sys/dev/bhnd/bhnd_bus_if.m Sun Aug 28 19:33:09 2016
> (r304962)
> +++ head/sys/dev/bhnd/bhnd_bus_if.m Sun Aug 28 19:34:22 2016
> (r304963)
> @@ -56,6 +56,13 @@ CODE {
> panic("bhnd_bus_get_chipid unimplemented");
> }
>
> +   static int
> +   bhnd_bus_null_get_core_table(device_t dev, device_t child,
> +   struct 

svn commit: r304970 - in head/sys/dev: ofw uart

2016-08-28 Thread Justin Hibbits
Author: jhibbits
Date: Sun Aug 28 21:31:21 2016
New Revision: 304970
URL: https://svnweb.freebsd.org/changeset/base/304970

Log:
  Check all compatible strings on uart devices in powerpc
  
  Summary:
  Some device trees put "fsl,ns16650" first in the compatible list.  This causes
  the probe code to choke, even though the device is compatible with ns16650, 
and
  has it listed later in the tree.
  
  Reviewed by:  nwhitehorn
  MFC after:1 week
  Differential Revision: https://reviews.freebsd.org/D7676

Modified:
  head/sys/dev/ofw/ofw_bus_subr.c
  head/sys/dev/ofw/ofw_bus_subr.h
  head/sys/dev/uart/uart_cpu_powerpc.c

Modified: head/sys/dev/ofw/ofw_bus_subr.c
==
--- head/sys/dev/ofw/ofw_bus_subr.c Sun Aug 28 21:26:11 2016
(r304969)
+++ head/sys/dev/ofw/ofw_bus_subr.c Sun Aug 28 21:31:21 2016
(r304970)
@@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$");
 
 #include "ofw_bus_if.h"
 
+#defineOFW_COMPAT_LEN  255
+
 int
 ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *obd, phandle_t node)
 {
@@ -178,7 +180,8 @@ ofw_bus_status_okay(device_t dev)
 }
 
 static int
-ofw_bus_node_is_compatible(const char *compat, int len, const char *onecompat)
+ofw_bus_node_is_compatible_int(const char *compat, int len,
+const char *onecompat)
 {
int onelen, l, ret;
 
@@ -203,6 +206,25 @@ ofw_bus_node_is_compatible(const char *c
 }
 
 int
+ofw_bus_node_is_compatible(phandle_t node, const char *compatstr)
+{
+   char compat[OFW_COMPAT_LEN];
+   int len, rv;
+
+   if ((len = OF_getproplen(node, "compatible")) <= 0)
+   return (0);
+
+   bzero(compat, OFW_COMPAT_LEN);
+
+   if (OF_getprop(node, "compatible", compat, OFW_COMPAT_LEN) < 0)
+   return (0);
+
+   rv = ofw_bus_node_is_compatible_int(compat, len, compatstr);
+
+   return (rv);
+}
+
+int
 ofw_bus_is_compatible(device_t dev, const char *onecompat)
 {
phandle_t node;
@@ -219,7 +241,7 @@ ofw_bus_is_compatible(device_t dev, cons
if ((len = OF_getproplen(node, "compatible")) <= 0)
return (0);
 
-   return (ofw_bus_node_is_compatible(compat, len, onecompat));
+   return (ofw_bus_node_is_compatible_int(compat, len, onecompat));
 }
 
 int
@@ -689,7 +711,7 @@ ofw_bus_find_compatible(phandle_t node, 
for (child = OF_child(node); child != 0; child = OF_peer(child)) {
len = OF_getprop_alloc(child, "compatible", 1, );
if (len >= 0) {
-   ret = ofw_bus_node_is_compatible(compat, len,
+   ret = ofw_bus_node_is_compatible_int(compat, len,
onecompat);
free(compat, M_OFWPROP);
if (ret != 0)

Modified: head/sys/dev/ofw/ofw_bus_subr.h
==
--- head/sys/dev/ofw/ofw_bus_subr.h Sun Aug 28 21:26:11 2016
(r304969)
+++ head/sys/dev/ofw/ofw_bus_subr.h Sun Aug 28 21:31:21 2016
(r304970)
@@ -107,6 +107,7 @@ phandle_t ofw_bus_find_iparent(phandle_t
 /* Helper routine for checking compat prop */
 int ofw_bus_is_compatible(device_t, const char *);
 int ofw_bus_is_compatible_strict(device_t, const char *);
+int ofw_bus_node_is_compatible(phandle_t, const char *);
 
 /* 
  * Helper routine to search a list of compat properties.  The table is

Modified: head/sys/dev/uart/uart_cpu_powerpc.c
==
--- head/sys/dev/uart/uart_cpu_powerpc.cSun Aug 28 21:26:11 2016
(r304969)
+++ head/sys/dev/uart/uart_cpu_powerpc.cSun Aug 28 21:31:21 2016
(r304970)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -163,14 +164,13 @@ uart_cpu_getdev(int devtype, struct uart
return (ENXIO);
if (strcmp(buf, "serial") != 0)
return (ENXIO);
-   if (OF_getprop(input, "compatible", buf, sizeof(buf)) == -1)
-   return (ENXIO);
 
-   if (strncmp(buf, "chrp,es", 7) == 0) {
+   if (ofw_bus_node_is_compatible(input, "chrp,es")) {
class = _z8530_class;
di->bas.regshft = 4;
di->bas.chan = 1;
-   } else if (strcmp(buf,"ns16550") == 0 || strcmp(buf,"ns8250") == 0) {
+   } else if (ofw_bus_node_is_compatible(input,"ns16550") ||
+   ofw_bus_node_is_compatible(input,"ns8250")) {
class = _ns8250_class;
di->bas.regshft = 0;
di->bas.chan = 0;
___
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-unsubscr...@freebsd.org"


svn commit: r304969 - head/sbin/hastd

2016-08-28 Thread Dimitry Andric
Author: dim
Date: Sun Aug 28 21:26:11 2016
New Revision: 304969
URL: https://svnweb.freebsd.org/changeset/base/304969

Log:
  Define hastd's STRICT_ALIGN macro in a defined and portable way.
  
  MFC after:3 days

Modified:
  head/sbin/hastd/lzf.h

Modified: head/sbin/hastd/lzf.h
==
--- head/sbin/hastd/lzf.h   Sun Aug 28 20:53:31 2016(r304968)
+++ head/sbin/hastd/lzf.h   Sun Aug 28 21:26:11 2016(r304969)
@@ -132,7 +132,11 @@ lzf_decompress (const void *const in_dat
  * Unconditionally aligning does not cost very much, so do it if unsure
  */
 #ifndef STRICT_ALIGN
-# define STRICT_ALIGN !(defined(__i386) || defined (__amd64))
+# if !(defined(__i386) || defined (__amd64))
+#  define STRICT_ALIGN 1
+# else
+#  define STRICT_ALIGN 0
+# endif
 #endif
 
 /*
___
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-unsubscr...@freebsd.org"


svn commit: r304967 - in head/sys/dev/bhnd: . siba

2016-08-28 Thread Landon J. Fuller
Author: landonf
Date: Sun Aug 28 20:39:53 2016
New Revision: 304967
URL: https://svnweb.freebsd.org/changeset/base/304967

Log:
  bhnd(4): Apply the siba chipid ncore fixup in bhnd_read_chipid(), ensuring
  that bhndb et al are always operating on a valid core count.
  
  Approved by:  adrian (mentor, implicit)

Modified:
  head/sys/dev/bhnd/bhnd.h
  head/sys/dev/bhnd/bhnd_subr.c
  head/sys/dev/bhnd/siba/siba.c

Modified: head/sys/dev/bhnd/bhnd.h
==
--- head/sys/dev/bhnd/bhnd.hSun Aug 28 20:39:33 2016(r304966)
+++ head/sys/dev/bhnd/bhnd.hSun Aug 28 20:39:53 2016(r304967)
@@ -317,6 +317,10 @@ void
bhnd_release_resources(device_t
 struct bhnd_chipid  bhnd_parse_chipid(uint32_t idreg,
 bhnd_addr_t enum_addr);
 
+int bhnd_chipid_fixed_ncores(
+const struct bhnd_chipid *cid,
+uint16_t chipc_hwrev, uint8_t *ncores);
+
 int bhnd_read_chipid(device_t dev,
 struct resource_spec *rs,
 bus_size_t chipc_offset,

Modified: head/sys/dev/bhnd/bhnd_subr.c
==
--- head/sys/dev/bhnd/bhnd_subr.c   Sun Aug 28 20:39:33 2016
(r304966)
+++ head/sys/dev/bhnd/bhnd_subr.c   Sun Aug 28 20:39:53 2016
(r304967)
@@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #include 
 
 #include "nvram/bhnd_nvram.h"
@@ -840,6 +842,63 @@ bhnd_parse_chipid(uint32_t idreg, bhnd_a
return (result);
 }
 
+
+/**
+ * Determine the correct core count for a chip identification value that
+ * may contain an invalid core count.
+ * 
+ * On some early siba(4) devices (see CHIPC_NCORES_MIN_HWREV()), the ChipCommon
+ * core does not provide a valid CHIPC_ID_NUMCORE field.
+ * 
+ * @param cid The chip identification to be queried.
+ * @param chipc_hwrev The hardware revision of the ChipCommon core from which
+ * @p cid was parsed.
+ * @param[out] ncores On success, will be set to the correct core count.
+ * 
+ * @retval 0 If the core count is already correct, or was mapped to a
+ * a correct value.
+ * @retval EINVAL If the core count is incorrect, but the chip was not
+ * recognized.
+ */
+int
+bhnd_chipid_fixed_ncores(const struct bhnd_chipid *cid, uint16_t chipc_hwrev,
+uint8_t *ncores)
+{
+   /* bcma(4), and most siba(4) devices */
+   if (CHIPC_NCORES_MIN_HWREV(chipc_hwrev)) {
+   *ncores = cid->ncores;
+   return (0);
+   }
+
+   /* broken siba(4) chipsets */
+   switch (cid->chip_id) {
+   case BHND_CHIPID_BCM4306:
+   *ncores = 6;
+   break;
+   case BHND_CHIPID_BCM4704:
+   *ncores = 9;
+   break;
+   case BHND_CHIPID_BCM5365:
+   /*
+   * BCM5365 does support ID_NUMCORE in at least
+   * some of its revisions, but for unknown
+   * reasons, Broadcom's drivers always exclude
+   * the ChipCommon revision (0x5) used by BCM5365
+   * from the set of revisions supporting
+   * ID_NUMCORE, and instead supply a fixed value.
+   * 
+   * Presumably, at least some of these devices
+   * shipped with a broken ID_NUMCORE value.
+   */
+   *ncores = 7;
+   break;
+   default:
+   return (EINVAL);
+   }
+
+   return (0);
+}
+
 /**
  * Allocate the resource defined by @p rs via @p dev, use it
  * to read the ChipCommon ID register relative to @p chipc_offset,
@@ -894,6 +953,27 @@ bhnd_read_chipid(device_t dev, struct re
 
*result = bhnd_parse_chipid(reg, enum_addr);
 
+   /* Fix the core count on early siba(4) devices */
+   if (chip_type == BHND_CHIPTYPE_SIBA) {
+   uint32_tidh;
+   uint16_tchipc_hwrev;
+
+   /* 
+* We need the ChipCommon revision to determine whether
+* the ncore field is valid.
+* 
+* We can safely assume the siba IDHIGH register is mapped
+* within the chipc register block.
+*/
+   idh = bus_read_4(res, SB0_REG_ABS(SIBA_CFG0_IDHIGH));
+   chipc_hwrev = SIBA_IDH_CORE_REV(idh);
+
+   error = bhnd_chipid_fixed_ncores(result, chipc_hwrev,
+   >ncores);
+   if (error)
+   goto cleanup;
+   }
+
 cleanup:
/* Clean up */
bus_release_resource(dev, rtype, rid, res);

Modified: head/sys/dev/bhnd/siba/siba.c
==
--- 

svn commit: r304966 - head/sys/boot/i386/libi386

2016-08-28 Thread Peter Wemm
Author: peter
Date: Sun Aug 28 20:39:33 2016
New Revision: 304966
URL: https://svnweb.freebsd.org/changeset/base/304966

Log:
  The read-ahead code from r298230 made it likely the boot code would read
  beyond the end of disk. r298900 added code to prevent this.  Some BIOSes
  cause significant delays if asked to read past end-of-disk.
  
  We never trusted the BIOS to accurately report the sectorsize of disks
  before and this set of changes.  Unfortuately they interact badly with
  the infamous >2TB wraparound bugs.  We have a number of relatively-recent
  machines in the FreeBSD.org cluster where the BIOS reports 3TB disks as 1TB.
  
  With pre-r298900 they work just fine.  After r298900 they stop working if
  the boot environment attempts to access anything outside the first 1TB on
  the disk.  'ZFS: I/O error, all block copies unavailable' etc.  It affects
  both UFS and ZFS if they try to boot from large volumes.
  
  This change replaces the blind trust of the BIOS end-of-disk reporting
  with a read-ahead clip to prevent reads crossing the of end-of-disk
  boundary.  Since 2^32 (2TB) size reporting truncation is not uncommon,
  the clipping is done on 2TB aliases of the reported end-of-disk.
  ie: a 3TB disk reported as 1TB has readahead clipped at 1TB, 3TB, 5TB, ...
  as one of them is likely to be the real end-of-disk.
  
  This should make the loader on these broken machines behave the same as
  traditional pre-r298900 loader behavior, without disabling read-ahead.
  
  PR:   212139
  Discussed with:   tsoome, allanjude

Modified:
  head/sys/boot/i386/libi386/biosdisk.c

Modified: head/sys/boot/i386/libi386/biosdisk.c
==
--- head/sys/boot/i386/libi386/biosdisk.c   Sun Aug 28 19:48:08 2016
(r304965)
+++ head/sys/boot/i386/libi386/biosdisk.c   Sun Aug 28 20:39:33 2016
(r304966)
@@ -497,7 +497,7 @@ bd_realstrategy(void *devdata, int rw, d
 char *buf, size_t *rsize)
 {
 struct disk_devdesc *dev = (struct disk_devdesc *)devdata;
-intblks;
+intblks, remaining;
 #ifdef BD_SUPPORT_FRAGS /* XXX: sector size */
 char   fragbuf[BIOSDISK_SECSIZE];
 size_t fragsize;
@@ -513,14 +513,15 @@ bd_realstrategy(void *devdata, int rw, d
 if (rsize)
*rsize = 0;
 
-if (dblk >= BD(dev).bd_sectors) {
-   DEBUG("IO past disk end %llu", (unsigned long long)dblk);
-   return (EIO);
-}
-
-if (dblk + blks > BD(dev).bd_sectors) {
-   /* perform partial read */
-   blks = BD(dev).bd_sectors - dblk;
+/*
+ * Perform partial read to prevent read-ahead crossing
+ * the end of disk - or any 32 bit aliases of the end.
+ * Signed arithmetic is used to handle wrap-around cases
+ * like we do for TCP sequence numbers.
+ */
+remaining = (int)(BD(dev).bd_sectors - dblk);  /* truncate */
+if (remaining > 0 && remaining < blks) {
+   blks = remaining;
size = blks * BD(dev).bd_sectorsize;
DEBUG("short read %d", blks);
 }
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304953 - head/sys/contrib/ipfilter/netinet

2016-08-28 Thread Dimitry Andric
On 28 Aug 2016, at 18:27, Ngie Cooper (yaneurabeya)  
wrote:
> 
>> On Aug 28, 2016, at 4:51 AM, Dimitry Andric  wrote:
>> 
>> Author: dim
>> Date: Sun Aug 28 11:51:46 2016
>> New Revision: 304953
>> URL: https://svnweb.freebsd.org/changeset/base/304953
>> 
>> Log:
>>  Define ipfilter's SOLARIS macro in a defined and portable way.
>> 
>>  Reviewed by:cy
>>  MFC after:  3 days
>>  Differential Revision: https://reviews.freebsd.org/D7671
> 
> This broke the build with DTrace/ZFS— could you please fix it or back it out? 
> https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/3802/console

Sorry about that, it hould now be fixed by r304959 and r304964.

-Dimitry



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r304964 - in head: contrib/ipfilter sys/contrib/ipfilter/netinet

2016-08-28 Thread Dimitry Andric
Author: dim
Date: Sun Aug 28 19:35:29 2016
New Revision: 304964
URL: https://svnweb.freebsd.org/changeset/base/304964

Log:
  Follow-up to r304953, in which I broke the build: apparently the SOLARIS
  macro is defined in lots of different places in ipfilter, so replace all
  of the nonportable definitions with portable ones.
  
  Pointy hat to:dim
  X-MFC-With:   r304959, r304953
  MFC after:3 days

Modified:
  head/contrib/ipfilter/opts.h
  head/sys/contrib/ipfilter/netinet/ip_compat.h
  head/sys/contrib/ipfilter/netinet/ip_fil.h
  head/sys/contrib/ipfilter/netinet/ip_log.c
  head/sys/contrib/ipfilter/netinet/ip_nat.h
  head/sys/contrib/ipfilter/netinet/ip_proxy.h

Modified: head/contrib/ipfilter/opts.h
==
--- head/contrib/ipfilter/opts.hSun Aug 28 19:34:22 2016
(r304963)
+++ head/contrib/ipfilter/opts.hSun Aug 28 19:35:29 2016
(r304964)
@@ -12,7 +12,11 @@
 #define__OPTS_H__
 
 #ifndefSOLARIS
-#defineSOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
+# if defined(sun) && (defined(__svr4__) || defined(__SVR4))
+#  define  SOLARIS 1
+# else
+#  define  SOLARIS 0
+# endif
 #endif
 #defineOPT_REMOVE  0x01
 #defineOPT_DEBUG   0x02

Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h
==
--- head/sys/contrib/ipfilter/netinet/ip_compat.h   Sun Aug 28 19:34:22 
2016(r304963)
+++ head/sys/contrib/ipfilter/netinet/ip_compat.h   Sun Aug 28 19:35:29 
2016(r304964)
@@ -32,10 +32,12 @@
 # define   __KERNEL__
 #endif
 
-#if defined(sun) && (defined(__svr4__) || defined(__SVR4))
-# define   SOLARIS 1
-#else
-# define   SOLARIS 0
+#ifndefSOLARIS
+# if defined(sun) && (defined(__svr4__) || defined(__SVR4))
+#  define  SOLARIS 1
+# else
+#  define  SOLARIS 0
+# endif
 #endif
 
 

Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h
==
--- head/sys/contrib/ipfilter/netinet/ip_fil.h  Sun Aug 28 19:34:22 2016
(r304963)
+++ head/sys/contrib/ipfilter/netinet/ip_fil.h  Sun Aug 28 19:35:29 2016
(r304964)
@@ -29,7 +29,11 @@
 #endif
 
 #ifndefSOLARIS
-# define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
+# if defined(sun) && (defined(__svr4__) || defined(__SVR4))
+#  define  SOLARIS 1
+# else
+#  define  SOLARIS 0
+# endif
 #endif
 
 #ifndef__P

Modified: head/sys/contrib/ipfilter/netinet/ip_log.c
==
--- head/sys/contrib/ipfilter/netinet/ip_log.c  Sun Aug 28 19:34:22 2016
(r304963)
+++ head/sys/contrib/ipfilter/netinet/ip_log.c  Sun Aug 28 19:35:29 2016
(r304964)
@@ -19,11 +19,11 @@
 # include 
 #endif
 #ifndef SOLARIS
-#if defined(sun) && (defined(__svr4__) || defined(__SVR4))
-# define   SOLARIS 1
-#else
-# define   SOLARIS 0
-#endif
+# if defined(sun) && (defined(__svr4__) || defined(__SVR4))
+#  define  SOLARIS 1
+# else
+#  define  SOLARIS 0
+# endif
 #endif
 #include 
 #include 

Modified: head/sys/contrib/ipfilter/netinet/ip_nat.h
==
--- head/sys/contrib/ipfilter/netinet/ip_nat.h  Sun Aug 28 19:34:22 2016
(r304963)
+++ head/sys/contrib/ipfilter/netinet/ip_nat.h  Sun Aug 28 19:35:29 2016
(r304964)
@@ -13,8 +13,12 @@
 #ifndef__IP_NAT_H__
 #define__IP_NAT_H__
 
-#ifndef SOLARIS
-#defineSOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
+#ifndefSOLARIS
+# if defined(sun) && (defined(__svr4__) || defined(__SVR4))
+#  define  SOLARIS 1
+# else
+#  define  SOLARIS 0
+# endif
 #endif
 
 #if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51)

Modified: head/sys/contrib/ipfilter/netinet/ip_proxy.h
==
--- head/sys/contrib/ipfilter/netinet/ip_proxy.hSun Aug 28 19:34:22 
2016(r304963)
+++ head/sys/contrib/ipfilter/netinet/ip_proxy.hSun Aug 28 19:35:29 
2016(r304964)
@@ -12,8 +12,12 @@
 #ifndef__IP_PROXY_H__
 #define__IP_PROXY_H__
 
-#ifndef SOLARIS
-#define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
+#ifndefSOLARIS
+# if defined(sun) && (defined(__svr4__) || defined(__SVR4))
+#  define  SOLARIS 1
+# else
+#  define  SOLARIS 0
+# endif
 #endif
 
 #if defined(__STDC__) || defined(__GNUC__) || defined(_AIX51)
___
svn-src-all@freebsd.org mailing list

svn commit: r304963 - in head/sys/dev/bhnd: . bcma siba

2016-08-28 Thread Landon J. Fuller
Author: landonf
Date: Sun Aug 28 19:34:22 2016
New Revision: 304963
URL: https://svnweb.freebsd.org/changeset/base/304963

Log:
  bhnd(4): Add a bhnd bus method for fetching the device's core table.
  
  This will allow us to perform bhndb(4) bridge configuration based on
  the identified hardware, prior to performing full enumeration of the
  child bhnd bus.
  
  Approved by:  adrian (mentor, implicit)

Modified:
  head/sys/dev/bhnd/bcma/bcma.c
  head/sys/dev/bhnd/bhnd.h
  head/sys/dev/bhnd/bhnd_bus_if.m
  head/sys/dev/bhnd/siba/siba.c

Modified: head/sys/dev/bhnd/bcma/bcma.c
==
--- head/sys/dev/bhnd/bcma/bcma.c   Sun Aug 28 19:33:09 2016
(r304962)
+++ head/sys/dev/bhnd/bcma/bcma.c   Sun Aug 28 19:34:22 2016
(r304963)
@@ -492,6 +492,42 @@ bcma_free_bhnd_dinfo(device_t dev, struc
bcma_free_dinfo(dev, (struct bcma_devinfo *)dinfo);
 }
 
+
+static int
+bcma_get_core_table(device_t dev, device_t child, struct bhnd_core_info 
**cores,
+u_int *num_cores)
+{
+   struct bcma_softc   *sc;
+   struct bcma_erom erom;
+   const struct bhnd_chipid*cid;
+   struct resource *r;
+   int  error;
+   int  rid;
+
+   sc = device_get_softc(dev);
+
+   /* Map the EROM table. */
+   cid = BHND_BUS_GET_CHIPID(dev, dev);
+   rid = 0;
+   r = bus_alloc_resource(dev, SYS_RES_MEMORY, , cid->enum_addr,
+   cid->enum_addr + BCMA_EROM_TABLE_SIZE, BCMA_EROM_TABLE_SIZE,
+   RF_ACTIVE);
+   if (r == NULL) {
+   device_printf(dev, "failed to allocate EROM resource\n");
+   return (ENXIO);
+   }
+
+   /* Enumerate all declared cores */
+   if ((error = bcma_erom_open(, r, BCMA_EROM_TABLE_START)))
+   goto cleanup;
+
+   error = bcma_erom_get_core_info(, cores, num_cores);
+
+cleanup:
+   bus_release_resource(dev, SYS_RES_MEMORY, rid, r);
+   return (error);
+}
+
 /**
  * Scan a device enumeration ROM table, adding all valid discovered cores to
  * the bus.
@@ -577,6 +613,7 @@ static device_method_t bcma_methods[] = 
DEVMETHOD(bhnd_bus_find_hostb_device,   bcma_find_hostb_device),
DEVMETHOD(bhnd_bus_alloc_devinfo,   bcma_alloc_bhnd_dinfo),
DEVMETHOD(bhnd_bus_free_devinfo,bcma_free_bhnd_dinfo),
+   DEVMETHOD(bhnd_bus_get_core_table,  bcma_get_core_table),
DEVMETHOD(bhnd_bus_reset_core,  bcma_reset_core),
DEVMETHOD(bhnd_bus_suspend_core,bcma_suspend_core),
DEVMETHOD(bhnd_bus_read_config, bcma_read_config),

Modified: head/sys/dev/bhnd/bhnd.h
==
--- head/sys/dev/bhnd/bhnd.hSun Aug 28 19:33:09 2016(r304962)
+++ head/sys/dev/bhnd/bhnd.hSun Aug 28 19:34:22 2016(r304963)
@@ -425,6 +425,32 @@ bhnd_get_chipid(device_t dev) {
 };
 
 /**
+ * Get a list of all cores discoverable on the bhnd bus.
+ *
+ * Enumerates all cores discoverable on @p dev, returning the list in
+ * @p cores and the count in @p num_cores.
+ * 
+ * The memory allocated for the list should be freed using
+ * `free(*cores, M_BHND)`. @p cores and @p num_cores are not changed
+ * when an error is returned.
+ * 
+ * @param  dev A bhnd bus child device.
+ * @param[out] cores   The table of core descriptors.
+ * @param[out] num_cores   The number of core descriptors in @p cores.
+ * 
+ * @retval 0   success
+ * @retval non-zeroif an error occurs enumerating @p dev, a regular UNIX
+ * error code should be returned.
+ */
+static inline int
+bhnd_get_core_table(device_t dev, struct bhnd_core_info **cores,
+u_int *num_cores)
+{
+   return (BHND_BUS_GET_CORE_TABLE(device_get_parent(dev), dev, cores,
+   num_cores));
+}
+
+/**
  * If supported by the chipset, return the clock source for the given clock.
  *
  * This function is only supported on early PWRCTL-equipped chipsets

Modified: head/sys/dev/bhnd/bhnd_bus_if.m
==
--- head/sys/dev/bhnd/bhnd_bus_if.m Sun Aug 28 19:33:09 2016
(r304962)
+++ head/sys/dev/bhnd/bhnd_bus_if.m Sun Aug 28 19:34:22 2016
(r304963)
@@ -56,6 +56,13 @@ CODE {
panic("bhnd_bus_get_chipid unimplemented");
}
 
+   static int
+   bhnd_bus_null_get_core_table(device_t dev, device_t child,
+   struct bhnd_core_info **cores, u_int *num_cores)
+   {
+   panic("bhnd_bus_get_core_table unimplemented");
+   }
+
static bhnd_attach_type
bhnd_bus_null_get_attach_type(device_t dev, device_t child)
{
@@ -271,6 +278,32 @@ METHOD const struct bhnd_chipid * get_ch
 } DEFAULT bhnd_bus_null_get_chipid;
 
 

svn commit: r304962 - head/sys/ddb

2016-08-28 Thread Bruce Evans
Author: bde
Date: Sun Aug 28 19:33:09 2016
New Revision: 304962
URL: https://svnweb.freebsd.org/changeset/base/304962

Log:
  Expand error messages: print symbol names, parentheses and shift tokens,
  and negative shift counts.
  
  Fix error messages: print "Division" instead of "Divide"; print
  multiplier-like, addition-like and logical operator tokens instead of
  garbage (usually the command name).
  
  ddb has a primitive lexer with excessive information hiding that makes
  it hard to find even the point in the line where a syntax error is
  detected.  Old ddb just printed "Syntax error" and this was unimproved
  in most places by printing a garbage token.

Modified:
  head/sys/ddb/db_expr.c

Modified: head/sys/ddb/db_expr.c
==
--- head/sys/ddb/db_expr.c  Sun Aug 28 19:32:14 2016(r304961)
+++ head/sys/ddb/db_expr.c  Sun Aug 28 19:33:09 2016(r304962)
@@ -57,7 +57,8 @@ db_term(db_expr_t *valuep)
if (!db_value_of_name(db_tok_string, valuep) &&
!db_value_of_name_pcpu(db_tok_string, valuep) &&
!db_value_of_name_vnet(db_tok_string, valuep)) {
-   db_error("Symbol not found\n");
+   db_printf("Symbol '%s' not found\n", db_tok_string);
+   db_error(NULL);
/*NOTREACHED*/
}
return (true);
@@ -89,12 +90,14 @@ db_term(db_expr_t *valuep)
}
if (t == tLPAREN) {
if (!db_expression(valuep)) {
-   db_error("Syntax error\n");
+   db_printf("Expression syntax error after '%c'\n", '(');
+   db_error(NULL);
/*NOTREACHED*/
}
t = db_read_token();
if (t != tRPAREN) {
-   db_error("Syntax error\n");
+   db_printf("Expression syntax error -- expected '%c'\n", ')');
+   db_error(NULL);
/*NOTREACHED*/
}
return (true);
@@ -164,7 +167,9 @@ db_mult_expr(db_expr_t *valuep)
while (t == tSTAR || t == tSLASH || t == tPCT || t == tHASH ||
t == tBIT_AND ) {
if (!db_term()) {
-   db_printf("Expression syntax error after '%c'\n", '!');
+   db_printf("Expression syntax error after '%c'\n",
+   t == tSTAR ? '*' : t == tSLASH ? '/' : t == tPCT ? '%' :
+   t == tHASH ? '#' : '&');
db_error(NULL);
/*NOTREACHED*/
}
@@ -177,7 +182,7 @@ db_mult_expr(db_expr_t *valuep)
break;
default:
if (rhs == 0) {
-   db_error("Divide by 0\n");
+   db_error("Division by 0\n");
/*NOTREACHED*/
}
if (t == tSLASH)
@@ -199,7 +204,6 @@ db_add_expr(db_expr_t *valuep)
 {
db_expr_t   lhs, rhs;
int t;
-   charc;
 
if (!db_mult_expr())
return (false);
@@ -207,8 +211,8 @@ db_add_expr(db_expr_t *valuep)
t = db_read_token();
while (t == tPLUS || t == tMINUS || t == tBIT_OR) {
if (!db_mult_expr()) {
-   c = db_tok_string[0];
-   db_printf("Expression syntax error after '%c'\n", c);
+   db_printf("Expression syntax error after '%c'\n",
+   t == tPLUS ? '+' : t == tMINUS ? '-' : '|');
db_error(NULL);
/*NOTREACHED*/
}
@@ -243,11 +247,14 @@ db_shift_expr(db_expr_t *valuep)
t = db_read_token();
while (t == tSHIFT_L || t == tSHIFT_R) {
if (!db_add_expr()) {
-   db_error("Syntax error\n");
+   db_printf("Expression syntax error after '%s'\n",
+   t == tSHIFT_L ? "<<" : ">>");
+   db_error(NULL);
/*NOTREACHED*/
}
if (rhs < 0) {
-   db_error("Negative shift amount\n");
+   db_printf("Negative shift amount %jd\n", (intmax_t)rhs);
+   db_error(NULL);
/*NOTREACHED*/
}
if (t == tSHIFT_L)
@@ -269,7 +276,6 @@ db_logical_relation_expr(
 {
db_expr_t   lhs, rhs;
int t;
-   charop[3];
 
if (!db_shift_expr())
return (false);
@@ -277,11 +283,11 @@ db_logical_relation_expr(
t = db_read_token();
while (t == tLOG_EQ || t == tLOG_NOT_EQ || t == tGREATER ||
t == tGREATER_EQ || t == tLESS || t == tLESS_EQ) {
-   op[0] = db_tok_string[0];
-   op[1] = db_tok_string[1];
-   op[2] = 0;
if (!db_shift_expr()) {
-   db_printf("Expression syntax error after \"%s\"\n", op);
+   db_printf("Expression syntax error after '%s'\n",
+   t == tLOG_EQ ? "==" : t == tLOG_NOT_EQ ? 

Re: svn commit: r304895 - head/usr.bin/netstat

2016-08-28 Thread Bruce Evans

On Sun, 28 Aug 2016, hiren panchasara wrote:


On 08/27/16 at 11:06P, Bruce Evans wrote:


Log:
  Fix build without INET6 and with gcc.  A function definition was ifdefed
  for INET6, but its protototype was not, and gcc detects the error.

Modified:
  head/usr.bin/netstat/route.c


Thanks for the fix.

Wouldn't stable/11 be broken in the same way?


Probably.

This only affects gcc users who omit INET6, and much more is broken for
stable/11 for gcc.

Bruce
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304895 - head/usr.bin/netstat

2016-08-28 Thread hiren panchasara
On 08/27/16 at 11:06P, Bruce Evans wrote:
> Author: bde
> Date: Sat Aug 27 11:06:06 2016
> New Revision: 304895
> URL: https://svnweb.freebsd.org/changeset/base/304895
> 
> Log:
>   Fix build without INET6 and with gcc.  A function definition was ifdefed
>   for INET6, but its protototype was not, and gcc detects the error.
> 
> Modified:
>   head/usr.bin/netstat/route.c

Thanks for the fix.

Wouldn't stable/11 be broken in the same way?

Cheers,
Hiren


pgpYONWMLDJbY.pgp
Description: PGP signature


svn commit: r304959 - head/sys/contrib/ipfilter/netinet

2016-08-28 Thread Konstantin Belousov
Author: kib
Date: Sun Aug 28 18:10:29 2016
New Revision: 304959
URL: https://svnweb.freebsd.org/changeset/base/304959

Log:
  Complete r304953.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 days

Modified:
  head/sys/contrib/ipfilter/netinet/ip_log.c

Modified: head/sys/contrib/ipfilter/netinet/ip_log.c
==
--- head/sys/contrib/ipfilter/netinet/ip_log.c  Sun Aug 28 15:23:44 2016
(r304958)
+++ head/sys/contrib/ipfilter/netinet/ip_log.c  Sun Aug 28 18:10:29 2016
(r304959)
@@ -19,7 +19,11 @@
 # include 
 #endif
 #ifndef SOLARIS
-# define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
+#if defined(sun) && (defined(__svr4__) || defined(__SVR4))
+# define   SOLARIS 1
+#else
+# define   SOLARIS 0
+#endif
 #endif
 #include 
 #include 
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304436 - in head: . sys/netinet

2016-08-28 Thread Slawa Olhovchenkov
On Sun, Aug 28, 2016 at 10:20:08AM -0700, Adrian Chadd wrote:

> * the rtalloc1_fib thing - that's odd, because it shouldn't be
> contending there unless there's some temporary redirect that's been
> learnt. What's the routing table look like on your machine? I Remember
> investigating the rtentry reference counting a while ago and concluded
> that .. it's terrible, and one specific corner case was checking for
> routes from redirects. I'll look at my notes again and see what I
> find.

JFYI:

  kernel`rtalloc1_fib+0x6d
  kernel`rtalloc_ign_fib+0xcc
  kernel`ip_output+0x3a5
  kernel`tcp_output+0x1852
  kernel`tcp_timer_rexmt+0x60e
  kernel`softclock_call_cc+0x17b
  kernel`softclock+0x94
  kernel`intr_event_execute_handlers+0xab
  kernel`ithread_loop+0x96
  kernel`fork_exit+0x9a
  kernel`0x806c8e0e
176868370


kernel`ip_output+0x3a5 is sys/netinet/ip_output.c:282

/*
 * We want to do any cloning requested by the link layer,
 * as this is probably required in all cases for correct
 * operation (as it is for ARP).
 */
if (rte == NULL) {
#ifdef RADIX_MPATH
rtalloc_mpath_fib(ro,
ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr),
inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m));
#else
in_rtalloc_ign(ro, 0,
inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m));
#endif
rte = ro->ro_rt;
}
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304436 - in head: . sys/netinet

2016-08-28 Thread Slawa Olhovchenkov
On Sun, Aug 28, 2016 at 10:20:08AM -0700, Adrian Chadd wrote:

Hi,
thanks for answer!

> Hi,
> 
> There are some no brainers here so far(tm):
> 
> working from the bottom up:
> 
> * yeah, the ixgbe locking is a bit silly. Kip's work with iflib and
> converting ixgbe to use that instead of its own locking for managing
> things should remove the bottom two locks

I think no MFC to stbale/10 planed?

> * the rtalloc1_fib thing - that's odd, because it shouldn't be
> contending there unless there's some temporary redirect that's been
> learnt. What's the routing table look like on your machine? I Remember

# netstat -rn
Routing tables

Internet:
DestinationGatewayFlags  Netif Expire
default37.220.36.1UGS   lagg0
37.220.36.0/24 link#6 U lagg0
37.220.36.11   link#6 UHS lo0
127.0.0.1  link#5 UH  lo0

Internet6:
Destination   Gateway   Flags  
Netif Expire
::/96 ::1   UGRSlo0
::1   link#5UH  lo0
:::0.0.0.0/96 ::1   UGRSlo0
fe80::/10 ::1   UGRSlo0
fe80::%lo0/64 link#5U   lo0
fe80::1%lo0   link#5UHS lo0
ff01::%lo0/32 ::1   U   lo0
ff02::/16 ::1   UGRSlo0
ff02::%lo0/32 ::1   U   lo0

> investigating the rtentry reference counting a while ago and concluded
> that .. it's terrible, and one specific corner case was checking for
> routes from redirects. I'll look at my notes again and see what I
> find.
> 
> kernel`vm_object_madvise+0x39e
>   kernel`vm_map_madvise+0x3bb
>   kernel`sys_madvise+0x82
>   kernel`amd64_syscall+0x40f
>   kernel`0x806c8bbb
>  97389657
> 
> .. something's doing frequent madvise calls, which may be causing some

In any case, this is create load on different CPU cores.

> hilarity between threads. What's the server? nginx?

yes

> Then the rest of the big entries are just a combination of rtentry
> locking, tcp timer locking, zfs locking and madvise locking. There's
> some sowakeup locking there as well, from the socket producer/consumer
> locking.
> 
> 
> 
> 
> -adrian
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304436 - in head: . sys/netinet

2016-08-28 Thread Adrian Chadd
Hi,

There are some no brainers here so far(tm):

working from the bottom up:

* yeah, the ixgbe locking is a bit silly. Kip's work with iflib and
converting ixgbe to use that instead of its own locking for managing
things should remove the bottom two locks
* the rtalloc1_fib thing - that's odd, because it shouldn't be
contending there unless there's some temporary redirect that's been
learnt. What's the routing table look like on your machine? I Remember
investigating the rtentry reference counting a while ago and concluded
that .. it's terrible, and one specific corner case was checking for
routes from redirects. I'll look at my notes again and see what I
find.

kernel`vm_object_madvise+0x39e
  kernel`vm_map_madvise+0x3bb
  kernel`sys_madvise+0x82
  kernel`amd64_syscall+0x40f
  kernel`0x806c8bbb
 97389657

.. something's doing frequent madvise calls, which may be causing some
hilarity between threads. What's the server? nginx?

Then the rest of the big entries are just a combination of rtentry
locking, tcp timer locking, zfs locking and madvise locking. There's
some sowakeup locking there as well, from the socket producer/consumer
locking.




-adrian
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304912 - head/sys/sys

2016-08-28 Thread Adrian Chadd
Thanks!


-a


On 28 August 2016 at 00:40, Mariusz Zaborski  wrote:
> Eh, sorry.
> Fixed in the @304952.
>
> On 28 August 2016 at 06:17, Adrian Chadd  wrote:
>> ...
>>
>> ===> lib/libnv (obj,all,install)
>> In file included from
>> /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/contrib/libnv/cnvlist.c:49:0:
>> /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/sys/cnv.h:107:6:
>> error: redundant redeclaration of 'cnvlist_free_descriptor'
>> [-Werror=redundant-decls]
>>  void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep);
>>   ^
>> /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/sys/cnv.h:101:6:
>> note: previous declaration of 'cnvlist_free_descriptor' was here
>>  void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep);
>>   ^
>> cc1: all warnings being treated as errors
>> --- cnvlist.o ---
>> *** [cnvlist.o] Error code 1
>>
>> make[4]: stopped in /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv
>> 1 error
>>
>>
>>
>> -a
>>
>>
>> On 27 August 2016 at 08:22, Mariusz Zaborski  wrote:
>>> Author: oshogbo
>>> Date: Sat Aug 27 15:22:55 2016
>>> New Revision: 304912
>>> URL: https://svnweb.freebsd.org/changeset/base/304912
>>>
>>> Log:
>>>   Add missed header file for cnv.h .
>>>
>>>   Submitted by: Adam Starak 
>>>   Reported by:  ache@
>>>
>>> Added:
>>>   head/sys/sys/cnv.h   (contents, props changed)
>>>
>>> Added: head/sys/sys/cnv.h
>>> ==
>>> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
>>> +++ head/sys/sys/cnv.h  Sat Aug 27 15:22:55 2016(r304912)
>>> @@ -0,0 +1,113 @@
>>> +/*-
>>> + * Copyright (c) 2016 Adam Starak 
>>> + * 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 AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE
>>> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
>>> CONSEQUENTIAL
>>> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
>>> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
>>> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
>>> STRICT
>>> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 
>>> WAY
>>> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>>> + * SUCH DAMAGE.
>>> + *
>>> + * $FreeBSD$
>>> + */
>>> +
>>> +#ifndef_CNV_H_
>>> +#define_CNV_H_
>>> +
>>> +#include 
>>> +
>>> +#ifndef _KERNEL
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#endif
>>> +
>>> +#ifndef_NVLIST_T_DECLARED
>>> +#define_NVLIST_T_DECLARED
>>> +struct nvlist;
>>> +
>>> +typedef struct nvlist nvlist_t;
>>> +#endif
>>> +
>>> +__BEGIN_DECLS
>>> +
>>> +/*
>>> + * The cnvlist_get functions returns value associated with the given 
>>> cookie.
>>> + * If it returns a pointer, the pointer represents internal buffer and 
>>> should
>>> + * not be freed by the caller.
>>> + */
>>> +
>>> +boolcnvlist_get_bool(void *cookiep);
>>> +uint64_tcnvlist_get_number(void *cookiep);
>>> +const char *cnvlist_get_string(void *cookiep);
>>> +const nvlist_t *cnvlist_get_nvlist(void *cookiep);
>>> +const void *cnvlist_get_binary(void *cookiep, size_t *sizep);
>>> +const bool *cnvlist_get_bool_array(void *cookiep, size_t 
>>> *nitemsp);
>>> +const uint64_t *cnvlist_get_number_array(void *cookiep, size_t 
>>> *nitemsp);
>>> +const char * const *cnvlist_get_string_array(void *cookiep, size_t 
>>> *nitemsp);
>>> +const nvlist_t * const *cnvlist_get_nvlist_array(void *cookiep, size_t 
>>> *nitemsp);
>>> +#ifndef _KERNEL
>>> +int cnvlist_get_descriptor(void *cookiep);
>>> +const int  *cnvlist_get_descriptor_array(void *cookiep, size_t 
>>> *nitemsp);
>>> +#endif
>>> +
>>> +
>>> +/*
>>> + * The cnvlist_take functions returns value associated with the given 
>>> cookie and
>>> + * remove the given entry from the nvlist.
>>> + * 

Re: svn commit: r304953 - head/sys/contrib/ipfilter/netinet

2016-08-28 Thread Ngie Cooper (yaneurabeya)

> On Aug 28, 2016, at 4:51 AM, Dimitry Andric  wrote:
> 
> Author: dim
> Date: Sun Aug 28 11:51:46 2016
> New Revision: 304953
> URL: https://svnweb.freebsd.org/changeset/base/304953
> 
> Log:
>  Define ipfilter's SOLARIS macro in a defined and portable way.
> 
>  Reviewed by: cy
>  MFC after:   3 days
>  Differential Revision: https://reviews.freebsd.org/D7671

This broke the build with DTrace/ZFS— could you please fix it or back it out? 
https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/3802/console 

Thanks,
-Ngie
___
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-unsubscr...@freebsd.org"

Re: svn commit: r304949 - stable/11/usr.bin/getconf

2016-08-28 Thread Adam Weinberger
> On 28 Aug, 2016, at 1:16, Garrett Cooper  wrote:
> 
> Author: ngie
> Date: Sun Aug 28 07:16:11 2016
> New Revision: 304949
> URL: https://svnweb.freebsd.org/changeset/base/304949
> 
> Log:
>  MFC r303830,r304693,r304694,r304698:
> 
>  r303830:
> 
>  Remove vestigal references to __alpha__
> 
>  Replace alpha reference in getconf(1) with amd64 [*]
> 
>  PR:  211300 [*]

Hi Garrett,

It doesn't look like the contents of r303830 were part of that MFC. I'm not 
sure if that was intentional, so this is just a head's up.

# Adam


-- 
Adam Weinberger
ad...@adamw.org
http://www.adamw.org


___
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-unsubscr...@freebsd.org"


svn commit: r304958 - head/sys/i386/i386

2016-08-28 Thread Bruce Evans
Author: bde
Date: Sun Aug 28 15:23:44 2016
New Revision: 304958
URL: https://svnweb.freebsd.org/changeset/base/304958

Log:
  Fix vm86 initialization, part 1 of 2 and a half.
  
  Early use of vm86 depends on the PIC being reset to mask interrupts,
  but r286667 moved PIC initialization to after where vm86 may be first
  used.
  
  Move the PIC initialization up to immdiately before vm86 initialization.
  All invocations of diff that I tried display this move poorly so that it
  looks like PIC and vm86 initialization was moved later.
  
  r286667 was to move console initialization later.  The diffs are again
  unreadable -- they show a large move that doesn't seem to involve the
  console.  The PIC initialization stayed just below the console
  initialization where it could still be debugged but no longer works.
  
  Later console initialization breaks mainly debugging vm86 initialization
  and memory sizing using ddb and printf().  There are several printf()s
  in the memory sizing that now go nowhere since message buffer
  initialization has always been too late.  Memory sizing is done by loader
  for most users, but the lost messages for this case are even more
  interesting than for an auto-probe since they tell you what the loader
  found.

Modified:
  head/sys/i386/i386/machdep.c

Modified: head/sys/i386/i386/machdep.c
==
--- head/sys/i386/i386/machdep.cSun Aug 28 14:03:25 2016
(r304957)
+++ head/sys/i386/i386/machdep.cSun Aug 28 15:23:44 2016
(r304958)
@@ -2646,20 +2646,7 @@ init386(first)
PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16);
ltr(gsel_tss);
 
-   vm86_initialize();
-   getmemsize(first);
-   init_param2(physmem);
-
-   /* now running on new page tables, configured,and u/iom is accessible */
-
-   /*
-* Initialize the console before we print anything out.
-*/
-   cninit();
-
-   if (metadata_missing)
-   printf("WARNING: loader(8) metadata is missing!\n");
-
+   /* Initialize the PIC early for vm86 calls. */
 #ifdef DEV_ISA
 #ifdef DEV_ATPIC
 #ifndef PC98
@@ -2681,6 +2668,20 @@ init386(first)
 #endif
 #endif
 
+   vm86_initialize();
+   getmemsize(first);
+   init_param2(physmem);
+
+   /* now running on new page tables, configured,and u/iom is accessible */
+
+   /*
+* Initialize the console before we print anything out.
+*/
+   cninit();
+
+   if (metadata_missing)
+   printf("WARNING: loader(8) metadata is missing!\n");
+
 #ifdef DDB
db_fetch_ksymtab(bootinfo.bi_symtab, bootinfo.bi_esymtab);
 #endif
___
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-unsubscr...@freebsd.org"


svn commit: r304957 - head/sys/i386/i386

2016-08-28 Thread Bruce Evans
Author: bde
Date: Sun Aug 28 14:03:25 2016
New Revision: 304957
URL: https://svnweb.freebsd.org/changeset/base/304957

Log:
  Fix vm86 initialization, part 1 of 2 and a half.
  
  vm86 uses the tss, but r273995 moved tss initialization to after where
  it may be first used, just because tss_esp0 now depends on later
  initializations and/or amd64 does it later.
  
  vm86 is first used for memory sizing in cases where the loader can't
  figure out the size or is not used.  Its initialization is placed
  immediately before memory sizing to support this, and the tss was
  initialized a little earlier.
  
  Move everything in the tss initialization except for tss_esp0 back to
  almost where it was, immediately before vm86 initialization (the
  combined move is from before dblflt_tss initialization to after).  Add
  only early initialization of tss_esp0, later reloading of the tss, and
  comments.  The initial tss_esp0 no longer has space for the pcb since
  initially the size of the pcb is not known and no pcb is needed.
  (Later changes broke debugging at this point, so the nonexistent pcb
  cannot be used by debuggers, and at the time of 273995 when ddb was
  almost able to debug this problem it didn't need the pcb.)  The
  iniitial tss_esp0 still has a magic 16 bytes reserved for vm86
  although I think this is unused too.

Modified:
  head/sys/i386/i386/machdep.c

Modified: head/sys/i386/i386/machdep.c
==
--- head/sys/i386/i386/machdep.cSun Aug 28 12:05:34 2016
(r304956)
+++ head/sys/i386/i386/machdep.cSun Aug 28 14:03:25 2016
(r304957)
@@ -2636,6 +2636,16 @@ init386(first)
dblfault_tss.tss_cs = GSEL(GCODE_SEL, SEL_KPL);
dblfault_tss.tss_ldt = GSEL(GLDT_SEL, SEL_KPL);
 
+   /* Initialize the tss (except for the final esp0) early for vm86. */
+   PCPU_SET(common_tss.tss_esp0, thread0.td_kstack +
+   thread0.td_kstack_pages * PAGE_SIZE - 16);
+   PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL));
+   gsel_tss = GSEL(GPROC0_SEL, SEL_KPL);
+   PCPU_SET(tss_gdt, [GPROC0_SEL].sd);
+   PCPU_SET(common_tssd, *PCPU_GET(tss_gdt));
+   PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16);
+   ltr(gsel_tss);
+
vm86_initialize();
getmemsize(first);
init_param2(physmem);
@@ -2701,14 +2711,10 @@ init386(first)
}
 #endif
PCPU_SET(curpcb, thread0.td_pcb);
-   /* make an initial tss so cpu can get interrupt stack on syscall! */
+   /* Move esp0 in the tss to its final place. */
/* Note: -16 is so we can grow the trapframe if we came from vm86 */
PCPU_SET(common_tss.tss_esp0, (vm_offset_t)thread0.td_pcb - 16);
-   PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL));
-   gsel_tss = GSEL(GPROC0_SEL, SEL_KPL);
-   PCPU_SET(tss_gdt, [GPROC0_SEL].sd);
-   PCPU_SET(common_tssd, *PCPU_GET(tss_gdt));
-   PCPU_SET(common_tss.tss_ioopt, (sizeof (struct i386tss)) << 16);
+   gdt[GPROC0_SEL].sd.sd_type = SDT_SYS386TSS; /* clear busy bit */
ltr(gsel_tss);
 
/* make a call gate to reenter kernel with */
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304436 - in head: . sys/netinet

2016-08-28 Thread Slawa Olhovchenkov
On Sat, Aug 27, 2016 at 07:05:01PM -0700, Adrian Chadd wrote:

> On 26 August 2016 at 17:46, Slawa Olhovchenkov  wrote:
> > On Fri, Aug 26, 2016 at 04:55:34PM -0700, Adrian Chadd wrote:
> >
> >> Hi,
> >>
> >> I use the kernel lock profiling debugging,
> >
> > I am already have 100% utilise all CPU cores, I think this is drop
> > performance?
> >
> >> but you can use dtrace to
> >> get an idea:
> >>
> >> dtrace -n 'lockstat:::adaptive-block { @[stack()] = sum(arg1); }'
> >
> > How to interpret results (how to distinct lock contention from lock
> > cost/overhead (LOCK CMPXCGQ is very expensive))?
> 
> well, paste the results? :)

OK, thanks!
http://m.uploadedit.com/ba3s/1472390519813.txt

> the lock is expensive because it's contended. :)

As I am understund lock contended:

1. Multiple thread wait same lock.
2. Performance not scaled by adding CPU power

As I understund lock expensive: Intel cache coherence protocol is
expensive and take lock 800K per second take too much cpu/memory
bandwidth w/o any contention. Memory latency at cache miss too.

Adding mory CPU power (more cores, more GHz) take me performane boost.
I am think my case is not lock contended.

> >> (https://wiki.freebsd.org/DTrace/One-Liners)
> >>
> >>
> >>
> >> -adrian
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304928 - in head/lib/libc: amd64/sys i386/sys sys

2016-08-28 Thread Andrey Chernov
On 28.08.2016 8:28, Bruce Evans wrote:
>> How hard it will be to bring ptrace() to what C99 expects? Perhaps now
>> time is suited well to change some obsoleted things.
> 
> This should be safe to change, since portable applications like gdb can't
> assume that the implemementation clobbers errno for them.

It looks safe for me too.

> Even FreeBSD's man page doesn't document the FreeBSD behaviour.  It
> documents, with poor wording, that applications must set errno as usual:
> 
> %%%
> RETURN VALUES
>  Some requests can cause ptrace() to return -1 as a non-error value; to
>  disambiguate, errno can be set to 0 before the call and checked
>  afterwards.
> %%%
> 
> The poor wording is just "errno can be set to 0".  It _must_ be set to 0.
> Also, the function gurantees to not clobber errno so that this checking
> is guaranteed to work.

Yes, I already mention this thing in my hour ago (related to your
answer) reply. We even don't have documented that ptrace() itself
overwrites errno, but document usual practice by setting it to 0 by its
user instead.

>> "conforming implementation may have extensions (including additional
>> library functions), provided they do not alter the behavior of any
>> strictly conforming program.3)"
>>
>> ptrace() is extension (additional library function) so can't set errno
>> to 0 (it breaks strictly conforming program).
> 
> Use of ptrace() makes a program very far from stricty conforming.  Only
> quality of implementation requires ptrace() to follow the usual rules.

It was terms mistake from my side, I already correct myself in my hour
ago reply.

___
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-unsubscr...@freebsd.org"


svn commit: r304956 - head/sys/modules

2016-08-28 Thread Bjoern A. Zeeb
Author: bz
Date: Sun Aug 28 12:05:34 2016
New Revision: 304956
URL: https://svnweb.freebsd.org/changeset/base/304956

Log:
  Back out r304907, Ed had fixed it apparently earlier in the cloudabi*
  subdirectories.
  
  Reported by:  np

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Sun Aug 28 11:58:15 2016(r304955)
+++ head/sys/modules/Makefile   Sun Aug 28 12:05:34 2016(r304956)
@@ -766,7 +766,7 @@ _epic=  epic
 _igb=  igb
 .endif
 
-.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE} == "i386"
+.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
 _cloudabi32=   cloudabi32
 .endif
 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
___
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-unsubscr...@freebsd.org"


svn commit: r304953 - head/sys/contrib/ipfilter/netinet

2016-08-28 Thread Dimitry Andric
Author: dim
Date: Sun Aug 28 11:51:46 2016
New Revision: 304953
URL: https://svnweb.freebsd.org/changeset/base/304953

Log:
  Define ipfilter's SOLARIS macro in a defined and portable way.
  
  Reviewed by:  cy
  MFC after:3 days
  Differential Revision: https://reviews.freebsd.org/D7671

Modified:
  head/sys/contrib/ipfilter/netinet/ip_compat.h

Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h
==
--- head/sys/contrib/ipfilter/netinet/ip_compat.h   Sun Aug 28 07:40:11 
2016(r304952)
+++ head/sys/contrib/ipfilter/netinet/ip_compat.h   Sun Aug 28 11:51:46 
2016(r304953)
@@ -32,7 +32,11 @@
 # define   __KERNEL__
 #endif
 
-#defineSOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4)))
+#if defined(sun) && (defined(__svr4__) || defined(__SVR4))
+# define   SOLARIS 1
+#else
+# define   SOLARIS 0
+#endif
 
 
 #if defined(__SVR4) || defined(__svr4__) || defined(__sgi)
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304947 - stable/11/tests/sys/kern/acct

2016-08-28 Thread Bruce Evans

On Sun, 28 Aug 2016, Garrett Cooper wrote:


Log:
 MFC r304238:

 Only expect :encode_tv_random_million to fail on 64-bit platforms

 It passes on i386


This can't depend on 64-bitness.  It might depend on FLT_EPSILON, but
IEEE might require a specific representation of floats and we only have
and only support one.

This is probably a bug in the tests that shows up on arches with extra
precision.  Perhaps just a complier bug.


Modified: stable/11/tests/sys/kern/acct/acct_test.c
==
--- stable/11/tests/sys/kern/acct/acct_test.c   Sun Aug 28 07:09:45 2016
(r304946)
+++ stable/11/tests/sys/kern/acct/acct_test.c   Sun Aug 28 07:10:48 2016
(r304947)
@@ -204,7 +204,10 @@ ATF_TC_BODY(encode_tv_random_million, tc
struct timeval tv;
long k;

-   atf_tc_expect_fail("the testcase violates FLT_EPSILON");
+#ifdef __LP64__
+   atf_tc_expect_fail("the testcase violates FLT_EPSILON on 64-bit "
+   "platforms, e.g. amd64");
+#endif

ATF_REQUIRE_MSG(unsetenv("TZ") == 0, "unsetting TZ failed; errno=%d", 
errno);


The rest of the function is:

X   for (k = 1; k < 100L; k++) {
X   tv.tv_sec = random();
X   tv.tv_usec = (random() % 100L);
X   v.c = encode_timeval(tv);
X   check_result(atf_tc_get_ident(tc),
X   (float)tv.tv_sec * AHZ + tv.tv_usec, v);
X   }

AHZ here is less than an obfuscation of literal 1000 or just 1e6 or
1e6F.  It doesn't even have the style bug of an L suffix like the nearby
literals.  Types are important here, but the L isn't.

AHZ used to be a constant related to fixed-point conversions in acct.h.
It used to have value 1000.  Note much like the AHZ.   now
devfines AHZV1 and this has value 64.  This is for a legacy API.  Not
very compatible.

This file doesn't include  except possibly via namespace
pollution, so it doesn't get any AHZ*.  It only uses AHZ to convert
tv_sec to usec.  This was magical and may be broken.  The file convert.c
is included.  This is a converted copy of kern_acct.c.  Back when AHZ
existed in acct.h, kern_acct.c used to use AHZ with its different value.
I don't see how overriding that value either didn't cause a redefinition
error or inconsistencies.  Now kern_acct.c doesn't use either AHZ* so
this definition is not magical.

So AHZ should be replaced by literal 100 except possibly for type
problems.  IIRC, C99 specifies the dubious behaviour of converting
integers to float in float expressions to support the dubious behaviour
of evaluating float expressions in float precision.  100 is even
exactly representable in float precision.  But the result of the
mutliplication isn't in general.  Adding a small tv_usec to a not
very large tv_sec converted to usec is almost certain to not be
representable in a 32-bit float after a few random choices.  So
we expect innacuracies.

The float expression may be evaluated in extra precision, and is on
i386.  So we expect smaller inaccuracies on i386.

It is not clear if remaining bugs are in the test or the compiler.
Probably both.  The test asks for inaccuracies and gets them in the
expression sometimes.  It doesn't try to force the inaccuracies by
casting to float, and only C90+ compilers do this cast as specified
since the specification specifies behaviour that is too pessimal to
use.  C90+ compilers are in short supply, but gcc later than aout
4.6 properlay pessimizes the cast when instructed to by certain
compiler flags.

But the test it calls a function which should do the conversion.  It
takes excessive inlining combined with the de-pessimization to not
do the conversion.  Apparently, clang does do the excessive inlining.
Otherwise the result would be the same on i386 as on amd64.

The test seems to be quite broken.  encode_timeval() does some
conversion which is presumably correct.  We calculate a value in
usec to compare against.  This is only done in float precision
(possibly higher, but we don't control this).  We expect a relative
error of about FLT_EPSILON in this.  Later we convert to a relative
error, so this is only slightly broken.  encode_timeval() must
have a rounding error, and our calculation has one and the scaling
has more.  So we should expect errors of several times FLT_EPSILON.
So the test only seems to be slightly broken.  Strictly less than
FLT_EPSILON is too strict if the calculations are actually done in
float precision since it is too difficult to calculate the reference
and do the scaling without increasing the error.  The worst case
for the reference is tv_sec = 2**31-1 (31 bits) and tv_usec = 99
(20 bits).  That is exactly representable in 53 bits (double precision)
so we should use that.

Bruce
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to 

svn commit: r304952 - head/sys/sys

2016-08-28 Thread Mariusz Zaborski
Author: oshogbo
Date: Sun Aug 28 07:40:11 2016
New Revision: 304952
URL: https://svnweb.freebsd.org/changeset/base/304952

Log:
  Remove duplicated declaration.
  
  Reported by:  adrian@

Modified:
  head/sys/sys/cnv.h

Modified: head/sys/sys/cnv.h
==
--- head/sys/sys/cnv.h  Sun Aug 28 07:19:33 2016(r304951)
+++ head/sys/sys/cnv.h  Sun Aug 28 07:40:11 2016(r304952)
@@ -98,7 +98,6 @@ void  cnvlist_free_number(nvlist_t *nvl, 
 void   cnvlist_free_string(nvlist_t *nvl, void *cookiep);
 void   cnvlist_free_nvlist(nvlist_t *nvl, void *cookiep);
 void   cnvlist_free_binary(nvlist_t *nvl, void *cookiep);
-void   cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep);
 void   cnvlist_free_bool_array(nvlist_t *nvl, void *cookiep);
 void   cnvlist_free_number_array(nvlist_t *nvl, void *cookiep);
 void   cnvlist_free_string_array(nvlist_t *nvl, void *cookiep);
___
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-unsubscr...@freebsd.org"


Re: svn commit: r304912 - head/sys/sys

2016-08-28 Thread Mariusz Zaborski
Eh, sorry.
Fixed in the @304952.

On 28 August 2016 at 06:17, Adrian Chadd  wrote:
> ...
>
> ===> lib/libnv (obj,all,install)
> In file included from
> /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/contrib/libnv/cnvlist.c:49:0:
> /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/sys/cnv.h:107:6:
> error: redundant redeclaration of 'cnvlist_free_descriptor'
> [-Werror=redundant-decls]
>  void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep);
>   ^
> /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv/../../sys/sys/cnv.h:101:6:
> note: previous declaration of 'cnvlist_free_descriptor' was here
>  void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep);
>   ^
> cc1: all warnings being treated as errors
> --- cnvlist.o ---
> *** [cnvlist.o] Error code 1
>
> make[4]: stopped in /usr/home/adrian/work/freebsd/head-embedded/src/lib/libnv
> 1 error
>
>
>
> -a
>
>
> On 27 August 2016 at 08:22, Mariusz Zaborski  wrote:
>> Author: oshogbo
>> Date: Sat Aug 27 15:22:55 2016
>> New Revision: 304912
>> URL: https://svnweb.freebsd.org/changeset/base/304912
>>
>> Log:
>>   Add missed header file for cnv.h .
>>
>>   Submitted by: Adam Starak 
>>   Reported by:  ache@
>>
>> Added:
>>   head/sys/sys/cnv.h   (contents, props changed)
>>
>> Added: head/sys/sys/cnv.h
>> ==
>> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
>> +++ head/sys/sys/cnv.h  Sat Aug 27 15:22:55 2016(r304912)
>> @@ -0,0 +1,113 @@
>> +/*-
>> + * Copyright (c) 2016 Adam Starak 
>> + * 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 AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE
>> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
>> CONSEQUENTIAL
>> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
>> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
>> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
>> STRICT
>> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
>> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
>> + * SUCH DAMAGE.
>> + *
>> + * $FreeBSD$
>> + */
>> +
>> +#ifndef_CNV_H_
>> +#define_CNV_H_
>> +
>> +#include 
>> +
>> +#ifndef _KERNEL
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#endif
>> +
>> +#ifndef_NVLIST_T_DECLARED
>> +#define_NVLIST_T_DECLARED
>> +struct nvlist;
>> +
>> +typedef struct nvlist nvlist_t;
>> +#endif
>> +
>> +__BEGIN_DECLS
>> +
>> +/*
>> + * The cnvlist_get functions returns value associated with the given cookie.
>> + * If it returns a pointer, the pointer represents internal buffer and 
>> should
>> + * not be freed by the caller.
>> + */
>> +
>> +boolcnvlist_get_bool(void *cookiep);
>> +uint64_tcnvlist_get_number(void *cookiep);
>> +const char *cnvlist_get_string(void *cookiep);
>> +const nvlist_t *cnvlist_get_nvlist(void *cookiep);
>> +const void *cnvlist_get_binary(void *cookiep, size_t *sizep);
>> +const bool *cnvlist_get_bool_array(void *cookiep, size_t 
>> *nitemsp);
>> +const uint64_t *cnvlist_get_number_array(void *cookiep, size_t 
>> *nitemsp);
>> +const char * const *cnvlist_get_string_array(void *cookiep, size_t 
>> *nitemsp);
>> +const nvlist_t * const *cnvlist_get_nvlist_array(void *cookiep, size_t 
>> *nitemsp);
>> +#ifndef _KERNEL
>> +int cnvlist_get_descriptor(void *cookiep);
>> +const int  *cnvlist_get_descriptor_array(void *cookiep, size_t 
>> *nitemsp);
>> +#endif
>> +
>> +
>> +/*
>> + * The cnvlist_take functions returns value associated with the given 
>> cookie and
>> + * remove the given entry from the nvlist.
>> + * The caller is responsible for freeing received data.
>> + */
>> +
>> +bool cnvlist_take_bool(nvlist_t *nvl, void *cookiep);
>> +uint64_t cnvlist_take_number(nvlist_t *nvl, void *cookiep);
>> +char

svn commit: r304951 - stable/11/usr.bin/tar/tests

2016-08-28 Thread Garrett Cooper
Author: ngie
Date: Sun Aug 28 07:19:33 2016
New Revision: 304951
URL: https://svnweb.freebsd.org/changeset/base/304951

Log:
  MFC r303804:
  
  Fix building usr.bin/tar/tests with PIE symbol building enabled by
  removing CFLAGS+= -static
  
  `CFLAGS+= -static` was a carryover from pre-r289195 with
  usr.bin/tar/test/Makefile that should have been specified in LDFLAGS
  There doesn't seem to be an apparent need for static compilation
  of the test binaries.
  
  Obtained-from:opBSD (418a491eed20d2603ddd1f1bd92c2c0d95094002)

Modified:
  stable/11/usr.bin/tar/tests/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/tar/tests/Makefile
==
--- stable/11/usr.bin/tar/tests/MakefileSun Aug 28 07:17:25 2016
(r304950)
+++ stable/11/usr.bin/tar/tests/MakefileSun Aug 28 07:19:33 2016
(r304951)
@@ -9,7 +9,6 @@ ATF_TESTS_SH+=  functional_test
 BINDIR=${TESTSDIR}
 
 CFLAGS+=   
-DPLATFORM_CONFIG_H=\"${SRCTOP}/lib/libarchive/config_freebsd.h\"
-CFLAGS+=   -static
 CFLAGS+=   -I${SRCTOP}/lib/libarchive -I${.OBJDIR}
 CFLAGS+=   -I${_LIBARCHIVEDIR}/tar -I${_LIBARCHIVEDIR}/test_utils
 
___
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-unsubscr...@freebsd.org"


svn commit: r304950 - stable/11/lib/libc/tests/resolv

2016-08-28 Thread Garrett Cooper
Author: ngie
Date: Sun Aug 28 07:17:25 2016
New Revision: 304950
URL: https://svnweb.freebsd.org/changeset/base/304950

Log:
  MFC r304033:
  
  Increase timeout from 10 minutes to 20 minutes for all tests
  
  On particular slow networks, it can (on average) take longer to
  resolve hosts to IP* addresses. 20 minutes seemed reasonable for
  my work network
  
  This will be solved in a more meaningful way (if possible) using
  concurrency in the near future

Modified:
  stable/11/lib/libc/tests/resolv/resolv_test.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/tests/resolv/resolv_test.c
==
--- stable/11/lib/libc/tests/resolv/resolv_test.c   Sun Aug 28 07:16:11 
2016(r304949)
+++ stable/11/lib/libc/tests/resolv/resolv_test.c   Sun Aug 28 07:17:25 
2016(r304950)
@@ -291,7 +291,7 @@ do {
\
 
 ATF_TC(getaddrinfo_test);
 ATF_TC_HEAD(getaddrinfo_test, tc) {
-   atf_tc_set_md_var(tc, "timeout", "450");
+   atf_tc_set_md_var(tc, "timeout", "1200");
 }
 ATF_TC_BODY(getaddrinfo_test, tc)
 {
@@ -301,7 +301,7 @@ ATF_TC_BODY(getaddrinfo_test, tc)
 
 ATF_TC(gethostby_test);
 ATF_TC_HEAD(gethostby_test, tc) {
-   atf_tc_set_md_var(tc, "timeout", "450");
+   atf_tc_set_md_var(tc, "timeout", "1200");
 }
 ATF_TC_BODY(gethostby_test, tc)
 {
@@ -312,7 +312,7 @@ ATF_TC_BODY(gethostby_test, tc)
 ATF_TC(getipnodeby_test);
 ATF_TC_HEAD(getipnodeby_test, tc) {
 
-   atf_tc_set_md_var(tc, "timeout", "450");
+   atf_tc_set_md_var(tc, "timeout", "1200");
 }
 ATF_TC_BODY(getipnodeby_test, tc)
 {
___
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-unsubscr...@freebsd.org"


svn commit: r304949 - stable/11/usr.bin/getconf

2016-08-28 Thread Garrett Cooper
Author: ngie
Date: Sun Aug 28 07:16:11 2016
New Revision: 304949
URL: https://svnweb.freebsd.org/changeset/base/304949

Log:
  MFC r303830,r304693,r304694,r304698:
  
  r303830:
  
  Remove vestigal references to __alpha__
  
  Replace alpha reference in getconf(1) with amd64 [*]
  
  PR:   211300 [*]
  
  r304693:
  
  Clean up trailing whitespace
  
  r304694:
  
  Add `MIN_HOLE_SIZE` pathconf(2) support to getconf
  
  This allows shell programs to programmatically determine whether
  or not a filesystem supports sparse files
  
  r304698:
  
  Add support for _PC_ACL_NFS4 as TRUSTEDBSD_ACL_NFS4
  
  The TRUSTEDBSD prefix was chosen for consistency with the other
  related `_PC_ACL*` prefixed variables.

Modified:
  stable/11/usr.bin/getconf/getconf.c
  stable/11/usr.bin/getconf/pathconf.gperf
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/getconf/getconf.c
==
--- stable/11/usr.bin/getconf/getconf.c Sun Aug 28 07:12:47 2016
(r304948)
+++ stable/11/usr.bin/getconf/getconf.c Sun Aug 28 07:16:11 2016
(r304949)
@@ -109,13 +109,13 @@ main(int argc, char **argv)
do_confstr(name, key);
else
printf("undefined\n");
-   } else {
+   } else {
valid = find_sysconf(name, );
if (valid > 0) {
do_sysconf(name, key);
} else if (valid < 0) {
printf("undefined\n");
-   } else 
+   } else
errx(EX_USAGE,
 "no such configuration parameter `%s'",
 name);

Modified: stable/11/usr.bin/getconf/pathconf.gperf
==
--- stable/11/usr.bin/getconf/pathconf.gperfSun Aug 28 07:12:47 2016
(r304948)
+++ stable/11/usr.bin/getconf/pathconf.gperfSun Aug 28 07:16:11 2016
(r304949)
@@ -24,6 +24,7 @@ FILESIZEBITS, _PC_FILESIZEBITS
 LINK_MAX, _PC_LINK_MAX
 MAX_CANON, _PC_MAX_CANON
 MAX_INPUT, _PC_MAX_INPUT
+MIN_HOLE_SIZE, _PC_MIN_HOLE_SIZE
 NAME_MAX, _PC_NAME_MAX
 PATH_MAX, _PC_PATH_MAX
 PIPE_BUF, _PC_PIPE_BUF
@@ -34,6 +35,7 @@ POSIX_REC_MIN_XFER_SIZE, _PC_REC_MIN_XFE
 POSIX_REC_XFER_ALIGN, _PC_REC_XFER_ALIGN
 SYMLINK_MAX, _PC_SYMLINK_MAX
 TRUSTEDBSD_ACL_EXTENDED, _PC_ACL_EXTENDED
+TRUSTEDBSD_ACL_NFS4, _PC_ACL_NFS4
 TRUSTEDBSD_ACL_PATH_MAX, _PC_ACL_PATH_MAX
 TRUSTEDBSD_CAP_PRESENT, _PC_CAP_PRESENT
 TRUSTEDBSD_INF_PRESENT, _PC_INF_PRESENT
___
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-unsubscr...@freebsd.org"


svn commit: r304948 - in stable/11/cddl/usr.sbin/dtrace/tests: common/raise common/safety tools

2016-08-28 Thread Garrett Cooper
Author: ngie
Date: Sun Aug 28 07:12:47 2016
New Revision: 304948
URL: https://svnweb.freebsd.org/changeset/base/304948

Log:
  MFC r303900:
  
  Highball memory requirement (4GB) with common/{raise,safety}
  
  Both test suites require more memory than my amd64 VM using
  GENERIC-NODEBUG can provide and reliably panic it with OOM issues in
  dtrace(4).
  
  Some of the testcases fail, but this at least bypasses the panic behavior
  on platforms that don't have enough resources
  
  Discussed with: markj

Modified:
  stable/11/cddl/usr.sbin/dtrace/tests/common/raise/Makefile
  stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile
  stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/usr.sbin/dtrace/tests/common/raise/Makefile
==
--- stable/11/cddl/usr.sbin/dtrace/tests/common/raise/Makefile  Sun Aug 28 
07:10:48 2016(r304947)
+++ stable/11/cddl/usr.sbin/dtrace/tests/common/raise/Makefile  Sun Aug 28 
07:12:47 2016(r304948)
@@ -20,4 +20,6 @@ CFILES= \
  tst.raise3.c  \
 
 
+TEST_METADATA.t_dtrace_contrib+=   required_memory="4g"
+
 .include "../../dtrace.test.mk"

Modified: stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile
==
--- stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Sun Aug 28 
07:10:48 2016(r304947)
+++ stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile Sun Aug 28 
07:12:47 2016(r304948)
@@ -53,4 +53,6 @@ CFILES= \
 
 
 
+TEST_METADATA.t_dtrace_contrib+=   required_memory="4g"
+
 .include "../../dtrace.test.mk"

Modified: stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
==
--- stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh  Sun Aug 28 
07:10:48 2016(r304947)
+++ stable/11/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh  Sun Aug 28 
07:12:47 2016(r304948)
@@ -34,15 +34,28 @@ genmakefile()
 
 # One-off variable definitions.
 local special
-if [ "$basedir" = proc ]; then
+case "$basedir" in
+proc)
 special="
 LIBADD.tst.sigwait.exe+= rt
 "
-elif [ "$basedir" = uctf ]; then
+;;
+raise)
+   special="
+TEST_METADATA.t_dtrace_contrib+=   required_memory=\"4g\"
+"
+;;
+safety)
+   special="
+TEST_METADATA.t_dtrace_contrib+=   required_memory=\"4g\"
+"
+;;
+uctf)
 special="
 WITH_CTF=YES
 "
-fi
+;;
+esac
 
 local makefile=$(mktemp)
 cat <<__EOF__ > $makefile
___
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-unsubscr...@freebsd.org"


svn commit: r304947 - stable/11/tests/sys/kern/acct

2016-08-28 Thread Garrett Cooper
Author: ngie
Date: Sun Aug 28 07:10:48 2016
New Revision: 304947
URL: https://svnweb.freebsd.org/changeset/base/304947

Log:
  MFC r304238:
  
  Only expect :encode_tv_random_million to fail on 64-bit platforms
  
  It passes on i386

Modified:
  stable/11/tests/sys/kern/acct/acct_test.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tests/sys/kern/acct/acct_test.c
==
--- stable/11/tests/sys/kern/acct/acct_test.c   Sun Aug 28 07:09:45 2016
(r304946)
+++ stable/11/tests/sys/kern/acct/acct_test.c   Sun Aug 28 07:10:48 2016
(r304947)
@@ -204,7 +204,10 @@ ATF_TC_BODY(encode_tv_random_million, tc
struct timeval tv;
long k;
 
-   atf_tc_expect_fail("the testcase violates FLT_EPSILON");
+#ifdef __LP64__
+   atf_tc_expect_fail("the testcase violates FLT_EPSILON on 64-bit "
+   "platforms, e.g. amd64");
+#endif
 
ATF_REQUIRE_MSG(unsetenv("TZ") == 0, "unsetting TZ failed; errno=%d", 
errno);
 
___
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-unsubscr...@freebsd.org"


svn commit: r304946 - stable/11/tests/sys/acl

2016-08-28 Thread Garrett Cooper
Author: ngie
Date: Sun Aug 28 07:09:45 2016
New Revision: 304946
URL: https://svnweb.freebsd.org/changeset/base/304946

Log:
  MFC r304040:
  
  Redirect the output of the testcases to stderr instead of
  redirecting it to /dev/null
  
  This will aid in debugging failures

Modified:
  stable/11/tests/sys/acl/00.sh
  stable/11/tests/sys/acl/01.sh
  stable/11/tests/sys/acl/02.sh
  stable/11/tests/sys/acl/03.sh
  stable/11/tests/sys/acl/04.sh
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/tests/sys/acl/00.sh
==
--- stable/11/tests/sys/acl/00.sh   Sun Aug 28 07:08:29 2016
(r304945)
+++ stable/11/tests/sys/acl/00.sh   Sun Aug 28 07:09:45 2016
(r304946)
@@ -75,7 +75,7 @@ chmod 600 xxx
 rm xxx
 echo "ok 2"
 
-perl $TESTDIR/run $TESTDIR/tools-posix.test > /dev/null
+perl $TESTDIR/run $TESTDIR/tools-posix.test >&2
 
 if [ $? -eq 0 ]; then
echo "ok 3"

Modified: stable/11/tests/sys/acl/01.sh
==
--- stable/11/tests/sys/acl/01.sh   Sun Aug 28 07:08:29 2016
(r304945)
+++ stable/11/tests/sys/acl/01.sh   Sun Aug 28 07:09:45 2016
(r304946)
@@ -76,7 +76,7 @@ chmod 600 xxx
 rm xxx
 echo "ok 2"
 
-perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test > /dev/null
+perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test >&2
 
 if [ $? -eq 0 ]; then
echo "ok 3"

Modified: stable/11/tests/sys/acl/02.sh
==
--- stable/11/tests/sys/acl/02.sh   Sun Aug 28 07:08:29 2016
(r304945)
+++ stable/11/tests/sys/acl/02.sh   Sun Aug 28 07:09:45 2016
(r304946)
@@ -76,9 +76,9 @@ rm xxx
 echo "ok 2"
 
 if [ `sysctl -n vfs.acl_nfs4_old_semantics` = 0 ]; then
-   perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test > /dev/null
+   perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test >&2
 else
-   perl $TESTDIR/run $TESTDIR/tools-nfs4.test > /dev/null
+   perl $TESTDIR/run $TESTDIR/tools-nfs4.test >&2
 fi
 
 if [ $? -eq 0 ]; then

Modified: stable/11/tests/sys/acl/03.sh
==
--- stable/11/tests/sys/acl/03.sh   Sun Aug 28 07:08:29 2016
(r304945)
+++ stable/11/tests/sys/acl/03.sh   Sun Aug 28 07:09:45 2016
(r304946)
@@ -89,7 +89,7 @@ echo "ok 3"
 
 cd $MNTROOT
 
-perl $TESTDIR/run $TESTDIR/tools-crossfs.test > /dev/null
+perl $TESTDIR/run $TESTDIR/tools-crossfs.test >&2
 
 if [ $? -eq 0 ]; then
echo "ok 4"

Modified: stable/11/tests/sys/acl/04.sh
==
--- stable/11/tests/sys/acl/04.sh   Sun Aug 28 07:08:29 2016
(r304945)
+++ stable/11/tests/sys/acl/04.sh   Sun Aug 28 07:09:45 2016
(r304946)
@@ -57,7 +57,7 @@ echo "ok 1"
 
 cd $MNT
 
-perl $TESTDIR/run $TESTDIR/tools-nfs4-trivial.test > /dev/null
+perl $TESTDIR/run $TESTDIR/tools-nfs4-trivial.test >&2
 
 if [ $? -eq 0 ]; then
echo "ok 2"
___
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-unsubscr...@freebsd.org"


svn commit: r304945 - stable/11/lib/libc/net

2016-08-28 Thread Garrett Cooper
Author: ngie
Date: Sun Aug 28 07:08:29 2016
New Revision: 304945
URL: https://svnweb.freebsd.org/changeset/base/304945

Log:
  MFC r304034:
  
  Initialize `ai` to NULL and test for `ai` with type-appropriate values
  
  Depending on the address family and ai_flags containing AI_V4MAPPED,
  it might not do a proper DNS lookup on the provided DNS address
  
  Convert some `ai` boolean true/false checks to NULL/non-NULL while here.
  
  PR:   211790

Modified:
  stable/11/lib/libc/net/getaddrinfo.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/net/getaddrinfo.c
==
--- stable/11/lib/libc/net/getaddrinfo.cSun Aug 28 05:42:03 2016
(r304944)
+++ stable/11/lib/libc/net/getaddrinfo.cSun Aug 28 07:08:29 2016
(r304945)
@@ -2249,6 +2249,8 @@ _dns_getaddrinfo(void *rv, void *cb_data
struct res_target q, q2;
res_state res;
 
+   ai = NULL;
+
hostname = va_arg(ap, char *);
pai = va_arg(ap, const struct addrinfo *);
 
@@ -2327,16 +2329,16 @@ _dns_getaddrinfo(void *rv, void *cb_data
/* prefer IPv6 */
if (q.next) {
ai = getanswer(buf2, q2.n, q2.name, q2.qtype, pai, res);
-   if (ai) {
+   if (ai != NULL) {
cur->ai_next = ai;
while (cur && cur->ai_next)
cur = cur->ai_next;
}
}
-   if (!ai || pai->ai_family != AF_UNSPEC ||
+   if (ai == NULL || pai->ai_family != AF_UNSPEC ||
(pai->ai_flags & (AI_ALL | AI_V4MAPPED)) != AI_V4MAPPED) {
ai = getanswer(buf, q.n, q.name, q.qtype, pai, res);
-   if (ai)
+   if (ai != NULL)
cur->ai_next = ai;
}
free(buf);
___
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-unsubscr...@freebsd.org"