1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

16 Commits

Author SHA1 Message Date
Benjamin Valentin
14afafa2d2 gnrc_pktbuf: fix gnrc_pktbuf_contains() 2022-06-17 19:58:01 +02:00
Sören Tempel
178c9eb745 gnrc_pktbuf: use _free function with gnrc_pktbuf_malloc
Otherwise the local mallocs variable is not decremented correctly (if
TEST_SUITES is defined) and the fuzzing setup (i.e. when MODULE_FUZZING
is defined) does not terminate. This regression was introduced in
3970b667aa.
2021-02-12 18:15:40 +01:00
Marian Buschsieweke
89c69c5450
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.
2021-02-03 15:16:42 +01:00
Marian Buschsieweke
3970b667aa
sys/net/gnrc_pktbuf: deduplicate code
Implement gnrc_pktbuf_release_error() in gnrc_pktbuf once, rather than providing
two implementations in gnrc_pktbuf_static and gnrc_pktbuf_malloc
2021-01-26 10:50:19 +01:00
Martine Lenders
72821a502f
gnrc_pktbuf: drop gnrc_pktbuf_replace_snip()
The function was deprecated in e94aa40bf5
and is unused and untested in the current code base.
2020-10-29 17:20:12 +01:00
Martine Lenders
45144fb4a4
treewide: use new gnrc_pkt API functions instead of utlist.h macros 2020-10-13 13:32:53 +02:00
Leandro Lanzieri
d25fc243c4
treewide: change prefix for generated Kconfig symbols.
This changes the prefixes of the symbols generated from USEMODULE and
USEPKG variables. The changes are as follow:

   KCONFIG_MODULE_ => KCONFIG_USEMODULE_
   KCONFIG_PKG_ => KCONFIG_USEPKG_
   MODULE_ => USEMODULE_
   PKG_ => USEPKG_
2020-08-31 09:37:09 +02:00
Leandro Lanzieri
ff8079b109
fuzzing: select gnrc_pktbuf_malloc implementation 2020-08-25 09:24:50 +02:00
Akshai M
6450d9989e gnrc/pktbuf : Set Kconfig defaults and conditions
Set Kconfig defaults for CPU and conditions to avoid
conflict with CFLAGS

Co-authored-by: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
2020-06-11 14:47:27 +05:30
Akshai M
cabcfae9e0 gnrc/pktbuf : Expose to Kconfig
Expose CONF_GNRC_PKTBUF_SIZE to Kconfig
2020-06-11 14:47:19 +05:30
de244e6679 gnrc/pktbuf: remove obsolete sys/uio.h include
This was previously used by gnrc_pktbuf_get_iovec() for the definitions
of "struct iovec", which has been removed a while ago.
2019-07-04 16:12:57 +02:00
Hauke Petersen
9fb2f541ba net/gnrc_pktbuf: rm deprecated _pktbuf_get_iovec() 2019-03-15 10:21:22 +01:00
Tobias Heider
f03247e752 gnrc_pktbuf: add gnrc_pktbuf_merge()
Co-Authored-By: Martine Lenders <m.lenders@fu-berlin.de>
2018-11-22 11:13:33 +01:00
Martine Lenders
ac54a2d2b2 gnrc_pktbuf: add gnrc_pktbuf_reverse_snips() helper function
This allows for

a) testing the packet reversal properly in unittests
b) use it in other places than `gnrc_ipv6`'s receive function
2018-10-25 23:11:33 +02:00
Martine Lenders
f51e4ca767
fixup! gnrc_pktbuf: move common auxiliary functions to common module 2017-06-15 15:15:02 +02:00
Martine Lenders
d8336c38b6
gnrc_pktbuf: move common auxiliary functions to common module
The packet buffer was originally designed to have a replaceable
back-end. This is why the actual module is called `gnrc_pktbuf_static`.
However, since than some auxiliary functions snuck into the static
back-end, which should go into the common module (which is a
pseudo-module at the moment).

This fix makes the `gnrc_pktbuf` pseudo-module an actual module and
moves the auxiliary functions to that module.
2017-06-14 12:24:56 +02:00