linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Christie <michael.christie@oracle.com>
To: Anastasia Kovaleva <a.kovaleva@yadro.com>, target-devel@vger.kernel.org
Cc: linux-scsi@vger.kernel.org, linux@yadro.com
Subject: Re: [PATCH 1/3] target: core: Send mtl in blocks
Date: Thu, 7 Jul 2022 16:34:31 -0500	[thread overview]
Message-ID: <bf167e56-fcac-f528-3e12-a185cce4ed01@oracle.com> (raw)
In-Reply-To: <20220630122241.1658-2-a.kovaleva@yadro.com>

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]);
>  

  reply	other threads:[~2022-07-07 21:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 12:22 [PATCH 0/3] Make target send correct io limits Anastasia Kovaleva
2022-06-30 12:22 ` [PATCH 1/3] target: core: Send mtl in blocks Anastasia Kovaleva
2022-07-07 21:34   ` Mike Christie [this message]
2022-06-30 12:22 ` [PATCH 2/3] target: core: make hw_max_sectors store the sectors amount " Anastasia Kovaleva
2022-07-07 21:38   ` Mike Christie
2022-06-30 12:22 ` [PATCH 3/3] target: core: Change the way target_xcopy_do_work sets restiction on max io Anastasia Kovaleva
2022-07-01  3:43   ` kernel test robot
2022-07-01  4:35   ` kernel test robot
2022-07-02 11:47   ` kernel test robot
2022-07-07 22:37   ` Mike Christie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf167e56-fcac-f528-3e12-a185cce4ed01@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=a.kovaleva@yadro.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@yadro.com \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).