Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 2/3] block: move dif_prepare/dif_complete functions to block layer
Date: Tue, 24 Jul 2018 15:55:46 +0200	[thread overview]
Message-ID: <20180724135546.GB29918@lst.de> (raw)
In-Reply-To: <1532439222-5668-2-git-send-email-maxg@mellanox.com>

> +/*
> + * The virtual start sector is the one that was originally submitted
> + * by the block layer.	Due to partitioning, MD/DM cloning, etc. the
> + * actual physical start sector is likely to be different.  Remap
> + * protection information to match the physical LBA.
> + *
> + * From SCSI protocol perspective there's a slight difference between
> + * Type 1 and 2.  The latter uses command's 32-byte exclusively, and the
> + * reference tag is seeded in the command.  This gives us the potential to
> + * avoid virt->phys remapping during write.  However, at read time we
> + * don't know whether the virt sector is the same as when we wrote it
> + * (we could be reading from real disk as opposed to MD/DM device.  So
> + * we always remap Type 2 making it identical to Type 1.
> + *
> + * Type 3 does not have a reference tag so no remapping is required.
> + */

Please convert the comments for  t10_pi_prepare/t10_pi_complete to
kerneldoc format, and remove the mention of 32-byte CDBs, which
are SCSI specific.

Otherwise this looks good to me.

Note that after this patch only sd_dif_config_host is left in sd_dif.c,
at which point it might be worth merging into sd.c as a separate patch.

  reply	other threads:[~2018-07-24 13:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 13:33 [PATCH 1/3] block: move ref_tag calculation func to the block layer Max Gurtovoy
2018-07-24 13:33 ` [PATCH 2/3] block: move dif_prepare/dif_complete functions to " Max Gurtovoy
2018-07-24 13:55   ` Christoph Hellwig [this message]
2018-07-24 14:33     ` Max Gurtovoy
2018-07-24 17:41       ` Christoph Hellwig
2018-07-24 20:33   ` Keith Busch
2018-07-24 22:32     ` Max Gurtovoy
2018-07-24 13:33 ` [PATCH 3/3] nvme: use blk API to remap ref tags for IOs with metadata Max Gurtovoy
2018-07-24 13:56   ` Christoph Hellwig
2018-07-24 13:52 ` [PATCH 1/3] block: move ref_tag calculation func to the block layer Christoph Hellwig

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=20180724135546.GB29918@lst.de \
    --to=hch@lst.de \
    /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