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

[mesh-forwarder] finalize message direct tx on drop or eviction #9682

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

abtink
Copy link
Member

@abtink abtink commented Dec 4, 2023

This commit adds FinalizeMessageDirectTx(), which clears the DirectTx flag on a given message, updates the IPv6 counter, and signals other modules about the transmission status(particularly for MleDiscoverRequest and MleChildIdRequest messages so their internal state can be updated).

This commit ensures FinalizeMessageDirectTx() is called in various scenarios:

  • Successful message delivery (all fragments reach destination).
  • Any fragment transmission failure (frame tx failure)
  • Message drop due to address query failure or malformed message.
  • Message drop by queue management.
  • Message eviction to prioritize higher-priority messages.

This commit also updates DiscoverScanner to stop an ongoing discover scan if the "MLE Discover Request" message transmission fails (with error other than CSMA error). This is necessary because the DiscoverScanner reuses the same Message instance for tx on different scan channels. If the Message is freed (e.g., evicted), the Message cannot be reused.

Finally, this commit renames RemoveMessage() to EvictMessage() to clarify the purpose and usage of this method.

Copy link

size-report bot commented Dec 4, 2023

Size Report of OpenThread

Merging #9682 into main(3754174).

name branch text data bss total
ot-cli-ftd main 463440 760 66244 530444
#9682 463520 760 66244 530524
+/- +80 0 0 +80
ot-ncp-ftd main 434140 760 61464 496364
#9682 434220 760 61464 496444
+/- +80 0 0 +80
libopenthread-ftd.a main 233062 0 40198 273260
#9682 233156 0 40198 273354
+/- +94 0 0 +94
libopenthread-cli-ftd.a main 56204 0 8067 64271
#9682 56204 0 8067 64271
+/- 0 0 0 0
libopenthread-ncp-ftd.a main 31841 0 5916 37757
#9682 31841 0 5916 37757
+/- 0 0 0 0
ot-cli-mtd main 362648 760 51132 414540
#9682 362728 760 51132 414620
+/- +80 0 0 +80
ot-ncp-mtd main 345852 760 46376 392988
#9682 345932 760 46376 393068
+/- +80 0 0 +80
libopenthread-mtd.a main 156442 0 25110 181552
#9682 156514 0 25110 181624
+/- +72 0 0 +72
libopenthread-cli-mtd.a main 39129 0 8043 47172
#9682 39129 0 8043 47172
+/- 0 0 0 0
libopenthread-ncp-mtd.a main 24721 0 5916 30637
#9682 24721 0 5916 30637
+/- 0 0 0 0
ot-cli-ftd-br main 531040 768 130900 662708
#9682 531120 768 130900 662788
+/- +80 0 0 +80
libopenthread-ftd-br.a main 295566 5 104830 400401
#9682 295658 5 104830 400493
+/- +92 0 0 +92
libopenthread-cli-ftd-br.a main 69552 0 8091 77643
#9682 69552 0 8091 77643
+/- 0 0 0 0
ot-rcp main 62168 564 20604 83336
#9682 62168 564 20604 83336
+/- 0 0 0 0
libopenthread-rcp.a main 9522 0 5052 14574
#9682 9522 0 5052 14574
+/- 0 0 0 0
libopenthread-radio.a main 18811 0 214 19025
#9682 18811 0 214 19025
+/- 0 0 0 0

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

Merging #9682 (9bfdd8b) into main (3754174) will increase coverage by 0.00%.
The diff coverage is 80.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9682   +/-   ##
=======================================
  Coverage   85.69%   85.70%           
=======================================
  Files         555      555           
  Lines       73753    73765   +12     
=======================================
+ Hits        63203    63218   +15     
+ Misses      10550    10547    -3     
Files Coverage Δ
src/core/thread/discover_scanner.hpp 50.00% <ø> (ø)
src/core/thread/mesh_forwarder.hpp 72.72% <ø> (ø)
src/core/thread/discover_scanner.cpp 81.48% <87.50%> (-0.34%) ⬇️
src/core/thread/mesh_forwarder_ftd.cpp 85.71% <66.66%> (+0.52%) ⬆️
src/core/thread/mesh_forwarder_mtd.cpp 50.00% <0.00%> (ø)
src/core/thread/mesh_forwarder.cpp 85.28% <82.60%> (-0.11%) ⬇️

... and 18 files with indirect coverage changes

This commit adds `FinalizeMessageDirectTx()`, which clears the
`DirectTx` flag on a given message, updates the IPv6 counter, and
signals other modules about the transmission status(particularly for
`MleDiscoverRequest` and `MleChildIdRequest` messages so their
internal state can be updated).

This commit ensures `FinalizeMessageDirectTx()` is called in various
scenarios:
- Successful message delivery (all fragments reach destination).
- Any fragment transmission failure (frame tx failure)
- Message drop due to address query failure or malformed message.
- Message drop by queue management.
- Message eviction to prioritize higher-priority messages.

This commit also updates `DiscoverScanner` to stop an ongoing discover
scan if the "MLE Discover Request" message transmission fails with error
other than CSMA error. This is necessary because the `DiscoverScanner`
reuses the same `Message` instance for tx on different scan channels.
If the `Message` is freed (e.g., evicted), the `Message` cannot be
reused.

Finally, this commit renames `RemoveMessage()` to `EvictMessage()` to
clarify the purpose and usage of this method.
@jwhui jwhui merged commit 001b01e into openthread:main Dec 5, 2023
105 checks passed
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.

None yet

2 participants