| #
66b5296f
|
| 06-Aug-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Add support for NVMe over Fabrics
While the overall structure is similar for NVMeoF controllers and iSCSI targets, there are sufficient differences that NVMe support uses an alternate configur
ctld: Add support for NVMe over Fabrics
While the overall structure is similar for NVMeoF controllers and iSCSI targets, there are sufficient differences that NVMe support uses an alternate configuration syntax.
- In authentication groups, permitted NVMeoF hosts can be allowed by names (NQNs) via "host-nqn" values (similar to "initiator-name" for iSCSI). Similarly, "host-address" accepts permitted host addresses similar to "initiator-portal" for iSCSI.
- A new "transport-group" context enumerates transports that can be used by a group of NVMeoF controllers similar to the "portal-group" context for iSCSI. In this section, the "listen" keyword accepts a transport as well as an address to permit other types of transports besides TCP in the future. The "foreign", "offload", and "redirect" keywords are also not meaningful and thus not supported.
- A new "controller" context describes an NVMeoF I/O controller similar to the "target" context for iSCSI. One key difference here is that "lun" objects are replaced by "namespace" objects. However, a "namespace" can reference a named global lun permitting LUNs to be shared between iSCSI targets and NVMeoF controllers.
NB: Authentication via CHAP is not implemented for NVMeoF.
Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48773
show more ...
|
| #
e01fe14c
|
| 04-Aug-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Make config file parsing exception safe
Split parse_conf in half keeping yyparse_conf as C-only function in parse.y. parse_conf uses freebsd::FILE_up to ensure that the config file is always
ctld: Make config file parsing exception safe
Split parse_conf in half keeping yyparse_conf as C-only function in parse.y. parse_conf uses freebsd::FILE_up to ensure that the config file is always closed.
Both parse_conf and uclparse_conf catch any exceptions thrown during parsing. This is in preparation for using C++ objects allocated with new for various data structures.
Note that this treats memory allocation failures from new as parsing errors rather than ctld exiting entirely as it currently does if malloc or calloc fail.
Sponsored by: Chelsio Communications Pull Request: https://github.com/freebsd/freebsd-src/pull/1794
show more ...
|
| #
2e0caa7c
|
| 02-Aug-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
libutil: Really fix expand_number(3)
It is unclear whether this function was originally intended to support negative numbers. The original implementation used signed integers, but actually giving i
libutil: Really fix expand_number(3)
It is unclear whether this function was originally intended to support negative numbers. The original implementation used signed integers, but actually giving it a negative number as input would have invoked undefined behavior, and the comments (since removed) only mentioned positive numbers. Fifteen years ago, I “fixed” this by changing the type from signed to unsigned. However, it would still have accepted an input with a leading minus sign (though it would have returned its absolute value). Fifteen years on, change the type back to signed and fix the logic so it correctly handles both positive and negative numbers without invoking undefined behavior. This makes it a better match for humanize_number(3), which it is supposed to complement.
Fixes: bbb2703b4f46 Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51542
show more ...
|
| #
d42a73fb
|
| 26-Feb-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Add a dedicated API between parse.y and the rest of the program
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 co
ctld: Add a dedicated API between parse.y and the rest of the program
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
show more ...
|
| #
6de7a0d6
|
| 12-Feb-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Consistently free temporary strings during yacc parsing
The lexer always allocates a duplicate string via strdup for STR tokens. The parse handlers did not always free these duplicated string
ctld: Consistently free temporary strings during yacc parsing
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
show more ...
|
| #
450a84c2
|
| 12-Feb-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Some bool-related cleanups
- 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 e
ctld: Some bool-related cleanups
- 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
show more ...
|
| #
703b03a8
|
| 30-Jan-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Use nvlist instead of home-rolled name-value lists
Reviewed by: asomers (older version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48595
|
| #
237e9b7f
|
| 18-Jan-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Trim trailing whitespace
Sponsored by: Chelsio Communications
|
| #
969876fc
|
| 10-Jun-2024 |
Alan Somers <asomers@FreeBSD.org> |
ctld: parse config file independently of getting kernel info
Separate the parsing of the config file from the reading of kernel port information. This has three benefits:
* Separation of concerns
ctld: parse config file independently of getting kernel info
Separate the parsing of the config file from the reading of kernel port information. This has three benefits:
* Separation of concerns makes future changes easier. * Allows the config file to be read earlier, which is necessary for fixing PR 271460. * Reduces total line count, by eliminating duplication between parse.y (for traditional config file) and uclparse.c (for UCL config file).
MFC after: 2 weeks Sponsored by: Axcient Reviewed by: mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1287
show more ...
|
| #
b3e76948
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| #
4d846d26
|
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
| #
e72a100b
|
| 01-Nov-2020 |
Adrian Chadd <adrian@FreeBSD.org> |
[ctld] Fix compilation under gcc-6.4
* remove dup yylex symbol; already defined in a header file * uint64_t is always >= 0
Reviewed by: cem, imp Differential Revision: https://reviews.freebsd.org/D
[ctld] Fix compilation under gcc-6.4
* remove dup yylex symbol; already defined in a header file * uint64_t is always >= 0
Reviewed by: cem, imp Differential Revision: https://reviews.freebsd.org/D27046
show more ...
|
| #
bce7ee9d
|
| 28-Oct-2020 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
Drop "All rights reserved" from all my stuff. This includes Foundation copyrights, approved by emaste@. It does not include files which carry other people's copyrights; if you're one of those peopl
Drop "All rights reserved" from all my stuff. This includes Foundation copyrights, approved by emaste@. It does not include files which carry other people's copyrights; if you're one of those people, feel free to make similar change.
Reviewed by: emaste, imp, gbe (manpages) Differential Revision: https://reviews.freebsd.org/D26980
show more ...
|
| #
ea8f1280
|
| 24-Oct-2020 |
Richard Scheffenegger <rscheff@FreeBSD.org> |
Add network QoS support for PCP to iscsi target.
Mak the Ethernet PCP codepoint configurable for L2 local traffic, to allow lower latency for iSCSI block IO. This addresses the target side only.
Re
Add network QoS support for PCP to iscsi target.
Mak the Ethernet PCP codepoint configurable for L2 local traffic, to allow lower latency for iSCSI block IO. This addresses the target side only.
Reviewed by: mav, trasz, bcr Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26740
show more ...
|
| #
64ffe6d4
|
| 27-Sep-2020 |
Richard Scheffenegger <rscheff@FreeBSD.org> |
Add DSCP support for network QoS to iscsi target.
In order to prioritize iSCSI traffic across a network, DSCP can be used. In order not to rely on "ipfw setdscp" or in-network reclassification, this
Add DSCP support for network QoS to iscsi target.
In order to prioritize iSCSI traffic across a network, DSCP can be used. In order not to rely on "ipfw setdscp" or in-network reclassification, this adds the dscp value directly to the portal group (where TCP sessions are accepted).
The incoming iSCSI session is first handled by ctld for any CHAP authentication and the socket is then handed off to the in-kernel iscsi driver without modification of the socket parameters. Simply setting up the socket in ctld is sufficient to keep sending outgoing iSCSI related traffic with the configured DSCP value.
Reviewed by: mav, trasz MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26385
show more ...
|
| #
66b5296f
|
| 06-Aug-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Add support for NVMe over Fabrics
While the overall structure is similar for NVMeoF controllers and iSCSI targets, there are sufficient differences that NVMe support uses an alternate configur
ctld: Add support for NVMe over Fabrics
While the overall structure is similar for NVMeoF controllers and iSCSI targets, there are sufficient differences that NVMe support uses an alternate configuration syntax.
- In authentication groups, permitted NVMeoF hosts can be allowed by names (NQNs) via "host-nqn" values (similar to "initiator-name" for iSCSI). Similarly, "host-address" accepts permitted host addresses similar to "initiator-portal" for iSCSI.
- A new "transport-group" context enumerates transports that can be used by a group of NVMeoF controllers similar to the "portal-group" context for iSCSI. In this section, the "listen" keyword accepts a transport as well as an address to permit other types of transports besides TCP in the future. The "foreign", "offload", and "redirect" keywords are also not meaningful and thus not supported.
- A new "controller" context describes an NVMeoF I/O controller similar to the "target" context for iSCSI. One key difference here is that "lun" objects are replaced by "namespace" objects. However, a "namespace" can reference a named global lun permitting LUNs to be shared between iSCSI targets and NVMeoF controllers.
NB: Authentication via CHAP is not implemented for NVMeoF.
Reviewed by: imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48773
show more ...
|
| #
e01fe14c
|
| 04-Aug-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Make config file parsing exception safe
Split parse_conf in half keeping yyparse_conf as C-only function in parse.y. parse_conf uses freebsd::FILE_up to ensure that the config file is always
ctld: Make config file parsing exception safe
Split parse_conf in half keeping yyparse_conf as C-only function in parse.y. parse_conf uses freebsd::FILE_up to ensure that the config file is always closed.
Both parse_conf and uclparse_conf catch any exceptions thrown during parsing. This is in preparation for using C++ objects allocated with new for various data structures.
Note that this treats memory allocation failures from new as parsing errors rather than ctld exiting entirely as it currently does if malloc or calloc fail.
Sponsored by: Chelsio Communications Pull Request: https://github.com/freebsd/freebsd-src/pull/1794
show more ...
|
| #
2e0caa7c
|
| 02-Aug-2025 |
Dag-Erling Smørgrav <des@FreeBSD.org> |
libutil: Really fix expand_number(3)
It is unclear whether this function was originally intended to support negative numbers. The original implementation used signed integers, but actually giving i
libutil: Really fix expand_number(3)
It is unclear whether this function was originally intended to support negative numbers. The original implementation used signed integers, but actually giving it a negative number as input would have invoked undefined behavior, and the comments (since removed) only mentioned positive numbers. Fifteen years ago, I “fixed” this by changing the type from signed to unsigned. However, it would still have accepted an input with a leading minus sign (though it would have returned its absolute value). Fifteen years on, change the type back to signed and fix the logic so it correctly handles both positive and negative numbers without invoking undefined behavior. This makes it a better match for humanize_number(3), which it is supposed to complement.
Fixes: bbb2703b4f46 Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D51542
show more ...
|
| #
d42a73fb
|
| 26-Feb-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Add a dedicated API between parse.y and the rest of the program
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 co
ctld: Add a dedicated API between parse.y and the rest of the program
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
show more ...
|
| #
6de7a0d6
|
| 12-Feb-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Consistently free temporary strings during yacc parsing
The lexer always allocates a duplicate string via strdup for STR tokens. The parse handlers did not always free these duplicated string
ctld: Consistently free temporary strings during yacc parsing
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
show more ...
|
| #
450a84c2
|
| 12-Feb-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Some bool-related cleanups
- 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 e
ctld: Some bool-related cleanups
- 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
show more ...
|
| #
703b03a8
|
| 30-Jan-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Use nvlist instead of home-rolled name-value lists
Reviewed by: asomers (older version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D48595
|
| #
237e9b7f
|
| 18-Jan-2025 |
John Baldwin <jhb@FreeBSD.org> |
ctld: Trim trailing whitespace
Sponsored by: Chelsio Communications
|
| #
969876fc
|
| 10-Jun-2024 |
Alan Somers <asomers@FreeBSD.org> |
ctld: parse config file independently of getting kernel info
Separate the parsing of the config file from the reading of kernel port information. This has three benefits:
* Separation of concerns
ctld: parse config file independently of getting kernel info
Separate the parsing of the config file from the reading of kernel port information. This has three benefits:
* Separation of concerns makes future changes easier. * Allows the config file to be read earlier, which is necessary for fixing PR 271460. * Reduces total line count, by eliminating duplication between parse.y (for traditional config file) and uclparse.c (for UCL config file).
MFC after: 2 weeks Sponsored by: Axcient Reviewed by: mav Pull Request: https://github.com/freebsd/freebsd-src/pull/1287
show more ...
|
| #
b3e76948
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|