iscsi_tcp_segment_recv(9)
π iscsi_tcp_segment_recv(9) β the Kernel API Manual, bestie edition β¨
Okay so this is a page from the Kernel API Manual (yes, that manual, the kernel one, we're fancy now π) and it's about one little function that copies data into a segment. Baby function. Big job. Let's get into it π¦
β¨ NAME β¨
iscsi_tcp_segment_recv β copy data to segment π
πΈ SYNOPSIS πΈ
int iscsi_tcp_segment_recv (struct iscsi_tcp_conn *tcp_conn , struct
iscsi_segment *segment , const void *ptr , unsigned int len );
Like, that's the whole signature, character for character, no notes π
π«Ά ARGUMENTS π«Ά
tcp_connβ the iSCSI TCP connection, the main character of this whole vibe πsegmentβ the buffer to copy to, aka where the data's gonna liveptrβ data pointer, literally just a pointer to the data πlenβ amount of data available, so you know how much we're working with
π¦ DESCRIPTION π¦
So what this function does is copy up to len bytes into the given buffer, and then it returns the number of bytes actually consumed β and yeah, lowkey that number can genuinely be less than len. Not a bug, just how it is π
If CRC is enabled, the function will update the CRC while copying. Like, doing both things at once π§
And the manpage is very honest about this part: combining these two operations doesn't buy us a lot (yet), but in the future we could implement combined copy+crc, just the way we do for network layer checksums. So it's giving "we left room for a glow-up" β¨
Real talk though: the "returns less than len" thing is for real, so bestie, don't assume you got everything you asked for β check what it actually handed back π
π SEE ALSO π
Kernel file ./drivers/scsi/libiscsi_tcp.c β and while you're there, go peek at all these siblings, they're iconic:
iscsi_tcp_segment_init_sg(9)iscsi_tcp_segment_map(9)iscsi_tcp_segment_done(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)
That's the whole page, no skips, no cuts, we ate and left no crumbs π Coming to you from ./drivers/scsi, dated October 2026 β mwah, periodt ππ·
π¦ 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