Skip to content

Tagged frames can exceed standard Ethernet mtu of 1500 #1

@rrendec

Description

@rrendec

It is usual for untagged interfaces to receive frames of exactly 1500 (Ethernet maximum mtu) bytes data. However, when sent out on a tagged interface, these frames will be 1504 long and therefore will exceed the maximum Ethernet mtu.

When setting interfaces to "switchport mode trunk", LiSA should automagically set the mtu to 1504 on the device to avoid trouble. Unfortunately, many devices don't support "Jumbo Frames" (frames larger than standard Ethernet) in hardware and issue an error on set_mtu() if mtu is larger than 1500. In such case, LiSA should issue a warning when setting the port to trunk mode and perhaps advise the user to change all untagged interfaces mtu to 1496.

Case study: Broadcom Tg3 driver (drivers/net/tg3.c)

#define TG3_MAX_MTU(tp) \
    ((tp->tg3_flags2 & TG3_FLG2_JUMBO_CAPABLE) ? 9000 : 1500)
static int tg3_change_mtu(struct net_device *dev, int new_mtu)
{
    struct tg3 *tp = netdev_priv(dev);
    int err;

    if (new_mtu < TG3_MIN_MTU || new_mtu > TG3_MAX_MTU(tp))
        return -EINVAL;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions