Commit Graph

9440 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
fa8bc7ed92 80211: ifconfig replace MS() with _IEEE80211_MASKSHIFT()
As we did in the kernel in r366112 replace the MS() macro with the version(s)
added to the kernel: _IEEE80211_MASKSHIFT().  Also provide its counter part.
This will later allow use to use other macros defined in net80211 headers
here in ifconfig.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-10-07 22:29:26 +00:00
Bjoern A. Zeeb
1e375f3aa7 80211: non-functional changes
Sort a few VHT160 and 80+80 lines, update some comments, and remove
a superfluous ','.

No functional changes intended.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2020-10-07 21:56:58 +00:00
Warner Losh
edad03308b Use intmax_t to print uint64_t values.
This fixes the 32-bit build where the types are different.
2020-10-07 07:55:55 +00:00
Warner Losh
c03b1920fb nvmecontrol: Update wdc module for newer WDC NVMe products
Update the to log fetch operation for latest WDC NVMe products.

Tested on HGST SN100 (a few years old) and WDC SN720 (more recent).

Submitted by: Akhilesh Rn <Akhilesh.RN@wdc.com> (minor style tweak by me)
Github PR: 435
2020-10-07 05:36:05 +00:00
Ryan Moeller
92e17803cd Enable iterating all sysctls, even ones with CTLFLAG_SKIP
Add an "nextnoskip" sysctl that allows for listing of sysctls intended to be
normally skipped for cost reasons.

This makes it so the names/descriptions of those sysctls can be discovered with
sysctl -aN/sysctl -ad/sysctl -at.

It also makes it so children are visited when a node flagged with CTLFLAG_SKIP
is explicitly requested.

The intended use case is to mark the root "kstat" node with CTLFLAG_SKIP so that
the extensive and expensive stats are skipped by default but may still be easily
obtained without having to know them all (which may not even be possible) and
request each one-by-one.

Reviewed by:	jhb
MFC after:	2 weeks
Relnotes:	yes
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D26560
2020-10-05 20:13:22 +00:00
Kristof Provost
9e9be081d8 devfs.rules: unhide pf in vnet jails
/dev/pf is usable in vnet jails, so don't hide the node there.

We shouldn't expose /dev/pf in regular jails, as that gives them control over
the host (or parent vnet jail) firewall.

Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D26537
2020-10-05 19:26:54 +00:00
Gordon Bergling
16d57d5af4 gvinum(8): Fix an issue reported by mandoc
- new sentence, new line

MFC after:	1 week
2020-10-03 18:49:00 +00:00
Gordon Bergling
f2ec704adc mdmfs(8): Fix an issue reported by mandoc
- whitespace at end of input line

MFC after:	1 week
2020-10-03 18:47:50 +00:00
Gordon Bergling
39dd0ed993 veriexec(8): Bugfix for an issue reported by mandoc
- consider using OS macro: Nx

MFC after:	1 week
2020-10-03 18:46:42 +00:00
Gordon Bergling
a401a76ceb fsdb(8): Fix an issue reported by mandoc
- whitespace at end of input line

MFC after:	1 week
2020-10-03 18:44:13 +00:00
Gordon Bergling
8b4948dbf2 dhclient(8): Bugfixes for some issues reported by mandoc
- no blank before trailing delimiter
- new sentence, new line

MFC after:	1 week
2020-10-03 18:42:15 +00:00
Gordon Bergling
6444039275 camcontrol(8): Bugfixes for some issues reported by mandoc
- new sentence, new line

MFC after:	1 week
2020-10-03 18:40:02 +00:00
Gordon Bergling
5f35cd7213 devd.conf(5): Bugfix for an issue reported by mandoc
- whitespace at end of input line

MFC after:	1 week
2020-10-03 18:37:59 +00:00
Gordon Bergling
8636dd5703 ipfw(8): Bugfixes for some issues reported by mandoc
- whitespace at end of input line
- new sentence, new line
- skipping paragraph macro: Pp before Pp

MFC after:	1 week
2020-10-03 18:30:01 +00:00
Kyle Evans
7cc42f6d25 Do a sweep and remove most WARNS=6 settings
Repeating the default WARNS here makes it slightly more difficult to
experiment with default WARNS changes, e.g. if we did something absolutely
bananas and introduced a WARNS=7 and wanted to try lifting the default to
that.

Drop most of them; there is one in the blake2 kernel module, but I suspect
it should be dropped -- the default WARNS in the rest of the build doesn't
currently apply to kernel modules, and I haven't put too much thought into
whether it makes sense to make it so.
2020-10-01 01:10:51 +00:00
Fernando Apesteguía
cf0fd1f84a kldconfig(8): Add EXAMPLES to the man page
Add EXAMPLES section to the man page showing the use of all flags except for
-S.

While here, clarify -f description. It not only suppresses diagnostic messages
but it also affects the exit status of the command itself. This is shown in two
of the examples.

Approved by:	bcr@
Differential Revision:	https://reviews.freebsd.org/D26588
2020-09-29 17:52:15 +00:00
Xin LI
5e8221100a Use %ju and cast to (uintmax_t) to avoid using PRI* macros.
Suggested by:	kevlo
2020-09-28 04:30:31 +00:00
Conrad Meyer
eb7e125e58 nextboot(8): Fix behavior on non-ZFS /boot systems
Fix unquoted test for an empty value, which broke nextboot(8) on non-ZFS /boot
systems after r365938.

Discussed with:	allanjude, tsoome
X-MFC-With:	r365938
2020-09-23 17:04:27 +00:00
Xin LI
6155466afb Fix build.
Pointy hat to:	delphij
MFC after:	3 days
2020-09-23 07:27:12 +00:00
Xin LI
4d2c300bde sbin/fsck_msdosfs: Fix an integer overflow on 32-bit platforms.
The purpose of checksize() is to verify that the referenced cluster
chain size matches the recorded file size (up to 2^32 - 1) in the
directory entry. We follow the cluster chain, then multiple the
cluster count by bytes per cluster to get the physical size, then
check it against the recorded size.

When a file is close to 4 GiB (between 4GiB - cluster size and 4GiB,
both non-inclusive), the product of cluster count and bytes per
cluster would be exactly 4 GiB. On 32-bit systems, because size_t
is 32-bit, this would wrap back to 0, which will cause the file be
truncated to 0.

Fix this by using 64-bit physicalSize instead.

This fix is inspired by an Android change request at
https://android-review.googlesource.com/c/platform/external/fsck_msdos/+/1428461

PR:		249533
Reviewed by:	kevlo
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D26524
2020-09-23 06:52:22 +00:00
Kirk McKusick
54fab0fbc4 Add missing cylinder group check-hash updates when doing large expansions
of filesystems.

Reported by:  Colin Percival (cperciva@)
Tested by:    Colin Percival (cperciva@)
MFC after:    3 days
Sponsored by: Netflix
2020-09-22 03:57:48 +00:00
David Bright
52664466c7 Whitespace fix after r365948
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2020-09-21 18:34:13 +00:00
Adrian Chadd
0dcdda0984 [rcorder] [crunch] Fix C function declarations to include void
This fixes a compile issue under gcc6 which complains about
legacy style C function declarations.

Differential Revision:	https://reviews.freebsd.org/D26504
2020-09-21 17:59:45 +00:00
David Bright
16969d1448 Honor the FWUG value of some drives in nvmecontrol
nvmecontrol tries to upload firmware in chunks as large as it thinks
the device permits. It fails to take into account the FWUG value used
by some drives to advertise the size and alignment limits for firmware
chunks.

  - Use the firwmare update granularity value from the
  - If the granularity is not reported or not restricted, fall back to
    the previously existing logic that calculates the max transfer
    size based on MDTS.
  - Add firmware update granularity to the identify-controller output.

Reviewed by:	imp (previous version), chuck
Obtained from:	Dell EMC Isilon
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D26390
2020-09-21 15:45:49 +00:00
Toomas Soome
e307eb94ae loader: zfs should support bootonce an nextboot
bootonce feature is temporary, one time boot, activated by
"bectl activate -t BE", "bectl activate -T BE" will reset the bootonce flag.

By default, the bootonce setting is reset on attempt to boot and the next
boot will use previously active BE.

By setting zfs_bootonce_activate="YES" in rc.conf, the bootonce BE will
be set permanently active.

bootonce dataset name is recorded in boot pool labels, bootenv area.

in case of nextboot, the nextboot_enable boolean variable is recorded in
freebsd:nvstore nvlist, also stored in boot pool label bootenv area.
On boot, the loader will process /boot/nextboot.conf if nextboot_enable
is "YES", and will set nextboot_enable to "NO", preventing /boot/nextboot.conf
processing on next boot.

bootonce and nextboot features are usable in both UEFI and BIOS boot.

To use bootonce/nextboot features, the boot loader needs to be updated on disk;
if loader.efi is stored on ESP, then ESP needs to be updated and
for BIOS boot, stage2 (zfsboot or gptzfsboot) needs to be updated
(gpart or other tools).

At this time, only lua loader is updated.

Sponsored by:	Netflix, Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D25512
2020-09-21 09:01:10 +00:00
Kirk McKusick
85ee267a3e Update the libufs cgget() and cgput() interfaces to have a similar
API to the sbget() and sbput() interfaces. Specifically they take
a file descriptor pointer rather than the struct uufsd *disk pointer
used by the libufs cgread() and cgwrite() interfaces. Update fsck_ffs
to use these revised interfaces.

No functional changes intended.

Sponsored by: Netflix
2020-09-19 22:48:30 +00:00
Kirk McKusick
68d7185b64 The fsdb(8) utility uses the fsck_ffs(8) disk I/O interfaces, so
switch from using libufs's bread() to using fsck_ffs's getdatablk()
when importing tools/diag/prtblnos's prtblknos().

Sponsored by: Netflix
2020-09-19 20:06:12 +00:00
Kyle Evans
fe815331bb build: provide a default WARNS for all in-tree builds
The current default is provided in various Makefile.inc in some top-level
directories and covers a good portion of the tree, but doesn't cover parts
of the build a little deeper (e.g. libcasper).

Provide a default in src.sys.mk and set WARNS to it in bsd.sys.mk if that
variable is defined. This lets us relatively cleanly provide a default WARNS
no matter where you're building in the src tree without breaking things
outside of the tree.

Crunchgen has been updated as a bootstrap tool to work on this change
because it needs r365605 at a minimum to succeed. The cleanup necessary to
successfully walk over this change on WITHOUT_CLEAN builds has been added.

There is a supplemental project to this to list all of the warnings that are
encountered when the environment has WARNS=6 NO_WERROR=yes:
https://warns.kevans.dev -- this project will hopefully eventually go away
in favor of CI doing a much better job than it.

Reviewed by:	emaste, brooks, ngie (all earlier version)
Reviewed by:	emaste, arichardson (depend-cleanup.sh change)
Differential Revision:	https://reviews.freebsd.org/D26455
2020-09-18 17:17:46 +00:00
Navdeep Parhar
830edb4561 Add two new ifnet capabilities for hw checksumming and TSO for VXLAN traffic.
These are similar to the existing VLAN capabilities.

Reviewed by:	kib@
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D25873
2020-09-18 02:10:28 +00:00
Edward Tomasz Napierala
2ccf8a827c Skip armv7 bectl tests on CI; they deadlock (""KSTACK_PAGES is 2").
PR:		249229
Sponsored by:	DARPA
2020-09-14 10:35:39 +00:00
Alex Richardson
d815e42419 pfctl_test: avoid 200 calls to atf_get_srcdir
I have been trying to reduce the time that testsuite runs take for CheriBSD
on QEMU (currently about 22 hours). One of the slowest tests is pfctl_test:
Just listing the available test cases currently takes 98 seconds on a
CheriBSD RISC-V system due to all the processes being spawned. This trivial
patch reduces the time to 92 seconds. The better solution would be to
rewrite the test in C/C++ which I may do as a follow-up change.

Reviewed By:	kp
Differential Revision: https://reviews.freebsd.org/D26417
2020-09-14 08:51:18 +00:00
Kirk McKusick
314a6544c5 In the newfs(8) utility, use the more appropriate sbwrite() and cgwrite()
libufs interfaces rather than sbput() and cgput().

No functional change.

MFC after:    7 days
Sponsored by: Netflix
2020-09-13 22:57:50 +00:00
Kyle Evans
ecebb3cc1d Only set WARNS if not defined
This would allow interested parties to do experimental runs with an
environment set appropriately to raise all the warnings throughout the
build; e.g. env WARNS=6 NO_WERROR=yes buildworld.

Not currently touching the numerous instances in ^/tools.

MFC after:	1 week
2020-09-11 13:28:37 +00:00
Andrey V. Elsukov
b876085f55 Fix compatibility regression after r364117.
Properly handle the case, when some opcode keywords follow after
the `frag` opcode without additional options.

Reported by:	Evgeniy Khramtsov <evgeniy at khramtsov org>
2020-09-11 10:07:09 +00:00
Richard Scheffenegger
6034024dad Add -z "TOS" option to ping6, to test DSCP/ECN values
ping has the option to add the (deprecated) TOS byte
using the -z option. Adding the same option, with the
same (deprecated) Traffic Class Byte (nowadays actually
DSCP and ECN fields) to ping6 to validate proper QoS
processing in network switches.

Reviewed by:	tuexen
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D26384
2020-09-10 00:50:18 +00:00
Mark Johnston
278847ae58 ggate: Fix ggated/ggatec debug print of offsets.
The request offset and length are always unsigned, so print them as
such.

Submitted by:	Yoshihiro Ota <ota@j.email.ne.jp>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D21388
2020-09-09 12:58:19 +00:00
Andrey V. Elsukov
30fe2bbfae Add a few features to rcorder:
o Enhance dependency loop logging: print full chain instead of the
  last link competing the loop;
o Add -g option to generate dependency graph suitable for GraphViz
  visualization, loops and other graph generation issues are highlighted
  automatically;
o Add -p option that enables grouping items that can be processed in
  parallel.

Submitted by:	Boris Lytochkin <lytboris at gmail>
Reviewed by:	melifaro
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D25389
2020-09-08 10:36:11 +00:00
Li-Wen Hsu
d8bdfeb653 Call atf_skip function in cleanup procedure as it also triggers zfs.ko loading
PR:		249055
Sponsored by:	The FreeBSD Foundation
2020-09-07 18:15:58 +00:00
Li-Wen Hsu
7c570021c8 Temporarily skip sbin.bectl.bectl_test.* i386 kernel in CI
kldload zfs.ko on i386 hangs in CI

Sponsored by:	The FreeBSD Foundation
2020-09-03 08:16:57 +00:00
Brooks Davis
a449e81e00 Remove risky compatability with old kernels
The badsys() handler for SIGSYS was added as a transtion aid for kernels
lacking sysctl() in 1993.  It is unsafe and unsound so remove it rather
than running the risk of a privilege-dropping system call being silently
omitted.

This partially reverts SCCSID 6.12 (Berkeley) 03/03/93 "add code to
change the system security level".

Reviewed by:	mckusick, imp, kevans
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D26289
2020-09-02 21:14:36 +00:00
Li-Wen Hsu
0932ee9fa0 Temporarily skip tests panic i386 kernel in CI
lib.libbe.be_create.libbe_create
sbin.bectl.bectl_test.bectl_create

PR:		249055
Sponsored by:	The FreeBSD Foundation
2020-09-02 19:18:27 +00:00
Mark Johnston
a0efcf6400 Add sysctl(8) formatting for hw.pagesizes.
- Change the type of hw.pagesizes to OPAQUE, since it returns an array.
- Modify the handler to only truncate the returned length if the caller
  supplied an output buffer.  This allows use of the trick of passing a
  NULL output buffer to fetch the output size, while preserving
  compatibility if MAXPAGESIZES is increased.
- Add a "S,pagesize" formatter to sysctl(8).

Reviewed by:	alc, kib
MFC after:	2 weeks
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D26239
2020-09-02 18:17:08 +00:00
Fernando Apesteguía
2825bf5b2a kldstat(8): Add EXAMPLES to the man page
Add EXAMPLES for all the flags

Approved by:	manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26283
2020-09-02 18:15:57 +00:00
Chuck Silvers
e83370448f Move all of the error prints in readsb() from stderr to stdout.
The only output from fsck that should go to stderr is the usage message.
if setup() fails then exit with EEXIT rather than 0.

Reviewed by:	mckusick
Sponsored by:	Netflix
2020-09-01 18:50:26 +00:00
Stefan Eßer
0fa427fe19 Change printf format string to include the extra blank
This is a follow up change to r364321 after a discussion about the style.
All near by places use extra blanks in format strings, and while use of the
format string to provide the extra blank may need more cycles than adding 1
to twidth, it generates shorter code and is clearer in the opinion of some
reviewers of the previous change.

Not objected to by:	emaste
MFC after:		3 days
2020-09-01 09:02:43 +00:00
Warner Losh
7daa93c454 Sort IFNET alphabetically 2020-08-31 23:48:27 +00:00
Warner Losh
b87de06445 Add documentation for ETHERNET events. 2020-08-31 23:48:23 +00:00
Mark Johnston
0a01415e6e ggated(8): Avoid doubly opening the requested disk device.
- Initialize the disk device fd field in connection_new().
- Close the disk device after handing the connection over
  to a child worker.
- Avoid re-opening a disk device for each connection from
  the same client, avoiding an fd leak.

PR:		132845
Submitted by:	Yoshihiro Ota <ota@j.email.ne.jp>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D26168
2020-08-31 15:59:17 +00:00
Ed Maste
57b278f886 dhclient: improve error handling parsing option 119
Reported by:	Shlomi Oberman, JSOF
Submitted by:	delphij
Reviewed by:	markj
Tested by:	markj
2020-08-31 15:55:29 +00:00
Alex Richardson
6424881cc8 Fix makefs bootstrap on macOS after D25563
The macOS assert.h header does not define static_assert when compiling in
C99 mode. To fix this compile with -std=c11.

Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D25928
2020-08-25 13:30:24 +00:00