Cannot change the L2 Max Frame Size to 1528 bytes in my LS1046A RDB

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot change the L2 Max Frame Size to 1528 bytes in my LS1046A RDB

126 Views
temax
Contributor I

Hi all!

I've been having a fascinating issue that I havent been able to resolve so far with my Layerscape LS1046A RDB board.

I read the reference manual for the board, and in the manual it says that the default max frame size for L2 Ethernet frames is 1536, so I wanted to double-check it since packets greater than 1518 bytes were producing this error in my OpenWRT:

fsl_dpaa_mac 1ae8000.ethernet ethfpga1: Err FD status = 0x00040020

So I instruemted the fman_get_max_frm() call in fman.c in my dpaa driver:

printk(KERN_EMERG "fman: max frame limit is %d\n", fsl_fm_max_frm);

Soon enough, after applying the patch, rebuilding and rebooting, dmesg was showing that the mac frame limit was 1522, which made sense since my 1519 bytes (1523 including FCS)was being rejected with that error code above. So this was my first concern, that the reference manual was not being respected somehow.

So, I decided to change it to 1528, and in that same file I saw this code:

/* Max frame size, across all interfaces.
 * Configurable from bootargs, to avoid allocating oversized (socket)
 * buffers when not using jumbo frames.
 * Must be large enough to accommodate the network MTU, but small enough
 * to avoid wasting skb memory.
 */
static int fsl_fm_max_frm = 1528;
module_param(fsl_fm_max_frm, int, 0);
MODULE_PARM_DESC(fsl_fm_max_frm, "Maximum frame size, across all interfaces");
 
The code is literally telling you to use bootargs, so I went ahead changed fsl_fm_max_frm  to 1528, harcoding it just for testing, and added it to my u-boot bootargs, and double-checked it with /proc/cmdline. It did not make a difference. Same error with a 1519-bytes packet.

Then, I checked fman_memac.c (since my interface is mEMAC) and fman_port.c, and saw that these are either getting the value from the prevoius call already, so the value is being propagated, in the case of memac, or using a jumbo frame limit of 9600, which is even more than I needed. I even checked the Rx FIFO size, and Max Rx FIFO size, and they are all good (12KB and 256K aprox, also more than I need).

So at this point I am a bit puzzled. My changes are not taking effect even though I am changing MAXFRM register via the above methods.

Two more things I was thinking to try:

1. Check for CONFIG_FSL_FM_MAX_FRAME_SIZE in /target/linux/layerscape/armv8_64b/config-5.10. But I didnt see anything there. I was hoping to find smth like this: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=8fdda1cc1033e2bd0d048188af5167faffbf9b...

If you see the code changes, it mentiones config-4.9, so apparently this has worked for someone before.
 
2. Look for the same config parameter in menuconfig, but it is not there.

Thus, I could try to add it manually in my .config or in the config-5.10, and see what happens, but I wanted to first ask the community to see what you think. I had no idea changing the L2 max frame size could be this cumbersome. 

Any ideas are highly appreciated!
Tags (1)
0 Kudos
Reply
2 Replies

69 Views
temax
Contributor I

Thanks for the suggestion, yipingwang! I will use othbootargs and reply back next week. ALthough even when using bootargs, I was able to see that the kernel was indeed receiving the correct parameter, as I checked /proc/cmdline but was still getting the error. Still, I will try this.

As per the CONFIG_FSL_FM_MAX_FRAME_SIZE Kconfig option, unfortunately it does not show up in my OpenWRT flavor, as I dont have a vanilla Linux kernel. In fact, none of those options exist, not with menuconfig nor kernel_menuconfig.

Thanks a lot!

0 Kudos
Reply

85 Views
yipingwang
NXP TechSupport
NXP TechSupport

1. Under u-boot prompt, you could use the following in bootargs.

=>setenv othbootargs "fsl_fm_max_frm=1528"

=>saveenv

2. The second method, please do the following command configuration in Linux Kernel.

As a Kconfig option (CONFIG_FSL_FM_MAX_FRAME_SIZE):
Device Drivers
+-> Network device support
  +-> Ethernet driver support
    +-> Freescale devices
        +-> Frame Manager support
           +-> Freescale Frame Manager (datapath) support
               +-> Maximum L2 frame size

0 Kudos
Reply