Commit Graph

219443 Commits

Author SHA1 Message Date
Andrew Rybchenko
542c719c02 sfxge(4): do not ignore requested MAC stats update period
Firmware version which takes PERIOD_MS parameter into account is
required.

Reviewed by:    philip
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9129
2017-01-12 06:29:14 +00:00
Scott Long
94e4e732af Print out the number of queues/MSIx vectors.
Sponsored by:	Netflix
2017-01-12 01:13:05 +00:00
Ian Lepore
f64342e354 Rework tty_drain() to poll the hardware for completion, and restore
drain timeout handling to historical freebsd behavior.

The primary reason for these changes is the need to have tty_drain() call
ttydevsw_busy() at some reasonable sub-second rate, to poll hardware that
doesn't signal an interrupt when the transmit shift register becomes empty
(which includes virtually all USB serial hardware).  Such hardware hangs
in a ttyout wait, because it never gets an opportunity to trigger a wakeup
from the sleep in tty_drain() by calling ttydisc_getc() again, after
handing the last of the buffered data to the hardware.

While researching the history of changes to tty_drain() I stumbled across
some email describing the historical BSD behavior of tcdrain() and close()
on serial ports, and the ability of comcontrol(1) to control timeout
behavior.  Using that and some advice from Bruce Evans as a guide, I've
put together these changes to implement the hardware polling and restore
the historical timeout behaviors...

 - tty_drain() now calls ttydevsw_busy() in a loop at 10 Hz to accomodate
   hardware that requires polling for busy state.

 - The "new historical" behavior for draining during close(2) is retained:
   the drain timeout is "1 second without making any progress".  When the
   1-second timeout expires, if the count of bytes remaining in the tty
   layer buffer is smaller than last time, the timeout is extended for
   another second.  Unfortunately, the same logic cannot be extended all
   the way down to the hardware, because the interface to that layer is a
   simple busy/not-busy indication.

 - Due to the previous point, an application that needs a guarantee that
   all data has been transmitted must use TIOCDRAIN/tcdrain(3) before
   calling close(2).

 - The historical behavior of honoring the drainwait setting for TIOCDRAIN
   (used by tcdrain(3)) is restored.

 - The historical kern.drainwait sysctl to control the global default
   drainwait time is restored, but is now named kern.tty_drainwait.

 - The historical default drainwait timeout of 300 seconds is restored.

 - Handling of TIOCGDRAINWAIT and TIOCSDRAINWAIT ioctls is restored
   (this also makes the comcontrol(1) drainwait verb work again).

 - Manpages are updated to document these behaviors.

Reviewed by:	bde (prior version)
2017-01-12 00:48:06 +00:00
Conrad Meyer
ca7d74d467 pciconf(8): Reallow trailing colon in selectors
Reallow device selectors to have a trailing colon, as documented in the
manual page.  This was broken along with some unrelated cleanups in
r295806.

PR:		215979
Reported by:	David Boyd <David.Boyd49 at twc.com>
Sponsored by:	Dell EMC Isilon
2017-01-12 00:34:37 +00:00
Mark Johnston
5fddef7999 Enable the use of ^C and ^S/^Q in DDB.
This lets one interrupt DDB's output, which is useful if paging is
disabled and the output device is slow.

Submitted by:	Anton Rang <rang@acm.org>
Reviewed by:	jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9138
2017-01-12 00:22:36 +00:00
Ian Lepore
8a2ec16a9d Include sys/systm.h for use of bootverbose. Fixes powerpc MPC85XXSPE build. 2017-01-12 00:09:31 +00:00
Bjoern A. Zeeb
2738f41598 Get rid of a compiler warning which I saw too often.
Include netinet/in.h before ip_compat.t which will then check if
IPPROTO_IPIP is defined or not.  Doing it the other way round,
ip_compat.h would not find it defined and netinet/in.h then
redefine it.
2017-01-12 00:01:02 +00:00
Navdeep Parhar
a342904bb5 cxgbe/tom: Add VIMAGE support to the TOE driver.
Active Open:
- Save the socket's vnet at the time of the active open (t4_connect) and
  switch to it when processing the reply (do_act_open_rpl or
  do_act_establish).

Passive Open:
- Save the listening socket's vnet in the driver's listen_ctx and switch
  to it when processing incoming SYNs for the socket.
- Reject SYNs that arrive on an ifnet that's not in the same vnet as the
  listening socket.

CLIP (Compressed Local IPv6) table:
- Add only those IPv6 addresses to the CLIP that are in a vnet
  associated with one of the card's ifnets.

Misc:
- Set vnet from the toepcb when processing TCP state transitions.
- The kernel sets the vnet when calling the driver's output routine
  so t4_push_frames runs in proper vnet context already.  One exception
  is when incoming credits trigger tx within the driver's ithread.  Set
  the vnet explicitly in do_fw4_ack for that case.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-01-11 23:48:17 +00:00
Andriy Voskoboinyk
bd99d5d4d8 rtwn: fix R92C_TXDW4_RTSRATE_M definition (0x3f -> 0x1f)
Submitted by:	kevlo
2017-01-11 23:32:40 +00:00
Pedro F. Giffuni
e9ed334fd2 rpcgen(1): Avoid unused variable warning on generated code.
Avoid "unused variable 'i'" warnings in generated .c files by only
emitting the "int i;" for non-opaque arrays. Opaque arrays use
xdr_opaque() rather than iterating over the array.

Obtained from:	OpenBSD (CVS rev 1.28)
MFC after:	1 week
2017-01-11 23:05:29 +00:00
Ed Maste
c83bcfbd2e readelf: add S390 relocation types
From https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries.html

Reviewed by:	bz
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9149
2017-01-11 22:54:04 +00:00
Colin Percival
bf4730f977 Remove obsolete path from fortune(6). This was inadvertantly left over
when fortune and other games moved from /usr/games to /usr/bin; I am
removing rather than correcting it since we normally do not mention in
the FILES section the paths to programs in /usr/bin/.

PR:		215962
Reported by:	Andras Farkas
2017-01-11 22:50:57 +00:00
Ed Maste
0fbbe5bf87 readelf: add more PPC64 relocation types found in LLVM
MFC after:	2 weeks
MFC with:	r311941
Sponsored by:	The FreeBSD Foundation
2017-01-11 21:28:22 +00:00
Ed Maste
dd9d62b416 readelf: add PPC64 relocation types
Reported by:	Mark Millard
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9146
2017-01-11 21:18:14 +00:00
Alexander Motin
47967ab741 Pretend we support some IOCTLs to not scary upper layers.
MFC after:	2 weeks
2017-01-11 20:23:45 +00:00
Dimitry Andric
400e78e45a Use proper prototypes in struct boot_module_t
With clang 4.0.0, we are getting the following warnings about struct
boot_module_t in efi's boot_module.h:

In file included from sys/boot/efi/boot1/ufs_module.c:41:
sys/boot/efi/boot1/boot_module.h:67:14: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        void (*init)();
                    ^
                     void
sys/boot/efi/boot1/boot_module.h:92:16: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        void (*status)();
                      ^
                       void
sys/boot/efi/boot1/boot_module.h:95:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
        dev_info_t *(*devices)();
                              ^
                               void
3 errors generated.

Fix this by adding 'void' to the parameter lists.  No functional change.

Reviewed by:	emaste, imp, smh
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9144
2017-01-11 20:00:24 +00:00
Dimitry Andric
5b89bdba3d Make EFI_RESERVED_SERVICE a proper prototype
With clang 4.0.0, the EFI API header causes the following warning:

In file included from sys/boot/efi/loader/bootinfo.c:43:
In file included from sys/boot/efi/loader/../include/efi.h:52:
sys/boot/efi/include/efiapi.h:534:32: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
(EFIAPI *EFI_RESERVED_SERVICE) (
                               ^

Add VOID to make it into a real prototype.

Reviewed by:	imp, emaste, tsoome
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9132
2017-01-11 19:59:27 +00:00
Sean Bruno
8237905651 Restore v6 offload caps for igb(4) class devices.
Reported by:	tuxen
2017-01-11 19:29:33 +00:00
Jean-Sébastien Pédron
6377daf2ec committers-ports.dot: Add myself
Approved by:	antoine (mentor)
Differential Revision:	https://reviews.freebsd.org/D9143
2017-01-11 19:29:28 +00:00
Dimitry Andric
7ce4822637 Don't include <errno.h> in reloc_elf.c, as it includes <stand.h> just
after it, which has a conflicting definition of errno.  This leads to
the following warning with clang 4.0.0:

    In file included from sys/boot/common/reloc_elf32.c:6:
    In file included from sys/boot/common/reloc_elf.c:37:
    /usr/obj/usr/src/tmp/usr/include/stand.h:155:12: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
    extern int errno;
               ^
    sys/sys/errno.h:46:26: note: expanded from macro 'errno'
    #define errno           (* __error())
                                      ^

MFC after:	3 days
2017-01-11 18:47:00 +00:00
Alan Somers
43e9ad02f6 Fix build of usr.bin/tail with GCC
Submitted by:	pluknet
Reported by:	pluknet
MFC after:	27 days
X-MFC-with:	311895
Sponsored by:	Spectra Logic Corp
2017-01-11 16:09:25 +00:00
Enji Cooper
bccef7f6d9 Consolidate __NetBSD__ #ifdef
MFC after:	3 days
2017-01-11 10:20:35 +00:00
Enji Cooper
ddba0402f4 Import testcase updates with code contributed back to NetBSD
This also (inadvertently) contains an update to
contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases).

MFC after:		2 weeks
In collaboration with:	christos@NetBSD.org
2017-01-11 09:51:34 +00:00
Enji Cooper
d1a6b5fb2f Fix whitespace in comment
MFC after:	3 days
2017-01-11 09:34:42 +00:00
Enji Cooper
8a4c0f8064 Add acpi_if.h and opt_acpi.h to Makefile to unbreak "make depend" with
sys/modules/sdhci_acpi

MFC after:	6 days
X-MFC with:	r311911
Reported by:	Jenkins
2017-01-11 08:43:58 +00:00
Enji Cooper
d87ba4cf3a Pull in changes from upstream for lib/libc/{c063,gen,string,sys} to address
issues resolved in FreeBSD or support added to testcases

In collaboration with:	<christos@NetBSD.org>
2017-01-11 08:15:18 +00:00
Enji Cooper
0e0dd02306 Partially revert r311236
There's no sense in trying to close a file descriptor from the negative cases
with unlink_test; it's best to ignore these cases.

The mkfifo case does make sense to keep though.

MFC after:	3 days
2017-01-11 07:22:21 +00:00
Hiroki Sato
b4d60f9802 Add more #ifdef INET and INET6. 2017-01-11 07:21:59 +00:00
Enji Cooper
19f27f3c34 Fix up r311227
Check for creat returning a value != -1, not a non-zero value

MFC after:	3 days
Pointyhat to:	ngie
Reported by:	Coverity
CID:		1368366
2017-01-11 07:17:03 +00:00
Xin LI
9ea45e75fa MFV r311913:
Fix multiple OpenSSH vulnerabilities.

Submitted by:	des
Approved by:	so
2017-01-11 05:49:39 +00:00
Xin LI
8f8c559269 Apply upstream fix for CVE-2016-10009 and CVE-2016-10010:
add a whitelist of paths from which ssh-agent will load (via
  ssh-pkcs11-helper) a PKCS#11 module; ok markus@

  disable Unix-domain socket forwarding when privsep is disabled

(Note that this is a backport of upstream fixes, and this commit
is mainly to ease future imports).

Obtained from:  OpenBSD
2017-01-11 05:42:06 +00:00
Justin Hibbits
6b3e2169c5 Force all TOC references in asm to include '@toc'
This reportedly fixes one problem with booting a clang kernel.

PR:		kern/215819
Submitted by:	Mark Millard <markmi AT dsl-only.net>
MFC after:	2 weeks
2017-01-11 02:21:34 +00:00
Oleksandr Tymoshenko
e5d519fdbc [sdhci] Add ACPI platform support for SDHCI driver
- Create ACPI version of SDHCI attach/detach/accessors logic. Some
    platforms (e.g. BayTrail-based Minnowboard) expose SDHCI devices
    via ACPI, not PCI
- Add sdchi_acpi kernel module

Reviewed by:	ian, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9112
2017-01-11 01:53:54 +00:00
Mark Johnston
d01e6ad41b Have DTrace handle faults when dereferencing a lock object pointer.
MFC after:	1 week
2017-01-11 01:18:06 +00:00
Mark Johnston
4153c9b932 Ignore LC_SLEEPABLE when testing whether a mutex is adaptive.
MFC after:	1 week
2017-01-11 01:15:55 +00:00
Ian Lepore
6a4b451a11 Follow r311103: add "pool" to the keywords that rc.d/ntpdate examines to
find a server address in ntp.conf.

Submitted by:	Ronald Klop <ronald@klop.ws>
Pointy hat to:	ian
2017-01-11 00:14:47 +00:00
Conrad Meyer
e116c444a0 Revert r311843, r311667
As jkim@ points out, it isn't needed.
2017-01-11 00:02:51 +00:00
Martin Matuska
9520841213 Build libarchive tests missing in r311899
MFC after:	1 week
X-MFC with:	r311899
2017-01-10 22:01:37 +00:00
Martin Matuska
2dbf8c4a76 MFV r311899:
Sync libarchive with vendor.

Vendor bugfixes:
#691: Support for SCHILY.xattr extended attributes
#854: Spelling fixes

Multiple fixes in ACL code:
  - prefer acl_set_fd_np() to acl_set_fd()
  - if acl_set_fd_np() fails, do no fallback to acl_set_file()
  - do not warn if trying to write ACLs to a filesystem without ACL support
  - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs

MFC after:	1 week
X-MFC with:	r310866
2017-01-10 21:59:35 +00:00
Mark Johnston
bd7abab0c9 Coalesce TLB shootdowns of global PTEs in pmap_advise() on x86.
We would previously invalidate such entries individually, resulting in more
IPIs than necessary.

Reviewed by:	alc, kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D9094
2017-01-10 21:52:48 +00:00
Mark Johnston
90e17792c8 Do not set BIO_DONE if the BIO specifies a completion handler.
biowait() will otherwise race with completions of such BIOs. In-tree code
only calls biowait() on BIOs that do not specify a handler, so this change
should not have any functional impact.

Reviewed by:	mav
MFC after:	1 month
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D9070
2017-01-10 21:41:28 +00:00
Sean Bruno
093cf24619 Set CFLAGS correctly for sys/modules/em
Unbreak gcc sparc64 builds (or any gcc build that uses em(4)).

Reported by:	lidl@freebsd.org
2017-01-10 21:21:00 +00:00
Martin Matuska
2a59734ec2 Update vendor/libarchive to git 22f2d190639e6bd496a3b82f70c01fba0d38b40a
Vendor changes:
#691: Support for SCHILY.xattr extended attributes
#854: Spelling fixes

Multiple fixes in ACL code:
  - prefer acl_set_fd_np() to acl_set_fd()
  - if acl_set_fd_np() fails, do no fallback to acl_set_file()
  - do not warn if trying to write ACLs to a filesystem without ACL support
  - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs
2017-01-10 21:18:32 +00:00
Mateusz Guzik
4cf80fbd79 sparc64: add atomic_fcmpset
Tested on hardware provided by feld.

Reviewed by:	marius
2017-01-10 21:10:20 +00:00
Alexander Motin
36289c3336 Add checks for received mode page length.
If our buffer is too small, we may receive part of the page, and should
not try read/write past the end of the buffer.

Reported by:	Coverity
CID:		1368374, 1368375
MFC after:	1 week
2017-01-10 20:52:44 +00:00
Pedro F. Giffuni
990c731f0d Remove unused __gnu_inline() attribute.
This was meant to be used by a future FORTIFY_SOURCE implementation.
Probably for good, FORTIFY_SOURCE and this particular GCCism were never
well supported by clang or other compilers. Furthermore, the technology
has long since been replaced by either static checkers, sanitizers, or
even just the strong stack protector that was enabled by default.

Drop __gnu_inline to avoid cluttering the headers.

MFC after:	5 days
2017-01-10 20:44:31 +00:00
Alan Somers
cdb7a6fc42 Fix memory leaks during "tail -r" of an irregular file
* Rewrite r_buf to use standard tail queues instead of a hand-rolled
  circular linked list. Free dynamic allocations when done.
* Remove an optimization for the case where the file is a multiple of 128KB
  in size and there is a scarcity of memory.
* Add ATF tests for "tail -r" and its variants.

Reported by:	Valgrind
Reviewed by:	ngie
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D9067
2017-01-10 20:43:32 +00:00
Alan Somers
442f47d697 Fix typo from change 310985 in ObsoleteFiles.inc
MFC after:	16 days
X-MFC-With:	310803
Sponsored by:	Spectra Logic Corp
2017-01-10 20:37:44 +00:00
Alan Somers
9a1fe327ae ATFify the geom gate tests.
This ensures their cleanup routines will be run even if they should timeout.

tests/sys/geom/class/gate/ggate_test.sh
tests/sys/geom/class/gate/Makefile
	Add an ATF test with three testcases, one for each TAP test. Use
	ATF-style cleanup functions, and convert sleeps to polling loops.

ObsoleteFiles.inc
tests/sys/geom/class/gate/conf.sh
tests/sys/geom/class/gate/1_test.sh
tests/sys/geom/class/gate/2_test.sh
tests/sys/geom/class/gate/3_test.sh
	Delete TAP test files

Reviewed by:	ngie
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D8891
2017-01-10 20:35:09 +00:00
Alexander Motin
4982dca18d Do not wait for HA thread shutdown if scheduler is stopped.
This wait loop made system hang on panic instead of reboot.

MFC after:	1 week
2017-01-10 20:16:16 +00:00