Skip to content

net/gnrc_netif/pktq: use event based scheduler - #22735

Open
jia200x wants to merge 3 commits into
RIOT-OS:masterfrom
jia200x:pr/pktq_event
Open

jia200x wants to merge 3 commits into
RIOT-OS:masterfrom
jia200x:pr/pktq_event

Conversation

@jia200x

@jia200x jia200x commented Sep 18, 2026

Copy link
Copy Markdown
Member

Contribution description

This PR replaces the current IPC-based pktq schedule with an event based counterpart. This ensures that dequeueing packet events are never lost, while reducing the clutter of the gnrc_netif thread.

Testing procedure

Do a ping test with multi fragments (-s 1024) on any IEEE 802.15.4 device that supports the radio HAL (e.g nrf52840).

E.g:

--- fe80::e436:c5d4:f690:f82e PING statistics ---
200 packets transmitted, 200 packets received, 0% packet loss
round-trip min/avg/max = 171.122/196.049/210.003 ms

Issues/PRs references

None so far

Declaration of AI-Tools / LLMs usage:

AI-Tools / LLMs that were used are:

  • none

@jia200x
jia200x requested a review from miri64 as a code owner September 18, 2026 08:27
@github-actions github-actions Bot added Area: network Area: Networking Area: sys Area: System labels Sep 18, 2026
Comment on lines +90 to +91
xtimer_set(&netif->send_queue.dequeue_timer,
CONFIG_GNRC_NETIF_PKTQ_TIMER_US);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could use the opportunity here and port to ztimer_set.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ah wait... forgot to update it in some of the files

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done!

@jia200x jia200x changed the title gnrc_netif_pktq: use event based scheduler net/gnrc_netif/pktq: use event based scheduler Sep 18, 2026
Comment thread sys/net/gnrc/Makefile.dep Outdated

ifneq (,$(filter gnrc_netif_pktq,$(USEMODULE)))
USEMODULE += xtimer
USEMODULE += ztimer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
USEMODULE += ztimer
USEMODULE += ztimer_usec

No?

@crasbe crasbe added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR AI: Not Used AI was stated to not be used in this PR/Issue labels Sep 18, 2026
@riot-ci

riot-ci commented Sep 18, 2026

Copy link
Copy Markdown

Murdock results

FAILED

e895a7e fixup! net/gnrc_netif/pktq: migrate to ztimer

Build failures (21)
Application Target Toolchain Runtime (s) Worker
examples/advanced/posix_select native32 llvm 0.91 mobi3
examples/advanced/posix_select native64 llvm 1.81 mobi6
examples/advanced/posix_select samr21-xpro llvm 5.06 skyleaf
examples/networking/coap/libcoap_server native64 llvm 2.74 mobi6
examples/networking/coap/libcoap_server native32 llvm 6.68 mobi6
examples/networking/coap/libcoap_server samr21-xpro llvm 7.89 mobi6
examples/networking/misc/telnet_server native32 llvm 2.74 skyleaf
examples/networking/misc/telnet_server samr21-xpro llvm 1.77 mobi3
examples/networking/misc/telnet_server native64 llvm 3.68 mobi7
tests/net/gcoap_forward_proxy native64 llvm 0.75 mobi6
tests/net/gcoap_forward_proxy native32 llvm 0.99 mobi3
tests/net/gcoap_forward_proxy samr21-xpro llvm 1.60 mobi6
tests/net/gnrc_ipv6_nib_6ln native32 llvm 0.71 mobi6
tests/net/gnrc_ipv6_nib_6ln native64 llvm 0.68 mobi6
tests/net/gnrc_netif_ipv6_wait_for_global_address native32 llvm 0.90 mobi7
tests/net/gnrc_netif_ipv6_wait_for_global_address native64 llvm 0.74 mobi6
tests/net/gnrc_netif_ipv6_wait_for_global_address samr21-xpro llvm 2.64 mobi6
tests/net/netstats_neighbor native32 llvm 1.19 mobi6
tests/net/netstats_neighbor native64 llvm 1.94 mobi3
tests/net/netstats_neighbor samr21-xpro llvm 3.36 mobi3

and 276 more build failures...

Artifacts

@miri64 miri64 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code LGTM, but I currently do not have the hardware with me to test.

/**
* @brief Call the ISR handler from an event
*
* @param[in] evp pointer to the event

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The documentation seems not to be correct here (or a function is missing, but more likely this is copy-pasta from above).

@crasbe crasbe added the CI: no fast fail don't abort PR build after first error label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Not Used AI was stated to not be used in this PR/Issue Area: network Area: Networking Area: sys Area: System CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants