【问题标题】:Ethtool Structs elements and what are they. What settings and info defined on themEthtool 结构元素和它们是什么。他们定义了哪些设置和信息
【发布时间】:2021-02-16 16:21:52
【问题描述】:

我正在读取来自 Intel E1000E AND Realtek r1869 驱动程序的驱动程序代码。我有这两个设备,

目前我正在学习ethtool_ops。我知道 Ethtool 可以成为一个工具

长话短说,ethtool 是一种显示和调整通用 NIC/驱动程序参数的方法
(标识,接收和传输队列的数量,接收和传输卸载,你>命名它)在用户空间应用程序中

但是如果你查看结构 ethtool_ops 并不是一切都一清二楚

下面是一个 Ethtool 结构

        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,
        };

我不明白的是这个页面上的一些信息,例如,显示正在做的设置。但是,当您查看结构时,这毫无意义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-to/ethtool-command-with-examples/

所以我想知道如果我必须使用 ethtool 用户空间应用程序执行以下这些操作,该怎么办。然后哪个ethtool_ops 函数处理这个

  1. 显示丢弃数据包的数量:为此,我在 RealTek 的 r8169 驱动程序中有 .get_ethtool_stats = rtl8169_get_ethtool_stats,。如果我错了这个信息由内核堆栈管理,请纠正我。

  2. 增加 RX 环形缓冲区以降低高丢包率。我不知道 struct ethtool_ops 的哪个成员处理这个

  3. 在最新的 MAC 和 GMAC 嵌入式设备中,可以通过“PAUSE”参数启用全双工流控制。

  4. 设置双工模式

  5. 哪些函数处理程序传输卸载,例如传输分段卸载以分组发送数据包

  6. TCP 分段卸载。

还有什么是结构体中的ksettings操作

【问题讨论】:

    标签: linux driver linux-device-driver intel ethernet


    【解决方案1】:
    1. 使用 ethtool -h 检查哪个命令负责相应的操作
    2. 查看 ethtool 源代码如何处理命令
    3. 在内核端签入 net/ethtool/

    一般提示:基本上没有网络驱动程序实现所有 ethtool 功能。

    【讨论】:

      猜你喜欢
      • 2010-12-03
      • 2010-09-06
      • 1970-01-01
      • 2016-10-24
      • 2012-05-30
      • 1970-01-01
      • 2013-10-10
      • 2014-10-23
      • 1970-01-01
      相关资源
      最近更新 更多