Allow the LUN number to be specified as the key for a LUN instead
of requiring it as a "number" field. If a key is used, permit
a simple string value to be used for non-anymous LUNs. This permits
replacing:
lun = [
{ number = 0, name = zvol_lun },
{
number = 1
backend = ramdisk
size = 1GB
}
]
with:
lun = {
0 = zvol_lun
1 {
backend = ramdisk
size = 1GB
}
}
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48939
In the case that a separate auth-group is not required, this permits
replacing:
portal-group = { name = pg0 }
with:
portal-group = pg0
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48938
If a target LUN entry doesn't have a name property, assume it is an
anonymous LUN and parse other properties from the entry to define the
LUN.
This removes the odd support for target LUNs only named by an integer.
My guess is this was meant to implement support for anonymous LUNs
based on how the syntax for this works in the non-UCL case, but the
prior implementation was useless (it just created unconfigured LUNs).
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48937
- Support for "foreign", "offload", and "tag" properties in portal
group contexts.
- Support for "ctl-lun" and "device-type" properties in LUN contexts.
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48936
The auth-group context required an array of entries for "chap",
"chap-mutual", "initiator-name", and "initiator-portal" whereas the
target context required exactly one entry (and only permitted a single
entry).
Allow either a single entry or an array of entries for these keywords
in both the auth-group and target contexts.
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48935
Errors from auth groups, portal groups, global luns, and targets were
not propagated out of the main loop.
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D49071
The primary purpose of this is to permit the rest of ctld to use C++.
However, this also has the nice side effect of reducing code
duplication with the UCL parser.
As a general rule, setting of options including error handling for
invalid values, etc. is moved out of parse.y and into conf.c. The
globals for the current configuration, auth group, portal group, lun,
and target are also moved into conf.c hiding the types from parse.y.
The intention is that all of the functions declared in conf.h will be
extern "C" for use by parse.y and that the backing data structures can
be reimplemented as C++ classes instead of C structures if desired.
A few other small changes are included with this refactoring:
- Warn and fail a configuration that specifies the same LUN multiple
times for a target.
- Use T_* constants for SCSI device types instead of magic numbers.
- Warn and fail for a few UCL properties that aren't the required type
including "discovery-auth-group" in a portal group context,
"auth-type" and "port" in a target context.
- Fix a bug where chap-mutual in a target in UCL would not auto-create
a new auth-group.
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48934
Pointer arithmetic overflow is UB. Convert to unsigned uintptr_t and do
the check there.
PR: 204945
Reported by: David Binderman <dcb314@hotmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Like pciconf -l add a -l to dump_device_desc for usbconfig which will
fold most fields into a single line. We do filter out some we think
will not be interesting in this case.
While mangling with string output in ways not always anticipated when
the program was initially written this should help to parse the
available devices for programs like fwget(8). While I had this in
mind for other bits for a while I got prompted by D48678 to finally
do it.
Sponsored by: The FreebSD Foundation
MFC after: 3 days
Reviewed by: bapt (LGTM), ziaee (man)
Differential Revision: https://reviews.freebsd.org/D48974
We now support multiple lables on a rule, so 'rule' is an array of strings, not
just one string. Adjust the check for 'is there a label?'.
CID: 1471808
Sponsored by: Rubicon Communications, LLC ("Netgate")
On most platforms time_t is 64 bits wide, but we assign it to 32 bits
variables. Unfortunately these are SNMP fields that are defined to be 32 bits
wide, so we cannot change this. We are similarly unable to prevent the passage
of time, meaning that time_t must remain 64 bits wide as well.
Explicitly cast to tell Coverity that we're aware of these limitations and do
not wish to be reminded of them.
CID: 1553869
CID: 1557025
CID: 1592232
CID: 1592234
Sponsored by: Rubicon Communications, LLC ("Netgate")
After fixing the obvious build and cast error when moving this from tools
to usr.sbin and removing -Wno-cast-align, re-add it back as at least
powerpc* does not compile without it (amd64, arm64, and i386 were ok).
In general wlanstats may now get a bit more love after 22 years of
being in the tree and being moved at least twice.
But first unbreak things again.
Reported by: mmel, cperciva (weekly snapshots)
Sponsored by: The FreeBSD Foundation
Fixes: 61ce422531
MFC after: 3 days
wlanstats is an incredible tool to get a quick overview of state
of affairs of wireless by looking at the counters.
And it makes it simple.
Having landed the LinuxKPI HW_CRYPTO bits I was asked by users
what to check and I realised the answer is in wlanstats.
It is annoying even as a developer to manually build it for each
installation but given it's also useful to users and support
make it available with the general installation.
Probably very long overdue.
Adjust the Makefile and make build again on main.
Hook it up to the build conditional on MK_WIRELESS.
Discussed with: adrian
Sponsored by: The FreeBSD Foundation
TODO: man page
MFC after: 3 days
Some device models, LPC in particular, will call pci_host_read_config()
when probing for devices. Currently this results in pcifd_init()
opening /dev/pci, and thus bhyve holds the fd open even when it's not
needed.
Modify pci_host_{read,write}_config() to open /dev/pci independent of
the global pcifd. This means that these routines can only be used
during VM initialization, as capsicum will prevent further opens
afterward. Introduce internal wrappers which use the global pcifd,
intended for the passthru code.
Reviewed by: jhb
MFC after: 3 weeks
Fixes: 563fd2240e ("bhyve: export funcs for read/write pci config")
Differential Revision: https://reviews.freebsd.org/D48908
These keywords were setting the wrong configuration value (connection
timeout).
Reviewed by: asomers
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48930
The lexer always allocates a duplicate string via strdup for STR
tokens. The parse handlers did not always free these duplicated
strings after consuming them.
Reviewed by: asomers
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48929
- Convert a few variables from int to bool
- Return bool instead of inverted 0/1 from configuration parsing
functions and the auth check functions
- Invert the existing dont_daemonize bool into a daemonize boolx
Reviewed by: asomers
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48928
Take a cue from vnet.subr and abstract module loading, jail creation and
cleanup.
Note that the way jails are created differs slightly from vnet.subr, to
maintain the current style of the tests.
Reported by: Jenkins
Reviewed by: markj
Approved by: emaste (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D48949
Tracking newer versions of C (and C++) permits assuming newer language
features in the base system. Some C11 extensions are already used in
the base system but implemented on top of GNU C extensions such as
_Alignas and _Static_assert. In some cases the fallback versions in
cdefs.h are more limited than the native C11 extensions.
Even though C11 is the next major version of C, C17 is chosen instead
since C17 does not add new features to C but merely fixes defects in
C11. It is also well supported by a wide range of clang (7.0.0+) and
GCC (8.1+) versions.
Along with changing the default, this change also removes explicit
requests for c11 via the CSTD variable in various Makefiles.
Libraries and binaries for ZFS continue to use c99.
PR: 284039 (exp-run)
Reviewed by: imp, arichardson, emaste
Differential Revision: https://reviews.freebsd.org/D43237
portal_group_add_listen already uses the default TCP port if no port
is specified so this was redundant.
Reviewed by: asomers
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48770
Similar to kernel SBI clean up patch, do clean up in userspace SBI part:
- use standard SBI error codes;
- remove unused function.
Differential Revision: https://reviews.freebsd.org/D48829
Apply 2e2b8afa52 for RISC-V:
As on amd64 and aarch64 APs will repeatedly exit until they are
brought online, so this hack helps avoid burning CPU time during
guest bootup.
Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D48811
Pass private data from supervisor as the second argument on secondary
CPU startup.
This is used by Linux guest.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D48807
Commit ac78e3e9c5 ("bsdinstall: Add "Finish" button to finalconfig")
removed the Exit entry from the menu, renamed OK to Select and added a
Finish in place of the old Exit entry. On the surface this seemed like a
good idea, as at a glance OK wasn't clear that it was selecting an entry
rather than just closing the box, Exit isn't the most obvious term
to use for proceeding through the installer without doing anything, and
it separated out the different cases of "do something extra" and
"continue". However, because bsddialog (and dialog) keep a menu entry
highlighted even when the Cancel (in this case, Finish) button is
selected, this now looks even more confusing, with users easily
believing that they are about to select the Add User option (being
either surprised when it doesn't actually do that, or being confused
about how to not select it).
Instead, go back to the old scheme that fits more with bsddialog's
supported functionality but tweak it to try and improve on the confusing
UI/UX from the past. Specifically, the UI changes compared with the
original version are as follows:
1. The OK button is renamed to Select, as in the current UI
2. The Exit entry is renamed to Finish, mirroring the label of the
button in the current UI that it replaces
This partially reverts commit ac78e3e9c5.
Reviewed by: khorben_defora.org
Differential Revision: https://reviews.freebsd.org/D47229
Historical network classes are deprecated, but currently still supported
in mountd with a LOG_WARNING-priority message added by Mike Karels in
2021. Upgrade the log to LOG_ERR well in advance of this becoming a
fatal error.
Reviewed by: rmacklem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48795
Sort options using the slightly unusual convention used here as well.
MFC after: 3 days
Approved by: carlavilla (mentor), imp (src)
Differential Revision: https://reviews.freebsd.org/D48800
Remove CPU clock-frequency property as incorrectly constructed
and not needed.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D48712
With all the recent changes we don't need extra argument that specifies
what exactly the syscalls does, neither we need a copyout-able pointer,
just a pointer sized integer.
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D48649
At normal NFS server runtime there is not much RPC traffic from kernel to
rpc.tlsservd. But as Rick rmacklem@ explained, the notion of multiple
workers exists to handle a situation when a server reboots and it has
several hundred or thousands of TLS/TCP connections from clients. Once it
comes back up, all the clients make TCP connections and do TLS handshakes.
So cleanup the remnants of the workers, that left after the conversion of
RPC over netlink(4) transport and restore desired parallelism with help of
pthread(3).
We are processing the TLS handshakes in separate threads, one per
handshake. Number of concurrent threads is capped by hw.ncpu / 2, but this
can be overriden with -N.
Differential Revision: https://reviews.freebsd.org/D48570
Since in the kernel and in the API this is now called socket cookie.
No functional change.
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D48777
Userland counterpart of the previous commit.
Note: this change intentionally ignores aspect of multiple workers of
rpc.tlsservd(8). This also will be addressed in a future commit.
Reviewed by: rmacklem
Differential Revision: https://reviews.freebsd.org/D48562