如何禁用已修复的 tx-checksum-ipv4

Ekk*_*kko 5 networking

我想用 ethtool 禁用 tx-checksum-ipv4 这是输出

ethtool -k eth0
Features for eth0:
rx-checksumming: off [fixed]
tx-checksumming: on
    tx-checksum-ipv4: on [fixed]
    tx-checksum-ip-generic: off [fixed]
    tx-checksum-ipv6: off [fixed]
    tx-checksum-fcoe-crc: off [fixed]
    tx-checksum-sctp: off [fixed]
scatter-gather: on
    tx-scatter-gather: on [fixed]
    tx-scatter-gather-fraglist: off [fixed]
tcp-segmentation-offload: off
    tx-tcp-segmentation: off [fixed]
    tx-tcp-ecn-segmentation: off [fixed]
    tx-tcp6-segmentation: off [fixed]
udp-fragmentation-offload: off [fixed]
generic-segmentation-offload: on
generic-receive-offload: on
large-receive-offload: off [fixed]
rx-vlan-offload: off [fixed]
tx-vlan-offload: off [fixed]
ntuple-filters: off [fixed]
receive-hashing: off [fixed]
highdma: off [fixed]
rx-vlan-filter: off [fixed]
vlan-challenged: off [fixed]
tx-lockless: off [fixed]
netns-local: off [fixed]
tx-gso-robust: off [fixed]
tx-fcoe-segmentation: off [fixed]
tx-gre-segmentation: off [fixed]
Run Code Online (Sandbox Code Playgroud)

tx-checksum-ipv4 已开启,我想禁用它

ethtool -K eth0 tx-checksum-ipv4 off
Run Code Online (Sandbox Code Playgroud)

我有

Could not change any device features
Run Code Online (Sandbox Code Playgroud)

我想知道如何禁用此 tx-checksum-ipv4。

Tgi*_*gul 0

简短回答:您使用的网络驱动程序应该实现一个禁用 tx-checksum-ipv4 的选项,否则它将在驱动程序加载时设置为默认状态并标记为“[固定]”。

更多信息:首先,每个功能支持由 include/linux/netdev-features.h 下的宏定义,tx-checksum-ipv4 由 NETIF_F_IP_CSUM 定义。每个驱动程序都设置其默认功能支持,因此如果包含 NETIF_F_IP_CSUM,则默认情况下将启用 tx-checksum-ipv4。

据我所知,TX 校验和的大多数子选项(ipv4、ipv6 等)本身并未公开。如果您的情况可能的话,您可以尝试完全禁用 TX 校验和,这应该禁用所有情况下的卸载。更改状态时您将看到实际的变化:

ethtool -K ens4f0 tx on
Actual changes:
tx-checksumming: on
        tx-checksum-ip-generic: on
tcp-segmentation-offload: on
        tx-tcp-segmentation: on
        tx-tcp6-segmentation: on
Run Code Online (Sandbox Code Playgroud)

您不仅可以看到支持的内部 TX 校验和更改,还可以看到相关的卸载。

如果没有驱动程序供应商和版本,很难给出准确的答案。请针对未来的问题指定更多信息。