sdma_txinit_ahg(9)
π sdma_txinit_ahg(9) β like, the Kernel API Manual era β¨
okay so bestie, welcome to sdma_txinit_ahg from the Kernel API Manual β yes that manual, the one we stan π«Ά
β¨ NAME β¨
sdma_txinit_ahg β initialize an sdma_txreq struct with AHG. that's the whole vibe, no cap π
π¦ SYNOPSIS π¦
int sdma_txinit_ahg (struct sdma_txreq *tx , u16 flags , u16 tlen , u8
ahg_entry , u8 num_ahg , u32 *ahg , u8 ahg_hlen , void (*cb)(struct
sdma_txreq *, int) );
look at her. she's iconic. she's taking eight arguments and she's not sorry π
π ARGUMENTS π
txβ the tx request you're initializing, bestie. this is the main character πflagsβ flags that key the last descriptor additions. yeah, that's what they do πtlenβ total packet length, and that'spbc+ headers + data, all of it, don't forget a single byte πahg_entryβ the ahg entry to use, in the range0 - 31β¨num_ahgβ the ahg descriptor for the first descriptor, range0 - 9π―ahgβ array of AHG descriptors, up to 9 entries, so like. nine. max. πahg_hlenβ number of bytes from the ASIC entry to use πΈcbβ the callback π
π DESCRIPTION π
okay so. the allocation of the sdma_txreq and its enclosing structure is user dependent β that part's on you, bestie, not on this function. this routine must be called to initialize the user independent fields. no skipping, fr fr π
the currently supported flags are SDMA_TXREQ_F_URGENT, SDMA_TXREQ_F_AHG_COPY, and SDMA_TXREQ_F_USE_AHG. let's break them down π§
SDMA_TXREQ_F_URGENTβ for latency sensitive situations, where you want the completion, like, as soon as possible. urgent means urgent, iykyk π₯SDMA_TXREQ_F_AHG_COPYβ causes the header in the first descriptor to be copied to chip entry β¨SDMA_TXREQ_F_USE_AHGβ causes the code to add the AHG descriptors into the first 1 to 3 descriptors π
completions of submitted requests can be gotten on selected txreqs by giving a completion routine callback to sdma_txinit or sdma_txinit_ahg. but bestie, listen β the environment in which the callback runs can be from an ISR, a tasklet, or a thread, so no sleeping kernel routines can be used. periodt. also, aspects of the sdma ring may be locked, so care should be taken with locking. don't be out here napping in the wrong context π
the callback pointer can be NULL to avoid any callback for the packet being submitted. the callback will be provided this tx, a status, and a flag π
the status will be one of SDMA_TXREQ_S_OK, SDMA_TXREQ_S_SENDERROR, SDMA_TXREQ_S_ABORTED, or SDMA_TXREQ_S_SHUTDOWN. those are your four options, no substitutions π
the flag β if the iowait had been used β indicates the iowait sdma_busy count has reached zero. (the original says "if the is the iowait had been used" and honestly? the typo ate, but the meaning is right there π«Ά)
the user data portion of tlen should be precise. like, precise precise. the sdma_txadd_* entrances will pad with a descriptor references 1 - 3 bytes when the number of bytes specified in tlen have been supplied to the sdma_txreq π
ahg_hlen is used to determine the number of on-chip entry bytes to use as the header. this is for cases where the stored header is larger than the header to be used in a packet. this is typical for verbs where an RDMA_WRITE_FIRST is larger than the packet in an RDMA_WRITE_MIDDLE π
ngl, that tlen precision thing is not a suggestion. get it wrong and the padding will be doing unhinged things to your descriptor count π
π¦ SEE ALSO π¦
- Kernel file
./drivers/infiniband/hw/hfi1/sdma.h - sdma exported routines(9)
- sdma PSM/verbs API(9)
- Infrastructure calls(9)
- struct sdma_engine(9)
- sdma_empty(9)
- sdma_running(9)
- sdma_txinit(9)
- sdma_txadd_page(9)
- sdma_txadd_daddr(9)
- sdma_txadd_kvaddr(9)
- sdma_progress(9)
- struct sdma_map_elem(9)
- sdma_engine_progress_schedule(9)
go read them. all of them. they're giving study group energy ππ
and that's the whole page, bestie! this one lives at ./drivers/infiniband/hw/hfi1 and it's dated October 2026 β so like, from the future, lowkey iconic πΈβ¨ bye ily π«Άπ
π¦ 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