Hey,
to reduce the CPU load for network transfer via UDP, I was thinking about setting up a larger MTU than the standard 1500 byte one. While my switch supports 9000 bytes and my desktop PC was cooperative in changing the setting to that, when I tried to change it via ifconfig on the iMX6 board to a higher value than 1500, it said the parameter was invalid.
Is this a hardware limit for this board, or is there anything in the Linux configuration that would change support for larger frames?
For context: (maybe someone has other hints)
Another device currently sends UDP packets of 1360 bytes payload with a very stable data rate of roughly 30 MByte/sec. It’s connected via a gigabit ethernet switch to the Apalis board.
On the iMX6 dual core, I have a program that’s basically a while(true) loop calling recv(…) on a socket set up for UDP, and a little bit of stats keeping, the performance impact of which is negligible.
The averaged total CPU load shown by the “uptime” command is ~35%, tload roughly agrees. Htop shows one core roughly at 22% sometimes peaking 30%, the other core at 53% peaking at 60%, roughly.
I had set the CPU affinity of my process to core1, so that not everything (incl the interrupts and system calls) runs on core0 which could max out and cause packet loss if something else is running.
So right now it looks like a 4-core version is needed to really do useful things on the CPU, which is significantly busy with data shoveling (I’m not really processing the data yet, just peeking at headers to check integrity).
Before that, I’d like to see if the CPU load can be reduced somehow… and reducing overhead / interrupt frequency by larger UDP packet size is about the only remaining thing that comes to mind now.
Side note: (or should this be an own thread?)
Why was I actually able to set CPU affinity on the iMX6, which in Toradex’ Linux image (see below under Environment), is compiled with CONFIG_CPUSET option disabled? While I am not able to set CPU affinity on the TK1 board - no surprize there, it also has CPUSET disabled.
I’m contemplating building a new Linux image with that option, but these observations make me doubt whether the effort is warranted by certain success - although the above described relation between the config option and availability of said functionality is what I gathered from the manpages* of sched_setaffinity and links there, I must now doubt my understanding.
- The manpages tell about certain files that need to be present as an indicator of whether affinity is supported, e.g. cpuset(7) - Linux man page says there should be a “nodev cpuset” in /proc/filesystems. Not seeing those, I stumbled upon the CPUSET option.