Commit Graph

248938 Commits

Author SHA1 Message Date
Patrick Kelsey
5d1899eedb Restore power-of-2 queue count constraint from r290948
When vmx(4) was converted to an iflib driver in r343291, the
power-of-2 queue count constraint was removed as it appeared that
current implementations of the VMXNET3 virtual device no longer
required that constraint.  It turns out that some of the
implementations still do, and on such systems, the device will fail to
initialize when configured with a non-power-of-2 RX or TX queue count.

PR:		237321
Reported by:	ncrogers@gmail.com
MFC after:	1 week
2020-03-17 03:32:13 +00:00
Lorenzo Salvadore
1d7a2bbe37 Add tcberner as co-mentor for salvadore
Approved by:	gerald (mentor)
2020-03-16 23:37:57 +00:00
Conrad Meyer
a99c321802 Remove misleading / redundant bzero in callout_callwheel_init
The intent seems to be zeroing all of the cc_cpu array, or its singleton on
such platforms.  The assumption made is that the BSP is always zero.  The
code smell was introduced in r326218, which changed the prior explicit zero
to 'curcpu'.  The change is only valid if curcpu continues to be zero,
contrary to the aim expressed in that commit message.

So, more succinctly, the expression could be: memset(cc_cpu,0,sizeof(cc_cpu)).

However, there's no point.  cc_cpu lives in the data section and has a zero
initial value already.  So this revision just removes the problematic
statement.

No functional change.  Appeases a (false positive, ish) Coverity CID.

CID:		1383567
Reported by:	Puneeth Jothaiah <puneethkumar.jothaia AT dell.com>
Reviewed by:	kib
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D24089
2020-03-16 22:25:25 +00:00
Alexander Motin
cf2f2eb568 Fix infinite scan on a pool with only special allocations
Attempt to run scrub or resilver on a new pool containing only special
allocations (special vdev added on creation) caused infinite loop
because of dsl_scan_should_clear() limiting memory usage to 5% of pool
size, which it calculated accounting only normal allocation class.

Addition of special and just in case dedup classes fixes the issue.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored-By: iXsystems, Inc.
Closes #10106
Closes #8694
openzfs/zfs@fa130e010c
2020-03-16 19:03:10 +00:00
Edward Tomasz Napierala
fb48a42f03 Make autofs(5) timeout messages include affected process name and PID.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2020-03-16 16:17:58 +00:00
Andrew Gallatin
ee7a9e506e Avoid a cache miss accessing an mbuf ext_pgs pointer when doing SW kTLS.
For a Netflix 90Gb/s 100% TLS software kTLS workload, this reduces
the CPI of tcp_m_copym() from ~3.5 to ~2.5 as reported by vtune.

Reviewed by:	jtl, rrs
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D23998
2020-03-16 14:03:27 +00:00
Alfredo Dal'Ava Junior
5c6ad2e813 atp: fix mouse attachment on PowerBook5,6 (G4)
Skip device mode switch step on Fountain-based devices as they don't
support RAW_SENSOR_MODE command, so failing to attach.

This was reproduced on PowerBook G4 (model PowerBook5,6) equipped with
product ID 0x020e

Reviewed by:	hselasky
Approved by:	jhibbits (mentor)
Differential Revision:	https://reviews.freebsd.org/D24005
2020-03-16 13:53:29 +00:00
Hans Petter Selasky
1c6a456125 Fix for double unlock in ipoib.
The ipoib_unicast_send() function is not supposed to unlock the priv lock.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2020-03-16 12:33:57 +00:00
Kristof Provost
bb490fcf19 bridge tests: Basic span test
Reviewed by:	philip, emaste (previous version)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23961
2020-03-16 08:44:46 +00:00
Ed Maste
9f6954e505 if_muge: whitespace and style cleanup
Submitted by:	clang-format (in part)
Sponsored by:	The FreeBSD Foundation
2020-03-15 21:47:16 +00:00
Warner Losh
ddeb85e131 We don't need $M/$M in the path anymore.
Now that machdep files are gone, we don't need $S/$M/$M in the path to find
them.
2020-03-15 17:40:14 +00:00
Ed Maste
6c0331ea04 muge: drop CSUM from MUGE_DEFAULT_TSO_CSUM_ENABLE
TSO is independent of checksum offload
2020-03-15 03:32:39 +00:00
Ed Maste
0d5e6868c5 muge: enable RXCSUM as it now works
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2020-03-15 03:03:01 +00:00
Pedro F. Giffuni
83735685d3 calendar(1): Updates and corrections for some calendar files.
These have an educational value and are, no doubt, an integral part of the fun
behind running the BSDs.

PR:		242909, 242918
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23581
2020-03-15 00:49:06 +00:00
Patrick Kelsey
876996910a Remove extraneous code from iflib
ifsd_cidx is never used, and the line removed from rxd_frag_to_sd() is
just dead code.

Reviewed by:	erj, gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23951
2020-03-14 20:13:42 +00:00
Patrick Kelsey
1342c8c622 Adjust if_vmx default receive parameters for better out-of-box performance
These adjustments improve performance with jumbo frames and/or LRO
enabled (i.e., when there may be multiple descriptors per packet) by
increasing the default size of the receive queues and by always using
page-sized buffers for the body type receive ring.

This patch also adjust the initialization of the max frame size to
remove cases where certain configuration sequences would result in 2K
receive buffers being used instead of 4K ones when jumbo frames were
enabled.

Reviewed by:	gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23950
2020-03-14 20:11:46 +00:00
Patrick Kelsey
f50375eec6 Fix if_vmx receive checksum offload bug and harden against the device skipping receive descriptors
This fixes a bug where the checksum offload status of received packets
was being taken from the first descriptor instead of the last, which
affected LRO packets.

The driver has been hardened against the device skipping receive
descriptors, although it is not believed that this can occur given the
way this implementation configures the receive rings.

Additionally, for packets received with the error indicator set, the
driver now forces the length of all fragments in that packet to zero
prior to passing it to iflib.  Such packets should wind up being
discarded at some point in the stack anyway, but this removes any
questions by killing them in the driver.

Counters have been added (and exposed via sysctls) for skipped receive
descriptors, zero-length packets received, and packets received with
the error indicator set so that these conditions can be easily
observed in the field.

PR:		243126, 243392, 240628
Reported by:	avg, alexandr.oleynikov@gmail.com, Harald Schmalzbauer
Reviewed by:	gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23949
2020-03-14 20:08:04 +00:00
Patrick Kelsey
3caff1885f Remove refill budget from iflib
Reviewed by:	gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23948
2020-03-14 19:58:50 +00:00
Patrick Kelsey
b38136097a Allow iflib drivers to specify the buffer size used for each receive queue
Reviewed by:	erj, gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23947
2020-03-14 19:56:46 +00:00
Patrick Kelsey
e503049067 Remove freelist contiguous-indexes assertion from rxd_frag_to_sd()
The vmx driver is an example of an iflib driver that might report
packets using non-contiguous descriptors (with unused descriptors
either between received packets or between the fragments of a received
packet), so this assertion needs to be removed.

For such drivers, the freelist producer and consumer indexes don't
relate directly to driver ring slots (the driver deals directly with
freelist buffer indexes supplied by iflib during refill, and reports
them with each fragment during packet reception), but do continue to
be used by iflib for accounting, such as determining the number of
ring slots that are refillable.

PR:		243126, 243392, 240628
Reported by:	avg, alexandr.oleynikov@gmail.com, Harald Schmalzbauer
Reviewed by:	gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23946
2020-03-14 19:55:05 +00:00
Patrick Kelsey
4f2beb721b Fix iflib zero-length fragment handling
The dmamap for zero-length fragments should not be unloaded, as doing
so breaks the the cluster-reuse logic in _iflib_fl_refill().

All zero-length fragments are now handled by the assemble_segments()
path so that the cluster-reuse logic there does not have to be
replicated in the small-single-fragment-packet path of
iflib_rxd_pkt_get().

Packets consisting entirely of zero-length fragments (which result in
a NULL mbuf pointer) are now properly tolerated.  This allows drivers
(such as the vmx driver) to pass such packets to iflib when a
descriptor error occurs during packet reception, the advantage being
that the refill of descriptors associated with the error packet are
handled via the existing iflib machinery without having to duplicate
parts of that machinery in the driver to handle that error case.

Reviewed by:	avg, erj, gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23945
2020-03-14 19:51:55 +00:00
Patrick Kelsey
9e9b738ac5 Fix iflib freelist state corruption
This fixes a bug in iflib freelist management that breaks the required
correspondence between freelist indexes and driver ring slots.

PR:		243126, 243392, 240628
Reported by:	avg, alexandr.oleynikov@gmail.com, Harald Schmalzbauer
Reviewed by:	avg, gallatin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D23943
2020-03-14 19:43:44 +00:00
Warner Losh
30b5d9be24 Sparc64 and pc98 needed cam_machdep and/or ata_machdep for various
reasons. Those have now left the tree, and with them the need to have machdep
files. Places that called the routines in quesiton have been removed
previously. Remove these files from the Makefile to tidy up.
2020-03-14 18:35:44 +00:00
Kyle Evans
19fe57fdb4 libssp: don't compile with -fstack-protector*
This similarly matches what we do in libc; compiling libssp with
-fstack-protector* is actively harmful.  For instance, if the canary ctor
ends up with a stack protector then it will trivially trigger a false
positive as the canary's being initialized.

This was noted by the reporter as irc/ircd-hybrid started crashing at start
after our libssp was MFC'd to stable/11, as its build will explicitly link
in libssp. On FreeBSD, this isn't necessary as SSP bits are included in
libc, but it should absolutely not trigger runtime breakage -- it does mean
that the canary will get initialized twice, but as this is happening early
on in application startup it should just be redundant work.

Reported by:	Tod McQuillin <devin@sevenlayer.studio>
MFC after:	3 days
2020-03-14 15:15:27 +00:00
Bjoern A. Zeeb
1b786d0191 kern_jail: missing \0 termination check on osrelease parameter
If a user spplies a non-\0 terminated osrelease parameter reading it back
may disclose kernel memory.
This is a problem in case of nested jails (children.max > 0, which is not
the default).  Otherwise root outside the jail has access to kernel memory
by other means and root inside a jail cannot create a child jail.

Add the proper \0 check at the end of a supplied osrelease parameter and
make sure any copies of the field will be \0-terminated.

Submitted by:	Hans Christian Woithe (chwoithe yahoo.com)
MFC after:	3 days
2020-03-14 14:04:55 +00:00
Toomas Soome
ebe8cd79d2 loader: add comconsole implementation on top of SIO protocol
Provide comconsole on top of SIO for arm platforms (x86 does use bios version).
2020-03-14 06:36:03 +00:00
Xin LI
a0eb385c2e Remove unneeded checks for prelen.
In order to determine the type of a compressed file, we have to read
in the first four bytes which may also be important for decompression
purposes, to do that we would pass the buffer that we have already
read in, along with the size of it.

Rename header1 to fourbytes to make that explicit, and remove all
checks for prelen.

Reported by:	cem
Reviewed by:	cem
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24034
2020-03-14 05:57:22 +00:00
Warner Losh
81490eda60 Add comment about how the deferred callback for AC_FOUND_DEVICE we
generate for a race where a device goes away, we start to tear down
the periph state for the device, and then the device suddently
reappears. The key that makes it work is removal of periph from the
drv list before calling the deferred callback.

Hat tip to: mav@
2020-03-14 02:36:45 +00:00
Ed Maste
bec8faad55 muge: correct RX checksum offload
Submitted by:	Johannes <iz-rpi04@hs-karlsruhe.de>
MFC after:	1 week
2020-03-14 01:52:38 +00:00
Ryan Moeller
9f24784038 TODO DONE: Use sx_xholder in SPL rwlock.h
Approved by:	mav (mentor)
MFC after:	1 week
Sponsored by:	iXsystems, Inc.
2020-03-14 00:16:15 +00:00
Warner Losh
7defd7582e Give some indication of the CCB that's in flight when we panic.
Print the pointer to ccb so we can find it (for what good it does)
as well as the type of operation in flight when the cam_path has
been freed out from under us. This helps both core analysis as well
as automated systems that collect panic strings but little else.
2020-03-13 18:45:36 +00:00
Michael Tuexen
db4493f7b6 sendfile() does currently not support SCTP sockets.
Therefore, fail the call.

Reviewed by:		markj@
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D24059
2020-03-13 18:38:28 +00:00
Li-Wen Hsu
c0507192fa Skip sys.netpfil.pf.nat.exhaust on all platforms as it not only fails on amd64
PR:		244703
Sponsored by:	The FreeBSD Foundation
2020-03-13 16:44:48 +00:00
Ed Maste
405e3338ac flua: implement chmod
Lua does not provide a native way to change the permission of a file.

Submitted by:	Yang Wang <2333@outlook.jp>
Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D24036
2020-03-13 15:40:35 +00:00
Alexander Motin
a2386b6f6a Increase buffer in mprsas_log_command() from 192 to 224 bytes.
192 bytes are not enough to print long commands, such as ATA COMMAND PASS
THROUGH(16), that makes debug output difficult to read.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-03-13 14:51:11 +00:00
Mateusz Piotrowski
d7ef92ffae CMSG_DATA.3: Fix formatting of printf escape sequences
Escape sequences like "\n" have to be escaped twice in examples in our
mdoc(7)-based manual pages in order to be displayed properly. The problem
is that otherwise they are interpreted by mdoc(7), which results in:

    printf("parent: received '%s'0, buf);

being shown to the user instead of:

    printf("parent: received '%s'\n", buf);

Approved by:	bcr (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24056
2020-03-13 11:07:48 +00:00
Justin Hibbits
8cf2c8ed64 powerpc: Simplify _nodrop variants of FPU and vector register saves
No need for an extra temporary.  It doesn't even help with readability.

Suggested by:	kib (almost 2 years ago)
2020-03-13 01:27:37 +00:00
Navdeep Parhar
7a25fb9963 cxgbe(4): Do not display error messages related to the CLIP table if
it's not in use by TOE or KTLS.

Reviewed by:	jhb@
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D24046
2020-03-13 00:12:15 +00:00
Ryan Moeller
797711a84f libpmcstat: Try /boot/modules if module not found
Modules from ports/pkg are commonly installed to /boot/modules rather than to
the same directory the kernel resides in.  Look there if a module is not found
next to the kernel.

Submitted by:	mmacy
Reported by:	Nick Principe <nap@iXsystems.com>
Approved by:	mmacy (mentor)
MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2020-03-12 23:04:40 +00:00
Conrad Meyer
7a119578a4 kern_shutdown: Add missing EKCD ifdef
Submitted by:	Puneeth Jothaiah <puneethkumar.jothaia AT dell.com>
Reviewed by:	bdrewery
Sponsored by:	Dell EMC Isilon
2020-03-12 21:26:36 +00:00
Mariusz Zaborski
8838296e56 logger: capsicumize
Submitted by:	Tiger Gao <tig@freebsdfoundation.org>
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23744
2020-03-12 19:55:51 +00:00
Mateusz Piotrowski
18a9889f69 ftw.3: Follow style(9) in the example
Reported by:	oshogbo
Approved by:	bcr (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D24043
2020-03-12 18:28:23 +00:00
Enji Cooper
0fbbe50269 Remove /usr/share/snmp/defs/tc.def with delete-old if MK_BSNMP == no
This removes a lingering file on new installs of CURRENT, originally
added in r345797.

MFC after:	1 week
MFC with:	r345797
2020-03-12 16:06:26 +00:00
Michael Tuexen
7ca6e2963f Use KMOD_TCPSTAT_INC instead of TCPSTAT_INC for RACK and BBR, since
these are kernel modules. Also add a KMOD_TCPSTAT_ADD and use that
instead of TCPSTAT_ADD.

Reviewed by:		jtl@, rrs@
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D23904
2020-03-12 15:37:41 +00:00
Ed Maste
450cc34172 Makefile.inc1: move dependency hack comment to the block it applies to 2020-03-12 14:01:17 +00:00
Ed Maste
3b1781b4fd Extend r358907 to explicitly remove stale lib32 dependency
After r325072 stale lib32 dependencies were not remooved.  A more
holistic approach is needed to address this but for the immediate issue
(-DNO_CLEAN builds across r358851) just readd the explicit lib32 path.

Reported by:	dim
Sponsored by:	The FreeBSD Foundation
2020-03-12 13:42:08 +00:00
Leandro Lupori
c5568ba087 Enable ixl device on PowerPC64
The ixl driver now works on PowerPC64 and may be compiled in-kernel and
as a module.

Reviewed by:	alfredo, erj
Sponsored by:	Eldorado Research Institute (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D23974
2020-03-12 12:47:10 +00:00
Dimitry Andric
0efe25f9a5 Allow -DNO_CLEAN build across r358851.
The openmp 10.0.0 import renamed one .c file to .cpp, and this is
something our dependency system does not handle correctly.  Add another
ad-hoc cleanup to get rid of the stale dependency.

PR:		244251
MFC after:	6 weeks
X-MFC-With:	358851
2020-03-12 11:39:04 +00:00
Toomas Soome
7f505e7f79 test if port does exist via using scratch register
The SCR, scratch register was not present on the 8250 and 8250B UART, so we
can use to test if we actually do have serial port.

We need this test because some systems will get long delays while attempting
to write to non-existing port and this will slow down the console IO
to extreme.

MFC after:	1 week
2020-03-12 06:45:08 +00:00
Pedro F. Giffuni
68983a2bc7 style(9): Fix space after #define.
No functional change.
2020-03-12 03:56:54 +00:00