iscsi_tcp_segment_done(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… iscsi_tcp_segment_done(9) β€” the Kernel API Manual, bestie edition

okay so you're in the kernel API manual, section 9, and today's main character is iscsi_tcp_segment_done ✨ β€” like, this is literally the function that checks whether the segment is complete. that's the whole vibe. slay.


✨ NAME ✨

iscsi_tcp_segment_done β€” check whether the segment is complete πŸŽ€


🌸 SYNOPSIS 🌸

int iscsi_tcp_segment_done (struct iscsi_tcp_conn *tcp_conn , struct
       iscsi_segment *segment , int recv , unsigned copied );

that's the whole signature, copy it exactly bestie, don't be cute with it πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • tcp_conn β€” the iscsi tcp connection, iykyk 🫢
  • segment β€” the iscsi segment we're checking, the one under the microscope πŸ”
  • recv β€” set to one of this is called from the recv path πŸ‘‘ (yes that's the wording, we keep the wording)
  • copied β€” number of bytes copied, fr fr πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

so the actual job: check if we're done receiving this segment. that's it, that's the check ⭐

but here's the plot twist β€” if the receive buffer is full but we're expecting more data? we move on to the next entry in the scatterlist. no cap, just keep it moving πŸ¦‹

and if the amount of data we received isn't a multiple of 4? we will transparently receive the pad bytes, too. the padding just gets handled, you don't even have to think about it 🌸

πŸ’€ important one: this function must be re-entrant. like, genuinely, must be. don't come for it with lock assumptions, she's got main character energy and she gets called from multiple places.

🌈 SEE ALSO 🌈

the kernel file ./drivers/scsi/libiscsi_tcp.c is where the magic lives, and here's the whole friend group 🫢:


πŸŽ€ and that's the page!! brought to you by ./drivers/scsi, dated October 2026 β€” periodt, go read the other ones too bestie πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from