net: tcp: net_tcp_queue_pkt: Lock while appending to sent_list #9819
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.
net_tcp_queue_pkt() is a single point where packets are added to
tcp->sent_list, and this happens from application thread. This
list is also accessed (iterated on, items removed) from a number
of delayed work handlers. These handlers are serialized among
themselves. Thus, the only issue is serializing access to this
list between net_tcp_queue_pkt() running in app thread and
delayes works running in own cooperatively scheduled thread.
This patch does this, and as adding to the list is very quick
operation, it just uses irq_lock(), as interrupt jitter added
is very minimal and usage of mutex would likely give the same
amount of jitter anyway.
Signed-off-by: Paul Sokolovsky [email protected]