hwrm_req_dma_slice(9)
π hwrm_req_dma_slice(9) β the Kernel API Manual, bestie edition
okay so this is a page from the Kernel API Manual and honestly? it's a little gem. we're talking hwrm_req_dma_slice β yes the (9) means kernel API section, iykyk. let's get into it π
β¨ NAME β¨
hwrm_req_dma_slice β Allocate a slice of DMA mapped memory.
like, literally it hands you a lil piece of DMA mapped memory. a slice. π
πΈ SYNOPSIS πΈ
void * hwrm_req_dma_slice (struct bnxt *bp , void *req , u32 size ,
dma_addr_t *dma_handle );
that's the whole vibe check right there β¨
π ARGUMENTS π
bpβ The driver context. your home base πreqβ The request for which indirect data will be associated.sizeβ The size of the allocation. (yes bestie, how big π )dma_handleβ The bus address associated with the allocation. now listen, this one's got lore: the HWRM API has no knowledge about the type of the request and so cannot infer how the caller intends to use the indirect data. Thus, the caller is responsible for configuring the request object appropriately to point to the associated indirect memory. also β note, DMA handle has the same definition as it does indma_alloc_coherent, and the caller is responsible for endian conversions viacpu_to_le64before assigning this address. so like, don't just yeet it in there π
π¦ DESCRIPTION π¦
Allocates DMA mapped memory for indirect data related to a request. the way this works is the lifetime of the DMA resources is bound to that of the request (ie. they will be automatically released when the request is either consumed by hwrm_req_send or dropped by hwrm_req_drop). auto-cleanup, iconic, no notes π
so here's the tea: small allocations are efficiently suballocated out of the request buffer space β hence the name slice β while larger requests are satisfied via an underlying call to dma_alloc_coherent.
Multiple suballocations are supported, however, only one externally mapped region is. that's the rule, periodt π«Ά
β RETURN β
The kernel virtual address of the DMA mapping. that's what you get back, bestie β¨
π SEE ALSO π
- Kernel file
./drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c __hwrm_req_init(9),hwrm_req_timeout(9),hwrm_req_alloc_flags(9),hwrm_req_replace(9),hwrm_req_flags(9),hwrm_req_hold(9),hwrm_req_drop(9),hwrm_req_send(9),hwrm_req_send_silent(9)
the whole friend group fr fr π
and that's the page! π§
source sitch: ./drivers/net/ethernet/broadco... β dated October 2026. screenshot it, cite it, cite me, whatever π
π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms