Skip to content

NBFT API overhaul#3583

Open
tbzatek wants to merge 7 commits into
linux-nvme:masterfrom
tbzatek:3.0-nbft-api-1
Open

NBFT API overhaul#3583
tbzatek wants to merge 7 commits into
linux-nvme:masterfrom
tbzatek:3.0-nbft-api-1

Conversation

@tbzatek

@tbzatek tbzatek commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

This is a sync of the Boot Specification rev. 1.3 into nvme-types-nbft.h and the nbft.h parser API.

  • ditched the parsed bools in favour of untranslated flags bitfields - a futureproof approach since nbft.h don't include any reserved fields
  • updated the Python interface file to follow the flags instead of bools
  • in contrast the nvme nbft show JSON output preserves all the original bool flags to maintain compability with dracut
  • the DHCP DUID fields are tough to swallow as these are composite and variable values, I still wanted to provide human readable representation in the JSON output; the parser API provides original bytes though
  • added Security Descriptor parser API without actual parser implementation, as agreed on the last Timberland SIG call - added only to avoid breaking stable API in the future, follows actual rev. 1.3. spec pretty closely

Assisted by Claude, it's surprisingly easy to let it craft synthetic binary NBFT table for testing, if needed.

Cc: @mwilck @stuarthayes @martin-belanger @johnmeneghini @MichaelRabek

tbzatek added 5 commits July 15, 2026 18:44
Update the raw ACPI NBFT C type definitions to match the NVM Express
Boot Specification Revision 1.3. Changes include:

- nbft_hfi_info_tcp: hfi_ext_info, pcie_seg_num
- Add NBFT_HFI_INFO_TCP_IPADDR_AUTOCONF
- Add struct nbft_hfi_info_ext (descriptor type Ah) for HFI Transport
  Info Extended Information
- Add enum nbft_hfi_info_ext_flags (VALID, DCI)
- Extend struct nbft_ssns_ext_info with naed, cipeec, cto, nceec
- Add enum nbft_ssns_ext_info_naed
- Add enum nbft_ssns_ext_info_cipeec
- Add enum nbft_ssns_ext_info_nceec

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
Update the NBFT parser to handle both revision 1.0 and 1.1 NBFT files,
and extend the convenient API with fields added in Boot Spec rev. 1.3.

All new fields default to zero for rev. 1.0 NBFT data files.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
Replace individual bool struct members in the nbft.h public API with
raw enum bitmask fields that reuse existing enums from nvme-types-nbft.h.
This prevents ABI breakage when future Boot Specification revisions add
new flags to existing enums.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
Update nbft-dump.c to print all struct members from nbft.h and
regenerate all test diffs.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
Update nvme.i to mirror the C API: expose raw flags instead of
decoded bools.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
tbzatek added 2 commits July 15, 2026 19:00
Update the JSON output with added fields while preserving the
decoded bools from the old API to avoid breaking the format.

Took the liberty to fully parse the DHCP DUID identifiers into
individual JSON keys.

Not all JSON keys are printed all the time, those not applicable
either due to an older NBFT file revision or optional and
not present are not printed out.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
While we're intentionally not going to support Security Descriptors
yet, the public API needs to be finalized before it gets stabilized
and frozen for libnvme-3.0.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
@igaw

igaw commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

From a quick glance it looks good. Does every patch for itself compile? I think I saw code refactoring which will break the build, e.g. this_hfi_is_default_route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants