From nobody Fri Jun 6 01:41:23 2025 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 4bD3v82hzKz5xDn8; Fri, 06 Jun 2025 01:41:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bD3v81byPz4BvC; Fri, 06 Jun 2025 01:41:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749174084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9uRtvQT2nEUJzzNp30g8PWcU1VUV1s7ZvLsW5OYNTwc=; b=k8a/Aqk+cpY7/PhJQtJrMtpdyBU5RSUsljUi56E81LZ3jNSjgQfXrb5Ny9NK5Lhtj4bJoP J4ZbkeLG3cnh8/8xLfNFPxawACAr1v/f2IRMVbxGqpK9xURtqosL85RVtMRQHHuGgx+6fw RcKJDNRJqC3shuoP8KAYaSrkUfbuILrasgpJyApoOnXPDLlcV1VYYuODP2uZ4YZMNN5mmW i51+3WFl9Y327Zdkpp6pwaMvjIBORPj/i5ByDu2tcdl6Px/9WKZq5f9kAtK39T53arM4o/ mocUQ10Qb9/GwMsrcOYR6/CihmxFJxQY+cO2CwDzzEAZeYWyC5prpyD5A44N7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749174084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9uRtvQT2nEUJzzNp30g8PWcU1VUV1s7ZvLsW5OYNTwc=; b=sgInFOGBBZ6JyOkzLxSt+2IlAOV0B2AvBLtP/BzeBYAZui+rqMfM4oAFiB6uVOiDd2BQdS mAD5pRib8sSayRj7rP2GH0eHWhCW60JJyzculhcE53PJidobJkttuCkC6+NvpRJzFQnuQd knGpRYr9aD32f14dlS/Wuu/ZyhsaRDN9DDvhRHtYwrJLWbvUhodvkvKJ3bYMq30yu9Q7P4 wWy4DpRLzlx/imkBo60kNwwd8h4zmDZ0npN30j93VRM79IJnpqFSwldXS7jID161pDOkQR HLTjO4ksZ2g4bQKHqqw0TbnhmWlkVApaGAh4yPCpeYFskziLfVLq+kv6s2UuAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749174084; a=rsa-sha256; cv=none; b=bOA1NKDPOekKkFhGuJUbz/nn8WOJy9yJMXM428e8F25od4hT4IUn3BM1t2vt+bDhJBbAAL c8zeopGx1XzaLdONfQkDqqQXllQJQfxIdeB6niIrjr8McwJsUA+DgMJHz0VftqJ851nIH1 9XcGX2AwGGBdIdIGHNuLLX/wG17ARxoHg1ZRc8vrv+VvVKTZ1vTuq0NchMNZD2VMhwvnfC PaIYr8mrc3LxCAndRelgrfqCxOCVLjHbEGgZY7M09vM9ERufmbyCYXF4Si3NjX23PZvSR4 dcAeDzzpwKIQh98WZ1hKneK6EyvzoxYJZMeCFdG5NPCIpcbv5TqlGzsN3VE/uQ== Received: from [IPV6:2601:5c0:4200:b830:a1dc:a233:e9a8:3ed1] (unknown [IPv6:2601:5c0:4200:b830:a1dc:a233:e9a8:3ed1]) (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 did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4bD3v76d6yz6ZV; Fri, 06 Jun 2025 01:41:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Thu, 5 Jun 2025 21:41:23 -0400 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 User-Agent: Mozilla Thunderbird Subject: Re: git: 7b3ee39e73af - main - libcam: Include nvme opcode and status code routines from nvme_util.c Content-Language: en-US From: John Baldwin To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202506060132.5561Wakc094185@gitrepo.freebsd.org> In-Reply-To: <202506060132.5561Wakc094185@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/5/25 21:32, John Baldwin wrote: > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=7b3ee39e73af36f49f471f7900baeb98ac3504d0 > > commit 7b3ee39e73af36f49f471f7900baeb98ac3504d0 > Author: John Baldwin > AuthorDate: 2025-06-06 01:28:38 +0000 > Commit: John Baldwin > CommitDate: 2025-06-06 01:28:38 +0000 > > libcam: Include nvme opcode and status code routines from nvme_util.c > > libcam in userspace also includes nvme_all.c which now depends on > nvme_util.c, so add nvme_util.c to libcam's sources. This requires > exporting the opcode and status code routines in nvme_util.c to > userspace as well as the kernel. In turn, this means nvmecontrol now > depends on libsbuf (which is already present in /lib). > > Reported by: viswhin, Jenkins > Fixes: 60159a98a837 ("nvme: Move opcode and status code tables from base CAM to nvme_util.c") > Sponsored by: Chelsio Communications This fixes the build for now (and sorry for breaking it). However, this raises a few questions for me at least. Why does libcam include nvme_all.c at all? We don't document any of the nvme_* functions in cam(3), nor any of the functions from scsi_all.c, smp_all.c, etc. This seems really odd, and it also means that we can add (and remove!) symbols from libcam without realizing it by changing sys/cam//_all.h which is not very obvious. It seems to me that we should be more intentional about which symbols we export from libcam. Switching to symbol versioning (which implicitly enforces hidden visibility on all symbols not explicitly exported) would keep us from leaking symbols into the ABI of libcam that we don't intend to export. I also wonder if we can remove some of the *_all.c files from libcam entirely? None of the nvme_* ones are used outside of the kernel in the base system for example. -- John Baldwin