txtechhelp
txtechhelp

Reputation: 6752

PCIe bus latency when using ioctl vs read?

I've got a hardware client1 who's line of data acquisition cards I've written a Linux PCI kernel driver for.

The card can only communicate 1-4 bytes at a time depending on how the user specifies to utilize it, given this, I utilize ioctl for some of the functionality, but also make use of the file_operations structure to treat the card as a basic character device to give the user of the card the ability to just use read or write if they just want simple 1-byte communication with the card.

After discussing the driver with the client, one of their developers is in the understanding that treating the card as a character device by using open/read/write will introduce latency on the PCI bus, versus using open/ioctl.

Given that the driver makes no distinction how it's opened and the ioctl and read/write functions call the same code, is there any validity to this concern?

If so, how would I test the bus latency from my driver code? Are there kernel functions I can call to test this?

Lastly, wouldn't my test of the bus only be valid for my specific setup (kernel settings, platform, memory timing, CPU, etc.)?

1: they only have 2 other developers, neither of which have ever used Linux

Upvotes: 1

Views: 732

Answers (1)

David Schwartz
David Schwartz

Reputation: 182743

I suspect the client's developer is slightly confused. He's thinking that the distinction between using read or write versus ioctl corresponds to the type of operation performed on the bus. If you explain to him that this is just a software API difference and either option performs the exact same operation on the bus, that should satisfy them.

Upvotes: 2

Related Questions