libnvme: move fabrics-only helpers to util-fabrics.c#3301
Merged
igaw merged 1 commit intolinux-nvme:masterfrom Apr 21, 2026
Merged
libnvme: move fabrics-only helpers to util-fabrics.c#3301igaw merged 1 commit intolinux-nvme:masterfrom
igaw merged 1 commit intolinux-nvme:masterfrom
Conversation
d5782a1 to
a0e0151
Compare
igaw
reviewed
Apr 21, 2026
igaw
reviewed
Apr 21, 2026
igaw
reviewed
Apr 21, 2026
libnvmf_exat_ptr_next(), libnvmf_getifaddrs() (renamed from libnvme_getifaddrs()), and the libnvmf_exat_len()/libnvmf_exat_size() static inlines (renamed from nvmf_exat_len()/nvmf_exat_size()) are only meaningful in fabrics-capable builds. Moving them out of util.c and private.h into util-fabrics.c and private-fabrics.h keeps the fabrics footprint contained and ensures PCIe-only/embedded builds do not pull in this code. util-fabrics.c is compiled only when want_fabrics is set, which implies CONFIG_FABRICS is always defined, so no guard is needed around libnvmf_getifaddrs() in that file. While at it, simplify the util.c include guard from: #if defined(HAVE_NETDB) || defined(CONFIG_FABRICS) to: #ifdef HAVE_NETDB since CONFIG_FABRICS was only needed for libnvme_getifaddrs(), which is now in util-fabrics.c. Signed-off-by: Martin Belanger <Martin.Belanger@dell.com> Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
a0e0151 to
3df9122
Compare
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
libnvmf_exat_ptr_next()andlibnvme_getifaddrs()were compiled unconditionally even in PCIe-only/embedded builds that disable the fabrics layer. This patch moves them to a newutil-fabrics.cwhich is only compiled whenwant_fabricsis set (inmeson.build).libnvme_getifaddrs()is renamed tolibnvmf_getifaddrs()to reflect that it is a fabrics-only function (consistent with thelibnvmf_prefix convention).nvmf_exat_len()andnvmf_exat_size()static inlines, along with thelibnvmf_getifaddrs()declaration, are moved fromprivate.htoprivate-fabrics.hfor the same reason.util.cis simplified from#if defined(HAVE_NETDB) || defined(CONFIG_FABRICS)to#ifdef HAVE_NETDBnow thatCONFIG_FABRICSis no longer needed there.This is low-hanging fruit — a small, self-contained first step toward a cleaner fabrics/PCIe separation. More work is needed in
tree.c, which still contains several#ifdef CONFIG_FABRICSblocks (TCP-specific match functions,libnvme_iface_matching_addr(), etc.) that belong in a futuretree-fabrics.c. That follow-up is more invasive and will be handled separately.Test plan
meson setup .build && meson compile -C .buildmeson setup .build -Dfabrics=disabledmeson test -C .build