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
NUC472/M487: Limit EMAC receive frame length as 1518 #12057
Conversation
@@ -262,6 +262,8 @@ void numaker_eth_init(uint8_t *mac_addr) | |||
EMAC_CAMCTL_ABP_Msk; | |||
EMAC->CAMEN = 1; // Enable CAM entry 0 | |||
|
|||
/* Limit the max receive frame length to 1514 + 4 */ | |||
EMAC->MRFL = 1518; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not be expressed based on NU_ETH_MAX_FLEN
or PACKET_BUFFER_SIZE
?
It might be that those are not quite defined right - I would expect the NU_ETH_MAX_FLEN
to be 1518, not 1520, and then maybe PACKET_BUFFER_SIZE should be that rounded up to 1520 (multiple of 4).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kjbracey-arm, thanks of your advisement, I correct the definition & relative code in this commit 42103f0.
@cyliangtw, thank you for your changes. |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Summary of changes
Limit the max receive frame length of EMAC to (1514 + 4) bytes.
According to the EMAC H/W design, this setting could avoid the risk of SRAM overwrite as while come-in some long packet over 1518 bytes.
Documentation
None
Pull request type
Test results
Reviewers