On what kernel version should I compile the mqnic?

116 views
Skip to first unread message

윤정한

unread,
Nov 19, 2020, 9:45:59 PM11/19/20
to corundum-nic
Hello. I'm a novice trying to use corundum as a 100G NIC on U250 card.

I did "make" and "make program", so finished flashing the program to U250 card.

Now, "lspci -vd 10ee: " does not show the U250 card.

But, I am not sure from where I can get mqnic.ko in this project.

I thought in folder, "modules/mqnic" I should "make" them,
and after then I could get mqnic.ko.

At this point, I faced with a compile error about some fields of "net_device" and "net_device_ops" structures. (compiler says that min_mtu, max_mtu, .ndo_.. are not the fields of those structures.)

Through searching on google, I found it is an error from kernel version mismatch.

So I decided to ask community, on what kernel version I should compile the mqnic.
(Actually, I should ask earlier.)

Please point me if there is anything wrong with my guess.  

Thank you.

Alex Forencich

unread,
Nov 19, 2020, 9:53:42 PM11/19/20
to corund...@googlegroups.com

It should work fine under Ubuntu 18.04.  It also should work under Arch Linux.  What OS are you running currently?  If it's not too old or too weird, I may be able to add some ifdefs so it works. 

Distributions that screw around with the kernel (redhat/centos/etc.) are a different story.  The reported kernel version is not reliable for determining which features are present due to the amount of patch backporting that takes place.  An alternative technique is required.  Therefore, those distributions are currently not supported. 

Alex Forencich
--
You received this message because you are subscribed to the Google Groups "corundum-nic" group.
To unsubscribe from this group and stop receiving emails from it, send an email to corundum-nic...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/corundum-nic/2ce5b7bd-847b-43ff-9df6-7c6b5d0f3f4cn%40googlegroups.com.

윤정한

unread,
Nov 19, 2020, 9:56:49 PM11/19/20
to corundum-nic
Thank you for quick response!

[junghan@forest4 kernels]$ uname -r
3.10.0-957.el7.x86_64
[junghan@forest4 kernels]$ lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.6.1810 (Core)
Release:        7.6.1810
Codename:       Core

This is my result.
2020년 11월 20일 금요일 오전 11시 53분 42초 UTC+9에 jfor...@eng.ucsd.edu님이 작성:

Alex Forencich

unread,
Nov 19, 2020, 10:03:39 PM11/19/20
to corund...@googlegroups.com

Ah, I see, you're on centos.  Yeah, you'll have to move over to Ubuntu or Debian or something that doesn't mess around with the kernel as much, at least for the time being. 

Alex Forencich

Adrian Holmes

unread,
Apr 13, 2021, 11:15:30 AM4/13/21
to corundum-nic
I've just compiled the kernel module on RHEL8.2 (Kernel 4.18.0-193.19.1.el8_2.x86_64).
(CentOS being a close relative of RHEL).

Only change I had to make was to line 523 of mqnic_tx.c from:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
to
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0)

Not got as far as testing it yet, just thought i'd see if I could compile the latest kernel module.

Alex Forencich

unread,
Apr 13, 2021, 5:47:45 PM4/13/21
to corund...@googlegroups.com

What I have observed so far is that if the module compiles successfully, it's highly likely to work.  Generally the main thing to worry about are kernel API changes (renamed method or struct member), and those changes generally prevent the module from compiling.  So I think in your case there is a good chance that it will work without requiring any significant modifications. 

But this does highlight the problems with supporting RHEL/Centos....in this case it seems they back-ported a bunch of kernel code from 5.2.0 or possibly a more recent release, so now they have a kernel that has features and internal APIs that look like 5.2.0, but it reports kernel version 4.18.0.  Ideally, supporting RHEL/Centos would be useful, but I don't have the time to go figure out when things changed in the RHEL kernels so I can add all of the correct ifdefs based on the redhat release information. 

Alex Forencich
Reply all
Reply to author
Forward
0 new messages