Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ obj-m := dnvme.o
dnvme-objs += sysdnvme.o dnvme_ioctls.o dnvme_reg.o dnvme_sts_chk.o dnvme_queue.o dnvme_cmds.o dnvme_ds.o dnvme_irq.o

all:
make -C $(KDIR) M=$(PWD) modules
$(MAKE) -C $(KDIR) M=$(PWD) modules

rpm: rpmzipsrc rpmbuild

clean:
make -C $(KDIR) M=$(PWD) clean
$(MAKE) -C $(KDIR) M=$(PWD) clean
rm -f doxygen.log
rm -rf $(SRCDIR)
rm -rf $(RPMFILE)
Expand Down
5 changes: 0 additions & 5 deletions README

This file was deleted.

47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
This is the dnvm repository in the Nvme Compliance project.

This repo contains the Linux driver for the NVMe Compliance Suite.

Contact compliance@nvmexpress.org for more information.

## Compilation

To compile:
```
# don't use sudo
make
```

## Installation

To install
```
sudo make install
```

## Running

To run after install (unload the kernel nvme driver first)
```
sudo modprobe -r nvme # unload kernel driver

sudo modprobe dnvme
```

## Potential Issues

If you run into issues, check dmesg.

If you see something like:
```
DMAR: DRHD: handling fault status reg 3
```
try setting (in your grub config (for ex: /etc/default/grub))
```
intel_iommu=off
```
then run
```
sudo update-grub
```

4 changes: 4 additions & 0 deletions dnvme_ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/fcntl.h>
#include <linux/version.h>
#include <asm/uaccess.h>
#include <asm/segment.h>

Expand Down Expand Up @@ -98,6 +99,9 @@ static loff_t irq_nodes_log(struct file *file, loff_t pos,
return err;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
#define vfs_write kernel_write
#endif

int driver_log(struct nvme_file *n_file)
{
Expand Down
26 changes: 26 additions & 0 deletions dnvme_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,28 @@ static int validate_irq_inputs(struct metrics_device_list
return ret_val;
}

/*
* Re-add function to work with newer kernels
* pci_enable_msix was removed in 4.12
*/

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
/*
* Returns 0 if the correct number of vectors were allocated
* Returns negative on failure
* Returns positive if the number requested exceeds available
*/
int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec)
{
int ret = pci_enable_msix_range(dev, entries, nvec, nvec);
if (ret == nvec) {
return 0;
}

return ret;
}
#endif

/*
* Sets up the active IRQ scheme to MSI-X. It gets the number of irqs
* requested and loops from 0 to n -1 irqs, enables the active irq
Expand Down Expand Up @@ -655,7 +677,11 @@ static int dnvme_pci_enable_msi(struct pci_dev * dev, unsigned int nvec)
return pci_enable_msi_block(dev, nvec);
#else
int ret;
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,11,0)
ret = pci_enable_msi_range(dev, nvec, nvec);
#else
ret = pci_alloc_irq_vectors(dev, nvec, nvec, PCI_IRQ_MSI);
#endif
if (ret < nvec)
return ret;
else
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
2

#define VER_MINOR \
14
15