From nobody Fri Jun 6 02:21:30 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 4bD4ng4Ntsz5xHR4 for ; Fri, 06 Jun 2025 02:21:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 4bD4nf72grz3Thx for ; Fri, 06 Jun 2025 02:21:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2350fc2591dso13451135ad.1 for ; Thu, 05 Jun 2025 19:21:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749176502; x=1749781302; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=FE/me4thOf8JgbFdqwLI/X3ybfMCCBOsmcOr9Abr4Rc=; b=u/l63Sja6gJAvdy2ot3yn7YkAkdHsy8dWgpxu/pBHgUCj18NkW7Cz4pQ0A/gzMVwRc FB1y1tH8+KRwYqUyKqyRep0JEAvT4d0faRjYyvTvMstnDgSJbptEbFQLYj+HCHczGsRS QdNkv24V3D6SgMvkPto6qpxigqJLgSQSHNgO4XvENIIFKdUv/haPHHgHxm3HP5bZ/XSj HJYEDATcaMAAA/4hX0hJE50ZMrtpI7po97C57gO6d3P/fc/CRobAR/xWH3+fVwdaOhL4 5YMEZGezjua0lot9HAbXVgb1/YwX9vPOY8Yzd29yf8nN1kY0i9n9qumuIWoQdo6qC4Cw 0Y1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749176502; x=1749781302; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FE/me4thOf8JgbFdqwLI/X3ybfMCCBOsmcOr9Abr4Rc=; b=ixewpe0eKus+rYIoxSJJAiDd/baDu8cMbS8Tu+4ZrytcRnYdwZ8ePQaeFiYmtq1ZDH VcZ+nBonRz0cOgZsNnNIyI2qaq2eucUbdq6CWMGT/kfxwF9I/Ab6rnJqSnl50veWqsA0 uXvn2S11o6GzLdo1OyUEAWl1ymiV+G8Rkkc93h8qmhTX1j0JiEfzKFIrGm1Kr+VJBXJp Khl4vwLZDWzJtTxFPdqElzZuitgpwuWeWr540n2GUYcvcnUWS4cHHRcBWw2Ys8HKi1PN oqo4j2ucR0RW8HGoR3Y9cRl74r319vISHRpQc5fHfqVfTXgPnc83z+L5xjwmTTaufHj2 oFQA== X-Forwarded-Encrypted: i=1; AJvYcCWANmsu+ZE4+tJZye20IfO5/f7QTUmyrpCc8ugEDc/QHwHSZmAjgSac3zCpLqNrUCvH8Q+HgwLEWu4E6rfUOh2jKszk9Q==@freebsd.org X-Gm-Message-State: AOJu0Yx1CvOMNqyQjNp4WRKTkD9NpcVpFd5AJmlbKfwHQ72JBu4VxtmA Wyka8LObxR531NM3xycMXjyKR17qg8ldrL6DLH4XDK0mmVwul0T0EYvrbk1oIrw7xqs/GC1ctCK yVeo3WzVDLt6kcDU5sUDsWBb+TKtyCujtO/I9sHqCrw== X-Gm-Gg: ASbGncv9Y7ehzuUUdpXNYMqAHFF0sf4tIsQXvc8iNfIHVRXGlGeS6MGaLwRtS2SzsVg lrKI3flkdWzNqjr7b9mlNObuoRwmnKNZ6k2FX3gLlrzjqtzjF4GqHblz5g8GxBDp+8YR2XQjw5a jzuhYVbZme6Oa92+o9siIK+2IYcTBMfO2BG1RbC/I/r1TtkmPd+EBaSVAYJb7XJQ4w X-Google-Smtp-Source: AGHT+IGFPPZ+OWqZG4Iyl76CgIfZO4Nbp+iQHulvISvF7+iJZp13EJLvqMvDcbMwLh4VLCLk2G23aeiIlZyfrQBIhVc= X-Received: by 2002:a17:903:22cf:b0:231:c89f:4e94 with SMTP id d9443c01a7336-23603a5d4d0mr11336645ad.21.1749176501616; Thu, 05 Jun 2025 19:21:41 -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: <202506060132.5561Wakc094185@gitrepo.freebsd.org> In-Reply-To: From: Warner Losh Date: Thu, 5 Jun 2025 20:21:30 -0600 X-Gm-Features: AX0GCFs0MJB1I_WUtrogsyAkPdNqz-Qnhb4Ew9rAs8jYQ74OyoGKLxKoFmrEr-A Message-ID: Subject: Re: git: 7b3ee39e73af - main - libcam: Include nvme opcode and status code routines from nvme_util.c To: John Baldwin Cc: 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-Rspamd-Queue-Id: 4bD4nf72grz3Thx X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] On Thu, Jun 5, 2025 at 7:41=E2=80=AFPM John Baldwin wrote= : > > 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=3D7b3ee39e73af36f49f471f79= 00baeb98ac3504d0 > > > > 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_uti= l.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 require= s > > 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 t= ables 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 witho= ut > 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. No. We can't remove all that. They are used by camcontrol, ddcam and others. We use the functions in *_all.h/c functions to populate the CCBs to send down into the kernel. I think that we need a different take on it. It is, after all, basically designed in FreeBSD 3 timeframe when such considerations were the furthest thing from the minds of the developers. Times have changed, though, and libcam hasn't with it. We don't document it very well... Sometimes I've thought we should make libcam a private library. But I don't know who all uses it in raw mode. I think about a dozen ports use this for things like smart reporting... Warner