svn commit: r321844 - head/sys/boot/zfs

2017-07-31 Thread Ngie Cooper
Author: ngie
Date: Tue Aug  1 05:16:14 2017
New Revision: 321844
URL: https://svnweb.freebsd.org/changeset/base/321844

Log:
  Clean up style in print_state(..) and pager_printf(..)
  
  No functional change intended.
  
  MFC after:3 days

Modified:
  head/sys/boot/zfs/zfsimpl.c

Modified: head/sys/boot/zfs/zfsimpl.c
==
--- head/sys/boot/zfs/zfsimpl.c Tue Aug  1 04:52:03 2017(r321843)
+++ head/sys/boot/zfs/zfsimpl.c Tue Aug  1 05:16:14 2017(r321844)
@@ -794,6 +794,7 @@ pager_printf(const char *fmt, ...)
va_start(args, fmt);
vsprintf(line, fmt, args);
va_end(args);
+
return (pager_output(line));
 }
 
@@ -804,15 +805,15 @@ pager_printf(const char *fmt, ...)
 static int
 print_state(int indent, const char *name, vdev_state_t state)
 {
-   int i;
char buf[512];
+   int i;
 
buf[0] = 0;
for (i = 0; i < indent; i++)
strcat(buf, "  ");
strcat(buf, name);
+
return (pager_printf(STATUS_FORMAT, buf, state_name(state)));
-   
 }
 
 static int
___
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: r321843 - head/cddl/contrib/opensolaris/cmd/lockstat

2017-07-31 Thread Mark Johnston
Author: markj
Date: Tue Aug  1 04:52:03 2017
New Revision: 321843
URL: https://svnweb.freebsd.org/changeset/base/321843

Log:
  Remove local variables missed in r321842.
  
  X-MFC with:   r321842

Modified:
  head/cddl/contrib/opensolaris/cmd/lockstat/sym.c

Modified: head/cddl/contrib/opensolaris/cmd/lockstat/sym.c
==
--- head/cddl/contrib/opensolaris/cmd/lockstat/sym.cTue Aug  1 04:49:54 
2017(r321842)
+++ head/cddl/contrib/opensolaris/cmd/lockstat/sym.cTue Aug  1 04:52:03 
2017(r321843)
@@ -175,10 +175,6 @@ symtab_init(void)
int fd;
int i;
int strindex = -1;
-#ifndef illumos
-   void*ksyms;
-   size_t  sz;
-#endif
 
 #ifndef illumos
if ((fd = open("/dev/ksyms", O_RDONLY)) == -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"


Re: svn commit: r321840 - in head/sys: kern sys

2017-07-31 Thread Alan Cox
On 07/31/2017 23:20, Warner Losh wrote:
>
> On July 31, 2017, at 9:51 PM, Alan Cox  wrote:
>
> >Author: alc
> >Date: Tue Aug  1 03:51:26 2017
> >New Revision: 321840
> >URL: https://svnweb.freebsd.org/changeset/base/321840
> >Log:
> >  The blist_meta_* routines that process a subtree take arguments
> 'radix' and
> >  'skip', which denote, respectively, the largest number of blocks
> that can be
> >  managed by a subtree of that height, and one less than the number
> of nodes
> >  in a subtree of that height.  This change removes the 'skip'
> argument from
> >  those functions because 'skip' can be trivially computed from 'radius'.
> >  This change also redefines 'skip' so that it denotes the number of
> nodes in
> >  the subtree, and so changes loop upper bound tests from '<= skip' to '<
> >  skip' to account for the change.
> > 
> >  The 'skip' field is also removed from the blist struct.
> > 
> >  The self-test program is changed so that the print command includes the
> >  cursor value in the output.
> > 
> >  Submitted by: Doug Moore 
> >  MFC after: 1 week
> >Modified:
> >  head/sys/kern/subr_blist.c
> >  head/sys/sys/blist.h
> >Modified: head/sys/kern/subr_blist.c
> >==
> >--- head/sys/kern/subr_blist.c Tue Aug  1 03:40:19 2017 (r321839)
> >+++ head/sys/kern/subr_blist.c Tue Aug  1 03:51:26 2017 (r321840)
> >@@ -123,20 +123,19 @@ void panic(const char *ctl, ...);
> >static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count,
> >daddr_t cursor);
> >static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t
> count,
> >- daddr_t radix, daddr_t skip, daddr_t cursor);
> >+ daddr_t radix, daddr_t cursor);
> >static void blst_leaf_free(blmeta_t *scan, daddr_t relblk, int count);
> >static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t
> count,
> >- daddr_t radix, daddr_t skip, daddr_t blk);
> >+ daddr_t radix, daddr_t blk);
> >static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix,
> >- daddr_t skip, blist_t dest, daddr_t count);
> >+ blist_t dest, daddr_t count);
> >static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count);
> >static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk,
> daddr_t count,
> >- daddr_t radix, daddr_t skip, daddr_t blk);
> >-static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix,
> daddr_t skip,
> >- daddr_t count);
> >+ daddr_t radix, daddr_t blk);
> >+static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix,
> daddr_t count);
> >#ifndef _KERNEL
> >static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix,
> >- daddr_t skip, int tab);
> >+ int tab);
> >#endif
> >#ifdef _KERNEL
> >@@ -144,6 +143,28 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space");
> >#endif
> >/*
> >+ * For a subtree that can represent the state of up to 'radix'
> blocks, the
> >+ * number of leaf nodes of the subtree is L=radix/BLIST_BMAP_RADIX. 
> If 'm'
> >+ * is short for BLIST_META_RADIX, then for a tree of height h with
> L=m**h
> >+ * leaf nodes, the total number of tree nodes is 1 + m + m**2 + ...
> + m**h,
> >+ * or, equivalently, (m**(h+1)-1)/(m-1).  This quantity is called 'skip'
> >+ * in the 'meta' functions that process subtrees.  Since integer
> division
> >+ * discards remainders, we can express this computation as
> >+ * skip = (m * m**h) / (m - 1)
> >+ * skip = (m * radix / BLIST_BMAP_RADIX) / (m - 1)
> >+ * and if m divides BLIST_BMAP_RADIX, we can simplify further to
> >+ * skip = radix / (BLIST_BMAP_RADIX / m * (m - 1))
> >+ * so that a simple integer division is enough for the calculation.
> >+ */
> >+static inline daddr_t
> >+radix_to_skip(daddr_t radix)
> >+{
> >+
> >+ return (radix /
> >+ (BLIST_BMAP_RADIX / BLIST_META_RADIX * (BLIST_META_RADIX - 1)));
>
> I don't think this matches the comment. It is missing parens,no?
>
>

Substitute BLIST_META_RADIX for 'm' in the comment and they match.  (The
second line of the comment defines 'm' to be
BLIST_META_RADIX.)

> >+}
> >+
> >+/*
> >  * blist_create() - create a blist capable of handling up to the
> specified
> >  * number of blocks
> >  *
> >@@ -157,18 +178,16 @@ blist_t
> >blist_create(daddr_t blocks, int flags)
> >{
> >blist_t bl;
> >- daddr_t nodes, radix, skip;
> >+ daddr_t nodes, radix;
> >/*
> >- * Calculate radix and skip field used for scanning.
> >+ * Calculate the radix field used for scanning.
> >*/
> >radix = BLIST_BMAP_RADIX;
> >- skip = 0;
> >while (radix < blocks) {
> >radix *= BLIST_META_RADIX;
> >- skip = (skip + 1) * BLIST_META_RADIX;
> >}
> >- nodes = 1 + blst_radix_init(NULL, radix, skip, blocks);
> >+ nodes = 1 + blst_radix_init(NULL, radix, blocks);
> >bl = malloc(sizeof(struct blist), M_SWAP, flags);
> >if (bl == NULL)
> >@@ -176,14 +195,13 @@ blist_create(daddr_t blocks, int flags)
> >bl->bl_blocks = blocks;
> >bl->bl_radix = radix;
> >- bl->bl_skip = skip;
> 

svn commit: r321842 - head/cddl/contrib/opensolaris/cmd/lockstat

2017-07-31 Thread Mark Johnston
Author: markj
Date: Tue Aug  1 04:49:54 2017
New Revision: 321842
URL: https://svnweb.freebsd.org/changeset/base/321842

Log:
  Let lockstat use ksyms(4)'s mmap interface.
  
  The workaround described in the deleted comment is no longer needed.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/cmd/lockstat/sym.c

Modified: head/cddl/contrib/opensolaris/cmd/lockstat/sym.c
==
--- head/cddl/contrib/opensolaris/cmd/lockstat/sym.cTue Aug  1 04:16:52 
2017(r321841)
+++ head/cddl/contrib/opensolaris/cmd/lockstat/sym.cTue Aug  1 04:49:54 
2017(r321842)
@@ -194,33 +194,9 @@ symtab_init(void)
return (-1);
 #endif
 
-#ifdef illumos
(void) elf_version(EV_CURRENT);
 
elf = elf_begin(fd, ELF_C_READ, NULL);
-#else
-   /* 
-* XXX - libelf needs to be fixed so it will work with
-* non 'ordinary' files like /dev/ksyms.  The following
-* is a work around for now.
-*/ 
-   if (elf_version(EV_CURRENT) == EV_NONE) {
-   close(fd);
-   return (-1);
-   }
-   if (ioctl(fd, KIOCGSIZE, ) < 0) {
-   close(fd);
-   return (-1);
-   }
-   if (ioctl(fd, KIOCGADDR, ) < 0) {
-   close(fd);
-   return (-1);
-   }
-   if ((elf = elf_memory(ksyms, sz)) == NULL) {
-   close(fd);
-   return (-1);
-   }
-#endif 
 
for (cnt = 1; (scn = elf_nextscn(elf, scn)) != NULL; cnt++) {
Shdr *shdr = elf_getshdr(scn);
___
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"


Re: svn commit: r321840 - in head/sys: kern sys

2017-07-31 Thread Warner Losh


On July 31, 2017, at 9:51 PM, Alan Cox  wrote:

>Author: alc
>Date: Tue Aug  1 03:51:26 2017
>New Revision: 321840
>URL: https://svnweb.freebsd.org/changeset/base/321840
>Log:
>  The blist_meta_* routines that process a subtree take arguments 'radix' and
>  'skip', which denote, respectively, the largest number of blocks that can be
>  managed by a subtree of that height, and one less than the number of nodes
>  in a subtree of that height.  This change removes the 'skip' argument from
>  those functions because 'skip' can be trivially computed from 'radius'.
>  This change also redefines 'skip' so that it denotes the number of nodes in
>  the subtree, and so changes loop upper bound tests from '<= skip' to '<
>  skip' to account for the change.
>  
>  The 'skip' field is also removed from the blist struct.
>  
>  The self-test program is changed so that the print command includes the
>  cursor value in the output.
>  
>  Submitted by: Doug Moore 
>  MFC after: 1 week
>Modified:
>  head/sys/kern/subr_blist.c
>  head/sys/sys/blist.h
>Modified: head/sys/kern/subr_blist.c
>==
>--- head/sys/kern/subr_blist.c Tue Aug  1 03:40:19 2017 (r321839)
>+++ head/sys/kern/subr_blist.c Tue Aug  1 03:51:26 2017 (r321840)
>@@ -123,20 +123,19 @@ void panic(const char *ctl, ...);
>static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count,
>    daddr_t cursor);
>static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t count,
>-     daddr_t radix, daddr_t skip, daddr_t cursor);
>+     daddr_t radix, daddr_t cursor);
>static void blst_leaf_free(blmeta_t *scan, daddr_t relblk, int count);
>static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count,
>-     daddr_t radix, daddr_t skip, daddr_t blk);
>+     daddr_t radix, daddr_t blk);
>static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix,
>-     daddr_t skip, blist_t dest, daddr_t count);
>+     blist_t dest, daddr_t count);
>static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count);
>static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count,
>-     daddr_t radix, daddr_t skip, daddr_t blk);
>-static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t skip,
>-     daddr_t count);
>+     daddr_t radix, daddr_t blk);
>+static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count);
>#ifndef _KERNEL
>static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix,
>-     daddr_t skip, int tab);
>+     int tab);
>#endif
>#ifdef _KERNEL
>@@ -144,6 +143,28 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space");
>#endif
>/*
>+ * For a subtree that can represent the state of up to 'radix' blocks, the
>+ * number of leaf nodes of the subtree is L=radix/BLIST_BMAP_RADIX.  If 'm'
>+ * is short for BLIST_META_RADIX, then for a tree of height h with L=m**h
>+ * leaf nodes, the total number of tree nodes is 1 + m + m**2 + ... + m**h,
>+ * or, equivalently, (m**(h+1)-1)/(m-1).  This quantity is called 'skip'
>+ * in the 'meta' functions that process subtrees.  Since integer division
>+ * discards remainders, we can express this computation as
>+ * skip = (m * m**h) / (m - 1)
>+ * skip = (m * radix / BLIST_BMAP_RADIX) / (m - 1)
>+ * and if m divides BLIST_BMAP_RADIX, we can simplify further to
>+ * skip = radix / (BLIST_BMAP_RADIX / m * (m - 1))
>+ * so that a simple integer division is enough for the calculation.
>+ */
>+static inline daddr_t
>+radix_to_skip(daddr_t radix)
>+{
>+
>+ return (radix /
>+     (BLIST_BMAP_RADIX / BLIST_META_RADIX * (BLIST_META_RADIX - 1)));

I don't think this matches the comment. It is missing parens, no?

Warner
>+}
>+
>+/*
>  * blist_create() - create a blist capable of handling up to the specified
>  *     number of blocks
>  *
>@@ -157,18 +178,16 @@ blist_t
>blist_create(daddr_t blocks, int flags)
>{
>blist_t bl;
>- daddr_t nodes, radix, skip;
>+ daddr_t nodes, radix;
>/*
>- * Calculate radix and skip field used for scanning.
>+ * Calculate the radix field used for scanning.
>*/
>radix = BLIST_BMAP_RADIX;
>- skip = 0;
>while (radix < blocks) {
>radix *= BLIST_META_RADIX;
>- skip = (skip + 1) * BLIST_META_RADIX;
>}
>- nodes = 1 + blst_radix_init(NULL, radix, skip, blocks);
>+ nodes = 1 + blst_radix_init(NULL, radix, blocks);
>bl = malloc(sizeof(struct blist), M_SWAP, flags);
>if (bl == NULL)
>@@ -176,14 +195,13 @@ blist_create(daddr_t blocks, int flags)
>bl->bl_blocks = blocks;
>bl->bl_radix = radix;
>- bl->bl_skip = skip;
>bl->bl_cursor = 0;
>bl->bl_root = malloc(nodes * sizeof(blmeta_t), M_SWAP, flags);
>if (bl->bl_root == NULL) {
>free(bl, M_SWAP);
>return (NULL);
>}
>- blst_radix_init(bl->bl_root, radix, skip, blocks);
>+ blst_radix_init(bl->bl_root, radix, blocks);
>#if defined(BLIST_DEBUG)
>printf(
>@@ -225,7 +243,7 @@ blist_alloc(blist_t bl, daddr_t count)
>*/
>while (count <= bl->bl_root->bm_bighint) {
>blk = 

svn commit: r321841 - in head/sys: conf dev/iicbus modules/i2c modules/i2c/isl12xx

2017-07-31 Thread Ian Lepore
Author: ian
Date: Tue Aug  1 04:16:52 2017
New Revision: 321841
URL: https://svnweb.freebsd.org/changeset/base/321841

Log:
  Add a driver for the Intersil ISL12xx family of i2c RTC chips.
  
  Supports ISL1209, ISL1218, ISL1219, ISL1220, ISL1221 (just basic RTC
  functionality, not all the other fancy stuff the chips can do).

Added:
  head/sys/dev/iicbus/isl12xx.c   (contents, props changed)
  head/sys/modules/i2c/isl12xx/
  head/sys/modules/i2c/isl12xx/Makefile   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/modules/i2c/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Aug  1 03:51:26 2017(r321840)
+++ head/sys/conf/files Tue Aug  1 04:16:52 2017(r321841)
@@ -1736,6 +1736,7 @@ dev/iicbus/iiconf.c   optional iicbus
 dev/iicbus/iicsmb.coptional iicsmb \
dependency  "iicbus_if.h"
 dev/iicbus/iicoc.c optional iicoc
+dev/iicbus/isl12xx.c   optional isl12xx
 dev/iicbus/lm75.c  optional lm75
 dev/iicbus/nxprtc.coptional nxprtc | pcf8563
 dev/iicbus/ofw_iicbus.coptional fdt iicbus

Added: head/sys/dev/iicbus/isl12xx.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/iicbus/isl12xx.c   Tue Aug  1 04:16:52 2017
(r321841)
@@ -0,0 +1,354 @@
+/*-
+ * Copyright (c) 2017 Ian Lepore.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR 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$");
+
+/*
+ * Driver for ISL12xx family i2c realtime clocks:
+ *  - ISL1209 = 2B sram, tamper/event timestamp
+ *  - ISL1218 = 8B sram, DS13xx pin compatible (but not software compatible)
+ *  - ISL1219 = 2B sram, tamper/event timestamp
+ *  - ISL1220 = 8B sram, separate Fout
+ *  - ISL1221 = 2B sram, separate Fout, tamper/event timestamp
+ *
+ * This driver supports only the basic RTC functionality in all these chips.
+ */
+
+#include "opt_platform.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef FDT
+#include 
+#include 
+#endif
+
+#include 
+#include 
+
+#include "clock_if.h"
+#include "iicbus_if.h"
+
+/*
+ * All register and bit names as found in the datasheet.  When a bit name ends
+ * in 'B' that stands for "bar" and it is an active-low signal; something named
+ * "EVENB" implies 1=event-disable, 0=event-enable.
+ */
+
+#defineISL12XX_SC_REG  0x00/* RTC Seconds */
+
+#defineISL12XX_SR_REG  0x07/* Status */
+#define  ISL12XX_SR_ARST (1u << 7) /*   Auto-reset on 
status read */
+#define  ISL12XX_SR_XTOSCB   (1u << 5) /*   Osc disable (use 
ext osc) */
+#define  ISL12XX_SR_WRTC (1u << 4) /*   Write RTC enable */
+#define  ISL12XX_SR_EVT  (1u << 3) /*   Event occurred 
(w0c) */
+#define  ISL12XX_SR_ALM  (1u << 2) /*   Alarm occurred 
(w0c) */
+#define  ISL12XX_SR_BAT  (1u << 1) /*   Running on battery 
(w0c) */
+#define  ISL12XX_SR_RTCF (1u << 0) /*   RTC fail (power 
loss) */
+#define  ISL12XX_SR_W0C_BITS (ISL12XX_SR_BAT | ISL12XX_SR_ALM | 
ISL12XX_SR_EVT)
+
+#defineISL12XX_INT_REG 0x08/* Interrupts */
+#define  ISL12XX_INT_IM  (1u << 7) /*   Alarm interrupt 
mode */
+#define  ISL12XX_INT_ALME(1u << 6) /*   Alarm enable */
+#define  ISL12XX_INT_LPMODE  (1u << 5) /*   Low Power mode */
+#define  ISL12XX_INT_FOBATB

Re: svn commit: r321839 - in head: share/man/man4 share/man/man5 sys/fs/fdescfs sys/kern sys/sys

2017-07-31 Thread Chagin Dmitry
On Tue, Aug 01, 2017 at 03:40:19AM +, Dmitry Chagin wrote:
> Author: dchagin
> Date: Tue Aug  1 03:40:19 2017
> New Revision: 321839
> URL: https://svnweb.freebsd.org/changeset/base/321839
> 
> Log:
>   Implement proper Linux /dev/fd and /proc/self/fd behavior by adding
>   Linux specific things to the native fdescfs file system.
>   
>   Unlike FreeBSD, the Linux fdescfs is a directory containing a symbolic
>   links to the actual files, which the process has open.
>   A readlink(2) call on this file returns a full path in case of regular file
>   or a string in a special format (type:[inode], anon_inode:, 
> etc..).
>   As well as in a FreeBSD, opening the file in the Linux fdescfs directory is
>   equivalent to duplicating the corresponding file descriptor.
>   
>   Here we have mutually exclusive requirements:
>   - in case of readlink(2) call fdescfs lookup() method should return VLNK
>   vnode otherwise our kern_readlink() fail with EINVAL error;
>   - in the other calls fdescfs lookup() method should return non VLNK vnode.
>   
>   For what new vnode v_flag VV_READLINK was added, which is set if fdescfs 
> has beed
>   mounted with linrdlnk option an modified kern_readlinkat() to properly 
> handle it.
>   
>   For now For Linux ABI compatibility mount fdescfs volume with linrdlnk 
> option:
>   
>   mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd
>   
>   Reviewed by:kib@
>   MFC after:  1 week
>   Relnotes:   yes

Differential Revision:  https://reviews.freebsd.org/D11452 
___
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: r321840 - in head/sys: kern sys

2017-07-31 Thread Alan Cox
Author: alc
Date: Tue Aug  1 03:51:26 2017
New Revision: 321840
URL: https://svnweb.freebsd.org/changeset/base/321840

Log:
  The blist_meta_* routines that process a subtree take arguments 'radix' and
  'skip', which denote, respectively, the largest number of blocks that can be
  managed by a subtree of that height, and one less than the number of nodes
  in a subtree of that height.  This change removes the 'skip' argument from
  those functions because 'skip' can be trivially computed from 'radius'.
  This change also redefines 'skip' so that it denotes the number of nodes in
  the subtree, and so changes loop upper bound tests from '<= skip' to '<
  skip' to account for the change.
  
  The 'skip' field is also removed from the blist struct.
  
  The self-test program is changed so that the print command includes the
  cursor value in the output.
  
  Submitted by: Doug Moore 
  MFC after:1 week

Modified:
  head/sys/kern/subr_blist.c
  head/sys/sys/blist.h

Modified: head/sys/kern/subr_blist.c
==
--- head/sys/kern/subr_blist.c  Tue Aug  1 03:40:19 2017(r321839)
+++ head/sys/kern/subr_blist.c  Tue Aug  1 03:51:26 2017(r321840)
@@ -123,20 +123,19 @@ void panic(const char *ctl, ...);
 static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count,
daddr_t cursor);
 static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t blk, daddr_t count,
-   daddr_t radix, daddr_t skip, daddr_t cursor);
+   daddr_t radix, daddr_t cursor);
 static void blst_leaf_free(blmeta_t *scan, daddr_t relblk, int count);
 static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count,
-   daddr_t radix, daddr_t skip, daddr_t blk);
+   daddr_t radix, daddr_t blk);
 static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix,
-   daddr_t skip, blist_t dest, daddr_t count);
+   blist_t dest, daddr_t count);
 static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count);
 static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count,
-   daddr_t radix, daddr_t skip, daddr_t blk);
-static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t skip,
-   daddr_t count);
+   daddr_t radix, daddr_t blk);
+static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count);
 #ifndef _KERNEL
 static voidblst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix,
-   daddr_t skip, int tab);
+   int tab);
 #endif
 
 #ifdef _KERNEL
@@ -144,6 +143,28 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Swap space");
 #endif
 
 /*
+ * For a subtree that can represent the state of up to 'radix' blocks, the
+ * number of leaf nodes of the subtree is L=radix/BLIST_BMAP_RADIX.  If 'm'
+ * is short for BLIST_META_RADIX, then for a tree of height h with L=m**h
+ * leaf nodes, the total number of tree nodes is 1 + m + m**2 + ... + m**h,
+ * or, equivalently, (m**(h+1)-1)/(m-1).  This quantity is called 'skip'
+ * in the 'meta' functions that process subtrees.  Since integer division
+ * discards remainders, we can express this computation as
+ * skip = (m * m**h) / (m - 1)
+ * skip = (m * radix / BLIST_BMAP_RADIX) / (m - 1)
+ * and if m divides BLIST_BMAP_RADIX, we can simplify further to
+ * skip = radix / (BLIST_BMAP_RADIX / m * (m - 1))
+ * so that a simple integer division is enough for the calculation.
+ */
+static inline daddr_t
+radix_to_skip(daddr_t radix)
+{
+
+   return (radix /
+   (BLIST_BMAP_RADIX / BLIST_META_RADIX * (BLIST_META_RADIX - 1)));
+}
+
+/*
  * blist_create() - create a blist capable of handling up to the specified
  * number of blocks
  *
@@ -157,18 +178,16 @@ blist_t
 blist_create(daddr_t blocks, int flags)
 {
blist_t bl;
-   daddr_t nodes, radix, skip;
+   daddr_t nodes, radix;
 
/*
-* Calculate radix and skip field used for scanning.
+* Calculate the radix field used for scanning.
 */
radix = BLIST_BMAP_RADIX;
-   skip = 0;
while (radix < blocks) {
radix *= BLIST_META_RADIX;
-   skip = (skip + 1) * BLIST_META_RADIX;
}
-   nodes = 1 + blst_radix_init(NULL, radix, skip, blocks);
+   nodes = 1 + blst_radix_init(NULL, radix, blocks);
 
bl = malloc(sizeof(struct blist), M_SWAP, flags);
if (bl == NULL)
@@ -176,14 +195,13 @@ blist_create(daddr_t blocks, int flags)
 
bl->bl_blocks = blocks;
bl->bl_radix = radix;
-   bl->bl_skip = skip;
bl->bl_cursor = 0;
bl->bl_root = malloc(nodes * sizeof(blmeta_t), M_SWAP, flags);
if (bl->bl_root == NULL) {
free(bl, M_SWAP);
return (NULL);
}
-   blst_radix_init(bl->bl_root, radix, skip, blocks);
+   

svn commit: r321839 - in head: share/man/man4 share/man/man5 sys/fs/fdescfs sys/kern sys/sys

2017-07-31 Thread Dmitry Chagin
Author: dchagin
Date: Tue Aug  1 03:40:19 2017
New Revision: 321839
URL: https://svnweb.freebsd.org/changeset/base/321839

Log:
  Implement proper Linux /dev/fd and /proc/self/fd behavior by adding
  Linux specific things to the native fdescfs file system.
  
  Unlike FreeBSD, the Linux fdescfs is a directory containing a symbolic
  links to the actual files, which the process has open.
  A readlink(2) call on this file returns a full path in case of regular file
  or a string in a special format (type:[inode], anon_inode:, etc..).
  As well as in a FreeBSD, opening the file in the Linux fdescfs directory is
  equivalent to duplicating the corresponding file descriptor.
  
  Here we have mutually exclusive requirements:
  - in case of readlink(2) call fdescfs lookup() method should return VLNK
  vnode otherwise our kern_readlink() fail with EINVAL error;
  - in the other calls fdescfs lookup() method should return non VLNK vnode.
  
  For what new vnode v_flag VV_READLINK was added, which is set if fdescfs has 
beed
  mounted with linrdlnk option an modified kern_readlinkat() to properly handle 
it.
  
  For now For Linux ABI compatibility mount fdescfs volume with linrdlnk option:
  
  mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd
  
  Reviewed by:  kib@
  MFC after:1 week
  Relnotes: yes

Modified:
  head/share/man/man4/linux.4
  head/share/man/man5/fdescfs.5
  head/sys/fs/fdescfs/fdesc.h
  head/sys/fs/fdescfs/fdesc_vfsops.c
  head/sys/fs/fdescfs/fdesc_vnops.c
  head/sys/kern/vfs_syscalls.c
  head/sys/sys/vnode.h

Modified: head/share/man/man4/linux.4
==
--- head/share/man/man4/linux.4 Tue Aug  1 03:13:43 2017(r321838)
+++ head/share/man/man4/linux.4 Tue Aug  1 03:40:19 2017(r321839)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 8, 2010
+.Dd August 1, 2017
 .Dt LINUX 4
 .Os
 .Sh NAME
@@ -127,9 +127,11 @@ regardless of whether the
 module is statically linked into the kernel
 or loaded as a module.
 .Sh FILES
-.Bl -tag -width /compat/linux/proc -compact
+.Bl -tag -width /compat/linux/dev/fd -compact
 .It Pa /compat/linux
 minimal Linux run-time environment
+.It Pa /compat/linux/dev/fd
+limited Linux file-descriptor file system
 .It Pa /compat/linux/proc
 limited Linux process file system
 .It Pa /compat/linux/sys
@@ -138,6 +140,7 @@ limited Linux system file system
 .Sh SEE ALSO
 .Xr brandelf 1 ,
 .Xr elf 5 ,
+.Xr fdescfs 5 ,
 .Xr linprocfs 5 ,
 .Xr linsysfs 5
 .Sh HISTORY

Modified: head/share/man/man5/fdescfs.5
==
--- head/share/man/man5/fdescfs.5   Tue Aug  1 03:13:43 2017
(r321838)
+++ head/share/man/man5/fdescfs.5   Tue Aug  1 03:40:19 2017
(r321839)
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 18, 2010
+.Dd August 1, 2017
 .Dt FDESCFS 5
 .Os
 .Sh NAME
@@ -92,6 +92,14 @@ and
 files are created by default when devfs alone is mounted.
 .Nm
 creates entries for all file descriptors opened by the process.
+.Pp
+For
+.Xr linux 4
+ABI compatibility mount
+.Nm
+volume with
+.Cm linrdlnk
+option.
 .Sh FILES
 .Bl -tag -width /dev/stderr -compact
 .It Pa /dev/fd/#
@@ -103,6 +111,12 @@ volume located on
 .Pa /dev/fd :
 .Pp
 .Dl "mount -t fdescfs null /dev/fd"
+.Pp
+For
+.Xr linux 4
+ABI compatibility:
+.Pp
+.Dl "mount -t fdescfs -o linrdlnk null /compat/linux/dev/fd"
 .Sh SEE ALSO
 .Xr devfs 5 ,
 .Xr mount 8

Modified: head/sys/fs/fdescfs/fdesc.h
==
--- head/sys/fs/fdescfs/fdesc.h Tue Aug  1 03:13:43 2017(r321838)
+++ head/sys/fs/fdescfs/fdesc.h Tue Aug  1 03:40:19 2017(r321839)
@@ -38,7 +38,9 @@
 #define _FS_FDESC_H_
 
 /* Private mount flags for fdescfs. */
-#define FMNT_UNMOUNTF 0x01
+#define FMNT_UNMOUNTF  0x01
+#define FMNT_LINRDLNKF 0x02
+
 struct fdescmount {
struct vnode*f_root;/* Root node */
int flags;

Modified: head/sys/fs/fdescfs/fdesc_vfsops.c
==
--- head/sys/fs/fdescfs/fdesc_vfsops.c  Tue Aug  1 03:13:43 2017
(r321838)
+++ head/sys/fs/fdescfs/fdesc_vfsops.c  Tue Aug  1 03:40:19 2017
(r321839)
@@ -101,6 +101,8 @@ fdesc_mount(struct mount *mp)
 */
mp->mnt_data = fmp;
fmp->flags = 0;
+   if (vfs_getopt(mp->mnt_optnew, "linrdlnk", NULL, NULL) == 0)
+   fmp->flags |= FMNT_LINRDLNKF;
error = fdesc_allocvp(Froot, -1, FD_ROOT, mp, );
if (error) {
free(fmp, M_FDESCMNT);

Modified: head/sys/fs/fdescfs/fdesc_vnops.c
==
--- head/sys/fs/fdescfs/fdesc_vnops.c   Tue Aug  1 03:13:43 2017
(r321838)
+++ head/sys/fs/fdescfs/fdesc_vnops.c   Tue Aug  1 03:40:19 2017
(r321839)
@@ -69,6 +69,7 @@ static vop_getattr_t  

svn commit: r321838 - head/sys/net80211

2017-07-31 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug  1 03:13:43 2017
New Revision: 321838
URL: https://svnweb.freebsd.org/changeset/base/321838

Log:
  sys/net8021: Add missing braces in setcurchan().
  
  Obtained from:DragonFlyBSD (git c69e37d6)
  MFC after:3 days

Modified:
  head/sys/net80211/ieee80211_ioctl.c
  head/sys/net80211/ieee80211_mesh.c

Modified: head/sys/net80211/ieee80211_ioctl.c
==
--- head/sys/net80211/ieee80211_ioctl.c Tue Aug  1 02:55:43 2017
(r321837)
+++ head/sys/net80211/ieee80211_ioctl.c Tue Aug  1 03:13:43 2017
(r321838)
@@ -2014,9 +2014,10 @@ setcurchan(struct ieee80211vap *vap, struct ieee80211_
/* XXX need state machine for other vap's to follow */
ieee80211_setcurchan(ic, vap->iv_des_chan);
vap->iv_bss->ni_chan = ic->ic_curchan;
-   } else
+   } else {
ic->ic_curchan = vap->iv_des_chan;
ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan);
+   }
} else {
/*
 * Need to go through the state machine in case we

Modified: head/sys/net80211/ieee80211_mesh.c
==
--- head/sys/net80211/ieee80211_mesh.c  Tue Aug  1 02:55:43 2017
(r321837)
+++ head/sys/net80211/ieee80211_mesh.c  Tue Aug  1 03:13:43 2017
(r321838)
@@ -2630,7 +2630,7 @@ mesh_recv_action_meshgate(struct ieee80211_node *ni,
/* popagate only if decremented ttl >= 1 && forwarding is enabled */
if ((ie.gann_ttl - 1) < 1 && !(ms->ms_flags & IEEE80211_MESHFLAGS_FWD))
return 0;
-   pgann.gann_flags = ie.gann_flags; /* Reserved */
+   pgann.gann_flags = ie.gann_flags; /* Reserved */
pgann.gann_hopcount = ie.gann_hopcount + 1;
pgann.gann_ttl = ie.gann_ttl - 1;
IEEE80211_ADDR_COPY(pgann.gann_addr, ie.gann_addr);
___
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: r321837 - head/sys/dev/hyperv/netvsc

2017-07-31 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Aug  1 02:55:43 2017
New Revision: 321837
URL: https://svnweb.freebsd.org/changeset/base/321837

Log:
  hyperv/hn: Add comment about ether_ifattach event subscription.
  
  MFC after:3 days
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D11710

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

Modified: head/sys/dev/hyperv/netvsc/if_hn.c
==
--- head/sys/dev/hyperv/netvsc/if_hn.c  Tue Aug  1 02:45:54 2017
(r321836)
+++ head/sys/dev/hyperv/netvsc/if_hn.c  Tue Aug  1 02:55:43 2017
(r321837)
@@ -1541,6 +1541,12 @@ hn_attach(device_t dev)
sc->hn_ifaddr_evthand = EVENTHANDLER_REGISTER(ifaddr_event,
hn_ifaddr_event, sc, EVENTHANDLER_PRI_ANY);
 
+   /*
+* NOTE:
+* Subscribe ether_ifattach event, instead of ifnet_arrival event,
+* since interface's LLADDR is needed; interface LLADDR is not
+* available when ifnet_arrival event is triggered.
+*/
sc->hn_ifnet_atthand = EVENTHANDLER_REGISTER(ether_ifattach_event,
hn_ifnet_attevent, sc, EVENTHANDLER_PRI_ANY);
sc->hn_ifnet_dethand = EVENTHANDLER_REGISTER(ifnet_departure_event,
___
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: r321836 - head/sys/dev/hyperv/netvsc

2017-07-31 Thread Sepherosa Ziehau
Author: sephe
Date: Tue Aug  1 02:45:54 2017
New Revision: 321836
URL: https://svnweb.freebsd.org/changeset/base/321836

Log:
  hyperv/hn: Renaming and minor cleanup
  
  This prepares for the upcoming transparent VF support.
  
  MFC after:3 days
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D11708

Modified:
  head/sys/dev/hyperv/netvsc/if_hn.c
  head/sys/dev/hyperv/netvsc/if_hnvar.h

Modified: head/sys/dev/hyperv/netvsc/if_hn.c
==
--- head/sys/dev/hyperv/netvsc/if_hn.c  Tue Aug  1 01:39:54 2017
(r321835)
+++ head/sys/dev/hyperv/netvsc/if_hn.c  Tue Aug  1 02:45:54 2017
(r321836)
@@ -222,9 +222,9 @@ struct hn_rxinfo {
uint32_thash_value;
 };
 
-struct hn_update_vf {
+struct hn_rxvf_setarg {
struct hn_rx_ring   *rxr;
-   struct ifnet*vf;
+   struct ifnet*vf_ifp;
 };
 
 #define HN_RXINFO_VLAN 0x0001
@@ -264,6 +264,13 @@ static voidhn_ifaddr_event(void *, 
struct ifnet *);
 static voidhn_ifnet_attevent(void *, struct ifnet *);
 static voidhn_ifnet_detevent(void *, struct ifnet *);
 
+static boolhn_ismyvf(const struct hn_softc *,
+   const struct ifnet *);
+static voidhn_rxvf_change(struct hn_softc *,
+   struct ifnet *, bool);
+static voidhn_rxvf_set(struct hn_softc *, struct ifnet *);
+static voidhn_rxvf_set_task(void *, int);
+
 static int hn_rndis_rxinfo(const void *, int,
struct hn_rxinfo *);
 static voidhn_rndis_rx_data(struct hn_rx_ring *,
@@ -801,7 +808,7 @@ hn_rxfilter_config(struct hn_softc *sc)
HN_LOCK_ASSERT(sc);
 
if ((ifp->if_flags & IFF_PROMISC) ||
-   (sc->hn_flags & HN_FLAG_VF)) {
+   (sc->hn_flags & HN_FLAG_RXVF)) {
filter = NDIS_PACKET_TYPE_PROMISCUOUS;
} else {
filter = NDIS_PACKET_TYPE_DIRECTED;
@@ -991,39 +998,39 @@ hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *i
 }
 
 static void
-hn_update_vf_task(void *arg, int pending __unused)
+hn_rxvf_set_task(void *xarg, int pending __unused)
 {
-   struct hn_update_vf *uv = arg;
+   struct hn_rxvf_setarg *arg = xarg;
 
-   uv->rxr->hn_rxvf_ifp = uv->vf;
+   arg->rxr->hn_rxvf_ifp = arg->vf_ifp;
 }
 
 static void
-hn_update_vf(struct hn_softc *sc, struct ifnet *vf)
+hn_rxvf_set(struct hn_softc *sc, struct ifnet *vf_ifp)
 {
struct hn_rx_ring *rxr;
-   struct hn_update_vf uv;
+   struct hn_rxvf_setarg arg;
struct task task;
int i;
 
HN_LOCK_ASSERT(sc);
 
-   TASK_INIT(, 0, hn_update_vf_task, );
+   TASK_INIT(, 0, hn_rxvf_set_task, );
 
for (i = 0; i < sc->hn_rx_ring_cnt; ++i) {
rxr = >hn_rx_ring[i];
 
if (i < sc->hn_rx_ring_inuse) {
-   uv.rxr = rxr;
-   uv.vf = vf;
+   arg.rxr = rxr;
+   arg.vf_ifp = vf_ifp;
vmbus_chan_run_task(rxr->hn_chan, );
} else {
-   rxr->hn_rxvf_ifp = vf;
+   rxr->hn_rxvf_ifp = vf_ifp;
}
}
 }
 
-static __inline bool
+static bool
 hn_ismyvf(const struct hn_softc *sc, const struct ifnet *ifp)
 {
const struct ifnet *hn_ifp;
@@ -1048,7 +1055,7 @@ hn_ismyvf(const struct hn_softc *sc, const struct ifne
 }
 
 static void
-hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool vf)
+hn_rxvf_change(struct hn_softc *sc, struct ifnet *ifp, bool rxvf)
 {
struct ifnet *hn_ifp;
 
@@ -1059,21 +1066,19 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool
 
if (!hn_ismyvf(sc, ifp))
goto out;
-
hn_ifp = sc->hn_ifp;
 
-   /* Now we're sure 'ifp' is a real VF device. */
-   if (vf) {
-   if (sc->hn_flags & HN_FLAG_VF)
+   if (rxvf) {
+   if (sc->hn_flags & HN_FLAG_RXVF)
goto out;
 
-   sc->hn_flags |= HN_FLAG_VF;
+   sc->hn_flags |= HN_FLAG_RXVF;
hn_rxfilter_config(sc);
} else {
-   if (!(sc->hn_flags & HN_FLAG_VF))
+   if (!(sc->hn_flags & HN_FLAG_RXVF))
goto out;
 
-   sc->hn_flags &= ~HN_FLAG_VF;
+   sc->hn_flags &= ~HN_FLAG_RXVF;
if (hn_ifp->if_drv_flags & IFF_DRV_RUNNING)
hn_rxfilter_config(sc);
else
@@ -1081,11 +1086,11 @@ hn_set_vf(struct hn_softc *sc, struct ifnet *ifp, bool
}
 
hn_nvs_set_datapath(sc,
-   vf ? HN_NVS_DATAPATH_VF : HN_NVS_DATAPATH_SYNTHETIC);
+

svn commit: r321835 - head/usr.bin/calendar/calendars

2017-07-31 Thread Jason A. Harmening
Author: jah
Date: Tue Aug  1 01:39:54 2017
New Revision: 321835
URL: https://svnweb.freebsd.org/changeset/base/321835

Log:
  Add myself to FreeBSD calendar
  
  Requested by: mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdTue Aug  1 01:35:23 
2017(r321834)
+++ head/usr.bin/calendar/calendars/calendar.freebsdTue Aug  1 01:39:54 
2017(r321835)
@@ -290,6 +290,7 @@
 08/19  Chin-San Huang  born in Yi-Lan, Taiwan, Republic 
of China, 1979
 08/19  Pav Lucistnik  born in Kutna Hora, Czech Republic, 
1980
 08/20  Michael Heffner  born in Cleona, Pennsylvania, 
United States, 1981
+08/21  Jason A. Harmening  born in Fort Wayne, Indiana, 
United States, 1981
 08/24  Mark Linimon  born in Houston, Texas, United 
States, 1955
 08/24  Alexander Botero-Lowry  died in San Francisco, 
California, United States, 2012
 08/25  Beech Rintoul  born in Oakland, California, United 
States, 1952
___
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: r321834 - head/usr.bin/calendar/calendars

2017-07-31 Thread Pedro F. Giffuni
Author: pfg
Date: Tue Aug  1 01:35:23 2017
New Revision: 321834
URL: https://svnweb.freebsd.org/changeset/base/321834

Log:
  Bring my aging self to calendar.freebsd.
  
  Requested by: mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdTue Aug  1 01:25:18 
2017(r321833)
+++ head/usr.bin/calendar/calendars/calendar.freebsdTue Aug  1 01:35:23 
2017(r321834)
@@ -353,6 +353,7 @@
 10/18  Sheldon Hearn  born in Cape Town, Western Cape, 
South Africa, 1974
 10/19  Nicholas Souchu  born in Suresnes, Hauts-de-Seine, 
France, 1972
 10/19  Nick Barkas  born in Longview, Washington, United 
States, 1981
+10/19  Pedro Giffuni  born in Bogot�, Colombia, 1968
 10/20  Joel Dahl  born in Bitterna, Skaraborg, Sweden, 1983
 10/20  Dmitry Marakasov  born in Moscow, Russian 
Federation, 1984
 10/21  Ben Smithurst  born in Sheffield, South Yorkshire, 
United Kingdom, 1981
___
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: r321828 - in head/sys/modules/i2c: . ds1307 ds3231 nxprtc

2017-07-31 Thread Ian Lepore
Author: ian
Date: Mon Jul 31 22:32:11 2017
New Revision: 321828
URL: https://svnweb.freebsd.org/changeset/base/321828

Log:
  Build iicbus/{ds1307,ds3231,nxprtc} as modules.

Added:
  head/sys/modules/i2c/ds1307/
  head/sys/modules/i2c/ds1307/Makefile   (contents, props changed)
  head/sys/modules/i2c/ds3231/
  head/sys/modules/i2c/ds3231/Makefile   (contents, props changed)
  head/sys/modules/i2c/nxprtc/
  head/sys/modules/i2c/nxprtc/Makefile   (contents, props changed)
Modified:
  head/sys/modules/i2c/Makefile

Modified: head/sys/modules/i2c/Makefile
==
--- head/sys/modules/i2c/Makefile   Mon Jul 31 22:28:33 2017
(r321827)
+++ head/sys/modules/i2c/Makefile   Mon Jul 31 22:32:11 2017
(r321828)
@@ -3,6 +3,8 @@
 SUBDIR = \
controllers \
cyapa \
+   ds1307 \
+   ds3231 \
if_ic \
iic \
iicbb \
@@ -10,6 +12,7 @@ SUBDIR = \
iicsmb \
isl \
jedec_ts \
+   nxprtc \
smb \
smbus \
 

Added: head/sys/modules/i2c/ds1307/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/i2c/ds1307/MakefileMon Jul 31 22:32:11 2017
(r321828)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD   = ds1307
+SRCS   = ds1307.c bus_if.h clock_if.h device_if.h iicbus_if.h
+
+.include 

Added: head/sys/modules/i2c/ds3231/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/i2c/ds3231/MakefileMon Jul 31 22:32:11 2017
(r321828)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD   = ds3231
+SRCS   = ds3231.c bus_if.h clock_if.h device_if.h iicbus_if.h
+
+.include 

Added: head/sys/modules/i2c/nxprtc/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/i2c/nxprtc/MakefileMon Jul 31 22:32:11 2017
(r321828)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+.PATH: ${SRCTOP}/sys/dev/iicbus
+KMOD   = nxprtc
+SRCS   = nxprtc.c bus_if.h clock_if.h device_if.h iicbus_if.h
+
+.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: r321826 - head/sys/modules/i2c

2017-07-31 Thread Ian Lepore
Author: ian
Date: Mon Jul 31 22:26:30 2017
New Revision: 321826
URL: https://svnweb.freebsd.org/changeset/base/321826

Log:
  Restructure the SUBDIR list as 1-per-line and alphabetize, so it will be
  easier to add new things (and see what changed) in the future.

Modified:
  head/sys/modules/i2c/Makefile

Modified: head/sys/modules/i2c/Makefile
==
--- head/sys/modules/i2c/Makefile   Mon Jul 31 22:19:39 2017
(r321825)
+++ head/sys/modules/i2c/Makefile   Mon Jul 31 22:26:30 2017
(r321826)
@@ -1,6 +1,16 @@
 # $FreeBSD$
 
-SUBDIR =
-SUBDIR += controllers if_ic smbus iicbus iicbb iicsmb iic cyapa smb isl 
jedec_ts
+SUBDIR = \
+   controllers \
+   cyapa \
+   if_ic \
+   iic \
+   iicbb \
+   iicbus \
+   iicsmb \
+   isl \
+   jedec_ts \
+   smb \
+   smbus \
 
 .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"


Re: svn commit: r321824 - head/tests/sys/file

2017-07-31 Thread Ngie Cooper (yaneurabeya)

> On Jul 31, 2017, at 15:00, Bryan Drewery  wrote:
> 
> Author: bdrewery
> Date: Mon Jul 31 22:00:27 2017
> New Revision: 321824
> URL: https://svnweb.freebsd.org/changeset/base/321824
> 
> Log:
>  Allow changing the test PORT at compile-time.
> 
>  Sponsored by:Dell EMC Isilon

MFC after?


signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r321824 - head/tests/sys/file

2017-07-31 Thread Bryan Drewery
Author: bdrewery
Date: Mon Jul 31 22:00:27 2017
New Revision: 321824
URL: https://svnweb.freebsd.org/changeset/base/321824

Log:
  Allow changing the test PORT at compile-time.
  
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/file/newfileops_on_fork_test.c

Modified: head/tests/sys/file/newfileops_on_fork_test.c
==
--- head/tests/sys/file/newfileops_on_fork_test.c   Mon Jul 31 22:00:00 
2017(r321823)
+++ head/tests/sys/file/newfileops_on_fork_test.c   Mon Jul 31 22:00:27 
2017(r321824)
@@ -50,7 +50,9 @@
 #include 
 #include 
 
+#ifndef PORT
 #definePORT9000
+#endif
 
 static int listen_fd;
 
___
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: r321823 - head/sys/dev/iicbus

2017-07-31 Thread Ian Lepore
Author: ian
Date: Mon Jul 31 22:00:00 2017
New Revision: 321823
URL: https://svnweb.freebsd.org/changeset/base/321823

Log:
  Bugfixes and enhancements...
  
  Don't enable the oscillator when it is found to be stopped at init time,
  just let the first setting of valid time start it.  But still report a dead
  battery if it's stopped at init time.
  
  Don't force the chip into 24hr mode, just cope with whatever mode it is
  already in.
  
  Schedule the clock_settime() callbacks to align the RTC clock to top of
  second when setting it.

Modified:
  head/sys/dev/iicbus/ds3231.c
  head/sys/dev/iicbus/ds3231reg.h

Modified: head/sys/dev/iicbus/ds3231.c
==
--- head/sys/dev/iicbus/ds3231.cMon Jul 31 21:59:06 2017
(r321822)
+++ head/sys/dev/iicbus/ds3231.cMon Jul 31 22:00:00 2017
(r321823)
@@ -62,6 +62,7 @@ struct ds3231_softc {
uint16_tsc_addr;/* DS3231 slave address. */
uint8_t sc_ctrl;
uint8_t sc_status;
+   boolsc_use_ampm;
 };
 
 static void ds3231_start(void *);
@@ -141,25 +142,6 @@ ds3231_status_write(struct ds3231_softc *sc, int clear
 }
 
 static int
-ds3231_set_24hrs_mode(struct ds3231_softc *sc)
-{
-   int error;
-   uint8_t hour;
-
-   error = ds3231_read1(sc->sc_dev, DS3231_HOUR, );
-   if (error) {
-   device_printf(sc->sc_dev, "cannot read from RTC.\n");
-   return (error);
-   }
-   hour &= ~DS3231_C_MASK;
-   error = ds3231_write1(sc->sc_dev, DS3231_HOUR, hour);
-   if (error != 0)
-   device_printf(sc->sc_dev, "cannot write to RTC.\n");
-
-   return (error);
-}
-
-static int
 ds3231_temp_read(struct ds3231_softc *sc, int *temp)
 {
int error, neg, t;
@@ -437,20 +419,20 @@ ds3231_start(void *xdev)
return;
if (ds3231_status_read(sc) != 0)
return;
-   /* Clear the OSF bit and ack any pending alarm interrupt. */
+   /*
+* Warn if the clock stopped, but don't restart it until the first
+* clock_settime() call.
+*/
if (sc->sc_status & DS3231_STATUS_OSF) {
device_printf(sc->sc_dev,
-   "oscillator has stopped, check the battery.\n");
-   sc->sc_status &= ~DS3231_STATUS_OSF;
+   "WARNING: RTC clock stopped, check the battery.\n");
}
+   /* Ack any pending alarm interrupt. */
if (ds3231_status_write(sc, 1, 1) != 0)
return;
/* Always enable the oscillator. */
if (ds3231_ctrl_write(sc) != 0)
return;
-   /* Set the 24 hours mode. */
-   if (ds3231_set_24hrs_mode(sc) != 0)
-   return;
 
/* Temperature. */
SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "temperature",
@@ -476,8 +458,13 @@ ds3231_start(void *xdev)
CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, sc, 0,
ds3231_en32khz_sysctl, "IU", "DS3231 enable the 32kHz output");
 
-   /* 1 second resolution. */
-   clock_register(dev, 100);
+   /*
+* Register as a clock with 1 second resolution.  Schedule the
+* clock_settime() method to be called just after top-of-second;
+* resetting the time resets top-of-second in the hardware.
+*/
+   clock_register_flags(dev, 100, CLOCKF_SETTIME_NO_ADJ);
+   clock_schedule(dev, 1);
 }
 
 static int
@@ -486,24 +473,45 @@ ds3231_gettime(device_t dev, struct timespec *ts)
int c, error;
struct clocktime ct;
struct ds3231_softc *sc;
-   uint8_t data[7];
+   uint8_t data[7], hourmask;
 
sc = device_get_softc(dev);
-   memset(data, 0, sizeof(data));
+
+   /* If the clock halted, we don't have good data. */
+   if ((error = ds3231_status_read(sc)) != 0) {
+   device_printf(dev, "cannot read from RTC.\n");
+   return (error);
+   }
+   if (sc->sc_status & DS3231_STATUS_OSF)
+   return (EINVAL);
+
error = iicdev_readfrom(sc->sc_dev, DS3231_SECS, data, sizeof(data),
IIC_INTRWAIT);
if (error != 0) {
device_printf(dev, "cannot read from RTC.\n");
return (error);
}
+
+   /* If chip is in AM/PM mode remember that. */
+   if (data[DS3231_HOUR] & DS3231_HOUR_USE_AMPM) {
+   sc->sc_use_ampm = true;
+   hourmask = DS3231_HOUR_MASK_12HR;
+   } else
+   hourmask = DS3231_HOUR_MASK_24HR;
+
ct.nsec = 0;
-   ct.sec = FROMBCD(data[DS3231_SECS] & DS3231_SECS_MASK);
-   ct.min = FROMBCD(data[DS3231_MINS] & DS3231_MINS_MASK);
-   ct.hour = FROMBCD(data[DS3231_HOUR] & DS3231_HOUR_MASK);
-   ct.day = FROMBCD(data[DS3231_DATE] & DS3231_DATE_MASK);
-   ct.dow = data[DS3231_WEEKDAY] & DS3231_WEEKDAY_MASK;
-   ct.mon = FROMBCD(data[DS3231_MONTH] & 

svn commit: r321821 - head/sys/dev/iicbus

2017-07-31 Thread Ian Lepore
Author: ian
Date: Mon Jul 31 21:53:00 2017
New Revision: 321821
URL: https://svnweb.freebsd.org/changeset/base/321821

Log:
  No need to call getnanotime() now that the waiting is done by the central
  subr_rtc code, switch from CLOCKF_SETTIME_NO_TS to CLOCKF_SETTIME_NO_ADJ
  so that we get fed a timestamp, but it's not adjusted to compensate for
  inaccuracy in setting time.

Modified:
  head/sys/dev/iicbus/ds1307.c

Modified: head/sys/dev/iicbus/ds1307.c
==
--- head/sys/dev/iicbus/ds1307.cMon Jul 31 21:52:08 2017
(r321820)
+++ head/sys/dev/iicbus/ds1307.cMon Jul 31 21:53:00 2017
(r321821)
@@ -303,12 +303,12 @@ ds1307_start(void *xdev)
CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, sc, 0,
ds1307_sqw_out_sysctl, "IU", "DS1307 square-wave output state");
 
-/*
- * Register as a clock with 1 second resolution.  Schedule the
- * clock_settime() method to be called just after top-of-second;
- * resetting the time resets top-of-second in the hardware.
- */
-   clock_register_flags(dev, 100, CLOCKF_SETTIME_NO_TS);
+   /*
+* Register as a clock with 1 second resolution.  Schedule the
+* clock_settime() method to be called just after top-of-second;
+* resetting the time resets top-of-second in the hardware.
+*/
+   clock_register_flags(dev, 100, CLOCKF_SETTIME_NO_ADJ);
clock_schedule(dev, 1);
 }
 
@@ -368,6 +368,13 @@ ds1307_settime(device_t dev, struct timespec *ts)
 
sc = device_get_softc(dev);
 
+   /*
+* We request a timespec with no resolution-adjustment.  That also
+* disables utc adjustment, so apply that ourselves.
+*/
+   ts->tv_sec -= utc_offset();
+   clock_ts_to_ct(ts, );
+
/* If the chip is in AM/PM mode, adjust hour and set flags as needed. */
if (sc->sc_use_ampm) {
pmflags = DS1307_HOUR_USE_AMPM;
@@ -379,10 +386,6 @@ ds1307_settime(device_t dev, struct timespec *ts)
ct.hour = 12;
} else
pmflags = 0;
-
-   getnanotime(ts);
-   ts->tv_sec -= utc_offset();
-   clock_ts_to_ct(ts, );
 
data[DS1307_SECS]= TOBCD(ct.sec);
data[DS1307_MINS]= TOBCD(ct.min);
___
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: r321818 - head/usr.bin/calendar/calendars

2017-07-31 Thread Tobias C. Berner
Author: tcberner (ports committer)
Date: Mon Jul 31 21:08:31 2017
New Revision: 321818
URL: https://svnweb.freebsd.org/changeset/base/321818

Log:
  Add myself to the calendar.freebsd
  
  Reported by:mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 20:54:23 
2017(r321817)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 21:08:31 
2017(r321818)
@@ -71,6 +71,7 @@
 02/14  Martin Blapp  born in Olten, Switzerland, 1976
 02/15  Hiren Panchasara  born in Ahmedabad, Gujarat, India, 
1984
 02/16  Justin Hibbits  born in Toledo, Ohio, United 
States, 1983
+02/16   Tobias Christian Berner  born in Bern, 
Switzerland, 1985
 02/19  Murray Stokely  born in Jacksonville, Florida, 
United States, 1979
 02/20  Anders Nordby  born in Oslo, Norway, 1976
 02/21  Alexey Zelkin  born in Simferopol, Ukraine, 1978
___
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: r321817 - head/usr.bin/calendar/calendars

2017-07-31 Thread Pawel Pekala
Author: pawel (ports committer)
Date: Mon Jul 31 20:54:23 2017
New Revision: 321817
URL: https://svnweb.freebsd.org/changeset/base/321817

Log:
  Add myself to the calendar.freebsd
  
  Reported by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 20:41:45 
2017(r321816)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 20:54:23 
2017(r321817)
@@ -188,6 +188,7 @@
 05/23  Munechika Sumikawa  born in Osaka, Osaka, Japan, 
1972
 05/24  Duncan McLennan Barclay  born in London, Middlesex, 
United Kingdom, 1970
 05/24  Oliver Lehmann  born in Karlsburg, Germany, 1981
+05/25   Pawel Pekala  born in Swidnica, Poland, 1980
 05/25  Tom Rhodes  born in Ellwood City, Pennsylvania, 
United States, 1981
 05/25  Roman Divacky  born in Brno, Czech Republic, 1983
 05/26  Jim Pirzyk  born in Chicago, Illinois, United 
States, 1968
___
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: r321816 - head/sys/ufs/ffs

2017-07-31 Thread Kirk McKusick
Author: mckusick
Date: Mon Jul 31 20:41:45 2017
New Revision: 321816
URL: https://svnweb.freebsd.org/changeset/base/321816

Log:
  Avoid reading a snapshot block when it is already in the cache.
  Update the use of the B_CACHE flag (since the May 1999 commit
  that made it the correct test here).
  
  Reported by: Andreas Longwitz 
  Reviewed by: kib
  Tested by: Peter Holm
  MFC after: 1 week

Modified:
  head/sys/ufs/ffs/ffs_snapshot.c

Modified: head/sys/ufs/ffs/ffs_snapshot.c
==
--- head/sys/ufs/ffs/ffs_snapshot.c Mon Jul 31 20:28:26 2017
(r321815)
+++ head/sys/ufs/ffs/ffs_snapshot.c Mon Jul 31 20:41:45 2017
(r321816)
@@ -1394,7 +1394,7 @@ indiracct_ufs2(snapvp, cancelvp, level, blkno, lbn, rl
 */
bp = getblk(cancelvp, lbn, fs->fs_bsize, 0, 0, 0);
bp->b_blkno = fsbtodb(fs, blkno);
-   if ((bp->b_flags & (B_DONE | B_DELWRI)) == 0 &&
+   if ((bp->b_flags & B_CACHE) == 0 &&
(error = readblock(cancelvp, bp, fragstoblks(fs, blkno {
brelse(bp);
return (error);
___
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"


Re: svn commit: r321720 - head/sys/dev/ichwd

2017-07-31 Thread John Baldwin
On Sunday, July 30, 2017 03:19:07 PM Alexander Motin wrote:
> Author: mav
> Date: Sun Jul 30 15:19:07 2017
> New Revision: 321720
> URL: https://svnweb.freebsd.org/changeset/base/321720
> 
> Log:
>   Attach ichwd(4) only to ISA bus of the LPC bridge.
>   
>   Resource allocation for parent device does not look good by itself, but
>   attempt to allocate them for unrelated device just does not end up good.
>   On Asus X99-E WS/USB3.1 system reporting ISA bridge via both PCI and ACPI
>   this reported to cause kernel panic on shutdown due to messed resources:
>   https://bugs.freenas.org/issues/25237.
>   
>   MFC after:  1 week
> 
> Modified:
>   head/sys/dev/ichwd/ichwd.c
> 
> Modified: head/sys/dev/ichwd/ichwd.c
> ==
> --- head/sys/dev/ichwd/ichwd.cSun Jul 30 11:50:16 2017
> (r321719)
> +++ head/sys/dev/ichwd/ichwd.cSun Jul 30 15:19:07 2017
> (r321720)
> @@ -533,23 +533,26 @@ ichwd_event(void *arg, unsigned int cmd, int *error)
>  }
>  
>  static device_t
> -ichwd_find_ich_lpc_bridge(struct ichwd_device **id_p)
> +ichwd_find_ich_lpc_bridge(device_t isa, struct ichwd_device **id_p)
>  {
>   struct ichwd_device *id;
> - device_t ich = NULL;
> + device_t isab;
> + uint16_t devid;
>  
> - /* look for an ICH LPC interface bridge */
> - for (id = ichwd_devices; id->desc != NULL; ++id)
> - if ((ich = pci_find_device(VENDORID_INTEL, id->device)) != NULL)
> - break;
> -
> - if (ich == NULL)
> + /* Check whether parent ISA bridge looks familiar. */
> + isab = device_get_parent(isa);
> + if (pci_get_vendor(isab) != VENDORID_INTEL)
>   return (NULL);

You probably need to do slightly more work to verify that the isab device is a
PCI child before you use pci_get_vendor().  I believe isa0 can be a child of
legacy0 for example (though I doubt we run on such hardware without PCI 
anymore).

Seeing if the devclass of device_get_parent(isab) == devclass_find("pci") would
be sufficient.  It might also be nice to add a 'device_is_pci()' helper function
as I think we probably have a similar check in some other places.

The general change is definitely an improvement though.

-- 
John Baldwin
___
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"


Re: svn commit: r321790 - head/sbin/sysctl

2017-07-31 Thread John Baldwin
On Monday, July 31, 2017 02:56:35 PM Andrew Gallatin wrote:
> Author: gallatin
> Date: Mon Jul 31 14:56:35 2017
> New Revision: 321790
> URL: https://svnweb.freebsd.org/changeset/base/321790
> 
> Log:
>   Don't request CTLTYPE_OPAQUE if we can't print them.
>   
>   The intent is to skip expensive opaque sysctls like tcp_pcblist unless
>   they are explicitly requested. Sysctl nodes like this don't show up in
>   sysctl -a, but they do generate output that winds up being dropped,
>   unless the user specifically requested  binary/hex output or opaques.
>   
>   This reduces the runtime of sysctl in many circumstances on a loaded
>   system.  It also reduces the likelihood that simply gathering
>   diagnostics on a sick machine (stuck lock, etc) via sysctl -a might
>   push it over the edge into a total lockup.
>   
>   Reviewed by:jtl
>   Sponsored by:   Netflix
>   Differential Revision:  https://reviews.freebsd.org/D11461
> 
> Modified:
>   head/sbin/sysctl/sysctl.c
> 
> Modified: head/sbin/sysctl/sysctl.c
> ==
> --- head/sbin/sysctl/sysctl.c Mon Jul 31 14:53:03 2017(r321789)
> +++ head/sbin/sysctl/sysctl.c Mon Jul 31 14:56:35 2017(r321790)
> @@ -925,6 +925,32 @@ show_var(int *oid, int nlen)
>   printf("%s", buf);
>   return (0);
>   }
> +
> + /* don't fetch opaques that we don't know how to print */
> + if (ctltype == CTLTYPE_OPAQUE) {
> + if (strcmp(fmt, "S,clockinfo") == 0)
> + func = S_clockinfo;
> + else if (strcmp(fmt, "S,timeval") == 0)
> + func = S_timeval;
> + else if (strcmp(fmt, "S,loadavg") == 0)
> + func = S_loadavg;
> + else if (strcmp(fmt, "S,vmtotal") == 0)
> + func = S_vmtotal;
> +#ifdef __amd64__
> + else if (strcmp(fmt, "S,efi_map_header") == 0)
> + func = S_efi_map;
> +#endif
> +#if defined(__amd64__) || defined(__i386__)
> + else if (strcmp(fmt, "S,bios_smap_xattr") == 0)
> + func = S_bios_smap_xattr;
> +#endif
> + else {
> + func = NULL;
> + if (!bflag && !oflag && !xflag)
> + return (1);
> + }
> + }
> +
>   /* find an estimate of how much we need for this var */
>   if (Bflag)
>   j = Bflag;
> @@ -1045,24 +1071,6 @@ show_var(int *oid, int nlen)
>  
>   case CTLTYPE_OPAQUE:
>   i = 0;
> - if (strcmp(fmt, "S,clockinfo") == 0)
> - func = S_clockinfo;
> - else if (strcmp(fmt, "S,timeval") == 0)
> - func = S_timeval;
> - else if (strcmp(fmt, "S,loadavg") == 0)
> - func = S_loadavg;
> - else if (strcmp(fmt, "S,vmtotal") == 0)
> - func = S_vmtotal;
> -#ifdef __amd64__
> - else if (strcmp(fmt, "S,efi_map_header") == 0)
> - func = S_efi_map;
> -#endif
> -#if defined(__amd64__) || defined(__i386__)
> - else if (strcmp(fmt, "S,bios_smap_xattr") == 0)
> - func = S_bios_smap_xattr;
> -#endif
> - else
> - func = NULL;
>   if (func) {

func should always be true now?

-- 
John Baldwin
___
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: r321814 - head/usr.bin/calendar/calendars

2017-07-31 Thread Mateusz Guzik
Author: mjg
Date: Mon Jul 31 20:15:11 2017
New Revision: 321814
URL: https://svnweb.freebsd.org/changeset/base/321814

Log:
  Add myself to the calendar.
  
  Prodded by:   invisible peer pressure

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 19:58:49 
2017(r321813)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 20:15:11 
2017(r321814)
@@ -233,6 +233,7 @@
 06/30  Guido van Rooij  born in Best, Noord-Brabant, the 
Netherlands, 1965
 06/30  Second quarter status reports are due on 07/15
 07/01  Matthew Dillon  born in San Francisco, 
California, United States, 1966
+07/01  Mateusz Guzik  born in Nowy Targ, Poland, 1986
 07/02  Mark Christopher Ovens  born in Preston, Lancashire, 
United Kingdom, 1958
 07/02  Vasil Venelinov Dimov  born in Shumen, Bulgaria, 1982
 07/04  Motoyuki Konno  born in Musashino, Tokyo, Japan, 
1969
___
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: r321812 - head/share/misc

2017-07-31 Thread Baptiste Daroussin
Author: bapt
Date: Mon Jul 31 19:51:36 2017
New Revision: 321812
URL: https://svnweb.freebsd.org/changeset/base/321812

Log:
  Update pci_vendors to 2017.07.27
  
  MFC after:2 days

Modified:
  head/share/misc/pci_vendors

Modified: head/share/misc/pci_vendors
==
--- head/share/misc/pci_vendors Mon Jul 31 19:48:29 2017(r321811)
+++ head/share/misc/pci_vendors Mon Jul 31 19:51:36 2017(r321812)
@@ -3,8 +3,8 @@
 #
 #  List of PCI ID's
 #
-#  Version: 2017.07.13
-#  Date:2017-07-13 03:15:01
+#  Version: 2017.07.27
+#  Date:2017-07-27 03:15:02
 #
 #  Maintained by Albert Pool, Martin Mares, and other volunteers from
 #  the PCI ID Project at http://pci-ids.ucw.cz/.
@@ -2436,7 +2436,7 @@
144d c0c7  Radeon HD 7550M
6842  Thames LE [Radeon HD 7000M Series]
6843  Thames [Radeon HD 7670M]
-   6863  Vega 10 [Radeon Vega Frontier Edition]
+   6863  Vega 10 XTX [Radeon Vega Frontier Edition]
687f  Vega [Radeon RX Vega]
6888  Cypress XT [FirePro V8800]
6889  Cypress PRO [FirePro V7800]
@@ -2952,6 +2952,8 @@
6987  Polaris12
6995  Lexa XT [Radeon PRO WX 2100]
699f  Lexa PRO [Radeon RX 550]
+   148c 2380  Lexa XL [Radeon RX 550]
+   1da2 e367  Lexa PRO [Radeon RX 550]
700f  RS100 AGP Bridge
7010  RS200/RS250 AGP Bridge
7100  R520 [Radeon X1800 XT]
@@ -6026,11 +6028,12 @@
1077 e4f4  FastLinQ QL45411H 40GbE Adapter
1644  FastLinQ QL45000 Series 100GbE Controller
1077 e4f8  FastLinQ QL45611H 100GbE Adapter
+   1654  FastLinQ QL45000 Series 50GbE Controller
+   1590 0223  Synergy 6810C 25/50Gb Ethernet Adapter
1656  FastLinQ QL45000 Series 25GbE Controller
1077 02a7  QL45212-DE 25GbE Adapter
1077 e4f6  FastLinQ QL45211H 25GbE Adapter
1077 e4f7  FastLinQ QL45212H 25GbE Adapter
-   1590 0223  Synergy 6810C 25/50Gb Ethernet Adapter
165c  FastLinQ QL45000 Series 40GbE Controller (FCoE)
1077 e4f1  FastLinQ QL45462H 40GbE FCoE Adapter
1077 e4f2  FastLinQ QL45461H 40GbE FCoE Adapter
@@ -16128,6 +16131,8 @@
50a0  T540-50A0 Unified Wire Ethernet Controller
50a1  T540-50A1 Unified Wire Ethernet Controller
50a2  T580-50A2 Unified Wire Ethernet Controller
+   50a3  T580-50A3 Unified Wire Ethernet Controller
+   50a4  T540-50A4 Unified Wire Ethernet Controller
5401  T520-CR Unified Wire Ethernet Controller
5402  T522-CR Unified Wire Ethernet Controller
5403  T540-CR Unified Wire Ethernet Controller
@@ -16181,6 +16186,8 @@
54a0  T540-50A0 Unified Wire Ethernet Controller
54a1  T540-50A1 Unified Wire Ethernet Controller
54a2  T580-50A2 Unified Wire Ethernet Controller
+   54a3  T580-50A3 Unified Wire Ethernet Controller
+   54a4  T540-50A4 Unified Wire Ethernet Controller
5501  T520-CR Unified Wire Storage Controller
5502  T522-CR Unified Wire Storage Controller
5503  T540-CR Unified Wire Storage Controller
@@ -16234,6 +16241,8 @@
55a0  T540-50A0 Unified Wire Storage Controller
55a1  T540-50A1 Unified Wire Storage Controller
55a2  T580-50A2 Unified Wire Storage Controller
+   55a3  T580-50A3 Unified Wire Storage Controller
+   55a4  T540-50A4 Unified Wire Storage Controller
5601  T520-CR Unified Wire Storage Controller
5602  T522-CR Unified Wire Storage Controller
5603  T540-CR Unified Wire Storage Controller
@@ -16287,6 +16296,8 @@
56a0  T540-50A0 Unified Wire Storage Controller
56a1  T540-50A1 Unified Wire Storage Controller
56a2  T580-50A2 Unified Wire Storage Controller
+   56a3  T580-50A3 Unified Wire Storage Controller
+   56a4  T540-50A4 Unified Wire Storage Controller
5701  T520-CR Unified Wire Ethernet Controller
5702  T522-CR Unified Wire Ethernet Controller
5703  T540-CR Unified Wire Ethernet Controller
@@ -16379,6 +16390,8 @@
58a0  T540-50A0 Unified Wire Ethernet Controller [VF]
58a1  T540-50A1 Unified Wire Ethernet Controller [VF]
58a2  T580-50A2 Unified Wire Ethernet Controller [VF]
+   58a3  T580-50A3 Unified Wire Ethernet Controller [VF]
+   58a4  T540-50A4 Unified Wire Ethernet Controller [VF]
6001  T6225-CR Unified Wire Ethernet Controller
6002  T6225-SO-CR Unified Wire Ethernet Controller
6003  T6425-CR Unified Wire Ethernet Controller
@@ -16594,6 +16607,7 @@
e836  M115S Hybrid Analog/DVB PAL/SECAM/NTSC Tuner
f436  AVerTV Hybrid+FM
 1462  Micro-Star International Co., Ltd. [MSI]
+   aaf0  Radeon RX 580 Gaming X 8G
 1463  Fast Corporation
 1464  Interactive Circuits & Systems Ltd
 1465  GN NETTEST 

svn commit: r321810 - in head: contrib/mdocml usr.bin/mandoc

2017-07-31 Thread Baptiste Daroussin
Author: bapt
Date: Mon Jul 31 19:34:38 2017
New Revision: 321810
URL: https://svnweb.freebsd.org/changeset/base/321810

Log:
  Update mandoc to 1.14.2

Added:
  head/contrib/mdocml/compat_recallocarray.c
 - copied unchanged from r321808, vendor/mdocml/dist/compat_recallocarray.c
  head/contrib/mdocml/mandoc_xr.c
 - copied unchanged from r321808, vendor/mdocml/dist/mandoc_xr.c
  head/contrib/mdocml/mandoc_xr.h
 - copied unchanged from r321808, vendor/mdocml/dist/mandoc_xr.h
  head/contrib/mdocml/test-recallocarray.c
 - copied unchanged from r321808, vendor/mdocml/dist/test-recallocarray.c
Modified:
  head/contrib/mdocml/INSTALL
  head/contrib/mdocml/LICENSE
  head/contrib/mdocml/Makefile
  head/contrib/mdocml/Makefile.depend
  head/contrib/mdocml/NEWS
  head/contrib/mdocml/TODO
  head/contrib/mdocml/apropos.1
  head/contrib/mdocml/att.c
  head/contrib/mdocml/cgi.c
  head/contrib/mdocml/chars.c
  head/contrib/mdocml/config.h
  head/contrib/mdocml/configure
  head/contrib/mdocml/configure.local.example
  head/contrib/mdocml/demandoc.c
  head/contrib/mdocml/eqn.7
  head/contrib/mdocml/eqn.c
  head/contrib/mdocml/eqn_html.c
  head/contrib/mdocml/eqn_term.c
  head/contrib/mdocml/gmdiff
  head/contrib/mdocml/html.c
  head/contrib/mdocml/html.h
  head/contrib/mdocml/lib.c
  head/contrib/mdocml/libmandoc.h
  head/contrib/mdocml/libroff.h
  head/contrib/mdocml/main.c
  head/contrib/mdocml/man.7
  head/contrib/mdocml/man.c
  head/contrib/mdocml/man.options.1
  head/contrib/mdocml/man_html.c
  head/contrib/mdocml/man_macro.c
  head/contrib/mdocml/man_term.c
  head/contrib/mdocml/man_validate.c
  head/contrib/mdocml/manconf.h
  head/contrib/mdocml/mandoc.1
  head/contrib/mdocml/mandoc.3
  head/contrib/mdocml/mandoc.c
  head/contrib/mdocml/mandoc.css
  head/contrib/mdocml/mandoc.h
  head/contrib/mdocml/mandoc_aux.c
  head/contrib/mdocml/mandoc_aux.h
  head/contrib/mdocml/mandoc_char.7
  head/contrib/mdocml/mandoc_escape.3
  head/contrib/mdocml/mandoc_headers.3
  head/contrib/mdocml/mandoc_html.3
  head/contrib/mdocml/mandocd.c
  head/contrib/mdocml/mandocdb.c
  head/contrib/mdocml/manpath.c
  head/contrib/mdocml/mansearch.c
  head/contrib/mdocml/mdoc.7
  head/contrib/mdocml/mdoc.c
  head/contrib/mdocml/mdoc_html.c
  head/contrib/mdocml/mdoc_man.c
  head/contrib/mdocml/mdoc_markdown.c
  head/contrib/mdocml/mdoc_term.c
  head/contrib/mdocml/mdoc_validate.c
  head/contrib/mdocml/msec.in
  head/contrib/mdocml/out.c
  head/contrib/mdocml/out.h
  head/contrib/mdocml/read.c
  head/contrib/mdocml/roff.7
  head/contrib/mdocml/roff.c
  head/contrib/mdocml/roff.h
  head/contrib/mdocml/roff_html.c
  head/contrib/mdocml/roff_int.h
  head/contrib/mdocml/roff_term.c
  head/contrib/mdocml/roff_validate.c
  head/contrib/mdocml/soelim.1
  head/contrib/mdocml/st.c
  head/contrib/mdocml/st.in
  head/contrib/mdocml/tbl.7
  head/contrib/mdocml/tbl.c
  head/contrib/mdocml/tbl_data.c
  head/contrib/mdocml/tbl_html.c
  head/contrib/mdocml/tbl_layout.c
  head/contrib/mdocml/tbl_term.c
  head/contrib/mdocml/term.c
  head/contrib/mdocml/term.h
  head/contrib/mdocml/term_ascii.c
  head/contrib/mdocml/term_tab.c
  head/contrib/mdocml/tree.c
  head/usr.bin/mandoc/Makefile
Directory Properties:
  head/contrib/mdocml/   (props changed)

Modified: head/contrib/mdocml/INSTALL
==
--- head/contrib/mdocml/INSTALL Mon Jul 31 19:30:23 2017(r321809)
+++ head/contrib/mdocml/INSTALL Mon Jul 31 19:34:38 2017(r321810)
@@ -1,22 +1,24 @@
-$Id: INSTALL,v 1.18 2017/02/08 12:24:10 schwarze Exp $
+$Id: INSTALL,v 1.20 2017/07/28 14:57:56 schwarze Exp $
 
-About mdocml, the portable mandoc distribution
---
-The mandoc manpage compiler toolset is a suite of tools compiling
-mdoc(7), the roff(7) macro language of choice for BSD manual pages,
-and man(7), the predominant historical language for UNIX manuals.
+About the portable mandoc distribution
+--
+The mandoc manpage compiler toolset (formerly called "mdocml")
+is a suite of tools compiling mdoc(7), the roff(7) macro language
+of choice for BSD manual pages, and man(7), the predominant
+historical language for UNIX manuals.
+
 It includes a man(1) manual viewer and additional tools.
-For general information, see .
+For general information, see .
 
 In case you have questions or want to provide feedback, read
-.  Consider subscribing to the
+.  Consider subscribing to the
 discuss@ mailing list mentioned on that page.  If you intend to
 help with the development of mandoc, consider subscribing to the
 tech@ mailing list, too.
 
 Enjoy using the mandoc toolset!
 
-Ingo Schwarze, Karlsruhe, February 2017
+Ingo Schwarze, Karlsruhe, July 2017
 
 
 Installation
@@ -25,7 +27,7 @@ Before manually installing mandoc on your system, 

svn commit: r321806 - head/lib/libtelnet

2017-07-31 Thread Cy Schubert
Author: cy
Date: Mon Jul 31 19:07:45 2017
New Revision: 321806
URL: https://svnweb.freebsd.org/changeset/base/321806

Log:
  Remove redundant include directories which expand to a noop,
  "-I/lib/krb5 -I -I".
  
  Reviewed by:  ngie@, markm@
  MFC after:1 month
  Differential Revision:D11769

Modified:
  head/lib/libtelnet/Makefile

Modified: head/lib/libtelnet/Makefile
==
--- head/lib/libtelnet/Makefile Mon Jul 31 18:48:58 2017(r321805)
+++ head/lib/libtelnet/Makefile Mon Jul 31 19:07:45 2017(r321806)
@@ -23,8 +23,7 @@ CFLAGS+=  -DENCRYPTION -DAUTHENTICATION -DSRA
 
 .if ${MK_KERBEROS_SUPPORT} != "no"
 SRCS+= kerberos5.c
-CFLAGS+=   -DKRB5 -I${KRB5DIR}/lib/krb5 -I${KRB5OBJDIR} -I${ASN1OBJDIR}
-CFLAGS+=   -DFORWARD -Dnet_write=telnet_net_write
+CFLAGS+=   -DKRB5 -DFORWARD -Dnet_write=telnet_net_write
 .endif
 
 .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: r321805 - head/sys/kern

2017-07-31 Thread Mark Johnston
Author: markj
Date: Mon Jul 31 18:48:58 2017
New Revision: 321805
URL: https://svnweb.freebsd.org/changeset/base/321805

Log:
  Batch v_wire_count decrements in vm_hold_free_pages().
  
  Atomic updates to v_wire_count are a significant source of contention, so
  combine multiple updates into one in this easy case. Also remove an old
  printf that gets executed if the page is shared-busied, which is a case
  that will lead to a panic anyway.
  
  Reviewed by:  alc, kib
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D11791

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Mon Jul 31 18:10:10 2017(r321804)
+++ head/sys/kern/vfs_bio.c Mon Jul 31 18:48:58 2017(r321805)
@@ -4532,13 +4532,10 @@ vm_hold_free_pages(struct buf *bp, int newbsize)
for (index = newnpages; index < bp->b_npages; index++) {
p = bp->b_pages[index];
bp->b_pages[index] = NULL;
-   if (vm_page_sbusied(p))
-   printf("vm_hold_free_pages: blkno: %jd, lblkno: %jd\n",
-   (intmax_t)bp->b_blkno, (intmax_t)bp->b_lblkno);
p->wire_count--;
vm_page_free(p);
-   atomic_subtract_int(_cnt.v_wire_count, 1);
}
+   atomic_subtract_int(_cnt.v_wire_count, bp->b_npages - newnpages);
bp->b_npages = newnpages;
 }
 
___
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: r321804 - head/usr.bin/calendar/calendars

2017-07-31 Thread Matt Joras
Author: mjoras
Date: Mon Jul 31 18:10:10 2017
New Revision: 321804
URL: https://svnweb.freebsd.org/changeset/base/321804

Log:
  Add myself to the calendar.
  
  Reported by:  mckusick
  Approved by:  rstone (mentor)
  Differential Revision:https://reviews.freebsd.org/D11797

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 17:57:54 
2017(r321803)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 18:10:10 
2017(r321804)
@@ -374,6 +374,7 @@
 11/15  Lars Engels  born in Hilden, Nordrhein-Westfalen, 
Germany, 1980
 11/15  Tijl Coosemans  born in Duffel, Belgium, 1983
 11/16  Jose Maria Alcaide Salinas  born in Madrid, Spain, 
1962
+11/16  Matt Joras  born in Evanston, Illinois, United 
States, 1992
 11/17  Ralf S. Engelschall  born in Dachau, Bavaria, 
Germany, 1972
 11/18  Thomas Quinot  born in Paris, France, 1977
 11/19  Konstantin Belousov  born in Kiev, USSR, 1972
___
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: r321802 - head/usr.bin/calendar/calendars

2017-07-31 Thread Eric Joyner
Author: erj
Date: Mon Jul 31 17:57:44 2017
New Revision: 321802
URL: https://svnweb.freebsd.org/changeset/base/321802

Log:
  Add myself to calendar.freebsd
  
  Reported by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 17:49:47 
2017(r321801)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 17:57:44 
2017(r321802)
@@ -309,6 +309,7 @@
 09/05  Mark Robert Vaughan Murray  born in Harare, 
Mashonaland, Zimbabwe, 1961
 09/05  Adrian Harold Chadd  born in Perth, Western 
Australia, Australia, 1979
 09/05  Rodrigo Osorio  born in Montevideo, Uruguay, 1975
+09/06  Eric Joyner  born in Fairfax, Virginia, United 
States, 1991
 09/07  Tim Bishop  born in Cornwall, United Kingdom, 1978
 09/07  Chris Rees  born in Kettering, United Kingdom, 1987
 09/08  Boris Samorodov  born in Krasnodar, Russian 
Federation, 1963
___
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: r321803 - head/sys/x86/x86

2017-07-31 Thread Mark Johnston
Author: markj
Date: Mon Jul 31 17:57:54 2017
New Revision: 321803
URL: https://svnweb.freebsd.org/changeset/base/321803

Log:
  Don't trace running threads that have interrupts disabled.
  
  In this case we shouldn't assume that the thread has a valid frame pointer.
  
  Reviewed by:  kib
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D11787

Modified:
  head/sys/x86/x86/stack_machdep.c

Modified: head/sys/x86/x86/stack_machdep.c
==
--- head/sys/x86/x86/stack_machdep.cMon Jul 31 17:57:44 2017
(r321802)
+++ head/sys/x86/x86/stack_machdep.cMon Jul 31 17:57:54 2017
(r321803)
@@ -49,12 +49,14 @@ __FBSDID("$FreeBSD$");
 
 #ifdef __i386__
 #definePCB_FP(pcb) ((pcb)->pcb_ebp)
+#defineTF_FLAGS(tf)((tf)->tf_eflags)
 #defineTF_FP(tf)   ((tf)->tf_ebp)
 #defineTF_PC(tf)   ((tf)->tf_eip)
 
 typedef struct i386_frame *x86_frame_t;
 #else
 #definePCB_FP(pcb) ((pcb)->pcb_rbp)
+#defineTF_FLAGS(tf)((tf)->tf_rflags)
 #defineTF_FP(tf)   ((tf)->tf_rbp)
 #defineTF_PC(tf)   ((tf)->tf_rip)
 
@@ -104,10 +106,10 @@ stack_nmi_handler(struct trapframe *tf)
if (nmi_stack == NULL || curthread != nmi_pending)
return (0);
 
-   if (INKERNEL(TF_PC(tf)))
+   if (INKERNEL(TF_PC(tf)) && (TF_FLAGS(tf) & PSL_I) != 0)
stack_capture(curthread, nmi_stack, TF_FP(tf));
else
-   /* We interrupted a thread in user mode. */
+   /* We were running in usermode or had interrupts disabled. */
nmi_stack->depth = 0;
 
atomic_store_rel_ptr((long *)_pending, (long)NULL);
@@ -155,7 +157,6 @@ stack_save_td_running(struct stack *st, struct thread 
mtx_unlock_spin(_lock);
 
if (st->depth == 0)
-   /* We interrupted a thread in user mode. */
return (EAGAIN);
 #else /* !SMP */
KASSERT(0, ("curthread isn't running"));
___
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: r321801 - head/usr.bin/calendar/calendars

2017-07-31 Thread Dru Lavigne
Author: dru (doc committer)
Date: Mon Jul 31 17:49:47 2017
New Revision: 321801
URL: https://svnweb.freebsd.org/changeset/base/321801

Log:
  Add myself to calendar.

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 17:33:57 
2017(r321800)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 17:49:47 
2017(r321801)
@@ -254,6 +254,7 @@
 07/19  Masafumi NAKANE  born in Okazaki, Aichi, Japan, 1972
 07/19  Simon L. Nielsen  born in Copenhagen, Denmark, 1980
 07/19  Gleb Smirnoff  born in Kharkov, USSR, 1981
+07/20  Dru Lavigne  born in Kingston, Ontario, Canada, 1965
 07/20  Andrey V. Elsukov  born in Kotelnich, Russian 
Federation, 1981
 07/22  James Housley  born in Chicago, Illinois, United 
States, 1965
 07/22  Jens Schweikhardt  born in Waiblingen, 
Baden-Wuerttemberg, Germany, 1967
___
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: r321800 - head/tools/tools/net80211/wlanwds

2017-07-31 Thread Adrian Chadd
Author: adrian
Date: Mon Jul 31 17:33:57 2017
New Revision: 321800
URL: https://svnweb.freebsd.org/changeset/base/321800

Log:
  [wlanwds] allow for a DWDS AP VAP to be not be the first VAP on a NIC.
  
  The wlanwds code was just creating a clone VAP without specifying the MAC
  address to use for said clone VAP.  This meant that if an interface
  was cloned from an AP interface that wasn't the first created VAP
  (which shares the same MAC as the parent physical interface by default)
  then the cloned interface would have the wrong MAC and traffic wouldn't work.
  
  Besides chip bugs (ha!) this isn't a requirement.
  
  So, teach wlanwds to:
  
  * look up the link layer address for a given interface (which really should
be a library interface, and will likely quickly become one);
  * use this when creating a cloned interface for a DWDS peer;
  * (net80211 already has the infrastructure to do this, it just needed to be
used);
  * add some extra logging to see what MAC addresses, parent interfaces, etc
are being created.
  
  Whilst here, add a reminder that I should extend this to include monitoring
  a specific VAP for DWDS updates rather than just the parent interface.
  
  This is the first step in allowing for multiple DWDS hops, which is a
  pre-requisite for adrian's house having wifi in the single upstairs room.
  
  Tested:
  
  * AR9380, DWDS AP + AP mode - with DWDS AP being the second VAP created
with a different MAC address;
  * AR9331 (Carambola2), AP + DWDS STA;
  * passing traffic
  
  TODO:
  
  * fix 802.11s so this DWDS stuff is no longer required!

Modified:
  head/tools/tools/net80211/wlanwds/wlanwds.c

Modified: head/tools/tools/net80211/wlanwds/wlanwds.c
==
--- head/tools/tools/net80211/wlanwds/wlanwds.c Mon Jul 31 16:55:56 2017
(r321799)
+++ head/tools/tools/net80211/wlanwds/wlanwds.c Mon Jul 31 17:33:57 2017
(r321800)
@@ -55,6 +55,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -90,7 +93,8 @@ staticvoid wds_discovery(const char *ifname,
const uint8_t bssid[IEEE80211_ADDR_LEN]);
 static void wds_destroy(const char *ifname);
 static void wds_leave(const uint8_t bssid[IEEE80211_ADDR_LEN]);
-static int wds_vap_create(const char *ifname, struct wds *);
+static int wds_vap_create(const char *ifname, uint8_t macaddr[ETHER_ADDR_LEN],
+   struct wds *);
 static int wds_vap_destroy(const char *ifname);
 
 static void
@@ -201,6 +205,11 @@ getparent(const char *ifname, char parent[IFNAMSIZ+1])
  * Check if the specified ifnet is one we're supposed to monitor.
  * The ifnet is assumed to be a vap; we find it's parent and check
  * it against the set of ifnet's specified on the command line.
+ *
+ * TODO: extend this to also optionally allow the specific DWDS
+ * VAP to be monitored, instead of assuming all VAPs on a parent
+ * physical interface are being monitored by this instance of
+ * wlanwds.
  */
 static int
 checkifnet(const char *ifname, int complain)
@@ -257,6 +266,70 @@ getbssid(int s, const char *ifname, uint8_t bssid[IEEE
 }
 
 /*
+ * Fetch the mac address configured for a given ifnet.
+ * (Note - the current link level address, NOT hwaddr.)
+ *
+ * This is currently, sigh, O(n) because there's no current kernel
+ * API that will do it for a single interface.
+ *
+ * Return 0 if successful, -1 if failure.
+ */
+static int
+getlladdr(const char *ifname, uint8_t macaddr[ETHER_ADDR_LEN])
+{
+   struct ifaddrs *ifap, *ifa;
+   struct sockaddr_dl *sdl;
+
+   if (getifaddrs() < 0) {
+   warn("%s: getifaddrs", __func__);
+   return (-1);
+   }
+
+   /* Look for a matching interface */
+   for (ifa = ifap; ifa != NULL; ifa++) {
+   if (strcmp(ifname, ifa->ifa_name) != 0)
+   continue;
+
+   /* Found it - check if there's an ifa_addr */
+   if (ifa->ifa_addr == NULL) {
+   syslog(LOG_CRIT, "%s: ifname %s; ifa_addr is NULL\n",
+   __func__, ifname);
+   goto err;
+   }
+
+   /* Check address family */
+   sdl = (struct sockaddr_dl *) ifa->ifa_addr;
+   if (sdl->sdl_type != IFT_ETHER) {
+   syslog(LOG_CRIT, "%s: %s: unknown aftype (%d)\n",
+   __func__,
+   ifname,
+   sdl->sdl_type);
+   goto err;
+   }
+   if (sdl->sdl_alen != ETHER_ADDR_LEN) {
+   syslog(LOG_CRIT, "%s: %s: aflen too short (%d)\n",
+   __func__,
+   ifname,
+   sdl->sdl_alen);
+   goto err;
+   }
+
+   /* Ok, found it */
+   memcpy(macaddr, (void *) 

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

2017-07-31 Thread Scott Long
Author: scottl
Date: Mon Jul 31 16:55:56 2017
New Revision: 321799
URL: https://svnweb.freebsd.org/changeset/base/321799

Log:
  Fix a logic bug in the split PCI interrupt code that slipped through
  
  Reported by:  Harry Schmalzbauer

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

Modified: head/sys/dev/mpr/mpr_pci.c
==
--- head/sys/dev/mpr/mpr_pci.c  Mon Jul 31 16:46:16 2017(r321798)
+++ head/sys/dev/mpr/mpr_pci.c  Mon Jul 31 16:55:56 2017(r321799)
@@ -260,6 +260,7 @@ mpr_pci_alloc_interrupts(struct mpr_softc *sc)
 
dev = sc->mpr_dev;
error = 0;
+   msgs = 0;
 
if ((sc->disable_msix == 0) &&
((msgs = pci_msix_count(dev)) >= MPR_MSI_COUNT))
@@ -267,7 +268,7 @@ mpr_pci_alloc_interrupts(struct mpr_softc *sc)
if ((error != 0) && (sc->disable_msi == 0) &&
((msgs = pci_msi_count(dev)) >= MPR_MSI_COUNT))
error = mpr_alloc_msi(sc, MPR_MSI_COUNT);
-   else
+   if (error != 0)
msgs = 0;
 
sc->msi_msgs = msgs;

Modified: head/sys/dev/mps/mps_pci.c
==
--- head/sys/dev/mps/mps_pci.c  Mon Jul 31 16:46:16 2017(r321798)
+++ head/sys/dev/mps/mps_pci.c  Mon Jul 31 16:55:56 2017(r321799)
@@ -245,6 +245,7 @@ mps_pci_alloc_interrupts(struct mps_softc *sc)
 
dev = sc->mps_dev;
error = 0;
+   msgs = 0;
 
if ((sc->disable_msix == 0) &&
((msgs = pci_msix_count(dev)) >= MPS_MSI_COUNT))
@@ -252,7 +253,7 @@ mps_pci_alloc_interrupts(struct mps_softc *sc)
if ((error != 0) && (sc->disable_msi == 0) &&
((msgs = pci_msi_count(dev)) >= MPS_MSI_COUNT))
error = mps_alloc_msi(sc, MPS_MSI_COUNT);
-   else
+   if (error != 0)
msgs = 0;
 
sc->msi_msgs = msgs;
___
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: r321798 - head/sys/dev/iicbus

2017-07-31 Thread Ian Lepore
Author: ian
Date: Mon Jul 31 16:46:16 2017
New Revision: 321798
URL: https://svnweb.freebsd.org/changeset/base/321798

Log:
  Restore a few rather important lines of code that got fumbled in r321746.

Modified:
  head/sys/dev/iicbus/ds1307.c

Modified: head/sys/dev/iicbus/ds1307.c
==
--- head/sys/dev/iicbus/ds1307.cMon Jul 31 15:50:58 2017
(r321797)
+++ head/sys/dev/iicbus/ds1307.cMon Jul 31 16:46:16 2017
(r321798)
@@ -380,6 +380,10 @@ ds1307_settime(device_t dev, struct timespec *ts)
} else
pmflags = 0;
 
+   getnanotime(ts);
+   ts->tv_sec -= utc_offset();
+   clock_ts_to_ct(ts, );
+
data[DS1307_SECS]= TOBCD(ct.sec);
data[DS1307_MINS]= TOBCD(ct.min);
data[DS1307_HOUR]= TOBCD(ct.hour) | pmflags;
___
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: r321797 - head/usr.bin/calendar/calendars

2017-07-31 Thread Scott Long
Author: scottl
Date: Mon Jul 31 15:50:58 2017
New Revision: 321797
URL: https://svnweb.freebsd.org/changeset/base/321797

Log:
  Add an entry to the freebsd calendar for myself.
  
  Reported by:  kirk

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 15:29:44 
2017(r321796)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 15:50:58 
2017(r321797)
@@ -290,6 +290,7 @@
 08/24  Alexander Botero-Lowry  died in San Francisco, 
California, United States, 2012
 08/25  Beech Rintoul  born in Oakland, California, United 
States, 1952
 08/25  Jean Milanez Melo  born in Divinopolis, Minas 
Gerais, Brazil, 1982
+08/26  Scott Long  born in Chicago, Illinois, United 
States, 1974
 08/26  Dima Ruban  born in Nalchik, USSR, 1970
 08/26  Marc Fonvieille  born in Avignon, France, 1972
 08/26  Herve Quiroz  born in Aix-en-Provence, France, 1977
___
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: r321796 - head/usr.bin/calendar/calendars

2017-07-31 Thread Jamie Gritton
Author: jamie
Date: Mon Jul 31 15:29:44 2017
New Revision: 321796
URL: https://svnweb.freebsd.org/changeset/base/321796

Log:
  Add myself to the birthday calendar.
  
  Reminded by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 15:24:40 
2017(r321795)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 15:29:44 
2017(r321796)
@@ -180,6 +180,7 @@
 05/19  Sofian Brabez  born in Toulouse, France, 1984
 05/20  Dan Moschuk  died in Burlington, Ontario, Canada, 2010
 05/21  Kris Kennaway  born in Winnipeg, Manitoba, Canada, 
1978
+05/22  James Gritton  born in San Francisco, California, 
United States, 1967
 05/22  Clive Tong-I Lin  born in Changhua, Taiwan, Republic 
of China, 1978
 05/22  Michael Bushkov  born in Rostov-on-Don, Russian 
Federation, 1985
 05/22  Rui Paulo  born in Evora, Portugal, 1986
___
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: r321795 - head/sys/dev/iicbus

2017-07-31 Thread Ian Lepore
Author: ian
Date: Mon Jul 31 15:24:40 2017
New Revision: 321795
URL: https://svnweb.freebsd.org/changeset/base/321795

Log:
  Check the clock-halted flag every time the clock is read, not just once
  at startup.  The flag stays set until the clock is loaded with good time,
  so we need to keep saying the time is invalid until that happens.

Modified:
  head/sys/dev/iicbus/ds1307.c

Modified: head/sys/dev/iicbus/ds1307.c
==
--- head/sys/dev/iicbus/ds1307.cMon Jul 31 15:23:19 2017
(r321794)
+++ head/sys/dev/iicbus/ds1307.cMon Jul 31 15:24:40 2017
(r321795)
@@ -328,6 +328,10 @@ ds1307_gettime(device_t dev, struct timespec *ts)
return (error);
}
 
+   /* If the clock halted, we don't have good data. */
+   if (data[DS1307_SECS] & DS1307_SECS_CH)
+   return (EINVAL);
+
/* If chip is in AM/PM mode remember that. */
if (data[DS1307_HOUR] & DS1307_HOUR_USE_AMPM) {
sc->sc_use_ampm = true;
___
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: r321794 - in head/sys: fs/nfsserver nfs

2017-07-31 Thread Alexander Motin
Author: mav
Date: Mon Jul 31 15:23:19 2017
New Revision: 321794
URL: https://svnweb.freebsd.org/changeset/base/321794

Log:
  Improve FHA locality control for NFS read/write requests.
  
  This change adds two new tunables, allowing to control serialization for
  read and write NFS requests separately.  It does not change the default
  behavior since there are too many factors to consider, but gives additional
  space for further experiments and tuning.
  
  The main motivation for this change is very low write speed in case of ZFS
  with sync=always or when NFS clients requests sychronous operation, when
  every separate request has to be written/flushed to ZIL, and requests are
  processed one at a time.  Setting vfs.nfsd.fha.write=0 in that case allows
  to increase ZIL throughput by several times by coalescing writes and cache
  flushes.  There is a worry that doing it may increase data fragmentation
  on disks, but I suppose it should not happen for pool with SLOG.
  
  MFC after:1 week
  Sponsored by: iXsystems, Inc.

Modified:
  head/sys/fs/nfsserver/nfs_fha_new.c
  head/sys/nfs/nfs_fha.c
  head/sys/nfs/nfs_fha.h

Modified: head/sys/fs/nfsserver/nfs_fha_new.c
==
--- head/sys/fs/nfsserver/nfs_fha_new.c Mon Jul 31 15:21:26 2017
(r321793)
+++ head/sys/fs/nfsserver/nfs_fha_new.c Mon Jul 31 15:23:19 2017
(r321794)
@@ -93,7 +93,7 @@ fhanew_init(void *foo)
sysctl_ctx_init(>sysctl_ctx);
softc->sysctl_tree = SYSCTL_ADD_NODE(>sysctl_ctx,
SYSCTL_STATIC_CHILDREN(_vfs_nfsd), OID_AUTO, "fha", CTLFLAG_RD,
-   0, "fha node");
+   0, "NFS File Handle Affinity (FHA)");
if (softc->sysctl_tree == NULL) {
printf("%s: unable to allocate sysctl tree\n", __func__);
return;

Modified: head/sys/nfs/nfs_fha.c
==
--- head/sys/nfs/nfs_fha.c  Mon Jul 31 15:21:26 2017(r321793)
+++ head/sys/nfs/nfs_fha.c  Mon Jul 31 15:23:19 2017(r321794)
@@ -51,7 +51,6 @@ static MALLOC_DEFINE(M_NFS_FHA, "NFS FHA", "NFS FHA");
 void
 fha_init(struct fha_params *softc)
 {
-   char tmpstr[128];
int i;
 
for (i = 0; i < FHA_HASH_SIZE; i++)
@@ -61,47 +60,38 @@ fha_init(struct fha_params *softc)
 * Set the default tuning parameters.
 */
softc->ctls.enable = FHA_DEF_ENABLE;
+   softc->ctls.read = FHA_DEF_READ;
+   softc->ctls.write = FHA_DEF_WRITE;
softc->ctls.bin_shift = FHA_DEF_BIN_SHIFT;
softc->ctls.max_nfsds_per_fh = FHA_DEF_MAX_NFSDS_PER_FH;
softc->ctls.max_reqs_per_nfsd = FHA_DEF_MAX_REQS_PER_NFSD;
 
/*
-* Allow the user to override the defaults at boot time with
-* tunables.
+* Add sysctls so the user can change the tuning parameters.
 */
-   snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.enable",
-   softc->server_name);
-   TUNABLE_INT_FETCH(tmpstr, >ctls.enable);
-   snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.bin_shift",
-   softc->server_name);
-   TUNABLE_INT_FETCH(tmpstr, >ctls.bin_shift);
-   snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.max_nfsds_per_fh",
-   softc->server_name);
-   TUNABLE_INT_FETCH(tmpstr, >ctls.max_nfsds_per_fh);
-   snprintf(tmpstr, sizeof(tmpstr), "vfs.%s.fha.max_reqs_per_nfsd",
-   softc->server_name);
-   TUNABLE_INT_FETCH(tmpstr, >ctls.max_reqs_per_nfsd);
-
-   /*
-* Add sysctls so the user can change the tuning parameters at
-* runtime.
-*/
SYSCTL_ADD_UINT(>sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
-   OID_AUTO, "enable", CTLFLAG_RW,
+   OID_AUTO, "enable", CTLFLAG_RWTUN,
>ctls.enable, 0, "Enable NFS File Handle Affinity (FHA)");
 
SYSCTL_ADD_UINT(>sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
-   OID_AUTO, "bin_shift", CTLFLAG_RW,
-   >ctls.bin_shift, 0, "For FHA reads, no two requests will "
-   "contend if they're 2^(bin_shift) bytes apart");
+   OID_AUTO, "read", CTLFLAG_RWTUN,
+   >ctls.read, 0, "Enable NFS FHA read locality");
 
SYSCTL_ADD_UINT(>sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
-   OID_AUTO, "max_nfsds_per_fh", CTLFLAG_RW,
+   OID_AUTO, "write", CTLFLAG_RWTUN,
+   >ctls.write, 0, "Enable NFS FHA write locality");
+
+   SYSCTL_ADD_UINT(>sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
+   OID_AUTO, "bin_shift", CTLFLAG_RWTUN,
+   >ctls.bin_shift, 0, "Maximum locality distance 2^(bin_shift) 
bytes");
+
+   SYSCTL_ADD_UINT(>sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
+   OID_AUTO, "max_nfsds_per_fh", CTLFLAG_RWTUN,
>ctls.max_nfsds_per_fh, 0, "Maximum nfsd threads that "
"should be working on requests for the same file handle");
 
  

svn commit: r321793 - head/usr.bin/calendar/calendars

2017-07-31 Thread Alan Somers
Author: asomers
Date: Mon Jul 31 15:21:26 2017
New Revision: 321793
URL: https://svnweb.freebsd.org/changeset/base/321793

Log:
  spellcheck jhale's calendar entry

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 14:58:01 
2017(r321792)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 15:21:26 
2017(r321793)
@@ -61,7 +61,7 @@
 02/10  David Greenman  born in Portland, Oregon, United 
States, 1968
 02/10  Paul Richards  born in Ammanford, Carmarthenshire, 
United Kingdom, 1968
 02/10  Simon Barner  born in Rosenheim, Bayern, Germany, 
1980
-02/10  Jason E. Hale  born in Pittsburgh, Pennsylvania, 
Unites States, 1982
+02/10  Jason E. Hale  born in Pittsburgh, Pennsylvania, 
United States, 1982
 02/13  Jesper Skriver  born in Aarhus, Denmark, 1975
 02/13  Steve Wills  born in Lynchburg, Virginia, United 
States, 1975
 02/13  Andrey Slusar  born in Odessa, USSR, 1979
___
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: r321792 - head/sys/dev/iicbus

2017-07-31 Thread Ian Lepore
Author: ian
Date: Mon Jul 31 14:58:01 2017
New Revision: 321792
URL: https://svnweb.freebsd.org/changeset/base/321792

Log:
  Add a detach() method.

Modified:
  head/sys/dev/iicbus/ds1307.c

Modified: head/sys/dev/iicbus/ds1307.c
==
--- head/sys/dev/iicbus/ds1307.cMon Jul 31 14:57:02 2017
(r321791)
+++ head/sys/dev/iicbus/ds1307.cMon Jul 31 14:58:01 2017
(r321792)
@@ -78,14 +78,14 @@ static int
 ds1307_read1(device_t dev, uint8_t reg, uint8_t *data)
 {
 
-   return(iicdev_readfrom(dev, reg, data, 1, IIC_INTRWAIT));
+   return (iicdev_readfrom(dev, reg, data, 1, IIC_INTRWAIT));
 }
 
 static int
 ds1307_write1(device_t dev, uint8_t reg, uint8_t data)
 {
 
-   return(iicdev_writeto(dev, reg, , 1, IIC_INTRWAIT));
+   return (iicdev_writeto(dev, reg, , 1, IIC_INTRWAIT));
 }
 
 static int
@@ -255,6 +255,14 @@ ds1307_attach(device_t dev)
return (0);
 }
 
+static int
+ds1307_detach(device_t dev)
+{
+
+   clock_unregister(dev);
+   return (0);
+}
+
 static void
 ds1307_start(void *xdev)
 {
@@ -387,6 +395,7 @@ ds1307_settime(device_t dev, struct timespec *ts)
 static device_method_t ds1307_methods[] = {
DEVMETHOD(device_probe, ds1307_probe),
DEVMETHOD(device_attach,ds1307_attach),
+   DEVMETHOD(device_detach,ds1307_detach),
 
DEVMETHOD(clock_gettime,ds1307_gettime),
DEVMETHOD(clock_settime,ds1307_settime),
___
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: r321791 - head/sys/dev/iicbus

2017-07-31 Thread Ian Lepore
Author: ian
Date: Mon Jul 31 14:57:02 2017
New Revision: 321791
URL: https://svnweb.freebsd.org/changeset/base/321791

Log:
  Switch from using iic_transfer() to iicdev_readfrom/writeto(), mostly so
  that transfers will be done with proper ownership of the bus. No
  behavioral changes.  Also add a detach() method.

Modified:
  head/sys/dev/iicbus/ds3231.c

Modified: head/sys/dev/iicbus/ds3231.c
==
--- head/sys/dev/iicbus/ds3231.cMon Jul 31 14:56:35 2017
(r321790)
+++ head/sys/dev/iicbus/ds3231.cMon Jul 31 14:57:02 2017
(r321791)
@@ -67,24 +67,17 @@ struct ds3231_softc {
 static void ds3231_start(void *);
 
 static int
-ds3231_read(device_t dev, uint16_t addr, uint8_t reg, uint8_t *data, size_t 
len)
+ds3231_read1(device_t dev, uint8_t reg, uint8_t *data)
 {
-   struct iic_msg msg[2] = {
-   { addr, IIC_M_WR | IIC_M_NOSTOP, 1,  },
-   { addr, IIC_M_RD, len, data },
-   };
 
-   return (iicbus_transfer(dev, msg, nitems(msg)));
+   return (iicdev_readfrom(dev, reg, data, 1, IIC_INTRWAIT));
 }
 
 static int
-ds3231_write(device_t dev, uint16_t addr, uint8_t *data, size_t len)
+ds3231_write1(device_t dev, uint8_t reg, uint8_t data)
 {
-   struct iic_msg msg[1] = {
-   { addr, IIC_M_WR, len, data },
-   };
 
-   return (iicbus_transfer(dev, msg, nitems(msg)));
+   return (iicdev_writeto(dev, reg, , 1, IIC_INTRWAIT));
 }
 
 static int
@@ -92,14 +85,11 @@ ds3231_ctrl_read(struct ds3231_softc *sc)
 {
int error;
 
-   sc->sc_ctrl = 0;
-   error = ds3231_read(sc->sc_dev, sc->sc_addr, DS3231_CONTROL,
-   >sc_ctrl, sizeof(sc->sc_ctrl));
+   error = ds3231_read1(sc->sc_dev, DS3231_CONTROL, >sc_ctrl);
if (error) {
device_printf(sc->sc_dev, "cannot read from RTC.\n");
return (error);
}
-
return (0);
 }
 
@@ -107,12 +97,11 @@ static int
 ds3231_ctrl_write(struct ds3231_softc *sc)
 {
int error;
-   uint8_t data[2];
+   uint8_t data;
 
-   data[0] = DS3231_CONTROL;
/* Always enable the oscillator.  Always disable both alarms. */
-   data[1] = sc->sc_ctrl & ~DS3231_CTRL_MASK;
-   error = ds3231_write(sc->sc_dev, sc->sc_addr, data, sizeof(data));
+   data = sc->sc_ctrl & ~DS3231_CTRL_MASK;
+   error = ds3231_write1(sc->sc_dev, DS3231_CONTROL, data);
if (error != 0)
device_printf(sc->sc_dev, "cannot write to RTC.\n");
 
@@ -124,9 +113,7 @@ ds3231_status_read(struct ds3231_softc *sc)
 {
int error;
 
-   sc->sc_status = 0;
-   error = ds3231_read(sc->sc_dev, sc->sc_addr, DS3231_STATUS,
-   >sc_status, sizeof(sc->sc_status));
+   error = ds3231_read1(sc->sc_dev, DS3231_STATUS, >sc_status);
if (error) {
device_printf(sc->sc_dev, "cannot read from RTC.\n");
return (error);
@@ -139,15 +126,14 @@ static int
 ds3231_status_write(struct ds3231_softc *sc, int clear_a1, int clear_a2)
 {
int error;
-   uint8_t data[2];
+   uint8_t data;
 
-   data[0] = DS3231_STATUS;
-   data[1] = sc->sc_status;
+   data = sc->sc_status;
if (clear_a1 == 0)
-   data[1] |= DS3231_STATUS_A1F;
+   data |= DS3231_STATUS_A1F;
if (clear_a2 == 0)
-   data[1] |= DS3231_STATUS_A2F;
-   error = ds3231_write(sc->sc_dev, sc->sc_addr, data, sizeof(data));
+   data |= DS3231_STATUS_A2F;
+   error = ds3231_write1(sc->sc_dev, DS3231_STATUS, data);
if (error != 0)
device_printf(sc->sc_dev, "cannot write to RTC.\n");
 
@@ -158,18 +144,15 @@ static int
 ds3231_set_24hrs_mode(struct ds3231_softc *sc)
 {
int error;
-   uint8_t data[2], hour;
+   uint8_t hour;
 
-   hour = 0;
-   error = ds3231_read(sc->sc_dev, sc->sc_addr, DS3231_HOUR,
-   , sizeof(hour));
+   error = ds3231_read1(sc->sc_dev, DS3231_HOUR, );
if (error) {
device_printf(sc->sc_dev, "cannot read from RTC.\n");
return (error);
}
-   data[0] = DS3231_HOUR;
-   data[1] = hour & ~DS3231_C_MASK;
-   error = ds3231_write(sc->sc_dev, sc->sc_addr, data, sizeof(data));
+   hour &= ~DS3231_C_MASK;
+   error = ds3231_write1(sc->sc_dev, DS3231_HOUR, hour);
if (error != 0)
device_printf(sc->sc_dev, "cannot write to RTC.\n");
 
@@ -183,8 +166,8 @@ ds3231_temp_read(struct ds3231_softc *sc, int *temp)
uint8_t buf8[2];
uint16_t buf;
 
-   error = ds3231_read(sc->sc_dev, sc->sc_addr, DS3231_TEMP,
-   buf8, sizeof(buf8));
+   error = iicdev_readfrom(sc->sc_dev, DS3231_TEMP, buf8, sizeof(buf8),
+   IIC_INTRWAIT);
if (error != 0)
return (error);
buf = (buf8[0] << 8) | (buf8[1] & 0xff);
@@ -426,6 +409,14 @@ ds3231_attach(device_t dev)
 

svn commit: r321790 - head/sbin/sysctl

2017-07-31 Thread Andrew Gallatin
Author: gallatin
Date: Mon Jul 31 14:56:35 2017
New Revision: 321790
URL: https://svnweb.freebsd.org/changeset/base/321790

Log:
  Don't request CTLTYPE_OPAQUE if we can't print them.
  
  The intent is to skip expensive opaque sysctls like tcp_pcblist unless
  they are explicitly requested. Sysctl nodes like this don't show up in
  sysctl -a, but they do generate output that winds up being dropped,
  unless the user specifically requested  binary/hex output or opaques.
  
  This reduces the runtime of sysctl in many circumstances on a loaded
  system.  It also reduces the likelihood that simply gathering
  diagnostics on a sick machine (stuck lock, etc) via sysctl -a might
  push it over the edge into a total lockup.
  
  Reviewed by:  jtl
  Sponsored by: Netflix
  Differential Revision:https://reviews.freebsd.org/D11461

Modified:
  head/sbin/sysctl/sysctl.c

Modified: head/sbin/sysctl/sysctl.c
==
--- head/sbin/sysctl/sysctl.c   Mon Jul 31 14:53:03 2017(r321789)
+++ head/sbin/sysctl/sysctl.c   Mon Jul 31 14:56:35 2017(r321790)
@@ -925,6 +925,32 @@ show_var(int *oid, int nlen)
printf("%s", buf);
return (0);
}
+
+   /* don't fetch opaques that we don't know how to print */
+   if (ctltype == CTLTYPE_OPAQUE) {
+   if (strcmp(fmt, "S,clockinfo") == 0)
+   func = S_clockinfo;
+   else if (strcmp(fmt, "S,timeval") == 0)
+   func = S_timeval;
+   else if (strcmp(fmt, "S,loadavg") == 0)
+   func = S_loadavg;
+   else if (strcmp(fmt, "S,vmtotal") == 0)
+   func = S_vmtotal;
+#ifdef __amd64__
+   else if (strcmp(fmt, "S,efi_map_header") == 0)
+   func = S_efi_map;
+#endif
+#if defined(__amd64__) || defined(__i386__)
+   else if (strcmp(fmt, "S,bios_smap_xattr") == 0)
+   func = S_bios_smap_xattr;
+#endif
+   else {
+   func = NULL;
+   if (!bflag && !oflag && !xflag)
+   return (1);
+   }
+   }
+
/* find an estimate of how much we need for this var */
if (Bflag)
j = Bflag;
@@ -1045,24 +1071,6 @@ show_var(int *oid, int nlen)
 
case CTLTYPE_OPAQUE:
i = 0;
-   if (strcmp(fmt, "S,clockinfo") == 0)
-   func = S_clockinfo;
-   else if (strcmp(fmt, "S,timeval") == 0)
-   func = S_timeval;
-   else if (strcmp(fmt, "S,loadavg") == 0)
-   func = S_loadavg;
-   else if (strcmp(fmt, "S,vmtotal") == 0)
-   func = S_vmtotal;
-#ifdef __amd64__
-   else if (strcmp(fmt, "S,efi_map_header") == 0)
-   func = S_efi_map;
-#endif
-#if defined(__amd64__) || defined(__i386__)
-   else if (strcmp(fmt, "S,bios_smap_xattr") == 0)
-   func = S_bios_smap_xattr;
-#endif
-   else
-   func = NULL;
if (func) {
if (!nflag)
printf("%s%s", name, sep);
___
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: r321789 - head/usr.bin/calendar/calendars

2017-07-31 Thread Takahashi Yoshihiro
Author: nyan
Date: Mon Jul 31 14:53:03 2017
New Revision: 321789
URL: https://svnweb.freebsd.org/changeset/base/321789

Log:
  Add myself.
  
  Reminded by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 14:50:42 
2017(r321788)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 14:53:03 
2017(r321789)
@@ -53,6 +53,7 @@
 02/02  Michael W Lucas  born in Detroit, Michigan, United 
States, 1967
 02/02  Dmitry Chagin  born in Stalingrad, USSR, 1976
 02/02  Yoichi Nakayama  born in Tsu, Mie, Japan, 1976
+02/02  Yoshihiro Takahashi  born in Yokohama, Kanagawa, 
Japan, 1976
 02/03  Jason Helfman  born in Royal Oak, Michigan, United 
States, 1972
 02/04  Eitan Adler  born in West Hempstead, New York, 
United States, 1991
 02/05  Frank Laszlo  born in Howell, Michigan, United 
States, 1983
___
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: r321788 - head/usr.bin/calendar/calendars

2017-07-31 Thread Alan Somers
Author: asomers
Date: Mon Jul 31 14:50:42 2017
New Revision: 321788
URL: https://svnweb.freebsd.org/changeset/base/321788

Log:
  Add myself to the calendar
  
  Reported by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 14:49:44 
2017(r321787)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 14:50:42 
2017(r321788)
@@ -320,6 +320,7 @@
 09/18  Matthew Fleming  born in Cleveland, Ohio, United 
States, 1975
 09/20  Kevin Lo  born in Taipei, Taiwan, Republic of China, 
1972
 09/21  Gleb Kurtsou  born in Minsk, Belarus, 1984
+09/22  Alan Somers  born in San Antonio, Texas, United 
States, 1982
 09/22  Bryan Drewery  born in San Diego, California, 
United States, 1984
 09/23  Martin Matuska  born in Bratislava, Slovakia, 1979
 09/24  Larry Rosenman  born in Queens, New York, United 
States, 1957
___
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: r321787 - head/usr.bin/calendar/calendars

2017-07-31 Thread Martin Matuska
Author: mm
Date: Mon Jul 31 14:49:44 2017
New Revision: 321787
URL: https://svnweb.freebsd.org/changeset/base/321787

Log:
  Add myself to the calendar
  
  Reminded by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 14:42:38 
2017(r321786)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 14:49:44 
2017(r321787)
@@ -321,6 +321,7 @@
 09/20  Kevin Lo  born in Taipei, Taiwan, Republic of China, 
1972
 09/21  Gleb Kurtsou  born in Minsk, Belarus, 1984
 09/22  Bryan Drewery  born in San Diego, California, 
United States, 1984
+09/23  Martin Matuska  born in Bratislava, Slovakia, 1979
 09/24  Larry Rosenman  born in Queens, New York, United 
States, 1957
 09/27  Neil Blakey-Milner  born in Port Elizabeth, South 
Africa, 1978
 09/27  Renato Botelho  born in Araras, Sao Paulo, Brazil, 
1979
___
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: r321786 - head/usr.bin/calendar/calendars

2017-07-31 Thread Ravi Pokala
Author: rpokala
Date: Mon Jul 31 14:42:38 2017
New Revision: 321786
URL: https://svnweb.freebsd.org/changeset/base/321786

Log:
  Add my birthday to the FreeBSD calendar
  
  Requested by: mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 14:16:35 
2017(r321785)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 14:42:38 
2017(r321786)
@@ -210,6 +210,7 @@
 06/06  Alan Eldridge  died in Denver, Colorado, 2003
 06/07  Jimmy Olgeni  born in Milano, Italy, 1976
 06/07  Benjamin Close  born in Adelaide, Australia, 1978
+06/08  Ravi Pokala  born in Royal Oak, Michigan, United 
States, 1980
 06/09  Stanislav Galabov  born in Sofia, Bulgaria 1978
 06/11  Alonso Cardenas Marquez  born in Arequipa, Peru, 1979
 06/14  Josh Paetzel  born in Minneapolis, Minnesota, 
United States, 1973
___
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: r321785 - head/usr.bin/calendar/calendars

2017-07-31 Thread Justin Hibbits
Author: jhibbits
Date: Mon Jul 31 14:16:35 2017
New Revision: 321785
URL: https://svnweb.freebsd.org/changeset/base/321785

Log:
  Add myself to the calendar
  
  Reminded by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 13:32:35 
2017(r321784)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 14:16:35 
2017(r321785)
@@ -69,6 +69,7 @@
 02/14  Erwin Lansing  born in 's-Hertogenbosch, the 
Netherlands, 1975
 02/14  Martin Blapp  born in Olten, Switzerland, 1976
 02/15  Hiren Panchasara  born in Ahmedabad, Gujarat, India, 
1984
+02/16  Justin Hibbits  born in Toledo, Ohio, United 
States, 1983
 02/19  Murray Stokely  born in Jacksonville, Florida, 
United States, 1979
 02/20  Anders Nordby  born in Oslo, Norway, 1976
 02/21  Alexey Zelkin  born in Simferopol, Ukraine, 1978
___
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: r321784 - head/usr.bin/calendar/calendars

2017-07-31 Thread Wen Heping
Author: wen (ports committer)
Date: Mon Jul 31 13:32:35 2017
New Revision: 321784
URL: https://svnweb.freebsd.org/changeset/base/321784

Log:
  add myself to calendar.freebsd

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 13:08:47 
2017(r321783)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 13:32:35 
2017(r321784)
@@ -192,6 +192,7 @@
 05/27  Ollivier Robert  born in Paris, France, 1967
 05/29  Wilko Bulte  born in Arnhem, the Netherlands, 1965
 05/29  Seigo Tanimura  born in Kitakyushu, Fukuoka, 
Japan, 1976
+05/30   Wen Heping  born in Xiangxiang, Hunan, China, 1970
 05/31  Ville Skytta  born in Helsinki, Finland, 1974
 06/02  Jean-Marc Zucconi  born in Pontarlier, France, 1954
 06/02  Alexander Botero-Lowry  born in Austin, Texas, 
United States, 1986
___
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: r321783 - head/usr.bin/calendar/calendars

2017-07-31 Thread Nikolai Lifanov
Author: lifanov (ports committer)
Date: Mon Jul 31 13:08:47 2017
New Revision: 321783
URL: https://svnweb.freebsd.org/changeset/base/321783

Log:
  add myself to calendar.freebsd

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 12:09:24 
2017(r321782)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 13:08:47 
2017(r321783)
@@ -94,6 +94,7 @@
 03/07  Michael P. Pritchard  born in Los Angeles, 
California, United States, 1964
 03/07  Giorgos Keramidas  born in Athens, Greece, 1976
 03/10  Andreas Klemm  born in Duesseldorf, 
Nordrhein-Westfalen, Germany, 1963
+03/10  Nikolai Lifanov  born in Moscow, Russian 
Federation, 1989
 03/11  Soeren Straarup  born in Andst, Denmark, 1978
 03/12  Greg Lewis  born in Adelaide, South Australia, 
Australia, 1969
 03/13  Alexander Leidinger  born in Neunkirchen, 
Saarland, Germany, 1976
___
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: r321782 - in head/sys/dev/mlx4: . mlx4_core mlx4_en

2017-07-31 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jul 31 12:09:24 2017
New Revision: 321782
URL: https://svnweb.freebsd.org/changeset/base/321782

Log:
  Remove some dead statistics related code and a structure field from the
  mlx4en driver which is used by its Linux counterpart, but not under
  FreeBSD.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/dev/mlx4/device.h
  head/sys/dev/mlx4/mlx4_core/mlx4_port.c
  head/sys/dev/mlx4/mlx4_en/en.h
  head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
  head/sys/dev/mlx4/stats.h

Modified: head/sys/dev/mlx4/device.h
==
--- head/sys/dev/mlx4/device.h  Mon Jul 31 12:08:44 2017(r321781)
+++ head/sys/dev/mlx4/device.h  Mon Jul 31 12:09:24 2017(r321782)
@@ -1273,7 +1273,6 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u
 void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac);
 int mlx4_get_base_qpn(struct mlx4_dev *dev, u8 port);
 int __mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac);
-void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap);
 int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
  u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx);
 int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,

Modified: head/sys/dev/mlx4/mlx4_core/mlx4_port.c
==
--- head/sys/dev/mlx4/mlx4_core/mlx4_port.c Mon Jul 31 12:08:44 2017
(r321781)
+++ head/sys/dev/mlx4/mlx4_core/mlx4_port.c Mon Jul 31 12:09:24 2017
(r321782)
@@ -982,38 +982,6 @@ int mlx4_DUMP_ETH_STATS_wrapper(struct mlx4_dev *dev, 
return 0;
 }
 
-void mlx4_set_stats_bitmap(struct mlx4_dev *dev, unsigned long *stats_bitmap)
-{
-   int last_i = 0;
-
-   bitmap_zero(stats_bitmap, NUM_ALL_STATS);
-
-   if (mlx4_is_slave(dev)) {
-   last_i = dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN ?
-   NUM_PKT_STATS + NUM_FLOW_STATS : NUM_PKT_STATS;
-   } else {
-   bitmap_set(stats_bitmap, last_i, NUM_PKT_STATS);
-   last_i = NUM_PKT_STATS;
-
-   if (dev->caps.flags2 &
-   MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN) {
-   bitmap_set(stats_bitmap, last_i, NUM_FLOW_STATS);
-   last_i += NUM_FLOW_STATS;
-   }
-   }
-
-   if (mlx4_is_slave(dev))
-   bitmap_set(stats_bitmap, last_i, NUM_VF_STATS);
-   last_i += NUM_VF_STATS;
-
-   if (mlx4_is_master(dev))
-   bitmap_set(stats_bitmap, last_i, NUM_VPORT_STATS);
-   last_i += NUM_VPORT_STATS;
-
-   bitmap_set(stats_bitmap, last_i, NUM_PORT_STATS);
-}
-EXPORT_SYMBOL(mlx4_set_stats_bitmap);
-
 int mlx4_get_slave_from_roce_gid(struct mlx4_dev *dev, int port, u8 *gid, int 
*slave_id)
 {
struct mlx4_priv *priv = mlx4_priv(dev);

Modified: head/sys/dev/mlx4/mlx4_en/en.h
==
--- head/sys/dev/mlx4/mlx4_en/en.h  Mon Jul 31 12:08:44 2017
(r321781)
+++ head/sys/dev/mlx4/mlx4_en/en.h  Mon Jul 31 12:09:24 2017
(r321782)
@@ -572,7 +572,6 @@ struct mlx4_en_priv {
struct mlx4_en_port_stats port_stats;
struct mlx4_en_vport_stats vport_stats;
struct mlx4_en_vf_stats vf_stats;
-   DECLARE_BITMAP(stats_bitmap, NUM_ALL_STATS);
struct list_head mc_list;
struct list_head curr_list;
u64 broadcast_id;

Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
==
--- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c  Mon Jul 31 12:08:44 2017
(r321781)
+++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c  Mon Jul 31 12:09:24 2017
(r321782)
@@ -1377,8 +1377,6 @@ int mlx4_en_start_port(struct net_device *dev)
/* Schedule multicast task to populate multicast list */
queue_work(mdev->workqueue, >rx_mode_task);
 
-   mlx4_set_stats_bitmap(mdev->dev, priv->stats_bitmap);
-
priv->port_up = true;
 
 /* Enable the queues. */
@@ -2731,28 +2729,6 @@ static void mlx4_en_sysctl_stat(struct mlx4_en_priv *p
SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_gt_1548_bytes_packets", 
CTLFLAG_RD,
>pkstats.rx_gt_1548_bytes_packets,
"RX Greater Then 1548 bytes Packets");
-
-struct mlx4_en_pkt_stats {
-   unsigned long tx_packets;
-   unsigned long tx_bytes;
-   unsigned long tx_multicast_packets;
-   unsigned long tx_broadcast_packets;
-   unsigned long tx_errors;
-   unsigned long tx_dropped;
-   unsigned long tx_lt_64_bytes_packets;
-   unsigned long tx_127_bytes_packets;
-   unsigned long tx_255_bytes_packets;
-   unsigned long tx_511_bytes_packets;
-   unsigned long tx_1023_bytes_packets;
-   

svn commit: r321780 - head/sys/dev/mlx4/mlx4_ib

2017-07-31 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jul 31 12:03:45 2017
New Revision: 321780
URL: https://svnweb.freebsd.org/changeset/base/321780

Log:
  Make sure on-stack buffer is properly aligned.
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c

Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c
==
--- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c Mon Jul 31 11:04:35 2017
(r321779)
+++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c Mon Jul 31 12:03:45 2017
(r321780)
@@ -983,7 +983,7 @@ static int iboe_process_mad(struct ib_device *ibdev, i
int err;
u32 counter_index = dev->counters[port_num - 1].counter_index & 0x;
u8 mode;
-   charcounter_buf[MLX4_IF_STAT_SZ(1)];
+   charcounter_buf[MLX4_IF_STAT_SZ(1)] 
__aligned(8);
union  mlx4_counter *counter = (union mlx4_counter *)
   counter_buf;
 
___
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: r321779 - in head/sys: net netipsec

2017-07-31 Thread Andrey V. Elsukov
Author: ae
Date: Mon Jul 31 11:04:35 2017
New Revision: 321779
URL: https://svnweb.freebsd.org/changeset/base/321779

Log:
  Add inpcb pointer to struct ipsec_ctx_data and pass it to the pfil hook
  from enc_hhook().
  
  This should solve the problem when pf is used with if_enc(4) interface,
  and outbound packet with existing PCB checked by pf, and this leads to
  deadlock due to pf does its own PCB lookup and tries to take rlock when
  wlock is already held.
  
  Now we pass PCB pointer if it is known to the pfil hook, this helps to
  avoid extra PCB lookup and thus rlock acquiring is not needed.
  For inbound packets it is safe to pass NULL, because we do not held any
  PCB locks yet.
  
  PR:   220217
  MFC after:3 weeks
  Sponsored by: Yandex LLC

Modified:
  head/sys/net/if_enc.c
  head/sys/net/if_enc.h
  head/sys/netipsec/ipsec.h
  head/sys/netipsec/ipsec_input.c
  head/sys/netipsec/ipsec_output.c

Modified: head/sys/net/if_enc.c
==
--- head/sys/net/if_enc.c   Mon Jul 31 09:54:04 2017(r321778)
+++ head/sys/net/if_enc.c   Mon Jul 31 11:04:35 2017(r321779)
@@ -284,7 +284,7 @@ enc_hhook(int32_t hhook_type, int32_t hhook_id, void *
/* Make a packet looks like it was received on enc(4) */
rcvif = (*ctx->mp)->m_pkthdr.rcvif;
(*ctx->mp)->m_pkthdr.rcvif = ifp;
-   if (pfil_run_hooks(ph, ctx->mp, ifp, pdir, NULL) != 0 ||
+   if (pfil_run_hooks(ph, ctx->mp, ifp, pdir, ctx->inp) != 0 ||
*ctx->mp == NULL) {
*ctx->mp = NULL; /* consumed by filter */
return (EACCES);

Modified: head/sys/net/if_enc.h
==
--- head/sys/net/if_enc.h   Mon Jul 31 09:54:04 2017(r321778)
+++ head/sys/net/if_enc.h   Mon Jul 31 11:04:35 2017(r321779)
@@ -33,6 +33,7 @@
 struct ipsec_ctx_data {
struct mbuf **mp;
struct secasvar *sav;
+   struct inpcb*inp;
uint8_t af;
 #defineIPSEC_ENC_BEFORE0x01
 #defineIPSEC_ENC_AFTER 0x02

Modified: head/sys/netipsec/ipsec.h
==
--- head/sys/netipsec/ipsec.h   Mon Jul 31 09:54:04 2017(r321778)
+++ head/sys/netipsec/ipsec.h   Mon Jul 31 11:04:35 2017(r321779)
@@ -253,8 +253,9 @@ struct ipsecstat {
 #include 
 
 struct ipsec_ctx_data;
-#defineIPSEC_INIT_CTX(_ctx, _mp, _sav, _af, _enc) do { \
+#defineIPSEC_INIT_CTX(_ctx, _mp, _inp, _sav, _af, _enc) do {   \
(_ctx)->mp = (_mp); \
+   (_ctx)->inp = (_inp);   \
(_ctx)->sav = (_sav);   \
(_ctx)->af = (_af); \
(_ctx)->enc = (_enc);   \

Modified: head/sys/netipsec/ipsec_input.c
==
--- head/sys/netipsec/ipsec_input.c Mon Jul 31 09:54:04 2017
(r321778)
+++ head/sys/netipsec/ipsec_input.c Mon Jul 31 11:04:35 2017
(r321779)
@@ -325,7 +325,7 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar
(prot == IPPROTO_UDP || prot == IPPROTO_TCP))
udp_ipsec_adjust_cksum(m, sav, prot, skip);
 
-   IPSEC_INIT_CTX(, , sav, AF_INET, IPSEC_ENC_BEFORE);
+   IPSEC_INIT_CTX(, , NULL, sav, AF_INET, IPSEC_ENC_BEFORE);
if ((error = ipsec_run_hhooks(, HHOOK_TYPE_IPSEC_IN)) != 0)
goto bad;
ip = mtod(m, struct ip *);  /* update pointer */
@@ -416,7 +416,7 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar
goto bad;
}
 
-   IPSEC_INIT_CTX(, , sav, af, IPSEC_ENC_AFTER);
+   IPSEC_INIT_CTX(, , NULL, sav, af, IPSEC_ENC_AFTER);
if ((error = ipsec_run_hhooks(, HHOOK_TYPE_IPSEC_IN)) != 0)
goto bad;
 
@@ -522,7 +522,7 @@ ipsec6_common_input_cb(struct mbuf *m, struct secasvar
goto bad;
}
 
-   IPSEC_INIT_CTX(, , sav, af, IPSEC_ENC_BEFORE);
+   IPSEC_INIT_CTX(, , NULL, sav, af, IPSEC_ENC_BEFORE);
if ((error = ipsec_run_hhooks(, HHOOK_TYPE_IPSEC_IN)) != 0)
goto bad;
 
@@ -593,7 +593,7 @@ ipsec6_common_input_cb(struct mbuf *m, struct secasvar
else
 #endif
af = AF_INET6;
-   IPSEC_INIT_CTX(, , sav, af, IPSEC_ENC_AFTER);
+   IPSEC_INIT_CTX(, , NULL, sav, af, IPSEC_ENC_AFTER);
if ((error = ipsec_run_hhooks(, HHOOK_TYPE_IPSEC_IN)) != 0)
goto bad;
if (skip == 0) {

Modified: head/sys/netipsec/ipsec_output.c
==
--- head/sys/netipsec/ipsec_output.cMon Jul 31 09:54:04 2017
(r321778)
+++ head/sys/netipsec/ipsec_output.cMon Jul 31 11:04:35 2017  

svn commit: r321776 - head/usr.bin/calendar/calendars

2017-07-31 Thread Stanislav Galabov
Author: sgalabov
Date: Mon Jul 31 09:46:48 2017
New Revision: 321776
URL: https://svnweb.freebsd.org/changeset/base/321776

Log:
  Add myself to calendar
  
  Reminded by: mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 09:28:43 
2017(r321775)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 09:46:48 
2017(r321776)
@@ -207,6 +207,7 @@
 06/06  Alan Eldridge  died in Denver, Colorado, 2003
 06/07  Jimmy Olgeni  born in Milano, Italy, 1976
 06/07  Benjamin Close  born in Adelaide, Australia, 1978
+06/09  Stanislav Galabov  born in Sofia, Bulgaria 1978
 06/11  Alonso Cardenas Marquez  born in Arequipa, Peru, 1979
 06/14  Josh Paetzel  born in Minneapolis, Minnesota, 
United States, 1973
 06/17  Tilman Linneweh  born in Weinheim, 
Baden-Wuerttemberg, Germany, 1978
___
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: r321774 - head/usr.bin/calendar/calendars

2017-07-31 Thread Eugene Grosbein
Author: eugen (ports committer)
Date: Mon Jul 31 09:18:53 2017
New Revision: 321774
URL: https://svnweb.freebsd.org/changeset/base/321774

Log:
  Add myself.
  
  Reminded by:mckusick
  Approved by:  vsevolod (mentor)

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 09:17:54 
2017(r321773)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 09:18:53 
2017(r321774)
@@ -332,6 +332,7 @@
 10/09  Stefan Walter  born in Werne, Nordrhein-Westfalen, 
Germany, 1978
 10/12  Pawel Jakub Dawidek  born in Radzyn Podlaski, Poland, 
1980
 10/15  Maxim Konovalov  born in Khabarovsk, USSR, 1973
+10/15  Eugene Grosbein  born in Novokuznetsk, Russian 
Republic, USSR, 1976
 10/16  Remko Lodder  born in Rotterdam, the Netherlands, 
1983
 10/17  Maho NAKATA  born in Osaka, Japan, 1974
 10/18  Sheldon Hearn  born in Cape Town, Western Cape, 
South Africa, 1974
___
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: r321773 - head/sys/compat/linuxkpi/common/include/linux

2017-07-31 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jul 31 09:17:54 2017
New Revision: 321773
URL: https://svnweb.freebsd.org/changeset/base/321773

Log:
  Remove cycle_t type from the LinuxKPI similar to Linux upstream.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/clocksource.h

Modified: head/sys/compat/linuxkpi/common/include/linux/clocksource.h
==
--- head/sys/compat/linuxkpi/common/include/linux/clocksource.h Mon Jul 31 
09:15:15 2017(r321772)
+++ head/sys/compat/linuxkpi/common/include/linux/clocksource.h Mon Jul 31 
09:17:54 2017(r321773)
@@ -33,9 +33,6 @@
 
 #include 
 
-#defineCLOCKSOURCE_MASK(x) ((cycle_t)(-1ULL >> ((-(x)) & 63)))
-
-/* clocksource cycle base type */
-typedef u64 cycle_t;
+#defineCLOCKSOURCE_MASK(x) ((u64)(-1ULL >> ((-(x)) & 63)))
 
 #endif /* _LINUX_CLOCKSOURCE_H */
___
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: r321772 - in head/sys/dev/mlx4: . mlx4_core mlx4_ib

2017-07-31 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Jul 31 09:15:15 2017
New Revision: 321772
URL: https://svnweb.freebsd.org/changeset/base/321772

Log:
  Fix broken usage of the mlx4_read_clock() function:
   - return value has too small width
   - cycle_t is unsigned and cannot be less than zero
  
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/dev/mlx4/device.h
  head/sys/dev/mlx4/mlx4_core/mlx4_main.c
  head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c

Modified: head/sys/dev/mlx4/device.h
==
--- head/sys/dev/mlx4/device.h  Mon Jul 31 09:13:18 2017(r321771)
+++ head/sys/dev/mlx4/device.h  Mon Jul 31 09:15:15 2017(r321772)
@@ -1337,7 +1337,7 @@ int mlx4_get_roce_gid_from_slave(struct mlx4_dev *dev,
 
 int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn, 
u32 max_range_qpn);
 
-int mlx4_read_clock(struct mlx4_dev *dev);
+s64 mlx4_read_clock(struct mlx4_dev *dev);
 int mlx4_get_internal_clock_params(struct mlx4_dev *dev,
   struct mlx4_clock_params *params);
 

Modified: head/sys/dev/mlx4/mlx4_core/mlx4_main.c
==
--- head/sys/dev/mlx4/mlx4_core/mlx4_main.c Mon Jul 31 09:13:18 2017
(r321771)
+++ head/sys/dev/mlx4/mlx4_core/mlx4_main.c Mon Jul 31 09:15:15 2017
(r321772)
@@ -1793,10 +1793,10 @@ static void unmap_bf_area(struct mlx4_dev *dev)
io_mapping_free(mlx4_priv(dev)->bf_mapping);
 }
 
-int mlx4_read_clock(struct mlx4_dev *dev)
+s64 mlx4_read_clock(struct mlx4_dev *dev)
 {
u32 clockhi, clocklo, clockhi1;
-   cycle_t cycles;
+   s64 cycles;
int i;
struct mlx4_priv *priv = mlx4_priv(dev);
 
@@ -1813,7 +1813,7 @@ int mlx4_read_clock(struct mlx4_dev *dev)
 
cycles = (u64) clockhi << 32 | (u64) clocklo;
 
-   return cycles;
+   return cycles & CORE_CLOCK_MASK;
 }
 EXPORT_SYMBOL_GPL(mlx4_read_clock);
 

Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c
==
--- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.cMon Jul 31 09:13:18 2017
(r321771)
+++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.cMon Jul 31 09:15:15 2017
(r321772)
@@ -877,12 +877,12 @@ static int mlx4_ib_query_values(struct ib_device *devi
struct ib_device_values *values)
 {
struct mlx4_ib_dev *dev = to_mdev(device);
-   cycle_t cycles;
+   s64 cycles;
 
values->values_mask = 0;
if (q_values & IBV_VALUES_HW_CLOCK) {
cycles = mlx4_read_clock(dev->dev);
-   if (cycles < 0) {
+   if (cycles >= 0) {
values->hwclock = cycles & CORE_CLOCK_MASK;
values->values_mask |= IBV_VALUES_HW_CLOCK;
}
___
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: r321771 - head/usr.bin/calendar/calendars

2017-07-31 Thread Kristof Provost
Author: kp
Date: Mon Jul 31 09:13:18 2017
New Revision: 321771
URL: https://svnweb.freebsd.org/changeset/base/321771

Log:
  Add myself to calendar
  
  Reminded by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 08:19:44 
2017(r321770)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 09:13:18 
2017(r321771)
@@ -18,6 +18,7 @@
 01/10  Jean-Yves Lefort  born in Charleroi, Belgium, 1980
 01/12  Yen-Ming Lee  born in Taipei, Taiwan, Republic of 
China, 1977
 01/12  Ying-Chieh Liao  born in Taipei, Taiwan, Republic 
of China, 1979
+01/12  Kristof Provost  born in Aalst, Belgium, 1983
 01/13  Ruslan Bukin  born in Dudinka, Russian Federation, 
1985
 01/14  Yi-Jheng Lin  born in Taichung, Taiwan, Republic of 
China, 1985
 01/16  Ariff Abdullah  born in Kuala Lumpur, Malaysia, 1978
___
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: r321769 - head/usr.bin/calendar/calendars

2017-07-31 Thread Nick Hibma
Author: n_hibma
Date: Mon Jul 31 08:16:12 2017
New Revision: 321769
URL: https://svnweb.freebsd.org/changeset/base/321769

Log:
  Add my birthday entry to the calendar file.

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 08:11:58 
2017(r321768)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 08:16:12 
2017(r321769)
@@ -34,6 +34,7 @@
 01/23  Hideyuki KURASHINA  born in Niigata, Japan, 1982
 01/24  Fabien Thomas  born in Avignon, France, 1971
 01/24  Matteo Riondato  born in Padova, Italy, 1986
+01/25  Nick Hibma  born in Groningen, the Netherlands, 
1972
 01/25  Bernd Walter  born in Moers, Nordrhein-Westfalen, 
Germany, 1974
 01/26  Andrew Gallatin  born in Buffalo, New York, 
United States, 1970
 01/27  Nick Sayer  born in San Diego, California, United 
States, 1968
___
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: r321768 - head/usr.bin/calendar/calendars

2017-07-31 Thread Romain Tartière
Author: romain (ports committer)
Date: Mon Jul 31 08:11:58 2017
New Revision: 321768
URL: https://svnweb.freebsd.org/changeset/base/321768

Log:
  Add myself
  
  Reminded by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 08:11:05 
2017(r321767)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 08:11:58 
2017(r321768)
@@ -340,6 +340,7 @@
 10/21  Ben Smithurst  born in Sheffield, South Yorkshire, 
United Kingdom, 1981
 10/22  Jean-Sebastien Pedron  born in Redon, 
Ille-et-Vilaine, France, 1980
 10/23  Mario Sergio Fujikawa Ferreira  born in Brasilia, 
Distrito Federal, Brazil, 1976
+10/23  Romain Tartière  born in Clermont-Ferrand, France, 
1984
 10/25  Eric Melville  born in Los Gatos, California, United 
States, 1980
 10/25  Julien Laffaye  born in Toulouse, France, 1988
 10/25  Ashish SHUKLA  born in Kanpur, India, 1985
___
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: r321766 - head/usr.bin/calendar/calendars

2017-07-31 Thread Ruslan Bukin
Author: br
Date: Mon Jul 31 08:10:02 2017
New Revision: 321766
URL: https://svnweb.freebsd.org/changeset/base/321766

Log:
  Add my birthday.

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 08:02:25 
2017(r321765)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 08:10:02 
2017(r321766)
@@ -18,6 +18,7 @@
 01/10  Jean-Yves Lefort  born in Charleroi, Belgium, 1980
 01/12  Yen-Ming Lee  born in Taipei, Taiwan, Republic of 
China, 1977
 01/12  Ying-Chieh Liao  born in Taipei, Taiwan, Republic 
of China, 1979
+01/13  Ruslan Bukin  born in Dudinka, Russian Federation, 
1985
 01/14  Yi-Jheng Lin  born in Taichung, Taiwan, Republic of 
China, 1985
 01/16  Ariff Abdullah  born in Kuala Lumpur, Malaysia, 1978
 01/16  Dmitry Sivachenko  born in Moscow, USSR, 1978
___
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: r321767 - head/usr.bin/calendar/calendars

2017-07-31 Thread Toomas Soome
Author: tsoome
Date: Mon Jul 31 08:11:05 2017
New Revision: 321767
URL: https://svnweb.freebsd.org/changeset/base/321767

Log:
  Add myself to calendar
  
  Reminded by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 08:10:02 
2017(r321766)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 08:11:05 
2017(r321767)
@@ -343,6 +343,7 @@
 10/25  Eric Melville  born in Los Gatos, California, United 
States, 1980
 10/25  Julien Laffaye  born in Toulouse, France, 1988
 10/25  Ashish SHUKLA  born in Kanpur, India, 1985
+10/25  Toomas Soome  born Estonia, 1971
 10/26  Matthew Ahrens  born in United States, 1979
 10/26  Philip M. Gollucci  born in Silver Spring, 
Maryland, United States, 1979
 10/27  Takanori Watanabe  born in Numazu, Shizuoka, 
Japan, 1972
___
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: r321764 - head/usr.bin/calendar/calendars

2017-07-31 Thread Emmanuel Vadot
Author: manu
Date: Mon Jul 31 07:58:29 2017
New Revision: 321764
URL: https://svnweb.freebsd.org/changeset/base/321764

Log:
  Add myself to calendar
  
  Reminded by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 07:48:08 
2017(r321763)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 07:58:29 
2017(r321764)
@@ -384,6 +384,7 @@
 12/18  Muhammad Moinur Rahman  born in Dhaka, Bangladesh, 
1983
 12/18  Semen Ustimenko  born in Novosibirsk, Russian 
Federation, 1979
 12/19  Stephen Hurd  born in Estevan, Saskatchewan, Canada, 
1975
+12/19  Emmanuel Vadot  born in Decines-Charpieu, France, 1983
 12/21  Rong-En Fan  born in Taipei, Taiwan, Republic of 
China, 1982
 12/22  Maxim Sobolev  born in Dnepropetrovsk, Ukraine, 
1976
 12/23  Sean Chittenden  born in Seattle, Washington, United 
States, 1979
___
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: r321763 - head/usr.bin/calendar/calendars

2017-07-31 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Jul 31 07:48:08 2017
New Revision: 321763
URL: https://svnweb.freebsd.org/changeset/base/321763

Log:
  calendar: Add myself.
  
  Reminded by: mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 07:18:15 
2017(r321762)
+++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jul 31 07:48:08 
2017(r321763)
@@ -364,6 +364,7 @@
 11/21  Mark Johnston  born in Toronto, Ontario, Canada, 1989
 11/22  Frederic Culot  born in Saint-Germain-En-Laye, 
France, 1976
 11/23  Josef Lawrence Karthauser  born in Pembury, Kent, 
United Kingdom, 1972
+11/23  Sepherosa Ziehau  born in Shanghai, China, 1980
 11/24  Andrey Zakhvatov  born in Chelyabinsk, Russian 
Federation, 1974
 11/24  Daniel Gerzo  born in Bratislava, Slovakia, 1986
 11/28  Nik Clayton  born in Peterborough, United Kingdom, 
1973
___
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: r321762 - in head: contrib/hyperv/tools/scripts etc/devd libexec/hyperv

2017-07-31 Thread Sepherosa Ziehau
Author: sephe
Date: Mon Jul 31 07:18:15 2017
New Revision: 321762
URL: https://svnweb.freebsd.org/changeset/base/321762

Log:
  hyperv: Add VF bringup scripts and devd rules.
  
  How network VF works with hn(4) on Hyper-V in non-transparent mode:
  
  - Each network VF has a cooresponding hn(4).
  - The network VF and the it's cooresponding hn(4) have the same hardware
address.
  - Once the network VF is up, e.g. ifconfig VF up:
o  All of the transmission should go through the network VF.
o  Most of the reception goes through the network VF.
o  Small amount of reception may go through the cooresponding hn(4).
   This reception will happen, even if the the cooresponding hn(4) is
   down.  The cooresponding hn(4) will change the reception interface
   to the network VF, so that network layer and application layer will
   be tricked into thinking that these packets were received by the
   network VF.
o  The cooresponding hn(4) pretends the physical link is down.
  - Once the network VF is down or detached:
o  All of the transmission should go through the cooresponding hn(4).
o  All of the reception goes through the cooresponding hn(4).
o  The cooresponding hn(4) fallbacks to the original physical link
   detection logic.
  
  All these features are mainly used to help live migration, during which
  the network VF will be detached, while the network communication to the
  VM must not be cut off.  In order to reach this level of live migration
  transparency, we use failover mode lagg(4) with the network VF and the
  cooresponding hn(4) attached to it.
  
  To ease user configuration for both network VF and non-network VF, the
  lagg(4) will be created by the following rules, and the configuration
  of the cooresponding hn(4) will be applied to the lagg(4) automatically.
  
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D11635

Added:
  head/contrib/hyperv/tools/scripts/hyperv_vfattach
  head/contrib/hyperv/tools/scripts/hyperv_vfup
Modified:
  head/etc/devd/hyperv.conf
  head/libexec/hyperv/Makefile

Added: head/contrib/hyperv/tools/scripts/hyperv_vfattach
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/hyperv/tools/scripts/hyperv_vfattach   Mon Jul 31 07:18:15 
2017(r321762)
@@ -0,0 +1,79 @@
+#!/bin/sh
+
+#
+# If transparent VF is enabled, don't do anything.
+#
+
+sysctl -n hw.hn.vf_transparent > /dev/null 2>&1
+if [ $? -ne 0 ]
+then
+   # Old kernel; no transparent VF.
+   vf_transparent=0
+else
+   vf_transparent=`sysctl -n hw.hn.vf_transparent`
+fi
+
+if [ $vf_transparent -ne 0 ]
+then
+   # Transparent VF; done!
+   exit 0
+fi
+
+iface=$1
+delay=$2
+
+if [ $delay -gt 0 ]
+then
+   #
+   # Delayed VF up.
+   #
+   sleep $delay
+   ifconfig $iface up
+   # Done!
+   exit $?
+fi
+
+#
+# Check to see whether $iface is a VF or not.
+# If $iface is a VF, bring it up now.
+#
+
+# for hyperv_vf_delay
+. /etc/rc.conf
+
+sysctl -n hw.hn.vflist > /dev/null 2>&1
+if [ $? -ne 0 ]
+then
+   # Old kernel; nothing could be done properly.
+   exit 0
+fi
+vf_list=`sysctl -n hw.hn.vflist`
+
+for vf in $vf_list
+do
+   if [ $vf = $iface ]
+   then
+   #
+   # Linger a little bit (at least 2 seconds) mainly to
+   # make sure that $iface is fully attached.
+   #
+   # NOTE:
+   # In Azure hyperv_vf_delay should be configured to a
+   # large value, e.g. 120 seconds, to avoid racing cloud
+   # agent goofs.
+   #
+   test $hyperv_vf_delay -ge 2 > /dev/null 2>&1
+   if [ $? -ne 0 ]
+   then
+   hyperv_vf_delay=2
+   fi
+   #
+   # NOTE:
+   # "(sleep ..; ifconfig .. up) > /dev/null 2>&1 &"
+   # does _not_ work.
+   #
+   daemon -f /usr/libexec/hyperv/hyperv_vfattach \
+   $iface $hyperv_vf_delay
+   break
+   fi
+done

Added: head/contrib/hyperv/tools/scripts/hyperv_vfup
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/hyperv/tools/scripts/hyperv_vfup   Mon Jul 31 07:18:15 
2017(r321762)
@@ -0,0 +1,119 @@
+#!/bin/sh
+
+. /etc/rc.subr
+. /etc/network.subr
+
+load_rc_config netif
+
+#
+# Customized per-interface setup, e.g. hyperv_vfup.hn1
+#
+# NOTE-CUSTOMIZE:
+# Comment this out, if this script is used as template
+# for the customized per-interface setup.
+#
+if [ -f /usr/libexec/hyperv/hyperv_vfup.$1 ]
+then
+   /usr/libexec/hyperv/hyperv_vfup.$1
+   exit $?
+fi
+
+# NOTE-CUSTOMIZE:
+#hn=${0##*.}
+hn=$1
+hn_unit=`echo $hn | sed 

Re: svn commit: r321605 - head/contrib/ipfilter

2017-07-31 Thread Cy Schubert
In message <201707310527.v6v5rdrj004...@slippy.cwsent.com>, Cy Schubert 
writes:
> Cy Schubert writes:
> > In message <59e80a44-d9de-5081-9eda-f068188b8...@delphij.net>, Xin Li 
> > writes:
> > > On 7/26/17 23:26, Cy Schubert wrote:
> > > > Author: cy
> > > > Date: Thu Jul 27 06:26:15 2017
> > > > New Revision: 321605
> > > > URL: https://svnweb.freebsd.org/changeset/base/321605
> > > >=20
> > > > Log:
> > > >   As in r315225, discard 3072 bytes of RC4 bytestream instead of 1024.
> > > >  =20
> > > >   PR:   217920
> > > >   Submitted by: codar...@hackers.mu
> > > >   Reviewed by:  emaste, cem
> > > >   Approved by:  so (implicit, in r315225)
> > > 
> > > Why ipfilter is using its own pseudo random number generator?  Please
> > > remove them altogether and use the system PRNG instead.
> > 
> > It uses this code when it builds the kernel sources in a userland program 
> > called ipftest. ipftest is a userland application outside of the kernel in 
> > which users pass generated or captured packets into it to test arbitrary 
> > ipfilter rules, which are separate from those in the kernel. ipftest is a 
> > rule testing application. ipftest is currently broken (it segfaults) and in
>  
> > my queue for loving attention. I'll look into using the libkern version of 
> > arc4rand(9) in this userland utility.
> 
> This will take a little more surgery than initially thought.
> 
> make: "/export/home/cy/freebsd/svn/current/share/mk/src.libnames.mk" line 
> 563: /export/home/cy/freebsd/svn/current/sbin/ipf/ipftest: Invalid LIBADD 
> used which may need to be added to src.libnames.mk: libkern
> 
> Probably not a good idea anyway to reference libkern from a userland 
> utility.

Late night moving furniture. Sorry, I should have worded this better.

This is an approximation of the libkern arc4rand(9) used in the ipftest(1) 
userland arbitrary rule testing utility. IP Filter "duplicates" a number of 
kernel function calls, including this one, to facilitate ipftest's use of 
ipfilter's kernel sources in the userland utility.

My previous email's wording was disrespectful and simply bad. My apologies.

-- 
Cheers,
Cy Schubert 
FreeBSD UNIX:     Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
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"