1. 18 4月, 2022 1 次提交
  2. 10 3月, 2022 1 次提交
  3. 09 3月, 2022 1 次提交
  4. 08 3月, 2022 1 次提交
  5. 28 2月, 2022 1 次提交
    • E
      blk-crypto: show crypto capabilities in sysfs · 20f01f16
      Eric Biggers 提交于
      Add sysfs files that expose the inline encryption capabilities of
      request queues:
      
      	/sys/block/$disk/queue/crypto/max_dun_bits
      	/sys/block/$disk/queue/crypto/modes/$mode
      	/sys/block/$disk/queue/crypto/num_keyslots
      
      Userspace can use these new files to decide what encryption settings to
      use, or whether to use inline encryption at all.  This also brings the
      crypto capabilities in line with the other queue properties, which are
      already discoverable via the queue directory in sysfs.
      
      Design notes:
      
        - Place the new files in a new subdirectory "crypto" to group them
          together and to avoid complicating the main "queue" directory.  This
          also makes it possible to replace "crypto" with a symlink later if
          we ever make the blk_crypto_profiles into real kobjects (see below).
      
        - It was necessary to define a new kobject that corresponds to the
          crypto subdirectory.  For now, this kobject just contains a pointer
          to the blk_crypto_profile.  Note that multiple queues (and hence
          multiple such kobjects) may refer to the same blk_crypto_profile.
      
          An alternative design would more closely match the current kernel
          data structures: the blk_crypto_profile could be a kobject itself,
          located directly under the host controller device's kobject, while
          /sys/block/$disk/queue/crypto would be a symlink to it.
      
          I decided not to do that for now because it would require a lot more
          changes, such as no longer embedding blk_crypto_profile in other
          structures, and also because I'm not sure we can rule out moving the
          crypto capabilities into 'struct queue_limits' in the future.  (Even
          if multiple queues share the same crypto engine, maybe the supported
          data unit sizes could differ due to other queue properties.)  It
          would also still be possible to switch to that design later without
          breaking userspace, by replacing the directory with a symlink.
      
        - Use "max_dun_bits" instead of "max_dun_bytes".  Currently, the
          kernel internally stores this value in bytes, but that's an
          implementation detail.  It probably makes more sense to talk about
          this value in bits, and choosing bits is more future-proof.
      
        - "modes" is a sub-subdirectory, since there may be multiple supported
          crypto modes, sysfs is supposed to have one value per file, and it
          makes sense to group all the mode files together.
      
        - Each mode had to be named.  The crypto API names like "xts(aes)" are
          not appropriate because they don't specify the key size.  Therefore,
          I assigned new names.  The exact names chosen are arbitrary, but
          they happen to match the names used in log messages in fs/crypto/.
      
        - The "num_keyslots" file is a bit different from the others in that
          it is only useful to know for performance reasons.  However, it's
          included as it can still be useful.  For example, a user might not
          want to use inline encryption if there aren't very many keyslots.
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Link: https://lore.kernel.org/r/20220124215938.2769-4-ebiggers@kernel.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
      20f01f16
  6. 23 2月, 2022 1 次提交
  7. 17 2月, 2022 2 次提交
  8. 02 2月, 2022 4 次提交
  9. 29 1月, 2022 1 次提交
  10. 06 1月, 2022 1 次提交
  11. 23 12月, 2021 1 次提交
  12. 22 12月, 2021 1 次提交
  13. 04 12月, 2021 1 次提交
  14. 29 11月, 2021 2 次提交
  15. 28 10月, 2021 1 次提交
  16. 27 10月, 2021 1 次提交
    • D
      block: Add independent access ranges support · a2247f19
      Damien Le Moal 提交于
      The Concurrent Positioning Ranges VPD page (for SCSI) and data log page
      (for ATA) contain parameters describing the set of contiguous LBAs that
      can be served independently by a single LUN multi-actuator hard-disk.
      Similarly, a logically defined block device composed of multiple disks
      can in some cases execute requests directed at different sector ranges
      in parallel. A dm-linear device aggregating 2 block devices together is
      an example.
      
      This patch implements support for exposing a block device independent
      access ranges to the user through sysfs to allow optimizing device
      accesses to increase performance.
      
      To describe the set of independent sector ranges of a device (actuators
      of a multi-actuator HDDs or table entries of a dm-linear device),
      The type struct blk_independent_access_ranges is introduced. This
      structure describes the sector ranges using an array of
      struct blk_independent_access_range structures. This range structure
      defines the start sector and number of sectors of the access range.
      The ranges in the array cannot overlap and must contain all sectors
      within the device capacity.
      
      The function disk_set_independent_access_ranges() allows a device
      driver to signal to the block layer that a device has multiple
      independent access ranges.  In this case, a struct
      blk_independent_access_ranges is attached to the device request queue
      by the function disk_set_independent_access_ranges(). The function
      disk_alloc_independent_access_ranges() is provided for drivers to
      allocate this structure.
      
      struct blk_independent_access_ranges contains kobjects (struct kobject)
      to expose to the user through sysfs the set of independent access ranges
      supported by a device. When the device is initialized, sysfs
      registration of the ranges information is done from blk_register_queue()
      using the block layer internal function
      disk_register_independent_access_ranges(). If a driver calls
      disk_set_independent_access_ranges() for a registered queue, e.g. when a
      device is revalidated, disk_set_independent_access_ranges() will execute
      disk_register_independent_access_ranges() to update the sysfs attribute
      files.  The sysfs file structure created starts from the
      independent_access_ranges sub-directory and contains the start sector
      and number of sectors of each range, with the information for each range
      grouped in numbered sub-directories.
      
      E.g. for a dual actuator HDD, the user sees:
      
      $ tree /sys/block/sdk/queue/independent_access_ranges/
      /sys/block/sdk/queue/independent_access_ranges/
      |-- 0
      |   |-- nr_sectors
      |   `-- sector
      `-- 1
          |-- nr_sectors
          `-- sector
      
      For a regular device with a single access range, the
      independent_access_ranges sysfs directory does not exist.
      
      Device revalidation may lead to changes to this structure and to the
      attribute values. When manipulated, the queue sysfs_lock and
      sysfs_dir_lock mutexes are held for atomicity, similarly to how the
      blk-mq and elevator sysfs queue sub-directories are protected.
      
      The code related to the management of independent access ranges is
      added in the new file block/blk-ia-ranges.c.
      Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Reviewed-by: NKeith Busch <kbusch@kernel.org>
      Link: https://lore.kernel.org/r/20211027022223.183838-2-damien.lemoal@wdc.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
      a2247f19
  17. 22 10月, 2021 5 次提交
  18. 20 10月, 2021 2 次提交
  19. 19 10月, 2021 5 次提交
  20. 18 10月, 2021 7 次提交