hwrm_req_dma_slice(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 in dma_alloc_coherent, and the caller is responsible for endian conversions via cpu_to_le64 before 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 🌈

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