sdma_txinit_ahg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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's pbc + headers + data, all of it, don't forget a single byte πŸ™ˆ
  • ahg_entry β€” the ahg entry to use, in the range 0 - 31 ✨
  • num_ahg β€” the ahg descriptor for the first descriptor, range 0 - 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 πŸ¦„

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