On 6/30/22 7:22 AM, Anastasia Kovaleva wrote: > --- a/drivers/target/target_core_spc.c > +++ b/drivers/target/target_core_spc.c > @@ -513,6 +513,7 @@ spc_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf) > struct se_device *dev = cmd->se_dev; > u32 mtl = 0; > int have_tp = 0, opt, min; > + u32 io_max_blocks; > > /* > * Following spc3r22 section 6.5.3 Block Limits VPD page, when > @@ -547,11 +548,15 @@ spc_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf) > * XXX: Currently assumes single PAGE_SIZE per scatterlist for fabrics > * enforcing maximum HW scatter-gather-list entry limit > */ > + io_max_blocks = mult_frac( > + dev->dev_attrib.hw_max_sectors, > + dev->dev_attrib.hw_block_size, > + dev->dev_attrib.block_size); Just some trivial comments. This chunk might be better after the max_data_sg_nents chunk below because the comment above is for the max_data_sg_nents chunk. Also, fix up the tabbing/coding style like: io_max_blocks = mult_frac(dev->dev_attrib.hw_max_sectors, dev->dev_attrib.hw_block_size, dev->dev_attrib.block_size); > if (cmd->se_tfo->max_data_sg_nents) { > mtl = (cmd->se_tfo->max_data_sg_nents * PAGE_SIZE) / > dev->dev_attrib.block_size; > } > - put_unaligned_be32(min_not_zero(mtl, dev->dev_attrib.hw_max_sectors), &buf[8]); > + put_unaligned_be32(min_not_zero(mtl, io_max_blocks), &buf[8]); >