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

openthread_border_router: Recover from RCP communication issue #3887

Merged
merged 6 commits into from
Jan 9, 2025

Conversation

agners
Copy link
Member

@agners agners commented Jan 8, 2025

This mainly enables RCP (Spinel) communication recovery feature which should allow the OTBR to recover from "radio tx timeout" errors.

Additionally, it tweaks configuration slightly to attempt to lower the amount of "Failed to get forwarded frame priority". Note that these type of messages are not critical: It mearly means that the priority of a fragment could not be determined, and a default priority will be applied. The OTBR will still forward the frame.

Summary by CodeRabbit

Release Notes for OpenThread Border Router v2.12.3

  • New Features

    • Improved radio transmission resilience with recovery mechanisms.
    • Enhanced network route prioritization.
  • Performance Improvements

    • Increased mesh header fragmentation tag entries to reduce log messages.
    • Optimized network interface route metric configuration.
  • Configuration Updates

    • Updated to version 2.12.3.
    • Added new compile-time configuration options for better customization.
    • Introduced openthread-core-ha-config-posix.h for specific configuration settings.

agners added 4 commits January 8, 2025 15:58
Add a project specific OpenThread compile time configuration header
file for the OTBR add-on. This allows to configure OpenThread compile
time configs which are not exposed through the CMake build system.
This allows to drop the default route metric patch file and use the
config header file instead.
Increase the number of mesh header fragmentation tag entries to
potentially lower the amount of "Failed to get forwarded frame priority"
notice messages in logs.
Try to restore the communication with the RCP in case it stalls out.
Some users see "radio tx timeout" errors. It is not quite clear what
causes those, it could be firmware crashes or failures in the underlying
communication layer. With this option set, the OTBR will automatically
restore the communication, and if the fimrware supports it, also request
a crash dump (requires debug logging).
@agners agners marked this pull request as ready for review January 9, 2025 14:47
Copy link
Contributor

coderabbitai bot commented Jan 9, 2025

Warning

Rate limit exceeded

@agners has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7d306a2 and eb74b7b.

📒 Files selected for processing (1)
  • openthread_border_router/CHANGELOG.md (1 hunks)
📝 Walkthrough

Walkthrough

The pull request updates the OpenThread Border Router configuration to version 2.12.3. The changes focus on improving network interface routing and queue management. A new configuration header file openthread-core-ha-config-posix.h is introduced to set a lower route metric for the OpenThread network interface and increase the fragmentation tag entry list size. The Dockerfile and build process are modified to incorporate these configuration changes, and the patch for route metric adjustment is removed in favor of the new header-based configuration.

Changes

File Change Summary
third_party/openthread/CMakeLists.txt Added compilation definition for route metric
openthread_border_router/CHANGELOG.md Updated to version 2.12.3 with improvements in radio tx timeout recovery and fragmentation handling
openthread_border_router/Dockerfile Removed old patch, added new configuration file and build flags
openthread_border_router/config.yaml Version updated from 2.12.2 to 2.12.3
openthread_border_router/openthread-core-ha-config-posix.h New configuration header with route metric and fragmentation tag list size settings

Sequence Diagram

sequenceDiagram
    participant NM as NetworkManager
    participant OT as OpenThread Interface
    participant Radio as Radio Device

    Note over OT: Route Metric Set to 64
    Note over NM: Default Route Metric 128

    OT->>Radio: Establish Connection
    OT-->>NM: Prefer OpenThread Routes
    Radio->>OT: Transmit Data
    OT->>NM: Route Priority Established
Loading

The sequence diagram illustrates how the new route metric configuration ensures that the OpenThread interface takes precedence over routes learned through Neighbor Discovery, improving network routing priority.

Finishing Touches

  • 📝 Generate Docstrings

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
openthread_border_router/CHANGELOG.md (1)

7-8: Fix grammar in the changelog message.

Change "these type of messages" to "these types of messages" for correct grammar.

-  "Failed to get forwarded frame priority" notice messages in logs. Note that
-  these type of messages are non-critical (default priority will be applied in
+  "Failed to get forwarded frame priority" notice messages in logs. Note that
+  these types of messages are non-critical (default priority will be applied in
🧰 Tools
🪛 LanguageTool

[grammar] ~8-~8: In this context, ‘type’ should agree in number with the noun after ‘of’.
Context: ...ice messages in logs. Note that these type of messages are non-critical (default p...

(TYPE_OF_PLURAL)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6828d1e and 7443ab0.

📒 Files selected for processing (5)
  • openthread_border_router/0002-set-netif-route-metric-lower.patch (0 hunks)
  • openthread_border_router/CHANGELOG.md (1 hunks)
  • openthread_border_router/Dockerfile (3 hunks)
  • openthread_border_router/config.yaml (1 hunks)
  • openthread_border_router/openthread-core-ha-config-posix.h (1 hunks)
💤 Files with no reviewable changes (1)
  • openthread_border_router/0002-set-netif-route-metric-lower.patch
✅ Files skipped from review due to trivial changes (1)
  • openthread_border_router/config.yaml
🧰 Additional context used
📓 Path-based instructions (3)
openthread_border_router/CHANGELOG.md (6)

Pattern */**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

Pattern */**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

Pattern */**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"


Pattern */**(html|markdown|md): - Use sentence-style capitalization also in headings.


Pattern */**(html|markdown|md): do not comment on HTML used for icons


Pattern */**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.

openthread_border_router/openthread-core-ha-config-posix.h (6)

Pattern */**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

Pattern */**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

Pattern */**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"


Pattern */**(html|markdown|md): - Use sentence-style capitalization also in headings.


Pattern */**(html|markdown|md): do not comment on HTML used for icons


Pattern */**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.

openthread_border_router/Dockerfile (6)

Pattern */**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

Pattern */**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

Pattern */**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"


Pattern */**(html|markdown|md): - Use sentence-style capitalization also in headings.


Pattern */**(html|markdown|md): do not comment on HTML used for icons


Pattern */**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.

🪛 LanguageTool
openthread_border_router/CHANGELOG.md

[grammar] ~8-~8: In this context, ‘type’ should agree in number with the noun after ‘of’.
Context: ...ice messages in logs. Note that these type of messages are non-critical (default p...

(TYPE_OF_PLURAL)

🔇 Additional comments (8)
openthread_border_router/Dockerfile (2)

22-22: LGTM! Configuration header file integration looks good.

The new configuration header file is properly copied and integrated into the build process.

Also applies to: 61-61


93-94: Verify RCP restoration count value.

The RCP restoration count of 2 seems reasonable for recovery attempts, but we should verify this is sufficient for the target use case.

Could you confirm if 2 restoration attempts provide adequate recovery for typical "radio tx timeout" scenarios in your environment?

openthread_border_router/CHANGELOG.md (1)

3-10: LGTM! Clear and well-structured changelog entry.

The changelog effectively communicates the key improvements:

  1. RCP recovery feature
  2. Increased fragmentation tag entries
  3. Project header file configurations
🧰 Tools
🪛 LanguageTool

[grammar] ~8-~8: In this context, ‘type’ should agree in number with the noun after ‘of’.
Context: ...ice messages in logs. Note that these type of messages are non-critical (default p...

(TYPE_OF_PLURAL)

openthread_border_router/openthread-core-ha-config-posix.h (5)

1-27: LGTM: Standard BSD 3-clause license

The copyright notice and license terms are properly formatted and complete.


29-35: LGTM: Well-structured header guards and description

The include guards follow the standard naming convention, and the file description clearly states its purpose.


45-50: Consider memory impact of increased queue size

While increasing the fragment tag entry list size from 16 to 64 will help reduce "Failed to get forwarded frame priority" messages, we should verify the memory impact of this 4x increase.

Consider adding a comment documenting:

  • The memory overhead per entry
  • The total additional memory consumption
  • Any potential impact on resource-constrained devices

1-52: Verify configuration changes through testing

Both configuration changes look good, but please ensure they are tested in the following scenarios:

  1. Network transitions between different route sources
  2. High-load scenarios with many fragmented packets

This will help validate that:

  • Route preference works correctly under various network conditions
  • The increased queue size effectively reduces priority determination failures without causing memory issues

37-43: Verify route metric value across different NetworkManager configurations

The route metric of 64 should work well with NetworkManager's default of 128. However, we should verify this value is consistently lower across different NetworkManager configurations to ensure reliable route preference.

✅ Verification successful

Route metric configuration is appropriate

The value of 64 provides sufficient margin below NetworkManager's default metric while following standard routing practices. No conflicting configurations were found in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any NetworkManager route metric configurations in the codebase
rg -i "ipv6.route-metric|route-metric.*128" 

# Search for any existing usage or references to the route metric value
rg "OPENTHREAD_POSIX_CONFIG_NETIF_PREFIX_ROUTE_METRIC|64.*metric"

Length of output: 233

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
openthread_border_router/CHANGELOG.md (2)

6-9: Fix grammar in fragmentation entry.

The phrase "these type of" should be "these types of" to maintain proper grammar.

-- Increase the number of mesh header fragmentation tag entries to address
-  "Failed to get forwarded frame priority" notice messages in logs. Note that
-  these type of messages are non-critical (default priority will be applied in
-  that case).
+- Increase the number of mesh header fragmentation tag entries to address
+  "Failed to get forwarded frame priority" notice messages in logs. Note that
+  these types of messages are non-critical (default priority will be applied in
+  that case).
🧰 Tools
🪛 LanguageTool

[grammar] ~8-~8: In this context, ‘type’ should agree in number with the noun after ‘of’.
Context: ...ice messages in logs. Note that these type of messages are non-critical (default p...

(TYPE_OF_PLURAL)


10-10: Add more context about configuration changes.

Consider providing more specific information about the header file and its purpose, as this change affects the build process.

-- Make some compile time configurations via project header file
+- Move compile time configurations to project header file (openthread-core-ha-config-posix.h)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7443ab0 and 7d306a2.

📒 Files selected for processing (1)
  • openthread_border_router/CHANGELOG.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
openthread_border_router/CHANGELOG.md (6)

Pattern */**(html|markdown|md): - For instructional content in documentation, use a direct and authoritative tone. Avoid expressions of politeness such as 'may' or 'please', and ensure the goal of the instruction is fronted.

  • Apply the Microsoft Style Guide to ensure documentation maintains clarity and conciseness.
  • In step-by-step instructions, front the location phrase in the instructional sentence.
  • In step-by-step instructions, front the 'goal' in the instructional sentence.
  • In step-by-step instructions, if in doubt what to front, front the 'goal' before the location phrase in the instructional sentence.
  • do not hyphenate terms like 'top-right' or 'bottom-left' with 'corner'

Pattern */**(html|markdown|md): - Use bold to mark UI strings.

  • If "" are used to mark UI strings, replace them by bold.

Pattern */**(html|markdown|md): - Be brief in your replies and don't add fluff like "thank you for..." and "Please let me know if"


Pattern */**(html|markdown|md): - Use sentence-style capitalization also in headings.


Pattern */**(html|markdown|md): do not comment on HTML used for icons


Pattern */**(html|markdown|md): Avoid flagging inline HTML for embedding videos in future reviews for this repository.

🪛 LanguageTool
openthread_border_router/CHANGELOG.md

[grammar] ~8-~8: In this context, ‘type’ should agree in number with the noun after ‘of’.
Context: ...ice messages in logs. Note that these type of messages are non-critical (default p...

(TYPE_OF_PLURAL)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build amd64 openthread_border_router add-on
  • GitHub Check: Build aarch64 openthread_border_router add-on
🔇 Additional comments (2)
openthread_border_router/CHANGELOG.md (2)

3-3: LGTM!

Version number follows semantic versioning and maintains consistent formatting with previous entries.


5-5: Use previously approved wording for consistency.

-- Enable recovery mechanism from "radio tx timeout" errors
+- Enable recovery mechanism from "radio tx timeout" errors

@agners agners merged commit df9bfbe into master Jan 9, 2025
10 of 11 checks passed
@agners agners deleted the introduce-ot-project-config branch January 9, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants