STRUCT GSI_TRANS(9)
β¨ struct gsi_trans π β a GSI transaction, bestie β¨
okay so this is a page from the Kernel API Manual about struct gsi_trans(9), which is, like, literally a GSI transaction. it's giving "kernel internals but make it cute" and honestly? we're obsessed. let's get into it π
πΈ NAME πΈ
struct gsi_trans β a GSI transaction. that's it, that's the gig β¨
π¦ SYNOPSIS π¦
here's the whole struct, copied exactly, no cap:
struct gsi_trans {
struct gsi *gsi;
u8 channel_id;
bool cancelled;
u8 rsvd_count;
u8 used_count;
u32 len;
union {
void *data;
u8 cmd_opcode[IPA_COMMAND_TRANS_TRE_MAX];
};
struct scatterlist *sgl;
enum dma_data_direction direction;
refcount_t refcount;
struct completion completion;
u64 byte_count;
u64 trans_count;
};
like, look at her. main character struct energy fr fr π
π Members π
okay bestie, field-by-field, let's go:
gsiβ the GSI pointer. your ride-or-die back to the GSI, iykyk.channel_idβ channel number this transaction is associated with πcancelledβ if the core code sets this, it means the transaction was cancelled. dramatic but valid πrsvd_countβ how many TREs got reserved for this transaction.used_countβ how many TREs are used β and yes, it could be less thanrsvd_count. lowkey flexible like that β¨lenβ number of bytes sent or received by the transaction.- {unnamed_union} β anonymous. she doesn't need a name, she's mysterious like that π
dataβ preserved but not touched by the core transaction code. hands off, she's not yours π«Άcmd_opcodeβ array of command opcodes (command channel only, okay? only there π ).sglβ an array of scatter/gather entries managed by the core code.directionβ DMA transfer direction (DMA_NONEfor commands).refcountβ reference count used for destruction. this one's important, don't ghost it πcompletionβ completed when the transaction completes. yes, that's the sentence. it's giving tautology but it's correct πbyte_countβ TX channel byte count recorded when the transaction was committed.trans_countβ channel transaction count when committed (for BQL accounting). numbers girlies rise β
π₯ Description π₯
heads up: most fields in this structure are for internal use by the transaction core code. so like, don't go poking around in there unless you know what you're doing, bestie π
the len field gets set when the transaction is committed. and for RX transactions, it gets updated later to reflect the actual number of bytes received β so it's a little "we'll know when we know" situation β¨
π§ SEE ALSO π§
kernel file ./drivers/net/ipa/gsi_trans.h, plus the whole friend group right here β go say hi:
gsi_trans_pool_init(9)gsi_trans_pool_alloc(9)gsi_trans_pool_exit(9)gsi_trans_pool_init_dma(9)gsi_trans_pool_alloc_dma(9)gsi_trans_pool_exit_dma(9)gsi_channel_trans_idle(9)gsi_channel_trans_alloc(9)gsi_trans_free(9)gsi_trans_cmd_add(9)gsi_trans_page_add(9)gsi_trans_skb_add(9)gsi_trans_commit(9)gsi_trans_commit_wait(9)gsi_trans_read_byte(9)gsi_trans_read_byte_done(9)
okay that's the whole page, you ate that π this one lives in ./drivers/net/ipa and it's dated October 2026 β so like, future vibes, we love that for us π slay, periodt, go read the actual kernel source now π
β¨
π¦ 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