Xilinx / open-nic-driver

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

open-nic-driver on Centos? #41

Closed JunPhilips closed 1 year ago

JunPhilips commented 1 year ago

Hi,

I am a newbie for open-nic, apologise if this question has been asked/answered repetitively. I tried to build open-nic-driver on a couple of servers with Centos, all failed (please see the attached below), but fine with the one with Ubuntu. I wonder if this driver works for a Centos server?

Thanks very much for your help!

make make -C /lib/modules/3.10.0-1160.42.2.el7.x86_64/build M=/home/neil/U55nPlatform/open-nic-driver modules make[1]: Entering directory /usr/src/kernels/3.10.0-1160.42.2.el7.x86_64' CC [M] /home/neil/U55nPlatform/open-nic-driver/onic_main.o /home/neil/U55nPlatform/open-nic-driver/onic_main.c:132:2: error: unknown field ândo_change_mtuâ specified in initializer .ndo_change_mtu = onic_change_mtu, ^ /home/neil/U55nPlatform/open-nic-driver/onic_main.c:132:2: error: initialization from incompatible pointer type [-Werror] /home/neil/U55nPlatform/open-nic-driver/onic_main.c:132:2: error: (near initialization for âonic_netdev_ops.ndo_set_configâ cc1: all warnings being treated as errors make[2]: *** [/home/neil/U55nPlatform/open-nic-driver/onic_main.o] Error 1 make[1]: *** [_module_/home/neil/U55nPlatform/open-nic-driver] Error 2 make[1]: Leaving directory/usr/src/kernels/3.10.0-1160.42.2.el7.x86_64' make: *** [all] Error 2

cneely-amd commented 1 year ago

Hi @JunPhilips,

I've only used this driver with Ubuntu. In January 2022, @kenter committed an edit related to RHEL8.

https://github.com/Xilinx/open-nic-driver/commit/c222cb42afbf948917cdfe9edd7379d97dda625b

JunPhilips commented 1 year ago

Thanks very much @cneely-amd. figured out why i failed. I was trying to build the driver on Centos 7.8, where ndo_change_mtu is renamed as ndo_change_mtu_rh74 in netdevice.h. So the fix is to change ndo_change_mtu in onic_main.c to ndo_change_mtu_rh74.