Bpi-r4 10gbe sfp mtu only support 2k

Device: Banana Pi BPI-R4 Firmware: OpenWrt 24.10.2 Interface tested: eth1 Test method:

for mtu in $(seq 9500 -100 1500); do echo -n "Testing MTU $mtu … " if ip link set dev eth1 mtu $mtu 2>/dev/null; then echo “:white_check_mark: supported” else echo “:x: unsupported” fi done

Test Results:

Testing MTU 9500 … :x: unsupported
Testing MTU 9400 … :x: unsupported
Testing MTU 9300 … :x: unsupported
… Testing MTU 2100 … :x: unsupported
Testing MTU 2000 … :white_check_mark: supported
Testing MTU 1900 … :white_check_mark: supported
Testing MTU 1800 … :white_check_mark: supported
Testing MTU 1700 … :white_check_mark: supported
Testing MTU 1600 … :white_check_mark: supported
Testing MTU 1500 … :white_check_mark: supported

Summary:

MTU values above 2000 are not supported on eth1.

Maximum supported MTU: 2000 bytes

All standard and slightly extended MTU values (1500–2000) are working as expected.

Jumbo frames (MTU > 2000) are currently not supported on this interface with OpenWrt 24.10.2.

If anyone knows whether this is a hardware limitation of the MT7988 SoC, or a driver/configuration limitation (e.g., DSA or MTK HNAT driver), further insights would be appreciated.

for gigabit ports It’s a hardware limitation for gigabit ports (mentioned in datasheet) for USXGMII ports (10G , 2.5G) - it is mentioned that it is possible to have up to 15k frames , but simple setting controllers registers to use frames larger than 2k in driver leads to frames drops for frames larger than 2k , which means that some additional setup (like ring byffers adjustment, DMA tranfers setup etc.) is missing and needs to be done to actually support jumbo frames. Also , worth mentioning that using frames larger than 2k may be incompatible with some hardware accelerations

My response may help to add 9k support

But possibly (like valentin wrote) it breaks other parts.

Ictually , I’ve tried this patch and it doesn’t work out of the box , setting mtu to anything > 2k leads to broken reception

Ok,but youve tested without rss/lro so far…directly on ethernet driver and with mac (eth1,eth2),not switch.

for gmac and FE the MTU is limited by MAC MCR registers

2k is maximal MTU , anything more you set will be ignored so there is no point at all to use anything more than 2k on gigabit ports

in other hand for XFI Mac interfaces you have a different register for packet size configuration

which lets you to set upto 16k packet MTU

I’ve tested with and without rss/lro and only for XFI interfaces , no matter what is selected , as soon as MTU goes over 2022 - all frames are dropped. I believe that getting JUMBO frames working even without rss/lro makes sense , because it reduces overal interrupts count

patches from mtk for 6.6 kernel

How to enable jumbo frame?

MT7986/81/87: Change MTK_MAX_RX_LENGTH from default to MTK_MAX_RX_LENGTH_2K.

MT7988: Change MTK_MAX_RX_LENGTH from default to MTK_MAX_RX_LENGTH_9K.

https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/5f4624aa155af460eaaee5f3b740fb879b033a07/autobuild/unified/filogic/24.10/files/target/linux/mediatek/patches-6.6/999-2725-net-ethernet-mtk_eth_soc-change-default-rx-buffer-length.patch

https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/5f4624aa155af460eaaee5f3b740fb879b033a07/autobuild/unified/filogic/24.10/files/target/linux/mediatek/patches-6.6/999-2726-net-ethernet-mtk_eth_soc-add-9k-jumbo-frame-support.patch

There are no such restrictions on MT7981. I have 12k jumbo frames working.

maybe something is missing in 6.6, MTK pointed me to 5f4624aa155af460eaaee5f3b740fb879b033a07 - openwrt/feeds/mtk-openwrt-feeds - Gitiles

patch is different so far, but both not touching the dma sizes

@romanovj
There are no such restrictions on many other cpus , probably this limitation is there because of FE/GDM engines, it also could be if you disable FE/GDM completelly and will set global and per MTU registers , it will allow you to use higher MTU , but you’ll also going to need to update the driver

BTW , what driver are you using with your MT7981 ? because the one that in the kernel tree is also limiting MT7981 to 2K frame length. Can you share your driver with 12K MTU support ?

@frank-w it’s different but it uses same MTK_XMAC_RX_CFG2 register and MTU size function uses mtk_interface_mode_is_xgmii check (only for 10G MAC’s ) to allow 9K MTU - so larger MTU is applicable only to 10G ports

My own version, which doesn’t work with mt7988, I didn’t attempt to fix. Maximum mtu for mt7981&mt7531 - 12290

jumbo.patch

https://gist.githubusercontent.com/romanovj/07f0419a06d3d337eb564193ba09d6a6/raw/5e1895a4897dc9956952573d4bc957e84f34d993/jumbo.patch

page pool patch

https://gist.githubusercontent.com/romanovj/07f0419a06d3d337eb564193ba09d6a6/raw/5e1895a4897dc9956952573d4bc957e84f34d993/pp.patch

ps. mtk devs have used my idea of dynamic RX allocation in 5.4 kernel

Any idea whats missing for mt7988?

Most likely, the BPI-R4 board itself also has issues. Currently, various tests are being conducted, and there are stability problems with the PCIe interfaces.