[PATCH 3/3] nvme: parse format command's lbafu when tracing

Chaitanya Kulkarni chaitanyak at nvidia.com
Mon Jan 29 03:01:55 PST 2024


On 1/29/24 00:22, Guixin Liu wrote:
> Add the parse of format command's lbafu to calculate lbaf.
>
> Signed-off-by: Guixin Liu <kanie at linux.alibaba.com>
> ---
>   drivers/nvme/host/trace.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/trace.c b/drivers/nvme/host/trace.c
> index b383d51c1a0c..3ccb33646794 100644
> --- a/drivers/nvme/host/trace.c
> +++ b/drivers/nvme/host/trace.c
> @@ -119,7 +119,9 @@ static const char *nvme_trace_get_lba_status(struct trace_seq *p,
>   static const char *nvme_trace_admin_format_nvm(struct trace_seq *p, u8 *cdw10)
>   {
>   	const char *ret = trace_seq_buffer_ptr(p);
> -	u8 lbaf = cdw10[0] & 0xF;
> +	u8 lbafl = cdw10[0] & 0xF;
> +	u8 lbafu = (cdw10[1] >> 4) & 0x3;
> +	u8 lbaf = (lbafu << 4) | lbafl;
>   	u8 mset = (cdw10[0] >> 4) & 0x1;
>   	u8 pi = (cdw10[0] >> 5) & 0x7;
>   	u8 pil = cdw10[1] & 0x1;

as I don't see the newly added variables used in printing a trace do we 
really need
the calculation or a meaningful comment is would work ?

-ck




More information about the Linux-nvme mailing list