Skip to content

Conversation

@fengming-ye
Copy link
Contributor

net_buf_alloc_len will hard set timeout to 0 when
it is in sys workq thread and print warning log.

send_icmpv4_echo_request and send_icmpv6_echo_request are both allocating net_buf with timeout PKT_WAIT_TIME 1s. This will cause warning log in every icmp send and actual timeout is 0.

So fix it by always setting it to 0.

net_buf_alloc_len will hard set timeout to 0 when
it is in sys workq thread and print warning log.

send_icmpv4_echo_request and send_icmpv6_echo_request
are both allocating net_buf with timeout PKT_WAIT_TIME 1s.
This will cause warning log in every icmp send and
actual timeout is 0.

So fix it by always setting it to 0.

Signed-off-by: Fengming Ye <[email protected]>
Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

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

I don't think this is a good idea, you are now disabling the timeout for all use cases. The net_buf_ alloc_len will set the timeout to K_NO_WAIT anyway so doing it here is not really needed. If you are worried about the warning message, then I suggest the message is changed to LOG_DBG() in net_buf_alloc_len() instead.

@fengming-ye
Copy link
Contributor Author

fengming-ye commented Nov 12, 2024

send_icmpv4_echo_request and send_icmpv6_echo_request

send_icmpv4_echo_request and send_icmpv6_echo_request are both static used in ping_work. They will not be used by other use cases and timeout is always 0 for a long time.

This log level is recently increased from debug to warn by 88ee2be.
There is an issue #80167 reporting it.

@fengming-ye fengming-ye requested a review from jukkar November 29, 2024 03:25
@jukkar
Copy link
Member

jukkar commented Dec 17, 2024

There is an alternate implementation that will avoid the warning print but still allows timeout to be set at #83116
The PR is missing the actual calls that are done from work handler.

@jukkar
Copy link
Member

jukkar commented Jan 22, 2025

Closing this as the issue is implemented differently in main.

@jukkar jukkar closed this Jan 22, 2025
@fengming-ye fengming-ye deleted the fix/icmp_net_buf_alloc_warn branch February 6, 2025 08:52
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.

4 participants