Remove spurious ".Ar groupname".
Add missing full stops.
While there, tweak word order for better grammar.
MFC after: 3 days
Reviewed by: Alexander Ziaee, Mina Galić, allanjude, imp
Differential Revision: https://reviews.freebsd.org/D45092
Tags in $10 (filter_opts) are not guaranteed to be the maximum possible
tag length, so memcpy() can end up reading outside of the allocated
buffer.
Use strlcpy() instead.
Reported by: CheriBSD
Event: Kitchener-Waterloo Hackathon 202406
A previous commit aligned the start of the data area to a multiple of
the VM page size, in order to prevent extra buffers to be allocated
(which failed for 64 KB cluster size without this alignment).
Since a dependency on PAGE_SIZE caused compatibility issues, the
alignment was made conditional on this macro being defined, in the
previous commit. This lead to different behavior of this program
when built on FreeBSD vs. Linux (which does not define PAGE_SIZE).
This commit removes any use of PAGE_SIZE and instead always aligns
the start of the data area to a multiple of the cluster size.
The -A option is now implied, unless overridden by a specific number
of reserved sectors with the -r option.
Approved by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45436
Disable data area alignment if the build environment does not define
PAGE_SIZE (e.g., when building on Linux or macOS).
Reported by: jrtc27
MFC after: 1 week
Without alignment, the data area will not be aligned with the buffer
cache, leading to overhead, higher write multiplication on SSD devices
and issues with very large cluster sizes (see PR 277414).
The -A option used to align the start of the root directory to a
multiple of the cluster size, which happens to align the start of the
data area with a buffer page boundary in case of large clusters and
the default number of directory entries (512 entries requiring 16 KB
for FAT12 or FAT16, FAT32 puts the root directory into the data area).
This commit aligns the start of the data area with the page size, if
neither -A nor -r is used. It changes -A to align the start of the
data area (end of the root directory) to a multiple of the cluster
size, since this is the alignment that prevents write multiplication
due to clusters crossing erase block boundaries of a SSD device.
The -r option is unchanged and will prevent any automatic alignment
from occuring.
Approved by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45436
It's never had any effect. The kernel ignores it. Remove it from the
documentation. But continue to parse it on the command line, for
backwards-compatibility.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1271
This restores nextboot -k on ZFS setups where /boot is on the root
dataset of a pool.
Reviewed by: jrtc27, glebius
Fixes: 0c3ade2cf1 nextboot: fix nextboot -k on ZFS
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D45306
Similar to the preceding fix for rules, ensure that we
recursively list wildcard anchors for nat rules.
MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Add a handle variant of pfctl_get_rule(). This converts us from using
the nvlist variant to the netlink variant, and also moves us closer to a
world where all libpfctl functions take the handle.
While here have pfctl use the new function.
Sponsored by: Rubicon Communications, LLC ("Netgate")
This ensures we use the handle opened with pfctl_open(), and also brings
us closer to the ideal state where everything uses the handle rather
than a file descriptor.
When the if_vlan(4) interface has not been fully configured, i.e., a
bare interface without a physical interface associated with it,
retrieving the current settings of it and unconditionally overwriting
`params` will result in losing vlandev settings in `params`. That will
lead to failing to associate the if_vlan(4) interface with the requested
physical interface and the false report 'both vlan and vlandev must be
specified'.
Fix that by checking if the vlan interface has been fully configured.
The basic VLAN test is slightly modified to cover this case.
PR: 279181
Reviewed by: kp
Tested by: Mike Tancsa <mike@sentex.net>
Fixes: b82b8055ad ifconfig: fix vlan/vlanproto reconfiguration
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45283
Soft updates dramatically improve the performance of UFS filesystems.
The newfs(8) utility currently does not enable them by default. The
FreeBSD installer enables soft updates by default. However custom
built installations that do not specify the -U option to newfs(8)
and the prebuilt UFS system images get filesystems without soft
updates enabled.
There are several testing sites that run benchmarks comparing the
performance of Linux distributions versus BSD distributions. When
they run filesystem comparison benchmarks they use newfs(8) to
create the UFS filesystem. Because it does not have soft updates
enabled it runs poorly versus the Linux ext4 filesystem. When I
have suggested to them that they should enable soft updates on the
UFS filesystem in their testing their response is that they expect
the utility that creates the filesystem to use optimal defaults and
that they cannot be expected to fiddle with various option settings.
The purpose of this change is to give a filesystem created with
newfs(8) reasonably optimal settings. For UFS2 this means enabling
soft updates. For UFS1 which tends to be used on small systems with
minimal memory and CPU speed, the lower memory footprint of running
without soft updates is a more sensible default.
This change adds a note in the section of the newfs(8) manual page
that describes the -U option for enabling soft updates that they
are enabled by default for UFS2 filesystems and that they can be
disabled by using tunefs(8).
Reviewed-by: Warner Losh, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D45201
Consistently use the weird ssize_t type for things I know are unsigned,
but which none-the-less need to be compared to signed things to prevent
a bogus warning. Sigh, these aren't bugs, can't possibly be bugs and
a waste of time to fix.
Sponsored by: Netflix
This produces the same data as the Linux nvme-cli 'nvme telemetry-log'
command. It extracts the telemetry log from drive. This is a variable
length log, so we read the first page and find out how much of the log
to grab. There's 3 levels of details available, and we grab the level of
detail specified on the command line.
Sponsored by: Netflix
In this case it is harmless since it is an array of pointers so the
resulting length is identical.
Reported by: Coverity Scan
CID: 1545055
Sponsored by: Chelsio Communications
pfctl_get_rules_info() opened a netlink socket, but failed to close it again.
Fix this by factoring out the netlink-based function into a _h variant that
takes struct pfctl_handle, and implement pfctl_get_rules_info() based on that,
remembering to close the fd.
While here migrate all in-tree consumers to the _h variant.
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Allow carp(4) to use the VRRPv3 protocol (RFC 5798). We can distinguish carp and
VRRP based on the protocol version number (carp is 2, VRRPv3 is 3), and support
both from the carp(4) code.
Reviewed by: glebius
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D44774
Even though mqes (uint16_t) and queue_size (u_int) are both unsigned,
the expression 'mqes + 1' gets promoted to int which is signed. Keep
the value unsigned by explicitly promoting mqes to u_int before
incrementing the value.
Reported by: GCC
- discover: Connects to a remote Discovery controller, fetches its
Discovery Log Page, and enumerates the remote controllers described
in the log page.
The -v option can be used to display the Identify Controller data
structure for the Discovery controller. This is only really useful
for debugging.
- connect: Connects to a remote I/O controller and establishes an
association of an admin queue and a single I/O queue. The
association is handed off to the in-kernel host to create a new
nvmeX device.
- connect-all: Connects to a Discovery controller and attempts to
create an association with each I/O controller enumerated in the
Discovery controller's Discovery Log Page.
- reconnect: Establishes a new association with a remote I/O
controller for an existing nvmeX device. This can be used to
restore access to a remote I/O controller after the loss of a prior
association due to a transport error, controller reboot, etc.
- disconnect: Deletes one or more nvmeX devices after detaching its
namespaces and terminating any active associations. The devices to
delete can be identified by either a nvmeX device name or the NQN of
the remote controller.
- disconnect-all: Deletes all active associations with remote
controllers.
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44715
nvmecontrol operates on devices. Allow a user to specify the /dev/ if
they want. Any device that starts with / will be treated as if it was a
full path for maximum flexbility.
Sponsored by: Netflix
Introduce pfctl_get_status_h() because we need the pfctl_handle. In this variant
use netlink to obtain the information.
Sponsored by: Rubicon Communications, LLC ("Netgate")
The format command takes a number of different parameters. Include a
brief summary of what the values mean, though since the driver's support
for metadata is at best weak, 0's are almost always used for values
other than -f format. Add an example that ties it all together.
Sponsored by: Netflix
Reviewed by: pauamma@gundo.com, chuck
Differential Revision: https://reviews.freebsd.org/D44958