Re: git: 66b5296f1b29 - main - ctld: Add support for NVMe over Fabrics

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 06 Aug 2025 20:23:37 UTC
On 8/6/25 16:10, John Baldwin wrote:
> The branch main has been updated by jhb:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=66b5296f1b29083634e2875ff08c32e7b6b866a8
> 
> commit 66b5296f1b29083634e2875ff08c32e7b6b866a8
> Author:     John Baldwin <jhb@FreeBSD.org>
> AuthorDate: 2025-08-06 19:57:50 +0000
> Commit:     John Baldwin <jhb@FreeBSD.org>
> CommitDate: 2025-08-06 19:59:13 +0000
> 
>      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

The config file (UCL) I used for most of my testing looks something like
this (some settings omitted and names changed, etc.).  It creates two LUNs
that are exported by both iSCSI and NVMeoF (so you can access the same
disk via either protocol).

portal-group {
	pg0 {
		discovery-auth-group = no-authentication
		listen = [
			0.0.0.0,
			"[::]"
		]
		offload = cxgbei
	}
}

lun {
	zvol {
		path /dev/zvol/bhyve/iscsi
		size 4GB
	},
	ramdisk {
		backend ramdisk
		size 1G
		option capacity 1G
	}
}

target {
        "iqn.2001-03.com.example:myhost0" {
		auth-group = no-authentication
		portal-group = pg0
		lun {
			0 = zvol,
			1 = ramdisk
		}
	}
}

controller {
	"nqn.2001-03.com.example:myhost0" {
		auth-group = no-authentication
		namespace {
			1 = zvol,
			2 = ramdisk
		}
	}
}

-- 
John Baldwin