From nobody Tue Apr 14 15:59:07 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fw8964w7Sz6Z2jX for ; Tue, 14 Apr 2026 15:59:22 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw8956vhTz3L27 for ; Tue, 14 Apr 2026 15:59:21 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; arc=pass ("google.com:s=arc-20240605:i=1"); dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=asomers@gmail.com Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-66d65646c65so2951844a12.1 for ; Tue, 14 Apr 2026 08:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776182360; cv=none; d=google.com; s=arc-20240605; b=CADisVFCwWDm34z2rp5fU5RPGxH80RXoOwl0YkKjoNDRjZoKlbu+Zr18uMNrL9WHcV gxDRJZbQ0yQynoqRn5sXQYVFBRHu4TCwNn1EYhxM6483tJARrCfiloP0Up5E/ZtzoZJ+ XlX+NlIJetndinQ9HC0BWPjmqv9nzJZd2PWDxfD77dd++VcSUx1JiOikGuNYJPnYmqrv NkEXyyeIwhc62MtLoRHdk7gOHajTL+eHaxxdG5HKfrQNcWyIUyT/Arid9+/LNDqKka7I mayq9dgOCBKipmFgJPNahZEUnXI88RBK9eOoU5O259ZrTsNfaulZ7ulbu5gqMFMrjsDS MHHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:subject:message-id:date:from :in-reply-to:references:mime-version; bh=jxf8/aEjDiN6rsg4Ncu9YJaPGBL6iHR77KBxNbLhgK4=; fh=cDjLFfI510m5ujMCgLSLRu6e/SHEBxod4BPYDO9Rwhk=; b=Uqnfuh5VUcMZXeof5/8pHPu5ebzikpLQPB0gioli/u53zOWXoiDmo2ITsIWJVUlsvJ mybwX245Nun8GTr6ZUuijtbyrs73E6U8A/DJbNSyAHaruzgZQA67T3Suc52FcR133tS2 5DJq0HgneQ27KQr71/GqdUAmgndG7TlqcWOZOYgXTlmCYhyyqsoEVcZWudpSYGNNGPoX KNU2bCagE6PQyoMZsf+N0OAAnTTGPUKB0uMpvXF/5lxHZISnZxIeNYfIpekbS3cORz9D CfAtN+jz16lh8pOkHlyDN8zL1mFvkLiovW13qxwdQ+cQLVEB3XplXcgq4nXnQvRHEdt2 uY4Q==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776182360; x=1776787160; h=content-transfer-encoding:cc:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jxf8/aEjDiN6rsg4Ncu9YJaPGBL6iHR77KBxNbLhgK4=; b=fUZROI5VX4OejVUygPccPx6N1fh7fyu2LmkHz2v27FxjtuHbwOBJ/a6AE/wbXwcTo/ wAPPmxrmMFjk6hZLbJtFvWq/O7afWC9lurRWLaq6yXV8PpS7QWAn4NLixYy8csSukIov 9OCokMq7Z06IhRy5CrH3olWVoEI7b51buDsYmD+dbAk6L1nmVnZcF4XMh4Pc9CgzgcQ/ q7dxXVPRdZwgSROFjcfZ8Oxv4huOZ9RnPsmLUlwk8huqnTgr2psHnH9K+eJm+QK40UXE u86xPaOVYnsomGqQigdYShF8bfSu1qeeH8ulfMRj3nH1XnRKuWiiuQPZq59nI3bjO+lF 6n/g== X-Forwarded-Encrypted: i=1; AFNElJ82NtVYps6fTEEVSNNqJwny8kb/GsWCne+tnYaYZCZWY72m3k3pjDft0ZWhgcuB1vpf9lF4+7aAggDiEc0HM4L+OUHFLA==@freebsd.org X-Gm-Message-State: AOJu0Yxtb7/6I2XwYkfCWWRGnhoHq49ElM90e5NMeElcGcMSI0PJ4dfx x/uaBqz2v6AlFltNjpyBims3nklRTIxhyVPYVcAORGIpypbPe/v7Osmbtbf11exKIi2jsmFeh7R JmpzC6s458mJ6CM9+Z2TOYigjkNg4eHDLT83o X-Gm-Gg: AeBDiesHBqojO8NYZaw0CbNPASA613pbQ2ScX/sgfqEF+UZrPaLUfiKSrFsSYF5zipf zFjtftH5ZFNV3PceHRgT52BKBAV0eANjfeFcI9mqk475eU5gUStPDrQIJZDG8hS+OpkpSkOQ2Eb 78WvNeD7XEFTy45TIzbjfpqmeZncdUntleOf3blDK+aV9jcXAUZeSCk24VFj9heXk6z56tzgg81 g0xPDwDcbMA+qUuxjQV2Lt3DgzDYBTZjp04ba48o9AzhlT/9mZw0gSMAAOJdPGP70GtR3JEF602 ZOxlfFz+knvSfVFKgD8a6/qtX0efgvCwlwogcTIPh9DJql5RQ4Enju25dJ4W/Jh2zho/e3LzAJ/ ntFk= X-Received: by 2002:a05:6402:454a:b0:66e:6f38:47ef with SMTP id 4fb4d7f45d1cf-670752ab0e7mt7007900a12.8.1776182360033; Tue, 14 Apr 2026 08:59:20 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202508062010.576KA2Mk062184@gitrepo.freebsd.org> <680f1cb7-f8f6-4d40-af31-83e2ea0205d6@FreeBSD.org> In-Reply-To: From: Alan Somers Date: Tue, 14 Apr 2026 09:59:07 -0600 X-Gm-Features: AQROBzDliuCRFuDXQt97Uw597qNeo5cx6cvNwLVliT9gCnYYi-4jf3hVBoLzrBY Message-ID: Subject: Re: git: 66b5296f1b29 - main - ctld: Add support for NVMe over Fabrics Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [0.11 / 15.00]; MISSING_TO(2.00)[]; ARC_ALLOW(-1.00)[google.com:s=arc-20240605:i=1]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_SPAM_LONG(1.00)[0.997]; NEURAL_HAM_SHORT(-0.99)[-0.990]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; TO_DN_SOME(0.00)[]; MISSING_XM_UA(0.00)[]; FREEFALL_USER(0.00)[asomers]; FREEMAIL_ENVFROM(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.46:from]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.46:from] X-Rspamd-Queue-Id: 4fw8956vhTz3L27 X-Spamd-Bar: / On Tue, Apr 14, 2026 at 6:35=E2=80=AFAM Alan Somers w= rote: > > On Tue, Apr 14, 2026 at 4:31=E2=80=AFAM John Baldwin wr= ote: > > > > On 4/13/26 13:36, Alan Somers wrote: > > > On Mon, Apr 13, 2026 at 10:56=E2=80=AFAM John Baldwin wrote: > > >> > > >> On 4/13/26 11:51, Alan Somers wrote: > > >>> On Wed, Aug 6, 2025 at 2:10=E2=80=AFPM John Baldwin wrote: > > >>>> > > >>>> The branch main has been updated by jhb: > > >>>> > > >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D66b5296f1b29083634e= 2875ff08c32e7b6b866a8 > > >>>> > > >>>> commit 66b5296f1b29083634e2875ff08c32e7b6b866a8 > > >>>> Author: John Baldwin > > >>>> AuthorDate: 2025-08-06 19:57:50 +0000 > > >>>> Commit: John Baldwin > > >>>> CommitDate: 2025-08-06 19:59:13 +0000 > > >>>> > > >>>> ctld: Add support for NVMe over Fabrics > > >>>> > > >>>> While the overall structure is similar for NVMeoF controller= s and > > >>>> iSCSI targets, there are sufficient differences that NVMe su= pport uses > > >>>> an alternate configuration syntax. > > >>>> > > >>>> - In authentication groups, permitted NVMeoF hosts can be al= lowed 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 "port= al-group" > > >>>> context for iSCSI. In this section, the "listen" keyword = accepts a > > >>>> transport as well as an address to permit other types of t= ransports > > >>>> 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 control= ler > > >>>> similar to the "target" context for iSCSI. One key differ= ence 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 > > >>> ... > > >>>> +struct target * > > >>>> +conf::add_controller(const char *name) > > >>>> +{ > > >>>> + if (!nvmf_nqn_valid_strict(name)) { > > >>>> + log_warnx("controller name \"%s\" is invalid for N= VMe", name); > > >>>> + return nullptr; > > >>>> + } > > >>>> + > > >>>> + /* > > >>>> + * Normalize the name to lowercase to match iSCSI. > > >>>> + */ > > >>>> + std::string t_name(name); > > >>>> + for (char &c : t_name) > > >>>> + c =3D tolower(c); > > >>> ... > > >>> > > >>> This makes it impossible to define an uppercase or mixed case targe= t > > >>> name in ctld. I guess the intent was to comply with rfc3722[^1]? > > >>> Even so, it's surprising, because such target names used to work. > > >>> It's also inconsistent, because it's still possible to create an > > >>> uppercase target name using ctladm directly, like this: > > >>> > > >>> ctladm port -c -d iscsi -O cfiscsi_portal_group_tag=3D257 -O > > >>> cfiscsi_target=3Diqn.2018-10.myhost:TESTVOL1 > > >>> > > >>> Should we warn the user if they specify an uppercase target name, o= r > > >>> even fail to create it? > > >>> > > >>> [^1]: https://datatracker.ietf.org/doc/html/rfc3722 > > >> > > >> Note that this function is for NVMe, not iSCSI. iSCSI targets are c= reated in > > >> conf::add_target which has similar code: > > >> > > >> struct target * > > >> conf::add_target(const char *name) > > >> { > > >> if (!valid_iscsi_name(name, log_warnx)) > > >> return (nullptr); > > >> > > >> /* > > >> * RFC 3722 requires us to normalize the name to lowercase. > > >> */ > > >> std::string t_name(name); > > >> for (char &c : t_name) > > >> c =3D tolower(c); > > >> > > >> Prior to the C++ commit, this change was already in place: > > >> > > >> struct target * > > >> target_new(struct conf *conf, const char *name) > > >> { > > >> struct target *targ; > > >> int i, len; > > >> > > >> targ =3D target_find(conf, name); > > >> if (targ !=3D NULL) { > > >> log_warnx("duplicated target \"%s\"", name); > > >> return (NULL); > > >> } > > >> if (valid_iscsi_name(name, log_warnx) =3D=3D false) { > > >> return (NULL); > > >> } > > >> targ =3D new target(); > > >> targ->t_name =3D checked_strdup(name); > > >> > > >> /* > > >> * RFC 3722 requires us to normalize the name to lowercase. > > >> */ > > >> len =3D strlen(name); > > >> for (i =3D 0; i < len; i++) > > >> targ->t_name[i] =3D tolower(targ->t_name[i]); > > >> > > >> targ->t_conf =3D conf; > > >> TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); > > >> > > >> return (targ); > > >> } > > >> > > >> This was present in commit 009ea47eb2d21856af4529aaaca32cd67748daea > > >> which brought in the iSCSI target, so it has always been present > > >> in ctld. > > >> > > >> Also, AFAICT, the names are still accepted, they are just normalized= . > > >> > > >> I guess one difference is that before, target_new() called target_fi= nd() > > >> with the non-normalized name to check for duplicates, and now we che= ck > > >> for duplicates after normalizing the name. I'm not sure how that wo= rked > > >> in the past in practice as you would have had two targets with the s= ame > > >> name (e.g. I wonder what the ctladm portlist output looked like for = this > > >> case and if it would have listed two ports with the same name)? I s= uspect > > >> that was more by accident and probably didn't work properly in pract= ice > > >> (e.g. the kernel handoff ioctl used the normalized name when invokin= g > > >> CTL_ISCSI, so connections to both "names" probably were always mappe= d to > > >> only one of the connections, and finding a port during login process= ing > > >> probably only found the first target, and only if the initiator gave= the > > >> all-lowercase name). > > >> > > >> That is to say, you didn't get an error before, but it didn't work, = and > > >> now it tells you that it doesn't work AFAICT. > > > > > > Excuse me, I spoke a little too soon. You are correct that ctld has > > > been converting target names to lower case before registering them in > > > the kernel for a long time. The change is that previously, if an > > > initiator attempted to connect to an uppercase target name, ctld woul= d > > > accept it. That's because port_find_in_pg used strcasecmp in > > > stable/14. But change 4b1aac931465f39c5c26bfa1d5539a428d340f20 > > > removed strcasecmp, replacing it by the C++ STL's find method on > > > std::unordered_map. > > > > > > So we used to accept connections case-insensitively, and now we accep= t > > > them case-sensitively. To restore the previous behavior, should we > > > add tolower() on the target_name in iscsi_connection::login() ? > > > > Yes, we should normalize there, and that indeed is my fault and warrant= s > > a Fixes tag. > > > > -- > > John Baldwin > > Ok. I'll take care of it. FYI, I opened this bug, just so other users can find the issue. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D294522