TX2 limitation in setting MTU

Hello,

I have a question related to MTU of an Ethernet driver. As far as I remember in TX1 we could set any desired value to MTU.
Inside drivers/net/ethernet/nvidia/eqos/drv.c at function eqos_change_mtu():

if ((new_mtu != 1500) && (new_mtu != 4074) && (new_mtu != 9000)) {
                dev_err(&pdev->dev, "valid mtus are 1500, 4074, or 9000\n");
                return -EINVAL;
        }

Can I have some explanation regarding this limitation?
Why it’s restricted to only 3 values?
Is it a HW or SW limitation?

For example:

#ifconfig eth0 mtu 2000
SIOCSIFMTU: Invalid argument
#dmesg 
eqos 2490000.ether_qos: valid mtus are 1500, 4074, or 9000

Thanks

HI dshtaingus,

This issue should be fixed in rel-28.2 DP. Could you try it?

Hi WayneWWW.

Thanks for reply.
I’ll try to check it in a new release. But meanwhile I just wanted to verify the issue.
I mean, there must be a reason for that kind of behavior.
Is it made due to HW limitation/ bug fix/ something else?

Personally I just removed that test from driver, compiled and booted. I can set any MTU and ifconfig shows me the value I inserted. But I’m not sure that my solution is good enough and it will work.

Hi dshtaingus,

The original intention for these values (1500,4000,9000) was just to support most common jumbo frames size.

However, in fact it can be varied as you want. The only limitation of HW is that tx2 has a FIFO queue which can only support 9KB size, so the maximum limitation is 9000.

In rel-28.2 DP kernel source, it should be already modified.