What is NVM?
NVM provides persistent storage for configuration, state, diagnostics. Caller manages address space and layout. Read/write with checksums.
Quick Start
#define CONFIG_ADDR 0
#define CONFIG_SIZE 256
config_t cfg;
uint32_t crc = compute_crc((uint8_t *)&cfg, sizeof(cfg) - 4);
if (crc != cfg.checksum) {
log_error("Config corrupted");
use_default_config(&cfg);
}
cfg.checksum = compute_crc((uint8_t *)&cfg, sizeof(cfg) - 4);
rte_status_t rte_nvm_read(rte_nvm_handle_t handle, size_t offset, void *out_buffer, size_t buffer_size)
Reads and integrity-checks data from an NVM region.
rte_status_t rte_nvm_write(rte_nvm_handle_t handle, size_t offset, const void *buffer, size_t buffer_size)
Writes data and its integrity metadata to an NVM region.
Best Practices
- Always use checksums
- Manage wear (limit writes)
- Plan address layout
- Version data for evolution
See Also