402 Star 1.4K Fork 1.3K

GVPopenEuler / kernel

 / 详情

Kernel version string of openEuler is too long

待办的
任务 成员
创建于  
2023-07-18 15:21

openEuler 22.03-LTS-SP2的kernel版本字符串非常长,超过了32字节,这使得“ethtool -i”命令得到的version字符串被截断了。

下面的例子中,我们可以看到,kernel的版本字符串为“5.10.0-153.17.0.93.oe2203sp2.x86_64”,但是ethtool -i得到的版本是“5.10.0-153.17.0.93.oe2203sp2.x8”。被截断了。

[root@ocsbesrhlrepo01 ~]# modinfo ice | grep -i version
srcversion:     6196D38C820D715F7DC02E9
vermagic:       5.10.0-153.17.0.93.oe2203sp2.x86_64 SMP mod_unload modversions
[root@ocsbesrhlrepo01 ~]# ethtool -i ens66
driver: ice
version: 5.10.0-153.17.0.93.oe2203sp2.x8
firmware-version: 4.10 0x8001518b 1.3310.0
expansion-rom-version:
bus-info: 0000:6a:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes
[root@ocsbesrhlrepo01 ~]#

这里“ethtool -i”得到的version string是NIC driver的ethtool_drvinfo.version[]里面的字符串。
但是,并不是每个NIC driver都会在其ethtool_ops->get_drvinfo()中设置ethtool_drvinfo.version[]。

Upstream commit 6a7e25c7fb482dba3e80fec953f1907bcb24d52c Link description
为这样的driver提供了一个fallback的version string,也就是将kernel version string UTS_RELEASE拷贝到
ethtool_drvinfo.version[]中。

由于ethtool_drvinfo.version[]的大小是32字节,而UTS_RELEASE的大小是64字节,
因此函数ethtool_get_drvinfo()会将kernel version截断成32字节。

有没有可能将openEuler的内核version string限制在32字节以内?

评论 (4)

Hi x56Jason, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers.

Jason Zeng 创建了缺陷
openeuler-ci-bot 添加了
 
sig/Kernel
标签
展开全部操作日志

把内核version string限制在ethtool_drvinfo version的长度限制里看起来是不合理的耦合。是不是把kernel version作为ethtool_drvinfo version本身就不太合理?

把kernel version作为driver default version,对于kernel intree driver而言还是有用的,至少可以和out-of-tree driver区分开(如同一个driver两种不同模式下version的显示),尤其对于某些不是特别严格定义driver version的情况,至少看起来version显示会比较一致,不会太乱 :smile:

zhangjialin 任务类型缺陷 修改为任务
zhangjialin 修改了描述

Will this issue be ignored or resolved 22.03-SP3-Kernel-Release? Looks like the 22.03-SP3 is released: https://repo.openeuler.org/openEuler-22.03-LTS-SP3/

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(4)
5329419 openeuler ci bot 1632792936 5625574 stkid 1587900794
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助