__hwrm_req_init(9)
π __hwrm_req_init(9) β like, the HWRM request glow-up era begins
okay bestie, grab your matcha π΅ because this is a Kernel API Manual page and it's honestly kind of iconic. We're in __hwrm_req_init territory, aka the function that sets your HWRM request up so it can actually slay later. No cap.
β¨ SYNOPSIS β¨
int __hwrm_req_init (struct bnxt *bp , void **req , u16 req_type , u32 req_len );
that's the whole vibe. four args, one int coming back at you π«Ά
π ARGUMENTS π
bpβ the driver context. your main character struct, fr.reqβ a pointer to the request pointer you're initializing. yes, a pointer to a pointer, we love a double-pointer moment πreq_typeβ the request type. heads up: this gets converted to little endian before it's written to thereq_typefield of the request you get back. so don't come for it later asking why it looks different πreq_lenβ the length of the request to be allocated. size matters, lowkey.
π¦ DESCRIPTION π¦
So what actually happens? This bad boy allocates DMA resources and initializes a brand-new HWRM request object of the type you passed in. It's giving construction era. ποΈ
The response address field in the request gets configured with the DMA bus address that's been mapped for the response, and the request pointer you passed in gets pointed at kernel virtual memory mapped for the request β which is literally so that short_input indirection can be accomplished without copying. the way that saves a copyβ¦ obsessed. πβ¨
The request's target and completion ring are initialized to default values, and you can override them by writing to the returned request object directly. your request, your rules.
You can also customize the initialized request further by writing to its fields directly β just take care to convert such fields to little endian, okay? don't embarrass us. π«Ά
Now the important part, listen up:
The request object will be consumed (and all its associated resources released) when you pass it tohwrm_req_sendβ unless ownership of the request has been claimed by the caller via a call tohwrm_req_hold. π
And if the request is not consumed β either because it's never sent, or because ownership has been claimed β then it must be released by a call to hwrm_req_drop. no ghosting your requests, bestie, they will leak. π―οΈ
πΈ RETURN πΈ
- zero on success π
- a negative error code otherwise:
E2BIGβ the type of request pointer is too large to fit. it's giving "couldn't fit into the dress" energy πENOMEMβ an allocation failure occurred. the malloc said no. π
π₯ SEE ALSO π₯
the kernel file is right here, go read it:
./drivers/net/ethernet/broadcom/bnxt/bnxt_hwrm.c
and the whole friend group:
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)hwrm_req_dma_slice(9)
alright that's the page π this came out of the ./drivers/net/ethernet/broadco... source tree, dated October 2026, and it's filed under __hwrm_req_init(9). go forth and initialize responsibly, bestie ππ
π¦ 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