Skip to content

i.mxrt d-cache write-back mode with networking#8603

Merged
xiaoxiang781216 merged 3 commits into
apache:masterfrom
masayuki2009:imxrt-dcache-wb
Feb 21, 2023
Merged

i.mxrt d-cache write-back mode with networking#8603
xiaoxiang781216 merged 3 commits into
apache:masterfrom
masayuki2009:imxrt-dcache-wb

Conversation

@masayuki2009
Copy link
Copy Markdown
Contributor

@masayuki2009 masayuki2009 commented Feb 21, 2023

Summary

  • This PR consists of the following 3 commits
    • commit1: arch: imxrt: Fix CONFIG_IMXRT_ENET_ENHANCEDBD
      • I noticed that CONFIG_IMXRT_ENET_ENHANCEDBD is not correctly
        used though it is defined in Kconfig.
      • This commit fixes this issue.
    • commit2: arch: imxrt: Enable IMXRT_ENET_ENHANCEDBD if !ARMV7M_DCACHE_WRITETHROUGH
      • I noticed that there are two kinds of descriptors for imxrt_enet.c
      • The first one is the legacy descriptor and its size is 8bytes.
      • The second one is the enhanced descriptor and its size is 32bytes.
      • In both cases, we can not use a descriptor chain like stm32.
      • Considering cache line alignment, the second one is perfect because
        one descriptor fits the Cortex-M7 cache line which would fix networking
        stability issues in d-cache write-back mode.
    • commit3: boards: imxrt1060-evk: Add netnsh_dcache_wb configuration
      • This commit adds netnsh_dcache_wb configuration which enables
        d-cache write-back mode with networking.

Impact

  • imxrt ethernet in d-cache write-back mode

Testing

  • Tested with iperf, telnet and ping on imxrt1060-evk board
  • iperf -s 94Mbps, iperf -c 93Mbps

@masayuki2009 masayuki2009 requested a review from davids5 February 21, 2023 08:32
@masayuki2009
Copy link
Copy Markdown
Contributor Author

@davids5
I've just fixed i.mxrt d-cache write-back issues with networking.
Could you please review this PR?

@masayuki2009
Copy link
Copy Markdown
Contributor Author

Hmm, I think the following error does not relate to this PR.

====================================================================================
Configuration/Tool: stm32f4discovery/testlibcxx,CONFIG_ARM_TOOLCHAIN_GNU_EABI
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Building NuttX...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100 1836k  100 1836k    0     0  8916k      0 --:--:-- --:--:-- --:--:-- 8916k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100  539k  100  539k    0     0  2983k      0 --:--:-- --:--:-- --:--:-- 2983k
In file included from /github/workspace/sources/nuttx/include/libcxx/filesystem:241,
                 from libcxx/src/filesystem/operations.cpp:9:
In member function 'std::__1::_EnableIf<std::__1::__is_cpp17_forward_iterator<_InputIter>::value> std::__1::basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = const char*; _CharT = char; _Traits = std::__1::char_traits<char>; _Allocator = std::__1::allocator<char>]',
    inlined from 'std::__1::basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = const char*; <template-parameter-2-2> = void; _CharT = char; _Traits = std::__1::char_traits<char>; _Allocator = std::__1::allocator<char>]' at /github/workspace/sources/nuttx/include/libcxx/string:2195:11,
    inlined from 'std::__1::basic_string<_CharT, _Traits, _Allocator>& std::__1::basic_string<_CharT, _Traits, _Allocator>::__append_forward_unsafe(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = const char*; _CharT = char; _Traits = std::__1::char_traits<char>; _Allocator = std::__1::allocator<char>]' at /github/workspace/sources/nuttx/include/libcxx/string:2676:32,
    inlined from 'std::__1::basic_string<_CharT, _Traits, _Allocator>& std::__1::basic_string<_CharT, _Traits, _Allocator>::__append_forward_unsafe(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = const char*; _CharT = char; _Traits = std::__1::char_traits<char>; _Allocator = std::__1::allocator<char>]' at /github/workspace/sources/nuttx/include/libcxx/string:2662:1:
Error: /github/workspace/sources/nuttx/include/libcxx/string:2156:35: error: '__temp' may be used uninitialized [-Werror=maybe-uninitialized]
 2156 |         this->__throw_length_error();
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~^~

Summary:
- I noticed that CONFIG_IMXRT_ENET_ENHANCEDBD is not correctly
  used though it is defined in Kconfig.
- This commit fixes this issue.

Impact:
- None

Testing:
- Tested with imxrt1060-evk:netnsh_dcache_wb (will be added later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- I noticed that there are two kinds of descriptors for imxrt_enet.c
- The first one is the legacy descriptor and its size is 8bytes.
- The second one is the enhanced descriptor and its size is 32bytes.
- In both cases, we can not use a descriptor chain like stm32.
- Considering cache line alignment, the second one is perfect because
  one descriptor fits the Cortex-M7 cache line which would fix networking
  stability issues in d-cache write-back mode.

Impact:
- imxrt ethernet in d-cache write-back mode

Testing:
- Tested with ixmrt1060-evk:netnsh_dcache_wb (will be added later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
Summary:
- This commit adds netnsh_dcache_wb configuration which enables
  d-cache write-back mode with networking.

Impact:
- None

Testing:
- Tested with iperf, telnet and ping on imxrt1060-evk board
- iperf -s 94Mbps, iperf -c 93Mbps

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
@masayuki2009
Copy link
Copy Markdown
Contributor Author

Hmm, I think the following error does not relate to this PR.

Let me rebase to the latest master.

@masayuki2009
Copy link
Copy Markdown
Contributor Author

Let me rebase to the latest master.

Hmm, the build error still happens.

@xiaoxiang781216
Copy link
Copy Markdown
Contributor

Let's ignore the ci broken which is fixed by #8611 and merge this simple change.

@xiaoxiang781216 xiaoxiang781216 merged commit 5ef93ca into apache:master Feb 21, 2023
@masayuki2009 masayuki2009 deleted the imxrt-dcache-wb branch June 3, 2023 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants