V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
lysShub
V2EX  ›  程序员

为什么关闭网卡的 RX offload 不起作用?

  •  
  •   lysShub · 4 天前 · 577 次点击

    raw socket 读取到 Reassemble 不好处理,我把 offload 都关了:

    Features for eth0:
    rx-checksumming: on [fixed]
    tx-checksumming: on
            tx-checksum-ipv4: off [fixed]
            tx-checksum-ip-generic: on
            tx-checksum-ipv6: off [fixed]
            tx-checksum-fcoe-crc: off [fixed]
            tx-checksum-sctp: off [fixed]
    scatter-gather: on
            tx-scatter-gather: on
            tx-scatter-gather-fraglist: off [fixed]
    tcp-segmentation-offload: off
            tx-tcp-segmentation: off
            tx-tcp-ecn-segmentation: off
            tx-tcp-mangleid-segmentation: off
            tx-tcp6-segmentation: off
    udp-fragmentation-offload: off
    generic-segmentation-offload: off
    generic-receive-offload: off
    large-receive-offload: off [fixed]
    rx-vlan-offload: off [fixed]
    tx-vlan-offload: off [fixed]
    ntuple-filters: off [fixed]
    receive-hashing: off [fixed]
    highdma: on [fixed]
    rx-vlan-filter: on [fixed]
    vlan-challenged: off [fixed]
    tx-lockless: off [fixed]
    netns-local: off [fixed]
    tx-gso-robust: on [fixed]
    tx-fcoe-segmentation: off [fixed]
    tx-gre-segmentation: off [fixed]
    tx-gre-csum-segmentation: off [fixed]
    tx-ipxip4-segmentation: off [fixed]
    tx-ipxip6-segmentation: off [fixed]
    tx-udp_tnl-segmentation: off [fixed]
    tx-udp_tnl-csum-segmentation: off [fixed]
    tx-gso-partial: off [fixed]
    tx-sctp-segmentation: off [fixed]
    tx-esp-segmentation: off [fixed]
    tx-udp-segmentation: off [fixed]
    fcoe-mtu: off [fixed]
    tx-nocache-copy: off
    loopback: off [fixed]
    rx-fcs: off [fixed]
    rx-all: off [fixed]
    tx-vlan-stag-hw-insert: off [fixed]
    rx-vlan-stag-hw-parse: off [fixed]
    rx-vlan-stag-filter: off [fixed]
    l2-fwd-offload: off [fixed]
    hw-tc-offload: off [fixed]
    esp-hw-offload: off [fixed]
    esp-tx-csum-hw-offload: off [fixed]
    rx-udp_tunnel-port-offload: off [fixed]
    tls-hw-tx-offload: off [fixed]
    tls-hw-rx-offload: off [fixed]
    rx-gro-hw: off [fixed]
    tls-hw-record: off [fixed]
    

    无论是 tcpdump ,还是 raw/eth socket 都会读取到大于 mtu 的 tcp 数据包, 一时整的我没辙了。

    相关资料: https://v2ex.com/t/917581
    https://github.com/wangyu-/udp2raw/issues/226
    https://www.v2ex.com/t/1053423

    7 条回复    2024-12-19 15:03:37 +08:00
    1423
        1
    1423  
       4 天前
    之前研究过,包括 UDP 转发, 伪装 TCP. 都很容易碰到这类问题
    LGA1150
        2
    LGA1150  
       4 天前
    提供内核版本和网卡型号,我查一下代码
    loyfan
        3
    loyfan  
       4 天前
    这是虚机还是物理机?
    虚机网卡是特殊的
    lysShub
        4
    lysShub  
    OP
       4 天前
    @LGA1150
    云主机网卡似乎查不到 Red Hat, Inc Virtio network device

    内核 4.19.0-5-amd64
    lysShub
        5
    lysShub  
    OP
       4 天前
    @loyfan 对就是虚拟机,bwg 的,我试了下阿里云的是有效的
    LGA1150
        6
    LGA1150  
       4 天前
    KVM 的虚拟机,接收报文先经过宿主的网卡,我觉得只能关闭宿主的 GRO 功能才可以生效
    lysShub
        7
    lysShub  
    OP
       3 天前
    @LGA1150 嗯 想也是,我现在打算手动给它拆分开,真麻烦!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3680 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 04:19 · PVG 12:19 · LAX 20:19 · JFK 23:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.