r318525 wma May 19, 2017, 8:25 a.m.
Before the fix for single interrupt, both percpu and non-percpu routes
were enabled/disable at the same time.

Submitted by:  Marcin Wojtas <mw@semihalf.com
Obtained from: Semihalf
Sponsored by:  Stormshield, Netgate
Reviewed by:   loos
Differential revision: https://reviews.freebsd.org/D10716
r318524 wma May 19, 2017, 8:24 a.m.
e6000sw family automatically reflects PHY status in each port's registers.
Therefore it is not necessary to do a full PHY polling squence, which
results in much quicker operation and much less significant usage of
the SMI bus.

Care must be taken that the resulting ifmedia_active is identical to
what the PHY will compute, or gratuitous link status changes will
occur whenever the PHYs update function is called.

This patch implements above improvement. On the occasion set a pointer to
the proc structure to be part of software context instead of being
a global variable.

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10714
r318523 royger May 19, 2017, 8:19 a.m.
Make sure the RX ring lock is only released when the state of the ring is
consistent, or else concurrent calls to xn_rxeof might get an inconsistent ring
state and thus some packets might be processed twice.

Note that this is not very common, and could only happen when an interrupt is
delivered while in xn_ifinit.

Reported by:	cperciva
Tested by:	cperciva
MFC after:	1 week
Sponsored by:	Citrix Systems R&D
r318522 wma May 19, 2017, 8:19 a.m.
For all Marvell devices, MBUS windows configuration is done
in a common place. Only CESA was an exception, so move its
related code from driver to mv_common.c. This way it uses
same proper DRAM information, same as  all other interfaces
instead of parsing DT /memory node directly.

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10723
r318521 wma May 19, 2017, 8:16 a.m.
Hitherto implementation of PHY polling resulted in a risk of an
endless loop and very high occupation of the SMI bus. Improve the
operation by limiting the polling tries and adding sleepable

Submitted by: Marcin Wojtas <mw@semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Reviewed by: loos
Differential revision: https://reviews.freebsd.org/D10713
r318520 royger May 19, 2017, 8:11 a.m.
Call disk_gone when the backend switches to the "Closing" state and blkfront
still has pending users. This allows the disk to be detached, and will call
into xbd_closing by itself when the geom layout cleanup has finished.

Reported by:		bapt
Tested by:		manu
Reviewed by:		bapt
Sponsored by:		Citrix Systems R&D
MFC after:		1 week
Differential revision:	https://reviews.freebsd.org/D10772
r318517 delphij May 19, 2017, 6:37 a.m.
(Note that MIN macro is removed in favor of sys/param.h's version).

PR:		213922
r318516 mav May 19, 2017, 5:12 a.m.
pthread_cond_timedwait() receives absolute time, not relative.  Passing
wrong time there caused two threads of zdb to spin in a tight loop.

MFC after:	1 week
r318515 delphij May 19, 2017, 4:59 a.m.
always perform recursion on the left partition, then use a tail call to
handle the right partition.  In the worst case this could require O(N)
levels of recursions.

Reduce the possible recursion level to log2(N) by always recursing on the
smaller partition instead.

Obtained from:	PostgreSQL 9d6077abf9d6efd992a59f05ef5aba981ea32096
r318514 delphij May 19, 2017, 4:44 a.m.
Inspired by:	OpenBSD src/lib/libc/stdlib/qsort.c,v 1.11
r318512 sephe May 19, 2017, 1:42 a.m.
Miss read the parentheses.

Reported by:	oleg@
Reviewed by:	hps@
MFC after:	3 days
Sponsored by:	Microsoft
r318511 truckman May 19, 2017, 1:23 a.m.
defined.  On machines without arithmetic shift instructions, zero bits
may be shifted in from the left, giving a large positive result instead
of the desired divide-by power-of-2.  Fix this by operating on the
absolute value and compensating for the possible negation later.

Reverse the order of the underflow/overflow tests and the exponential
decay calculation to avoid the possibility of an erroneous overflow
detection if p is a sufficiently small non-negative value.  Also
check for negative values of prob before doing the exponential decay
to avoid another instance of of right shifting a negative value.

Tested by:	Rasool Al-Saadi <ralsaadi@swin.edu.au>
MFC after:	1 week
r318508 markj May 19, 2017, 12:25 a.m.
Reported by:	bdrewery
Sponsored by:	Dell EMC Isilon
r318502 jilles May 18, 2017, 10:10 p.m.
Allocating and deallocating repeatedly the 1024-byte buffer for stdout from
builtins costs CPU time for little or no benefit.

A simple loop containing builtins that write to a file descriptor, such as
  i=0; while [ "$i" -lt 1000000 ]; do printf .; i=$((i+1)); done >/dev/null
is over 10% faster in a simple benchmark on an amd64 virtual machine.
r318501 jilles May 18, 2017, 9:44 p.m.