Banana Pi BPI-R3 Ubuntu 22.04 Traffic Control Error

When creating a ingress qdisc on our capture interface eth0 on Traffic Control : ubuntu@host-1:~$ sudo tc qdisc add dev eth0 handle ffff: ingress the system issues a message: “Error: Cannot find ingress queue for specified device”.

Device: Banana Pi BPI-R3 with MediaTek MT7986(Filogic 830) OS : Ubuntu 22.04 (2022-12-18-ubuntu-22.04-server-bpi-r3-aarch64-sd-emmc.img)

Isn’t eth0 connected to the dsa switch? Check with

ip link

Does it say lan1@eth0 ?

Then only bring up eth0 and further do not use eth0.

Yes, bpi-r3 uses first gmac for switch-chip (wan,lan0-3) and second one for sfp

tried using external usb ethernet:

sudo tc qdisc add dev enx7cc2c645c3bf handle ffff: ingress

sudo tc filter add dev enx7cc2c645c3bf parent ffff: protocol all u32 match u32 0 0 action mirred egress mirror dev eth1

Error: Failed to load TC action module. We have an error talking to the kernel

Ok,do not know vendor kernel…i use mainline kernel with patches. But afair i have not added tc yet too.

Idk if my kernel can be used with the vendor image,but you can try my ubuntu-image and kernel from my repo after adding tc module(s)

If you tell me which are needed,i add them to defconfig

i used your image ubuntu 22.04 image with kernel 6.1.12/uboot 2023.01

sorry for not providing kernel info right away… Could you add support for tc ?

mhm, seems the QOS-Options are already enabled

$ grep 'CONFIG_NET_SCH' ../build/.config
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBQ=m
CONFIG_NET_SCH_HTB=m
# CONFIG_NET_SCH_HFSC is not set
CONFIG_NET_SCH_PRIO=m
# CONFIG_NET_SCH_MULTIQ is not set
CONFIG_NET_SCH_RED=m
# CONFIG_NET_SCH_SFB is not set
CONFIG_NET_SCH_SFQ=m
CONFIG_NET_SCH_TEQL=m
CONFIG_NET_SCH_TBF=m
# CONFIG_NET_SCH_CBS is not set
# CONFIG_NET_SCH_ETF is not set
# CONFIG_NET_SCH_TAPRIO is not set
CONFIG_NET_SCH_GRED=m
CONFIG_NET_SCH_DSMARK=m
# CONFIG_NET_SCH_NETEM is not set
# CONFIG_NET_SCH_DRR is not set
# CONFIG_NET_SCH_MQPRIO is not set
# CONFIG_NET_SCH_SKBPRIO is not set
# CONFIG_NET_SCH_CHOKE is not set
# CONFIG_NET_SCH_QFQ is not set
# CONFIG_NET_SCH_CODEL is not set
CONFIG_NET_SCH_FQ_CODEL=y
# CONFIG_NET_SCH_CAKE is not set
# CONFIG_NET_SCH_FQ is not set
# CONFIG_NET_SCH_HHF is not set
# CONFIG_NET_SCH_PIE is not set
CONFIG_NET_SCH_INGRESS=m
# CONFIG_NET_SCH_PLUG is not set
# CONFIG_NET_SCH_ETS is not set
CONFIG_NET_SCH_DEFAULT=y
CONFIG_NET_SCH_FIFO=y

wonder whats missing when you use my ubuntu-image

You could do this too in running system with zgrep and /proc/config.gz

i do not get an error when running tc command on my ubuntu-image with updated (changes for wifi) kernel

root@bpi-r3:~# tc qdisc add dev wan  handle ffff: ingress          
root@bpi-r3:~# lsmod                                                            
Module                  Size  Used by                                           
sch_ingress            16384  1
...
root@bpi-r3:~# zgrep 'CONFIG_NET_SCH' /proc/config.gz                           
CONFIG_NET_SCHED=y                                                              
CONFIG_NET_SCH_CBQ=m                                                            
CONFIG_NET_SCH_HTB=m                                                            
# CONFIG_NET_SCH_HFSC is not set                                                
CONFIG_NET_SCH_PRIO=m                                                           
# CONFIG_NET_SCH_MULTIQ is not set                                              
CONFIG_NET_SCH_RED=m    
...

your output above does not look like my image…

root@bpi-r3:~# root@bpi-r3:~# lsmod
Module                  Size  Used by
ax88179_178a           32768  0
usbnet                 40960  1 ax88179_178a
mii                    20480  2 usbnet,ax88179_178a
fuse                  126976  1
ip_tables              32768  0
x_tables               40960  1 ip_tables
root@bpi-r3:~# zgrep 'CONFIG_NET_SCH' /proc/config.gz
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBQ=m
CONFIG_NET_SCH_HTB=m
# CONFIG_NET_SCH_HFSC is not set
CONFIG_NET_SCH_PRIO=m
# CONFIG_NET_SCH_MULTIQ is not set
CONFIG_NET_SCH_RED=m
# CONFIG_NET_SCH_SFB is not set
CONFIG_NET_SCH_SFQ=m
CONFIG_NET_SCH_TEQL=m
CONFIG_NET_SCH_TBF=m
# CONFIG_NET_SCH_CBS is not set
# CONFIG_NET_SCH_ETF is not set
# CONFIG_NET_SCH_TAPRIO is not set
CONFIG_NET_SCH_GRED=m
CONFIG_NET_SCH_DSMARK=m
# CONFIG_NET_SCH_NETEM is not set
# CONFIG_NET_SCH_DRR is not set
# CONFIG_NET_SCH_MQPRIO is not set
# CONFIG_NET_SCH_SKBPRIO is not set
# CONFIG_NET_SCH_CHOKE is not set
# CONFIG_NET_SCH_QFQ is not set
# CONFIG_NET_SCH_CODEL is not set
CONFIG_NET_SCH_FQ_CODEL=y
# CONFIG_NET_SCH_CAKE is not set
# CONFIG_NET_SCH_FQ is not set
# CONFIG_NET_SCH_HHF is not set
# CONFIG_NET_SCH_PIE is not set
CONFIG_NET_SCH_INGRESS=m
# CONFIG_NET_SCH_PLUG is not set
# CONFIG_NET_SCH_ETS is not set
CONFIG_NET_SCH_DEFAULT=y
CONFIG_NET_SCH_FIFO=y
root@bpi-r3:~# tc qdisc add dev wan  handle ffff: ingress
root@bpi-r3:~# lsmod
Module                  Size  Used by
cls_u32                24576  0
sch_ingress            16384  1
ax88179_178a           32768  0
usbnet                 40960  1 ax88179_178a
mii                    20480  2 usbnet,ax88179_178a
fuse                  126976  1
ip_tables              32768  0
x_tables               40960  1 ip_tables
root@bpi-r3:~# sudo tc filter add dev wan parent ffff: protocol all u32 match u32 0 0 action mirred egress mirror dev eth1
Error: Failed to load TC action module.
We have an error talking to the kernel
root@bpi-r3:~#

Could you try enabling the other net_sch modules and try if all works?

Have not done much with tc

Edit: It looks the actions can have addition kernel symbols CONFIG_NET_ACT_*

edit2:

seems these are missing in my kernel…

$ grep 'CONFIG_NET_ACT_' ../build/.config 
# CONFIG_NET_ACT_POLICE is not set
# CONFIG_NET_ACT_GACT is not set
# CONFIG_NET_ACT_MIRRED is not set
# CONFIG_NET_ACT_SAMPLE is not set
# CONFIG_NET_ACT_IPT is not set
# CONFIG_NET_ACT_NAT is not set
# CONFIG_NET_ACT_PEDIT is not set
# CONFIG_NET_ACT_SIMP is not set
# CONFIG_NET_ACT_SKBEDIT is not set
# CONFIG_NET_ACT_CSUM is not set
# CONFIG_NET_ACT_MPLS is not set
CONFIG_NET_ACT_VLAN=m
# CONFIG_NET_ACT_BPF is not set
# CONFIG_NET_ACT_CONNMARK is not set
# CONFIG_NET_ACT_CTINFO is not set
# CONFIG_NET_ACT_SKBMOD is not set
# CONFIG_NET_ACT_IFE is not set
# CONFIG_NET_ACT_TUNNEL_KEY is not set
# CONFIG_NET_ACT_CT is not set
# CONFIG_NET_ACT_GATE is not set

edit3: added a commit to add the most of them…github ci is currently building…then you can download the new version from releases page

If I understand correctly, modules are added when the kernel is built? Could you provide a link to the kernel build instructions for BPI-r3?

You have to rebuild kernel and install it for new modules

there are same as for other boards in my repo…

change board in build.conf to bpi-r3

  • ./build.sh importconfig
  • ./build.sh config #optional, if you want to add anything
  • ./build.sh #asks for pack/install-to-sd at the end

edit: tested your commands with 6.3-rc (which uses same defconfig with action-options from 6.1), no error there

 $ git clone https://github.com/frank-w/BPI-Router-Linux.git 
 
before crash:

    Cloning into 'BPI-Router-Linux'...
    remote: Enumerating objects: 10342095, done.
    remote: Counting objects: 100% (118254/118254), done.
    remote: Compressing objects: 100% (38161/38161), done.
    remote: Total 10342095 (delta 86813), reused 99445 (delta 79824), pack-reused 10223841
    Receiving objects: 100% (10342095/10342095), 3.43 GiB | 6.06 MiB/s, done.
    Resolving deltas:  60% (5282251/8716479)

    crash:

    fatal: fetch-pack: invalid index-pack output

Do you clone to a x86 device with enough ram? Looks like you clone to some kind of limited device (ram,disk space) which failes because the full repo is too big (afaik base repo is approx 8gb,with multiple remotes like i have and some local only branches i have 14gb).

You can try to download a shallow clone:

git clone --depth 1 --single-branch --branch 6.1-main https://github.com/frank-w/BPI-Router-linux

Adjust depth to have deeper git commit log

I built the kernel, built the initramfs… Can you help me build itb and add it to Uboot? What should be the download path?

Why do you need an initramfs? You have the ubuntu rootfs…just build kernel and install to the sdcard