273257 Commits

Author SHA1 Message Date
mav
cea8b9dd7e Cleanup DMA handling.
- Make isp_start() to set all the IOCB fields aside of S/G list, removing
extra information from isp_send_cmd(), now only doing S/G lists and sending.
 - Turn DMA setup/free from being card and PCI-specific into OS-specific,
instead add new card-specific method for isp_send_cmd().  Previously this
function was a monster handling all the cards.
 - Remove double error code translation.
2020-11-20 18:02:04 +00:00
jtl
da9d13aad5 When copying types from one CTF container to another, ensure that we
encode 0-length (i.e. "") structure and union member names as offset 0.
This ensures that we don't confuse other parts of the CTF code which
expect this encoding.

This resolves a Dtrace error resolving members of anonymous structs/unions
within the (struct mbuf) type which some users were seeing after r366908.

While here, update the code in ctf_add_generic() to encode 0-length type
names as offset 0.

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27246
2020-11-20 17:26:02 +00:00
gbe
f5a209db33 hostapd.conf(5): Add missing 'l'
In r367901 I accidentally deleted the 'l' while fixing a few
mandoc erros.

Spotted by: Yuri Pankov
2020-11-20 17:13:13 +00:00
gbe
7a77116f62 moused(8): Fix a few mandoc warnings
- new sentence, new line
2020-11-20 17:04:49 +00:00
gbe
f817b7171c crashinfo(8): Fix a few mandoc warnings
- new sentence, new line
2020-11-20 16:59:51 +00:00
gbe
a8fac1d14c hostapd.conf(5): Fix a mandoc warning
- new sentence, new line
2020-11-20 16:57:06 +00:00
gbe
8c7a914707 syslog.conf(5): Fix a few mandoc warnings
- new sentence, new line
- skipping paragraph macro: Pp at the end of Sh
2020-11-20 16:50:52 +00:00
gbe
397665c1ea snmp_wlan(3): Fix mandoc warnings
- new sentence, new line
2020-11-20 16:46:51 +00:00
gbe
fde62fb64a iscsi.conf(5): Fix a mandoc warning
- new sentence, new line
2020-11-20 16:41:32 +00:00
gbe
768a95d35e devmatch(8): Fix section ordering
- sections out of conventional order: Sh HISTORY
2020-11-20 16:34:01 +00:00
mhorne
c472031cf2 riscv: always initialize the static kernel environment
Ensure we initialize the static environment when not booting via
loader(8), and provide a static buffer if this is the case. This fixes
two issues.

First, performing the initialization ensures that kenv variables set in
the kernel's config file are honored. Previously, any new or overridden
values were ignored.

Second, providing the static buffer allows variables to be set in the
device tree's bootargs property of the chosen node. This can be set by
u-boot or by QEMU's '-append' flag. Attempting to this prior to this
change resulted in an early panic, since the static environment had no
buffer backing it.

Submitted by:	syrinx (earlier version)
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D25034
2020-11-20 15:21:10 +00:00
kib
f23271115b msdosfs: suspend around unmount or remount rw->ro.
This also eliminates unsafe use of VFS_SYNC(MNT_WAIT).

Requested by:	mckusick
Discussed with:	imp
Tested by:	pho (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D27269
2020-11-20 15:19:30 +00:00
mhorne
fc2747e5ed Make net/ifq.h C++ friendly
Don't use "new" as an identifier, and add explicit casts from void *.

As a general policy, FreeBSD doesn't make any C++ compatibility
guarantees for kernel headers like it does for userland, but it is a
small effort to do so in this case, to the benefit of a downstream
consumer (NetApp).

Reviewed by:	rscheff
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D27286
2020-11-20 14:45:45 +00:00
0mp
b227aeacc2 Revert r367291 (KEYWORD: shutdown for rc.d/zfs)
The problem is that zfs is asked to stop too early in the shutdown
sequence. Other services, such as syslog may still be running and have some
files open (e.g., under /var/log). This of course causes the messages like:

  cannot unmount '/var/run': umount failed
  cannot unmount '/var/log': umount failed
  cannot unmount '/var': umount failed
  cannot unmount '/usr/home': umount failed
  cannot unmount '/usr': umount failed
  cannot unmount '/': umount failed

For now, let's remove the shutdown KEYWORD from the zfs service, as people are
reporting problems in their setups:
https://lists.freebsd.org/pipermail/freebsd-current/2020-November/077559.html

In the future, we may think of stopping zfs on shutdown after all the other
services and just before init(8) exits. Another interesting option might be to
a new rcorder(8) KEYWORD like "shutdownjail", but this idea would need to be
discussed a bit.

Reported by:	Johan Hendriks <joh.hendriks gmail.com>
Reported by:	Yasuhiro KIMURA <yasu utahime.org>
Reported by:	Tomoaki AOKI <junchoon dec.sakura.ne.jp>
Approved by:	kevans (src)
MFC:		3 days
Differential Revision:	https://reviews.freebsd.org/D27263
2020-11-20 14:37:07 +00:00
kib
cbc1f15ff5 Unlock channels when any of them are locked, when returning for non-busy state.
Reported and tested by:	"Wall, Stephen" <stephen.wall@redcom.com>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2020-11-20 14:02:43 +00:00
tuexen
7b1cb3d072 Fix an issue I introuced in r367530: tcp_twcheck() can be called
with to == NULL for SYN segments. So don't assume tp != NULL.
Thanks to jhb@ for reporting and suggesting a fix.

PR:			250499
MFC after:		1 week
XMFC-with:		r367530
Sponsored by:		Netflix, Inc.
2020-11-20 13:00:28 +00:00
kib
e573f04a3d msdosfs: Add trivial support for suspension.
Tested by:	pho (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D27269
2020-11-20 12:31:02 +00:00
gbe
9883c78ae9 camcontrol(8): Fix some warnings spotted by mandoc
- skipping paragraph macro: Pp before Bl
2020-11-20 11:45:08 +00:00
manu
2eba0b04b0 if_dwc: Add checksum offloading support 2020-11-20 11:31:25 +00:00
manu
44a68925de if_dwc: Add flow control support 2020-11-20 11:31:04 +00:00
manu
8aa972982a if_awg: Add a awg_dma_start_tx function that trigger dma engine
No functional changes intended
2020-11-20 11:30:44 +00:00
manu
f7da4a448f if_dwc: Use if_ function where appropriate
No functional changes intended
2020-11-20 11:30:23 +00:00
manu
3503cd192b if_dwc: Reorder functions and sort them by usage
No functional changes intended
2020-11-20 11:30:01 +00:00
manu
7162e66bc8 if_awg: Reorder functions and sort them by usage
No functional changes intended
2020-11-20 11:29:37 +00:00
manu
a6aec6b0a2 if_dwc: dwc_get_hwaddr cannot fail, change return to void
No functional changes intended
2020-11-20 11:29:20 +00:00
manu
5c93c1cfe6 if_dwc: Add dwc_stop_dma and use it in dwc_stop_locked
No functional changes intended
2020-11-20 11:29:00 +00:00
manu
e919b12faf if_awg: Add awg_stop_dma and use it in awg_stop
No functional changes intended
2020-11-20 11:28:23 +00:00
manu
f6f5e6e962 if_dwc: Use dwc_enable_mac in dwc_stop_locked
No functional changes intended
2020-11-20 11:28:06 +00:00
manu
7660387557 if_dwc: Add a function to enable/disable the mac tx/rx
No functional changes intended
2020-11-20 11:27:43 +00:00
manu
13dcff0c1f if_awg: Add a function to enable/disable the mac tx/rx
No functional changes intended
2020-11-20 11:27:26 +00:00
manu
322795db92 if_dwc: Use if_setdrvflagbits to notify that we are running
No functional changes intended
2020-11-20 11:27:08 +00:00
manu
ee97a751ee if_dwc: Split init code into sub function
Be clear of what we enable or init.

No functional changes intended
2020-11-20 11:26:46 +00:00
manu
ed202d1581 if_awg: Split init code into sub function
Be clear of what we enable or init.

No functional changes intended
2020-11-20 11:26:20 +00:00
manu
fbbaafa6d7 if_awg: Remove the taskqueue for miibus_statchg
I guess it was added so we can obtain the device lock but we already
have it when the function is called.

No functional changes intended
2020-11-20 11:25:54 +00:00
kp
0d4f95c905 pf tests: Basic source tracking test
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27255
2020-11-20 10:11:03 +00:00
kp
c8c6f8369a pf: Fix incorrect assertion
We never set PFRULE_RULESRCTRACK when calling pf_insert_src_node(). We do set
PFRULE_SRCTRACK, so update the assertion to match.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27254
2020-11-20 10:08:33 +00:00
eugen
fa6ca2c092 bzgrep: make flag --no-filename work
PR:		248813
MFC after:	1 week
2020-11-20 09:56:46 +00:00
mmel
5dc4ad3d38 Also pass interrupt binding request to non-root interrupt controllers.
There are message based controllers that can bind interrupts even if they are
not implemented as root controllers (such as the ITS subblock of GIC).

MFC after:	3 weeks
2020-11-20 09:05:36 +00:00
sjg
dabacd017f Merge bmake-20201117
o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
  checks in InitObjdir.  Explicit .OBJDIR target always allows
  read-only directory.

o More code cleanup and refactoring.

o More unit tests

MFC after:	1 week
2020-11-20 06:02:31 +00:00
mav
6a7fdc0729 Microoptimize cam_num_doneqs math in xpt_done().
MFC after:	1 week
2020-11-20 05:46:27 +00:00
sjg
f76bf0278e tag bmake-20201117 2020-11-20 03:54:46 +00:00
sjg
6574e2df4c Import bmake-20201117
o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
  checks in InitObjdir.  Explicit .OBJDIR target always allows
  read-only directory.

o Fix building and unit-tests on non-BSD.

o More code cleanup and refactoring.

o More unit tests
2020-11-20 03:54:37 +00:00
mav
0605ce802e Fix r367857 build without ISP_TARGET_MODE. 2020-11-20 02:03:58 +00:00
mav
998168954a Remove parallel SCSI and 1/2Gb FC support from isp(4).
This removes 288KB (36%) of the driver code and zillions of hacks and
workarounds, making single driver uniformly support several different
generations of hardware interfaces, not counting minor card variations.
After years of the hopeless fight, I don't think it worth to continue
support for hardware obsolete for 15-20 years.  Instead much cleaner
now code should allow to move forward toward better locking, multiple
queues and other cool features.

All the remaining Qlogic cards starting from 4Gb 24xx to 32Gb 27xx use
the same hardware/firmware interface with minor incremental improvements,
so it seems to be a good new starting point.  Except one PCI-X model all
all of them are PCIe and so still usable in modern systems.

Discussed with:	ken, scottl, jpaetzel, imp
Relnotes:	yes
2020-11-20 01:15:48 +00:00
wulf
512f3cd313 psm(4): Disable AUX multiplexer probing on all Lenovo laptops.
Rudimentary AUX multiplexing support was added to kernel to make possible
touchpad initialization on some HP EliteBook laptops with trackpoint.

Disable multiplexer probing on all Lenovo laptops now as they use touchpad
pass-through port rather than AUX multiplexer to connect trackpoint and
at least two model (X120e and X121e) is known for getting PS/2 AUX port
dysfunctional after switching back to hidden multiplexing mode.

AUX MUX probing can be reenabled with setting of hw.psm.mux_disabled loader
tunable to 0.

PR:		249987
Reported by:	jwb
MFC after:	2 weeks
2020-11-20 00:13:30 +00:00
emaste
ddba6a47c5 addr2line: swap if conditions for diff reduction in upcoming change
No functional change intended.
2020-11-19 21:10:36 +00:00
mjg
4727920853 pipe: thundering herd problem in pipelock
All reads and writes are serialized with a hand-rolled lock, but unlocking it
always wakes up all waiters. Existing flag fields get resized to make room for
introduction of waiter counter without growing the struct.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D27273
2020-11-19 19:25:47 +00:00
fernape
9e8ad253a4 fstat(1): Add EXAMPLES section
* Add examples covering -f, -m and -p flags.

While here, extend the initial description paragraph to note that fstat(1)
will report on all opened files, belonging to processes the user has access to.
The current paragraph may lead to understand that you can get information on
opened files from processes belonging to other users.

Reviewed by:	bjk@, danfe@, gbe@
Approved by:	manpages (gbe@)
Differential Revision:		https://reviews.freebsd.org/D26949
2020-11-19 19:05:16 +00:00
fernape
f44186fe3c grep(1): Add more EXAMPLES
* Add more EXAMPLES covering flags: -A, -B, -c, -f, -i, -H, -l, -q, -R, -w
* While here, change existing wording to use the imperative (remove "To
  find")
* Reword first example to be consistent with how grep(1) understand
  words (-w)

Approved by:	manpages (bcr@)
Differential Revision:		https://reviews.freebsd.org/D27264
2020-11-19 18:58:15 +00:00
markj
24a92577ae callout(9): Fix a race between CPU migration and callout_drain()
Suppose a running callout re-arms itself, and before the callout
finishes running another CPU calls callout_drain() and goes to sleep.
softclock_call_cc() will wake up the draining thread, which may not run
immediately if there is a lot of CPU load.  Furthermore, the callout is
still in the callout wheel so it can continue to run and re-arm itself.
Then, suppose that the callout migrates to another CPU before the
draining thread gets a chance to run.  The draining thread is in this
loop in _callout_stop_safe():

	while (cc_exec_curr(cc) == c) {
		CC_UNLOCK(cc);
		sleep();
		CC_LOCK(cc);
	}

but after the migration, cc points to the wrong CPU's callout state.
Then the draining thread goes off and removes the callout from the
wheel, but does so using the wrong lock and per-CPU callout state.

Fix the problem by doing a re-lookup of the callout CPU after sleeping.

Reported by:	syzbot+79569cd4d76636b2cc1c@syzkaller.appspotmail.com
Reported by:	syzbot+1b27e0237aa22d8adffa@syzkaller.appspotmail.com
Reported by:	syzbot+e21aa5b85a9aff90ef3e@syzkaller.appspotmail.com
Reviewed by:	emaste, hselasky
Tested by:	pho
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D27266
2020-11-19 18:37:28 +00:00