From nobody Fri Jun 6 02:21:30 2025 X-Original-To: dev-commits-src-all@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 4bD4nm1psTz5xHgJ for ; Fri, 06 Jun 2025 02:21:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) (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 4bD4nl6C31z3V1g for ; Fri, 06 Jun 2025 02:21:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-22e09f57ed4so25768915ad.0 for ; Thu, 05 Jun 2025 19:21:47 -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=ZEqvGcAMTO7jRMVz2Kb4OHGw3tjvxeBThlApLWjEypX0KGff2RdLV8mfjDUjkzEceB gdVgXMPozjsoTVJZCv0LJxT1bX3eBtvw1gVbWE9QS3734kndYK5++63l66lRhbVepMyW 9pbSN90KRiHlFPn8sfb2ZlIXa3wvVA1c6bg5JIev22VddfJ8EsN5RG1vDxGWbPhetjUk FDoGu55ERZ7kKGkpEfM/ow9Jh7ATa/3ezDhAo2d10x/Zgx0X6Isy1SZ9zn2P3ZtRVHMO xYJ4HJ5lyz1AxP8JBNDpVdFKJw2ejRHcnX3AY9da9bCH5I1UfMnF9k3dhr3W/ZBpVG8Q zMdg== X-Forwarded-Encrypted: i=1; AJvYcCWUla0k2gVR3rF6wAC/SrVzHNvzQO6VyzzlJZC1zSRmfFHJ3AnL+c40lcCEI+fEGftUMTPoxsejWf2Da9PcL4Q8Cpls@freebsd.org X-Gm-Message-State: AOJu0Yw5YMnoje2XqfilovDF6041hOyHj3awh/tzA2ZDvxELEGgcaWTk Yrv+0yQWYnrbrExaYvTjD+ykveNvoqXMZR3emPqhZ1ggEFynr1s7JYp63MmAZ0LgNhMCmmBEUO1 /gLPBwUKtUkTUSKL7MOFhKvifCPldSFb+2aTQA/Ls18JXtx7iTghnbWg= X-Gm-Gg: ASbGncvvAIEnIfxZtBJXC1kaH0WcG2lox0Dm1ChOxJo7nnAee0D7RAlMNdizuoEBSrx ueqKQNvPobkdbexXhv5ZyKstol1RtUbmG186fgh3k3mugLYyWQHwTSYV98IDcLrIic4USkOav5S P5f4+qFB6Rd9Lc6u6QW8fnnPT1maa0vDGd9YBK80+S3guE92DiWAI3H0JJGeYEpW6a 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 all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 4bD4nl6C31z3V1g 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