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

drivers/ethernet/eth_stm32_hal.c: net_pkt_write fails, when packet has size 1518 #83277

Open
clamattia opened this issue Dec 20, 2024 · 3 comments
Assignees
Labels
area: Ethernet bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32

Comments

@clamattia
Copy link
Contributor

When the system receives a packet with maximum payload (size 1518 including header), the driver fails with <err> eth_stm32_hal: eth_rx: Failed to append RX buffer to context buffer, rx_header->size=1518 (I added the length to the message).
This happens consistenly (we are using an ethernet test setup).

To reproduce, send a packet with maximum size.

Expected: The system does not fail, even with packets of maximal payload length.

Impact: This makes the driver unusable for our project. We need to find a solution.

Let me know if additional information is needed or, if I may test a patch on our setup.

@clamattia clamattia added the bug The issue is a bug, or the PR is fixing a bug label Dec 20, 2024
@clamattia
Copy link
Contributor Author

Still some length to go 4

@clamattia
Copy link
Contributor Author

Yes, allocation is faulty:
Data allocation maximum size 1514 (requested 1518)

Please also make it a warning in case we allocate less then requested and change message to Data allocation size 1514 (requested 1518), because it is not the 'maximum' it is the actual allocation size.

@clamattia
Copy link
Contributor Author

clamattia commented Dec 20, 2024

This would for example fix the problem. But maybe it is also somewhere else with NET_ETH_MAX_HDR_SIZE.

-ETH_NET_DEVICE_DT_INST_DEFINE(0, eth_initialize,
-		    NULL, &eth0_data, &eth0_config,
-		    CONFIG_ETH_INIT_PRIORITY, &eth_api, ETH_STM32_HAL_MTU);
+ETH_NET_DEVICE_DT_INST_DEFINE(0, eth_initialize,
+		    NULL, &eth0_data, &eth0_config,
+		    CONFIG_ETH_INIT_PRIORITY, &eth_api, ETH_STM32_HAL_FRAME_SIZE_MAX);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Ethernet bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32
Projects
None yet
Development

No branches or pull requests

5 participants