Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying Ethernet MTU in esp-netif API (IDFGH-14560) #15319

Open
3 tasks done
indexds opened this issue Feb 2, 2025 · 0 comments
Open
3 tasks done

Modifying Ethernet MTU in esp-netif API (IDFGH-14560) #15319

indexds opened this issue Feb 2, 2025 · 0 comments
Assignees
Labels
Status: Opened Issue is new

Comments

@indexds
Copy link

indexds commented Feb 2, 2025

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Hi,

I'm looking to make my ethernet netif's mtu match that of wireguard at 1420 to prevent fragmentation, but the default is 1500 and that doesn't seem changeable at all.
Since the rust wrappers in esp-idf-svc are using the esp-netif api to create interfaces, the raw lwip interface is abstracted and we can't access the mtu. And even if we could (it's most likely possible through shenanigans) I'm pretty sure changing the mtu at runtime is gonna make everything explode.

Soooo... How do we create a netif with a custom mtu? Is it even possible?

From what I could see the mtu is hardcoded here,

/**
 * In this function, the hardware should be initialized.
 * Invoked by ethernetif_init().
 * @param netif lwip network interface which has already been initialized
 */
static void ethernet_low_level_init(struct netif *netif)
{
    netif->mtu = 1500;
    ...
}

And this function is called by

/**
 * @brief   LWIP's network stack init function for Ethernet
 * @param netif LWIP's network interface handle
 * @return ERR_OK on success
 */
err_t ethernetif_init(struct netif *netif);

Which should be the init function passed when initializing an ethernet netif.

Is the mtu parameter just not exposed at all? In which case, what would be required to expose it in the api?

@indexds indexds changed the title MTU in esp-idf Modifying Ethernet MTU in esp-netif API Feb 2, 2025
@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 2, 2025
@github-actions github-actions bot changed the title Modifying Ethernet MTU in esp-netif API Modifying Ethernet MTU in esp-netif API (IDFGH-14560) Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

3 participants