[riot-commits] [RIOT-OS/RIOT] 89c69c: sys/net/gnrc/tx_sync: new module

Martine Lenders noreply at github.com
Mon Feb 8 19:48:00 CET 2021


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: 89c69c5450ae63456c07e649d83246767c05a3a5
      https://github.com/RIOT-OS/RIOT/commit/89c69c5450ae63456c07e649d83246767c05a3a5
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2021-02-03 (Wed, 03 Feb 2021)

  Changed paths:
    M sys/include/net/gnrc/nettype.h
    A sys/include/net/gnrc/tx_sync.h
    M sys/net/gnrc/Makefile
    M sys/net/gnrc/netif/gnrc_netif.c
    M sys/net/gnrc/network_layer/sixlowpan/frag/gnrc_sixlowpan_frag.c
    M sys/net/gnrc/pktbuf/gnrc_pktbuf.c
    M sys/net/gnrc/sock/gnrc_sock.c
    A sys/net/gnrc/tx_sync/Makefile
    A sys/net/gnrc/tx_sync/gnrc_tx_sync.c

  Log Message:
  -----------
  sys/net/gnrc/tx_sync: new module

The new `gnrc_tx_sync` module allows users of the GNRC network stack to
synchronize with the actual transmission of outgoing packets. This is directly
integrated into gnrc_sock. Hence, if `gnrc_tx_sync` is used, calls to e.g.
sock_udp_send() will block until the network stack has processed the message.

Use cases:
1. Prevent packet drop when sending at high rate
    - If the application is sending faster than the stack can handle, the
      message queues will overflow and outgoing packets are lost
2. Passing auxiliary data about the transmission back the stack
    - When e.g. the number of required retransmissions, the transmission time
      stamp, etc. should be made available to a user of an UDP sock, a
      synchronization mechanism is needed
3. Simpler error reporting without footguns
    - The current approach of using `core/msg` for passing up error messages is
      difficult to use if other message come in. Currently, gnrc_sock is
      busy-waiting and fetching messages from the message queue until the number
      of expected status reports is received. It will enqueue all
      non-status-report messages again at the end of the queue. This has
      multiple issues:
        - Busy waiting is especially in lower power scenarios with time slotted
          MAC protocols harmful, as the CPU will remain active and consume
          power even though the it could sleep until the TX slot is reached
        - The status reports from the network stack are send to the user thread
          blocking. If the message queue of the user thread is full, the network
          stack would block until the user stack can fetch the messages. If
          another higher priority thread would start sending a message, it
          would busy wait for its status reports to completely come in. Hence,
          the first thread doesn't get CPU time to fetch messages and unblock
          the network stack. As a result, the system would lock up completely.
    - Just adding the error/status code to the gnrc_tx_sync_t would preallocate
      and reserve memory for the error reporting. That way gnrc_sock does not
      need to search through the message queue for status reports and the
      network stack does not need to block for the user thread fetching it.


  Commit: 9895b840cde551eec02deb5610e4cec33ad2ad31
      https://github.com/RIOT-OS/RIOT/commit/9895b840cde551eec02deb5610e4cec33ad2ad31
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M sys/Makefile.dep

  Log Message:
  -----------
  sys/net: gnrc_tx_sync not implemented for gnrc_sixlowpand_frag_sfr

It is currently not possible to use both gnrc_tx_sync and
gnrc_sixlowpand_frag_sfr at the same time - this will be added in a follow
up PR.


  Commit: bd37457e14fa424a85d2a9f0b040928db6c47001
      https://github.com/RIOT-OS/RIOT/commit/bd37457e14fa424a85d2a9f0b040928db6c47001
  Author: Marian Buschsieweke <marian.buschsieweke at ovgu.de>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    A tests/gnrc_tx_sync/Makefile
    A tests/gnrc_tx_sync/Makefile.ci
    A tests/gnrc_tx_sync/main.c
    A tests/gnrc_tx_sync/tests/01-run.py

  Log Message:
  -----------
  tests/gnrc_tx_sync: add test for gnrc_tx_sync


  Commit: 209b48e38532afeb7017437c5971c2cc5473f576
      https://github.com/RIOT-OS/RIOT/commit/209b48e38532afeb7017437c5971c2cc5473f576
  Author: Martine Lenders <m.lenders at fu-berlin.de>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M sys/Makefile.dep
    M sys/include/net/gnrc/nettype.h
    A sys/include/net/gnrc/tx_sync.h
    M sys/net/gnrc/Makefile
    M sys/net/gnrc/netif/gnrc_netif.c
    M sys/net/gnrc/network_layer/sixlowpan/frag/gnrc_sixlowpan_frag.c
    M sys/net/gnrc/pktbuf/gnrc_pktbuf.c
    M sys/net/gnrc/sock/gnrc_sock.c
    A sys/net/gnrc/tx_sync/Makefile
    A sys/net/gnrc/tx_sync/gnrc_tx_sync.c
    A tests/gnrc_tx_sync/Makefile
    A tests/gnrc_tx_sync/Makefile.ci
    A tests/gnrc_tx_sync/main.c
    A tests/gnrc_tx_sync/tests/01-run.py

  Log Message:
  -----------
  Merge pull request #15694 from maribu/gnrc_tx_sync

sys/net/gnrc/tx_sync: new module


Compare: https://github.com/RIOT-OS/RIOT/compare/317534fe7b90...209b48e38532


More information about the commits mailing list