svn commit: r330974 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 08:49:21 2018
New Revision: 330974
URL: https://svnweb.freebsd.org/changeset/base/330974

Log:
  MFV r330973: 9164 assert: newds == os->os_dsl_dataset
  
  illumos/illumos-gate@5f5913bb83405db87f982abee80162a479d363af
  
https://github.com/illumos/illumos-gate/commit/5f5913bb83405db87f982abee80162a479d363af
  
  https://www.illumos.org/issues/9164
This issue has been reported by Alan Somers as
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225877
  
dmu_objset_refresh_ownership() first disowns a dataset (and releases
it) and then owns it again. There is an assert that the new dataset
object is the same as the old dataset object.  When running ZFS Test
Suite on FreeBSD we see this panic from zpool_upgrade_007_pos test:
  
panic: solaris assert: newds == os->os_dsl_dataset (0xf80045f4c000
== 0xf80021ab4800)
  
I see that the old dataset has dsl_dataset_evict_async() pending in
ds_dbu.dbu_tqent and its ds_dbuf is NULL.
  
  Reviewed by: Matt Ahrens 
  Reviewed by: Don Brady 
  Approved by: Richard Lowe 
  Author: Andriy Gapon 
  
  PR:   225877
  Reported by:  asomers
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.cThu Mar 
15 08:46:49 2018(r330973)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.cThu Mar 
15 08:49:21 2018(r330974)
@@ -670,23 +670,21 @@ dmu_objset_rele(objset_t *os, void *tag)
  * same name so that it can be partially torn down and reconstructed.
  */
 void
-dmu_objset_refresh_ownership(objset_t *os, void *tag)
+dmu_objset_refresh_ownership(dsl_dataset_t *ds, dsl_dataset_t **newds,
+void *tag)
 {
dsl_pool_t *dp;
-   dsl_dataset_t *ds, *newds;
char name[ZFS_MAX_DATASET_NAME_LEN];
 
-   ds = os->os_dsl_dataset;
VERIFY3P(ds, !=, NULL);
VERIFY3P(ds->ds_owner, ==, tag);
VERIFY(dsl_dataset_long_held(ds));
 
dsl_dataset_name(ds, name);
-   dp = dmu_objset_pool(os);
+   dp = ds->ds_dir->dd_pool;
dsl_pool_config_enter(dp, FTAG);
-   dmu_objset_disown(os, tag);
-   VERIFY0(dsl_dataset_own(dp, name, tag, &newds));
-   VERIFY3P(newds, ==, os->os_dsl_dataset);
+   dsl_dataset_disown(ds, tag);
+   VERIFY0(dsl_dataset_own(dp, name, tag, newds));
dsl_pool_config_exit(dp, FTAG);
 }
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
Thu Mar 15 08:46:49 2018(r330973)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h
Thu Mar 15 08:49:21 2018(r330974)
@@ -153,7 +153,8 @@ int dmu_objset_own(const char *name, dmu_objset_type_t
 boolean_t readonly, void *tag, objset_t **osp);
 int dmu_objset_own_obj(struct dsl_pool *dp, uint64_t obj,
 dmu_objset_type_t type, boolean_t readonly, void *tag, objset_t **osp);
-void dmu_objset_refresh_ownership(objset_t *os, void *tag);
+void dmu_objset_refresh_ownership(struct dsl_dataset *ds,
+struct dsl_dataset **newds, void *tag);
 void dmu_objset_rele(objset_t *os, void *tag);
 void dmu_objset_disown(objset_t *os, void *tag);
 int dmu_objset_from_ds(struct dsl_dataset *ds, objset_t **osp);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Mar 
15 08:46:49 2018(r330973)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Mar 
15 08:49:21 2018(r330974)
@@ -5115,14 +5115,14 @@ zfs_ioc_userspace_upgrade(zfs_cmd_t *zc)
 * objset needs to be closed & reopened (to grow the
 * objset_phys_t).  Suspend/resume the fs will do that.
 */
-   dsl_dataset_t *ds;
+   dsl_dataset_t *ds, *newds;
 
ds = dmu_objset_ds(zfsvfs->z_os);
error = zfs_suspend_fs(zfsvfs);
if (error == 0) {
-   dmu_objset_refresh_ownership(zfsvfs->z_os,
+   dmu_objset_refresh_ownership(ds, &newds,
zfsvfs);
-   error = zfs_resume_fs(zfsvfs, ds);
+

svn commit: r330975 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 08:52:49 2018
New Revision: 330975
URL: https://svnweb.freebsd.org/changeset/base/330975

Log:
  re-enable zpool_upgrade_007_pos test after the fix in r330974
  
  The test was disabled in r329248.
  
  PR:   225877

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh

Modified: 
head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh  
Thu Mar 15 08:49:21 2018(r330974)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_upgrade/zpool_upgrade_test.sh  
Thu Mar 15 08:52:49 2018(r330975)
@@ -207,7 +207,6 @@ zpool_upgrade_007_pos_body()
. $(atf_get_srcdir)/zpool_upgrade.cfg
 
verify_disk_count "$DISKS" 2
-   atf_skip "PR 225877 - panic: solaris assert: newds == 
os->os_dsl_dataset during"
ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed"
ksh93 $(atf_get_srcdir)/zpool_upgrade_007_pos.ksh || atf_fail "Testcase 
failed"
 }
___
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: r330977 - head/sys/geom

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 09:16:10 2018
New Revision: 330977
URL: https://svnweb.freebsd.org/changeset/base/330977

Log:
  g_access: deal with races created by geoms that drop the topology lock
  
  The problem is that g_access() must be called with the GEOM topology
  lock held.  And that gives a false impression that the lock is indeed
  held across the call.  But this isn't always true because many classes,
  ZVOL being one of the many, need to drop the lock.  It's either to
  perform an I/O on the first open or to acquire a different lock (like in
  g_mirror_access).
  
  That, of course, can break many assumptions.  For example,
  g_slice_access() adds an extra exclusive count on the first open. As
  described above, an underlying geom may drop the topology lock and that
  would open a race with another thread that would also request another
  extra exclusive count.  In general, two consumers may be granted
  incompatible accesses.
  
  To avoid this problem the code is changed to mark a geom with special
  flag before calling its access method and clear the flag afterwards.  If
  another thread sees that flag, then it means that the topology lock has
  been dropped (either by the geom in question or downstream from it), so
  it is not safe to make another access call.  So, the second thread would
  use g_topology_sleep() to wait until the flag is cleared and only then
  would it proceed with the access.
  
  Also see 
http://docs.freebsd.org/cgi/mid.cgi?809d9254-ee56-59d8-69a4-08838e985cea
  
  PR:   225960
  Reported by:  asomers
  Reviewed by:  markj, mav
  MFC after:3 weeks
  Differential Revision: https://reviews.freebsd.org/D14533

Modified:
  head/sys/geom/geom.h
  head/sys/geom/geom_subr.c

Modified: head/sys/geom/geom.h
==
--- head/sys/geom/geom.hThu Mar 15 09:04:23 2018(r330976)
+++ head/sys/geom/geom.hThu Mar 15 09:16:10 2018(r330977)
@@ -159,8 +159,10 @@ struct g_geom {
void*spare1;
void*softc;
unsignedflags;
-#defineG_GEOM_WITHER   1
-#defineG_GEOM_VOLATILE_BIO 2
+#defineG_GEOM_WITHER   0x01
+#defineG_GEOM_VOLATILE_BIO 0x02
+#defineG_GEOM_IN_ACCESS0x04
+#defineG_GEOM_ACCESS_WAIT  0x08
LIST_HEAD(,g_geom_alias) aliases;
 };
 

Modified: head/sys/geom/geom_subr.c
==
--- head/sys/geom/geom_subr.c   Thu Mar 15 09:04:23 2018(r330976)
+++ head/sys/geom/geom_subr.c   Thu Mar 15 09:16:10 2018(r330977)
@@ -876,7 +876,11 @@ int
 g_access(struct g_consumer *cp, int dcr, int dcw, int dce)
 {
struct g_provider *pp;
+   struct g_geom *gp;
int pw, pe;
+#ifdef INVARIANTS
+   int sr, sw, se;
+#endif
int error;
 
g_topology_assert();
@@ -884,6 +888,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int 
pp = cp->provider;
KASSERT(pp != NULL, ("access but not attached"));
G_VALID_PROVIDER(pp);
+   gp = pp->geom;
 
g_trace(G_T_ACCESS, "g_access(%p(%s), %d, %d, %d)",
cp, pp->name, dcr, dcw, dce);
@@ -892,7 +897,7 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int 
KASSERT(cp->acw + dcw >= 0, ("access resulting in negative acw"));
KASSERT(cp->ace + dce >= 0, ("access resulting in negative ace"));
KASSERT(dcr != 0 || dcw != 0 || dce != 0, ("NOP access request"));
-   KASSERT(pp->geom->access != NULL, ("NULL geom->access"));
+   KASSERT(gp->access != NULL, ("NULL geom->access"));
 
/*
 * If our class cares about being spoiled, and we have been, we
@@ -904,6 +909,27 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int 
return (ENXIO);
 
/*
+* A number of GEOM classes either need to perform an I/O on the first
+* open or to acquire a different subsystem's lock.  To do that they
+* may have to drop the topology lock.
+* Other GEOM classes perform special actions when opening a lower rank
+* geom for the first time.  As a result, more than one thread may
+* end up performing the special actions.
+* So, we prevent concurrent "first" opens by marking the consumer with
+* special flag.
+*
+* Note that if the geom's access method never drops the topology lock,
+* then we will never see G_GEOM_IN_ACCESS here.
+*/
+   while ((gp->flags & G_GEOM_IN_ACCESS) != 0) {
+   g_trace(G_T_ACCESS,
+   "%s: race on geom %s via provider %s and consumer of %s",
+   __func__, gp->name, pp->name, cp->geom->name);
+   gp->flags |= G_GEOM_ACCESS_WAIT;
+   g_topology_sleep(gp, 0);
+   }
+
+   /*
 * Figure out w

svn commit: r330979 - head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 09:28:10 2018
New Revision: 330979
URL: https://svnweb.freebsd.org/changeset/base/330979

Log:
  re-enable zfs_copies_006_pos test after a fix in r330977
  
  The test was disabled in r329408.
  
  PR:   225960

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh
Thu Mar 15 09:22:20 2018(r330978)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zfs_copies/zfs_copies_test.sh
Thu Mar 15 09:28:10 2018(r330979)
@@ -170,7 +170,6 @@ zfs_copies_006_pos_body()
. $(atf_get_srcdir)/zfs_copies.cfg
 
verify_disk_count "$DISKS" 1
-   atf_skip "PR 225960 g_access leak when unmounting UFS on a zvol"
ksh93 $(atf_get_srcdir)/setup.ksh || atf_fail "Setup failed"
ksh93 $(atf_get_srcdir)/zfs_copies_006_pos.ksh || atf_fail "Testcase 
failed"
 }
___
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: r330992 - head/tests/sys/cddl/zfs/include

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 12:35:22 2018
New Revision: 330992
URL: https://svnweb.freebsd.org/changeset/base/330992

Log:
  zfs test suite: fix a typo, da0 vs $disk

Modified:
  head/tests/sys/cddl/zfs/include/libtest.kshlib

Modified: head/tests/sys/cddl/zfs/include/libtest.kshlib
==
--- head/tests/sys/cddl/zfs/include/libtest.kshlib  Thu Mar 15 12:05:17 
2018(r330991)
+++ head/tests/sys/cddl/zfs/include/libtest.kshlib  Thu Mar 15 12:35:22 
2018(r330992)
@@ -678,7 +678,7 @@ function set_partition #  
 {
typeset disk=$1
-   diskinfo da0 | awk '{print $3}'
+   diskinfo $disk | awk '{print $3}'
 }
 
 function get_available_disk_size #
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r330993 - head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 12:40:43 2018
New Revision: 330993
URL: https://svnweb.freebsd.org/changeset/base/330993

Log:
  zfs test suite: align zfs_destroy_005_neg: with upstream
  
  The change is to account for a different order in which the recursive
  destroy may be attempted.  If we first try a dataset that can be destroyed
  then it will be destroyed, but if we first try a dataset that cannot be
  destroyed then we will not attempt to destroy the other dataset.

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh

Modified: 
head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh  
Thu Mar 15 12:35:22 2018(r330992)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zfs_destroy/zfs_destroy_005_neg.ksh  
Thu Mar 15 12:40:43 2018(r330993)
@@ -121,10 +121,30 @@ negative_test "-r -rf" "$CTR $FS $VOL"
 typeset mtpt_dir=$(get_prop mountpoint $FS)
 make_dir_busy $mtpt_dir
 negative_test "-R -rR" $CTR
-check_dataset datasetexists $CTR $FS $VOL $VOLSNAP $VOLCLONE
-log_must datasetnonexists $FSSNAP $FSCLONE
 
 #
+# Checking the outcome of the test above is tricky, because the order in
+# which datasets are destroyed is not deterministic. Both $FS and $VOL are
+# busy, and the remaining datasets will be different depending on whether we
+# tried (and failed) to delete $FS or $VOL first.
+
+# The following datasets will exist independent of the order
+check_dataset datasetexists $CTR $FS $VOL
+
+if datasetexists $VOLSNAP && datasetnonexists $FSSNAP; then
+   # The recursive destroy failed on $FS
+   check_dataset datasetnonexists $FSSNAP $FSCLONE
+   check_dataset datasetexists $VOLSNAP $VOLCLONE
+elif datasetexists $FSSNAP && datasetnonexists $VOLSNAP; then
+   # The recursive destroy failed on $VOL
+   check_dataset datasetnonexists $VOLSNAP $VOLCLONE
+   check_dataset datasetexists $FSSNAP $FSCLONE
+else
+   log_must zfs list -rtall
+   log_fail "Unexpected datasets remaining"
+fi
+
+#
 # Create the clones for test environment, then verify 'zfs destroy $FS'
 # failed without '-f'. 
 #
@@ -148,7 +168,17 @@ if is_global_zone; then
make_dir_busy $TESTDIR1
negative_test "-R -rR" $CTR
log_must datasetexists $CTR $VOL
-   log_must datasetnonexists $FS $FSSNAP $FSCLONE $VOLSNAP $VOLCLONE
+   log_must datasetnonexists $VOLSNAP $VOLCLONE
+
+   # Here again, the non-determinism of destroy order is a factor. $FS,
+   # $FSSNAP and $FSCLONE will still exist here iff we attempted to destroy
+   # $VOL (and failed) first. So check that either all of the datasets are
+   # present, or they're all gone.
+   if datasetexists $FS; then
+   check_dataset datasetexists $FS $FSSNAP $FSCLONE
+   else
+   check_dataset datasetnonexists $FS $FSSNAP $FSCLONE
+   fi
 
#
# Create the clones for test environment and make the volume busy.
___
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: r330994 - head/tests/sys/cddl/zfs/tests/hotplug

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 12:42:19 2018
New Revision: 330994
URL: https://svnweb.freebsd.org/changeset/base/330994

Log:
  zfs test suite: destroy old gnops before creating new ones

Modified:
  head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh

Modified: head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh
==
--- head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh Thu Mar 15 12:40:43 
2018(r330993)
+++ head/tests/sys/cddl/zfs/tests/hotplug/setup.ksh Thu Mar 15 12:42:19 
2018(r330994)
@@ -31,5 +31,6 @@
 
 . $STF_SUITE/tests/hotplug/hotplug.kshlib
 
+log_must destroy_gnops $ALL_DISKS
 log_must create_gnops $ALL_DISKS
 log_pass
___
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: r330995 - head/tests/sys/cddl/zfs/tests/slog

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 12:44:13 2018
New Revision: 330995
URL: https://svnweb.freebsd.org/changeset/base/330995

Log:
  zfs test suite: fix a typo, TESTPOOL vs TESTPOOL2

Modified:
  head/tests/sys/cddl/zfs/tests/slog/slog.kshlib

Modified: head/tests/sys/cddl/zfs/tests/slog/slog.kshlib
==
--- head/tests/sys/cddl/zfs/tests/slog/slog.kshlib  Thu Mar 15 12:42:19 
2018(r330994)
+++ head/tests/sys/cddl/zfs/tests/slog/slog.kshlib  Thu Mar 15 12:44:13 
2018(r330995)
@@ -34,7 +34,7 @@
 function cleanup
 {
poolexists $TESTPOOL && log_must $ZPOOL status $TESTPOOL
-   poolexists $TESTPOOL && log_must $ZPOOL status $TESTPOOL2
+   poolexists $TESTPOOL2 && log_must $ZPOOL status $TESTPOOL2
destroy_pool $TESTPOOL
destroy_pool $TESTPOOL2
 }
___
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: r330886 - head/share/examples

2018-03-15 Thread Matthias Meyser

Am 14.03.2018 um 00:37 schrieb Devin Teske:

Author: dteske
Date: Tue Mar 13 23:37:33 2018
New Revision: 330886
URL: https://svnweb.freebsd.org/changeset/base/330886

Log:
   Install files added in SVN's r295373, r295457, r295542
   
   Reported by:	woodsb02

   MFC after:   3 days
   X-MFC to:stable/11


PR: 214994 (2016) is missing

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214994

Please change to fixed




Modified:
   head/share/examples/Makefile

Modified: head/share/examples/Makefile
==
--- head/share/examples/MakefileTue Mar 13 23:36:15 2018
(r330885)
+++ head/share/examples/MakefileTue Mar 13 23:37:33 2018
(r330886)
@@ -76,6 +76,12 @@ XFILES=  BSD_daemon/FreeBSD.pfa \
indent/indent.pro \
ipfw/change_rules.sh \
jails/README \
+   jails/VIMAGE \
+   jails/jail.xxx.conf \
+   jails/jib \
+   jails/jng \
+   jails/rc.conf.jails \
+   jails/rcjail.xxx.conf \
kld/Makefile \
kld/cdev/Makefile \
kld/cdev/README \




--
Matthias Meyser| XeNET GmbH
Tel.:  +49-5323-9489050| 38678 Clausthal-Zellerfeld, Marktstrasse 40
Fax:   +49-5323-9489059| Registergericht: Amtsgericht Braunschweig HRB 
110823

Email: mey...@xenet.de | Geschaeftsfuehrer: Matthias Meyser
___
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: r330996 - in head/tests/sys/cddl/zfs: include tests/cache tests/cli_root/zpool_add

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 12:47:34 2018
New Revision: 330996
URL: https://svnweb.freebsd.org/changeset/base/330996

Log:
  zfs test suite: support device paths with intermediate directories
  
  The code assumed that disks (devices) used for testing are always named
  like /dev/foo, but there is no reason for that restriction and we can
  easily support paths like /dev/stripe/bar.

Modified:
  head/tests/sys/cddl/zfs/include/libtest.kshlib
  head/tests/sys/cddl/zfs/tests/cache/cache.kshlib
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib

Modified: head/tests/sys/cddl/zfs/include/libtest.kshlib
==
--- head/tests/sys/cddl/zfs/include/libtest.kshlib  Thu Mar 15 12:44:13 
2018(r330995)
+++ head/tests/sys/cddl/zfs/include/libtest.kshlib  Thu Mar 15 12:47:34 
2018(r330996)
@@ -640,7 +640,7 @@ function wipe_partition_table # [/dev/null 2>&1; then
+   if gpart list ${diskname#/dev/} >/dev/null 2>&1; then
wait_for 5 1 $GPART destroy -F $diskname
else
log_note "No GPT partitions detected on $diskname"

Modified: head/tests/sys/cddl/zfs/tests/cache/cache.kshlib
==
--- head/tests/sys/cddl/zfs/tests/cache/cache.kshlibThu Mar 15 12:44:13 
2018(r330995)
+++ head/tests/sys/cddl/zfs/tests/cache/cache.kshlibThu Mar 15 12:47:34 
2018(r330996)
@@ -90,9 +90,7 @@ function verify_cache_device
 
# Zpool status returns on the device name sans the /dev, so
# if the device contains /dev/ remove it.
-   if [[ $device =~ "^/dev/" ]]; then
-   device=`basename ${device}`
-   fi
+   device=${device#"/dev/"}
 
if [[ $WRAPPER == *"smi"* ]]; then
$ECHO $device | $EGREP "^c[0-F]+([td][0-F]+)+$" > /dev/null 2>&1

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib   Thu Mar 
15 12:44:13 2018(r330995)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib   Thu Mar 
15 12:47:34 2018(r330996)
@@ -55,9 +55,7 @@ function iscontained
for vdev in $@; do
 
 # remove /dev/dsk in vdev if there is
-   $ECHO $vdev | $GREP "^/dev/" >/dev/null 2>&1
-   (( $? == 0 )) && \
-   vdev=${vdev##*/}
+   vdev=${vdev#/dev/}
 
$ZPOOL status "$pool" | $AWK '$1 == vdevname {exit 1}' \
vdevname=$vdev >/dev/null 2>&1
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r331000 - head/lib/libc/net

2018-03-15 Thread Hiroki Sato
Author: hrs
Date: Thu Mar 15 13:46:28 2018
New Revision: 331000
URL: https://svnweb.freebsd.org/changeset/base/331000

Log:
  Make getnameinfo(3) salen requirement less strict and
  document details of salen in getnameinfo(3) manual page.
  
  getnameinfo(3) returned EAI_FAIL when salen was not equal to
  the length corresponding to the value specified by sa->sa_family.
  However, POSIX or RFC 3493 does not require it and RFC 4038
  Sec.6.2.3 shows an example passing sizeof(struct sockaddr_storage)
  to salen.
  
  This change makes the requirement less strict by accepting
  salen up to sizeof(struct sockaddr_storage).  It also includes
  two more changes: one is to fix return values because both SUSv4
  and RFC 3493 require EAI_FAMILY when the address length is invalid,
  another is to fix sa_len dependency in PF_LOCAL.
  
  Pointed out by:   Christophe Beauval
  Reviewed by:  ae
  Differential Revision:https://reviews.freebsd.org/D14585

Modified:
  head/lib/libc/net/getnameinfo.3
  head/lib/libc/net/getnameinfo.c

Modified: head/lib/libc/net/getnameinfo.3
==
--- head/lib/libc/net/getnameinfo.3 Thu Mar 15 13:07:15 2018
(r330999)
+++ head/lib/libc/net/getnameinfo.3 Thu Mar 15 13:46:28 2018
(r331000)
@@ -18,7 +18,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 28, 2016
+.Dd March 15, 2018
 .Dt GETNAMEINFO 3
 .Os
 .Sh NAME
@@ -80,6 +80,20 @@ or UNIX-domain respectively
 that is
 .Fa salen
 bytes long.
+If
+.Fa salen
+is shorter than the length corresponding to the specified
+address family or longer than
+.Fn sizeof "struct sockaddr_storage" ,
+it returns
+.Er EAI_FAMILY .
+Note that
+.Va sa->sa_len
+should be consistent with
+.Fa salen
+though the value of
+.Va sa->sa_len
+is not directly used in this function.
 .Pp
 The host and service names associated with
 .Fa sa

Modified: head/lib/libc/net/getnameinfo.c
==
--- head/lib/libc/net/getnameinfo.c Thu Mar 15 13:07:15 2018
(r330999)
+++ head/lib/libc/net/getnameinfo.c Thu Mar 15 13:46:28 2018
(r331000)
@@ -124,26 +124,36 @@ getnameinfo(const struct sockaddr *sa, socklen_t salen
afd = find_afd(sa->sa_family);
if (afd == NULL)
return (EAI_FAMILY);
+   /*
+* getnameinfo() accepts an salen of sizeof(struct sockaddr_storage)
+* at maximum as shown in RFC 4038 Sec.6.2.3.
+*/
+   if (salen > sizeof(struct sockaddr_storage))
+   return (EAI_FAMILY);
+
switch (sa->sa_family) {
case PF_LOCAL:
/*
-* PF_LOCAL uses variable sa->sa_len depending on the
+* PF_LOCAL uses variable salen depending on the
 * content length of sun_path.  Require 1 byte in
 * sun_path at least.
 */
-   if (salen > afd->a_socklen ||
-   salen <= afd->a_socklen -
+   if (salen <= afd->a_socklen -
sizeofmember(struct sockaddr_un, sun_path))
-   return (EAI_FAIL);
+   return (EAI_FAMILY);
+   else if (salen > afd->a_socklen)
+   salen = afd->a_socklen;
break;
case PF_LINK:
if (salen <= afd->a_socklen -
sizeofmember(struct sockaddr_dl, sdl_data))
-   return (EAI_FAIL);
+   return (EAI_FAMILY);
break;
default:
-   if (salen != afd->a_socklen)
-   return (EAI_FAIL);
+   if (salen < afd->a_socklen)
+   return (EAI_FAMILY);
+   else
+   salen = afd->a_socklen;
break;
}
 
@@ -517,7 +527,7 @@ getnameinfo_un(const struct afd *afd,
if (serv != NULL && servlen > 0)
*serv = '\0';
if (host != NULL && hostlen > 0) {
-   pathlen = sa->sa_len - afd->a_off;
+   pathlen = salen - afd->a_off;
 
if (pathlen + 1 > hostlen) {
*host = '\0';
___
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: r331001 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_export

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 14:23:31 2018
New Revision: 331001
URL: https://svnweb.freebsd.org/changeset/base/331001

Log:
  zfs test suite: move definition of DISK to the cfg file in zpool_export
  
  The variable is used not only by the setup script but also by the
  atf test bodies.

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh   Thu Mar 
15 13:46:28 2018(r331000)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/setup.ksh   Thu Mar 
15 14:23:31 2018(r331001)
@@ -31,6 +31,4 @@
 
 . $STF_SUITE/include/libtest.kshlib
 
-DISK=${DISKS%% *}
-
 default_setup $DISK

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg
Thu Mar 15 13:46:28 2018(r331000)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_export/zpool_export.cfg
Thu Mar 15 14:23:31 2018(r331001)
@@ -30,3 +30,5 @@
 #
 
 . $STF_SUITE/tests/cli_root/cli.cfg
+
+export DISK=${DISKS%% *}
___
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: r331002 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_get

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 14:35:46 2018
New Revision: 331002
URL: https://svnweb.freebsd.org/changeset/base/331002

Log:
  zfs test suite: move definition of DISK to the cfg file in zpool_get
  
  The variable is used not only by the setup script but also by the
  atf test bodies.
  
  This should have been in r331001.

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh  Thu Mar 15 
14:23:31 2018(r331001)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/setup.ksh  Thu Mar 15 
14:35:46 2018(r331002)
@@ -32,6 +32,4 @@
 . ${STF_SUITE}/include/libtest.kshlib
 verify_runnable "both"
 
-DISK=${DISKS%% *}
-
 default_setup $DISK

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg  Thu Mar 
15 14:23:31 2018(r331001)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg  Thu Mar 
15 14:35:46 2018(r331002)
@@ -69,3 +69,5 @@ typeset -a properties=(
 "feature@skein"
 # "feature@edonr" Edonr is not yet implemented on FreeBSD
 )
+
+export DISK=${DISKS%% *}
___
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: r331003 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_get

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 14:41:09 2018
New Revision: 331003
URL: https://svnweb.freebsd.org/changeset/base/331003

Log:
  zfs test suite: add new pool properties / features to the zpool_get list

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg  Thu Mar 
15 14:35:46 2018(r331002)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_get/zpool_get.cfg  Thu Mar 
15 14:41:09 2018(r331003)
@@ -53,6 +53,7 @@ typeset -a properties=(
 "freeing"
 "fragmentation"
 "leaked"
+"bootsize"
 "feature@async_destroy"
 "feature@empty_bpobj"
 "feature@lz4_compress"
@@ -68,6 +69,8 @@ typeset -a properties=(
 "feature@sha512"
 "feature@skein"
 # "feature@edonr" Edonr is not yet implemented on FreeBSD
+"feature@device_removal"
+"feature@obsolete_counts"
 )
 
 export DISK=${DISKS%% *}
___
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: r331004 - head/tests/sys/cddl/zfs/tests/cli_root/zpool_history

2018-03-15 Thread Andriy Gapon
Author: avg
Date: Thu Mar 15 14:47:53 2018
New Revision: 331004
URL: https://svnweb.freebsd.org/changeset/base/331004

Log:
  zfs test suite: move definition of DISK to the cfg file in zpool_get
  
  The variable is used not only by the setup script but also by the
  atf test bodies.
  
  Another one that should have been in r331001.

Modified:
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh  Thu Mar 
15 14:41:09 2018(r331003)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/setup.ksh  Thu Mar 
15 14:47:53 2018(r331004)
@@ -31,5 +31,4 @@
 
 . $STF_SUITE/include/libtest.kshlib
 
-DISK=${DISKS%% *}
 default_container_volume_setup $DISK

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg
==
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg  
Thu Mar 15 14:41:09 2018(r331003)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_history/zpool_history.cfg  
Thu Mar 15 14:47:53 2018(r331004)
@@ -28,3 +28,5 @@
 #
 
 . $STF_SUITE/tests/cli_root/cli.cfg
+
+export DISK=${DISKS%% *}
___
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: r331005 - head/share/termcap

2018-03-15 Thread Baptiste Daroussin
Author: bapt
Date: Thu Mar 15 15:05:26 2018
New Revision: 331005
URL: https://svnweb.freebsd.org/changeset/base/331005

Log:
  Fix tab vs space indentation
  
  MFC after:3 days

Modified:
  head/share/termcap/termcap

Modified: head/share/termcap/termcap
==
--- head/share/termcap/termcap  Thu Mar 15 14:47:53 2018(r331004)
+++ head/share/termcap/termcap  Thu Mar 15 15:05:26 2018(r331005)
@@ -4664,24 +4664,24 @@ Eterm|Eterm Terminal Emulator (X11 Window System):\
 
 # Termcap for xterm-termite
 xterm-termite|VTE-based terminal:\
-:NP:am:hs:mi:ms:ut:xn:\
-:Co#256:co#80:it#8:li#24:pa#32767:\
-:@7=\EOF:@8=\EOM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:AL=\E[%dL:\
-:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:\
-:IC=\E[%d@:K2=\EOE:Km=\E[M:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:\
-:SA=\E[?7h:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ZH=\E[3m:\
-:ZR=\E[23m:al=\E[L:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\
-:ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\
-:cs=\E[%i%d;%dr:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=^J:\
-:ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
-:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
-:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kD=\E[3~:\
-:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:\
-:kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:\
-:me=\E[m:mr=\E[7m:nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:\
-:sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:ta=^I:te=\E[?1049l:\
-:ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\
-:up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:
+   :NP:am:hs:mi:ms:ut:xn:\
+   :Co#256:co#80:it#8:li#24:pa#32767:\
+   :@7=\EOF:@8=\EOM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:AL=\E[%dL:\
+   :DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:F1=\E[23~:F2=\E[24~:\
+   :IC=\E[%d@:K2=\EOE:Km=\E[M:LE=\E[%dD:RA=\E[?7l:RI=\E[%dC:\
+   :SA=\E[?7h:SF=\E[%dS:SR=\E[%dT:UP=\E[%dA:ZH=\E[3m:\
+   :ZR=\E[23m:al=\E[L:bl=^G:bt=\E[Z:cb=\E[1K:cd=\E[J:ce=\E[K:\
+   :ch=\E[%i%dG:cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:\
+   :cs=\E[%i%d;%dr:cv=\E[%i%dd:dc=\E[P:dl=\E[M:do=^J:\
+   :ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
+   :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
+   :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kD=\E[3~:\
+   :kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:ke=\E[?1l:\
+   :kh=\EOH:kl=\EOD:kr=\EOC:ks=\E[?1h:ku=\EOA:le=^H:md=\E[1m:\
+   :me=\E[m:mr=\E[7m:nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:\
+   :sc=\E7:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:ta=^I:te=\E[?1049l:\
+   :ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\
+   :up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:
 
 #
 # END OF TERMCAP
___
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: r331006 - head/share/termcap

2018-03-15 Thread Baptiste Daroussin
Author: bapt
Date: Thu Mar 15 15:13:17 2018
New Revision: 331006
URL: https://svnweb.freebsd.org/changeset/base/331006

Log:
  Add termcap entries for the st terminal (https://st.sucksless.org)
  
  MFC after:3 days

Modified:
  head/share/termcap/termcap

Modified: head/share/termcap/termcap
==
--- head/share/termcap/termcap  Thu Mar 15 15:05:26 2018(r331005)
+++ head/share/termcap/termcap  Thu Mar 15 15:13:17 2018(r331006)
@@ -4683,6 +4683,43 @@ xterm-termite|VTE-based terminal:\
:ti=\E[?1049h:ts=\E]2;:u6=\E[%i%d;%dR:u7=\E[6n:ue=\E[24m:\
:up=\E[A:us=\E[4m:ve=\E[?25h:vi=\E[?25l:
 
+# Termcap for st terminal taken from the st-0.8 sources
+st|simpleterm:\
+   :am:hs:mi:ms:xn:\
+   :co#80:it#8:li#24:\
+   :AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
+   :K1=\E[1~:K2=\EOu:K3=\E[5~:K4=\E[4~:K5=\E[6~:LE=\E[%dD:\
+   :RI=\E[%dC:SF=\E[%dS:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:\
+   :bl=^G:bt=\E[Z:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\
+   :cm=\E[%i%d;%dH:cr=\r:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:\
+   :dl=\E[M:do=\n:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
+   :is=\E[4l\E>\E[?1034l:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:\
+   :k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:\
+   :kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:kd=\EOB:\
+   :ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\
+   :ku=\EOA:le=^H:mb=\E[5m:md=\E[1m:me=\E[0m:mh=\E[2m:\
+   :mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:se=\E[27m:sf=\n:so=\E[7m:\
+   :sr=\EM:st=\EH:ta=^I:te=\E[?1049l:ti=\E[?1049h:ts=\E]0;:\
+   :ue=\E[24m:up=\E[A:us=\E[4m:vb=\E[?5h\E[?5l:\
+   :ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?25h:
+
+st-256color|simpleterm with 256 colors:\
+   :cc:\
+   :Co#256:pa#32767:\
+   :AB=\E[48;5;%dm:AF=\E[38;5;%dm:\
+   
:..Ic=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\:\
+   :oc=\E]104\007:tc=st:
+
+st-meta|simpleterm with meta key:\
+   :km:\
+   :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\
+   :rs=\E[4l\E>\E[?1034h:tc=st:
+
+st-meta-256color|simpleterm with meta key and 256 colors:\
+   :km:\
+   :is=\E[4l\E>\E[?1034h:mm=\E[?1034h:mo=\E[?1034l:\
+   :rs=\E[4l\E>\E[?1034h:tc=st-256color:
+
 #
 # END OF TERMCAP
 # 
___
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: r330886 - head/share/examples

2018-03-15 Thread Devin Teske

> On Mar 15, 2018, at 5:25 AM, Matthias Meyser  wrote:
> 
> Am 14.03.2018 um 00:37 schrieb Devin Teske:
>> Author: dteske
>> Date: Tue Mar 13 23:37:33 2018
>> New Revision: 330886
>> URL: https://svnweb.freebsd.org/changeset/base/330886 
>> 
>> Log:
>>   Install files added in SVN's r295373, r295457, r295542
>>  Reported by:woodsb02
>>   MFC after: 3 days
>>   X-MFC to:  stable/11
> 
> PR: 214994 (2016) is missing
> 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214994 
> 
> 
> Please change to fixed
> 

Thanks.
-- 
Devin
___
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: r331006 - head/share/termcap

2018-03-15 Thread Andriy Gapon
On 15/03/2018 17:13, Baptiste Daroussin wrote:
> Add termcap entries for the st terminal (https://st.sucksless.org)

Just in case anyone else got curious, the correct URL is https://st.suckless.org

-- 
Andriy Gapon
___
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: r331006 - head/share/termcap

2018-03-15 Thread Baptiste Daroussin
On Thu, Mar 15, 2018 at 05:19:22PM +0200, Andriy Gapon wrote:
> On 15/03/2018 17:13, Baptiste Daroussin wrote:
> > Add termcap entries for the st terminal (https://st.sucksless.org)
> 
> Just in case anyone else got curious, the correct URL is 
> https://st.suckless.org

Thanks and sorry for the typo

Bapt


signature.asc
Description: PGP signature


svn commit: r331007 - head/sys/crypto/aesni

2018-03-15 Thread Conrad Meyer
Author: cem
Date: Thu Mar 15 16:17:02 2018
New Revision: 331007
URL: https://svnweb.freebsd.org/changeset/base/331007

Log:
  aesni(4): Stylistic/comment enhancements
  
  Improve clarity of a comment and style(9) some areas.
  
  No functional change.
  
  Reported by:  markj (on review of a mostly-copied driver)
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/crypto/aesni/aesni.c

Modified: head/sys/crypto/aesni/aesni.c
==
--- head/sys/crypto/aesni/aesni.c   Thu Mar 15 15:13:17 2018
(r331006)
+++ head/sys/crypto/aesni/aesni.c   Thu Mar 15 16:17:02 2018
(r331007)
@@ -327,8 +327,8 @@ unhandled:
return (EINVAL);
}
/*
-* Free sessions goes first, so if first session is used, we need to
-* allocate one.
+* Free sessions are inserted at the head of the list.  So if the first
+* session is used, none are free and we must allocate a new one.
 */
ses = TAILQ_FIRST(&sc->sessions);
if (ses == NULL || ses->used) {
@@ -403,11 +403,13 @@ aesni_freesession(device_t dev, uint64_t tid)
 static int
 aesni_process(device_t dev, struct cryptop *crp, int hint __unused)
 {
-   struct aesni_softc *sc = device_get_softc(dev);
-   struct aesni_session *ses = NULL;
+   struct aesni_softc *sc;
+   struct aesni_session *ses;
struct cryptodesc *crd, *enccrd, *authcrd;
int error, needauth;
 
+   sc = device_get_softc(dev);
+   ses = NULL;
error = 0;
enccrd = NULL;
authcrd = NULL;
@@ -538,7 +540,7 @@ static device_method_t aesni_methods[] = {
DEVMETHOD(cryptodev_freesession, aesni_freesession),
DEVMETHOD(cryptodev_process, aesni_process),
 
-   {0, 0},
+   DEVMETHOD_END
 };
 
 static driver_t aesni_driver = {
___
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: r331008 - head/sys/dev/md

2018-03-15 Thread Brooks Davis
Author: brooks
Date: Thu Mar 15 16:37:43 2018
New Revision: 331008
URL: https://svnweb.freebsd.org/changeset/base/331008

Log:
  Restore the behavior of returning the total number of units by
  unconditionally incrementing i in the loop;
  
  Reported by:  cem
  MFC with: r330880
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D14685

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

Modified: head/sys/dev/md/md.c
==
--- head/sys/dev/md/md.cThu Mar 15 16:17:02 2018(r331007)
+++ head/sys/dev/md/md.cThu Mar 15 16:37:43 2018(r331008)
@@ -1765,7 +1765,8 @@ err_after_new:
i = 1;
LIST_FOREACH(sc, &md_softc_list, list) {
if (i < MDNPAD - 1)
-   mdio->md_pad[i++] = sc->unit;
+   mdio->md_pad[i] = sc->unit;
+   i++;
}
mdio->md_pad[MIN(i, MDNPAD - 1)] = -1;
mdio->md_pad[0] = i - 1;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r331013 - head/sys/cam/ctl

2018-03-15 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Mar 15 17:36:13 2018
New Revision: 331013
URL: https://svnweb.freebsd.org/changeset/base/331013

Log:
  Fix iSCSI target crash on session reinstation.
  
  The crash scenario goes like this: there's a thread waiting on "reinstate";
  because it doesn't update the timeout counter it gets terminated by the
  callout; at this point the maintenance thread starts the termination routine.
  The first thread finishes waiting, proceeds to icl_conn_handoff(), and drops
  the refcount, which allows the maintenance thread to free its resources.  At
  this point another thread receives a PDU.  Boom.
  
  PR:   222898, 219866
  Reported by:  Eugene M. Zheganin 
  Tested by:Eugene M. Zheganin 
  Reviewed by:  mav@ (earlier version)
  MFC after:2 weeks
  Sponsored by: playkey.net

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/cam/ctl/ctl_frontend_iscsi.h

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Thu Mar 15 17:15:40 2018
(r331012)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Thu Mar 15 17:36:13 2018
(r331013)
@@ -1164,11 +1164,11 @@ cfiscsi_maintenance_thread(void *arg)
 
for (;;) {
CFISCSI_SESSION_LOCK(cs);
-   if (cs->cs_terminating == false)
+   if (cs->cs_terminating == false || cs->cs_handoff_in_progress)
cv_wait(&cs->cs_maintenance_cv, &cs->cs_lock);
CFISCSI_SESSION_UNLOCK(cs);
 
-   if (cs->cs_terminating) {
+   if (cs->cs_terminating && cs->cs_handoff_in_progress == false) {
 
/*
 * We used to wait up to 30 seconds to deliver queued
@@ -1196,8 +1196,6 @@ static void
 cfiscsi_session_terminate(struct cfiscsi_session *cs)
 {
 
-   if (cs->cs_terminating)
-   return;
cs->cs_terminating = true;
cv_signal(&cs->cs_maintenance_cv);
 #ifdef ICL_KERNEL_PROXY
@@ -1268,6 +1266,13 @@ cfiscsi_session_new(struct cfiscsi_softc *softc, const
cv_init(&cs->cs_login_cv, "cfiscsi_login");
 #endif
 
+   /*
+* The purpose of this is to avoid racing with session shutdown.
+* Otherwise we could have the maintenance thread call icl_conn_close()
+* before we call icl_conn_handoff().
+*/
+   cs->cs_handoff_in_progress = true;
+
cs->cs_conn = icl_new_conn(offload, false, "cfiscsi", &cs->cs_lock);
if (cs->cs_conn == NULL) {
free(cs, M_CFISCSI);
@@ -1378,8 +1383,18 @@ cfiscsi_accept(struct socket *so, struct sockaddr *sa,
icl_conn_handoff_sock(cs->cs_conn, so);
cs->cs_initiator_sa = sa;
cs->cs_portal_id = portal_id;
+   cs->cs_handoff_in_progress = false;
cs->cs_waiting_for_ctld = true;
cv_signal(&cfiscsi_softc.accept_cv);
+
+   CFISCSI_SESSION_LOCK(cs);
+   /*
+* Wake up the maintenance thread if we got scheduled for termination
+* somewhere between cfiscsi_session_new() and icl_conn_handoff_sock().
+*/
+   if (cs->cs_terminating)
+   cfiscsi_session_terminate(cs);
+   CFISCSI_SESSION_UNLOCK(cs);
 }
 #endif
 
@@ -1559,6 +1574,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci)
mtx_lock(&softc->lock);
if (ct->ct_online == 0) {
mtx_unlock(&softc->lock);
+   cs->cs_handoff_in_progress = false;
cfiscsi_session_terminate(cs);
cfiscsi_target_release(ct);
ci->status = CTL_ISCSI_ERROR;
@@ -1569,7 +1585,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci)
cs->cs_target = ct;
mtx_unlock(&softc->lock);
 
-   refcount_acquire(&cs->cs_outstanding_ctl_pdus);
 restart:
if (!cs->cs_terminating) {
mtx_lock(&softc->lock);
@@ -1606,8 +1621,8 @@ restart:
 #endif
error = icl_conn_handoff(cs->cs_conn, cihp->socket);
if (error != 0) {
+   cs->cs_handoff_in_progress = false;
cfiscsi_session_terminate(cs);
-   refcount_release(&cs->cs_outstanding_ctl_pdus);
ci->status = CTL_ISCSI_ERROR;
snprintf(ci->error_str, sizeof(ci->error_str),
"%s: icl_conn_handoff failed with error %d",
@@ -1632,7 +1647,16 @@ restart:
}
 #endif
 
-   refcount_release(&cs->cs_outstanding_ctl_pdus);
+   CFISCSI_SESSION_LOCK(cs);
+   cs->cs_handoff_in_progress = false;
+
+   /*
+* Wake up the maintenance thread if we got scheduled for termination.
+*/
+   if (cs->cs_terminating)
+   cfiscsi_session_terminate(cs);
+   CFISCSI_SESSION_UNLOCK(cs);
+
ci->status = CTL_ISCSI_OK;
 }
 

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.h

svn commit: r331014 - head/sys/dev/md

2018-03-15 Thread Brooks Davis
Author: brooks
Date: Thu Mar 15 18:12:55 2018
New Revision: 331014
URL: https://svnweb.freebsd.org/changeset/base/331014

Log:
  Move implementation of ioctls into kern_*() functions.
  
  Move locks from outside ioctl to the individual implementations.
  
  This is the first step of changing the implementations to act on a
  kernel-internal request struct rather than on struct md_ioctl and to
  removing the use of kern_ioctl in mountroot.
  
  Reviewed by:  cem, kib, markj (prior version)
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D14700

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

Modified: head/sys/dev/md/md.c
==
--- head/sys/dev/md/md.cThu Mar 15 17:36:13 2018(r331013)
+++ head/sys/dev/md/md.cThu Mar 15 18:12:55 2018(r331014)
@@ -1607,13 +1607,253 @@ mdcreate_null(struct md_s *sc, struct md_ioctl *mdio, 
 }
 
 static int
-xmdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct 
thread *td)
+kern_mdattach_locked(struct thread *td, struct md_ioctl *mdio)
 {
-   struct md_ioctl *mdio;
struct md_s *sc;
-   int error, i;
unsigned sectsize;
+   int error, i;
 
+   sx_assert(&md_sx, SA_XLOCKED);
+
+   switch (mdio->md_type) {
+   case MD_MALLOC:
+   case MD_PRELOAD:
+   case MD_VNODE:
+   case MD_SWAP:
+   case MD_NULL:
+   break;
+   default:
+   return (EINVAL);
+   }
+   if (mdio->md_sectorsize == 0)
+   sectsize = DEV_BSIZE;
+   else
+   sectsize = mdio->md_sectorsize;
+   if (sectsize > MAXPHYS || mdio->md_mediasize < sectsize)
+   return (EINVAL);
+   if (mdio->md_options & MD_AUTOUNIT)
+   sc = mdnew(-1, &error, mdio->md_type);
+   else {
+   if (mdio->md_unit > INT_MAX)
+   return (EINVAL);
+   sc = mdnew(mdio->md_unit, &error, mdio->md_type);
+   }
+   if (sc == NULL)
+   return (error);
+   if (mdio->md_label != NULL)
+   error = copyinstr(mdio->md_label, sc->label,
+   sizeof(sc->label), NULL);
+   if (error != 0)
+   goto err_after_new;
+   if (mdio->md_options & MD_AUTOUNIT)
+   mdio->md_unit = sc->unit;
+   sc->mediasize = mdio->md_mediasize;
+   sc->sectorsize = sectsize;
+   error = EDOOFUS;
+   switch (sc->type) {
+   case MD_MALLOC:
+   sc->start = mdstart_malloc;
+   error = mdcreate_malloc(sc, mdio);
+   break;
+   case MD_PRELOAD:
+   /*
+* We disallow attaching preloaded memory disks via
+* ioctl. Preloaded memory disks are automatically
+* attached in g_md_init().
+*/
+   error = EOPNOTSUPP;
+   break;
+   case MD_VNODE:
+   sc->start = mdstart_vnode;
+   error = mdcreate_vnode(sc, mdio, td);
+   break;
+   case MD_SWAP:
+   sc->start = mdstart_swap;
+   error = mdcreate_swap(sc, mdio, td);
+   break;
+   case MD_NULL:
+   sc->start = mdstart_null;
+   error = mdcreate_null(sc, mdio, td);
+   break;
+   }
+err_after_new:
+   if (error != 0) {
+   mddestroy(sc, td);
+   return (error);
+   }
+
+   /* Prune off any residual fractional sector */
+   i = sc->mediasize % sc->sectorsize;
+   sc->mediasize -= i;
+
+   mdinit(sc);
+   return (0);
+}
+
+static int
+kern_mdattach(struct thread *td, struct md_ioctl *mdio)
+{
+   int error;
+
+   sx_xlock(&md_sx);
+   error = kern_mdattach_locked(td, mdio);
+   sx_xunlock(&md_sx);
+   return (error);
+}
+
+static int
+kern_mddetach_locked(struct thread *td, struct md_ioctl *mdio)
+{
+   struct md_s *sc;
+
+   sx_assert(&md_sx, SA_XLOCKED);
+
+   if (mdio->md_mediasize != 0 ||
+   (mdio->md_options & ~MD_FORCE) != 0)
+   return (EINVAL);
+
+   sc = mdfind(mdio->md_unit);
+   if (sc == NULL)
+   return (ENOENT);
+   if (sc->opencount != 0 && !(sc->flags & MD_FORCE) &&
+   !(mdio->md_options & MD_FORCE))
+   return (EBUSY);
+   return (mddestroy(sc, td));
+}
+
+static int
+kern_mddetach(struct thread *td, struct md_ioctl *mdio)
+{
+   int error;
+
+   sx_xlock(&md_sx);
+   error = kern_mddetach_locked(td, mdio);
+   sx_xunlock(&md_sx);
+   return (error);
+}
+
+static int
+kern_mdresize_locked(struct md_ioctl *mdio)
+{
+   struct md_s *sc;
+
+   sx_assert(&md_sx, SA_XLOCKED);
+
+   if ((mdio->md_options & ~(MD_FORCE | MD_RESERVE)) != 0)
+   return (EINVAL);
+
+   sc = mdfind(mdio->md_unit);
+   if (sc ==

svn commit: r331015 - head/etc/rc.d

2018-03-15 Thread David Bright
Author: dab
Date: Thu Mar 15 18:29:56 2018
New Revision: 331015
URL: https://svnweb.freebsd.org/changeset/base/331015

Log:
  Modify rc.d/fsck to handle new status from fsck/fsck_ffs
  
  r328013 introduced a new error code from fsck_ffs that indicates that
  it could not completely fix the file system; this happens when it
  prints the message PLEASE RERUN FSCK. However, this status can happen
  when fsck is run in "preen" mode and the rc.d/fsck script does not
  handle that error code. Modify rc.d/fsck so that if "fsck -p"
  ("preen") returns the new status code (16) it will run "fsck -y", as
  it currently does for a status code of 8 (the "standard error exit").
  
  Reported by:  markj
  Reviewed by:  mckusick, markj, ian, rgrimes
  MFC after:3 days
  Sponsored by: Dell EMC
  Differential Revision:https://reviews.freebsd.org/D14679

Modified:
  head/etc/rc.d/fsck

Modified: head/etc/rc.d/fsck
==
--- head/etc/rc.d/fsck  Thu Mar 15 18:12:55 2018(r331014)
+++ head/etc/rc.d/fsck  Thu Mar 15 18:29:56 2018(r331015)
@@ -57,7 +57,7 @@ fsck_start()
echo "Reboot failed; help!"
stop_boot
;;
-   8)
+   8|16)
if checkyesno fsck_y_enable; then
echo "File system preen failed, trying fsck -y 
${fsck_y_flags}"
fsck -y ${fsck_y_flags}
___
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: r331015 - head/etc/rc.d

2018-03-15 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ]
> Author: dab
> Date: Thu Mar 15 18:29:56 2018
> New Revision: 331015
> URL: https://svnweb.freebsd.org/changeset/base/331015
> 
> Log:
>   Modify rc.d/fsck to handle new status from fsck/fsck_ffs
>   
>   r328013 introduced a new error code from fsck_ffs that indicates that
>   it could not completely fix the file system; this happens when it
>   prints the message PLEASE RERUN FSCK. However, this status can happen
>   when fsck is run in "preen" mode and the rc.d/fsck script does not
>   handle that error code. Modify rc.d/fsck so that if "fsck -p"
>   ("preen") returns the new status code (16) it will run "fsck -y", as
>   it currently does for a status code of 8 (the "standard error exit").

It will run "fsck -y" IFF fsck_y_enable is set to yes, otherwise it
drops to single user as it does for error 8.

>   Reported by:markj
>   Reviewed by:mckusick, markj, ian, rgrimes
>   MFC after:  3 days
>   Sponsored by:   Dell EMC
>   Differential Revision:  https://reviews.freebsd.org/D14679
> 
> Modified:
>   head/etc/rc.d/fsck
> 
> Modified: head/etc/rc.d/fsck
> ==
> --- head/etc/rc.d/fsckThu Mar 15 18:12:55 2018(r331014)
> +++ head/etc/rc.d/fsckThu Mar 15 18:29:56 2018(r331015)
> @@ -57,7 +57,7 @@ fsck_start()
>   echo "Reboot failed; help!"
>   stop_boot
>   ;;
> - 8)
> + 8|16)
>   if checkyesno fsck_y_enable; then
>   echo "File system preen failed, trying fsck -y 
> ${fsck_y_flags}"
>   fsck -y ${fsck_y_flags}
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
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: r331016 - head/lib/libc/sys

2018-03-15 Thread Mark Johnston
Author: markj
Date: Thu Mar 15 19:03:54 2018
New Revision: 331016
URL: https://svnweb.freebsd.org/changeset/base/331016

Log:
  Add a space between a section number and a following comma.
  
  Fix some nits from igor while here.
  
  MFC after:3 days

Modified:
  head/lib/libc/sys/sendfile.2

Modified: head/lib/libc/sys/sendfile.2
==
--- head/lib/libc/sys/sendfile.2Thu Mar 15 18:29:56 2018
(r331015)
+++ head/lib/libc/sys/sendfile.2Thu Mar 15 19:03:54 2018
(r331016)
@@ -129,8 +129,8 @@ Starting with
 .Nm
 sending files off the
 .Xr ffs 7
-filesystem doesn't block on I/O
-(see 
+filesystem does not block on I/O
+(see
 .Sx IMPLEMENTATION NOTES
 ), so the condition no longer applies.
 However, it is safe if an application utilizes
@@ -140,8 +140,8 @@ and on
 performs the same action as it did in
 older
 .Fx
-versions, e.g.
-.Xr aio_read 2,
+versions, e.g.,
+.Xr aio_read 2 ,
 .Xr read 2
 or
 .Nm
@@ -210,7 +210,7 @@ The
 .Fx
 implementation of
 .Fn sendfile
-doesn't block on disk I/O when it sends a file off the
+does not block on disk I/O when it sends a file off the
 .Xr ffs 7
 filesystem.
 The syscall returns success before the actual I/O completes, and data
___
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: r331018 - head/sys/vm

2018-03-15 Thread Jeff Roberson
Author: jeff
Date: Thu Mar 15 19:23:07 2018
New Revision: 331018
URL: https://svnweb.freebsd.org/changeset/base/331018

Log:
  Eliminate pageout wakeup races.  Take another step towards lockless
  vmd_free_count manipulation.  Reduce the scope of the free lock by
  using a pageout lock to synchronize sleep and wakeup.  Only trigger
  the pageout daemon on transitions between states.  Drive all wakeup
  operations directly as side-effects from freeing memory rather than
  requiring an additional function call.
  
  Reviewed by:  markj, kib
  Tested by:pho
  Sponsored by: Netflix, Dell/EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D14612

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_pageout.c
  head/sys/vm/vm_pagequeue.h
  head/sys/vm/vm_reserv.c

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Thu Mar 15 19:08:33 2018(r331017)
+++ head/sys/vm/vm_page.c   Thu Mar 15 19:23:07 2018(r331018)
@@ -139,14 +139,15 @@ extern intvmem_startup_count(void);
 struct vm_domain vm_dom[MAXMEMDOM];
 
 struct mtx_padalign __exclusive_cache_line pa_lock[PA_LOCK_COUNT];
+
 struct mtx_padalign __exclusive_cache_line vm_domainset_lock;
+/* The following fields are protected by the domainset lock. */
 domainset_t __exclusive_cache_line vm_min_domains;
 domainset_t __exclusive_cache_line vm_severe_domains;
 static int vm_min_waiters;
 static int vm_severe_waiters;
 static int vm_pageproc_waiters;
 
-
 /*
  * bogus page -- for I/O to/from partially complete buffers,
  * or for paging into sparsely invalid regions.
@@ -184,7 +185,6 @@ static void vm_page_insert_radixdone(vm_page_t m, vm_o
 vm_page_t mpred);
 static int vm_page_reclaim_run(int req_class, int domain, u_long npages,
 vm_page_t m_run, vm_paddr_t high);
-static void vm_domain_free_wakeup(struct vm_domain *);
 static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object,
 int req);
 
@@ -430,6 +430,7 @@ vm_page_domain_init(int domain)
MTX_DEF | MTX_DUPOK);
}
mtx_init(&vmd->vmd_free_mtx, "vm page free queue", NULL, MTX_DEF);
+   mtx_init(&vmd->vmd_pageout_mtx, "vm pageout lock", NULL, MTX_DEF);
snprintf(vmd->vmd_name, sizeof(vmd->vmd_name), "%d", domain);
 }
 
@@ -731,8 +732,8 @@ vm_page_startup(vm_offset_t vaddr)
vmd = VM_DOMAIN(seg->domain);
vm_domain_free_lock(vmd);
vm_phys_free_contig(m, pagecount);
-   vm_domain_freecnt_adj(vmd, (int)pagecount);
vm_domain_free_unlock(vmd);
+   vm_domain_freecnt_inc(vmd, pagecount);
vm_cnt.v_page_count += (u_int)pagecount;
 
vmd = VM_DOMAIN(seg->domain);
@@ -1694,7 +1695,6 @@ vm_page_alloc_domain_after(vm_object_t object, vm_pind
struct vm_domain *vmd;
vm_page_t m;
int flags;
-   u_int free_count;
 
KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) &&
(object != NULL || (req & VM_ALLOC_SBUSY) == 0) &&
@@ -1747,6 +1747,9 @@ again:
 #endif
}
}
+   if (m != NULL)
+   vm_domain_freecnt_dec(vmd, 1);
+   vm_domain_free_unlock(vmd);
if (m == NULL) {
/*
 * Not allocatable, give up.
@@ -1760,15 +1763,7 @@ again:
 *  At this point we had better have found a good page.
 */
KASSERT(m != NULL, ("missing page"));
-   free_count = vm_domain_freecnt_adj(vmd, -1);
-   vm_domain_free_unlock(vmd);
 
-   /*
-* Don't wakeup too often - wakeup the pageout daemon when
-* we would be nearly out of memory.
-*/
-   if (vm_paging_needed(vmd, free_count))
-   pagedaemon_wakeup(vmd->vmd_domain);
 #if VM_NRESERVLEVEL > 0
 found:
 #endif
@@ -1804,7 +1799,6 @@ found:
 
if (object != NULL) {
if (vm_page_insert_after(m, object, pindex, mpred)) {
-   pagedaemon_wakeup(domain);
if (req & VM_ALLOC_WIRED) {
vm_wire_sub(1);
m->wire_count = 0;
@@ -1961,13 +1955,14 @@ retry:
goto retry;
 #endif
}
+   if (m_ret != NULL)
+   vm_domain_freecnt_dec(vmd, npages);
+   vm_domain_free_unlock(vmd);
if (m_ret == NULL) {
if (vm_domain_alloc_fail(vmd, object, req))
goto again;
return (NULL);
}
-   vm_domain_freecnt_adj(vmd, -npages);
-   vm_domain_free_unlock(vmd);
 #if VM_NRESERVLEVEL > 0
 found:
 #endif
@@ -2006,7 +2001,6 @@ found:
m->oflags = oflags;
if (object != NULL) {
if (vm_page_insert_after(m, object, pindex, mpred)) {
-   

svn commit: r331029 - head

2018-03-15 Thread Brooks Davis
Author: brooks
Date: Thu Mar 15 21:31:19 2018
New Revision: 331029
URL: https://svnweb.freebsd.org/changeset/base/331029

Log:
  Finish removal of dataacq.h (r330716) and pcaudioio.h (r330766).

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Thu Mar 15 20:46:34 2018(r331028)
+++ head/ObsoleteFiles.inc  Thu Mar 15 21:31:19 2018(r331029)
@@ -38,6 +38,12 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20180311: remove sys/sys/i386/include/pcaudioio.h
+.if ${TARGET_ARCH} == "i386"
+OLD_FILES+=usr/include/machine/pcaudioio.h
+.endif
+# 20180310: remove sys/sys/dataacq.h
+OLD_FILES+=usr/include/sys/dataacq.h
 # 20180306: remove DTrace scripts made obsolete by dwatch(1)
 OLD_FILES+=usr/share/dtrace/watch_execve
 OLD_FILES+=usr/share/dtrace/watch_kill
___
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: r331018 - head/sys/vm

2018-03-15 Thread Kyle Evans
On Thu, Mar 15, 2018 at 2:23 PM, Jeff Roberson  wrote:
> Author: jeff
> Date: Thu Mar 15 19:23:07 2018
> New Revision: 331018
> URL: https://svnweb.freebsd.org/changeset/base/331018
>
> Log:
>   Eliminate pageout wakeup races.  Take another step towards lockless
>   vmd_free_count manipulation.  Reduce the scope of the free lock by
>   using a pageout lock to synchronize sleep and wakeup.  Only trigger
>   the pageout daemon on transitions between states.  Drive all wakeup
>   operations directly as side-effects from freeing memory rather than
>   requiring an additional function call.
>
>   Reviewed by:  markj, kib
>   Tested by:pho
>   Sponsored by: Netflix, Dell/EMC Isilon
>   Differential Revision:https://reviews.freebsd.org/D14612
>

Hey,

Just a heads up: this broke the GCC builds [1] with the following (excerpt):

20:00:47 /usr/src/sys/vm/vm_pagequeue.h:249: warning: redundant
redeclaration of 'pagedaemon_wakeup' [-Wredundant-decls]
20:00:47 /usr/src/sys/vm/vm_pageout.h:98: warning: previous
declaration of 'pagedaemon_wakeup' was here

Thanks,

Kyle Evans

[1] https://ci.freebsd.org/job/FreeBSD-head-mips64-build/1108/console
___
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: r331030 - head/sys/dev/md

2018-03-15 Thread Brooks Davis
Author: brooks
Date: Thu Mar 15 21:42:49 2018
New Revision: 331030
URL: https://svnweb.freebsd.org/changeset/base/331030

Log:
  Add a request structure and make the implementation use it.
  
  This allows compatibility translation to take place on the stack
  (md_ioctl is too big) and is more suitable as a public interface within
  the kernel than the kern_ioctl interface.
  
  Except for the initialization of the md_req from the md_ioctl
  (including detection of kernel md_file pointers) and the updating
  of the md_ioctl prior to return, this is a mechanical replacment
  of md_ioctl and mdio with md_req and mdr.
  
  Reviewed by:  markj, cem, kib (assorted versions)
  Obtained from:CheriBSD
  Sponsored by: DARPA, AFRL
  Differential Revision:https://reviews.freebsd.org/D14704

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

Modified: head/sys/dev/md/md.c
==
--- head/sys/dev/md/md.cThu Mar 15 21:31:19 2018(r331029)
+++ head/sys/dev/md/md.cThu Mar 15 21:42:49 2018(r331030)
@@ -114,6 +114,21 @@
 #define MD_NSECT (1 * 2)
 #endif
 
+struct md_req {
+   unsignedmd_unit;/* unit number */
+   enum md_types   md_type;/* type of disk */
+   off_t   md_mediasize;   /* size of disk in bytes */
+   unsignedmd_sectorsize;  /* sectorsize */
+   unsignedmd_options; /* options */
+   int md_fwheads; /* firmware heads */
+   int md_fwsectors;   /* firmware sectors */
+   char*md_file;   /* pathname of file to mount */
+   enum uio_segmd_file_seg;/* location of md_file */
+   char*md_label;  /* label of the device (userspace) */
+   int *md_units;  /* pointer to units array (kernel) */
+   size_t  md_units_nitems; /* items in md_units array */
+};
+
 static MALLOC_DEFINE(M_MD, "md_disk", "Memory Disk");
 static MALLOC_DEFINE(M_MDSECT, "md_sectors", "Memory Disk Sectors");
 
@@ -1285,29 +1300,29 @@ mdinit(struct md_s *sc)
 }
 
 static int
-mdcreate_malloc(struct md_s *sc, struct md_ioctl *mdio)
+mdcreate_malloc(struct md_s *sc, struct md_req *mdr)
 {
uintptr_t sp;
int error;
off_t u;
 
error = 0;
-   if (mdio->md_options & ~(MD_AUTOUNIT | MD_COMPRESS | MD_RESERVE))
+   if (mdr->md_options & ~(MD_AUTOUNIT | MD_COMPRESS | MD_RESERVE))
return (EINVAL);
-   if (mdio->md_sectorsize != 0 && !powerof2(mdio->md_sectorsize))
+   if (mdr->md_sectorsize != 0 && !powerof2(mdr->md_sectorsize))
return (EINVAL);
/* Compression doesn't make sense if we have reserved space */
-   if (mdio->md_options & MD_RESERVE)
-   mdio->md_options &= ~MD_COMPRESS;
-   if (mdio->md_fwsectors != 0)
-   sc->fwsectors = mdio->md_fwsectors;
-   if (mdio->md_fwheads != 0)
-   sc->fwheads = mdio->md_fwheads;
-   sc->flags = mdio->md_options & (MD_COMPRESS | MD_FORCE);
+   if (mdr->md_options & MD_RESERVE)
+   mdr->md_options &= ~MD_COMPRESS;
+   if (mdr->md_fwsectors != 0)
+   sc->fwsectors = mdr->md_fwsectors;
+   if (mdr->md_fwheads != 0)
+   sc->fwheads = mdr->md_fwheads;
+   sc->flags = mdr->md_options & (MD_COMPRESS | MD_FORCE);
sc->indir = dimension(sc->mediasize / sc->sectorsize);
sc->uma = uma_zcreate(sc->name, sc->sectorsize, NULL, NULL, NULL, NULL,
0x1ff, 0);
-   if (mdio->md_options & MD_RESERVE) {
+   if (mdr->md_options & MD_RESERVE) {
off_t nsectors;
 
nsectors = sc->mediasize / sc->sectorsize;
@@ -1368,19 +1383,15 @@ mdsetcred(struct md_s *sc, struct ucred *cred)
 }
 
 static int
-mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio, struct thread *td)
+mdcreate_vnode(struct md_s *sc, struct md_req *mdr, struct thread *td)
 {
struct vattr vattr;
struct nameidata nd;
char *fname;
int error, flags;
 
-   /*
-* Kernel-originated requests must have the filename appended
-* to the mdio structure to protect against malicious software.
-*/
-   fname = mdio->md_file;
-   if ((void *)fname != (void *)(mdio + 1)) {
+   fname = mdr->md_file;
+   if (mdr->md_file_seg == UIO_USERSPACE) {
error = copyinstr(fname, sc->file, sizeof(sc->file), NULL);
if (error != 0)
return (error);
@@ -1391,8 +1402,8 @@ mdcreate_vnode(struct md_s *sc, struct md_ioctl *mdio,
 * If the user specified that this is a read only device, don't
 * set the FWRITE mask before trying to open the backing store.
 */
-   flags = FREAD | ((mdio->md_options & MD_READONLY) ? 0 : FWRITE) \
-   | ((mdio->md_options & MD_VERIFY) ? O_VERIFY : 0);
+   flags = FREAD | ((mdr->

svn commit: r331040 - head/sys/net

2018-03-15 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Mar 15 23:32:29 2018
New Revision: 331040
URL: https://svnweb.freebsd.org/changeset/base/331040

Log:
  Correct comment for IFM_IEEE80211_VHT media variant.

Modified:
  head/sys/net/if_media.h

Modified: head/sys/net/if_media.h
==
--- head/sys/net/if_media.h Thu Mar 15 23:02:52 2018(r331039)
+++ head/sys/net/if_media.h Thu Mar 15 23:32:29 2018(r331040)
@@ -270,7 +270,7 @@ uint64_tifmedia_baudrate(int);
 #defineIFM_IEEE80211_OFDM2723  /* OFDM 27Mbps */
 /* NB: not enough bits to express MCS fully */
 #defineIFM_IEEE80211_MCS   24  /* HT MCS rate */
-#defineIFM_IEEE80211_VHT   25  /* HT MCS rate */
+#defineIFM_IEEE80211_VHT   25  /* VHT MCS rate */
 
 #defineIFM_IEEE80211_ADHOC 0x0100  /* Operate in Adhoc 
mode */
 #defineIFM_IEEE80211_HOSTAP0x0200  /* Operate in Host AP 
mode */
___
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: r331041 - head/sys/dev/usb/wlan

2018-03-15 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Mar 16 00:09:16 2018
New Revision: 331041
URL: https://svnweb.freebsd.org/changeset/base/331041

Log:
  urtw(4): provide names for some commonly used rate indices + drop
  now-unused urtw_rate2rtl()

Modified:
  head/sys/dev/usb/wlan/if_urtw.c

Modified: head/sys/dev/usb/wlan/if_urtw.c
==
--- head/sys/dev/usb/wlan/if_urtw.c Thu Mar 15 23:32:29 2018
(r331040)
+++ head/sys/dev/usb/wlan/if_urtw.c Fri Mar 16 00:09:16 2018
(r331041)
@@ -65,6 +65,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+/* copy some rate indices from if_rtwn_ridx.h */
+#defineURTW_RIDX_CCK5  2
+#defineURTW_RIDX_CCK11 3
+#defineURTW_RIDX_OFDM6 4
+#defineURTW_RIDX_OFDM248
+
 static SYSCTL_NODE(_hw_usb, OID_AUTO, urtw, CTLFLAG_RW, 0, "USB Realtek 
8187L");
 #ifdef URTW_DEBUG
 int urtw_debug = 0;
@@ -682,7 +688,6 @@ static void urtw_ledtask(void *, int);
 static voidurtw_watchdog(void *);
 static voidurtw_set_multi(void *);
 static int urtw_isbmode(uint16_t);
-static uint16_turtw_rate2rtl(uint32_t);
 static uint16_turtw_rtl2rate(uint32_t);
 static usb_error_t urtw_set_rate(struct urtw_softc *);
 static usb_error_t urtw_update_msr(struct urtw_softc *);
@@ -866,7 +871,7 @@ urtw_attach(device_t dev)
 
sc->sc_rts_retry = URTW_DEFAULT_RTS_RETRY;
sc->sc_tx_retry = URTW_DEFAULT_TX_RETRY;
-   sc->sc_currate = 3;
+   sc->sc_currate = URTW_RIDX_CCK11;
sc->sc_preamble_mode = urtw_preamble_mode;
 
ic->ic_softc = sc;
@@ -1766,8 +1771,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
flags |= URTW_TX_FLAG_CTS;
if (rtsenable) {
flags |= URTW_TX_FLAG_RTS;
-   flags |= (urtw_rate2rtl(11) & 0xf) <<
-   URTW_TX_FLAG_RTSRATE_SHIFT;
+   flags |= URTW_RIDX_CCK5 << URTW_TX_FLAG_RTSRATE_SHIFT;
tx->rtsdur = rtsdur;
}
tx->flag = htole32(flags);
@@ -1788,7 +1792,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
flags |= URTW_TX_FLAG_RTS;
tx->rtsdur = rtsdur;
}
-   flags |= (urtw_rate2rtl(11) & 0xf) << 
URTW_TX_FLAG_RTSRATE_SHIFT;
+   flags |= URTW_RIDX_CCK5 << URTW_TX_FLAG_RTSRATE_SHIFT;
tx->flag = htole32(flags);
tx->retry = 3;  /* CW minimum  */
tx->retry |= 7 << 4;/* CW maximum  */
@@ -1908,9 +1912,9 @@ urtw_set_rate(struct urtw_softc *sc)
uint16_t data;
usb_error_t error;
 
-   basic_rate = urtw_rate2rtl(48);
-   min_rr_rate = urtw_rate2rtl(12);
-   max_rr_rate = urtw_rate2rtl(48);
+   basic_rate = URTW_RIDX_OFDM24;
+   min_rr_rate = URTW_RIDX_OFDM6;
+   max_rr_rate = URTW_RIDX_OFDM24;
 
urtw_write8_m(sc, URTW_RESP_RATE,
max_rr_rate << URTW_RESP_MAX_RATE_SHIFT |
@@ -1925,19 +1929,6 @@ urtw_set_rate(struct urtw_softc *sc)
urtw_write16_m(sc, URTW_BRSR, data);
 fail:
return (error);
-}
-
-static uint16_t
-urtw_rate2rtl(uint32_t rate)
-{
-   unsigned int i;
-
-   for (i = 0; i < nitems(urtw_ratetable); i++) {
-   if (rate == urtw_ratetable[i].reg)
-   return urtw_ratetable[i].val;
-   }
-
-   return (3);
 }
 
 static uint16_t
___
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: r331042 - head/sys/dev/usb/wlan

2018-03-15 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Mar 16 00:38:10 2018
New Revision: 331042
URL: https://svnweb.freebsd.org/changeset/base/331042

Log:
  urtw(4), zyd(4): reduce code verbosity.
  
  No functional change intended.

Modified:
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/usb/wlan/if_zyd.c

Modified: head/sys/dev/usb/wlan/if_urtw.c
==
--- head/sys/dev/usb/wlan/if_urtw.c Fri Mar 16 00:09:16 2018
(r331041)
+++ head/sys/dev/usb/wlan/if_urtw.c Fri Mar 16 00:38:10 2018
(r331042)
@@ -1661,14 +1661,17 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
sc->sc_xfer[URTW_8187B_BULK_TX_VO]
};
struct usb_xfer *xfer;
-   int dur = 0, rtsdur = 0, rtsenable = 0, ctsenable = 0, rate,
-   pkttime = 0, txdur = 0, isshort = 0, xferlen;
+   int dur = 0, rtsdur = 0, rtsenable = 0, ctsenable = 0, rate, type,
+   pkttime = 0, txdur = 0, isshort = 0, xferlen, ismcast;
uint16_t acktime, rtstime, ctstime;
uint32_t flags;
usb_error_t error;
 
URTW_ASSERT_LOCKED(sc);
 
+   ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1);
+   type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
+
/*
 * Software crypto.
 */
@@ -1697,13 +1700,13 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
ieee80211_radiotap_tx(vap, m0);
}
 
-   if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT ||
-   (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL ||
+   if (type == IEEE80211_FC0_TYPE_MGT ||
+   type == IEEE80211_FC0_TYPE_CTL ||
(m0->m_flags & M_EAPOL) != 0) {
rate = tp->mgmtrate;
} else {
/* for data frames */
-   if (IEEE80211_IS_MULTICAST(wh->i_addr1))
+   if (ismcast)
rate = tp->mcastrate;
else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE)
rate = tp->ucastrate;
@@ -1713,7 +1716,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
 
sc->sc_stats.txrates[sc->sc_currate]++;
 
-   if (IEEE80211_IS_MULTICAST(wh->i_addr1))
+   if (ismcast)
txdur = pkttime = urtw_compute_txtime(m0->m_pkthdr.len +
IEEE80211_CRC_LEN, rate, 0, 0);
else {
@@ -1776,8 +1779,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
}
tx->flag = htole32(flags);
tx->txdur = txdur;
-   if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) ==
-   IEEE80211_FC0_TYPE_MGT &&
+   if (type == IEEE80211_FC0_TYPE_MGT &&
(wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) ==
IEEE80211_FC0_SUBTYPE_PROBE_RESP)
tx->retry = 1;
@@ -1805,7 +1807,7 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_
data->m = m0;
 
if (sc->sc_flags & URTW_RTL8187B) {
-   switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) {
+   switch (type) {
case IEEE80211_FC0_TYPE_CTL:
case IEEE80211_FC0_TYPE_MGT:
xfer = sc->sc_xfer[URTW_8187B_BULK_TX_EP12];

Modified: head/sys/dev/usb/wlan/if_zyd.c
==
--- head/sys/dev/usb/wlan/if_zyd.c  Fri Mar 16 00:09:16 2018
(r331041)
+++ head/sys/dev/usb/wlan/if_zyd.c  Fri Mar 16 00:38:10 2018
(r331042)
@@ -2443,7 +2443,7 @@ zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, st
struct ieee80211_frame *wh;
const struct ieee80211_txparam *tp = ni->ni_txparms;
struct ieee80211_key *k;
-   int rate, totlen;
+   int rate, totlen, type, ismcast;
static const uint8_t ratediv[] = ZYD_TX_RATEDIV;
uint8_t phy;
uint16_t pktlen;
@@ -2454,13 +2454,16 @@ zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, st
STAILQ_REMOVE_HEAD(&sc->tx_free, next);
sc->tx_nfree--;
 
-   if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_MGT ||
-   (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL ||
+   ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1);
+   type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;
+
+   if (type == IEEE80211_FC0_TYPE_MGT ||
+   type == IEEE80211_FC0_TYPE_CTL ||
(m0->m_flags & M_EAPOL) != 0) {
rate = tp->mgmtrate;
} else {
/* for data frames */
-   if (IEEE80211_IS_MULTICAST(wh->i_addr1))
+   if (ismcast)
rate = tp->mcastrate;
else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE)
rate = tp->ucastrate;
@@ -2498,7 +2501,7 @@ zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, st
desc->len = htole16(totlen);
 

svn commit: r331043 - in head/sys/dev/rtwn: . rtl8188e rtl8192c rtl8812a

2018-03-15 Thread Andriy Voskoboinyk
Author: avos
Date: Fri Mar 16 01:03:10 2018
New Revision: 331043
URL: https://svnweb.freebsd.org/changeset/base/331043

Log:
  rtwn(4): de-hardcode ('h/w rate index' - 'corresponding MCS index') constant

Modified:
  head/sys/dev/rtwn/if_rtwn_ridx.h
  head/sys/dev/rtwn/rtl8188e/r88e_rx.c
  head/sys/dev/rtwn/rtl8192c/r92c_rx.c
  head/sys/dev/rtwn/rtl8812a/r12a_rx.c

Modified: head/sys/dev/rtwn/if_rtwn_ridx.h
==
--- head/sys/dev/rtwn/if_rtwn_ridx.hFri Mar 16 00:38:10 2018
(r331042)
+++ head/sys/dev/rtwn/if_rtwn_ridx.hFri Mar 16 01:03:10 2018
(r331043)
@@ -36,8 +36,10 @@
 #define RTWN_RIDX_OFDM36   9
 #define RTWN_RIDX_OFDM48   10
 #define RTWN_RIDX_OFDM54   11
-#define RTWN_RIDX_HT_MCS(i)(12 + (i))
 
+#define RTWN_RIDX_HT_MCS_SHIFT 12
+#define RTWN_RIDX_HT_MCS(i)(RTWN_RIDX_HT_MCS_SHIFT + (i))
+
 #define RTWN_RIDX_COUNT28
 #define RTWN_RIDX_UNKNOWN  (uint8_t)-1
 
@@ -53,8 +55,7 @@ static __inline uint8_t
 rate2ridx(uint8_t rate)
 {
if (rate & IEEE80211_RATE_MCS) {
-   /* 11n rates start at idx 12 */
-   return ((rate & 0xf) + 12);
+   return ((rate & 0xf) + RTWN_RIDX_HT_MCS_SHIFT);
}
switch (rate) {
/* 11g */

Modified: head/sys/dev/rtwn/rtl8188e/r88e_rx.c
==
--- head/sys/dev/rtwn/rtl8188e/r88e_rx.cFri Mar 16 00:38:10 2018
(r331042)
+++ head/sys/dev/rtwn/rtl8188e/r88e_rx.cFri Mar 16 01:03:10 2018
(r331043)
@@ -108,7 +108,8 @@ r88e_ratectl_tx_complete(struct rtwn_softc *sc, uint8_
txs.long_retries = ntries;
if (rpt->final_rate > RTWN_RIDX_OFDM54) {   /* MCS */
txs.final_rate =
-   (rpt->final_rate - 12) | IEEE80211_RATE_MCS;
+   rpt->final_rate - RTWN_RIDX_HT_MCS_SHIFT;
+   txs.final_rate |= IEEE80211_RATE_MCS;
} else
txs.final_rate = ridx2rate[rpt->final_rate];
if (rpt->rptb1 & R88E_RPTB1_PKT_OK)

Modified: head/sys/dev/rtwn/rtl8192c/r92c_rx.c
==
--- head/sys/dev/rtwn/rtl8192c/r92c_rx.cFri Mar 16 00:38:10 2018
(r331042)
+++ head/sys/dev/rtwn/rtl8192c/r92c_rx.cFri Mar 16 01:03:10 2018
(r331043)
@@ -140,7 +140,8 @@ r92c_get_rx_stats(struct rtwn_softc *sc, struct ieee80
else
rxs->c_pktflags |= IEEE80211_RX_F_OFDM;
} else {/* MCS0~15. */
-   rxs->c_rate = IEEE80211_RATE_MCS | (rate - 12);
+   rxs->c_rate =
+   IEEE80211_RATE_MCS | (rate - RTWN_RIDX_HT_MCS_SHIFT);
rxs->c_pktflags |= IEEE80211_RX_F_HT;
}
 }

Modified: head/sys/dev/rtwn/rtl8812a/r12a_rx.c
==
--- head/sys/dev/rtwn/rtl8812a/r12a_rx.cFri Mar 16 00:38:10 2018
(r331042)
+++ head/sys/dev/rtwn/rtl8812a/r12a_rx.cFri Mar 16 01:03:10 2018
(r331043)
@@ -115,7 +115,8 @@ r12a_ratectl_tx_complete(struct rtwn_softc *sc, uint8_
txs.long_retries = ntries;
if (rpt->final_rate > RTWN_RIDX_OFDM54) {   /* MCS */
txs.final_rate =
-   (rpt->final_rate - 12) | IEEE80211_RATE_MCS;
+   rpt->final_rate - RTWN_RIDX_HT_MCS_SHIFT;
+   txs.final_rate |= IEEE80211_RATE_MCS;
} else
txs.final_rate = ridx2rate[rpt->final_rate];
if (rpt->txrptb0 & R12A_TXRPTB0_RETRY_OVER)
@@ -310,7 +311,8 @@ r12a_get_rx_stats(struct rtwn_softc *sc, struct ieee80
rxs->c_pktflags |= IEEE80211_RX_F_OFDM;
} else {/* MCS0~15. */
/* TODO: VHT rates */
-   rxs->c_rate = IEEE80211_RATE_MCS | (rate - 12);
+   rxs->c_rate =
+   IEEE80211_RATE_MCS | (rate - RTWN_RIDX_HT_MCS_SHIFT);
rxs->c_pktflags |= IEEE80211_RX_F_HT;
}
 
___
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: r331045 - head/sys/modules/imx/imx_spi

2018-03-15 Thread Ian Lepore
Author: ian
Date: Fri Mar 16 02:46:08 2018
New Revision: 331045
URL: https://svnweb.freebsd.org/changeset/base/331045

Log:
  Add required interface header.
  
  Reported by:  andreast@

Modified:
  head/sys/modules/imx/imx_spi/Makefile

Modified: head/sys/modules/imx/imx_spi/Makefile
==
--- head/sys/modules/imx/imx_spi/Makefile   Fri Mar 16 02:44:18 2018
(r331044)
+++ head/sys/modules/imx/imx_spi/Makefile   Fri Mar 16 02:46:08 2018
(r331045)
@@ -9,6 +9,7 @@ SRCS=   imx_spi.c
 SRCS+= \
bus_if.h \
device_if.h \
+   gpio_if.h \
ofw_bus_if.h \
opt_platform.h \
spibus_if.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: r331046 - head/sys/dev/nvme

2018-03-15 Thread Warner Losh
Author: imp
Date: Fri Mar 16 05:23:48 2018
New Revision: 331046
URL: https://svnweb.freebsd.org/changeset/base/331046

Log:
  Try polling the qpairs on timeout.
  
  On some systems, we're getting timeouts when we use multiple queues on
  drives that work perfectly well on other systems. On a hunch, Jim
  Harris suggested I poll the completion queue when we get a timeout.
  This patch polls the completion queue if no fatal status was
  indicated. If it had pending I/O, we complete that request and
  return. Otherwise, if aborts are enabled and no fatal status, we abort
  the command and return. Otherwise we reset the card.
  
  This may clear up the problem, or we may see it result in lots of
  timeouts and a performance problem. Either way, we'll know the next
  step. We may also need to pay attention to the fatal status bit
  of the controller.
  
  PR: 211713
  Suggested by: Jim Harris
  Sponsored by: Netflix

Modified:
  head/sys/dev/nvme/nvme_private.h
  head/sys/dev/nvme/nvme_qpair.c

Modified: head/sys/dev/nvme/nvme_private.h
==
--- head/sys/dev/nvme/nvme_private.hFri Mar 16 02:46:08 2018
(r331045)
+++ head/sys/dev/nvme/nvme_private.hFri Mar 16 05:23:48 2018
(r331046)
@@ -426,7 +426,7 @@ int nvme_qpair_construct(struct nvme_qpair *qpair, uin
 struct nvme_controller *ctrlr);
 void   nvme_qpair_submit_tracker(struct nvme_qpair *qpair,
  struct nvme_tracker *tr);
-void   nvme_qpair_process_completions(struct nvme_qpair *qpair);
+bool   nvme_qpair_process_completions(struct nvme_qpair *qpair);
 void   nvme_qpair_submit_request(struct nvme_qpair *qpair,
  struct nvme_request *req);
 void   nvme_qpair_reset(struct nvme_qpair *qpair);

Modified: head/sys/dev/nvme/nvme_qpair.c
==
--- head/sys/dev/nvme/nvme_qpair.c  Fri Mar 16 02:46:08 2018
(r331045)
+++ head/sys/dev/nvme/nvme_qpair.c  Fri Mar 16 05:23:48 2018
(r331046)
@@ -469,11 +469,12 @@ nvme_qpair_manual_complete_request(struct nvme_qpair *
nvme_free_request(req);
 }
 
-void
+bool
 nvme_qpair_process_completions(struct nvme_qpair *qpair)
 {
struct nvme_tracker *tr;
struct nvme_completion  cpl;
+   int done = 0;
 
qpair->num_intr_handler_calls++;
 
@@ -484,7 +485,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai
 *  associated with this interrupt will get retried when the
 *  reset is complete.
 */
-   return;
+   return (false);
 
while (1) {
cpl = qpair->cpl[qpair->cq_head];
@@ -500,6 +501,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai
if (tr != NULL) {
nvme_qpair_complete_tracker(qpair, tr, &cpl, TRUE);
qpair->sq_head = cpl.sqhd;
+   done++;
} else {
nvme_printf(qpair->ctrlr, 
"cpl does not map to outstanding cmd\n");
@@ -516,6 +518,7 @@ nvme_qpair_process_completions(struct nvme_qpair *qpai
nvme_mmio_write_4(qpair->ctrlr, doorbell[qpair->id].cq_hdbl,
qpair->cq_head);
}
+   return (done != 0);
 }
 
 static void
@@ -770,19 +773,30 @@ nvme_timeout(void *arg)
uint32_tcsts;
uint8_t cfs;
 
-   /* Read csts to get value of cfs - controller fatal status. */
+   /*
+* Read csts to get value of cfs - controller fatal status.
+* If no fatal status, try to call the completion routine, and
+* if completes transactions, report a missed interrupt and
+* return (this may need to be rate limited). Otherwise, if
+* aborts are enabled and the controller is not reporting
+* fatal status, abort the command. Otherwise, just reset the
+* controller and hope for the best.
+*/
csts = nvme_mmio_read_4(ctrlr, csts);
-
cfs = (csts >> NVME_CSTS_REG_CFS_SHIFT) & NVME_CSTS_REG_CFS_MASK;
+   if (cfs == 0 && nvme_qpair_process_completions(qpair)) {
+   nvme_printf(ctrlr, "Missing interrupt\n");
+   return;
+   }
if (ctrlr->enable_aborts && cfs == 0) {
-   /*
-* If aborts are enabled, only use them if the controller is
-*  not reporting fatal status.
-*/
+   nvme_printf(ctrlr, "Aborting command due to a timeout.\n");
nvme_ctrlr_cmd_abort(ctrlr, tr->cid, qpair->id,
nvme_abort_complete, tr);
-   } else
+   } else {
+   nvme_printf(ctrlr, "Resetting controller due to a timeout%s.\n",
+   cfs ? " and fatal error status" : "");

Re: svn commit: r303099 - head/sys/kern

2018-03-15 Thread Eitan Adler
On 20 July 2016 at 09:59, Conrad E. Meyer  wrote:
> Author: cem
> Date: Wed Jul 20 16:59:36 2016
> New Revision: 303099
> URL: https://svnweb.freebsd.org/changeset/base/303099
>
> Log:
>   Extend ELF coredump to support more than 65535 segments

r303099, r303105, r303114, r308177

Is this and related safe to MFC? If so did I miss any ?



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