Commit Graph

219276 Commits

Author SHA1 Message Date
Enji Cooper
cdebaff820 Upgrade NetBSD tests to 01.11.2017_23.20 snapshot
This contains some new testcases in /usr/tests/...:

- .../lib/libc
- .../lib/libthr
- .../lib/msun
- .../sys/kern

Tested on:	amd64, i386
MFC after:	1 month
2017-01-13 03:33:57 +00:00
Conrad Meyer
e266075649 fstyp(8): Detect exFAT filesystems
Simply detect the exFAT filesystem name in the Volume Boot Record
(superblock).

PR:		214908
Reported by:	<vermaden at interia.pl>
2017-01-13 02:12:58 +00:00
Kevin Lo
68c3c0258d Increase retry count to 100 in r88e_fw_cmd() and r92c_fw_cmd(). 2017-01-13 02:11:16 +00:00
Pedro F. Giffuni
be04edbb4f Remove __nonnull() attributes from x86 machine check architecture.
These are of the few cases where we use the GCC non-null attributes in
non-header code. As part of a review [1] of our use of such attributes we
are replacing such uses of the overly aggressive GCC attribute with clang's
_Nonnull attribute.

In this case the attributes serve little purpose as they just don't
enforce run time checks, If anything the attributes would cause NULL pointer
checks to be ignored but there are no such checks so only effect is
cosmetic.

The references appear to be left over from code development and likely
already fulfilled their purpose.

Reference [1]:
https://reviews.freebsd.org/D9004

Reviewed by:	jhb
MFC after:	3 weeks
2017-01-13 01:39:19 +00:00
Ian Lepore
e046e8e680 Restructure the tty_drain loop so that device-busy is checked one more time
after tty_timedwait() returns an error only if the error is EWOULDBLOCK;
other errors cause an immediate return.  This fixes the case of the tty
disappearing while in tty_drain().

Reported by:	pho
2017-01-12 21:18:43 +00:00
Gleb Smirnoff
4f56243aad Fix the contiguity once more. 2017-01-12 20:26:02 +00:00
Hiroki Sato
c10340d440 - Fix dereference of NULL pointer which could cause a crash [1]
- Fix memory leak due to lack of freeaddrinfo() [2]

CID:	1018281 [1]
CID:	1225057 [2]
MFC after:	3 days
2017-01-12 18:44:58 +00:00
Alexander Kabaev
eae0fba453 Fix typo in r311971.
Reported by:	ohartmann at walstatt.org
2017-01-12 18:05:12 +00:00
Sean Bruno
245c5ebbce Purge surprise change to sys/conf/files for ixgbe(4).
Reported by:	imp
2017-01-12 17:18:25 +00:00
Conrad Meyer
484820d442 libkern: Remove obsolete 'register' keyword
Sponsored by:	Dell EMC Isilon
2017-01-12 17:02:29 +00:00
Sean Bruno
9acdec7132 Purge EM_MULTIQUEUE references from the man page for em(4). 2017-01-12 16:44:40 +00:00
Bruce M Simpson
fb1d9b7f41 Allow uart(4) to use MSI interrupts on single-port PCI instances.
Do this here as puc(4) disallows single-port instances; at least
one multi-port PCIe UART chip (in this case, the ASIX MCS9922)
present separate PCI configuration space (functions) for each UART.

Tested using lrzsz and a null-modem cable. The ExpressCard/34
variants containing the MCS9922 should also use MSI with this change.

Reviewed by:		jhb, imp, rpokala
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D9123
2017-01-12 16:30:27 +00:00
Sean Bruno
25a3341048 Fix panic on mb_free_ext() due to NULL destructor.
This used to happen because of the SET_MBUF_DESTRUCTOR() called
on unregif.

Submitted by:	Vincenzo Maffione <v.maffione@gmail.com>
2017-01-12 16:24:10 +00:00
Alan Somers
c6e3715fbc Fix uninitialized variable CIDs in route6d
The variables in question are actually return arguments, but it's still good
form to initialize them.

Reported by:	Coverity
CID:		979679 979680
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
2017-01-12 16:22:28 +00:00
Konstantin Belousov
f8adf1a784 For the main binary, postpone enforcing relro read-only protection
until copy relocations are done.

Newer binutils and lld seems to output copy into relro-protected range.

Reported by: Rafael Espц╜ndola via emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-01-12 15:54:03 +00:00
Andrew Rybchenko
a0e88689f0 sfxge(4): add sysctl to change MAC stats update period
The sysctl controls the period per interface.

Reviewed by:    gnn
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9153
2017-01-12 15:26:23 +00:00
Sean Bruno
653e35e69f Restore fixup for newer em(4) devices WOL capabilities post iflib integration.
PR:	208343
2017-01-12 14:47:44 +00:00
Pedro F. Giffuni
f5ab496e62 rpcgen(1): Check getrlimit() return for generated code.
Obtained from:	NetBSD (CVS rev 1.27, 1.28)
MFC after:	1 week
2017-01-12 14:44:41 +00:00
Sean Bruno
062a4b8c68 Deprecate kernel configuration option EM_MULTIQUEUE now that the em(4)
driver conforms to iflib.
2017-01-12 14:38:18 +00:00
Sean Bruno
0aa7d3ff9e Reset the EIAC register to include the LINK status bit and restore
link up/down notifications.

Submitted by:	Franco Fichtner <franco@opnsense.org>
2017-01-12 14:28:32 +00:00
Sean Bruno
8bc3dfc424 Attempt to use the "new" BAR address for newer igb(4) devices. This code
was dropped during the IFLIB migration.

Reported by:	olivier
Reviewed by:	mmacy@nextbsd.org
2017-01-12 14:18:52 +00:00
Andrew Rybchenko
58223d5b7a sfxge(4): add tunable to configure MAC stats update period
Reviewed by:    philip
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9151
2017-01-12 13:00:17 +00:00
Maxim Sobolev
5e946c03c7 Fix slight type mismatch between so_options defined in sys/socketvar.h
and tw_so_options defined here which is supposed to be a copy of the
former (short vs u_short respectively).

Switch tw_so_options to be "signed short" to match the type of the field
it's inherited from.
2017-01-12 10:14:54 +00:00
Enji Cooper
7ad417dff8 Add __BIT and __BITS macros from NetBSD to help support new testcases
MFC after:	1 week
2017-01-12 09:01:14 +00:00
Alexander Motin
17160457b4 Report random flash storage as non-rotating to GEOM_DISK.
While doing it, introduce respective constants in geom_disk.h.

MFC after:	1 week
2017-01-12 08:53:10 +00:00
Enji Cooper
b6bd3eb5f3 Add additional testcases missed in r311966 2017-01-12 08:46:19 +00:00
Enji Cooper
9527fa4f66 Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile
This is to enable support in other testcases

Inspired by lib/msun/tests/Makefile .

MFC after:	1 week
2017-01-12 08:40:52 +00:00
Enji Cooper
35cfc322f1 Fix lib/libc/sys/access_test after r311925
sys/param.h needs to be #included in order for __FreeBSD_version to be checked

MFC after:	13 days
2017-01-12 08:31:42 +00:00
Enji Cooper
20d24fbb93 Sync ^/vendor/NetBSD/tests/dist with upstream 2017-01-12 07:26:39 +00:00
Enji Cooper
2254eda87e Commit updates accepted upstream (NetBSD) 2017-01-12 07:21:56 +00:00
Conrad Meyer
b28ea2c250 g_raid: Prevent tasters from attempting excessively large reads
Some g_raid tasters attempt metadata reads in multiples of the provider
sectorsize.  Reads larger than MAXPHYS are invalid, so detect and abort
in such situations.

Spiritually similar to r217305 / PR 147851.

PR:		214721
Sponsored by:	Dell EMC Isilon
2017-01-12 06:58:31 +00:00
Ravi Pokala
8e712af70b Remove writability requirement for single-mbuf, contiguous-range
m_pulldown()

m_pulldown() only needs to determine if a mbuf is writable if it is going to
copy data into the data region of an existing mbuf. It does this to create a
contiguous data region in a single mbuf from multiple mbufs in the chain. If
the requested memory region is already contiguous and nothing needs to
change, the mbuf does not need to be writeable.

Submitted by:	Brian Mueller <bmueller@panasas.com>
Reviewed by:	bz
MFC after:	1 week
Sponsored by:	Panasas
Differential Revision:	https://reviews.freebsd.org/D9053
2017-01-12 06:38:03 +00:00
Andrew Rybchenko
62f5c49637 sfxge(4): stats refresh in SW should depend on HW update period
The period should be taken into account by the function which
refreshes driver stats.

Reviewed by:    philip
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision:  https://reviews.freebsd.org/D9130
2017-01-12 06:30:44 +00:00
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