Xilinx / open-nic-driver

AMD OpenNIC driver includes the Linux kernel driver
GNU General Public License v2.0
55 stars 40 forks source link

user-space MMAP not working on Debian 10 #23

Open alacamester opened 2 years ago

alacamester commented 2 years ago

Hi!

I know that Debian is not supported yet... Problem: MMAP access to opennic via sysfs is not working on Debian, when opennic driver is loaded. For example: pcimem (https://github.com/billfarrow/pcimem) mmap fails.

Cause: Debian kernels ship with CONFIG_IO_STRICT_DEVMEM parameter set. This kernel setting prevents a user-space application to access device memory when a driver is loaded, and is using it.

I have modified open-nic-driver by adding a char-device, which allows to access BAR-2 register space from user applications. Note, that this is a fast-and-dirty modification because we needed it, but you could officially implement it, if others are interested too.

There is my fork: https://github.com/alacamester/open-nic-driver

L.

lmunch commented 2 years ago

I understand the use for this and I have implemented something similar locally. To have it officially in the driver am unsure about. Seems kind of hacky to open this backdoor but maybe there is a nice way to do it?. ethtool has --register-dump which could be implemented if you just need to view register values.