how to set up a nvme target over RAMDISK backend

Chuck Tuffli chuck at tuffli.net
Tue Jun 30 18:12:13 UTC 2020


On Thu, Jun 25, 2020 at 9:01 PM Krishnamraju Eraparaju <ekraju at gmail.com>
wrote:

> Hi All,
>
>
> Could someone please help me in setting up a nvme target over RAMDISK
> backend(or any pseudo disk).
>
> Equivalent in Linux would be as below:
>
> modprobe null_blk
> modprobe nvmet
> modprobe nvmet_rdma
>
>
> mkdir /sys/kernel/config/nvmet/subsystems/nvme-ram0
> mkdir /sys/kernel/config/nvmet/subsystems/nvme-ram0/namespaces/1
>
> echo -n /dev/ram1
> >/sys/kernel/config/nvmet/subsystems/nvme-ram0/namespaces/1/device_path
> echo 1 > /sys/kernel/config/nvmet/subsystems/nvme-ram0/attr_allow_any_host
> echo 1 > /sys/kernel/config/nvmet/subsystems/nvme-ram0/namespaces/1/enable
>

FreeBSD doesn't have a direct equivalent of this. It does support NVMe
device emulation in bhyve, but based on loading RDMA drivers above, I'm
guessing this won't meet your needs. Another option would be to use the
nvmf_tgt provided in SPDK (https://spdk.io/). This would give you the
similar functionality to the Linux NVMe target and supports multiple
transports including RoCE.

--chuck


More information about the freebsd-hackers mailing list