Linux: Disabling Interrupt Coalescing for NVMe device

linuxnvmepcipci-express

I'm looking at testing an NVMe device with interrupt coalescing enabled, and disabled.

NVMe protocol defined interrupt coalescing parameters that can be passed to the device, and in free BSD the nvme module has these parameters to configure:

 dev.nvme.0.int_coal_time
     (R/W) Interrupt coalescing timer period in microseconds.  Set to
     0 to disable.

 dev.nvme.0.int_coal_threshold
     (R/W) Interrupt coalescing threshold in number of command comple-
     tions.  Set to 0 to disable.

With linux, I can't seem to see anything much about interrupt coalescing (interrupt moderation) outside of ethernet adapters, so I'm wondering if I'm looking in entirely the wrong place.

Best Answer

Looking at the Linux kernel source there is no mention of that.

But you can read and write it with the nvme-cli utility:

> nvme get-feature /dev/nvme0n1 -f 8
get-feature:0x8 (Interrupt Coalescing), Current value:00000000

and to set it:

> nvme set-feature /dev/nvme0n1 -f 8 -v 100
set-feature:08 (Interrupt Coalescing), value:0x000064

Check out the NVMe spec to find the actual bits that you need to fill in there as these are the raw values and nothing really sets you up here.