svn commit: r321283 - head/usr.bin/procstat

2017-07-19 Thread Ngie Cooper
Author: ngie
Date: Thu Jul 20 05:43:48 2017
New Revision: 321283
URL: https://svnweb.freebsd.org/changeset/base/321283

Log:
  procstat(8): clarify program usage
  
  - Visualize mutually exclusive options and their corresponding
arguments.
  - Try to make the subtleties that are expressed in the code, and
potentially in the manpages, more apparent.

Modified:
  head/usr.bin/procstat/procstat.c

Modified: head/usr.bin/procstat/procstat.c
==
--- head/usr.bin/procstat/procstat.cThu Jul 20 04:32:06 2017
(r321282)
+++ head/usr.bin/procstat/procstat.cThu Jul 20 05:43:48 2017
(r321283)
@@ -50,12 +50,23 @@ static void
 usage(void)
 {
 
-   xo_error("usage: procstat [--libxo] [-CHhn] [-M core] "
+   xo_error(
+   "usage: procstat [--libxo] [-Hhn] [-M core] "
"[-N system] [-w interval]\n"
-   "[-b | -c | -e | -f | -i | -j | -k | "
-   "-l | -L | -r | -s | \n"
-   " -S | -t | -v | -x]\n"
-   "[-a | pid | core ...]\n");
+   "[-S | -b | -c | -e | -i | -j | -k | -kk | "
+   "-l | -r | -s | \n"
+   " -t | -v | -x]\n"
+   "[-a | pid ... | core ...]\n"
+   "   procstat [--libxo] -Cf [-hn] [-M core] "
+   "[-N system] [-a | pid ... | core ...]\n"
+   "[-S | -b | -c | -e | -i | -j | -k | -kk | "
+   "-l | -r | -s | \n"
+   "   procstat [--libxo] -L [-hn] [-M core] "
+   "[-N system] [-w interval]\n"
+   "[-S | -b | -c | -e | -i | -j | -k | -kk | "
+   "-l | -r | -s | \n"
+   " -t | -v | -x]\n"
+   "[core ...]\n");
xo_finish();
exit(EX_USAGE);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321282 - head/sys/dev/e1000

2017-07-19 Thread Ngie Cooper
Author: ngie
Date: Thu Jul 20 04:32:06 2017
New Revision: 321282
URL: https://svnweb.freebsd.org/changeset/base/321282

Log:
  Some trivial style(9) fixes
  
  - Delete trailing whitespace.
  - Fix leading indentation (convert single column spaces to tabs).
  - Convert "[Ff]all through" to "FALLTHROUGH", per implicit project
style/spelling.
  
  Reviewed by:  sbruno
  Differential Revision:D11665

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Thu Jul 20 01:19:05 2017(r321281)
+++ head/sys/dev/e1000/if_em.c  Thu Jul 20 04:32:06 2017(r321282)
@@ -203,7 +203,7 @@ static pci_vendor_info_t igb_vendor_info_array[] =
PVID(0x8086, E1000_DEV_ID_I210_COPPER_OEM1, "Intel(R) PRO/1000 
PCI-Express Network Driver"),
PVID(0x8086, E1000_DEV_ID_I210_COPPER_FLASHLESS, "Intel(R) PRO/1000 
PCI-Express Network Driver"),
PVID(0x8086, E1000_DEV_ID_I210_SERDES_FLASHLESS, "Intel(R) PRO/1000 
PCI-Express Network Driver"),
-   PVID(0x8086, E1000_DEV_ID_I210_FIBER, "Intel(R) PRO/1000 PCI-Express 
Network Driver"), 
+   PVID(0x8086, E1000_DEV_ID_I210_FIBER, "Intel(R) PRO/1000 PCI-Express 
Network Driver"),
PVID(0x8086, E1000_DEV_ID_I210_SERDES, "Intel(R) PRO/1000 PCI-Express 
Network Driver"),
PVID(0x8086, E1000_DEV_ID_I210_SGMII, "Intel(R) PRO/1000 PCI-Express 
Network Driver"),
PVID(0x8086, E1000_DEV_ID_I211_COPPER, "Intel(R) PRO/1000 PCI-Express 
Network Driver"),
@@ -231,8 +231,8 @@ static int  em_if_rx_queues_alloc(if_ctx_t ctx, caddr_t
 static voidem_if_queues_free(if_ctx_t ctx);
 
 static uint64_tem_if_get_counter(if_ctx_t, ift_counter);
-static voidem_if_init(if_ctx_t ctx); 
-static voidem_if_stop(if_ctx_t ctx); 
+static voidem_if_init(if_ctx_t ctx);
+static voidem_if_stop(if_ctx_t ctx);
 static voidem_if_media_status(if_ctx_t, struct ifmediareq *);
 static int em_if_media_change(if_ctx_t ctx);
 static int em_if_mtu_set(if_ctx_t ctx, uint32_t mtu);
@@ -357,11 +357,11 @@ static device_method_t em_if_methods[] = {
DEVMETHOD(ifdi_detach, em_if_detach),
DEVMETHOD(ifdi_shutdown, em_if_shutdown),
DEVMETHOD(ifdi_suspend, em_if_suspend),
-   DEVMETHOD(ifdi_resume, em_if_resume), 
+   DEVMETHOD(ifdi_resume, em_if_resume),
DEVMETHOD(ifdi_init, em_if_init),
DEVMETHOD(ifdi_stop, em_if_stop),
DEVMETHOD(ifdi_msix_intr_assign, em_if_msix_intr_assign),
-   DEVMETHOD(ifdi_intr_enable, em_if_enable_intr), 
+   DEVMETHOD(ifdi_intr_enable, em_if_enable_intr),
DEVMETHOD(ifdi_intr_disable, em_if_disable_intr),
DEVMETHOD(ifdi_tx_queues_alloc, em_if_tx_queues_alloc),
DEVMETHOD(ifdi_rx_queues_alloc, em_if_rx_queues_alloc),
@@ -1401,7 +1401,7 @@ em_msix_link(void *arg)
u32 reg_icr;
 
++adapter->link_irq;
-   MPASS(adapter->hw.back != NULL); 
+   MPASS(adapter->hw.back != NULL);
reg_icr = E1000_READ_REG(>hw, E1000_ICR);
 
if (reg_icr & E1000_ICR_RXO)
@@ -1720,9 +1720,9 @@ em_if_update_admin_status(if_ctx_t ctx)
break;
/* VF device is type_unknown */
case e1000_media_type_unknown:
-e1000_check_for_link(hw);
+   e1000_check_for_link(hw);
link_check = !hw->mac.get_link_status;
-   /* Fall thru */
+   /* FALLTHROUGH */
default:
break;
}
@@ -2536,15 +2536,15 @@ em_reset(if_ctx_t ctx)
case e1000_vfadapt_i350:
/* 16-byte granularity */
hw->fc.low_water = hw->fc.high_water - 16;
-   break; 
-case e1000_ich9lan:
-case e1000_ich10lan:
+   break;
+   case e1000_ich9lan:
+   case e1000_ich10lan:
if (if_getmtu(ifp) > ETHERMTU) {
hw->fc.high_water = 0x2800;
hw->fc.low_water = hw->fc.high_water - 8;
break;
}
-   /* else fall thru */
+   /* FALLTHROUGH */
default:
if (hw->mac.type == e1000_80003es2lan)
hw->fc.pause_time = 0x;
@@ -2611,7 +2611,7 @@ em_initialize_rss_mapping(struct adapter *adapter)
for (i = 0; i < 32; ++i)
E1000_WRITE_REG(hw, E1000_RETA(i), reta);
 
-   E1000_WRITE_REG(hw, E1000_MRQC, E1000_MRQC_RSS_ENABLE_2Q | 
+   E1000_WRITE_REG(hw, E1000_MRQC, E1000_MRQC_RSS_ENABLE_2Q |
E1000_MRQC_RSS_FIELD_IPV4_TCP |
E1000_MRQC_RSS_FIELD_IPV4 |
E1000_MRQC_RSS_FIELD_IPV6_TCP_EX |
@@ -2698,8 +2698,7 @@ igb_initialize_rss_mapping(struct adapter *adapter)
arc4rand(_key, sizeof(rss_key), 0);
 #endif
for (i = 0; i < 10; i++)
-   E1000_WRITE_REG_ARRAY(hw,
-   

svn commit: r321261 - head/usr.sbin/newsyslog/tests

2017-07-19 Thread Ngie Cooper
Author: ngie
Date: Thu Jul 20 00:40:03 2017
New Revision: 321261
URL: https://svnweb.freebsd.org/changeset/base/321261

Log:
  Clean up leading whitespace (convert single column spaces to hard tabs)
  
  MFC after:now

Modified:
  head/usr.sbin/newsyslog/tests/legacy_test.sh

Modified: head/usr.sbin/newsyslog/tests/legacy_test.sh
==
--- head/usr.sbin/newsyslog/tests/legacy_test.shThu Jul 20 00:33:12 
2017(r321260)
+++ head/usr.sbin/newsyslog/tests/legacy_test.shThu Jul 20 00:40:03 
2017(r321261)
@@ -14,8 +14,8 @@ RFC3164_FMT='^[A-Z][a-z]{2} [ 0-9][0-9] [0-9]{2}:[0-9]
 COUNT=0
 TMPDIR=$(pwd)/work
 if [ $? -ne 0 ]; then
-echo "$0: Can't create temp dir, exiting..."
-exit 1
+   echo "$0: Can't create temp dir, exiting..."
+   exit 1
 fi
 
 # Begin an individual test
@@ -432,8 +432,8 @@ tests_rfc5424() {
cknt ${dir}${LOGFNAME}.0${ext}
ckfe $LOGFNAME5424
cknt ${dir}${LOGFNAME5424}.0${ext}
-ckrfc3164 ${LOGFNAME}
-ckrfc5424 ${LOGFNAME5424}
+   ckrfc3164 ${LOGFNAME}
+   ckrfc5424 ${LOGFNAME5424}
end
 
begin "RFC-5424 - rotate normal 1 ${name_postfix}"
@@ -442,10 +442,10 @@ tests_rfc5424() {
ckfe ${dir}${LOGFNAME}.0${ext}
ckfe $LOGFNAME5424
ckfe ${dir}${LOGFNAME5424}.0${ext}
-ckrfc3164 ${LOGFNAME}
-ckrfc3164 ${dir}${LOGFNAME}.0${ext}
-ckrfc5424 ${LOGFNAME5424}
-ckrfc5424 ${dir}${LOGFNAME5424}.0${ext}
+   ckrfc3164 ${LOGFNAME}
+   ckrfc3164 ${dir}${LOGFNAME}.0${ext}
+   ckrfc5424 ${LOGFNAME5424}
+   ckrfc5424 ${dir}${LOGFNAME5424}.0${ext}
end
 
tmpdir_clean
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321258 - head/usr.bin/truss

2017-07-19 Thread Mark Johnston
Author: markj
Date: Wed Jul 19 23:34:28 2017
New Revision: 321258
URL: https://svnweb.freebsd.org/changeset/base/321258

Log:
  Decode FreeBSD11 fstatat calls.

Modified:
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/syscalls.c
==
--- head/usr.bin/truss/syscalls.c   Wed Jul 19 22:41:22 2017
(r321257)
+++ head/usr.bin/truss/syscalls.c   Wed Jul 19 23:34:28 2017
(r321258)
@@ -148,6 +148,9 @@ static struct syscall decoded_syscalls[] = {
  .args = { { Int, 0 } } },
{ .name = "compat11.fstat", .ret_type = 1, .nargs = 2,
  .args = { { Int, 0 }, { Stat11 | OUT, 1 } } },
+   { .name = "compat11.fstatat", .ret_type = 1, .nargs = 4,
+ .args = { { Atfd, 0 }, { Name | IN, 1 }, { Stat11 | OUT, 2 },
+   { Atflags, 3 } } },
{ .name = "compat11.lstat", .ret_type = 1, .nargs = 2,
  .args = { { Name | IN, 0 }, { Stat11 | OUT, 1 } } },
{ .name = "compat11.stat", .ret_type = 1, .nargs = 2,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321257 - head/sys/dev/e1000

2017-07-19 Thread Sean Bruno
Author: sbruno
Date: Wed Jul 19 22:41:22 2017
New Revision: 321257
URL: https://svnweb.freebsd.org/changeset/base/321257

Log:
  Restore igb(4) code dropped during iflib conversion
   - restore newer code for vf, i350, i210, i211
   - restore dmac init code for i354 and i350
   - restore WUC/WUFC update
   - check for igb mac type before attempting trying to assert
 a media changed event.
   - handle link events for igb(4) and em(4) devices differently
 and appropriately for their respective model types.
  
  Submitted by: Matt Macy 
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Wed Jul 19 22:06:35 2017(r321256)
+++ head/sys/dev/e1000/if_em.c  Wed Jul 19 22:41:22 2017(r321257)
@@ -1025,7 +1025,7 @@ em_if_attach_post(if_ctx_t ctx)
/* Non-AMT based hardware can now take control from firmware */
if (adapter->has_manage && !adapter->has_amt)
em_get_hw_control(adapter);
-   
+
INIT_DEBUGOUT("em_if_attach_post: end");
 
return (error);
@@ -1691,8 +1691,9 @@ em_if_update_admin_status(if_ctx_t ctx)
struct e1000_hw *hw = >hw;
struct ifnet *ifp = iflib_get_ifp(ctx);
device_t dev = iflib_get_dev(ctx);
-   u32 link_check = 0;
+   u32 link_check, thstat, ctrl;
 
+   link_check = thstat = ctrl = 0;
/* Get the cached link value or read phy for real */
switch (hw->phy.media_type) {
case e1000_media_type_copper:
@@ -1717,11 +1718,21 @@ em_if_update_admin_status(if_ctx_t ctx)
e1000_check_for_link(hw);
link_check = adapter->hw.mac.serdes_has_link;
break;
-   default:
+   /* VF device is type_unknown */
case e1000_media_type_unknown:
+e1000_check_for_link(hw);
+   link_check = !hw->mac.get_link_status;
+   /* Fall thru */
+   default:
break;
}
 
+   /* Check for thermal downshift or shutdown */
+   if (hw->mac.type == e1000_i350) {
+   thstat = E1000_READ_REG(hw, E1000_THSTAT);
+   ctrl = E1000_READ_REG(hw, E1000_CTRL_EXT);
+   }
+
/* Now check for a transition */
if (link_check && (adapter->link_active == 0)) {
e1000_get_speed_and_duplex(hw, >link_speed,
@@ -1743,6 +1754,21 @@ em_if_update_admin_status(if_ctx_t ctx)
adapter->link_active = 1;
adapter->smartspeed = 0;
if_setbaudrate(ifp, adapter->link_speed * 100);
+   if ((ctrl & E1000_CTRL_EXT_LINK_MODE_GMII) &&
+   (thstat & E1000_THSTAT_LINK_THROTTLE))
+   device_printf(dev, "Link: thermal downshift\n");
+   /* Delay Link Up for Phy update */
+   if (((hw->mac.type == e1000_i210) ||
+   (hw->mac.type == e1000_i211)) &&
+   (hw->phy.id == I210_I_PHY_ID))
+   msec_delay(I210_LINK_DELAY);
+   /* Reset if the media type changed. */
+   if ((hw->dev_spec._82575.media_changed) &&
+   (adapter->hw.mac.type >= igb_mac_min)) {
+   hw->dev_spec._82575.media_changed = false;
+   adapter->flags |= IGB_MEDIA_RESET;
+   em_reset(ctx);
+   }
iflib_link_state_change(ctx, LINK_STATE_UP, ifp->if_baudrate);
printf("Link state changed to up\n");
} else if (!link_check && (adapter->link_active == 1)) {
@@ -2210,7 +2236,115 @@ lem_smartspeed(struct adapter *adapter)
adapter->smartspeed = 0;
 }
 
+/*
+ *
+ *  Initialize the DMA Coalescing feature
+ *
+ **/
+static void
+igb_init_dmac(struct adapter *adapter, u32 pba)
+{
+   device_tdev = adapter->dev;
+   struct e1000_hw *hw = >hw;
+   u32 dmac, reg = ~E1000_DMACR_DMAC_EN;
+   u16 hwm;
+   u16 max_frame_size;
 
+   if (hw->mac.type == e1000_i211)
+   return;
+
+   max_frame_size = adapter->shared->isc_max_frame_size;
+   if (hw->mac.type > e1000_82580) {
+
+   if (adapter->dmac == 0) { /* Disabling it */
+   E1000_WRITE_REG(hw, E1000_DMACR, reg);
+   return;
+   } else
+   device_printf(dev, "DMA Coalescing enabled\n");
+
+   /* Set starting threshold */
+   E1000_WRITE_REG(hw, E1000_DMCTXTH, 0);
+
+   hwm = 64 * pba - max_frame_size / 16;
+   if (hwm < 64 * (pba - 6))
+   hwm = 64 * 

svn commit: r321256 - head/sys/conf

2017-07-19 Thread Brooks Davis
Author: brooks
Date: Wed Jul 19 22:06:35 2017
New Revision: 321256
URL: https://svnweb.freebsd.org/changeset/base/321256

Log:
  Include ARCH_FLAGS in CFLAGS when building modules.
  
  Without this change, modules will match the default compiler
  configuration which may not be the same as the kernel values.
  
  Reviewed by:  imp
  Obtained from:CheriBSD
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D11633

Modified:
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Wed Jul 19 21:19:28 2017(r321255)
+++ head/sys/conf/kern.pre.mk   Wed Jul 19 22:06:35 2017(r321256)
@@ -216,6 +216,7 @@ MKMODULESENV+=  MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMO
 MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH}
 MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH}
 MKMODULESENV+= MODULES_EXTRA="${MODULES_EXTRA}" 
WITHOUT_MODULES="${WITHOUT_MODULES}"
+MKMODULESENV+= ARCH_FLAGS="${ARCH_FLAGS}"
 .if (${KERN_IDENT} == LINT)
 MKMODULESENV+= ALL_MODULES=LINT
 .endif

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Wed Jul 19 21:19:28 2017(r321255)
+++ head/sys/conf/kmod.mk   Wed Jul 19 22:06:35 2017(r321256)
@@ -366,7 +366,7 @@ ${_src}:
 .endif
 
 # Respect configuration-specific C flags.
-CFLAGS+=   ${CONF_CFLAGS}
+CFLAGS+=   ${ARCH_FLAGS} ${CONF_CFLAGS}
 
 .if !empty(SRCS:Mvnode_if.c)
 CLEANFILES+=   vnode_if.c
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321253 - head/sys/net

2017-07-19 Thread Sean Bruno
Author: sbruno
Date: Wed Jul 19 21:18:04 2017
New Revision: 321253
URL: https://svnweb.freebsd.org/changeset/base/321253

Log:
  Don't cache mbuf pointers if the number of descriptors is greater than
  the number of buffers.
  
  Submitted by: Matt Macy 
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cWed Jul 19 21:06:31 2017(r321252)
+++ head/sys/net/iflib.cWed Jul 19 21:18:04 2017(r321253)
@@ -2927,6 +2927,14 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
m_free(tmp);
continue;
}
+   m = m->m_next;
+   count++;
+   } while (m != NULL);
+   if (count > *nsegs)
+   return (0);
+   m = *m0;
+   count = 0;
+   do {
next = (pidx + count) & (ntxd-1);
MPASS(ifsd_m[next] == NULL);
ifsd_m[next] = m;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321248 - head/usr.sbin/nfsd

2017-07-19 Thread Rick Macklem
Author: rmacklem
Date: Wed Jul 19 20:57:41 2017
New Revision: 321248
URL: https://svnweb.freebsd.org/changeset/base/321248

Log:
  Update the nfsv4 man page to reflect recent changes to support
  the newer RFCs (5661 and 7530). The main man changes are for the
  case of "numbers in strings" for user/groups that RFC7530 allows
  and avoids use of nfsuserd(8).
  
  This is a content change.
  
  Reviewed by:  trasz (earlier version)
  MFC after:1 week

Modified:
  head/usr.sbin/nfsd/nfsv4.4

Modified: head/usr.sbin/nfsd/nfsv4.4
==
--- head/usr.sbin/nfsd/nfsv4.4  Wed Jul 19 20:52:47 2017(r321247)
+++ head/usr.sbin/nfsd/nfsv4.4  Wed Jul 19 20:57:41 2017(r321248)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 1, 2013
+.Dd July 19, 2017
 .Dt NFSV4 4
 .Os
 .Sh NAME
@@ -34,7 +34,8 @@
 The NFS client and server provides support for the
 .Tn NFSv4
 specification; see
-.%T "Network File System (NFS) Version 4 Protocol RFC 3530" .
+.%T "Network File System (NFS) Version 4 Protocol RFC 7530" and
+.%T "Network File System (NFS) Version 4 Minor Version 1 Protocol RFC 5661" .
 The protocol is somewhat similar to NFS Version 3, but differs in significant
 ways.
 It uses a single compound RPC that concatenates operations to-gether.
@@ -74,6 +75,7 @@ It provides several optional features not present in N
 - Referrals, which redirect subtrees to other servers
   (not yet implemented)
 - Delegations, which allow a client to operate on a file locally
+- pNFS, where I/O operations are separated from Metadata operations
 .Ed
 .Pp
 The
@@ -115,8 +117,8 @@ multiple server file systems, although not all clients
 this.
 .Pp
 .Nm
-uses names for users and groups instead of numbers.
-On the wire, they
+uses strings for users and groups instead of numbers.
+On the wire, these strings can either have the numbers in the string or
 take the form:
 .sp
 .Bd -literal -offset indent -compact
@@ -136,15 +138,37 @@ Under FreeBSD, the mapping daemon is called
 .Xr nfsuserd 8
 and has a command line option that overrides the domain component of the
 machine's hostname.
-For use of
+For use of this form of string on
 .Nm ,
 either client or server, this daemon must be running.
-If this ``'' is not set correctly or the daemon is not running, 
``ls -l'' will typically
+.Pp
+The form where the numbers are in the strings can only be used for AUTH_SYS.
+To configure your systems this way, the
+.Xr nfsuserd 8
+daemon does not need to be running on the server, but the following sysctls 
need to be
+set to 1 on the server.
+.sp
+.Bd -literal -offset indent -compact
+vfs.nfs.enable_uidtostring
+vfs.nfsd.enable_stringtouid
+.Ed
+.sp
+On the client, the sysctl
+.sp
+.Bd -literal -offset indent -compact
+vfs.nfs.enable_uidtostring
+.Ed
+.sp
+must be set to 1 and the
+.Xr nfsuserd 8
+daemon does not need to be running.
+.Pp
+If these strings are not configured correctly, ``ls -l'' will typically
 report a lot of ``nobody'' and ``nogroup'' ownerships.
 .Pp
 Although uid/gid numbers are no longer used in the
 .Nm
-protocol, they will still be in the RPC authentication fields when
+protocol except optionally in the above strings, they will still be in the RPC 
authentication fields when
 using AUTH_SYS (sec=sys), which is the default.
 As such, in this case both the user/group name and number spaces must
 be consistent between the client and server.
@@ -156,24 +180,24 @@ will go on the wire.
 .Sh SERVER SETUP
 To set up the NFS server that supports
 .Nm ,
-you will need to either set the variables in
+you will need to set the variables in
 .Xr rc.conf 5
 as follows:
 .sp
 .Bd -literal -offset indent -compact
 nfs_server_enable="YES"
 nfsv4_server_enable="YES"
+.Ed
+.sp
+plus
+.sp
+.Bd -literal -offset indent -compact
 nfsuserd_enable="YES"
 .Ed
 .sp
-or start
-.Xr mountd 8
-and
-.Xr nfsd 8
-without the ``-o'' option, which would force use of the old server.
-The
-.Xr nfsuserd 8
-daemon must also be running.
+if the server is using the ``@'' form of user/group strings or
+is using the ``-manage-gids'' option for
+.Xr nfsuserd 8 .
 .Pp
 You will also need to add at least one ``V4:'' line to the
 .Xr exports 5
@@ -232,7 +256,7 @@ plus set ``tcp'' and
 .Pp
 The
 .Xr nfsuserd 8
-must be running, as above.
+must be running if name<->uid/gid mapping is being used, as above.
 Also, since an
 .Nm
 mount uses the host uuid to identify the client uniquely to the server,
@@ -255,7 +279,7 @@ daemon to handle client side callbacks.
 This will occur if
 .sp
 .Bd -literal -offset indent -compact
-nfsuserd_enable="YES"
+nfsuserd_enable="YES"  <-- If name<->uid/gid mapping is being used.
 nfscbd_enable="YES"
 .Ed
 .sp
@@ -265,7 +289,7 @@ are set in
 Without a functioning callback path, a server will never issue Delegations
 to a client.
 .sp
-By default, the callback address will be set to the IP address acquired via
+For NFSv4.0, by default, the callback address will be set to 

svn commit: r321247 - in head/sys: sys vm

2017-07-19 Thread Konstantin Belousov
Author: kib
Date: Wed Jul 19 20:52:47 2017
New Revision: 321247
URL: https://svnweb.freebsd.org/changeset/base/321247

Log:
  Add pctrie_init() and vm_radix_init() to initialize generic pctrie and
  vm_radix trie.
  
  Existing vm_radix_init() function is renamed to vm_radix_zinit().
  Inlines moved out of the _ headers.
  
  Reviewed by:  alc, markj (previous version)
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D11661

Modified:
  head/sys/sys/_pctrie.h
  head/sys/sys/pctrie.h
  head/sys/vm/_vm_radix.h
  head/sys/vm/vm_object.c
  head/sys/vm/vm_radix.c
  head/sys/vm/vm_radix.h

Modified: head/sys/sys/_pctrie.h
==
--- head/sys/sys/_pctrie.h  Wed Jul 19 20:49:04 2017(r321246)
+++ head/sys/sys/_pctrie.h  Wed Jul 19 20:52:47 2017(r321247)
@@ -38,14 +38,4 @@ struct pctrie {
uintptr_t   pt_root;
 };
 
-#ifdef _KERNEL
-
-static __inline boolean_t
-pctrie_is_empty(struct pctrie *ptree)
-{
-
-   return (ptree->pt_root == 0);
-}
-
-#endif /* _KERNEL */
 #endif /* !__SYS_PCTRIE_H_ */

Modified: head/sys/sys/pctrie.h
==
--- head/sys/sys/pctrie.h   Wed Jul 19 20:49:04 2017(r321246)
+++ head/sys/sys/pctrie.h   Wed Jul 19 20:52:47 2017(r321247)
@@ -119,5 +119,19 @@ void   pctrie_remove(struct pctrie *ptree, 
uint64_t key
 size_t pctrie_node_size(void);
 intpctrie_zone_init(void *mem, int size, int flags);
 
+static __inline void
+pctrie_init(struct pctrie *ptree)
+{
+
+   ptree->pt_root = 0;
+}
+
+static __inline boolean_t
+pctrie_is_empty(struct pctrie *ptree)
+{
+
+   return (ptree->pt_root == 0);
+}
+
 #endif /* _KERNEL */
 #endif /* !_SYS_PCTRIE_H_ */

Modified: head/sys/vm/_vm_radix.h
==
--- head/sys/vm/_vm_radix.h Wed Jul 19 20:49:04 2017(r321246)
+++ head/sys/vm/_vm_radix.h Wed Jul 19 20:52:47 2017(r321247)
@@ -38,14 +38,4 @@ struct vm_radix {
uintptr_t   rt_root;
 };
 
-#ifdef _KERNEL
-
-static __inline boolean_t
-vm_radix_is_empty(struct vm_radix *rtree)
-{
-
-   return (rtree->rt_root == 0);
-}
-
-#endif /* _KERNEL */
 #endif /* !__VM_RADIX_H_ */

Modified: head/sys/vm/vm_object.c
==
--- head/sys/vm/vm_object.c Wed Jul 19 20:49:04 2017(r321246)
+++ head/sys/vm/vm_object.c Wed Jul 19 20:52:47 2017(r321247)
@@ -204,7 +204,7 @@ vm_object_zinit(void *mem, int size, int flags)
/* These are true for any object that has been freed */
object->type = OBJT_DEAD;
object->ref_count = 0;
-   object->rtree.rt_root = 0;
+   vm_radix_init(>rtree);
object->paging_in_progress = 0;
object->resident_page_count = 0;
object->shadow_count = 0;
@@ -301,7 +301,7 @@ vm_object_init(void)
 #endif
vm_object_zinit, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
 
-   vm_radix_init();
+   vm_radix_zinit();
 }
 
 void

Modified: head/sys/vm/vm_radix.c
==
--- head/sys/vm/vm_radix.c  Wed Jul 19 20:49:04 2017(r321246)
+++ head/sys/vm/vm_radix.c  Wed Jul 19 20:52:47 2017(r321247)
@@ -310,7 +310,7 @@ SYSINIT(vm_radix_reserve_kva, SI_SUB_KMEM, SI_ORDER_TH
  * Initialize the UMA slab zone.
  */
 void
-vm_radix_init(void)
+vm_radix_zinit(void)
 {
 
vm_radix_node_zone = uma_zcreate("RADIX NODE",

Modified: head/sys/vm/vm_radix.h
==
--- head/sys/vm/vm_radix.h  Wed Jul 19 20:49:04 2017(r321246)
+++ head/sys/vm/vm_radix.h  Wed Jul 19 20:52:47 2017(r321247)
@@ -35,7 +35,6 @@
 
 #ifdef _KERNEL
 
-void   vm_radix_init(void);
 intvm_radix_insert(struct vm_radix *rtree, vm_page_t page);
 boolean_t  vm_radix_is_singleton(struct vm_radix *rtree);
 vm_page_t  vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index);
@@ -44,6 +43,21 @@ vm_page_tvm_radix_lookup_le(struct vm_radix *rtree, v
 void   vm_radix_reclaim_allnodes(struct vm_radix *rtree);
 vm_page_t  vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index);
 vm_page_t  vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage);
+void   vm_radix_zinit(void);
+
+static __inline void
+vm_radix_init(struct vm_radix *rtree)
+{
+
+   rtree->rt_root = 0;
+}
+
+static __inline boolean_t
+vm_radix_is_empty(struct vm_radix *rtree)
+{
+
+   return (rtree->rt_root == 0);
+}
 
 #endif /* _KERNEL */
 #endif /* !_VM_RADIX_H_ */
___
svn-src-head@freebsd.org mailing list

svn commit: r321240 - head/usr.sbin/cron/cron

2017-07-19 Thread Ngie Cooper
Author: ngie
Date: Wed Jul 19 19:53:07 2017
New Revision: 321240
URL: https://svnweb.freebsd.org/changeset/base/321240

Log:
  cron(8) manpage updates
  
  - Document /etc/cron.d and /usr/local/etc/cron.d under FILES.
  - Reword documentation for -n: add appropriate soft-stop and remove
contraction to appease igor.
  
  MFC after:3 days

Modified:
  head/usr.sbin/cron/cron/cron.8

Modified: head/usr.sbin/cron/cron/cron.8
==
--- head/usr.sbin/cron/cron/cron.8  Wed Jul 19 19:43:10 2017
(r321239)
+++ head/usr.sbin/cron/cron/cron.8  Wed Jul 19 19:53:07 2017
(r321240)
@@ -17,7 +17,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 31, 2016
+.Dd July 19, 2017
 .Dt CRON 8
 .Os
 .Sh NAME
@@ -138,7 +138,7 @@ set to a null string, usually specified in a shell as
 or
 .Li \*q\*q .
 .It Fl n
-Don't daemonize, run in foreground instead.
+Do not daemonize; run in foreground instead.
 .It Fl s
 Enable special handling of situations when the GMT offset of the local
 timezone changes, such as the switches between the standard time and
@@ -209,13 +209,17 @@ trace through the execution, but do not perform any ac
 .El
 .El
 .Sh FILES
-.Bl -tag -width /etc/pam.d/cron -compact
+.Bl -tag -width /usr/local/etc/cron.d -compact
 .It Pa /etc/crontab
 System crontab file
+.It Pa /etc/cron.d
+Directory for optional/modularized system crontab files.
 .It Pa /etc/pam.d/cron
 .Xr pam.conf 5
 configuration file for
 .Nm
+.It Pa /usr/local/etc/cron.d
+Directory for third-party package provided crontab files.
 .It Pa /var/cron/tabs
 Directory for personal crontab files
 .El
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321235 - head/usr.sbin/cron/cron

2017-07-19 Thread Ngie Cooper
Author: ngie
Date: Wed Jul 19 19:38:25 2017
New Revision: 321235
URL: https://svnweb.freebsd.org/changeset/base/321235

Log:
  Fix trivial whitespace bug introduced in usage message changes for -n
  support (r304570).
  
  MFC after:now

Modified:
  head/usr.sbin/cron/cron/cron.c

Modified: head/usr.sbin/cron/cron/cron.c
==
--- head/usr.sbin/cron/cron/cron.c  Wed Jul 19 19:30:13 2017
(r321234)
+++ head/usr.sbin/cron/cron/cron.c  Wed Jul 19 19:38:25 2017
(r321235)
@@ -59,7 +59,7 @@ usage() {
 #endif
 
fprintf(stderr, "usage: cron [-j jitter] [-J rootjitter] "
-   "[-m mailto] [-n ] [-s] [-o] [-x debugflag[,...]]\n");
+   "[-m mailto] [-n] [-s] [-o] [-x debugflag[,...]]\n");
 #if DEBUGGING
fprintf(stderr, "\ndebugflags: ");
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321233 - head/sys/dev/qlxgbe

2017-07-19 Thread David C Somayajulu
Author: davidcs
Date: Wed Jul 19 19:08:37 2017
New Revision: 321233
URL: https://svnweb.freebsd.org/changeset/base/321233

Log:
  Raise the watchdog timer interval to 2 ticks, there by guaranteeing
  that it fires between 1ms and 2ms. `
  Treat two consecutive occurrences of Heartbeat failures as a legitimate
  Heartbeat failure
  
  MFC after:3 days

Modified:
  head/sys/dev/qlxgbe/ql_def.h
  head/sys/dev/qlxgbe/ql_hw.c
  head/sys/dev/qlxgbe/ql_hw.h
  head/sys/dev/qlxgbe/ql_os.c

Modified: head/sys/dev/qlxgbe/ql_def.h
==
--- head/sys/dev/qlxgbe/ql_def.hWed Jul 19 19:06:19 2017
(r321232)
+++ head/sys/dev/qlxgbe/ql_def.hWed Jul 19 19:08:37 2017
(r321233)
@@ -105,7 +105,7 @@ struct qla_ivec {
 
 typedef struct qla_ivec qla_ivec_t;
 
-#define QLA_WATCHDOG_CALLOUT_TICKS 1
+#define QLA_WATCHDOG_CALLOUT_TICKS 2
 
 typedef struct _qla_tx_ring {
qla_tx_buf_ttx_buf[NUM_TX_DESCRIPTORS];

Modified: head/sys/dev/qlxgbe/ql_hw.c
==
--- head/sys/dev/qlxgbe/ql_hw.c Wed Jul 19 19:06:19 2017(r321232)
+++ head/sys/dev/qlxgbe/ql_hw.c Wed Jul 19 19:08:37 2017(r321233)
@@ -3366,7 +3366,7 @@ ql_hw_check_health(qla_host_t *ha)
 
ha->hw.health_count++;
 
-   if (ha->hw.health_count < 1000)
+   if (ha->hw.health_count < 500)
return 0;
 
ha->hw.health_count = 0;
@@ -3385,10 +3385,18 @@ ql_hw_check_health(qla_host_t *ha)
if ((val != ha->hw.hbeat_value) &&
(!(QL_ERR_INJECT(ha, INJCT_HEARTBEAT_FAILURE {
ha->hw.hbeat_value = val;
+   ha->hw.hbeat_failure = 0;
return 0;
}
-   device_printf(ha->pci_dev, "%s: Heartbeat Failue [0x%08x]\n",
-   __func__, val);
+
+   ha->hw.hbeat_failure++;
+
+   if (ha->hw.hbeat_failure < 2) /* we ignore the first failure */
+   return 0;
+   else
+   device_printf(ha->pci_dev, "%s: Heartbeat Failue [0x%08x]\n",
+   __func__, val);
+
 
return -1;
 }

Modified: head/sys/dev/qlxgbe/ql_hw.h
==
--- head/sys/dev/qlxgbe/ql_hw.h Wed Jul 19 19:06:19 2017(r321232)
+++ head/sys/dev/qlxgbe/ql_hw.h Wed Jul 19 19:08:37 2017(r321233)
@@ -1671,6 +1671,7 @@ typedef struct _qla_hw {
/* heart beat register value */
uint32_thbeat_value;
uint32_thealth_count;
+   uint32_thbeat_failure;
 
uint32_tmax_tx_segs;
uint32_tmin_lro_pkt_size;

Modified: head/sys/dev/qlxgbe/ql_os.c
==
--- head/sys/dev/qlxgbe/ql_os.c Wed Jul 19 19:06:19 2017(r321232)
+++ head/sys/dev/qlxgbe/ql_os.c Wed Jul 19 19:08:37 2017(r321233)
@@ -276,7 +276,7 @@ qla_watchdog(void *arg)
ha->qla_watchdog_paused = 1;
}
 
-   ha->watchdog_ticks = ha->watchdog_ticks++ % 1000;
+   ha->watchdog_ticks = ha->watchdog_ticks++ % 500;
callout_reset(>tx_callout, QLA_WATCHDOG_CALLOUT_TICKS,
qla_watchdog, ha);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321230 - head/sys/vm

2017-07-19 Thread Konstantin Belousov
Author: kib
Date: Wed Jul 19 19:00:32 2017
New Revision: 321230
URL: https://svnweb.freebsd.org/changeset/base/321230

Log:
  Disable stack growth when accessed by AIO daemons.
  
  Commit message for r321173 incorrectly stated that the change disables
  automatic stack growth from the AIO daemons contexts, with explanation
  that this is currently prevents applying wrong resource limits.  Fix
  this by actually disabling the growth.
  
  Noted by: alc
  Reviewed by:  alc, jhb
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==
--- head/sys/vm/vm_map.cWed Jul 19 18:59:26 2017(r321229)
+++ head/sys/vm/vm_map.cWed Jul 19 19:00:32 2017(r321230)
@@ -3698,8 +3698,15 @@ vm_map_growstack(vm_map_t map, vm_offset_t addr, vm_ma
 
p = curproc;
vm = p->p_vmspace;
-   if (map != >p_vmspace->vm_map)
+
+   /*
+* Disallow stack growth when the access is performed by a
+* debugger or AIO daemon.  The reason is that the wrong
+* resource limits are applied.
+*/
+   if (map != >p_vmspace->vm_map || p->p_textvp == NULL)
return (KERN_FAILURE);
+
MPASS(!map->system_map);
 
guard = stack_guard_page * PAGE_SIZE;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321228 - head/usr.sbin/crashinfo

2017-07-19 Thread Mark Johnston
Author: markj
Date: Wed Jul 19 18:41:16 2017
New Revision: 321228
URL: https://svnweb.freebsd.org/changeset/base/321228

Log:
  Allow matches of truncated version strings.
  
  Long objdir paths make it easy to hit the version string length limit in
  kernel dump headers. The build number and timestamp are unlikely to be
  truncated and ought to be sufficient to protect against false positives.
  
  Discussed with:   jhb
  MFC after:1 week

Modified:
  head/usr.sbin/crashinfo/crashinfo.sh

Modified: head/usr.sbin/crashinfo/crashinfo.sh
==
--- head/usr.sbin/crashinfo/crashinfo.shWed Jul 19 18:30:16 2017
(r321227)
+++ head/usr.sbin/crashinfo/crashinfo.shWed Jul 19 18:41:16 2017
(r321228)
@@ -83,10 +83,12 @@ find_kernel()
}
}' $INFO)
 
-   # Look for a matching kernel version.
+   # Look for a matching kernel version, handling possible truncation
+   # of the version string recovered from the dump.
for k in `sysctl -n kern.bootfile` $(ls -t /boot/*/kernel); do
-   kvers=$(gdb_command $k 'printf "  Version String: %s", version' 
\
-2>/dev/null)
+   kvers=$(gdb_command $k 'printf "  Version String: %s", version' 
| \
+   awk "{line=line\$0\"\n\"} END{print 
substr(line,1,${#ivers})}" \
+   2>/dev/null)
if [ "$ivers" = "$kvers" ]; then
KERNEL=$k
break
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321227 - head/usr.bin/diff/tests

2017-07-19 Thread Ngie Cooper
Author: ngie
Date: Wed Jul 19 18:30:16 2017
New Revision: 321227
URL: https://svnweb.freebsd.org/changeset/base/321227

Log:
  Use more flexible expression for replacing t_diff in
  contrib/netbsd-tests/usr.bin/diff/t_diff.sh with the name of the script via
  `basename $0`.
  
  This was a change I forgot to port over from
  ^/head/gnu/usr.bin/diff/tests/Makefile@r272787.

Modified:
  head/usr.bin/diff/tests/Makefile

Modified: head/usr.bin/diff/tests/Makefile
==
--- head/usr.bin/diff/tests/MakefileWed Jul 19 18:25:52 2017
(r321226)
+++ head/usr.bin/diff/tests/MakefileWed Jul 19 18:30:16 2017
(r321227)
@@ -31,7 +31,7 @@ ${PACKAGE}FILES+= \
d_mallocv1.in   \
d_mallocv2.in
 
-ATF_TESTS_SH_SED_netbsd_diff_test+=-e 's,t_diff,netbsd_diff_test,g'
+ATF_TESTS_SH_SED_netbsd_diff_test+=-e 's/t_diff/`basename $$0`/g'
 ATF_TESTS_SH_SRC_netbsd_diff_test= t_diff.sh
 
 .include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321226 - head/usr.sbin/bsdinstall/scripts

2017-07-19 Thread Ed Maste
Author: emaste
Date: Wed Jul 19 18:25:52 2017
New Revision: 321226
URL: https://svnweb.freebsd.org/changeset/base/321226

Log:
  bsdinstall: improve checksum mismatch error for snapshots
  
  The usual case of a mismatched checksum for installer snapshots
  (e.g., -CURRENT, -ALPHA*) is that a newer snapshot has been built and
  the old install sets have been replaced.  Provide a specific error
  message for checksum mismatches there that suggests looking for a newer
  snapshot.
  
  Submitted by: Guangyuan Yang 
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D11641

Modified:
  head/usr.sbin/bsdinstall/scripts/checksum

Modified: head/usr.sbin/bsdinstall/scripts/checksum
==
--- head/usr.sbin/bsdinstall/scripts/checksum   Wed Jul 19 18:23:49 2017
(r321225)
+++ head/usr.sbin/bsdinstall/scripts/checksum   Wed Jul 19 18:25:52 2017
(r321226)
@@ -62,8 +62,16 @@ for dist in $DISTRIBUTIONS; do
percentage=$(echo $percentage + 100/`echo $DISTRIBUTIONS | wc 
-w` | bc)
else
eval "status_$distname=1"
-   dialog --backtitle "FreeBSD Installer" --title "Error" \
-   --msgbox "The checksum for $dist does not match. It may 
have become corrupted, and should be redownloaded." 0 0
+   case $(/bin/freebsd-version -u) in
+   *-ALPHA*|*-CURRENT|*-STABLE|*-PRERELEASE)
+   dialog --backtitle "FreeBSD Installer" --title "Error" \
+   --msgbox "The checksum for $dist does not match. It 
may have become corrupted, or it may be from a newer version of FreeBSD. Please 
check for a newer snapshot." 0 0
+   ;;
+   *)
+   dialog --backtitle "FreeBSD Installer" --title "Error" \
+   --msgbox "The checksum for $dist does not match. It 
may have become corrupted, and should be redownloaded." 0 0
+   ;;
+   esac
exit 1
fi
 done
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321218 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2017-07-19 Thread Ed Maste
Author: emaste
Date: Wed Jul 19 18:17:41 2017
New Revision: 321218
URL: https://svnweb.freebsd.org/changeset/base/321218

Log:
  zfs: Fix a typo in the delay_min_dirty_percent sysctl description
  
  The description is FreeBSD-specific and was added in r266497
  to fix PR189865.
  
  PR:   220825
  Submitted by: Fabian Keil
  Obtained from:ElectroBSD
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c  Wed Jul 
19 17:28:46 2017(r321217)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c  Wed Jul 
19 18:17:41 2017(r321218)
@@ -167,7 +167,7 @@ static int sysctl_zfs_delay_min_dirty_percent(SYSCTL_H
 SYSCTL_PROC(_vfs_zfs, OID_AUTO, delay_min_dirty_percent,
 CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(int),
 sysctl_zfs_delay_min_dirty_percent, "I",
-"The limit of outstanding dirty data before transations are delayed");
+"The limit of outstanding dirty data before transactions are delayed");
 
 static int sysctl_zfs_delay_scale(SYSCTL_HANDLER_ARGS);
 /* No zfs_delay_scale tunable due to limit requirements */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321217 - head/sys/vm

2017-07-19 Thread Konstantin Belousov
Author: kib
Date: Wed Jul 19 17:28:46 2017
New Revision: 321217
URL: https://svnweb.freebsd.org/changeset/base/321217

Log:
  Remove unused function swap_pager_isswapped().
  
  Noted by: alc
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/vm/swap_pager.c
  head/sys/vm/swap_pager.h

Modified: head/sys/vm/swap_pager.c
==
--- head/sys/vm/swap_pager.cWed Jul 19 16:54:34 2017(r321216)
+++ head/sys/vm/swap_pager.cWed Jul 19 17:28:46 2017(r321217)
@@ -1585,43 +1585,6 @@ swp_pager_async_iodone(struct buf *bp)
);
 }
 
-/*
- * swap_pager_isswapped:
- *
- * Return 1 if at least one page in the given object is paged
- * out to the given swap device.
- *
- * This routine may not sleep.
- */
-int
-swap_pager_isswapped(vm_object_t object, struct swdevt *sp)
-{
-   daddr_t index = 0;
-   int bcount;
-   int i;
-
-   VM_OBJECT_ASSERT_WLOCKED(object);
-   if (object->type != OBJT_SWAP)
-   return (0);
-
-   mtx_lock(_mtx);
-   for (bcount = 0; bcount < object->un_pager.swp.swp_bcount; bcount++) {
-   struct swblock *swap;
-
-   if ((swap = *swp_pager_hash(object, index)) != NULL) {
-   for (i = 0; i < SWAP_META_PAGES; ++i) {
-   if (swp_pager_isondev(swap->swb_pages[i], sp)) {
-   mtx_unlock(_mtx);
-   return (1);
-   }
-   }
-   }
-   index += SWAP_META_PAGES;
-   }
-   mtx_unlock(_mtx);
-   return (0);
-}
-
 int
 swap_pager_nswapdev(void)
 {

Modified: head/sys/vm/swap_pager.h
==
--- head/sys/vm/swap_pager.hWed Jul 19 16:54:34 2017(r321216)
+++ head/sys/vm/swap_pager.hWed Jul 19 17:28:46 2017(r321217)
@@ -82,7 +82,6 @@ void swap_pager_copy(vm_object_t, vm_object_t, vm_pind
 vm_pindex_t swap_pager_find_least(vm_object_t object, vm_pindex_t pindex);
 void swap_pager_freespace(vm_object_t, vm_pindex_t, vm_size_t);
 void swap_pager_swap_init(void);
-int swap_pager_isswapped(vm_object_t, struct swdevt *);
 int swap_pager_nswapdev(void);
 int swap_pager_reserve(vm_object_t, vm_pindex_t, vm_size_t);
 void swap_pager_status(int *total, int *used);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321214 - head/targets/pseudo/tests

2017-07-19 Thread Ngie Cooper
Author: ngie
Date: Wed Jul 19 16:45:57 2017
New Revision: 321214
URL: https://svnweb.freebsd.org/changeset/base/321214

Log:
  Update targets/pseudo/tests/Makefile.depend after recent 
additions/subtractions
  from the FreeBSD test suite.
  
  MFC after:3 days
  MFC with: r316603

Modified:
  head/targets/pseudo/tests/Makefile.depend

Modified: head/targets/pseudo/tests/Makefile.depend
==
--- head/targets/pseudo/tests/Makefile.depend   Wed Jul 19 16:39:00 2017
(r321213)
+++ head/targets/pseudo/tests/Makefile.depend   Wed Jul 19 16:45:57 2017
(r321214)
@@ -7,9 +7,12 @@
 # find . -name Makefile -exec grep -l '^\.include.*\.test.mk' {} + | grep -v 
'^\./contrib' | sed -e 's,/Makefile,,' -e 's,^\./,,' -e 's,^, ,' -e 's,$, 
\\,' | sort
 DIRDEPS= \
   bin/cat/tests \
+  bin/chmod/tests \
   bin/date/tests \
   bin/dd/tests \
+  bin/echo/tests \
   bin/expr/tests \
+  bin/ln/tests \
   bin/ls/tests \
   bin/mv/tests \
   bin/pax/tests \
@@ -118,7 +121,6 @@ DIRDEPS= \
   cddl/usr.sbin/zfsd/tests \
   gnu/lib/tests \
   gnu/tests \
-  gnu/usr.bin/diff/tests \
   gnu/usr.bin/tests \
   lib/atf/libatf-c++/tests \
   lib/atf/libatf-c++/tests/detail \
@@ -186,6 +188,7 @@ DIRDEPS= \
   sbin/ifconfig/tests \
   sbin/mdconfig/tests \
   sbin/pfctl/tests \
+  sbin/savecore/tests \
   sbin/tests \
   secure/lib/tests \
   secure/libexec/tests \
@@ -196,7 +199,9 @@ DIRDEPS= \
   share/examples/tests/tests \
   share/examples/tests/tests/atf \
   share/examples/tests/tests/plain \
+  share/examples/tests/tests/tap \
   share/tests \
+  share/zoneinfo/tests \
   tests \
   tests/etc \
   tests/etc/rc.d \
@@ -246,6 +251,7 @@ DIRDEPS= \
   tests/sys/pjdfstest/tests/symlink \
   tests/sys/pjdfstest/tests/truncate \
   tests/sys/pjdfstest/tests/unlink \
+  tests/sys/pjdfstest/tests/utimensat \
   tests/sys/posixshm \
   tests/sys/sys \
   tests/sys/vfs \
@@ -306,13 +312,19 @@ DIRDEPS= \
   usr.bin/cmp/tests \
   usr.bin/col/tests \
   usr.bin/comm/tests \
+  usr.bin/compress/tests \
   usr.bin/cpio/tests \
+  usr.bin/csplit/tests \
   usr.bin/cut/tests \
   usr.bin/diff/tests \
+  usr.bin/diff3/tests \
   usr.bin/dirname/tests \
+  usr.bin/du/tests \
   usr.bin/file2c/tests \
+  usr.bin/getconf/tests \
   usr.bin/grep/tests \
   usr.bin/gzip/tests \
+  usr.bin/hexdump/tests \
   usr.bin/ident/tests \
   usr.bin/indent/tests \
   usr.bin/join/tests \
@@ -324,10 +336,12 @@ DIRDEPS= \
   usr.bin/ncal/tests \
   usr.bin/pr/tests \
   usr.bin/printf/tests \
+  usr.bin/procstat/tests \
   usr.bin/sdiff/tests \
   usr.bin/sed/tests \
   usr.bin/sed/tests/regress.multitest.out \
   usr.bin/soelim/tests \
+  usr.bin/stat/tests \
   usr.bin/tail/tests \
   usr.bin/tar/tests \
   usr.bin/tests \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321211 - head/tests/sys/kern

2017-07-19 Thread Ngie Cooper
Author: ngie
Date: Wed Jul 19 16:23:02 2017
New Revision: 321211
URL: https://svnweb.freebsd.org/changeset/base/321211

Log:
  Clean up :coredump_phnum
  
  - Use "atf_check -x 'cmd1 | cmd2'" instead of "cmd1 | atf_check cmd2". The
two forms are idiomatically similar, but subtly different in the sense of
what program invokes the other, and there could be unwanted side effects
of the latter idiom dealing with forking, pipes, etc.
  - Remove chmod and instead source coredump_phnum_restore_state.sh directly.
This avoids the need to check the result of the chmod call.
  - Fix indentation in an if-block (4 column space indentation -> hard tab).

Modified:
  head/tests/sys/kern/coredump_phnum_test.sh

Modified: head/tests/sys/kern/coredump_phnum_test.sh
==
--- head/tests/sys/kern/coredump_phnum_test.sh  Wed Jul 19 16:08:08 2017
(r321210)
+++ head/tests/sys/kern/coredump_phnum_test.sh  Wed Jul 19 16:23:02 2017
(r321211)
@@ -46,7 +46,6 @@ coredump_phnum_body()
sysctl kern.coredump=$(sysctl -n kern.coredump)
sysctl kern.corefile='$(sysctl -n kern.corefile)'
 EOF
-   chmod +x coredump_phnum_restore_state.sh
 
ulimit -c unlimited
sysctl kern.coredump=1
@@ -56,30 +55,27 @@ EOF
 
# Check that core looks good
if [ ! -f coredump_phnum_helper.core ]; then
-   atf_fail "Helper program did not dump core"
+   atf_fail "Helper program did not dump core"
fi
 
# These magic numbers don't have any real significance.  They are just
# the result of running the helper program and dumping core.  The only
# important bit is that they're larger than 65535 (UINT16_MAX).
-   readelf -h coredump_phnum_helper.core | \
-   atf_check -o "match:65535 \(66[0-9]{3}\)" \
-   grep "Number of program headers:"
-   readelf -l coredump_phnum_helper.core | \
-   atf_check -o "match:There are 66[0-9]{3} program headers" \
-   grep -1 "program headers"
-   readelf -S coredump_phnum_helper.core | \
-   atf_check -o "match: 0001 .* 66[0-9]{3} " \
-   grep -A1 "^  \[ 0\] "
+   atf_check -o "match:65535 \(66[0-9]{3}\)" \
+   -x 'readelf -h coredump_phnum_helper.core | grep "Number of program 
headers:"'
+   atf_check -o "match:There are 66[0-9]{3} program headers" \
+   -x 'readelf -l coredump_phnum_helper.core | grep -1 "program 
headers"'
+   atf_check -o "match: 0001 .* 66[0-9]{3} " \
+   -x 'readelf -S coredump_phnum_helper.core | grep -A1 "^  \[ 0\] "'
 
-   procstat -v coredump_phnum_helper.core | \
-   atf_check -o "match:66[0-9]{3}" wc -l
+   atf_check -o "match:66[0-9]{3}" \
+   -x 'procstat -v coredump_phnum_helper.core | wc -l'
 }
 coredump_phnum_cleanup()
 {
rm -f coredump_phnum_helper.core
-   if [ -x coredump_phnum_restore_state.sh ]; then
-   ./coredump_phnum_restore_state.sh
+   if [ -f coredump_phnum_restore_state.sh ]; then
+   . ./coredump_phnum_restore_state.sh
fi
rm -f coredump_phnum_restore_state.sh
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321210 - head/tests/sys/kern

2017-07-19 Thread Ngie Cooper
Author: ngie
Date: Wed Jul 19 16:08:08 2017
New Revision: 321210
URL: https://svnweb.freebsd.org/changeset/base/321210

Log:
  Remove expected failure for :coredump_phnum
  
  The testcase no longer fails on ^/head because readelf has established parity
  with binutils' copy of readelf.
  
  This issue is not seen on Jenkins because
  `test_suites.FreeBSD.allow_sysctl_side_effects` isn't set in kyua.conf on
  the CI host, i.e., the test is skipped.
  
  PR:   215019
  Tested with:  binutils (amd64-binutils-2.28,1); elftoolchain (r3561M)

Modified:
  head/tests/sys/kern/coredump_phnum_test.sh

Modified: head/tests/sys/kern/coredump_phnum_test.sh
==
--- head/tests/sys/kern/coredump_phnum_test.sh  Wed Jul 19 15:59:51 2017
(r321209)
+++ head/tests/sys/kern/coredump_phnum_test.sh  Wed Jul 19 16:08:08 2017
(r321210)
@@ -39,8 +39,6 @@ coredump_phnum_head()
 }
 coredump_phnum_body()
 {
-   atf_expect_fail "elftoolchain (base) readelf doesn't handle extended 
program header numbers; bug # 215019"
-
# Set up core dumping
cat > coredump_phnum_restore_state.sh <<-EOF
#!/bin/sh
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321207 - in head/sys/dev: mpr mps

2017-07-19 Thread Kenneth D. Merry
Author: ken
Date: Wed Jul 19 15:39:01 2017
New Revision: 321207
URL: https://svnweb.freebsd.org/changeset/base/321207

Log:
  Fix spurious timeouts on commands sent to mps(4) and mpr(4) controllers.
  
  mps_wait_command() and mpr_wait_command() were using getmicrotime() to
  determine elapsed time when checking for a timeout in polled mode.
  getmicrotime() isn't guaranteed to monotonically increase, and that
  caused spurious timeouts occasionally.
  
  Switch to using getmicrouptime(), which does increase monotonically.
  This fixes the spurious timeouts in my test case.
  
  Reviewed by:  slm, scottl
  MFC after:3 days
  Sponsored by: Spectra Logic

Modified:
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mps/mps.c

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Wed Jul 19 15:22:10 2017(r321206)
+++ head/sys/dev/mpr/mpr.c  Wed Jul 19 15:39:01 2017(r321207)
@@ -3286,9 +3286,17 @@ mpr_wait_command(struct mpr_softc *sc, struct mpr_comm
if (curthread->td_pflags & TDP_NOSLEEPING)
 #endif //__FreeBSD_version >= 129
sleep_flag = NO_SLEEP;
-   getmicrotime(_time);
+   getmicrouptime(_time);
if (mtx_owned(>mpr_mtx) && sleep_flag == CAN_SLEEP) {
error = msleep(cm, >mpr_mtx, 0, "mprwait", timeout*hz);
+   if (error == EWOULDBLOCK) {
+   /*
+* Record the actual elapsed time in the case of a
+* timeout for the message below.
+*/
+   getmicrouptime(_time);
+   timevalsub(_time, _time);
+   }
} else {
while ((cm->cm_flags & MPR_CM_FLAGS_COMPLETE) == 0) {
mpr_intr_locked(sc);
@@ -3297,8 +3305,9 @@ mpr_wait_command(struct mpr_softc *sc, struct mpr_comm
else
DELAY(5);

-   getmicrotime(_time);
-   if ((cur_time.tv_sec - start_time.tv_sec) > timeout) {
+   getmicrouptime(_time);
+   timevalsub(_time, _time);
+   if (cur_time.tv_sec > timeout) {
error = EWOULDBLOCK;
break;
}
@@ -3306,7 +3315,9 @@ mpr_wait_command(struct mpr_softc *sc, struct mpr_comm
}
 
if (error == EWOULDBLOCK) {
-   mpr_dprint(sc, MPR_FAULT, "Calling Reinit from %s\n", __func__);
+   mpr_dprint(sc, MPR_FAULT, "Calling Reinit from %s, timeout=%d,"
+   " elapsed=%jd\n", __func__, timeout,
+   (intmax_t)cur_time.tv_sec);
rc = mpr_reinit(sc);
mpr_dprint(sc, MPR_FAULT, "Reinit %s\n", (rc == 0) ? "success" :
"failed");

Modified: head/sys/dev/mps/mps.c
==
--- head/sys/dev/mps/mps.c  Wed Jul 19 15:22:10 2017(r321206)
+++ head/sys/dev/mps/mps.c  Wed Jul 19 15:39:01 2017(r321207)
@@ -2551,10 +2551,18 @@ mps_wait_command(struct mps_softc *sc, struct mps_comm
 */
if (curthread->td_no_sleeping != 0)
sleep_flag = NO_SLEEP;
-   getmicrotime(_time);
+   getmicrouptime(_time);
if (mtx_owned(>mps_mtx) && sleep_flag == CAN_SLEEP) {
cm->cm_flags |= MPS_CM_FLAGS_WAKEUP;
error = msleep(cm, >mps_mtx, 0, "mpswait", timeout*hz);
+   if (error == EWOULDBLOCK) {
+   /*
+* Record the actual elapsed time in the case of a
+* timeout for the message below.
+*/
+   getmicrouptime(_time);
+   timevalsub(_time, _time);
+   }
} else {
while ((cm->cm_flags & MPS_CM_FLAGS_COMPLETE) == 0) {
mps_intr_locked(sc);
@@ -2563,8 +2571,9 @@ mps_wait_command(struct mps_softc *sc, struct mps_comm
else
DELAY(5);

-   getmicrotime(_time);
-   if ((cur_time.tv_sec - start_time.tv_sec) > timeout) {
+   getmicrouptime(_time);
+   timevalsub(_time, _time);
+   if (cur_time.tv_sec > timeout) {
error = EWOULDBLOCK;
break;
}
@@ -2572,7 +2581,9 @@ mps_wait_command(struct mps_softc *sc, struct mps_comm
}
 
if (error == EWOULDBLOCK) {
-   mps_dprint(sc, MPS_FAULT, "Calling Reinit from %s\n", __func__);
+   mps_dprint(sc, MPS_FAULT, "Calling Reinit from %s, timeout=%d,"
+  

svn commit: r321206 - head/tests/sys/aio

2017-07-19 Thread Alan Somers
Author: asomers
Date: Wed Jul 19 15:22:10 2017
New Revision: 321206
URL: https://svnweb.freebsd.org/changeset/base/321206

Log:
  Remove dead code that was killed by r320975
  
  Reported by:  Coverity
  CID:  1377977
  MFC after:15 days
  X-MFC-With:   320975
  Sponsored by: Spectra Logic Corp

Modified:
  head/tests/sys/aio/aio_test.c

Modified: head/tests/sys/aio/aio_test.c
==
--- head/tests/sys/aio/aio_test.c   Wed Jul 19 15:12:23 2017
(r321205)
+++ head/tests/sys/aio/aio_test.c   Wed Jul 19 15:22:10 2017
(r321206)
@@ -158,15 +158,10 @@ poll(struct aiocb *aio)
 
while ((error = aio_error(aio)) == EINPROGRESS)
usleep(25000);
-   switch (error) {
-   case EINPROGRESS:
-   errno = EINTR;
-   return (-1);
-   case 0:
-   return (aio_return(aio));
-   default:
-   return (error);
-   }
+   if (error)
+   return (error);
+   else
+   return (aio_return(aio));
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321205 - head/sys/netinet

2017-07-19 Thread Michael Tuexen
Author: tuexen
Date: Wed Jul 19 15:12:23 2017
New Revision: 321205
URL: https://svnweb.freebsd.org/changeset/base/321205

Log:
  Avoid shadowed variables.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_indata.c

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Wed Jul 19 14:28:58 2017
(r321204)
+++ head/sys/netinet/sctp_indata.c  Wed Jul 19 15:12:23 2017
(r321205)
@@ -2071,12 +2071,12 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struc
return (0);
}
if ((chk_flags & SCTP_DATA_NOT_FRAG) == SCTP_DATA_NOT_FRAG) {
-   struct mbuf *m;
+   struct mbuf *mm;
 
control->data = dmbuf;
-   m = control->data;
-   for (m = control->data; m; m = m->m_next) {
-   control->length += SCTP_BUF_LEN(m);
+   mm = control->data;
+   for (mm = control->data; mm; mm = mm->m_next) {
+   control->length += SCTP_BUF_LEN(mm);
}
control->tail_mbuf = NULL;
control->end_added = 1;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321204 - in head/sys: netinet netinet6

2017-07-19 Thread Michael Tuexen
Author: tuexen
Date: Wed Jul 19 14:28:58 2017
New Revision: 321204
URL: https://svnweb.freebsd.org/changeset/base/321204

Log:
  Use memset/memcpy instead of bzero/bcopy.
  
  Just use one variant instead of both. Use the memset/memcpy
  ones since they cause less problems in crossplatform deployment.
  
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_asconf.c
  head/sys/netinet/sctp_auth.c
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet/sctputil.c
  head/sys/netinet6/sctp6_usrreq.c

Modified: head/sys/netinet/sctp_asconf.c
==
--- head/sys/netinet/sctp_asconf.c  Wed Jul 19 14:21:29 2017
(r321203)
+++ head/sys/netinet/sctp_asconf.c  Wed Jul 19 14:28:58 2017
(r321204)
@@ -182,7 +182,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc
}
v4addr = (struct sctp_ipv4addr_param *)ph;
sin = 
-   bzero(sin, sizeof(*sin));
+   memset(sin, 0, sizeof(*sin));
sin->sin_family = AF_INET;
sin->sin_len = sizeof(struct sockaddr_in);
sin->sin_port = stcb->rport;
@@ -205,7 +205,7 @@ sctp_process_asconf_add_ip(struct sockaddr *src, struc
}
v6addr = (struct sctp_ipv6addr_param *)ph;
sin6 = 
-   bzero(sin6, sizeof(*sin6));
+   memset(sin6, 0, sizeof(*sin6));
sin6->sin6_family = AF_INET6;
sin6->sin6_len = sizeof(struct sockaddr_in6);
sin6->sin6_port = stcb->rport;
@@ -332,7 +332,7 @@ sctp_process_asconf_delete_ip(struct sockaddr *src,
}
v4addr = (struct sctp_ipv4addr_param *)ph;
sin = 
-   bzero(sin, sizeof(*sin));
+   memset(sin, 0, sizeof(*sin));
sin->sin_family = AF_INET;
sin->sin_len = sizeof(struct sockaddr_in);
sin->sin_port = stcb->rport;
@@ -352,7 +352,7 @@ sctp_process_asconf_delete_ip(struct sockaddr *src,
}
v6addr = (struct sctp_ipv6addr_param *)ph;
sin6 = 
-   bzero(sin6, sizeof(*sin6));
+   memset(sin6, 0, sizeof(*sin6));
sin6->sin6_family = AF_INET6;
sin6->sin6_len = sizeof(struct sockaddr_in6);
sin6->sin6_port = stcb->rport;
@@ -461,7 +461,7 @@ sctp_process_asconf_set_primary(struct sockaddr *src,
}
v4addr = (struct sctp_ipv4addr_param *)ph;
sin = 
-   bzero(sin, sizeof(*sin));
+   memset(sin, 0, sizeof(*sin));
sin->sin_family = AF_INET;
sin->sin_len = sizeof(struct sockaddr_in);
sin->sin_addr.s_addr = v4addr->addr;
@@ -479,7 +479,7 @@ sctp_process_asconf_set_primary(struct sockaddr *src,
}
v6addr = (struct sctp_ipv6addr_param *)ph;
sin6 = 
-   bzero(sin6, sizeof(*sin6));
+   memset(sin6, 0, sizeof(*sin6));
sin6->sin6_family = AF_INET6;
sin6->sin6_len = sizeof(struct sockaddr_in6);
memcpy((caddr_t)>sin6_addr, v6addr->addr,
@@ -2604,7 +2604,7 @@ sctp_compose_asconf(struct sctp_tcb *stcb, int *retlen
SCTP_BUF_LEN(m_asconf_chk) = sizeof(struct sctp_asconf_chunk);
SCTP_BUF_LEN(m_asconf) = 0;
acp = mtod(m_asconf_chk, struct sctp_asconf_chunk *);
-   bzero(acp, sizeof(struct sctp_asconf_chunk));
+   memset(acp, 0, sizeof(struct sctp_asconf_chunk));
/* save pointers to lookup address and asconf params */
lookup_ptr = (caddr_t)(acp + 1);/* after the header */
ptr = mtod(m_asconf, caddr_t);  /* beginning of cluster */
@@ -2737,7 +2737,7 @@ sctp_compose_asconf(struct sctp_tcb *stcb, int *retlen
/* XXX for now, we send a IPv4 address of 0.0.0.0 */
lookup->ph.param_type = htons(SCTP_IPV4_ADDRESS);
lookup->ph.param_length = 
htons(SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param)));
-   bzero(lookup->addr, sizeof(struct in_addr));
+   memset(lookup->addr, 0, sizeof(struct in_addr));
SCTP_BUF_LEN(m_asconf_chk) += SCTP_SIZE32(sizeof(struct 
sctp_ipv4addr_param));
}
}

Modified: head/sys/netinet/sctp_auth.c
==
--- head/sys/netinet/sctp_auth.cWed Jul 19 14:21:29 2017
(r321203)
+++ head/sys/netinet/sctp_auth.cWed Jul 19 14:28:58 2017
(r321204)
@@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$");
 void
 sctp_clear_chunklist(sctp_auth_chklist_t *chklist)
 {
-   bzero(chklist, sizeof(*chklist));
+   memset(chklist, 0, 

svn commit: r321203 - head/sys/dev/bxe

2017-07-19 Thread Andrey V. Elsukov
Author: ae
Date: Wed Jul 19 14:21:29 2017
New Revision: 321203
URL: https://svnweb.freebsd.org/changeset/base/321203

Log:
  Add HPE FlexFabric 10Gb 4-port 536FLR-T device id to the bxe(4) driver.
  
  Tested by:David Miguel Almas 
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D11478

Modified:
  head/sys/dev/bxe/bxe.c
  head/sys/dev/bxe/bxe.h

Modified: head/sys/dev/bxe/bxe.c
==
--- head/sys/dev/bxe/bxe.c  Wed Jul 19 14:15:49 2017(r321202)
+++ head/sys/dev/bxe/bxe.c  Wed Jul 19 14:21:29 2017(r321203)
@@ -167,6 +167,12 @@ static struct bxe_device_type bxe_devs[] = {
 "QLogic NetXtreme II BCM57840 4x10GbE"
 },
 {
+QLOGIC_VENDORID,
+CHIP_NUM_57840_4_10,
+PCI_ANY_ID, PCI_ANY_ID,
+"QLogic NetXtreme II BCM57840 4x10GbE"
+},
+{
 BRCM_VENDORID,
 CHIP_NUM_57840_2_20,
 PCI_ANY_ID, PCI_ANY_ID,

Modified: head/sys/dev/bxe/bxe.h
==
--- head/sys/dev/bxe/bxe.h  Wed Jul 19 14:15:49 2017(r321202)
+++ head/sys/dev/bxe/bxe.h  Wed Jul 19 14:21:29 2017(r321203)
@@ -168,6 +168,7 @@ int bxe_ilog2(int x)
 #include "ecore_sp.h"
 
 #define BRCM_VENDORID 0x14e4
+#defineQLOGIC_VENDORID 0x1077
 #define PCI_ANY_ID(uint16_t)(~0U)
 
 struct bxe_device_type
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321201 - head/lib/libutil/tests

2017-07-19 Thread Ed Maste
Author: emaste
Date: Wed Jul 19 14:07:38 2017
New Revision: 321201
URL: https://svnweb.freebsd.org/changeset/base/321201

Log:
  enable pidfile tests on arm64
  
  Pidfile tests were disabled on arm64 (in r286863) because they hung.
  They have been fixed (r306098) and so can be enabled now.
  
  PR:   202304
  Sponsored by: The FreeBSD Foundation

Modified:
  head/lib/libutil/tests/Makefile

Modified: head/lib/libutil/tests/Makefile
==
--- head/lib/libutil/tests/Makefile Wed Jul 19 13:32:08 2017
(r321200)
+++ head/lib/libutil/tests/Makefile Wed Jul 19 14:07:38 2017
(r321201)
@@ -3,9 +3,7 @@
 TAP_TESTS_C+=  flopen_test
 TAP_TESTS_C+=  grp_test
 TAP_TESTS_C+=  humanize_number_test
-.if ${MACHINE_CPUARCH} != "aarch64" # PR202304: pidfile_test hangs on arm64
 TAP_TESTS_C+=  pidfile_test
-.endif
 TAP_TESTS_C+=  trimdomain_test
 TAP_TESTS_C+=  trimdomain-nodomain_test
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r321197 - head/sys/netinet

2017-07-19 Thread Michael Tuexen
Author: tuexen
Date: Wed Jul 19 12:27:40 2017
New Revision: 321197
URL: https://svnweb.freebsd.org/changeset/base/321197

Log:
  Fix the accounting and add code to detect errors in accounting.
  Joint work with rrs@
  MFC after:1 week

Modified:
  head/sys/netinet/sctp_auth.c
  head/sys/netinet/sctp_indata.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctp_auth.c
==
--- head/sys/netinet/sctp_auth.cWed Jul 19 09:59:32 2017
(r321196)
+++ head/sys/netinet/sctp_auth.cWed Jul 19 12:27:40 2017
(r321197)
@@ -1797,8 +1797,8 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint
sctp_m_freem(m_notify);
return;
}
-   control->spec_flags = M_NOTIFICATION;
control->length = SCTP_BUF_LEN(m_notify);
+   control->spec_flags = M_NOTIFICATION;
/* not that we need this */
control->tail_mbuf = m_notify;
sctp_add_to_readq(stcb->sctp_ep, stcb, control,

Modified: head/sys/netinet/sctp_indata.c
==
--- head/sys/netinet/sctp_indata.c  Wed Jul 19 09:59:32 2017
(r321196)
+++ head/sys/netinet/sctp_indata.c  Wed Jul 19 12:27:40 2017
(r321197)
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
  * This will cause sctp_service_queues() to get called on the top entry in
  * the list.
  */
-static void
+static uint32_t
 sctp_add_chk_to_control(struct sctp_queued_to_read *control,
 struct sctp_stream_in *strm,
 struct sctp_tcb *stcb,
@@ -92,6 +92,8 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_asso
asoc->size_on_reasm_queue == 0 &&
asoc->size_on_all_streams == 0) {
/* Full rwnd granted */
+   KASSERT(asoc->cnt_on_reasm_queue == 0, ("cnt_on_reasm_queue is 
%u", asoc->cnt_on_reasm_queue));
+   KASSERT(asoc->cnt_on_all_streams == 0, ("cnt_on_all_streams is 
%u", asoc->cnt_on_all_streams));
calc = max(SCTP_SB_LIMIT_RCV(stcb->sctp_socket), 
SCTP_MINIMAL_RWND);
return (calc);
}
@@ -558,7 +560,15 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb,
}
/* EY it wont be queued if it could be delivered directly */
queue_needed = 0;
-   asoc->size_on_all_streams -= control->length;
+   if (asoc->size_on_all_streams >= control->length) {
+   asoc->size_on_all_streams -= control->length;
+   } else {
+#ifdef INVARIANTS
+   panic("size_on_all_streams = %u smaller than control 
length %u", asoc->size_on_all_streams, control->length);
+#else
+   asoc->size_on_all_streams = 0;
+#endif
+   }
sctp_ucount_decr(asoc->cnt_on_all_streams);
strm->last_mid_delivered++;
sctp_mark_non_revokable(asoc, control->sinfo_tsn);
@@ -571,11 +581,19 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb,
nxt_todel = strm->last_mid_delivered + 1;
if (SCTP_MID_EQ(asoc->idata_supported, nxt_todel, 
control->mid) &&
(((control->sinfo_flags >> 8) & SCTP_DATA_NOT_FRAG) 
== SCTP_DATA_NOT_FRAG)) {
-   asoc->size_on_all_streams -= control->length;
-   sctp_ucount_decr(asoc->cnt_on_all_streams);
if (control->on_strm_q == SCTP_ON_ORDERED) {
TAILQ_REMOVE(>inqueue, control, 
next_instrm);
+   if (asoc->size_on_all_streams >= 
control->length) {
+   asoc->size_on_all_streams -= 
control->length;
+   } else {
 #ifdef INVARIANTS
+   panic("size_on_all_streams = %u 
smaller than control length %u", asoc->size_on_all_streams, control->length);
+#else
+   asoc->size_on_all_streams = 0;
+#endif
+   }
+   
sctp_ucount_decr(asoc->cnt_on_all_streams);
+#ifdef INVARIANTS
} else {
panic("Huh control: %p is on_strm_q: 
%d",
control, control->on_strm_q);
@@ -671,7 +689,7 @@ sctp_setup_tail_pointer(struct sctp_queued_to_read *co
 }
 
 static void
-sctp_add_to_tail_pointer(struct sctp_queued_to_read *control, struct mbuf *m)
+sctp_add_to_tail_pointer(struct sctp_queued_to_read *control, struct mbuf *m, 
uint32_t *added)
 {
struct mbuf *prev = NULL;
struct sctp_tcb *stcb;
@@ -715,6 +733,7 @@ sctp_add_to_tail_pointer(struct sctp_queued_to_read *c
 

Re: svn commit: r320901 - in head/sys: amd64/amd64 isa x86/isa

2017-07-19 Thread Bruce Evans

On Tue, 18 Jul 2017, Ian Lepore wrote:


On Tue, 2017-07-18 at 18:08 +1000, Bruce Evans wrote:



[lots of stuff about locking and accurate time-setting]

Good idea.

My inittodr() waits for the seconds register to change.? This
increases
boot time by an average of 0.5 seconds, but is needed to get a result
that is not out of date by an average of 0.5 seconds.? After the
seconds
register changes, the window for reading the other registers is
almost
1 second, but the reads must complete in a few microseconds anyway
else
the result is still too out of date.? Debugging printf()s show that
the reads usually complete in 10-50 usec with low latency (faster on
old systems with faster ISA buses).



I was considering adding a tunable to do that for people who don't mind
the extra time to boot/wakeup.??It's interesting that you label an
error of a few microseconds as "too out of date", I was thinking that
reducing the average error from .5s to .005s was good enough.

The .005s number comes from an idea of using a callout that begins as
soon as interrupts are available that checks for rtc rollover every
10ms, with the hopes that it can catch the rollover between the time
callouts start working and rootfs mount time when inittodr() gets
called.??If it can catch the rollover happening in that window, it can
latch the monotonic clock and then use that at inittodr() time to
calculate the fractional part of the time.??Even if it doesn't catch
the rollover in that time, it at least has a measurement that sets a
floor value for the fractional part, reducing the error to something
less than .5s.


Hmm, my rtcintr() already does essentially that without really trying.
It is designed to fix up the time after "suspension" in ddb breaks the
time by stopping timecounter updates.  The fixed up time is:

   (the rtc time) +
   (the last known good difference between the timecounter time and the
 rtc time) +
   (an adjustment for the drift rate)

My rtcintr() samples the difference and calibrates the drift every 64
seconds.  It uses rtc update interrupts every second to get precise
timing for the sampling and to avoid having to wait for updates to
complete before sampling.

Initially, the offset and drift are unknown, but using 0 for them would
give similar functionality to inittodr().


I have no idea yet how much time elapses between interrupts coming
online and the first inittodr() call on a typical modern x86
system.??For all my arm systems with nfsroot it's several seconds. ?If
it averages a few milliseconds on x86 systems, it isn't useful enough
to justify the extra work. ?If it's typically half a second or more it
probably is worth it.


My fastest x86 system takes 6 seconds to boot from boot2 (no loader) to
mounting root.  Surprisingly, inittodr() runs even later than mountroot
(at least on an old system).  That must be for the old feature of
defaulting the time to a timestamp on the (ffs) root partition.  Normally
that is not used, but if inittodr() ran earlier than it would have to
run again if it couldn't find a hardware rtc.  Interrupt handling starts
working much earlier than that, but I wouldn't trust all time features
to be initialized on the first call to rtcintr().

However, it is unimportant to set the time very early in the boot.  This
just makes CLOCK_REALTIME timestamps valid earlier.

The time should be fixed up similarly after real suspensions.  Then it
is even less clear what the reinitialization order actually is.


Accuracy for reading is not very important because accuracy for
writing
is very low (1-2 seconds).? My resettodr() only writes if the
difference
is more than 2 seconds.



The gross inaccuracy when writing is fixable now. ?I'm not worried
about the microsecond inaccuracies of accessing the hardware, what I
want to fix is the fact that clock_settime() may get called at x.995
and will record the time as x.0.


Very old old versions seemed to have complications related to the
hardware.  Something to do with half-second boundaries, because the
hardware is "smart" about this 0.995 error and schedules the next
update to 0.5 seconds after writing to the seconds register (this
reduces the average error to 0.5 seconds for sloppy settings)?
I can't find these in the 2004 version.


Because settime is now called from a task thread, any clock driver is
free to sleep as needed to set the clock hardware in a way that aligns
its second rollover with kernel time. ?Not efficient, but easy to do.


The syscall was always free to sleep, and it is a bug for it return before
setting the time.  Except, the syscall never claimed to even have hardware
to write to.  If there were an RTC driver, then it should support both sync
and async settings.


Even better, most rtc hardware has unused storage. ?Sometimes in the
form of battery-backed ram, sometimes in the form of things like alarm
registers that aren't used for anything and a driver can tuck away
values in them for its own use. ?If clock_settime() stores the

svn commit: r321196 - in head/sys/fs: nfs nfsserver

2017-07-19 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jul 19 09:59:32 2017
New Revision: 321196
URL: https://svnweb.freebsd.org/changeset/base/321196

Log:
  Rename vfs.nfsd.enable_uidtostring to vfs.nfs.enable_uidtostring.
  It applies to both NFS client and NFS server, and is useful for both.
  This is different from vfs.nfsd.enable_stringtouid, which is specific
  to server side.
  
  Reviewed by:  rmacklem@
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==
--- head/sys/fs/nfs/nfs_commonsubs.cWed Jul 19 07:03:16 2017
(r321195)
+++ head/sys/fs/nfs/nfs_commonsubs.cWed Jul 19 09:59:32 2017
(r321196)
@@ -68,11 +68,15 @@ gid_t nfsrv_defaultgid = GID_NOGROUP;
 int nfsrv_lease = NFSRV_LEASE;
 int ncl_mbuf_mlen = MLEN;
 int nfsd_enable_stringtouid = 0;
-int nfsd_enable_uidtostring = 0;
+static int nfs_enable_uidtostring = 0;
 NFSNAMEIDMUTEX;
 NFSSOCKMUTEX;
 extern int nfsrv_lughashsize;
 
+SYSCTL_DECL(_vfs_nfs);
+SYSCTL_INT(_vfs_nfs, OID_AUTO, enable_uidtostring, CTLFLAG_RW,
+_enable_uidtostring, 0, "Make nfs always send numeric owner_names");
+
 /*
  * This array of structures indicates, for V4:
  * retfh - which of 3 types of calling args are used
@@ -2562,7 +2566,7 @@ nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp, 
 
cnt = 0;
 tryagain:
-   if (nfsrv_dnsnamelen > 0 && !nfsd_enable_uidtostring) {
+   if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) {
/*
 * Always map nfsrv_defaultuid to "nobody".
 */
@@ -2824,7 +2828,7 @@ nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp, 
 
cnt = 0;
 tryagain:
-   if (nfsrv_dnsnamelen > 0 && !nfsd_enable_uidtostring) {
+   if (nfsrv_dnsnamelen > 0 && !nfs_enable_uidtostring) {
/*
 * Always map nfsrv_defaultgid to "nogroup".
 */

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cWed Jul 19 07:03:16 2017
(r321195)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cWed Jul 19 09:59:32 2017
(r321196)
@@ -87,7 +87,6 @@ static int nfs_commit_miss;
 extern int nfsrv_issuedelegs;
 extern int nfsrv_dolocallocks;
 extern int nfsd_enable_stringtouid;
-extern int nfsd_enable_uidtostring;
 
 SYSCTL_NODE(_vfs, OID_AUTO, nfsd, CTLFLAG_RW, 0, "NFS server");
 SYSCTL_INT(_vfs_nfsd, OID_AUTO, mirrormnt, CTLFLAG_RW,
@@ -104,8 +103,6 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, debuglevel, CTLFLAG_RW
 0, "Debug level for NFS server");
 SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_stringtouid, CTLFLAG_RW,
 _enable_stringtouid, 0, "Enable nfsd to accept numeric owner_names");
-SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_uidtostring, CTLFLAG_RW,
-_enable_uidtostring, 0, "Make nfsd always send numeric owner_names");
 
 #defineMAX_REORDERED_RPC   16
 #defineNUM_HEURISTIC   1031
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"