I have a user space application that generates large SCSI entries (details below). However, when I look at SCSI commands that reach the SCSI target (i.e. Storage connected by FC), something splits these records into 512KB blocks.
The application basically performs direct recording in 1M format directly to the device:
fd = open("/dev/sdab", ..|O_DIRECT);
write(fd, ..., 1024 * 1024);
This code causes the sending of two SCSI WRITE, 512 thousand each.
However, if I issue a direct SCSI command, without a block layer, the record will not be split. I exit the command line the following command:
sg_dd bs=1M count=1 blk_sgio=1 if=/dev/urandom of=/dev/sdab oflag=direct
I see one single SCI WRITE of size 1 M.
The question is what separates the record and, more importantly, is it customizable? The Linux layer seems to be to blame (because SG_IO does not go through it), and 512K seems to be too arbitrary a number to not be some kind of custom parameter.
source
share