How to invoke pcie functions with nvme linux driver installed in device

408 Views Asked by At

I am new to linux device drivers.I am familiar with linux driver code for pcie and nvme. I have loaded linux nvme driver and able to send read, write command through nvme cli. With nvme driver loaded, is there a way to send pcie commads( change speed, lanes) to device. What are the changes to be done to existing nvme driver code? The main objective is to port bunch of pcie testcases to run in parallel with nvme read/writes.

1

There are 1 best solutions below

0
On

You can use setpci to issue PCIe commands. No changes required to be done on nvme driver code.

setpci -s Bus:device.function reg=value

You can use setpci --dumpregs to check the register address for link control 2 register. And then modify the target link speed for the upstream bridge of nvme device