Ethtool Structs元素以及它们是什么.在它们上定义了哪些设置和信息 [英] Ethtool Structs elements and what are they. What settings and info defined on them
问题描述
我正在从Intel E1000E
和Realtek r1869
驱动程序中读取驱动程序代码.我都喜欢这两种设备,
I am reading driver code from Intel E1000E
AND Realtek r1869
driver. I hvae the devices for both,
目前,我正在学习 ethtool_ops
.我知道Ethtool可以成为
Currently I am studying ethtool_ops
. I know Ethtool can be a tool for
长话短说,ethtool是显示和调整通用NIC/驱动程序参数的一种方式
(标识,接收和传输队列的数量,接收和传输卸载,您将其命名)
Long story short, ethtool is a means to display and adjust generic NIC/driver parameters
(identification, the number of receive and transmit queues, receive and transmit offloads, you > name it) in a userspace application
但是,如果您查看struct ethtool_ops
的结构,并非一切都十分清晰
But if you look at the struct ethtool_ops
not everythhing is crystal clear
下面是Ethtool的结构
Below is a Ethtool struct
static const struct ethtool_ops rtl8169_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
ETHTOOL_COALESCE_MAX_FRAMES,
.get_drvinfo = rtl8169_get_drvinfo,
.get_regs_len = rtl8169_get_regs_len,
.get_link = ethtool_op_get_link,
.get_coalesce = rtl_get_coalesce,
.set_coalesce = rtl_set_coalesce,
.get_regs = rtl8169_get_regs,
.get_wol = rtl8169_get_wol,
.set_wol = rtl8169_set_wol,
.get_strings = rtl8169_get_strings,
.get_sset_count = rtl8169_get_sset_count,
.get_ethtool_stats = rtl8169_get_ethtool_stats,
.get_ts_info = ethtool_op_get_ts_info,
.nway_reset = phy_ethtool_nway_reset,
.get_eee = rtl8169_get_eee,
.set_eee = rtl8169_set_eee,
.get_link_ksettings = phy_ethtool_get_link_ksettings,
.set_link_ksettings = phy_ethtool_set_link_ksettings,
};
我不知道的是此页面上的一些信息,例如,显示正在执行的设置.但是,当您查看该结构时,
What I don't get it is some info on this page, for example, show doing settings. But when you look at the struct much make no sense https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/monitoring-and-tuning-the-rx-ring-buffer_configuring-and-managing-networking
https://linoxide.com/linux-how-到/ethtool-command-with-examples/
所以我想知道如果我必须使用ethtool用户空间应用程序执行以下操作.那么哪个 ethtool_ops
函数可以处理此问题
So I like to know what if I have to do these following thinges using ethtool userspace application. then which ethtool_ops
function handlers this
-
显示丢弃的数据包数量:为此,我在RealTek的r8169驱动程序中具有
.get_ethtool_stats = rtl8169_get_ethtool_stats
.如果我错了,该信息由内核堆栈管理,请纠正我.
Displaying the number of dropped packets: I for that I have
.get_ethtool_stats = rtl8169_get_ethtool_stats,
in r8169 driver from RealTek. Correct me if I am wrong that this info managed by kernel stack.
增加RX环形缓冲区以降低高丢包率.我不知道结构 ethtool_ops
的哪个成员可以处理
Increasing the RX ring buffer to reduce a high packet drop rate. I couldn't figure out which member of struct ethtool_ops
handles this
可以通过最新的MAC和GMAC嵌入式设备中的'PAUSE'参数启用全双工中的流控制.
Flow control in full duplex can be enabled by 'PAUSE' parameter in the latest MAC and GMAC embedded devices.
设置双工模式
哪些函数处理程序会传输诸如分组分段传输的传输分段卸载之类的卸载
Which function handlers transmit offloads like Transmit segmentation offload for group sending of packets
TCP分段卸载.
还有什么是struct中的ksettings操作
Also what is ksettings operation in the struct
推荐答案
- 使用ethtool -h检查哪个命令负责相应的操作
- 在ethtool源代码中检查命令的处理方式
- 在内核侧检入net/ethtool/
还有一个一般性提示:基本上没有网络驱动程序可以实现所有ethtool功能.
And a general hint: Basically no network driver implements all ethtool functionalities.
这篇关于Ethtool Structs元素以及它们是什么.在它们上定义了哪些设置和信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!