bsp: hpmicro: clear full ENET buffers#11581
Open
Old-Ding wants to merge 1 commit into
Open
Conversation
rt_hw_eth_init() clears ENET descriptor tables using element size times count, but the RX/TX data buffers used sizeof(size), which only covers the width of the size field. Use the configured buffer count and size so the whole RX/TX buffer areas are initialized before handing them to the ENET descriptor configuration. Generated-by: OpenAI Codex Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Clear the full HPMicro ENET RX/TX data buffer regions during
rt_hw_eth_init().Why
The descriptor tables are cleared with
sizeof(desc) * count, but the RX/TX data buffers usedsizeof(...->size). That only clears the width of thesizefield instead of the configured buffer storage.The buffer configs are initialized from the static
[COUNT][SIZE]RX/TX arrays and then copied into the ENET descriptor configuration asbuffer,count, andsize, so the init clear should covercount * sizebytes.Testing
git diff --checkgit diff --check HEAD~1 HEADgit show --stat --check --format=fuller HEADgit ls-files --eol -- bsp/hpmicro/libraries/drivers/drv_enet.ctotal_count: 0for:repo:RT-Thread/rt-thread hpmicro drv_enet sizeof rx_buff_cfg size is:prrepo:RT-Thread/rt-thread hpmicro drv_enet sizeof rx_buff_cfg size is:issuerepo:RT-Thread/rt-thread drv_enet tx_buff_cfg buffer memset sizeof is:prrepo:RT-Thread/rt-thread drv_enet tx_buff_cfg buffer memset sizeof is:issueNot run locally:
scons,make,gcc,arm-none-eabi-gcc, andclangare not installed