为什么关闭网卡的 RX offload 不起作用? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
请不要在回答技术问题时复制粘贴 AI 生成的内容
lysShub
V2EX    程序员

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

  •  
  •   lysShub 2024-12-18 14:34:18 +08:00 1595 次点击
    这是一个创建于 373 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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
    t/1053423

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

    内核 4.19.0-5-amd64
    lysShub
        5
    lysShub  
    OP
       2024-12-18 16:23:45 +08:00
    @loyfan 对就是虚拟机,bwg 的,我试了下阿里云的是有效的
    LGA1150
        6
    LGA1150  
       2024-12-18 17:51:21 +08:00
    KVM 的虚拟机,接收报文先经过宿主的网卡,我觉得只能关闭宿主的 GRO 功能才可以生效
    lysShub
        7
    lysShub  
    OP
       2024-12-19 15:03:37 +08:00
    @LGA1150 嗯 想也是,我现在打算手动给它拆分开,真麻烦!
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     1474 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 23ms UTC 16:38 PVG 00:38 LAX 08:38 JFK 11:38
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86