1. 服务器/VPS/主机用户Telegram电报群: https://t.me/openos
    黑群晖 Synology Telegram电报群: https://t.me/nasfan
    排除公告

SA6400 内核5.10 编译 TCP_BBR 和 流控 Fq / Cake 模块

本帖由 Ardentwheel2023-10-23 发布。版面名称:群晖 Synology DSM

  1. Ardentwheel

    Ardentwheel Member

    注册:
    2019-01-31
    帖子:
    23
    下载ToolChain
    代码:
    wget https://cndl.synology.cn/download/ToolChain/toolchain/7.2-63134/AMD%20x86%20Linux%20Linux%205.10.55%20%28epyc7002%29/epyc7002-gcc1220_glibc236_x86_64-GPL.txz
    tar -Jxf epyc7002-gcc1220_glibc236_x86_64-GPL.txz
    
    下载 Linux-5.10.x 官方内核源代码
    代码:
    wget https://global.synologydownload.com/download/ToolChain/Synology%20NAS%20GPL%20Source/7.2-64570/epyc7002/linux-5.10.x.txz
    tar -Jxf linux-5.10.x.txz
    
    准备交叉编译
    代码:
    export ARCH=x86_64
    export CROSS_COMPILE=/home/parallels/synology/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-
    cd linux-5.10.x
    cp synology/synoconfigs/epyc7002 .config
    make oldconfig && make prepare && make modules_prepare && make scripts
    
    避免 version magic 错误
    修改文件 /linux-5.10.x/include/generated/utsrelease.h
    代码:
    #define UTS_RELEASE "5.10.55+"
    编译单个模块 BBR / Fq / Fq_codel / Fq_qie / Cake
    ⚠️注意:重新编译前要清理目录否则编译出错

    代码:
    make M=net/ipv4/ clean
    make M=net/ipv4/ CONFIG_TCP_CONG_BBR=m modules -j$(nproc)
    
    代码:
    make M=net/sched/ clean
    make M=net/sched/ CONFIG_NET_SCH_FQ=m CONFIG_NET_SCH_FQ_CODEL=m CONFIG_NET_SCH_PIE=m CONFIG_NET_SCH_FQ_PIE=m modules -j$(nproc)
    
    安装内核模块 BBR(复制模块到 /lib/modules/ 目录)
    代码:
    sudo cp /volume1/Exchange/tcp_bbr.ko /lib/modules/
    sudo chmod 644 /lib/modules/tcp_bbr.ko
    sudo insmod /lib/modules/tcp_bbr.ko
    
    安装内核模块 Fq / Fq_Codel / Fq_Pie / Cake (复制模块到 /lib/modules/ 目录)
    代码:
    sudo cp /volume1/Exchange/sch_*.ko /lib/modules/
    sudo chmod 644 /lib/modules/sch_*.ko
    sudo insmod /lib/modules/sch_*.ko
    
    查看可用流控
    启用 BBR 和 FQ流控
    代码:
    sysctl net.ipv4.tcp_congestion_control=bbr
    sysctl net.core.default_qdisc=fq
    
    设置为开机自动启用 BBR 和 FQ
    代码:
    sudo bash -c 'echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf'
    sudo bash -c 'echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf'
    
    设置为开机自动加载内核
    代码:
    sudo bash -c 'echo tcp_bbr > /usr/lib/modules-load.d/90-tcp_bbr.conf'
    sudo bash -c 'echo sch_fq > /usr/lib/modules-load.d/91-sch_fq.conf'
    sudo bash -c 'echo sch_fq_codel >> /usr/lib/modules-load.d/91-sch_fq.conf'
    sudo bash -c 'echo sch_pie > /usr/lib/modules-load.d/91-sch_pie.conf'
    sudo bash -c 'echo sch_fq_pie >> /usr/lib/modules-load.d/91-sch_pie.conf'
    sudo bash -c 'echo sch_cake > /usr/lib/modules-load.d/91-sch_cake.conf'
    sudo chmod 644 /usr/lib/modules-load.d/9*
    
    ⚠️注意:群晖修改/usr/lib/modules-load.d 需要更新 modules.dep 文件,否则会导致自动关机,修复方法如下
    代码:
    sudo ln -s /bin/kmod /usr/sbin/depmod
    sudo /sbin/depmod -a 2>/dev/null
    sudo systemctl restart systemd-modules-load
    
    额外的TCP连接优化
    代码:
    sudo bash -c 'echo "net.ipv4.tcp_fastopen=3" >> /etc/sysctl.conf'
    

    编译好的 TCP_BBR 以及 Fq / Fq_Codel / Fq_Pie / Cake
    隐藏内容:
    ******隐藏内容-请回复后再查看******
    ******You must reply before you can see the hidden data contained here.******
     
    最后编辑: 2023-11-06
    已获得 qq593490577 的点赞。
  2. ECHOOWV

    ECHOOWV New Member

    注册:
    2021-10-26
    帖子:
    21
    SA6400 内核5.10
     
  3. viceangel

    viceangel New Member

    注册:
    2023-03-17
    帖子:
    4
    大佬NB!!!
     
  4. wahaha520

    wahaha520 Member

    注册:
    2021-08-16
    帖子:
    32
    大佬NB!!!支持一下!!!
     
  5. rmbrgb

    rmbrgb New Member

    注册:
    2020-09-16
    帖子:
    16
    感谢。。。


    root@NAS:~# sysctl net.core.default_qdisc=fq
    sysctl: setting key "net.core.default_qdisc": No such file or directory
    net.core.default_qdisc = fq
     
    最后编辑: 2023-12-30
  6. qq593490577

    qq593490577 New Member

    注册:
    2021-02-16
    帖子:
    10
    学习学习学习学习
     
  7. asps1726

    asps1726 New Member

    注册:
    2024-01-21
    帖子:
    1
    大佬NB,学习学习
     
  8. qq358311703

    qq358311703 Member

    注册:
    2020-09-19
    帖子:
    57
    学习学习学习
     
  9. tunayoshi

    tunayoshi New Member

    注册:
    2024-02-02
    帖子:
    1
    学习学习学习
     
  10. zjz130183

    zjz130183 New Member

    注册:
    2019-07-20
    帖子:
    17
    学习学习学习