15 Sep, 2016

1 commit


22 Oct, 2015

1 commit

  • We previously made a complete copy of a device's data integrity profile
    even though several of the fields inside the blk_integrity struct are
    pointers to fixed template entries in t10-pi.c.

    Split the static and per-device portions so that we can reference the
    template directly.

    Signed-off-by: Martin K. Petersen
    Reported-by: Christoph Hellwig
    Reviewed-by: Sagi Grimberg
    Cc: Dan Williams
    Signed-off-by: Dan Williams
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

17 Apr, 2015

1 commit

  • 3aec2f41a8bae introduced a merge error where we would end up check for
    sdkp instead of sdkp->ATO. Fix this so we register app tag capability
    correctly.

    Signed-off-by: Martin K. Petersen
    Cc: # v3.17+
    Reviewed-by: Sagi Grimberg
    Signed-off-by: James Bottomley

    Martin K. Petersen
     

01 Oct, 2014

1 commit

  • A set of flags introduced in the block layer enable better control over
    how protection information is handled. These flags are useful for both
    error injection and data recovery purposes. Checking can be enabled and
    disabled for controller and disk, and the guard tag format is now a
    per-I/O property.

    Update sd_protect_op to communicate the relevant information to the
    low-level device driver via a set of flags in scsi_cmnd.

    Signed-off-by: Martin K. Petersen
    Reviewed-by: Sagi Grimberg
    Acked-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

27 Sep, 2014

8 commits

  • The T10 Protection Information format is also used by some devices that
    do not go through the SCSI layer (virtual block devices, NVMe). Relocate
    the relevant functions to a block layer library that can be used without
    involving SCSI.

    Signed-off-by: Martin K. Petersen
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     
  • Make the choice of checksum a per-I/O property by introducing a flag
    that can be inspected by the SCSI layer. There are several reasons for
    this:

    1. It allows us to switch choice of checksum without unloading and
    reloading the HBA driver.

    2. During error recovery we need to be able to tell the HBA that
    checksums read from disk should not be verified and converted to IP
    checksums.

    3. For error injection purposes we need to be able to write a bad guard
    tag to storage. Since the storage device only supports T10 CRC we
    need to be able to disable IP checksum conversion on the HBA.

    Signed-off-by: Martin K. Petersen
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     
  • Move flags affecting the integrity code out of the bio bi_flags and into
    the block integrity payload.

    Signed-off-by: Martin K. Petersen
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     
  • So far we have relied on the app tag size to determine whether a disk
    has been formatted with T10 protection information or not. However, not
    all target devices provide application tag storage.

    Add a flag to the block integrity profile that indicates whether the
    disk has been formatted with protection information.

    Signed-off-by: Martin K. Petersen
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     
  • Instead of the "operate" parameter we pass in a seed value and a pointer
    to a function that can be used to process the integrity metadata. The
    generation function is changed to have a return value to fit into this
    scheme.

    Signed-off-by: Martin K. Petersen
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     
  • The protection interval is not necessarily tied to the logical block
    size of a block device. Stop using the terms "sector" and "sectors".

    Going forward we will use the term "seed" to describe the initial
    reference tag value for a given I/O. "Interval" will be used to describe
    the portion of the data buffer that a given piece of protection
    information is associated with.

    Signed-off-by: Martin K. Petersen
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     
  • None of the filesystems appear interested in using the integrity tagging
    feature. Potentially because very few storage devices actually permit
    using the application tag space.

    Remove the tagging functions.

    Signed-off-by: Martin K. Petersen
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     
  • For commands like REQ_COPY we need a way to pass extra information along
    with each bio. Like integrity metadata this information must be
    available at the bottom of the stack so bi_private does not suffice.

    Rename the existing bi_integrity field to bi_special and make it a union
    so we can have different bio extensions for each class of command.

    We previously used bi_integrity != NULL as a way to identify whether a
    bio had integrity metadata or not. Introduce a REQ_INTEGRITY to be the
    indicator now that bi_special can contain different things.

    In addition, bio_integrity(bio) will now return a pointer to the
    integrity payload (when applicable).

    Signed-off-by: Martin K. Petersen
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

24 Nov, 2013

1 commit

  • The bio integrity is also stored in a bvec array, so if we use the bvec
    iter code we just added, the integrity code won't need to implement its
    own iteration stuff (bio_integrity_mark_head(), bio_integrity_mark_tail())

    Signed-off-by: Kent Overstreet
    Cc: Jens Axboe
    Cc: "Martin K. Petersen"
    Cc: "James E.J. Bottomley"

    Kent Overstreet
     

03 May, 2013

1 commit

  • It appears to me that there is a problem with handling of type 1 protection
    information.

    It is considering a logical block reference tag of 0xffffffff to be an error,
    but it is actually valid any time ((lba & 0xffffffff) == 0xffffffff) [for
    example, 2TiB-1, 4TiB-1, 6TiB-1, etc.].

    I'm going by what's written in 4.18.3 of SBC3, where there doesn't appear
    to be any invalid value for the reference tag.

    Signed-off-by: Jeremy Higdon
    Acked-by: Martin K. Petersen
    Signed-off-by: James Bottomley

    Jeremy Higdon
     

24 Sep, 2012

1 commit


20 Mar, 2012

1 commit


06 Mar, 2012

1 commit


15 Oct, 2010

1 commit

  • Previously we tracked whether the integrity metadata had been remapped
    using a request flag. This was fine for low-level retries. However, if
    an I/O was redriven by upper layers we would end up remapping again,
    causing the retry to fail.

    Deprecate the REQ_INTEGRITY flag and introduce BIO_MAPPED_INTEGRITY
    which enables filesystems to notify lower layers that the bio in
    question has already been remapped.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

26 Nov, 2009

1 commit


02 Oct, 2009

2 commits

  • So far we have only issued DIF commands if CONFIG_BLK_DEV_INTEGRITY is
    enabled. However, communication between initiator and target should be
    independent of protection information DMA. There are DIF-only host
    adapters coming out that will be able to take advantage of this.

    Move the relevant DIF bits to sd.c.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: James Bottomley

    Martin K. Petersen
     
  • The checksum format is orthogonal to whether the protection information
    is being passed on beyond the HBA or not. It is perfectly valid to use
    a non-T10 CRC with WRITE_STRIP and READ_INSERT.

    Consequently it no longer makes sense to explicitly refer to the
    conversion in the protection operation. Update sd_dif and lpfc
    accordingly.

    Signed-off-by: Martin K. Petersen
    Acked-by: Ihab Hamadi
    Signed-off-by: James Bottomley

    Martin K. Petersen
     

11 May, 2009

1 commit

  • With recent cleanups, there is no place where low level driver
    directly manipulates request fields. This means that the 'hard'
    request fields always equal the !hard fields. Convert all
    rq->sectors, nr_sectors and current_nr_sectors references to
    accessors.

    While at it, drop superflous blk_rq_pos() < 0 test in swim.c.

    [ Impact: use pos and nr_sectors accessors ]

    Signed-off-by: Tejun Heo
    Acked-by: Geert Uytterhoeven
    Tested-by: Grant Likely
    Acked-by: Grant Likely
    Tested-by: Adrian McMenamin
    Acked-by: Adrian McMenamin
    Acked-by: Mike Miller
    Cc: James Bottomley
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Borislav Petkov
    Cc: Sergei Shtylyov
    Cc: Eric Moore
    Cc: Alan Stern
    Cc: FUJITA Tomonori
    Cc: Pete Zaitcev
    Cc: Stephen Rothwell
    Cc: Paul Clements
    Cc: Tim Waugh
    Cc: Jeff Garzik
    Cc: Jeremy Fitzhardinge
    Cc: Alex Dubov
    Cc: David Woodhouse
    Cc: Martin Schwidefsky
    Cc: Dario Ballabio
    Cc: David S. Miller
    Cc: Rusty Russell
    Cc: unsik Kim
    Cc: Laurent Vivier
    Signed-off-by: Jens Axboe

    Tejun Heo
     

05 Jan, 2009

3 commits


13 Oct, 2008

3 commits


27 Jul, 2008

1 commit

  • Support for controllers and disks that implement DIF protection
    information:

    - During command preparation the RDPROTECT/WRPROTECT must be set
    correctly if the target has DIF enabled.

    - READ(6) and WRITE(6) are not supported when DIF is on.

    - The controller must be told how to handle the I/O via the
    protection operation field in scsi_cmnd.

    - Refactor the I/O completion code that extracts failed LBA from the
    returned sense data and handle DIF failures correctly.

    - sd_dif.c implements the functions required to prepare and complete
    requests with protection information attached.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: James Bottomley

    Martin K. Petersen