Re: svn commit: r304070 - svnadmin/conf

2016-08-13 Thread Conrad Meyer
On Sat, Aug 13, 2016 at 10:48 PM, Juli Mallett  wrote:
> On Sat, Aug 13, 2016 at 9:47 PM, Glen Barber  wrote:
>> Quoting the original request to remove this, which I tend to agree:
>>
>> -- begin quoted text ---
>>  The svn commit mail script uses some form of 'diff -p' (or 'svn diff
>>  -x-p') to include function names at the top of each hunk.  The problem
>>  is that diff gets it wrong more often than not, especially (but not
>>  only) when functions are added or renamed, or outside a funciton, or in
>>  headers, or in code that makes heavy use of macros, or in files that
>>  aren't C-like source code: shell scripts, man pages, Makefiles...  All
>>  it really does is clutter up the patch and mislead the reader.
>> --- end quoted text 
>
> :(
>
> I'm deeply skeptical that the described conditions add up to "more
> often than not," and that tangible harm is done in those cases,
> outweighing benefit added in the other, ostensibly rarer, case
> (changes in ordinary C source files, which are actually fairly
> abundant in FreeBSD.)

Exactly.  Yes, it gets it wrong sometimes.  But not enough to make it
more harmful than beneficial.

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


Re: svn commit: r304070 - svnadmin/conf

2016-08-13 Thread Juli Mallett
On Sat, Aug 13, 2016 at 9:47 PM, Glen Barber  wrote:
> Quoting the original request to remove this, which I tend to agree:
>
> -- begin quoted text ---
>  The svn commit mail script uses some form of 'diff -p' (or 'svn diff
>  -x-p') to include function names at the top of each hunk.  The problem
>  is that diff gets it wrong more often than not, especially (but not
>  only) when functions are added or renamed, or outside a funciton, or in
>  headers, or in code that makes heavy use of macros, or in files that
>  aren't C-like source code: shell scripts, man pages, Makefiles...  All
>  it really does is clutter up the patch and mislead the reader.
> --- end quoted text 

:(

I'm deeply skeptical that the described conditions add up to "more
often than not," and that tangible harm is done in those cases,
outweighing benefit added in the other, ostensibly rarer, case
(changes in ordinary C source files, which are actually fairly
abundant in FreeBSD.)

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


svn commit: r304072 - head/etc

2016-08-13 Thread Xin LI
Author: delphij
Date: Sun Aug 14 05:18:38 2016
New Revision: 304072
URL: https://svnweb.freebsd.org/changeset/base/304072

Log:
  Now that the portsnap buildbox is generating the raw bits for INDEX-12,
  add it to the set of INDEX files built by portsnap.
  
  Switch to INDEX-12 for head/.

Modified:
  head/etc/portsnap.conf

Modified: head/etc/portsnap.conf
==
--- head/etc/portsnap.conf  Sun Aug 14 05:10:26 2016(r304071)
+++ head/etc/portsnap.conf  Sun Aug 14 05:18:38 2016(r304072)
@@ -32,4 +32,5 @@
 # List of INDEX files to build and the DESCRIBE file to use for each
 #INDEX INDEX-9 DESCRIBE.9
 #INDEX INDEX-10 DESCRIBE.10
-INDEX INDEX-11 DESCRIBE.11
+#INDEX INDEX-11 DESCRIBE.11
+INDEX INDEX-12 DESCRIBE.12
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304071 - head/sys/dev/ofw

2016-08-13 Thread Michal Meloun
Author: mmel
Date: Sun Aug 14 05:10:26 2016
New Revision: 304071
URL: https://svnweb.freebsd.org/changeset/base/304071

Log:
  OFWPCI: Don't strip RF_ACTIVE from flags when parent bus method is called.
  
  Reviewed by:  nwhitehorn
  MFC after:3 weeks

Modified:
  head/sys/dev/ofw/ofwpci.c

Modified: head/sys/dev/ofw/ofwpci.c
==
--- head/sys/dev/ofw/ofwpci.c   Sun Aug 14 04:35:04 2016(r304070)
+++ head/sys/dev/ofw/ofwpci.c   Sun Aug 14 05:10:26 2016(r304071)
@@ -414,14 +414,14 @@
 #if defined(NEW_PCIB) && defined(PCI_RES_BUS)
if (type ==  PCI_RES_BUS) {
  return (pci_domain_alloc_bus(sc->sc_pci_domain, child, rid,
- start, end, count, flags));
+ start, end, count, flags | needactivate));
}
 #endif
 
rm = ofw_pci_get_rman(sc, type, flags);
if (rm == NULL)  {
return (bus_generic_alloc_resource(bus, child, type, rid,
-   start, end, count, flags));
+   start, end, count, flags | needactivate));
}
 
rv = rman_reserve_resource(rm, start, end, count, flags, child);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304070 - svnadmin/conf

2016-08-13 Thread Glen Barber
Quoting the original request to remove this, which I tend to agree:

-- begin quoted text ---
 The svn commit mail script uses some form of 'diff -p' (or 'svn diff
 -x-p') to include function names at the top of each hunk.  The problem
 is that diff gets it wrong more often than not, especially (but not
 only) when functions are added or renamed, or outside a funciton, or in
 headers, or in code that makes heavy use of macros, or in files that
 aren't C-like source code: shell scripts, man pages, Makefiles...  All
 it really does is clutter up the patch and mislead the reader.
--- end quoted text 

Glen

On Sat, Aug 13, 2016 at 09:39:14PM -0700, Conrad Meyer wrote:
> Wait, what?  Why not?  This option provides useful context for
> reviewing changes.
> 
> Best,
> Conrad
> 
> On Sat, Aug 13, 2016 at 9:35 PM, Glen Barber  wrote:
> > Author: gjb
> > Date: Sun Aug 14 04:35:04 2016
> > New Revision: 304070
> > URL: https://svnweb.freebsd.org/changeset/base/304070
> >
> > Log:
> >   Do not include C function changes by default in svn commit
> >   email.
> >
> >   No objection: svnadmin
> >   Submitted by: des
> >   Sponsored by: The FreeBSD Foundation
> >
> > Modified:
> >   svnadmin/conf/mailer.conf
> >
> > Modified: svnadmin/conf/mailer.conf
> > ==
> > --- svnadmin/conf/mailer.conf   Sun Aug 14 04:11:36 2016(r304069)
> > +++ svnadmin/conf/mailer.conf   Sun Aug 14 04:35:04 2016(r304070)
> > @@ -143,7 +143,7 @@
> >  # This is not passed to the shell, so do not use shell metacharacters.
> >  # The command is split around whitespace, so if you want to include
> >  # whitespace in the command, then ### something ###.
> > -diff = /usr/bin/diff -up -L %(label_from)s -L %(label_to)s %(from)s %(to)s
> > +diff = /usr/bin/diff -u -L %(label_from)s -L %(label_to)s %(from)s %(to)s
> >
> >  # The default prefix for the Subject: header for commits.
> >  commit_subject_prefix = svn commit:
> >
> 


signature.asc
Description: PGP signature


Re: svn commit: r304070 - svnadmin/conf

2016-08-13 Thread Conrad Meyer
Wait, what?  Why not?  This option provides useful context for
reviewing changes.

Best,
Conrad

On Sat, Aug 13, 2016 at 9:35 PM, Glen Barber  wrote:
> Author: gjb
> Date: Sun Aug 14 04:35:04 2016
> New Revision: 304070
> URL: https://svnweb.freebsd.org/changeset/base/304070
>
> Log:
>   Do not include C function changes by default in svn commit
>   email.
>
>   No objection: svnadmin
>   Submitted by: des
>   Sponsored by: The FreeBSD Foundation
>
> Modified:
>   svnadmin/conf/mailer.conf
>
> Modified: svnadmin/conf/mailer.conf
> ==
> --- svnadmin/conf/mailer.conf   Sun Aug 14 04:11:36 2016(r304069)
> +++ svnadmin/conf/mailer.conf   Sun Aug 14 04:35:04 2016(r304070)
> @@ -143,7 +143,7 @@
>  # This is not passed to the shell, so do not use shell metacharacters.
>  # The command is split around whitespace, so if you want to include
>  # whitespace in the command, then ### something ###.
> -diff = /usr/bin/diff -up -L %(label_from)s -L %(label_to)s %(from)s %(to)s
> +diff = /usr/bin/diff -u -L %(label_from)s -L %(label_to)s %(from)s %(to)s
>
>  # The default prefix for the Subject: header for commits.
>  commit_subject_prefix = svn commit:
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304070 - svnadmin/conf

2016-08-13 Thread Glen Barber
Author: gjb
Date: Sun Aug 14 04:35:04 2016
New Revision: 304070
URL: https://svnweb.freebsd.org/changeset/base/304070

Log:
  Do not include C function changes by default in svn commit
  email.
  
  No objection: svnadmin
  Submitted by: des
  Sponsored by: The FreeBSD Foundation

Modified:
  svnadmin/conf/mailer.conf

Modified: svnadmin/conf/mailer.conf
==
--- svnadmin/conf/mailer.conf   Sun Aug 14 04:11:36 2016(r304069)
+++ svnadmin/conf/mailer.conf   Sun Aug 14 04:35:04 2016(r304070)
@@ -143,7 +143,7 @@
 # This is not passed to the shell, so do not use shell metacharacters.
 # The command is split around whitespace, so if you want to include
 # whitespace in the command, then ### something ###.
-diff = /usr/bin/diff -up -L %(label_from)s -L %(label_to)s %(from)s %(to)s
+diff = /usr/bin/diff -u -L %(label_from)s -L %(label_to)s %(from)s %(to)s
 
 # The default prefix for the Subject: header for commits.
 commit_subject_prefix = svn commit:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304069 - head/sys/powerpc/mpc85xx

2016-08-13 Thread Justin Hibbits
Author: jhibbits
Date: Sun Aug 14 04:11:36 2016
New Revision: 304069
URL: https://svnweb.freebsd.org/changeset/base/304069

Log:
  Return 0 instead of an error code on failure to find dcsr.
  
  mpc85xx_map_dcsr() returns a vm_offset_t, not an error code.
  mpc85xx_fix_errata() will gracefully exit if mpc85xx_map_dcsr() returns 0, as
  that indicates an error (NULL pointer).

Modified:
  head/sys/powerpc/mpc85xx/mpc85xx.c

Modified: head/sys/powerpc/mpc85xx/mpc85xx.c
==
--- head/sys/powerpc/mpc85xx/mpc85xx.c  Sun Aug 14 03:49:37 2016
(r304068)
+++ head/sys/powerpc/mpc85xx/mpc85xx.c  Sun Aug 14 04:11:36 2016
(r304069)
@@ -358,10 +358,10 @@ mpc85xx_map_dcsr(void)
 * Find the node the long way.
 */
if ((node = OF_finddevice("/")) == -1)
-   return (ENXIO);
+   return (0);
 
if ((node = ofw_bus_find_compatible(node, "fsl,dcsr")) == 0)
-   return (ENXIO);
+   return (0);
 
 moveon:
err = fdt_get_range(node, 0, , );
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304068 - head/sys/powerpc/mpc85xx

2016-08-13 Thread Justin Hibbits
Author: jhibbits
Date: Sun Aug 14 03:49:37 2016
New Revision: 304068
URL: https://svnweb.freebsd.org/changeset/base/304068

Log:
  Only flush bp_kernload from the dcache, no need to sync the icache on the 
boot CPU.
  
  __syncicache() only syncs the icache on the current CPU, it doesn't touch the
  cache on any other core.  Replace the call with cpu_flush_dcache() instead.
  Since bp_kernload is not touched again by the boot CPU in this code path, dcbf
  is no less efficient than the dcbst from __syncicache() by invalidating the
  cache line.

Modified:
  head/sys/powerpc/mpc85xx/platform_mpc85xx.c

Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c
==
--- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sun Aug 14 00:40:17 2016
(r304067)
+++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sun Aug 14 03:49:37 2016
(r304068)
@@ -404,7 +404,7 @@ mpc85xx_smp_start_cpu(platform_t plat, s
 * bp_kernload is in the boot page.  Sync the cache because ePAPR
 * booting has the other core(s) already running.
 */
-   __syncicache(_kernload, sizeof(bp_kernload));
+   cpu_flush_dcache(_kernload, sizeof(bp_kernload));
 
ap_pcpu = pc;
__asm __volatile("msync; isync");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304067 - stable/11/sys/dev/virtio/network

2016-08-13 Thread Steven Hartland
Author: smh
Date: Sun Aug 14 00:40:17 2016
New Revision: 304067
URL: https://svnweb.freebsd.org/changeset/base/304067

Log:
  MFC r303971:
  
  Fix vtnet hang with max_virtqueue_pairs > VTNET_MAX_QUEUE_PAIRS
  
  Sponsored by: Multiplay

Modified:
  stable/11/sys/dev/virtio/network/if_vtnet.c
  stable/11/sys/dev/virtio/network/if_vtnetvar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/virtio/network/if_vtnet.c
==
--- stable/11/sys/dev/virtio/network/if_vtnet.c Sun Aug 14 00:24:00 2016
(r304066)
+++ stable/11/sys/dev/virtio/network/if_vtnet.c Sun Aug 14 00:40:17 2016
(r304067)
@@ -230,18 +230,32 @@ static void   vtnet_disable_interrupts(str
 static int vtnet_tunable_int(struct vtnet_softc *, const char *, int);
 
 /* Tunables. */
+static SYSCTL_NODE(_hw, OID_AUTO, vtnet, CTLFLAG_RD, 0, "VNET driver 
parameters");
 static int vtnet_csum_disable = 0;
 TUNABLE_INT("hw.vtnet.csum_disable", _csum_disable);
+SYSCTL_INT(_hw_vtnet, OID_AUTO, csum_disable, CTLFLAG_RDTUN,
+_csum_disable, 0, "Disables receive and send checksum offload");
 static int vtnet_tso_disable = 0;
 TUNABLE_INT("hw.vtnet.tso_disable", _tso_disable);
+SYSCTL_INT(_hw_vtnet, OID_AUTO, tso_disable, CTLFLAG_RDTUN, _tso_disable,
+0, "Disables TCP Segmentation Offload");
 static int vtnet_lro_disable = 0;
 TUNABLE_INT("hw.vtnet.lro_disable", _lro_disable);
+SYSCTL_INT(_hw_vtnet, OID_AUTO, lro_disable, CTLFLAG_RDTUN, _lro_disable,
+0, "Disables TCP Large Receive Offload");
 static int vtnet_mq_disable = 0;
 TUNABLE_INT("hw.vtnet.mq_disable", _mq_disable);
-static int vtnet_mq_max_pairs = 0;
+SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_disable, CTLFLAG_RDTUN, _mq_disable,
+0, "Disables Multi Queue support");
+static int vtnet_mq_max_pairs = VTNET_MAX_QUEUE_PAIRS;
 TUNABLE_INT("hw.vtnet.mq_max_pairs", _mq_max_pairs);
+SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_max_pairs, CTLFLAG_RDTUN,
+_mq_max_pairs, 0, "Sets the maximum number of Multi Queue pairs");
 static int vtnet_rx_process_limit = 512;
 TUNABLE_INT("hw.vtnet.rx_process_limit", _rx_process_limit);
+SYSCTL_INT(_hw_vtnet, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN,
+_rx_process_limit, 0,
+"Limits the number RX segments processed in a single pass");
 
 static uma_zone_t vtnet_tx_header_zone;
 
@@ -597,7 +611,6 @@ static void
 vtnet_setup_features(struct vtnet_softc *sc)
 {
device_t dev;
-   int max_pairs, max;
 
dev = sc->vtnet_dev;
 
@@ -646,32 +659,31 @@ vtnet_setup_features(struct vtnet_softc 
 
if (virtio_with_feature(dev, VIRTIO_NET_F_MQ) &&
sc->vtnet_flags & VTNET_FLAG_CTRL_VQ) {
-   max_pairs = virtio_read_dev_config_2(dev,
+   sc->vtnet_max_vq_pairs = virtio_read_dev_config_2(dev,
offsetof(struct virtio_net_config, max_virtqueue_pairs));
-   if (max_pairs < VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN ||
-   max_pairs > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX)
-   max_pairs = 1;
} else
-   max_pairs = 1;
+   sc->vtnet_max_vq_pairs = 1;
 
-   if (max_pairs > 1) {
+   if (sc->vtnet_max_vq_pairs > 1) {
/*
-* Limit the maximum number of queue pairs to the number of
-* CPUs or the configured maximum. The actual number of
-* queues that get used may be less.
+* Limit the maximum number of queue pairs to the lower of
+* the number of CPUs and the configured maximum.
+* The actual number of queues that get used may be less.
 */
+   int max;
+
max = vtnet_tunable_int(sc, "mq_max_pairs", vtnet_mq_max_pairs);
-   if (max > 0 && max_pairs > max)
-   max_pairs = max;
-   if (max_pairs > mp_ncpus)
-   max_pairs = mp_ncpus;
-   if (max_pairs > VTNET_MAX_QUEUE_PAIRS)
-   max_pairs = VTNET_MAX_QUEUE_PAIRS;
-   if (max_pairs > 1)
-   sc->vtnet_flags |= VTNET_FLAG_MULTIQ;
+   if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN) {
+   if (max > mp_ncpus)
+   max = mp_ncpus;
+   if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX)
+   max = VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX;
+   if (max > 1) {
+   sc->vtnet_requested_vq_pairs = max;
+   sc->vtnet_flags |= VTNET_FLAG_MULTIQ;
+   }
+   }
}
-
-   sc->vtnet_max_vq_pairs = max_pairs;
 }
 
 static int
@@ -2982,13 +2994,11 @@ vtnet_set_active_vq_pairs(struct vtnet_s
dev = sc->vtnet_dev;
 
if ((sc->vtnet_flags & VTNET_FLAG_MULTIQ) == 0) {
-   

svn commit: r304066 - head/usr.bin/nfsstat

2016-08-13 Thread Mark Johnston
Author: markj
Date: Sun Aug 14 00:24:00 2016
New Revision: 304066
URL: https://svnweb.freebsd.org/changeset/base/304066

Log:
  nfsstat depends on libdevstat as of r304058.
  
  X-MFC-With:   r304058

Modified:
  head/usr.bin/nfsstat/Makefile

Modified: head/usr.bin/nfsstat/Makefile
==
--- head/usr.bin/nfsstat/Makefile   Sat Aug 13 23:35:20 2016
(r304065)
+++ head/usr.bin/nfsstat/Makefile   Sun Aug 14 00:24:00 2016
(r304066)
@@ -4,4 +4,6 @@
 PROG=  nfsstat
 CFLAGS+=-DNFS
 
+LIBADD+= devstat
+
 .include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-08-13 Thread Greg Lehey
Author: grog
Date: Sat Aug 13 23:35:20 2016
New Revision: 304065
URL: https://svnweb.freebsd.org/changeset/base/304065

Log:
  Correct date ov VJ day (1945-08-15, about 03:00 UTC).

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

Modified: head/usr.bin/calendar/calendars/calendar.holiday
==
--- head/usr.bin/calendar/calendars/calendar.holidaySat Aug 13 23:00:15 
2016(r304064)
+++ head/usr.bin/calendar/calendars/calendar.holidaySat Aug 13 23:35:20 
2016(r304065)
@@ -331,8 +331,8 @@
 08/13  Proclamation of Independence in Central African Republic
 08/13  Women's Day in Tunisia
 08/14  Independence Day in Pakistan
-08/14  VJ Day, 1945
 08/14  Waddi Dhahab in Morocco
+08/15  VJ Day, 1945
 08/15  Founding of Ascuncion in Paraguay
 08/15  Independence Day in India
 08/15  Liberation Day in South Korea
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304061 - head/sys/netpfil/ipfw/nat64

2016-08-13 Thread Andrey V. Elsukov
Author: ae
Date: Sat Aug 13 22:14:16 2016
New Revision: 304061
URL: https://svnweb.freebsd.org/changeset/base/304061

Log:
  Use %ju to print unsigned 64-bit value.
  
  Reported by:  kib

Modified:
  head/sys/netpfil/ipfw/nat64/nat64lsn_control.c

Modified: head/sys/netpfil/ipfw/nat64/nat64lsn_control.c
==
--- head/sys/netpfil/ipfw/nat64/nat64lsn_control.c  Sat Aug 13 21:20:06 
2016(r304060)
+++ head/sys/netpfil/ipfw/nat64/nat64lsn_control.c  Sat Aug 13 22:14:16 
2016(r304061)
@@ -733,8 +733,8 @@ nat64lsn_states(struct ip_fw_chain *ch, 
}
if (addr < cfg->prefix4 || addr > cfg->pmask4) {
IPFW_UH_RUNLOCK(ch);
-   DPRINTF(DP_GENERIC | DP_STATE, "XXX: %lu %u %u",
-   next_idx, addr, cfg->pmask4);
+   DPRINTF(DP_GENERIC | DP_STATE, "XXX: %ju %u %u",
+   (uintmax_t)next_idx, addr, cfg->pmask4);
return (EINVAL);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304060 - in vendor/libarchive/dist: . build/cmake cat/test cpio cpio/test libarchive libarchive/test tar tar/test

2016-08-13 Thread Martin Matuska
Author: mm
Date: Sat Aug 13 21:20:06 2016
New Revision: 304060
URL: https://svnweb.freebsd.org/changeset/base/304060

Log:
  Update vendor/libarchive to git 6a0d970f70102fe50ee9f1e51a2e4c048985e616
  
  Vendor issues fixed:
  
  Issue #744: Very long pathnames evade symlink checks
  Issue #748: libarchive can compress, but cannot decompress zip some files
  PR #750: ustar: fix out of bounds read on empty string ("") filename
  PR #755: fix use of acl_get_flagset_np() on FreeBSD

Added:
  
vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c  
 (contents, props changed)
  
vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.zip.uu
  vendor/libarchive/dist/libarchive/test/test_write_disk_secure744.c   
(contents, props changed)
  vendor/libarchive/dist/libarchive/test/test_write_disk_secure745.c   
(contents, props changed)
  vendor/libarchive/dist/libarchive/test/test_write_disk_secure746.c   
(contents, props changed)
Modified:
  vendor/libarchive/dist/CMakeLists.txt
  vendor/libarchive/dist/Makefile.am
  vendor/libarchive/dist/build/cmake/config.h.in
  vendor/libarchive/dist/cat/test/test_version.c
  vendor/libarchive/dist/cpio/cmdline.c
  vendor/libarchive/dist/cpio/test/test_option_version.c
  vendor/libarchive/dist/libarchive/archive_match.c
  vendor/libarchive/dist/libarchive/archive_ppmd7_private.h
  vendor/libarchive/dist/libarchive/archive_read_add_passphrase.c
  vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c
  vendor/libarchive/dist/libarchive/archive_read_disk_posix.c
  vendor/libarchive/dist/libarchive/archive_read_disk_windows.c
  vendor/libarchive/dist/libarchive/archive_read_private.h
  vendor/libarchive/dist/libarchive/archive_read_support_filter_lz4.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c
  vendor/libarchive/dist/libarchive/archive_util.c
  vendor/libarchive/dist/libarchive/archive_write_disk_acl.c
  vendor/libarchive/dist/libarchive/archive_write_disk_posix.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_ustar.c
  vendor/libarchive/dist/libarchive/test/CMakeLists.txt
  vendor/libarchive/dist/libarchive/test/main.c
  vendor/libarchive/dist/libarchive/test/test.h
  vendor/libarchive/dist/libarchive/test/test_archive_string_conversion.c
  vendor/libarchive/dist/libarchive/test/test_fuzz.c
  vendor/libarchive/dist/libarchive/test/test_read_format_rar.c
  vendor/libarchive/dist/tar/cmdline.c
  vendor/libarchive/dist/tar/test/test_version.c

Modified: vendor/libarchive/dist/CMakeLists.txt
==
--- vendor/libarchive/dist/CMakeLists.txt   Sat Aug 13 20:21:32 2016
(r304059)
+++ vendor/libarchive/dist/CMakeLists.txt   Sat Aug 13 21:20:06 2016
(r304060)
@@ -1274,6 +1274,10 @@ CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEM
 
 CMAKE_POP_CHECK_STATE()# Restore the state of the variables
 
+CHECK_C_SOURCE_COMPILES(
+  "#include \n#include \nint main(void) { struct 
vfsconf v; return sizeof(v);}"
+  HAVE_STRUCT_VFSCONF)
+
 # Make sure we have the POSIX version of readdir_r, not the
 # older 2-argument version.
 CHECK_C_SOURCE_COMPILES(
@@ -1299,6 +1303,10 @@ CHECK_C_SOURCE_COMPILES(
   "#include \nint main() { return major(256); }"
   MAJOR_IN_SYSMACROS)
 
+CHECK_C_SOURCE_COMPILES(
+  "#include \n#if LZMA_VERSION < 5002\n#error 
unsupported\n#endif\nint main(void){lzma_stream_encoder_mt(0, 0); return 0;}"
+  HAVE_LZMA_STREAM_ENCODER_MT)
+
 IF(HAVE_STRERROR_R)
   SET(HAVE_DECL_STRERROR_R 1)
 ENDIF(HAVE_STRERROR_R)

Modified: vendor/libarchive/dist/Makefile.am
==
--- vendor/libarchive/dist/Makefile.am  Sat Aug 13 20:21:32 2016
(r304059)
+++ vendor/libarchive/dist/Makefile.am  Sat Aug 13 21:20:06 2016
(r304060)
@@ -475,6 +475,7 @@ libarchive_test_SOURCES= \
libarchive/test/test_read_format_zip_encryption_partially.c \
libarchive/test/test_read_format_zip_encryption_header.c \
libarchive/test/test_read_format_zip_filename.c \
+   libarchive/test/test_read_format_zip_high_compression.c \
libarchive/test/test_read_format_zip_mac_metadata.c \
libarchive/test/test_read_format_zip_malformed.c \
libarchive/test/test_read_format_zip_msdos.c \
@@ -509,6 +510,9 @@ libarchive_test_SOURCES= \
libarchive/test/test_write_disk_no_hfs_compression.c \
libarchive/test/test_write_disk_perms.c \
libarchive/test/test_write_disk_secure.c \
+   libarchive/test/test_write_disk_secure744.c \
+   libarchive/test/test_write_disk_secure745.c \
+   libarchive/test/test_write_disk_secure746.c \
libarchive/test/test_write_disk_sparse.c \
libarchive/test/test_write_disk_symlink.c \
 

svn commit: r304059 - head/usr.bin/nfsstat

2016-08-13 Thread Rick Macklem
Author: rmacklem
Date: Sat Aug 13 20:21:32 2016
New Revision: 304059
URL: https://svnweb.freebsd.org/changeset/base/304059

Log:
  Update the man page to descibe the "-d" option added by r304058.
  
  This is a content change.
  
  Submitted by: will (earlier version)
  Reviewed by:  ken, wblock
  MFC after:1 month
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D1626

Modified:
  head/usr.bin/nfsstat/nfsstat.1

Modified: head/usr.bin/nfsstat/nfsstat.1
==
--- head/usr.bin/nfsstat/nfsstat.1  Sat Aug 13 20:14:44 2016
(r304058)
+++ head/usr.bin/nfsstat/nfsstat.1  Sat Aug 13 20:21:32 2016
(r304059)
@@ -28,7 +28,7 @@
 .\" From: @(#)nfsstat.18.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd April 23, 2015
+.Dd August 13, 2016
 .Dt NFSSTAT 1
 .Os
 .Sh NAME
@@ -38,7 +38,7 @@
 statistics
 .Sh SYNOPSIS
 .Nm
-.Op Fl cemszW
+.Op Fl cdemszW
 .Op Fl M Ar core
 .Op Fl N Ar system
 .Op Fl w Ar wait
@@ -57,6 +57,28 @@ The options are as follows:
 .Bl -tag -width indent
 .It Fl c
 Only display client side statistics.
+.It Fl d
+Display statistics for the new NFS server that are similar to those
+displayed by
+.Xr iostat 8 .
+This includes kilobytes per transfer, transfers per second, and megabytes per
+second for read, write, and all operations.
+It also includes the current queue depth, the busy percentage, and latency
+for all operations.
+If the
+.Fl W
+flag is added, commits per second, commit latency, read latency, and write
+latency are also added to the display.
+The busy percentage shown can exceed 100 at times.
+This is because of the way busy percentages are calculated.
+The busy time is calculated by adding the elapsed time between the
+last time an operation started or finished,
+and the current time.
+If there is only one operation outstanding, the "busy time" time
+will get updated with the total time of that operation.
+That means that the difference in the busy time between the two
+measurement intervals (often 1 second)
+will increase by more than the measurement interval.
 .It Fl e
 Report the extra statistics collected by the NFS client and
 server for NFSv4.
@@ -79,7 +101,8 @@ Only display server side statistics.
 Use wide format with interval short summary.
 This option is especially
 useful when combined with
-.Fl c
+.Fl c ,
+.Fl d ,
 or
 .Fl s
 and a time delay.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304058 - head/usr.bin/nfsstat

2016-08-13 Thread Rick Macklem
Author: rmacklem
Date: Sat Aug 13 20:14:44 2016
New Revision: 304058
URL: https://svnweb.freebsd.org/changeset/base/304058

Log:
  Update nfsstat.c to use the new kernel nfsstat structure and
  add the new "-d" flag from D1626.
  The man page will be updated in a subsequent commit.
  
  Submitted by: will (earlier version)
  Reviewed by:  ken
  MFC after:1 month
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D1626

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

Modified: head/usr.bin/nfsstat/nfsstat.c
==
--- head/usr.bin/nfsstat/nfsstat.c  Sat Aug 13 19:57:36 2016
(r304057)
+++ head/usr.bin/nfsstat/nfsstat.c  Sat Aug 13 20:14:44 2016
(r304058)
@@ -29,6 +29,36 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
+/*-
+ * Copyright (c) 2004, 2008, 2009 Silicon Graphics International Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions, and the following disclaimer,
+ *without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *substantially similar to the "NO WARRANTY" disclaimer below
+ *("Disclaimer") and any redistribution must be conditioned upon
+ *including a substantially similar Disclaimer requirement for further
+ *binary redistribution.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
 
 #ifndef lint
 static const char copyright[] =
@@ -64,33 +94,57 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 static int widemode = 0;
 static int zflag = 0;
 static int printtitle = 1;
-static struct ext_nfsstats ext_nfsstats;
+static struct nfsstatsv1 ext_nfsstats;
 static int extra_output = 0;
 
 static void intpr(int, int);
-static void printhdr(int, int);
+static void printhdr(int, int, int);
 static void usage(void);
 static char *sperc1(int, int);
 static char *sperc2(int, int);
 static void exp_intpr(int, int);
-static void exp_sidewaysintpr(u_int, int, int);
+static void exp_sidewaysintpr(u_int, int, int, int);
+static void compute_new_stats(struct nfsstatsv1 *cur_stats,
+struct nfsstatsv1 *prev_stats, int curop, long double etime,
+long double *mbsec, long double *kb_per_transfer,
+long double *transfers_per_second, long double *ms_per_transfer,
+uint64_t *queue_len, long double *busy_pct);
 
 #define DELTA(field)   (nfsstats.field - lastst.field)
 
+#defineSTAT_TYPE_READ  0
+#defineSTAT_TYPE_WRITE 1
+#defineSTAT_TYPE_COMMIT2
+#defineNUM_STAT_TYPES  3
+
+struct stattypes {
+   int stat_type;
+   int nfs_type;
+} static statstruct[] = {
+   {STAT_TYPE_READ, NFSV4OP_READ},
+   {STAT_TYPE_WRITE, NFSV4OP_WRITE},
+   {STAT_TYPE_COMMIT, NFSV4OP_COMMIT}
+};
+
+#defineSTAT_TYPE_TO_NFS(stat_type) statstruct[stat_type].nfs_type
+
 int
 main(int argc, char **argv)
 {
u_int interval;
int clientOnly = -1;
int serverOnly = -1;
+   int newStats = 0;
int ch;
char *memf, *nlistf;
int mntlen, i;
@@ -100,7 +154,7 @@ main(int argc, char **argv)
 
interval = 0;
memf = nlistf = NULL;
-   while ((ch = getopt(argc, argv, "cesWM:mN:w:z")) != -1)
+   while ((ch = getopt(argc, argv, "cdesWM:mN:w:z")) != -1)
switch(ch) {
case 'M':
memf = optarg;
@@ -140,6 +194,11 @@ main(int argc, char **argv)
if (serverOnly < 0)
serverOnly = 0;
break;
+   case 'd':
+   newStats = 1;
+   if (interval == 0)
+   interval = 1;
+   break;
case 's':
serverOnly = 1;
if (clientOnly 

svn commit: r304057 - in vendor/illumos/dist: cmd/dtrace/test/cmd/scripts cmd/dtrace/test/tst/common/sugar lib/libdtrace/common

2016-08-13 Thread Mark Johnston
Author: markj
Date: Sat Aug 13 19:57:36 2016
New Revision: 304057
URL: https://svnweb.freebsd.org/changeset/base/304057

Log:
  7085 add support for "if" and "else" statements in dtrace
  
  illumos/illumos-gate@c3bd3abd8856e8e75d820f65c58031cd6cbac818
  
  Add syntactic sugar to dtrace: "if" and "else" statements. The sugar is
  baked down to standard dtrace features by adding additional clauses with
  the appropriate predicates.
  
  Reviewed by: Adam Leventhal 
  Reviewed by: Sebastien Roy 
  Reviewed by: Paul Dagnelie 
  Reviewed by: Bryan Cantrill 
  Approved by: Richard Lowe 
  Author: Matthew Ahrens 

Added:
  vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/
  vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/tst.else.d
  vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/tst.if.d
  vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/tst.if2.d
  vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/tst.if_before_after.d
  vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/tst.if_nested.d
  
vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/tst.if_trailing_semicolon.d
  
vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/tst.if_trailing_semicolon2.d
  vendor/illumos/dist/lib/libdtrace/common/dt_sugar.c
Modified:
  vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dstyle.pl
  vendor/illumos/dist/lib/libdtrace/common/dt_cc.c
  vendor/illumos/dist/lib/libdtrace/common/dt_grammar.y
  vendor/illumos/dist/lib/libdtrace/common/dt_impl.h
  vendor/illumos/dist/lib/libdtrace/common/dt_open.c
  vendor/illumos/dist/lib/libdtrace/common/dt_parser.c
  vendor/illumos/dist/lib/libdtrace/common/dt_parser.h
  vendor/illumos/dist/lib/libdtrace/common/dtrace.h

Modified: vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dstyle.pl
==
--- vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dstyle.pl   Sat Aug 13 
19:54:32 2016(r304056)
+++ vendor/illumos/dist/cmd/dtrace/test/cmd/scripts/dstyle.pl   Sat Aug 13 
19:57:36 2016(r304057)
@@ -25,6 +25,10 @@
 # Use is subject to license terms.
 #
 
+#
+# Copyright (c) 2014, 2016 by Delphix. All rights reserved.
+#
+
 require 5.8.4;
 
 $PNAME = $0;
@@ -131,7 +135,8 @@ sub dstyle
}
 
if (!/^enum/ && !/^\t*struct/ && !/^\t*union/ && !/^typedef/ &&
-   !/^translator/ && !/^provider/) {
+   !/^translator/ && !/^provider/ && !/\tif / &&
+   !/ else /) {
if (/[\w\s]+{/) {
err "left brace not on its own line";
}
@@ -141,7 +146,7 @@ sub dstyle
}
}
 
-   if (!/;$/) {
+   if (!/;$/ && !/\t*}$/ && !/ else /) {
if (/[\w\s]+}/) {
err "right brace not on its own line";
}

Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/tst.else.d
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/tst.else.d Sat Aug 
13 19:57:36 2016(r304057)
@@ -0,0 +1,33 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2014, 2016 by Delphix. All rights reserved.
+ */
+
+/*
+ * ASSERTION:
+ *   "else" statement is executed
+ */
+
+BEGIN
+{
+   if (0) {
+   n = 1;
+   } else {
+   n = 0;
+   }
+   exit(n)
+}

Added: vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/tst.if.d
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/tst.if.d   Sat Aug 
13 19:57:36 2016(r304057)
@@ -0,0 +1,33 @@
+/*
+ * CDDL HEADER START
+ *
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2014, 2016 

svn commit: r304056 - vendor/illumos/dist/lib/libdtrace/common

2016-08-13 Thread Mark Johnston
Author: markj
Date: Sat Aug 13 19:54:32 2016
New Revision: 304056
URL: https://svnweb.freebsd.org/changeset/base/304056

Log:
  5396 fix longjmp clobbering errors
  
  illumos/illumos-gate@67a4bb8f9ad4c49e9aa9e21e2114a7c093c3a73a
  
  Reviewed by: Josef 'Jeff' Sipek 
  Reviewed by: Igor Kozhukhov 
  Approved by: Richard Lowe 
  Author: Gary Mills 

Modified:
  vendor/illumos/dist/lib/libdtrace/common/dt_cc.c

Modified: vendor/illumos/dist/lib/libdtrace/common/dt_cc.c
==
--- vendor/illumos/dist/lib/libdtrace/common/dt_cc.cSat Aug 13 19:51:00 
2016(r304055)
+++ vendor/illumos/dist/lib/libdtrace/common/dt_cc.cSat Aug 13 19:54:32 
2016(r304056)
@@ -23,6 +23,7 @@
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2013, Joyent Inc. All rights reserved.
  * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright 2015 Gary Mills
  */
 
 /*
@@ -2335,7 +2336,7 @@ dt_compile(dtrace_hdl_t *dtp, int contex
dt_node_t *dnp;
dt_decl_t *ddp;
dt_pcb_t pcb;
-   void *rv;
+   void *volatile rv;
int err;
 
if ((fp == NULL && s == NULL) || (cflags & ~DTRACE_C_MASK) != 0) {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304055 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2016-08-13 Thread Mark Johnston
Author: markj
Date: Sat Aug 13 19:51:00 2016
New Revision: 304055
URL: https://svnweb.freebsd.org/changeset/base/304055

Log:
  Fix handling of forward enum declarations in the CTF tools.
  
  Reported by:  mmacy
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
  head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c
==
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Aug 13 19:49:32 
2016(r304054)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Aug 13 19:51:00 
2016(r304055)
@@ -816,6 +816,11 @@ die_enum_create(dwarf_t *dw, Dwarf_Die d
Dwarf_Unsigned uval;
Dwarf_Signed sval;
 
+   if (die_isdecl(dw, die)) {
+   tdp->t_type = FORWARD;
+   return;
+   }
+
debug(3, "die %llu: creating enum\n", off);
 
tdp->t_type = ENUM;

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c
==
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Sat Aug 13 19:49:32 
2016(r304054)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Sat Aug 13 19:51:00 
2016(r304055)
@@ -338,7 +338,8 @@ fwd_equiv(tdesc_t *ctdp, tdesc_t *mtdp)
 {
tdesc_t *defn = (ctdp->t_type == FORWARD ? mtdp : ctdp);
 
-   return (defn->t_type == STRUCT || defn->t_type == UNION);
+   return (defn->t_type == STRUCT || defn->t_type == UNION ||
+   defn->t_type == ENUM);
 }
 
 static int
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304054 - head/sys/vm

2016-08-13 Thread Mark Johnston
Author: markj
Date: Sat Aug 13 19:49:32 2016
New Revision: 304054
URL: https://svnweb.freebsd.org/changeset/base/304054

Log:
  Strengthen assertions about the busy state of newly-allocated pages.
  
  Reviewed by:  alc
  MFC after:1 week

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Sat Aug 13 19:48:43 2016(r304053)
+++ head/sys/vm/vm_page.c   Sat Aug 13 19:49:32 2016(r304054)
@@ -1712,8 +1712,7 @@ vm_page_alloc(vm_object_t object, vm_pin
("vm_page_alloc: page %p has unexpected queue %d", m, m->queue));
KASSERT(m->wire_count == 0, ("vm_page_alloc: page %p is wired", m));
KASSERT(m->hold_count == 0, ("vm_page_alloc: page %p is held", m));
-   KASSERT(!vm_page_sbusied(m),
-   ("vm_page_alloc: page %p is busy", m));
+   KASSERT(!vm_page_busied(m), ("vm_page_alloc: page %p is busy", m));
KASSERT(m->dirty == 0, ("vm_page_alloc: page %p is dirty", m));
KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT,
("vm_page_alloc: page %p has unexpected memattr %d", m,
@@ -2021,7 +2020,7 @@ vm_page_alloc_init(vm_page_t m)
("vm_page_alloc_init: page %p is wired", m));
KASSERT(m->hold_count == 0,
("vm_page_alloc_init: page %p is held", m));
-   KASSERT(!vm_page_sbusied(m),
+   KASSERT(!vm_page_busied(m),
("vm_page_alloc_init: page %p is busy", m));
KASSERT(m->dirty == 0,
("vm_page_alloc_init: page %p is dirty", m));
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304053 - head/sys/vm

2016-08-13 Thread Mark Johnston
Author: markj
Date: Sat Aug 13 19:48:43 2016
New Revision: 304053
URL: https://svnweb.freebsd.org/changeset/base/304053

Log:
  Initialize page busy lock state in vm_phys_add_page().
  
  MFC after:1 week

Modified:
  head/sys/vm/vm_phys.c

Modified: head/sys/vm/vm_phys.c
==
--- head/sys/vm/vm_phys.c   Sat Aug 13 18:57:14 2016(r304052)
+++ head/sys/vm/vm_phys.c   Sat Aug 13 19:48:43 2016(r304053)
@@ -741,6 +741,7 @@ vm_phys_add_page(vm_paddr_t pa)
 
vm_cnt.v_page_count++;
m = vm_phys_paddr_to_vm_page(pa);
+   m->busy_lock = VPB_UNBUSIED;
m->phys_addr = pa;
m->queue = PQ_NONE;
m->segind = vm_phys_paddr_to_segind(pa);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r304046 - in head: sbin/ipfw sys/conf sys/modules sys/modules/ipfw_nat64 sys/netinet sys/netinet6 sys/netpfil/ipfw/nat64

2016-08-13 Thread Konstantin Belousov
On Sat, Aug 13, 2016 at 04:09:49PM +, Andrey V. Elsukov wrote:
> Author: ae
> Date: Sat Aug 13 16:09:49 2016
> New Revision: 304046
> URL: https://svnweb.freebsd.org/changeset/base/304046
> 
> Log:
>   Add ipfw_nat64 module that implements stateless and stateful NAT64.

--- all_subdir_ipfw_nat64 ---
/usr/home/kostik/work/build/bsd/DEV/src/sys/modules/ipfw_nat64/../../netpfil/ipfw/nat64/nat64lsn_control.c:737:7:
 error: format specifies type 'unsigned long' but the argument has type 
'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]
next_idx, addr, cfg->pmask4);
^~~~

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


Re: svn commit: r304052 - in head/sys/powerpc: booke powerpc

2016-08-13 Thread Justin Hibbits
On Sat, 13 Aug 2016 18:57:14 + (UTC)
Justin Hibbits  wrote:

> Author: jhibbits
> Date: Sat Aug 13 18:57:14 2016
> New Revision: 304052
> URL: https://svnweb.freebsd.org/changeset/base/304052
> 
> Log:
>   Add missing pmap_kenter() method for book-e.

This should obviously be pmap_kremove().

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


svn commit: r304052 - in head/sys/powerpc: booke powerpc

2016-08-13 Thread Justin Hibbits
Author: jhibbits
Date: Sat Aug 13 18:57:14 2016
New Revision: 304052
URL: https://svnweb.freebsd.org/changeset/base/304052

Log:
  Add missing pmap_kenter() method for book-e.
  
  This isn't added to AIM yet, because it's not yet needed.  It's needed for
  Book-E ePAPR boot support.
  
  X-MFC With:   r304047

Modified:
  head/sys/powerpc/booke/pmap.c
  head/sys/powerpc/powerpc/mmu_if.m
  head/sys/powerpc/powerpc/pmap_dispatch.c

Modified: head/sys/powerpc/booke/pmap.c
==
--- head/sys/powerpc/booke/pmap.c   Sat Aug 13 18:46:49 2016
(r304051)
+++ head/sys/powerpc/booke/pmap.c   Sat Aug 13 18:57:14 2016
(r304052)
@@ -385,7 +385,7 @@ static mmu_method_t mmu_booke_methods[] 
MMUMETHOD(mmu_kenter,   mmu_booke_kenter),
MMUMETHOD(mmu_kenter_attr,  mmu_booke_kenter_attr),
MMUMETHOD(mmu_kextract, mmu_booke_kextract),
-/* MMUMETHOD(mmu_kremove,  mmu_booke_kremove), */
+   MMUMETHOD(mmu_kremove,  mmu_booke_kremove),
MMUMETHOD(mmu_unmapdev, mmu_booke_unmapdev),
MMUMETHOD(mmu_change_attr,  mmu_booke_change_attr),
 

Modified: head/sys/powerpc/powerpc/mmu_if.m
==
--- head/sys/powerpc/powerpc/mmu_if.m   Sat Aug 13 18:46:49 2016
(r304051)
+++ head/sys/powerpc/powerpc/mmu_if.m   Sat Aug 13 18:57:14 2016
(r304052)
@@ -870,6 +870,16 @@ METHOD void kenter_attr {
 } DEFAULT mmu_null_kenter_attr;
 
 /**
+ * @brief Unmap a wired page from kernel virtual address space
+ *
+ * @param _va  mapped virtual address
+ */
+METHOD void kremove {
+   mmu_t   _mmu;
+   vm_offset_t _va;
+};
+
+/**
  * @brief Determine if the given physical address range has been direct-mapped.
  *
  * @param _pa  physical address start

Modified: head/sys/powerpc/powerpc/pmap_dispatch.c
==
--- head/sys/powerpc/powerpc/pmap_dispatch.cSat Aug 13 18:46:49 2016
(r304051)
+++ head/sys/powerpc/powerpc/pmap_dispatch.cSat Aug 13 18:57:14 2016
(r304052)
@@ -510,6 +510,14 @@ pmap_kenter_attr(vm_offset_t va, vm_offs
MMU_KENTER_ATTR(mmu_obj, va, pa, ma);
 }
 
+void
+pmap_kremove(vm_offset_t va)
+{
+
+   CTR2(KTR_PMAP, "%s(%#x)", __func__, va);
+   return (MMU_KREMOVE(mmu_obj, va));
+}
+
 boolean_t
 pmap_dev_direct_mapped(vm_paddr_t pa, vm_size_t size)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304051 - in head/sys/powerpc: aim booke powerpc

2016-08-13 Thread Justin Hibbits
Author: jhibbits
Date: Sat Aug 13 18:46:49 2016
New Revision: 304051
URL: https://svnweb.freebsd.org/changeset/base/304051

Log:
  Add a kdb show command to print arbitrary SPRs on PowerPC
  
  Summary:
  There is often a need at the debugger to print arbitrary special
  purpose registers (SPRs) on PowerPC.  Using a rewritable asm stub, print any 
SPR
  provided on the command line.
  
  Note, as there is no checking in this, attempting to print a nonexistent SPR
  may cause a Program exception (illegal instruction, or boundedly undefined).
  
  Note also that this relies on the kernel text pages being writable.  If in the
  future this is made not the case, this will need to be reworked.
  
  Test Plan:
  Printing the Processor Version Register (PVR, SPR 287):
  
  db> show spr 11f
  SPR 287(11f): 80240012
  
  Differential Revision: https://reviews.freebsd.org/D7403

Modified:
  head/sys/powerpc/aim/locore.S
  head/sys/powerpc/booke/locore.S
  head/sys/powerpc/powerpc/machdep.c

Modified: head/sys/powerpc/aim/locore.S
==
--- head/sys/powerpc/aim/locore.S   Sat Aug 13 18:10:32 2016
(r304050)
+++ head/sys/powerpc/aim/locore.S   Sat Aug 13 18:46:49 2016
(r304051)
@@ -6,3 +6,10 @@
 #include 
 #endif
 
+/*
+ * XXX: This should be moved to a shared AIM/booke asm file, if one ever is
+ * created.
+ */
+ENTRY(get_spr)
+   mfspr   %r3, 0
+   blr

Modified: head/sys/powerpc/booke/locore.S
==
--- head/sys/powerpc/booke/locore.S Sat Aug 13 18:10:32 2016
(r304050)
+++ head/sys/powerpc/booke/locore.S Sat Aug 13 18:46:49 2016
(r304051)
@@ -848,6 +848,14 @@ ENTRY(dataloss_erratum_access)
 
blr
 
+/*
+ * XXX: This should be moved to a shared AIM/booke asm file, if one ever is
+ * created.
+ */
+ENTRY(get_spr)
+   mfspr   %r3, 0
+   blr
+
 //
 /* Data section
*/
 //

Modified: head/sys/powerpc/powerpc/machdep.c
==
--- head/sys/powerpc/powerpc/machdep.c  Sat Aug 13 18:10:32 2016
(r304050)
+++ head/sys/powerpc/powerpc/machdep.c  Sat Aug 13 18:46:49 2016
(r304051)
@@ -516,3 +516,31 @@ spinlock_exit(void)
}
 }
 
+/*
+ * Simple ddb(4) command/hack to view any SPR on the running CPU.
+ * Uses a trivial asm function to perform the mfspr, and rewrites the mfspr
+ * instruction each time.
+ * XXX: Since it uses code modification, it won't work if the kernel code pages
+ * are marked RO.
+ */
+extern register_t get_spr(int);
+
+DB_SHOW_COMMAND(spr, db_show_spr)
+{
+   register_t spr;
+   volatile uint32_t *p;
+   int sprno, saved_sprno;
+
+   if (!have_addr)
+   return;
+
+   saved_sprno = sprno = (intptr_t) addr;
+   sprno = ((sprno & 0x3e0) >> 5) | ((sprno & 0x1f) << 5);
+   p = (uint32_t *)(void *)_spr;
+   *p = (*p & ~0x001ff800) | (sprno << 11);
+   __syncicache(get_spr, cacheline_size);
+   spr = get_spr(sprno);
+
+   db_printf("SPR %d(%x): %lx\n", saved_sprno, saved_sprno,
+   (unsigned long)spr);
+}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304050 - head/sys/kern

2016-08-13 Thread Alan Cox
Author: alc
Date: Sat Aug 13 18:10:32 2016
New Revision: 304050
URL: https://svnweb.freebsd.org/changeset/base/304050

Log:
  Eliminate two calls to vm_page_xunbusy() that are both unnecessary and
  incorrect from the error cases in exec_map_first_page().  They are
  unnecessary because we automatically unbusy the page in vm_page_free()
  when we remove it from the object.  The calls are incorrect because they
  happen after the page is freed, so we might actually unbusy the page
  after it has been reallocated to a different object.  (This error was
  introduced in r292373.)
  
  Reviewed by:  kib
  MFC after:1 week

Modified:
  head/sys/kern/kern_exec.c

Modified: head/sys/kern/kern_exec.c
==
--- head/sys/kern/kern_exec.c   Sat Aug 13 16:45:14 2016(r304049)
+++ head/sys/kern/kern_exec.c   Sat Aug 13 18:10:32 2016(r304050)
@@ -990,7 +990,6 @@ exec_map_first_page(imgp)
vm_page_lock(ma[0]);
vm_page_free(ma[0]);
vm_page_unlock(ma[0]);
-   vm_page_xunbusy(ma[0]);
VM_OBJECT_WUNLOCK(object);
return (EIO);
}
@@ -1018,7 +1017,6 @@ exec_map_first_page(imgp)
vm_page_lock(ma[i]);
vm_page_free(ma[i]);
vm_page_unlock(ma[i]);
-   vm_page_xunbusy(ma[i]);
}
VM_OBJECT_WUNLOCK(object);
return (EIO);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304049 - in head: sbin/ipfw sys/netinet sys/netpfil/ipfw/nptv6

2016-08-13 Thread Andrey V. Elsukov
Author: ae
Date: Sat Aug 13 16:45:14 2016
New Revision: 304049
URL: https://svnweb.freebsd.org/changeset/base/304049

Log:
  Add `stats reset` command implementation to NPTv6 module
  to be able reset statistics counters.
  
  Obtained from:Yandex LLC
  Sponsored by: Yandex LLC

Modified:
  head/sbin/ipfw/ipfw.8
  head/sbin/ipfw/nptv6.c
  head/sys/netinet/ip_fw.h
  head/sys/netpfil/ipfw/nptv6/nptv6.c

Modified: head/sbin/ipfw/ipfw.8
==
--- head/sbin/ipfw/ipfw.8   Sat Aug 13 16:26:15 2016(r304048)
+++ head/sbin/ipfw/ipfw.8   Sat Aug 13 16:45:14 2016(r304049)
@@ -156,7 +156,7 @@ in-kernel NAT.
 .Brq Ar name | all
 .Cm destroy
 .Nm
-.Oo Cm set Ar N Oc Cm nptv6 Ar name Cm stats
+.Oo Cm set Ar N Oc Cm nptv6 Ar name Cm stats Op Cm reset
 .Ss INTERNAL DIAGNOSTICS
 .Nm
 .Cm internal iflist

Modified: head/sbin/ipfw/nptv6.c
==
--- head/sbin/ipfw/nptv6.c  Sat Aug 13 16:26:15 2016(r304048)
+++ head/sbin/ipfw/nptv6.c  Sat Aug 13 16:45:14 2016(r304049)
@@ -56,6 +56,7 @@ static int nptv6_foreach(nptv6_cb_t *f, 
 static void nptv6_create(const char *name, uint8_t set, int ac, char **av);
 static void nptv6_destroy(const char *name, uint8_t set);
 static void nptv6_stats(const char *name, uint8_t set);
+static void nptv6_reset_stats(const char *name, uint8_t set);
 static int nptv6_show_cb(ipfw_nptv6_cfg *cfg, const char *name, uint8_t set);
 static int nptv6_destroy_cb(ipfw_nptv6_cfg *cfg, const char *name, uint8_t 
set);
 
@@ -68,10 +69,15 @@ static struct _s_x nptv6cmds[] = {
   { NULL, 0 }
 };
 
+static struct _s_x nptv6statscmds[] = {
+  { "reset",   TOK_RESET },
+  { NULL, 0 }
+};
+
 /*
  * This one handles all NPTv6-related commands
  * ipfw [set N] nptv6 NAME {create | config} ...
- * ipfw [set N] nptv6 NAME stats
+ * ipfw [set N] nptv6 NAME stats [reset]
  * ipfw [set N] nptv6 {NAME | all} destroy
  * ipfw [set N] nptv6 {NAME | all} {list | show}
  */
@@ -119,7 +125,14 @@ ipfw_nptv6_handler(int ac, char *av[])
nptv6_destroy(name, set);
break;
case TOK_STATS:
-   nptv6_stats(name, set);
+   ac--; av++;
+   if (ac == 0) {
+   nptv6_stats(name, set);
+   break;
+   }
+   tcmd = get_token(nptv6statscmds, *av, "stats command");
+   if (tcmd == TOK_RESET)
+   nptv6_reset_stats(name, set);
}
 }
 
@@ -304,6 +317,21 @@ nptv6_stats(const char *name, uint8_t se
(uintmax_t)stats.dropped);
 }
 
+/*
+ * Reset NPTv6 instance statistics specified by @oh->ntlv.
+ * Request: [ ipfw_obj_header ]
+ */
+static void
+nptv6_reset_stats(const char *name, uint8_t set)
+{
+   ipfw_obj_header oh;
+
+   memset(, 0, sizeof(oh));
+   nptv6_fill_ntlv(, name, set);
+   if (do_set3(IP_FW_NPTV6_RESET_STATS, , sizeof(oh)) != 0)
+   err(EX_OSERR, "failed to reset stats for instance %s", name);
+}
+
 static int
 nptv6_show_cb(ipfw_nptv6_cfg *cfg, const char *name, uint8_t set)
 {

Modified: head/sys/netinet/ip_fw.h
==
--- head/sys/netinet/ip_fw.hSat Aug 13 16:26:15 2016(r304048)
+++ head/sys/netinet/ip_fw.hSat Aug 13 16:45:14 2016(r304049)
@@ -130,6 +130,7 @@ typedef struct _ip_fw3_opheader {
 #defineIP_FW_NPTV6_CONFIG  152 /* Modify NPTv6 instance */
 #defineIP_FW_NPTV6_LIST153 /* List NPTv6 instances */
 #defineIP_FW_NPTV6_STATS   154 /* Get NPTv6 instance 
statistics */
+#defineIP_FW_NPTV6_RESET_STATS 155 /* Reset NPTv6 instance 
statistics */
 
 /*
  * The kernel representation of ipfw rules is made of a list of

Modified: head/sys/netpfil/ipfw/nptv6/nptv6.c
==
--- head/sys/netpfil/ipfw/nptv6/nptv6.c Sat Aug 13 16:26:15 2016
(r304048)
+++ head/sys/netpfil/ipfw/nptv6/nptv6.c Sat Aug 13 16:45:14 2016
(r304049)
@@ -700,6 +700,9 @@ nptv6_stats(struct ip_fw_chain *ch, ip_f
oh = (ipfw_obj_header *)ipfw_get_sopt_header(sd, sz);
if (oh == NULL)
return (EINVAL);
+   if (ipfw_check_object_name_generic(oh->ntlv.name) != 0 ||
+   oh->ntlv.set >= IPFW_MAX_SETS)
+   return (EINVAL);
memset(, 0, sizeof(stats));
 
IPFW_UH_RLOCK(ch);
@@ -722,12 +725,45 @@ nptv6_stats(struct ip_fw_chain *ch, ip_f
return (0);
 }
 
+/*
+ * Reset NPTv6 statistics.
+ * Data layout (v0)(current):
+ * Request: [ ipfw_obj_header ]
+ *
+ * Returns 0 on success
+ */
+static int
+nptv6_reset_stats(struct ip_fw_chain *ch, ip_fw3_opheader *op,
+struct sockopt_data *sd)
+{
+   struct 

Re: svn commit: r303970 - in stable/11/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys

2016-08-13 Thread Slawa Olhovchenkov
On Fri, Aug 12, 2016 at 09:51:42AM +0300, Andriy Gapon wrote:

> On 12/08/2016 01:33, Slawa Olhovchenkov wrote:
> > MFC to 10.x/9.x planed?
> 
> I would like to do it, but it depends on how hard it would be to merge the 
> code.
> If it's trivial, then I'll certainly do it.
> If it's very hard, then I will not do it myself.  But if anybody merges and
> tests the change, then I'll be happy to commit it.

303970 cleanly applayed to stable/10 after 303969 (303969 cleanly
applayed w/o changed).

I am can't test result becaus don't touch bug.

> Also, I would normally use a much longer MFC period for such a change.  It was
> short only to get the change into 11.0.  So, I'll wait for a couple more weeks
> before even trying to MFC the change to stable/10 and 9.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304048 - head/sys/netpfil/ipfw/nat64

2016-08-13 Thread Andrey V. Elsukov
Author: ae
Date: Sat Aug 13 16:26:15 2016
New Revision: 304048
URL: https://svnweb.freebsd.org/changeset/base/304048

Log:
  Replace __noinline with special debug macro NAT64NOINLINE.

Modified:
  head/sys/netpfil/ipfw/nat64/nat64_translate.c
  head/sys/netpfil/ipfw/nat64/nat64lsn_control.c

Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c
==
--- head/sys/netpfil/ipfw/nat64/nat64_translate.c   Sat Aug 13 16:16:02 
2016(r304047)
+++ head/sys/netpfil/ipfw/nat64/nat64_translate.c   Sat Aug 13 16:26:15 
2016(r304048)
@@ -77,12 +77,12 @@ nat64_log(struct pfloghdr *logdata, stru
ipfw_bpf_mtap2(logdata, PFLOG_HDRLEN, m);
 }
 #ifdef IPFIREWALL_NAT64_DIRECT_OUTPUT
-static __noinline struct sockaddr* nat64_find_route4(struct route *ro,
+static NAT64NOINLINE struct sockaddr* nat64_find_route4(struct route *ro,
 in_addr_t dest, struct mbuf *m);
-static __noinline struct sockaddr* nat64_find_route6(struct route_in6 *ro,
+static NAT64NOINLINE struct sockaddr* nat64_find_route6(struct route_in6 *ro,
 struct in6_addr *dest, struct mbuf *m);
 
-static __noinline int
+static NAT64NOINLINE int
 nat64_output(struct ifnet *ifp, struct mbuf *m,
 struct sockaddr *dst, struct route *ro, nat64_stats_block *stats,
 void *logdata)
@@ -97,7 +97,7 @@ nat64_output(struct ifnet *ifp, struct m
return (error);
 }
 
-static __noinline int
+static NAT64NOINLINE int
 nat64_output_one(struct mbuf *m, nat64_stats_block *stats, void *logdata)
 {
struct route_in6 ro6;
@@ -144,7 +144,7 @@ nat64_output_one(struct mbuf *m, nat64_s
return (error);
 }
 #else /* !IPFIREWALL_NAT64_DIRECT_OUTPUT */
-static __noinline int
+static NAT64NOINLINE int
 nat64_output(struct ifnet *ifp, struct mbuf *m,
 struct sockaddr *dst, struct route *ro, nat64_stats_block *stats,
 void *logdata)
@@ -176,7 +176,7 @@ nat64_output(struct ifnet *ifp, struct m
return (ret);
 }
 
-static __noinline int
+static NAT64NOINLINE int
 nat64_output_one(struct mbuf *m, nat64_stats_block *stats, void *logdata)
 {
 
@@ -199,7 +199,7 @@ print_ipv6_header(struct ip6_hdr *ip6, c
 }
 
 
-static __noinline int
+static NAT64NOINLINE int
 nat64_embed_ip4(struct nat64_cfg *cfg, in_addr_t ia, struct in6_addr *ip6)
 {
 
@@ -239,7 +239,7 @@ nat64_embed_ip4(struct nat64_cfg *cfg, i
return (1);
 }
 
-static __noinline in_addr_t
+static NAT64NOINLINE in_addr_t
 nat64_extract_ip4(struct in6_addr *ip6, int plen)
 {
in_addr_t ia;
@@ -333,7 +333,7 @@ badip6:
  * IPv6 to IPv4:   HC' = cksum_add(HC, result)
  * IPv4 to IPv6:   HC' = cksum_add(HC, ~result)
  */
-static __noinline uint16_t
+static NAT64NOINLINE uint16_t
 nat64_cksum_convert(struct ip6_hdr *ip6, struct ip *ip)
 {
uint32_t sum;
@@ -356,7 +356,7 @@ nat64_cksum_convert(struct ip6_hdr *ip6,
 #if __FreeBSD_version < 110
 #defineip_fillid(ip)   (ip)->ip_id = ip_newid()
 #endif
-static __noinline void
+static NAT64NOINLINE void
 nat64_init_ip4hdr(const struct ip6_hdr *ip6, const struct ip6_frag *frag,
 uint16_t plen, uint8_t proto, struct ip *ip)
 {
@@ -386,7 +386,7 @@ nat64_init_ip4hdr(const struct ip6_hdr *
 }
 
 #defineFRAGSZ(mtu) ((mtu) - sizeof(struct ip6_hdr) - sizeof(struct 
ip6_frag))
-static __noinline int
+static NAT64NOINLINE int
 nat64_fragment6(nat64_stats_block *stats, struct ip6_hdr *ip6, struct mbufq 
*mq,
 struct mbuf *m, uint32_t mtu, uint16_t ip_id, uint16_t ip_off)
 {
@@ -474,7 +474,7 @@ fail:
 #definert_expire   rt_rmx.rmx_expire
 #definert_mtu  rt_rmx.rmx_mtu
 #endif
-static __noinline struct sockaddr*
+static NAT64NOINLINE struct sockaddr*
 nat64_find_route6(struct route_in6 *ro, struct in6_addr *dest, struct mbuf *m)
 {
struct sockaddr_in6 *dst;
@@ -503,7 +503,7 @@ nat64_find_route6(struct route_in6 *ro, 
 }
 
 #defineNAT64_ICMP6_PLEN64
-static __noinline void
+static NAT64NOINLINE void
 nat64_icmp6_reflect(struct mbuf *m, uint8_t type, uint8_t code, uint32_t mtu,
 nat64_stats_block *stats, void *logdata)
 {
@@ -600,7 +600,7 @@ freeit:
m_freem(m);
 }
 
-static __noinline struct sockaddr*
+static NAT64NOINLINE struct sockaddr*
 nat64_find_route4(struct route *ro, in_addr_t dest, struct mbuf *m)
 {
struct sockaddr_in *dst;
@@ -629,7 +629,7 @@ nat64_find_route4(struct route *ro, in_a
 }
 
 #defineNAT64_ICMP_PLEN 64
-static __noinline void
+static NAT64NOINLINE void
 nat64_icmp_reflect(struct mbuf *m, uint8_t type,
 uint8_t code, uint16_t mtu, nat64_stats_block *stats, void *logdata)
 {
@@ -738,7 +738,7 @@ nat64_icmp_handle_echo(struct ip6_hdr *i
IPPROTO_ICMPV6, ~icmp6->icmp6_cksum);
 }
 
-static __noinline struct mbuf *
+static NAT64NOINLINE struct mbuf *
 nat64_icmp_translate(struct mbuf *m, struct ip6_hdr *ip6, uint16_t icmpid,
 int offset, nat64_stats_block *stats)
 {

Modified: 

svn commit: r304047 - in head/sys/powerpc: booke mpc85xx

2016-08-13 Thread Justin Hibbits
Author: jhibbits
Date: Sat Aug 13 16:16:02 2016
New Revision: 304047
URL: https://svnweb.freebsd.org/changeset/base/304047

Log:
  Add ePAPR boot support for PowerPC book-E (MPC85xx) hardware
  
  Summary:
  u-boot, following the ePAPR specification, puts secondary cores into a
  spinloop at boot, rather than leaving them shut off.  It then relies on the 
host
  OS to write the correct values to a special spin table, located in coherent
  memory (on newer implementations), or noncoherent memory (older
  implementations).
  
  This supports both implementations of ePAPR, as well as continuing to support
  non-ePAPR booting, by first attempting to use the spintable, and falling back 
to
  expecting non-started CPUs.
  
  Test Plan:
  Booted on a P5020 board.  Tested before and after the changes.
  Before the changes, prints the error "SMP: CPU 1 already out of hold-off 
state!"
  and panics shortly thereafter.  After the changes, same boot method lets it
  complete boot.
  
  Reviewed by:  nwhitehorn
  MFC after:2 weeks
  Relnotes: Yes
  Sponsored by: Alex Perez/Inertial Computing
  Differential Revision: https://reviews.freebsd.org/D7494

Modified:
  head/sys/powerpc/booke/locore.S
  head/sys/powerpc/mpc85xx/platform_mpc85xx.c

Modified: head/sys/powerpc/booke/locore.S
==
--- head/sys/powerpc/booke/locore.S Sat Aug 13 16:09:49 2016
(r304046)
+++ head/sys/powerpc/booke/locore.S Sat Aug 13 16:16:02 2016
(r304047)
@@ -412,6 +412,8 @@ bp_kernload:
ori %r3, %r3, (MAS3_SX | MAS3_SW | MAS3_SR)@l
mtspr   SPR_MAS3, %r3
isync
+   bl  zero_mas7
+   bl  zero_mas8
tlbwe
isync
msync

Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c
==
--- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Aug 13 16:09:49 2016
(r304046)
+++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Aug 13 16:16:02 2016
(r304047)
@@ -39,7 +39,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -53,6 +55,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -63,6 +66,15 @@ extern void *ap_pcpu;
 extern vm_paddr_t kernload;/* Kernel physical load address */
 extern uint8_t __boot_page[];  /* Boot page body */
 extern uint32_t bp_kernload;
+
+struct cpu_release {
+   uint32_t entry_h;
+   uint32_t entry_l;
+   uint32_t r3_h;
+   uint32_t r3_l;
+   uint32_t reserved;
+   uint32_t pir;
+};
 #endif
 
 extern uint32_t *bootinfo;
@@ -316,6 +328,51 @@ mpc85xx_smp_get_bsp(platform_t plat, str
return (0);
 }
 
+#ifdef SMP
+static int
+mpc85xx_smp_start_cpu_epapr(platform_t plat, struct pcpu *pc)
+{
+   vm_paddr_t rel_pa, bptr;
+   volatile struct cpu_release *rel;
+   vm_offset_t rel_va, rel_page;
+   phandle_t node;
+   int i;
+
+   /* If we're calling this, the node already exists. */
+   node = OF_finddevice("/cpus");
+   for (i = 0, node = OF_child(node); i < pc->pc_cpuid;
+   i++, node = OF_peer(node))
+   ;
+   if (OF_getencprop(node, "cpu-release-addr", (pcell_t *)_pa,
+   sizeof(rel_pa)) == -1) {
+   return (ENOENT);
+   }
+
+   rel_page = kva_alloc(PAGE_SIZE);
+   if (rel_page == 0)
+   return (ENOMEM);
+
+   critical_enter();
+   rel_va = rel_page + (rel_pa & PAGE_MASK);
+   pmap_kenter(rel_page, rel_pa & ~PAGE_MASK);
+   rel = (struct cpu_release *)rel_va;
+   bptr = ((vm_paddr_t)(uintptr_t)__boot_page - KERNBASE) + kernload;
+   cpu_flush_dcache(__DEVOLATILE(struct cpu_release *,rel), sizeof(*rel));
+   rel->pir = pc->pc_cpuid; __asm __volatile("sync");
+   rel->entry_h = (bptr >> 32);
+   rel->entry_l = bptr; __asm __volatile("sync");
+   cpu_flush_dcache(__DEVOLATILE(struct cpu_release *,rel), sizeof(*rel));
+   if (bootverbose)
+   printf("Waking up CPU %d via CPU release page %p\n",
+   pc->pc_cpuid, rel);
+   critical_exit();
+   pmap_kremove(rel_page);
+   kva_free(rel_page, PAGE_SIZE);
+
+   return (0);
+}
+#endif
+
 static int
 mpc85xx_smp_start_cpu(platform_t plat, struct pcpu *pc)
 {
@@ -325,6 +382,7 @@ mpc85xx_smp_start_cpu(platform_t plat, s
int timeout;
uintptr_t brr;
int cpuid;
+   int epapr_boot = 0;
uint32_t tgt;
 
if (mpc85xx_is_qoriq()) {
@@ -342,6 +400,20 @@ mpc85xx_smp_start_cpu(platform_t plat, s
cpuid = pc->pc_cpuid + 24;
}
bp_kernload = kernload;
+   /*
+* bp_kernload is in the boot page.  Sync the cache because ePAPR
+* booting has the other core(s) already running.
+*/
+   __syncicache(_kernload, 

svn commit: r304046 - in head: sbin/ipfw sys/conf sys/modules sys/modules/ipfw_nat64 sys/netinet sys/netinet6 sys/netpfil/ipfw/nat64

2016-08-13 Thread Andrey V. Elsukov
Author: ae
Date: Sat Aug 13 16:09:49 2016
New Revision: 304046
URL: https://svnweb.freebsd.org/changeset/base/304046

Log:
  Add ipfw_nat64 module that implements stateless and stateful NAT64.
  
  The module works together with ipfw(4) and implemented as its external
  action module.
  
  Stateless NAT64 registers external action with name nat64stl. This
  keyword should be used to create NAT64 instance and to address this
  instance in rules. Stateless NAT64 uses two lookup tables with mapped
  IPv4->IPv6 and IPv6->IPv4 addresses to perform translation.
  
  A configuration of instance should looks like this:
   1. Create lookup tables:
   # ipfw table T46 create type addr valtype ipv6
   # ipfw table T64 create type addr valtype ipv4
   2. Fill T46 and T64 tables.
   3. Add rule to allow neighbor solicitation and advertisement:
   # ipfw add allow icmp6 from any to any icmp6types 135,136
   4. Create NAT64 instance:
   # ipfw nat64stl NAT create table4 T46 table6 T64
   5. Add rules that matches the traffic:
   # ipfw add nat64stl NAT ip from any to table(T46)
   # ipfw add nat64stl NAT ip from table(T64) to 64:ff9b::/96
   6. Configure DNS64 for IPv6 clients and add route to 64:ff9b::/96
  via NAT64 host.
  
  Stateful NAT64 registers external action with name nat64lsn. The only
  one option required to create nat64lsn instance - prefix4. It defines
  the pool of IPv4 addresses used for translation.
  
  A configuration of instance should looks like this:
   1. Add rule to allow neighbor solicitation and advertisement:
   # ipfw add allow icmp6 from any to any icmp6types 135,136
   2. Create NAT64 instance:
   # ipfw nat64lsn NAT create prefix4 A.B.C.D/28
   3. Add rules that matches the traffic:
   # ipfw add nat64lsn NAT ip from any to A.B.C.D/28
   # ipfw add nat64lsn NAT ip6 from any to 64:ff9b::/96
   4. Configure DNS64 for IPv6 clients and add route to 64:ff9b::/96
  via NAT64 host.
  
  Obtained from:Yandex LLC
  Relnotes: yes
  Sponsored by: Yandex LLC
  Differential Revision:https://reviews.freebsd.org/D6434

Added:
  head/sbin/ipfw/nat64lsn.c   (contents, props changed)
  head/sbin/ipfw/nat64stl.c   (contents, props changed)
  head/sys/modules/ipfw_nat64/
  head/sys/modules/ipfw_nat64/Makefile   (contents, props changed)
  head/sys/netinet6/ip_fw_nat64.h   (contents, props changed)
  head/sys/netpfil/ipfw/nat64/
  head/sys/netpfil/ipfw/nat64/ip_fw_nat64.c   (contents, props changed)
  head/sys/netpfil/ipfw/nat64/ip_fw_nat64.h   (contents, props changed)
  head/sys/netpfil/ipfw/nat64/nat64_translate.c   (contents, props changed)
  head/sys/netpfil/ipfw/nat64/nat64_translate.h   (contents, props changed)
  head/sys/netpfil/ipfw/nat64/nat64lsn.c   (contents, props changed)
  head/sys/netpfil/ipfw/nat64/nat64lsn.h   (contents, props changed)
  head/sys/netpfil/ipfw/nat64/nat64lsn_control.c   (contents, props changed)
  head/sys/netpfil/ipfw/nat64/nat64stl.c   (contents, props changed)
  head/sys/netpfil/ipfw/nat64/nat64stl.h   (contents, props changed)
  head/sys/netpfil/ipfw/nat64/nat64stl_control.c   (contents, props changed)
Modified:
  head/sbin/ipfw/Makefile
  head/sbin/ipfw/ipfw.8
  head/sbin/ipfw/ipfw2.c
  head/sbin/ipfw/ipfw2.h
  head/sbin/ipfw/main.c
  head/sbin/ipfw/tables.c
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/modules/Makefile
  head/sys/netinet/ip_fw.h

Modified: head/sbin/ipfw/Makefile
==
--- head/sbin/ipfw/Makefile Sat Aug 13 15:59:18 2016(r304045)
+++ head/sbin/ipfw/Makefile Sat Aug 13 16:09:49 2016(r304046)
@@ -5,7 +5,7 @@
 PACKAGE=ipfw
 PROG=  ipfw
 SRCS=  ipfw2.c dummynet.c ipv6.c main.c nat.c tables.c
-SRCS+= nptv6.c
+SRCS+= nat64lsn.c nat64stl.c nptv6.c
 WARNS?=2
 
 .if ${MK_PF} != "no"

Modified: head/sbin/ipfw/ipfw.8
==
--- head/sbin/ipfw/ipfw.8   Sat Aug 13 15:59:18 2016(r304045)
+++ head/sbin/ipfw/ipfw.8   Sat Aug 13 16:09:49 2016(r304046)
@@ -1,7 +1,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 19, 2016
+.Dd August 13, 2016
 .Dt IPFW 8
 .Os
 .Sh NAME
@@ -113,6 +113,37 @@ in-kernel NAT.
 .Oc
 .Oc
 .Ar pathname
+.Ss STATEFUL IPv6/IPv4 NETWORK ADDRESS AND PROTOCOL TRANSLATION
+.Nm
+.Oo Cm set Ar N Oc Cm nat64lsn Ar name Cm create Ar create-options
+.Nm
+.Oo Cm set Ar N Oc Cm nat64lsn Ar name Cm config Ar config-options
+.Nm
+.Oo Cm set Ar N Oc Cm nat64lsn
+.Brq Ar name | all
+.Brq Cm list | show
+.Op Cm states
+.Nm
+.Oo Cm set Ar N Oc Cm nat64lsn
+.Brq Ar name | all
+.Cm destroy
+.Nm
+.Oo Cm set Ar N Oc Cm nat64lsn Ar name Cm stats Op Cm reset
+.Ss STATELESS IPv6/IPv4 NETWORK ADDRESS AND PROTOCOL TRANSLATION
+.Nm
+.Oo Cm set Ar N Oc Cm nat64stl Ar name Cm create Ar create-options
+.Nm
+.Oo Cm set Ar N Oc Cm nat64stl Ar name Cm config Ar config-options
+.Nm
+.Oo Cm set Ar N Oc Cm nat64stl
+.Brq Ar name | all

svn commit: r304045 - head/share/timedef

2016-08-13 Thread Baptiste Daroussin
Author: bapt
Date: Sat Aug 13 15:59:18 2016
New Revision: 304045
URL: https://svnweb.freebsd.org/changeset/base/304045

Log:
  Set date and time formats back to what they were before CLDR
  
  While CLDR brings us a good and up to date source data to generate locales for
  all databses we are using for locales, it is not the case of LC_TIME. Where it
  does not defines the informations we need.
  
  Put back all the date and time formats from the old locales.
  Make it statically for now (in order to be able to merge it now into
  11.0-RELEASE). The generation tools will be updated soon.
  
  That gives us time to properly work on LC_TIME during the 12 timeframe.
  
  While here fix abbreviated month for af_ZA (which are already fixed in CLDR
  data upstream)
  
  In locales where AP/PM was not defined before CLDR data, remove again the 
AP/PM
  informations
  
  For locales where AP/PM was defined before CLDR data, keep the CLDR 
information
  which was properly translated.
  
  MFC after:3 days

Modified:
  head/share/timedef/af_ZA.UTF-8.src
  head/share/timedef/am_ET.UTF-8.src
  head/share/timedef/ar_JO.UTF-8.src
  head/share/timedef/ar_MA.UTF-8.src
  head/share/timedef/ar_SA.UTF-8.src
  head/share/timedef/be_BY.CP1131.src
  head/share/timedef/be_BY.CP1251.src
  head/share/timedef/be_BY.ISO8859-5.src
  head/share/timedef/be_BY.UTF-8.src
  head/share/timedef/bg_BG.CP1251.src
  head/share/timedef/bg_BG.UTF-8.src
  head/share/timedef/ca_IT.ISO8859-15.src
  head/share/timedef/ca_IT.UTF-8.src
  head/share/timedef/cs_CZ.ISO8859-2.src
  head/share/timedef/cs_CZ.UTF-8.src
  head/share/timedef/da_DK.ISO8859-15.src
  head/share/timedef/da_DK.UTF-8.src
  head/share/timedef/de_AT.ISO8859-15.src
  head/share/timedef/de_AT.UTF-8.src
  head/share/timedef/de_DE.ISO8859-15.src
  head/share/timedef/de_DE.UTF-8.src
  head/share/timedef/el_GR.ISO8859-7.src
  head/share/timedef/el_GR.UTF-8.src
  head/share/timedef/en_CA.UTF-8.src
  head/share/timedef/en_GB.UTF-8.src
  head/share/timedef/en_IE.UTF-8.src
  head/share/timedef/en_PH.UTF-8.src
  head/share/timedef/en_SG.UTF-8.src
  head/share/timedef/en_US.UTF-8.src
  head/share/timedef/en_ZA.UTF-8.src
  head/share/timedef/es_AR.ISO8859-1.src
  head/share/timedef/es_CR.UTF-8.src
  head/share/timedef/es_ES.ISO8859-15.src
  head/share/timedef/es_ES.UTF-8.src
  head/share/timedef/es_MX.ISO8859-1.src
  head/share/timedef/es_MX.UTF-8.src
  head/share/timedef/et_EE.ISO8859-15.src
  head/share/timedef/eu_ES.UTF-8.src
  head/share/timedef/fi_FI.ISO8859-15.src
  head/share/timedef/fi_FI.UTF-8.src
  head/share/timedef/fr_BE.ISO8859-15.src
  head/share/timedef/fr_BE.UTF-8.src
  head/share/timedef/fr_CA.ISO8859-15.src
  head/share/timedef/fr_CA.UTF-8.src
  head/share/timedef/fr_CH.ISO8859-15.src
  head/share/timedef/fr_CH.UTF-8.src
  head/share/timedef/fr_FR.ISO8859-15.src
  head/share/timedef/fr_FR.UTF-8.src
  head/share/timedef/he_IL.UTF-8.src
  head/share/timedef/hi_IN.ISCII-DEV.src
  head/share/timedef/hi_IN.UTF-8.src
  head/share/timedef/hr_HR.ISO8859-2.src
  head/share/timedef/hr_HR.UTF-8.src
  head/share/timedef/hu_HU.ISO8859-2.src
  head/share/timedef/hu_HU.UTF-8.src
  head/share/timedef/hy_AM.ARMSCII-8.src
  head/share/timedef/hy_AM.UTF-8.src
  head/share/timedef/is_IS.ISO8859-15.src
  head/share/timedef/is_IS.UTF-8.src
  head/share/timedef/it_CH.ISO8859-15.src
  head/share/timedef/it_CH.UTF-8.src
  head/share/timedef/it_IT.ISO8859-15.src
  head/share/timedef/it_IT.UTF-8.src
  head/share/timedef/ja_JP.SJIS.src
  head/share/timedef/ja_JP.UTF-8.src
  head/share/timedef/ja_JP.eucJP.src
  head/share/timedef/kk_KZ.UTF-8.src
  head/share/timedef/ko_KR.UTF-8.src
  head/share/timedef/ko_KR.eucKR.src
  head/share/timedef/lt_LT.ISO8859-13.src
  head/share/timedef/lt_LT.UTF-8.src
  head/share/timedef/lv_LV.ISO8859-13.src
  head/share/timedef/lv_LV.UTF-8.src
  head/share/timedef/mn_MN.UTF-8.src
  head/share/timedef/nb_NO.ISO8859-15.src
  head/share/timedef/nb_NO.UTF-8.src
  head/share/timedef/nl_BE.UTF-8.src
  head/share/timedef/nl_NL.UTF-8.src
  head/share/timedef/nn_NO.ISO8859-15.src
  head/share/timedef/nn_NO.UTF-8.src
  head/share/timedef/pl_PL.ISO8859-2.src
  head/share/timedef/pl_PL.UTF-8.src
  head/share/timedef/pt_BR.ISO8859-1.src
  head/share/timedef/pt_BR.UTF-8.src
  head/share/timedef/pt_PT.ISO8859-15.src
  head/share/timedef/pt_PT.UTF-8.src
  head/share/timedef/ro_RO.ISO8859-2.src
  head/share/timedef/ro_RO.UTF-8.src
  head/share/timedef/ru_RU.CP1251.src
  head/share/timedef/ru_RU.CP866.src
  head/share/timedef/ru_RU.ISO8859-5.src
  head/share/timedef/ru_RU.KOI8-R.src
  head/share/timedef/ru_RU.UTF-8.src
  head/share/timedef/se_FI.UTF-8.src
  head/share/timedef/se_NO.UTF-8.src
  head/share/timedef/sk_SK.ISO8859-2.src
  head/share/timedef/sk_SK.UTF-8.src
  head/share/timedef/sl_SI.ISO8859-2.src
  head/share/timedef/sl_SI.UTF-8.src
  head/share/timedef/sr_RS.ISO8859-2.src
  head/share/timedef/sr_RS.ISO8859-5.src
  head/share/timedef/sr_RS.UTF-8.src
  

svn commit: r304043 - head/sys/netpfil/ipfw

2016-08-13 Thread Andrey V. Elsukov
Author: ae
Date: Sat Aug 13 15:48:56 2016
New Revision: 304043
URL: https://svnweb.freebsd.org/changeset/base/304043

Log:
  Add three helper function to manage tables from external modules.
  
  ipfw_objhash_lookup_table_kidx does lookup kernel index of table;
  ipfw_ref_table/ipfw_unref_table takes and releases reference to table.
  
  Obtained from:Yandex LLC
  Sponsored by: Yandex LLC

Modified:
  head/sys/netpfil/ipfw/ip_fw_private.h
  head/sys/netpfil/ipfw/ip_fw_table.c

Modified: head/sys/netpfil/ipfw/ip_fw_private.h
==
--- head/sys/netpfil/ipfw/ip_fw_private.h   Sat Aug 13 15:48:34 2016
(r304042)
+++ head/sys/netpfil/ipfw/ip_fw_private.h   Sat Aug 13 15:48:56 2016
(r304043)
@@ -743,8 +743,12 @@ typedef int (table_lookup_t)(struct tabl
 
 int ipfw_lookup_table(struct ip_fw_chain *ch, uint16_t tbl, in_addr_t addr,
 uint32_t *val);
-int ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl, uint16_t 
plen,
-void *paddr, uint32_t *val);
+int ipfw_lookup_table_extended(struct ip_fw_chain *ch, uint16_t tbl,
+uint16_t plen, void *paddr, uint32_t *val);
+struct named_object *ipfw_objhash_lookup_table_kidx(struct ip_fw_chain *ch,
+uint16_t kidx);
+int ipfw_ref_table(struct ip_fw_chain *ch, ipfw_obj_ntlv *ntlv, uint16_t 
*kidx);
+void ipfw_unref_table(struct ip_fw_chain *ch, uint16_t kidx);
 int ipfw_init_tables(struct ip_fw_chain *ch, int first);
 int ipfw_resize_tables(struct ip_fw_chain *ch, unsigned int ntables);
 int ipfw_switch_tables_namespace(struct ip_fw_chain *ch, unsigned int nsets);

Modified: head/sys/netpfil/ipfw/ip_fw_table.c
==
--- head/sys/netpfil/ipfw/ip_fw_table.c Sat Aug 13 15:48:34 2016
(r304042)
+++ head/sys/netpfil/ipfw/ip_fw_table.c Sat Aug 13 15:48:56 2016
(r304043)
@@ -1602,6 +1602,57 @@ ipfw_resize_tables(struct ip_fw_chain *c
 }
 
 /*
+ * Lookup table's named object by its @kidx.
+ */
+struct named_object *
+ipfw_objhash_lookup_table_kidx(struct ip_fw_chain *ch, uint16_t kidx)
+{
+
+   return (ipfw_objhash_lookup_kidx(CHAIN_TO_NI(ch), kidx));
+}
+
+/*
+ * Take reference to table specified in @ntlv.
+ * On success return its @kidx.
+ */
+int
+ipfw_ref_table(struct ip_fw_chain *ch, ipfw_obj_ntlv *ntlv, uint16_t *kidx)
+{
+   struct tid_info ti;
+   struct table_config *tc;
+   int error;
+
+   IPFW_UH_WLOCK_ASSERT(ch);
+
+   ntlv_to_ti(ntlv, );
+   error = find_table_err(CHAIN_TO_NI(ch), , );
+   if (error != 0)
+   return (error);
+
+   if (tc == NULL)
+   return (ESRCH);
+
+   tc_ref(tc);
+   *kidx = tc->no.kidx;
+
+   return (0);
+}
+
+void
+ipfw_unref_table(struct ip_fw_chain *ch, uint16_t kidx)
+{
+
+   struct namedobj_instance *ni;
+   struct named_object *no;
+
+   IPFW_UH_WLOCK_ASSERT(ch);
+   ni = CHAIN_TO_NI(ch);
+   no = ipfw_objhash_lookup_kidx(ni, kidx);
+   KASSERT(no != NULL, ("Table with index %d not found", kidx));
+   no->refcnt--;
+}
+
+/*
  * Lookup an IP @addr in table @tbl.
  * Stores found value in @val.
  *
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r304041 - in head/sys: conf modules/ipfw netpfil/ipfw

2016-08-13 Thread Andrey V. Elsukov
Author: ae
Date: Sat Aug 13 15:41:04 2016
New Revision: 304041
URL: https://svnweb.freebsd.org/changeset/base/304041

Log:
  Move logging via BPF support into separate file.
  
  * make interface cloner VNET-aware;
  * simplify cloner code and use if_clone_simple();
  * migrate LOGIF_LOCK() to rmlock;
  * add ipfw_bpf_mtap2() function to pass mbuf to BPF;
  * introduce new additional ipfwlog0 pseudo interface. It differs from
ipfw0 by DLT type used in bpfattach. This interface is intended to
used by ipfw modules to dump packets with additional info attached.
Currently pflog format is used. ipfw_bpf_mtap2() function uses second
argument to determine which interface use for dumping. If dlen is equal
to ETHER_HDR_LEN it uses old ipfw0 interface, if dlen is equal to
PFLOG_HDRLEN - ipfwlog0 will be used.
  
  Obtained from:Yandex LLC
  Sponsored by: Yandex LLC

Added:
  head/sys/netpfil/ipfw/ip_fw_bpf.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/modules/ipfw/Makefile
  head/sys/netpfil/ipfw/ip_fw2.c
  head/sys/netpfil/ipfw/ip_fw_log.c
  head/sys/netpfil/ipfw/ip_fw_private.h

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Aug 13 06:26:33 2016(r304040)
+++ head/sys/conf/files Sat Aug 13 15:41:04 2016(r304041)
@@ -3872,6 +3872,7 @@ netpfil/ipfw/ip_dummynet.coptional inet
 netpfil/ipfw/ip_dn_io.coptional inet dummynet
 netpfil/ipfw/ip_dn_glue.c  optional inet dummynet
 netpfil/ipfw/ip_fw2.c  optional inet ipfirewall
+netpfil/ipfw/ip_fw_bpf.c   optional inet ipfirewall
 netpfil/ipfw/ip_fw_dynamic.c   optional inet ipfirewall
 netpfil/ipfw/ip_fw_eaction.c   optional inet ipfirewall
 netpfil/ipfw/ip_fw_log.c   optional inet ipfirewall

Modified: head/sys/modules/ipfw/Makefile
==
--- head/sys/modules/ipfw/Makefile  Sat Aug 13 06:26:33 2016
(r304040)
+++ head/sys/modules/ipfw/Makefile  Sat Aug 13 15:41:04 2016
(r304041)
@@ -3,7 +3,7 @@
 .PATH: ${.CURDIR}/../../netpfil/ipfw
 
 KMOD=  ipfw
-SRCS=  ip_fw2.c ip_fw_pfil.c
+SRCS=  ip_fw2.c ip_fw_pfil.c ip_fw_bpf.c
 SRCS+= ip_fw_dynamic.c ip_fw_log.c ip_fw_eaction.c
 SRCS+= ip_fw_sockopt.c ip_fw_table.c ip_fw_table_algo.c ip_fw_iface.c
 SRCS+= ip_fw_table_value.c

Modified: head/sys/netpfil/ipfw/ip_fw2.c
==
--- head/sys/netpfil/ipfw/ip_fw2.c  Sat Aug 13 06:26:33 2016
(r304040)
+++ head/sys/netpfil/ipfw/ip_fw2.c  Sat Aug 13 15:41:04 2016
(r304041)
@@ -2792,6 +2792,7 @@ vnet_ipfw_init(const void *unused)
 #ifdef LINEAR_SKIPTO
ipfw_init_skipto_cache(chain);
 #endif
+   ipfw_bpf_init(first);
 
/* First set up some values that are compile time options */
V_ipfw_vnet_ready = 1;  /* Open for business */
@@ -2810,7 +2811,6 @@ vnet_ipfw_init(const void *unused)
 * is checked on each packet because there are no pfil hooks.
 */
V_ip_fw_ctl_ptr = ipfw_ctl3;
-   ipfw_log_bpf(1); /* init */
error = ipfw_attach_hooks(1);
return (error);
 }
@@ -2834,8 +2834,6 @@ vnet_ipfw_uninit(const void *unused)
(void)ipfw_attach_hooks(0 /* detach */);
V_ip_fw_ctl_ptr = NULL;
 
-   ipfw_log_bpf(0); /* uninit */
-
last = IS_DEFAULT_VNET(curvnet) ? 1 : 0;
 
IPFW_UH_WLOCK(chain);
@@ -2865,6 +2863,7 @@ vnet_ipfw_uninit(const void *unused)
ipfw_dyn_uninit(1); /* free the remaining parts */
ipfw_destroy_counters();
ipfw_destroy_obj_rewriter();
+   ipfw_bpf_uninit(last);
return (0);
 }
 

Added: head/sys/netpfil/ipfw/ip_fw_bpf.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/netpfil/ipfw/ip_fw_bpf.c   Sat Aug 13 15:41:04 2016
(r304041)
@@ -0,0 +1,209 @@
+/*-
+ * Copyright (c) 2016 Yandex LLC
+ * Copyright (c) 2016 Andrey V. Elsukov 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE 

svn commit: r304040 - head/tests/sys/acl

2016-08-13 Thread Garrett Cooper
Author: ngie
Date: Sat Aug 13 06:26:33 2016
New Revision: 304040
URL: https://svnweb.freebsd.org/changeset/base/304040

Log:
  Redirect the output of the testcases to stderr instead of
  redirecting it to /dev/null
  
  This will aid in debugging failures
  
  MFC after:1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tests/sys/acl/00.sh
  head/tests/sys/acl/01.sh
  head/tests/sys/acl/02.sh
  head/tests/sys/acl/03.sh
  head/tests/sys/acl/04.sh

Modified: head/tests/sys/acl/00.sh
==
--- head/tests/sys/acl/00.shSat Aug 13 06:16:38 2016(r304039)
+++ head/tests/sys/acl/00.shSat Aug 13 06:26:33 2016(r304040)
@@ -75,7 +75,7 @@ chmod 600 xxx
 rm xxx
 echo "ok 2"
 
-perl $TESTDIR/run $TESTDIR/tools-posix.test > /dev/null
+perl $TESTDIR/run $TESTDIR/tools-posix.test >&2
 
 if [ $? -eq 0 ]; then
echo "ok 3"

Modified: head/tests/sys/acl/01.sh
==
--- head/tests/sys/acl/01.shSat Aug 13 06:16:38 2016(r304039)
+++ head/tests/sys/acl/01.shSat Aug 13 06:26:33 2016(r304040)
@@ -76,7 +76,7 @@ chmod 600 xxx
 rm xxx
 echo "ok 2"
 
-perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test > /dev/null
+perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test >&2
 
 if [ $? -eq 0 ]; then
echo "ok 3"

Modified: head/tests/sys/acl/02.sh
==
--- head/tests/sys/acl/02.shSat Aug 13 06:16:38 2016(r304039)
+++ head/tests/sys/acl/02.shSat Aug 13 06:26:33 2016(r304040)
@@ -76,9 +76,9 @@ rm xxx
 echo "ok 2"
 
 if [ `sysctl -n vfs.acl_nfs4_old_semantics` = 0 ]; then
-   perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test > /dev/null
+   perl $TESTDIR/run $TESTDIR/tools-nfs4-psarc.test >&2
 else
-   perl $TESTDIR/run $TESTDIR/tools-nfs4.test > /dev/null
+   perl $TESTDIR/run $TESTDIR/tools-nfs4.test >&2
 fi
 
 if [ $? -eq 0 ]; then

Modified: head/tests/sys/acl/03.sh
==
--- head/tests/sys/acl/03.shSat Aug 13 06:16:38 2016(r304039)
+++ head/tests/sys/acl/03.shSat Aug 13 06:26:33 2016(r304040)
@@ -89,7 +89,7 @@ echo "ok 3"
 
 cd $MNTROOT
 
-perl $TESTDIR/run $TESTDIR/tools-crossfs.test > /dev/null
+perl $TESTDIR/run $TESTDIR/tools-crossfs.test >&2
 
 if [ $? -eq 0 ]; then
echo "ok 4"

Modified: head/tests/sys/acl/04.sh
==
--- head/tests/sys/acl/04.shSat Aug 13 06:16:38 2016(r304039)
+++ head/tests/sys/acl/04.shSat Aug 13 06:26:33 2016(r304040)
@@ -57,7 +57,7 @@ echo "ok 1"
 
 cd $MNT
 
-perl $TESTDIR/run $TESTDIR/tools-nfs4-trivial.test > /dev/null
+perl $TESTDIR/run $TESTDIR/tools-nfs4-trivial.test >&2
 
 if [ $? -eq 0 ]; then
echo "ok 2"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"