iscsi_tcp_segment_done(9)
π 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 π«Ά:
iscsi_tcp_segment_init_sg(9)iscsi_tcp_segment_map(9)iscsi_tcp_segment_recv(9)iscsi_tcp_hdr_recv_prep(9)iscsi_tcp_cleanup_task(9)iscsi_tcp_data_in(9)iscsi_tcp_r2t_rsp(9)iscsi_tcp_hdr_dissect(9)iscsi_tcp_hdr_recv_done(9)iscsi_tcp_recv_segment_is_hdr(9)iscsi_tcp_recv_skb(9)iscsi_tcp_task_init(9)iscsi_tcp_task_xmit(9)
π 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
- 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