Re: svn commit: r303763 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys

2016-08-05 Thread Andriy Gapon
On 05/08/2016 09:23, Andriy Gapon wrote:
>   - replace ZFS_ENTER mechanism with VFS managed / visible mechanism
>   - replace zfs_zget with zfs_vget[f] as much as possible

I'd like to add a couple more words about these items.

At the moment the operation like rollback and (incremental) receive are
protected by z_teardown_lock that is acquired within ZPL and thus after
vnode locks acquired by VFS.

That has several consequences:

- we have to be very careful to not acquire any vnode locks within
ZFS_ENTER + ZFS_EXIT delimited blocks and that leads to more complex code

- as a consequence we can not lock ZFS vnodes right when we get them, so
we have to resort to some tricks

- zfs rollback, as an example, may cause trouble for operations like
zfs_remove, because the parent and child vnodes are looked up (and
locked) before calling zfs_remove and by the time it grabs
z_teardown_lock those vnodes may already point to arbitrary nodes as a
result of the rollback

- there is a LOR between the normal path (e.g. page in or page out)
where the vnode and page locks are acquired before z_teardown_lock and
the rollback path where ZPL calls vn_pages_remove() while holding the
tear-down lock.

So, logically we should acquire a lock that protects a filesystem from a
rollback (or other out-of-band modification) before acquiring any of its
vnode locks.  Currently we have a similar but rather FFS-specific
mechanism of vn_start_write and vfs_write_suspend.  The mechanism is
used for blocking writes when taking FFS snapshots, but it could be
extended to block reads for rollbacks.

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


svn commit: r303764 - head/sys/dev/hyperv/vmbus

2016-08-05 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Aug  5 08:57:51 2016
New Revision: 303764
URL: https://svnweb.freebsd.org/changeset/base/303764

Log:
  hyperv/vmbus: Only make sure the TX bufring will not be closed.
  
  KVP can write data, whose size is > 1/2 TX bufring size.
  
  MFC after:1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:https://reviews.freebsd.org/D7414

Modified:
  head/sys/dev/hyperv/vmbus/vmbus_brvar.h

Modified: head/sys/dev/hyperv/vmbus/vmbus_brvar.h
==
--- head/sys/dev/hyperv/vmbus/vmbus_brvar.h Fri Aug  5 06:23:06 2016
(r303763)
+++ head/sys/dev/hyperv/vmbus/vmbus_brvar.h Fri Aug  5 08:57:51 2016
(r303764)
@@ -74,8 +74,12 @@ struct sysctl_oid;
 static __inline int
 vmbus_txbr_maxpktsz(const struct vmbus_txbr *tbr)
 {
-   /* 1/2 data size */
-   return (tbr->txbr_dsize / 2);
+   /*
+* - 64 bits for the trailing start index (- sizeof(uint64_t)).
+* - The rindex and windex can't be same (- 1).  See
+*   the comment near vmbus_bufring.br_{r,w}index.
+*/
+   return (tbr->txbr_dsize - sizeof(uint64_t) - 1);
 }
 
 void   vmbus_br_sysctl_create(struct sysctl_ctx_list *ctx,
___
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: r303765 - head/sys/dev/usb/input

2016-08-05 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Aug  5 08:58:00 2016
New Revision: 303765
URL: https://svnweb.freebsd.org/changeset/base/303765

Log:
  Keep a reference count on USB keyboard polling to allow recursive
  cngrab() during a panic for example, similar to what the AT-keyboard
  driver is doing.
  
  Found by: Bruce Evans 
  MFC after:1 week

Modified:
  head/sys/dev/usb/input/ukbd.c

Modified: head/sys/dev/usb/input/ukbd.c
==
--- head/sys/dev/usb/input/ukbd.c   Fri Aug  5 08:57:51 2016
(r303764)
+++ head/sys/dev/usb/input/ukbd.c   Fri Aug  5 08:58:00 2016
(r303765)
@@ -198,6 +198,7 @@ struct ukbd_softc {
int sc_mode;/* input mode (K_XLATE,K_RAW,K_CODE) */
int sc_state;   /* shift/lock key state */
int sc_accents; /* accent key index (> 0) */
+   int sc_polling; /* polling recursion count */
int sc_led_size;
int sc_kbd_size;
 
@@ -1983,7 +1984,16 @@ ukbd_poll(keyboard_t *kbd, int on)
struct ukbd_softc *sc = kbd->kb_data;
 
UKBD_LOCK();
-   if (on) {
+   /*
+* Keep a reference count on polling to allow recursive
+* cngrab() during a panic for example.
+*/
+   if (on)
+   sc->sc_polling++;
+   else
+   sc->sc_polling--;
+
+   if (sc->sc_polling != 0) {
sc->sc_flags |= UKBD_FLAG_POLLING;
sc->sc_poll_thread = curthread;
} else {
___
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: r303766 - head/sys/netinet

2016-08-05 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Aug  5 09:08:00 2016
New Revision: 303766
URL: https://svnweb.freebsd.org/changeset/base/303766

Log:
  tcp/lro: If timestamps mismatch or it's a FIN, force flush.
  
  This keeps the segments/ACK/FIN delivery order.
  
  Before this patch, it was observed: if A sent FIN immediately after
  an ACK, B would deliver FIN first to the TCP stack, then the ACK.
  This out-of-order delivery causes one unnecessary ACK sent from B.
  
  Reviewed by:  gallatin, hps
  Obtained from:  rrs, gallatin
  Sponsored by: Netflix (rrs, gallatin), Microsoft (sephe)
  Differential Revision:https://reviews.freebsd.org/D7415

Modified:
  head/sys/netinet/tcp_lro.c

Modified: head/sys/netinet/tcp_lro.c
==
--- head/sys/netinet/tcp_lro.c  Fri Aug  5 08:58:00 2016(r303765)
+++ head/sys/netinet/tcp_lro.c  Fri Aug  5 09:08:00 2016(r303766)
@@ -603,6 +603,7 @@ tcp_lro_rx2(struct lro_ctrl *lc, struct 
int error, ip_len, l;
uint16_t eh_type, tcp_data_len;
struct lro_head *bucket;
+   int force_flush = 0;
 
/* We expect a contiguous header [eh, ip, tcp]. */
 
@@ -669,8 +670,15 @@ tcp_lro_rx2(struct lro_ctrl *lc, struct 
 * Check TCP header constraints.
 */
/* Ensure no bits set besides ACK or PSH. */
-   if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0)
-   return (TCP_LRO_CANNOT);
+   if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0) {
+   if (th->th_flags & TH_SYN)
+   return (TCP_LRO_CANNOT);
+   /*
+* Make sure that previously seen segements/ACKs are delivered
+* before this segement, e.g. FIN.
+*/
+   force_flush = 1;
+   }
 
/* XXX-BZ We lose a ACK|PUSH flag concatenating multiple segments. */
/* XXX-BZ Ideally we'd flush on PUSH? */
@@ -686,8 +694,13 @@ tcp_lro_rx2(struct lro_ctrl *lc, struct 
ts_ptr = (uint32_t *)(th + 1);
if (l != 0 && (__predict_false(l != TCPOLEN_TSTAMP_APPA) ||
(*ts_ptr != ntohl(TCPOPT_NOP<<24|TCPOPT_NOP<<16|
-   TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP
-   return (TCP_LRO_CANNOT);
+   TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP {
+   /*
+* Make sure that previously seen segements/ACKs are delivered
+* before this segement.
+*/
+   force_flush = 1;
+   }
 
/* If the driver did not pass in the checksum, set it now. */
if (csum == 0x)
@@ -754,6 +767,13 @@ tcp_lro_rx2(struct lro_ctrl *lc, struct 
 #endif
}
 
+   if (force_flush) {
+   /* Timestamps mismatch; this is a FIN, etc */
+   tcp_lro_active_remove(le);
+   tcp_lro_flush(lc, le);
+   return (TCP_LRO_CANNOT);
+   }
+
/* Flush now if appending will result in overflow. */
if (le->p_len > (lc->lro_length_lim - tcp_data_len)) {
tcp_lro_active_remove(le);
@@ -830,6 +850,14 @@ tcp_lro_rx2(struct lro_ctrl *lc, struct 
return (0);
}
 
+   if (force_flush) {
+   /*
+* Nothing to flush, but this segment can not be further
+* aggregated/delayed.
+*/
+   return (TCP_LRO_CANNOT);
+   }
+
/* Try to find an empty slot. */
if (LIST_EMPTY(&lc->lro_free))
return (TCP_LRO_NO_ENTRIES);
___
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: r303755 - head/sys/kern

2016-08-05 Thread John Baldwin
On Friday, August 05, 2016 01:06:22 PM Julian Elischer wrote:
> On 5/08/2016 8:07 AM, John Baldwin wrote:
> > On Thursday, August 04, 2016 07:14:18 PM Bryan Drewery wrote:
> >> Author: bdrewery
> >> Date: Thu Aug  4 19:14:18 2016
> >> New Revision: 303755
> >> URL: https://svnweb.freebsd.org/changeset/base/303755
> >>
> >> Log:
> >>Still provide freebsd10_* symbols from libc for COMPAT10.
> >>
> >>r296773 was done to only remove libc symbols for <7.  We want to provide
> >>the syscall symbols going forward for 7+.
> > In particular, binaries from FreeBSD versions older than 7 do not link
> > against libc.so.7.  However, we want compat system call symbols in libc.so.7
> > for COMPAT_FREEBSD7 and later in case a shim is needed to implement an
> > older version of a libc symbol via symver_compat().
> >
> personally I'd rather we drove a stake through the heart of symbol 
> versioning and
> went back to how it was, when one could work out what was going on.
> I certainly miss the ability to get the openssl package to overwrite 
> the base one,
> which I'm told is no longer possible due to versioning.

It would be possible if both used the same versioning.  Looks like
base on my desktop (10.3) is not using versioning, so if the version
map is provided by openssl we could in theory just use their version
map when building base openssl.  That is actually the far easier
problem to solve (using upstream-maintained version map vs trying to
maintain a local version map that has to be updated manually whenever
upstream changes).

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


svn commit: r303767 - in head: share/man/man9 sys/sys

2016-08-05 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Aug  5 13:53:28 2016
New Revision: 303767
URL: https://svnweb.freebsd.org/changeset/base/303767

Log:
  Remove lockmgr_waiters(9) and BUF_LOCKWAITERS(9); they were not used
  for anything.
  
  Reviewed by:  kib@
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D7420

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/lock.9
  head/sys/sys/buf.h
  head/sys/sys/lockmgr.h

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileFri Aug  5 09:08:00 2016
(r303766)
+++ head/share/man/man9/MakefileFri Aug  5 13:53:28 2016
(r303767)
@@ -1015,7 +1015,6 @@ MLINKS+=lock.9 lockdestroy.9 \
lock.9 lockmgr_printinfo.9 \
lock.9 lockmgr_recursed.9 \
lock.9 lockmgr_rw.9 \
-   lock.9 lockmgr_waiters.9 \
lock.9 lockstatus.9
 MLINKS+=LOCK_PROFILING.9 MUTEX_PROFILING.9
 MLINKS+=make_dev.9 destroy_dev.9 \

Modified: head/share/man/man9/lock.9
==
--- head/share/man/man9/lock.9  Fri Aug  5 09:08:00 2016(r303766)
+++ head/share/man/man9/lock.9  Fri Aug  5 13:53:28 2016(r303767)
@@ -39,7 +39,6 @@
 .Nm lockmgr_printinfo ,
 .Nm lockmgr_recursed ,
 .Nm lockmgr_rw ,
-.Nm lockmgr_waiters ,
 .Nm lockstatus ,
 .Nm lockmgr_assert
 .Nd "lockmgr family of functions"
@@ -66,8 +65,6 @@
 .Ft int
 .Fn lockmgr_rw "struct lock *lkp" "u_int flags" "struct rwlock *ilk"
 .Ft int
-.Fn lockmgr_waiters "const struct lock *lkp"
-.Ft int
 .Fn lockstatus "const struct lock *lkp"
 .Pp
 .Cd "options INVARIANTS"
@@ -279,10 +276,6 @@ function returns true if the lock is rec
 otherwise.
 .Pp
 The
-.Fn lockmgr_waiters
-function returns true if the lock has waiters, 0 otherwise.
-.Pp
-The
 .Fn lockstatus
 function returns the status of the lock in relation to the current thread.
 .Pp

Modified: head/sys/sys/buf.h
==
--- head/sys/sys/buf.h  Fri Aug  5 09:08:00 2016(r303766)
+++ head/sys/sys/buf.h  Fri Aug  5 13:53:28 2016(r303767)
@@ -355,12 +355,6 @@ extern const char *buf_wmesg;  /* Defaul
_lockmgr_disown(&(bp)->b_lock, LOCK_FILE, LOCK_LINE)
 #endif
 
-/*
- * Find out if the lock has waiters or not.
- */
-#defineBUF_LOCKWAITERS(bp) 
\
-   lockmgr_waiters(&(bp)->b_lock)
-
 #endif /* _KERNEL */
 
 struct buf_queue_head {

Modified: head/sys/sys/lockmgr.h
==
--- head/sys/sys/lockmgr.h  Fri Aug  5 09:08:00 2016(r303766)
+++ head/sys/sys/lockmgr.h  Fri Aug  5 13:53:28 2016(r303767)
@@ -127,8 +127,6 @@ _lockmgr_args_rw(struct lock *lk, u_int 
 #definelockmgr_rw(lk, flags, ilk)  
\
_lockmgr_args_rw((lk), (flags), (ilk), LK_WMESG_DEFAULT,\
LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, LOCK_FILE, LOCK_LINE)
-#definelockmgr_waiters(lk) 
\
-   ((lk)->lk_lock & LK_ALL_WAITERS)
 #ifdef INVARIANTS
 #definelockmgr_assert(lk, what)
\
_lockmgr_assert((lk), (what), LOCK_FILE, LOCK_LINE)
___
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: r303755 - head/sys/kern

2016-08-05 Thread Benjamin Kaduk
On Fri, Aug 5, 2016 at 8:06 AM, John Baldwin  wrote:

>
> It would be possible if both used the same versioning.  Looks like
> base on my desktop (10.3) is not using versioning, so if the version
> map is provided by openssl we could in theory just use their version
> map when building base openssl.  That is actually the far easier
> problem to solve (using upstream-maintained version map vs trying to
> maintain a local version map that has to be updated manually whenever
> upstream changes).
>

Upstream does not supply a version map for the 1.0.2 releases and older; it
will be new in 1.1.0 (due out in a few weeks, last we heard).

-Ben
___
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: r303771 - head/sys/dev/xen/netfront

2016-08-05 Thread Roger Pau Monné
Author: royger
Date: Fri Aug  5 15:48:56 2016
New Revision: 303771
URL: https://svnweb.freebsd.org/changeset/base/303771

Log:
  xen-netfront: improve the logic when handling nic features from ioctl
  
  Simplify the logic involved in changing the nic features on the fly, and
  only reset the frontend when really needed (when changing RX features). Also
  don't return from the ioctl until the interface has been properly
  reconfigured.
  
  While there, make sure XN_CSUM_FEATURES is used consistently.
  
  Reported by:  julian
  MFC after:5 days
  X-MFC-with:   r303488
  Sponsored by: Citrix Systems R&D

Modified:
  head/sys/dev/xen/netfront/netfront.c

Modified: head/sys/dev/xen/netfront/netfront.c
==
--- head/sys/dev/xen/netfront/netfront.cFri Aug  5 15:32:35 2016
(r303770)
+++ head/sys/dev/xen/netfront/netfront.cFri Aug  5 15:48:56 2016
(r303771)
@@ -1760,7 +1760,7 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, 
 #ifdef INET
struct ifaddr *ifa = (struct ifaddr *)data;
 #endif
-   int mask, error = 0;
+   int mask, error = 0, reinit;
 
dev = sc->xbdev;
 
@@ -1809,41 +1809,36 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, 
break;
case SIOCSIFCAP:
mask = ifr->ifr_reqcap ^ ifp->if_capenable;
+   reinit = 0;
+
if (mask & IFCAP_TXCSUM) {
-   if (IFCAP_TXCSUM & ifp->if_capenable) {
-   ifp->if_capenable &= ~(IFCAP_TXCSUM|IFCAP_TSO4);
-   ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP
-   | CSUM_IP | CSUM_TSO);
-   } else {
-   ifp->if_capenable |= IFCAP_TXCSUM;
-   ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP
-   | CSUM_IP);
-   }
-   }
-   if (mask & IFCAP_RXCSUM) {
-   ifp->if_capenable ^= IFCAP_RXCSUM;
+   ifp->if_capenable ^= IFCAP_TXCSUM;
+   ifp->if_hwassist ^= XN_CSUM_FEATURES;
}
if (mask & IFCAP_TSO4) {
-   if (IFCAP_TSO4 & ifp->if_capenable) {
-   ifp->if_capenable &= ~IFCAP_TSO4;
-   ifp->if_hwassist &= ~CSUM_TSO;
-   } else if (IFCAP_TXCSUM & ifp->if_capenable) {
-   ifp->if_capenable |= IFCAP_TSO4;
-   ifp->if_hwassist |= CSUM_TSO;
-   } else {
-   IPRINTK("Xen requires tx checksum offload"
-   " be enabled to use TSO\n");
-   error = EINVAL;
-   }
+   ifp->if_capenable ^= IFCAP_TSO4;
+   ifp->if_hwassist ^= CSUM_TSO;
}
-   if (mask & IFCAP_LRO) {
-   ifp->if_capenable ^= IFCAP_LRO;
 
+   if (mask & (IFCAP_RXCSUM | IFCAP_LRO)) {
+   /* These Rx features require us to renegotiate. */
+   reinit = 1;
+
+   if (mask & IFCAP_RXCSUM)
+   ifp->if_capenable ^= IFCAP_RXCSUM;
+   if (mask & IFCAP_LRO)
+   ifp->if_capenable ^= IFCAP_LRO;
}
+
+   if (reinit == 0)
+   break;
+
/*
 * We must reset the interface so the backend picks up the
 * new features.
 */
+   device_printf(sc->xbdev,
+   "performing interface reset due to feature change\n");
XN_LOCK(sc);
netfront_carrier_off(sc);
sc->xn_reset = true;
@@ -1865,6 +1860,13 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, 
xs_rm(XST_NIL, xenbus_get_node(dev), "feature-gso-tcpv4");
xs_rm(XST_NIL, xenbus_get_node(dev), "feature-no-csum-offload");
xenbus_set_state(dev, XenbusStateClosing);
+
+   /*
+* Wait for the frontend to reconnect before returning
+* from the ioctl. 30s should be more than enough for any
+* sane backend to reconnect.
+*/
+   error = tsleep(sc, 0, "xn_rst", 30*hz);
break;
case SIOCADDMULTI:
case SIOCDELMULTI:
@@ -1971,6 +1973,7 @@ xn_connect(struct netfront_info *np)
 * packets.
 */
netfront_carrier_on(np);
+   wakeup(np);
 
return (0);
 }
@@ -2085,7 +2088,7 @@ xn_configure_features(struct netfront_in
 #endif
if ((ifp->if_capabilities & cap_enabled & IFCAP_TXCSUM) != 0) {
ifp->if_capenable |= IFCAP_TXCSUM;

Re: svn commit: r303763 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys

2016-08-05 Thread Glen Barber
On Fri, Aug 05, 2016 at 06:23:06AM +, Andriy Gapon wrote:
> Author: avg
> Date: Fri Aug  5 06:23:06 2016
> New Revision: 303763
> URL: https://svnweb.freebsd.org/changeset/base/303763
> 
> Log:
>   zfs: honour and make use of vfs vnode locking protocol
>   
>   ZFS POSIX Layer is originally written for Solaris VFS which is very
>   different from FreeBSD VFS.  Most importantly many things that FreeBSD VFS
>   manages on behalf of all filesystems are implemented in ZPL in a different
>   way.
>   Thus, ZPL contains code that is redundant on FreeBSD or duplicates VFS
>   functionality or, in the worst cases, badly interacts / interferes
>   with VFS.
>   
>   The most prominent problem is a deadlock caused by the lock order reversal
>   of vnode locks that may happen with concurrent zfs_rename() and lookup().
>   The deadlock is a result of zfs_rename() not observing the vnode locking
>   contract expected by VFS.
>   
>   This commit removes all ZPL internal locking that protects parent-child
>   relationships of filesystem nodes.  These relationships are protected
>   by vnode locks and the code is changed to take advantage of that fact
>   and to properly interact with VFS.
>   
>   Removal of the internal locking allowed all ZPL dmu_tx_assign calls to
>   use TXG_WAIT mode.
>   
>   Another victim, disputable perhaps, is ZFS support for filesystems with
>   mixed case sensitivity.  That support is not provided by the OS anyway,
>   so in ZFS it was a buch of dead code.
>   
>   To do:
>   - replace ZFS_ENTER mechanism with VFS managed / visible mechanism
>   - replace zfs_zget with zfs_vget[f] as much as possible
>   - get rid of not really useful now zfs_freebsd_* adapters
>   - more cleanups of unneeded / unused code
>   - fix / replace .zfs support
>   
>   PR: 209158
>   Reported by:many
>   Tested by:  many (thank you all!)
>   MFC after:  5 days
>   Sponsored by:   HybridCluster / ClusterHQ
>   Differential Revision: https://reviews.freebsd.org/D6533
> 

Thank you very much for working on this.

Glen



signature.asc
Description: PGP signature


Re: svn commit: r303763 - in head/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys

2016-08-05 Thread Bryan Drewery
On 8/5/2016 8:53 AM, Glen Barber wrote:
> On Fri, Aug 05, 2016 at 06:23:06AM +, Andriy Gapon wrote:
>> Author: avg
>> Date: Fri Aug  5 06:23:06 2016
>> New Revision: 303763
>> URL: https://svnweb.freebsd.org/changeset/base/303763
>>
>> Log:
>>   zfs: honour and make use of vfs vnode locking protocol
>>   
>>   ZFS POSIX Layer is originally written for Solaris VFS which is very
>>   different from FreeBSD VFS.  Most importantly many things that FreeBSD VFS
>>   manages on behalf of all filesystems are implemented in ZPL in a different
>>   way.
>>   Thus, ZPL contains code that is redundant on FreeBSD or duplicates VFS
>>   functionality or, in the worst cases, badly interacts / interferes
>>   with VFS.
>>   
>>   The most prominent problem is a deadlock caused by the lock order reversal
>>   of vnode locks that may happen with concurrent zfs_rename() and lookup().
>>   The deadlock is a result of zfs_rename() not observing the vnode locking
>>   contract expected by VFS.
>>   
>>   This commit removes all ZPL internal locking that protects parent-child
>>   relationships of filesystem nodes.  These relationships are protected
>>   by vnode locks and the code is changed to take advantage of that fact
>>   and to properly interact with VFS.
>>   
>>   Removal of the internal locking allowed all ZPL dmu_tx_assign calls to
>>   use TXG_WAIT mode.
>>   
>>   Another victim, disputable perhaps, is ZFS support for filesystems with
>>   mixed case sensitivity.  That support is not provided by the OS anyway,
>>   so in ZFS it was a buch of dead code.
>>   
>>   To do:
>>   - replace ZFS_ENTER mechanism with VFS managed / visible mechanism
>>   - replace zfs_zget with zfs_vget[f] as much as possible
>>   - get rid of not really useful now zfs_freebsd_* adapters
>>   - more cleanups of unneeded / unused code
>>   - fix / replace .zfs support
>>   
>>   PR:209158
>>   Reported by:   many
>>   Tested by: many (thank you all!)
>>   MFC after: 5 days
>>   Sponsored by:  HybridCluster / ClusterHQ
>>   Differential Revision: https://reviews.freebsd.org/D6533
>>
> 
> Thank you very much for working on this.
> 

Yes agreed. It scares me, but releasing with trivial deadlocks that we
cannot EN due to that risk scares me more.  FreeBSD's ZFS is a huge
selling point for it and we want to maintain that.


-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r303773 - head/sys/vm

2016-08-05 Thread Alan Cox
Author: alc
Date: Fri Aug  5 16:44:11 2016
New Revision: 303773
URL: https://svnweb.freebsd.org/changeset/base/303773

Log:
  Correct a spelling error.

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cFri Aug  5 16:32:09 2016(r303772)
+++ head/sys/vm/vm_pageout.cFri Aug  5 16:44:11 2016(r303773)
@@ -247,7 +247,7 @@ static boolean_t vm_pageout_page_lock(vm
 /*
  * Initialize a dummy page for marking the caller's place in the specified
  * paging queue.  In principle, this function only needs to set the flag
- * PG_MARKER.  Nonetheless, it wirte busies and initializes the hold count
+ * PG_MARKER.  Nonetheless, it write busies and initializes the hold count
  * to one as safety precautions.
  */ 
 static void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r303778 - head/sys/mips/atheros

2016-08-05 Thread Adrian Chadd
Author: adrian
Date: Fri Aug  5 17:16:35 2016
New Revision: 303778
URL: https://svnweb.freebsd.org/changeset/base/303778

Log:
  [arge] add some extra MDIO debugging support
  
  * add an ANY debug level which will always echo the message if debugging
is compiled in;
  * log MDIO transaction timeouts if debugging is compiled in;
  * the argemdio device is different to arge, so turning on MDIO debugging
flags in arge->sc_debug doesn't help.  Add a debug sysctl to argemdio
as well so that MDIO transactions can be debugged.
  
  Tested:
  
  * AR9331

Modified:
  head/sys/mips/atheros/if_arge.c

Modified: head/sys/mips/atheros/if_arge.c
==
--- head/sys/mips/atheros/if_arge.c Fri Aug  5 17:14:45 2016
(r303777)
+++ head/sys/mips/atheros/if_arge.c Fri Aug  5 17:16:35 2016
(r303778)
@@ -108,6 +108,7 @@ typedef enum {
ARGE_DBG_ERR=   0x0010,
ARGE_DBG_RESET  =   0x0020,
ARGE_DBG_PLL=   0x0040,
+   ARGE_DBG_ANY=   0x,
 } arge_debug_flags;
 
 static const char * arge_miicfg_str[] = {
@@ -122,7 +123,7 @@ static const char * arge_miicfg_str[] = 
 #ifdef ARGE_DEBUG
 #defineARGEDEBUG(_sc, _m, ...) 
\
do {\
-   if ((_m) & (_sc)->arge_debug)   \
+   if (((_m) & (_sc)->arge_debug) || ((_m) == ARGE_DBG_ANY)) \
device_printf((_sc)->arge_dev, __VA_ARGS__);\
} while (0)
 #else
@@ -1123,7 +1124,7 @@ arge_miibus_readreg(device_t dev, int ph
 
if (arge_mdio_busy(sc) != 0) {
mtx_unlock(&miibus_mtx);
-   ARGEDEBUG(sc, ARGE_DBG_MII, "%s timedout\n", __func__);
+   ARGEDEBUG(sc, ARGE_DBG_ANY, "%s timedout\n", __func__);
/* XXX: return ERRNO istead? */
return (-1);
}
@@ -1160,7 +1161,7 @@ arge_miibus_writereg(device_t dev, int p
 
if (arge_mdio_busy(sc) != 0) {
mtx_unlock(&miibus_mtx);
-   ARGEDEBUG(sc, ARGE_DBG_MII, "%s timedout\n", __func__);
+   ARGEDEBUG(sc, ARGE_DBG_ANY, "%s timedout\n", __func__);
/* XXX: return ERRNO istead? */
return (-1);
}
@@ -2690,7 +2691,10 @@ argemdio_attach(device_t dev)
 {
struct arge_softc   *sc;
int error = 0;
-
+#ifdef ARGE_DEBUG
+   struct sysctl_ctx_list *ctx;
+   struct sysctl_oid *tree;
+#endif
sc = device_get_softc(dev);
sc->arge_dev = dev;
sc->arge_mac_unit = device_get_unit(dev);
@@ -2703,6 +2707,14 @@ argemdio_attach(device_t dev)
goto fail;
}
 
+#ifdef ARGE_DEBUG
+   ctx = device_get_sysctl_ctx(dev);
+   tree = device_get_sysctl_tree(dev);
+   SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
+   "debug", CTLFLAG_RW, &sc->arge_debug, 0,
+   "argemdio interface debugging flags");
+#endif
+
/* Reset MAC - required for AR71xx MDIO to successfully occur */
arge_reset_mac(sc);
/* Reset MII bus */
___
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: r303779 - head/sys/mips/conf

2016-08-05 Thread Adrian Chadd
Author: adrian
Date: Fri Aug  5 17:17:36 2016
New Revision: 303779
URL: https://svnweb.freebsd.org/changeset/base/303779

Log:
  [ar934x] add tap/tun as modules, for people who wish to use VPNs.

Modified:
  head/sys/mips/conf/std.AR934X

Modified: head/sys/mips/conf/std.AR934X
==
--- head/sys/mips/conf/std.AR934X   Fri Aug  5 17:16:35 2016
(r303778)
+++ head/sys/mips/conf/std.AR934X   Fri Aug  5 17:17:36 2016
(r303779)
@@ -20,7 +20,7 @@ files "../atheros/files.ar71xx"
 hints  "AR934X_BASE.hints"
 
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
-makeoptionsMODULES_OVERRIDE="gpio ar71xx if_gif if_gre if_vlan if_bridge 
bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip wlan_ccmp 
wlan_rssadapt wlan_amrr ath ath_ahb hwpmc ipfw ipfw_nat libalias urtwn urtwnfw 
otus otusfw"
+makeoptionsMODULES_OVERRIDE="gpio ar71xx if_gif if_vlan if_gre if_tap 
if_tun if_bridge bridgestp usb wlan wlan_xauth wlan_acl wlan_wep wlan_tkip 
wlan_ccmp wlan_rssadapt wlan_amrr hwpmc ipfw ipfw_nat libalias ipfw_nptv6 urtwn 
urtwnfw otus otusfw"
 # makeoptions  MODULES_OVERRIDE=""
 
 optionsDDB
___
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: r303782 - head/release

2016-08-05 Thread Glen Barber
Author: gjb
Date: Fri Aug  5 19:00:45 2016
New Revision: 303782
URL: https://svnweb.freebsd.org/changeset/base/303782

Log:
  Fix GCE image publication.  The gcutil utility is deprecated in favor
  of gcloud.
  
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/Makefile.gce

Modified: head/release/Makefile.gce
==
--- head/release/Makefile.gce   Fri Aug  5 18:41:51 2016(r303781)
+++ head/release/Makefile.gce   Fri Aug  5 19:00:45 2016(r303782)
@@ -35,7 +35,7 @@ gce-check-depends:
@false
 . endif
 .endfor
-.if !exists(/usr/local/bin/gcutil)
+.if !exists(/usr/local/bin/gcloud)
 . if !exists(${PORTSDIR}/net/google-cloud-sdk/Makefile)
 .  if !exists(/usr/local/sbin/pkg-static)
env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf
@@ -63,7 +63,7 @@ gce-do-upload:
/usr/local/bin/gsutil mb gs://${GCE_BUCKET} || true
/usr/local/bin/gsutil cp ${.OBJDIR}/${GCE_TARGET}.tar.gz \
gs://${GCE_BUCKET}/
-   /usr/local/bin/gcutil addimage ${GCE_TARGET} \
-   gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz
+   /usr/local/bin/gcloud compute images create ${GCE_TARGET} \
+   --source-uri gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz
touch ${.OBJDIR}/${.TARGET}
 
___
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: r303783 - head/usr.bin/sdiff

2016-08-05 Thread Baptiste Daroussin
Author: bapt
Date: Fri Aug  5 19:14:55 2016
New Revision: 303783
URL: https://svnweb.freebsd.org/changeset/base/303783

Log:
  sdiff: remove non finish/function code
  
  2 extra options not available neither on other BSD nor in GNU sdiff:
  --diff-pid and --pipe-fd were present in the SoC code, none were usable
  
  Just remove it

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

Modified: head/usr.bin/sdiff/sdiff.c
==
--- head/usr.bin/sdiff/sdiff.c  Fri Aug  5 19:00:45 2016(r303782)
+++ head/usr.bin/sdiff/sdiff.c  Fri Aug  5 19:14:55 2016(r303783)
@@ -104,9 +104,6 @@ enum {
HLINES_OPT,
LFILES_OPT,
DIFFPROG_OPT,
-   PIPE_FD,
-   /* pid from the diff parent (if applicable) */
-   DIFF_PID,
 
NOOP_OPT,
 };
@@ -120,8 +117,6 @@ static struct option longopts[] = {
{ "output", required_argument,  NULL,   'o' },
{ "diff-program",   required_argument,  NULL,   
DIFFPROG_OPT },
 
-   { "pipe-fd",required_argument,  NULL,   PIPE_FD 
},
-   { "diff-pid",   required_argument,  NULL,   
DIFF_PID },
/* Options processed by diff. */
{ "ignore-file-name-case",  no_argument,NULL,   
FCASE_IGNORE_OPT },
{ "no-ignore-file-name-case",   no_argument,NULL,   
FCASE_SENSITIVE_OPT },
@@ -236,7 +231,7 @@ main(int argc, char **argv)
FILE *diffpipe=NULL, *file1, *file2;
size_t diffargc = 0, wflag = WIDTH;
int ch, fd[2] = {-1}, status;
-   pid_t pid=0; pid_t ppid =-1;
+   pid_t pid=0;
const char *outfile = NULL;
struct option *popt;
char **diffargv, *diffprog = DIFF_PATH, *filename1, *filename2,
@@ -319,11 +314,6 @@ main(int argc, char **argv)
if (errstr)
errx(2, "width is %s: %s", errstr, optarg);
break;
-   case DIFF_PID:
-   ppid = strtonum(optarg, 0, INT_MAX, &errstr);
-   if (errstr)
-   errx(2, "diff pid value is %s: %s", errstr, 
optarg);
-   break;
case HELP_OPT:
for (i = 0; help_msg[i] != NULL; i++)
printf("%s\n", help_msg[i]);
@@ -392,35 +382,34 @@ main(int argc, char **argv)
errx(2, "width is too large: %zu", width);
line_width = width * 2 + 3;
 
-   if (ppid == -1 ) {
-   if (pipe(fd))
-   err(2, "pipe");
-
-   switch (pid = fork()) {
-   case 0:
-   /* child */
-   /* We don't read from the pipe. */
-   close(fd[0]);
-   if (dup2(fd[1], STDOUT_FILENO) == -1)
-   err(2, "child could not duplicate descriptor");
-   /* Free unused descriptor. */
-   close(fd[1]);
-   execvp(diffprog, diffargv);
-   err(2, "could not execute diff: %s", diffprog);
-   break;
-   case -1:
-   err(2, "could not fork");
-   break;
-   }
+   if (pipe(fd))
+   err(2, "pipe");
 
-   /* parent */
-   /* We don't write to the pipe. */
+   switch (pid = fork()) {
+   case 0:
+   /* child */
+   /* We don't read from the pipe. */
+   close(fd[0]);
+   if (dup2(fd[1], STDOUT_FILENO) == -1)
+   err(2, "child could not duplicate descriptor");
+   /* Free unused descriptor. */
close(fd[1]);
-
-   /* Open pipe to diff command. */
-   if ((diffpipe = fdopen(fd[0], "r")) == NULL)
-   err(2, "could not open diff pipe");
+   execvp(diffprog, diffargv);
+   err(2, "could not execute diff: %s", diffprog);
+   break;
+   case -1:
+   err(2, "could not fork");
+   break;
}
+
+   /* parent */
+   /* We don't write to the pipe. */
+   close(fd[1]);
+
+   /* Open pipe to diff command. */
+   if ((diffpipe = fdopen(fd[0], "r")) == NULL)
+   err(2, "could not open diff pipe");
+
if ((file1 = fopen(filename1, "r")) == NULL)
err(2, "could not open %s", filename1);
if ((file2 = fopen(filename2, "r")) == NULL)
___
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: r303784 - head/usr.sbin/etcupdate

2016-08-05 Thread Baptiste Daroussin
Author: bapt
Date: Fri Aug  5 19:22:33 2016
New Revision: 303784
URL: https://svnweb.freebsd.org/changeset/base/303784

Log:
  etcupdate: directly use diff3(1) instead of merge(1)
  
  During the last attempt to rmeove GNU rcs, 2 blockers were spotted:
  We need an ident(1) and etcupdate(8) uses merge(1).
  
  Now nothing should prevent to remove rcs from base
  
  Reviewed by:  jhb
  Differential Revision:https://reviews.freebsd.org/D7401

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

Modified: head/usr.sbin/etcupdate/etcupdate.sh
==
--- head/usr.sbin/etcupdate/etcupdate.shFri Aug  5 19:14:55 2016
(r303783)
+++ head/usr.sbin/etcupdate/etcupdate.shFri Aug  5 19:22:33 2016
(r303784)
@@ -814,15 +814,17 @@ merge_file()
local res
 
# Try the merge to see if there is a conflict.
-   merge -q -p ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1 >/dev/null 2>&3
+   diff3 -E -m ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1 > /dev/null 2>&3
res=$?
case $res in
0)
# No conflicts, so just redo the merge to the
# real file.
-   log "merge ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1"
+   log "diff3 -E -m ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1"
if [ -z "$dryrun" ]; then
-   merge ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1
+   temp=$(mktemp -t etcupdate)
+   diff3 -E -m ${DESTDIR}$1 ${OLDTREE}$1 
${NEWTREE}$1 > ${temp}
+   mv -f ${temp} ${DESTDIR}$1
fi
post_install_file $1
echo "  M $1"
@@ -832,10 +834,10 @@ merge_file()
# the conflicts directory.
if [ -z "$dryrun" ]; then
install_dirs $NEWTREE $CONFLICTS $1
-   log "cp -Rp ${DESTDIR}$1 ${CONFLICTS}$1"
-   cp -Rp ${DESTDIR}$1 ${CONFLICTS}$1 >&3 2>&1
-   merge -A -q -L "yours" -L "original" -L "new" \
-   ${CONFLICTS}$1 ${OLDTREE}$1 ${NEWTREE}$1
+   log "diff3 -m -A ${DESTDIR}$1 ${CONFLICTS}$1"
+   diff3 -m -A -L "yours" -L "original" -L "new" \
+   ${DESTDIR}$1 ${OLDTREE}$1 ${NEWTREE}$1 > \
+   ${CONFLICTS}$1
fi
echo "  C $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: r303785 - in head: tools/build/mk usr.sbin

2016-08-05 Thread Baptiste Daroussin
Author: bapt
Date: Fri Aug  5 19:24:52 2016
New Revision: 303785
URL: https://svnweb.freebsd.org/changeset/base/303785

Log:
  always install etcupdate
  
  Now that etcupdate does not depend on rcs anymore there is no need to
  conditionnally install it

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc
  head/usr.sbin/Makefile

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Aug  5 19:22:33 
2016(r303784)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Aug  5 19:24:52 
2016(r303785)
@@ -6800,7 +6800,6 @@ OLD_FILES+=usr/bin/rcsdiff
 OLD_FILES+=usr/bin/rcsfreeze
 OLD_FILES+=usr/bin/rcsmerge
 OLD_FILES+=usr/bin/rlog
-OLD_FILES+=usr/sbin/etcupdate
 OLD_FILES+=usr/share/man/man1/ci.1.gz
 OLD_FILES+=usr/share/man/man1/co.1.gz
 OLD_FILES+=usr/share/man/man1/merge.1.gz
@@ -6812,16 +6811,6 @@ OLD_FILES+=usr/share/man/man1/rcsintro.1
 OLD_FILES+=usr/share/man/man1/rcsmerge.1.gz
 OLD_FILES+=usr/share/man/man1/rlog.1.gz
 OLD_FILES+=usr/share/man/man5/rcsfile.5.gz
-OLD_FILES+=usr/share/man/man8/etcupdate.8.gz
-OLD_FILES+=usr/tests/usr.sbin/etcupdate/Kyuafile
-OLD_FILES+=usr/tests/usr.sbin/etcupdate/always_test
-OLD_FILES+=usr/tests/usr.sbin/etcupdate/conflicts_test
-OLD_FILES+=usr/tests/usr.sbin/etcupdate/fbsdid_test
-OLD_FILES+=usr/tests/usr.sbin/etcupdate/ignore_test
-OLD_FILES+=usr/tests/usr.sbin/etcupdate/preworld_test
-OLD_FILES+=usr/tests/usr.sbin/etcupdate/tests_test
-OLD_FILES+=usr/tests/usr.sbin/etcupdate/tzsetup_test
-OLD_DIRS+=usr/tests/usr.sbin/etcupdate
 .endif
 
 #.if ${MK_RESCUE} == no

Modified: head/usr.sbin/Makefile
==
--- head/usr.sbin/Makefile  Fri Aug  5 19:22:33 2016(r303784)
+++ head/usr.sbin/Makefile  Fri Aug  5 19:24:52 2016(r303785)
@@ -25,6 +25,7 @@ SUBDIR=   adduser \
digictl \
diskinfo \
dumpcis \
+   etcupdate \
extattr \
extattrctl \
fifolog \
@@ -188,7 +189,6 @@ SUBDIR.${MK_QUOTAS}+=   edquota
 SUBDIR.${MK_QUOTAS}+=  quotaon
 SUBDIR.${MK_QUOTAS}+=  repquota
 SUBDIR.${MK_RCMDS}+=   rwhod
-SUBDIR.${MK_RCS}+= etcupdate
 SUBDIR.${MK_SENDMAIL}+=editmap
 SUBDIR.${MK_SENDMAIL}+=mailstats
 SUBDIR.${MK_SENDMAIL}+=makemap
___
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: r303784 - head/usr.sbin/etcupdate

2016-08-05 Thread John Baldwin
On Friday, August 05, 2016 07:22:33 PM Baptiste Daroussin wrote:
> Author: bapt
> Date: Fri Aug  5 19:22:33 2016
> New Revision: 303784
> URL: https://svnweb.freebsd.org/changeset/base/303784
> 
> Log:
>   etcupdate: directly use diff3(1) instead of merge(1)
>   
>   During the last attempt to rmeove GNU rcs, 2 blockers were spotted:
>   We need an ident(1) and etcupdate(8) uses merge(1).
>   
>   Now nothing should prevent to remove rcs from base
>   
>   Reviewed by:jhb
>   Differential Revision:  https://reviews.freebsd.org/D7401

Thanks for cleaning this up!

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


svn commit: r303786 - head/sys/ofed/drivers/infiniband/hw/mthca

2016-08-05 Thread Mark Johnston
Author: markj
Date: Fri Aug  5 21:34:09 2016
New Revision: 303786
URL: https://svnweb.freebsd.org/changeset/base/303786

Log:
  mthca: Add a wrapper for the firmware's DIAG_RPRT command.
  
  MFC after:1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c
  head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.h

Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c
==
--- head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c   Fri Aug  5 
19:24:52 2016(r303785)
+++ head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c   Fri Aug  5 
21:34:09 2016(r303786)
@@ -1927,6 +1927,13 @@ int mthca_MGID_HASH(struct mthca_dev *de
return err;
 }
 
+int mthca_DIAG_RPRT(struct mthca_dev *dev, int mod,
+   struct mthca_mailbox *mailbox, u8 *status)
+{
+   return mthca_cmd_box(dev, 0, mailbox->dma, 0, mod, CMD_DIAG_RPRT,
+CMD_TIME_CLASS_A, status);
+}
+
 int mthca_NOP(struct mthca_dev *dev, u8 *status)
 {
return mthca_cmd(dev, 0, 0x1f, 0, CMD_NOP, msecs_to_jiffies(100), 
status);

Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.h
==
--- head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.h   Fri Aug  5 
19:24:52 2016(r303785)
+++ head/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.h   Fri Aug  5 
21:34:09 2016(r303786)
@@ -112,6 +112,15 @@ enum {
DEV_LIM_FLAG_UD_MULTI   = 1 << 21,
 };
 
+enum {
+   DIAG_RPRT_Q_XPRT_CIERR = 2,
+   DIAG_RPRT_QR_XPRT_CIERR = 3,
+   DIAG_RPRT_Q_PERF = 4,
+   DIAG_RPRT_QR_PERF = 5,
+   DIAG_RPRT_Q_MISC = 6,
+   DIAG_RPRT_QR_MISC = 7,
+};
+
 struct mthca_mailbox {
dma_addr_t dma;
void  *buf;
@@ -325,6 +334,8 @@ int mthca_WRITE_MGM(struct mthca_dev *de
struct mthca_mailbox *mailbox, u8 *status);
 int mthca_MGID_HASH(struct mthca_dev *dev, struct mthca_mailbox *mailbox,
u16 *hash, u8 *status);
+int mthca_DIAG_RPRT(struct mthca_dev *dev, int mod,
+   struct mthca_mailbox *mailbox, u8 *status);
 int mthca_NOP(struct mthca_dev *dev, u8 *status);
 
 #endif /* MTHCA_CMD_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: r303788 - in head: sys/dev/pci usr.sbin/pciconf

2016-08-05 Thread Eric van Gyzen
Author: vangyzen
Date: Fri Aug  5 23:23:48 2016
New Revision: 303788
URL: https://svnweb.freebsd.org/changeset/base/303788

Log:
  Fix some logic in PCIe HotPlug; display EI status
  
  The interpretation of the Electromechanical Interlock Status was
  inverted, so we disengaged the EI if a card was inserted.
  Fix it to engage the EI if a card is inserted.
  
  When displaying the slot capabilites/status with pciconf:
  
  - We inverted the sense of the Power Controller Control bit,
saying the power was off when it was really on (according to
this bit).  Fix that.
  
  - Display the status of the Electromechanical Interlock:
  EI(engaged)
  EI(disengaged)
  
  Reviewed by:  jhb
  MFC after:3 days
  Sponsored by: Dell Inc.
  Differential Revision:https://reviews.freebsd.org/D7426

Modified:
  head/sys/dev/pci/pci_pci.c
  head/usr.sbin/pciconf/cap.c

Modified: head/sys/dev/pci/pci_pci.c
==
--- head/sys/dev/pci/pci_pci.c  Fri Aug  5 22:23:04 2016(r303787)
+++ head/sys/dev/pci/pci_pci.c  Fri Aug  5 23:23:48 2016(r303788)
@@ -1057,7 +1057,7 @@ static void
 pcib_pcie_hotplug_update(struct pcib_softc *sc, uint16_t val, uint16_t mask,
 bool schedule_task)
 {
-   bool card_inserted;
+   bool card_inserted, ei_engaged;
 
/* Clear DETACHING if Present Detect has cleared. */
if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) ==
@@ -1094,8 +1094,8 @@ pcib_pcie_hotplug_update(struct pcib_sof
 */
if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_EIP) {
mask |= PCIEM_SLOT_CTL_EIC;
-   if (card_inserted !=
-   !(sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS))
+   ei_engaged = (sc->pcie_slot_sta & PCIEM_SLOT_STA_EIS) != 0;
+   if (card_inserted != ei_engaged)
val |= PCIEM_SLOT_CTL_EIC;
}
 
@@ -1122,7 +1122,7 @@ pcib_pcie_hotplug_update(struct pcib_sof
pcib_pcie_hotplug_command(sc, val, mask);
 
/*
-* During attach the child "pci" device is added sychronously;
+* During attach the child "pci" device is added synchronously;
 * otherwise, the task is scheduled to manage the child
 * device.
 */

Modified: head/usr.sbin/pciconf/cap.c
==
--- head/usr.sbin/pciconf/cap.c Fri Aug  5 22:23:04 2016(r303787)
+++ head/usr.sbin/pciconf/cap.c Fri Aug  5 23:23:48 2016(r303788)
@@ -529,10 +529,13 @@ cap_express(int fd, struct pci_conf *p, 
if (cap & PCIEM_SLOT_CAP_APB)
printf(" Attn Button");
if (cap & PCIEM_SLOT_CAP_PCP)
-   printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "on" : "off");
+   printf(" PC(%s)", ctl & PCIEM_SLOT_CTL_PCC ? "off" : "on");
if (cap & PCIEM_SLOT_CAP_MRLSP)
printf(" MRL(%s)", sta & PCIEM_SLOT_STA_MRLSS ? "open" :
"closed");
+   if (cap & PCIEM_SLOT_CAP_EIP)
+   printf(" EI(%s)", sta & PCIEM_SLOT_STA_EIS ? "engaged" :
+   "disengaged");
 }
 
 static void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r300383 - head/sys/net80211

2016-08-05 Thread Adrian Chadd
Hi,

Just a reminder and notice to others - yeah, I've found that this
actually stops scan from working well and reliably.

Notably, I've found that we get a scan completion notification and
then we can't restart a subsequent scan for some reason.

I may have to revert this and put in something slightly more explicit
- eg, we put on an explicit full scan timeout and we explicitly
complete the scan if we don't finish it in time.


-adrian


On 21 May 2016 at 16:24, Andriy Voskoboinyk  wrote:
> Tested with wpi(4) and urtwn(4) in STA 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"


Re: svn commit: r300383 - head/sys/net80211

2016-08-05 Thread Adrian Chadd
Also, the scan code now also seems to alternate between g and n
channels on 2ghz; and it never seems to update the chanlist if it's
interrupted.

So yeah, hm. Avos, any ideas?



-adrian


On 5 August 2016 at 16:42, Adrian Chadd  wrote:
> Hi,
>
> Just a reminder and notice to others - yeah, I've found that this
> actually stops scan from working well and reliably.
>
> Notably, I've found that we get a scan completion notification and
> then we can't restart a subsequent scan for some reason.
>
> I may have to revert this and put in something slightly more explicit
> - eg, we put on an explicit full scan timeout and we explicitly
> complete the scan if we don't finish it in time.
>
>
> -adrian
>
>
> On 21 May 2016 at 16:24, Andriy Voskoboinyk  wrote:
>> Tested with wpi(4) and urtwn(4) in STA 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"