How to limit the wlan0 speed of Jetson TX2

I try to install the “wondershaper” on TX2 board. I install wondershaper following: https://vitux.com/how-to-limit-network-bandwidth-in-ubuntu/

I use it well on my PC. But when using it on TX2 board, it has the error:

sudo wondershaper -a wlan0 -d 10 -u 40000
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
RTNETLINK answers: No such file or directory
modprobe: FATAL: Module ifb not found in directory /lib/modules/4.9.140-tegra
Cannot find device “ifb0”
RTNETLINK answers: No such file or directory
Cannot find device “ifb0”
bad action parsing
parse_action: bad value (5:mirred)!
Illegal “action”
Cannot find device “ifb0”
Cannot find device “ifb0”
Cannot find device “ifb0”

My uname info is: Linux eb504-desktop 4.9.140-tegra #1 SMP PREEMPT Wed Mar 13 00:30:11 PDT 2019 aarch64 aarch64 aarch64 GNU/Linux.

Does anyone can help me? Or suggest another method to limit the download and upload speed with given speed value.

Thanks,
Letian

I think this issue comes from missing below configuration in tegra_defconfig.

Please put this into tegra_defconfig and rebuild the kernel modules.
CONFIG_IFB=m

Hi WayneWWW,

I rebuild the kernel modules with CONFIG_IFB=m, but it doesn’t work.
I find that wondershaper need module “sched”. But I doesn’t find it in the /lib/modules/4.9.140-tegra/kernel/net.

Can you tell me the configuration I need to modify?
I use the method by https://github.com/jetsonhacks/buildJetsonTX2Kernel to build the kernel modules.
I don’t know how to edit the configuration by command “make menuconfig”.

Thanks,
Letian

“make menuconfig” brings up an app to search for and find various features. Answering with “m” enables the feature as a module (probably what you want), “y” puts the feature directly in the Image (probably not what you want), and “n” removes the feature. The “make menuconfig” application understands dependencies, and will enable or disable as needed. If it turns out that you need “sched”, and answer “m” to “CONFIG_IFB”, then this would also enable “sched” (direct edit of the .config would fail to do this). Note that not all features can be created as a module, although the bulk of them can.

Before you run “make menuconfig” you may need to add this to the compiling host:

sudo apt-get install libncurses5-dev

There are several variations on “make menuconfig” which provide different interfaces. I like the similar “make nconfig” because it allows searching for symbols (e.g., you could search for “ifb”). The full GUI version which I do not care for is “make xconfig”.

Any time you “make tegra_defconfig” you have all sane settings for starting for the Jetson. After this you can run “make nconfig” or “make menuconfig” and the starting values will be from the defconfig.

Note that what follows from the URLs referenced below will seem complicated, but it isn’t actually too difficult. Once you’ve set up for compile things get quite easy to build or configure. The official documentation basically is purely for cross compile (compile for aarch64 on an x86_64 PC host), and you can compile directly on a TX2. If you happen to have the cross tools installed on the host PC though, then you only need to set the right ARCH and CROSS_COMPILE environment variables).

About modules (“m”) versus integrated (“y”) features:
https://devtalk.nvidia.com/default/topic/1012382/jetson-tx2/usb-wifi-adapter-s-/post/5290682/#5290682

Here is some more general information:
https://devtalk.nvidia.com/default/topic/1038175/jetson-tx2/tx2i-wifi-support/post/5274619/#5274619

Thank you for you help. I find “make nconfig” is much better than “make menuconfig”.
After rebuild kernel modules CONFIG_IFB=m and some “NET_SCH_” modules, I can use “wondershaper” to limit the upload speed. But for limiting download speed, it also has some problems.
When I Redirect ingress (incoming) to egress ifb0 with command.
tc qdisc add dev wlan0 handle ffff: ingress
tc filter add dev wlan0 parent ffff: protocol ip u32 match u32 0 0
action mirred egress redirect dev ifb0

It has error:
RTNETLINK answers: No such file or directory
We have an error talking to the kernel

Best,
Letian

I do not know what the traffic shaping functions require, and you may need to find a Linux list related to that topic. However, if this is a file which is part of configuration, then perhaps you are just missing some user space package requirement (an ordinary apt package install operation). If the missing file is in “/dev/”, then you would still be missing a kernel feature.

I couldn’t say for sure, but perhaps run “dmesg --follow” to watch logs in one terminal, and then see what shows up at the moment of trying to enable or otherwise use the feature might cause the logs to print the particular file name.