1. 30 11月, 2016 6 次提交
  2. 21 9月, 2016 3 次提交
    • S
      lightnvm: expose device geometry through sysfs · 40267efd
      Simon A. F. Lund 提交于
      For a host to access an Open-Channel SSD, it has to know its geometry,
      so that it writes and reads at the appropriate device bounds.
      
      Currently, the geometry information is kept within the kernel, and not
      exported to user-space for consumption. This patch exposes the
      configuration through sysfs and enables user-space libraries, such as
      liblightnvm, to use the sysfs implementation to get the geometry of an
      Open-Channel SSD.
      
      The sysfs entries are stored within the device hierarchy, and can be
      found using the "lightnvm" device type.
      
      An example configuration looks like this:
      
      /sys/class/nvme/
      └── nvme0n1
         ├── capabilities: 3
         ├── device_mode: 1
         ├── erase_max: 1000000
         ├── erase_typ: 1000000
         ├── flash_media_type: 0
         ├── media_capabilities: 0x00000001
         ├── media_type: 0
         ├── multiplane: 0x00010101
         ├── num_blocks: 1022
         ├── num_channels: 1
         ├── num_luns: 4
         ├── num_pages: 64
         ├── num_planes: 1
         ├── page_size: 4096
         ├── prog_max: 100000
         ├── prog_typ: 100000
         ├── read_max: 10000
         ├── read_typ: 10000
         ├── sector_oob_size: 0
         ├── sector_size: 4096
         ├── media_manager: gennvm
         ├── ppa_format: 0x380830082808001010102008
         ├── vendor_opcode: 0
         ├── max_phys_secs: 64
         └── version: 1
      Signed-off-by: NSimon A. F. Lund <slund@cnexlabs.com>
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      40267efd
    • M
      lightnvm: control life of nvm_dev in driver · b0b4e09c
      Matias Bjørling 提交于
      LightNVM compatible device drivers does not have a method to expose
      LightNVM specific sysfs entries.
      
      To enable LightNVM sysfs entries to be exposed, lightnvm device
      drivers require a struct device to attach it to. To allow both the
      actual device driver and lightnvm sysfs entries to coexist, the device
      driver tracks the lifetime of the nvm_dev structure.
      
      This patch refactors NVMe and null_blk to handle the lifetime of struct
      nvm_dev, which eliminates the need for struct gendisk when a lightnvm
      compatible device is provided.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      b0b4e09c
    • M
      nvme: refactor namespaces to support non-gendisk devices · ac81bfa9
      Matias Bjørling 提交于
      With LightNVM enabled namespaces, the gendisk structure is not exposed
      to the user. This prevents LightNVM users from accessing the NVMe device
      driver specific sysfs entries, and LightNVM namespace geometry.
      
      Refactor the revalidation process, so that a namespace, instead of a
      gendisk, is revalidated. This later allows patches to wire up the
      sysfs entries up to a non-gendisk namespace.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      ac81bfa9
  3. 31 8月, 2016 1 次提交
  4. 07 7月, 2016 8 次提交
  5. 07 5月, 2016 12 次提交
  6. 19 3月, 2016 2 次提交
  7. 04 3月, 2016 4 次提交
  8. 05 2月, 2016 1 次提交
    • M
      lightnvm: allow to force mm initialization · bf643185
      Matias Bjørling 提交于
      System block allows the device to initialize with its configured media
      manager. The system blocks is written to disk, and read again when media
      manager is determined. For this to work, the backend must store the
      data. Device drivers, such as null_blk, does not have any backend
      storage. This patch allows the media manager to be initialized without a
      storage backend.
      
      It also fix incorrect configuration of capabilities in null_blk, as it
      does not support get/set bad block interface.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      bf643185
  9. 12 1月, 2016 3 次提交
    • M
      lightnvm: introduce factory reset · 8b4970c4
      Matias Bjørling 提交于
      Now that a device can be managed using the system blocks, a method to
      reset the device is necessary as well. This patch introduces logic to
      reset the device easily to factory state and exposes it through an
      ioctl.
      
      The ioctl takes the following flags:
      
        NVM_FACTORY_ERASE_ONLY_USER
            By default all blocks, except host-reserved blocks are erased upon
            factory reset. Instead of this, only erase host-reserved blocks.
        NVM_FACTORY_RESET_HOST_BLKS
            Mark host-reserved blocks to be erased and set their type to free.
        NVM_FACTORY_RESET_GRWN_BBLKS
            Mark "grown bad blocks" to be erased and set their type to free.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      8b4970c4
    • M
      lightnvm: use system block for mm initialization · b7692076
      Matias Bjørling 提交于
      Use system block information to register the appropriate media manager.
      This enables the LightNVM subsystem to instantiate a media manager
      selected by the user, instead of relying on automatic detection by each
      media manager loaded in the kernel.
      
      A device must now be initialized before it can proceed to initialize its
      media manager. Upon initialization, the configured media manager is
      automatically initialized as well.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      b7692076
    • M
      lightnvm: introduce ioctl to initialize device · 55696154
      Matias Bjørling 提交于
      Based on the previous patch, we now introduce an ioctl to initialize the
      device using nvm_init_sysblock and create the necessary system blocks.
      The user may specify the media manager that they wish to instantiate on
      top. Default from user-space will be "gennvm".
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      55696154