[riot-notifications] [RIOT-OS/RIOT] sys/net/gnrc: implement sock_aux_timestamp for TX (#15883)

Marian Buschsieweke notifications at github.com
Fri Jan 29 09:55:43 CET 2021


### Contribution description

- includes [gnrc_tx_sync](https://github.com/RIOT-OS/RIOT/pull/15694) to allow waiting for completion of TX (as needed to access TX results)
- includes [PR patching `gnrc_netif` to make use of `netdev_driver_t::confirm_send()`](https://github.com/RIOT-OS/RIOT/pull/15821), which allows passing TX info from netdev to netif
- Introduce type `netdev_tx_info_t`, which contains a timestamp if (pseudo-)module `netdev_tx_info_timestamp` is used
- Extend `gnrc_tx_sync_t` to contain a member `netdev_tx_info_t tx_info`, which can be used to transfer TX info up the stack
- Extend `gnrc_netif` to pass the new `tx_info` member of `gnrc_tx_sync_t` to `netdev_driver_t::confirm_send()` when module `gnrc_tx_sync` is used
- Extend `gnrc_sock` to pass timestamp in `gnrc_tx_sync_t::tx_info` up to `sock_udp_send_aux()` / `sock_ip_send_aux()`, which in turn are extended to pass this on to the user
- Implement PTP timestamping for TX in `stm32_eth`

### Testing procedure

- `make BOARD=nucleo-f767zi -C tests/sock_udp_aux flash term`
- Check the IPv6 address of the Nucleo via `ifconfig`
- Send UDP packets directed at port `12345` of the Nucleo

The output should look like this

```
2021-01-29 09:53:25,054 # main(): This is RIOT! (Version: 2021.04-devel-366-g1932ed-tx_timestamp)
2021-01-29 09:53:25,058 # UDP echo server listening at port 12345
> ifconfig
2021-01-29 09:53:28,013 #  ifconfig
2021-01-29 09:53:28,018 # Iface  4  HWaddr: AA:C8:16:C2:3C:6D  Link: up 
2021-01-29 09:53:28,024 #           L2-PDU:1500  MTU:1500  HL:64  Source address length: 6
2021-01-29 09:53:28,027 #           Link type: wired
2021-01-29 09:53:28,032 #           inet6 addr: fe80::a8c8:16ff:fec2:3c6d  scope: link  VAL
2021-01-29 09:53:28,035 #           inet6 group: ff02::1
2021-01-29 09:53:28,038 #           inet6 group: ff02::1:ffc2:3c6d
2021-01-29 09:53:28,039 #           
2021-01-29 09:53:28,042 #           Statistics for Layer 2
2021-01-29 09:53:28,045 #             RX packets 2  bytes 180
2021-01-29 09:53:28,050 #             TX packets 2 (Multicast: 2)  bytes 140
2021-01-29 09:53:28,053 #             TX succeeded 2 errors 0
2021-01-29 09:53:28,056 #           Statistics for IPv6
2021-01-29 09:53:28,059 #             RX packets 2  bytes 152
2021-01-29 09:53:28,063 #             TX packets 2 (Multicast: 2)  bytes 112
2021-01-29 09:53:28,067 #             TX succeeded 2 errors 0
2021-01-29 09:53:28,067 # 
>
2021-01-29 09:53:33,848 # Received a message via: [fe80::a8c8:16ff:fec2:3c6d]:12345
2021-01-29 09:53:33,851 # Received a message at: 8795389140 ns
2021-01-29 09:53:33,854 # Received a message with: No RSSI value
2021-01-29 09:53:33,857 # Sent echo at: 8807312980 ns
2021-01-29 09:53:33,862 # Received a message via: [fe80::a8c8:16ff:fec2:3c6d]:12345
2021-01-29 09:53:33,865 # Received a message at: 8807667580 ns
2021-01-29 09:53:33,869 # Received a message with: No RSSI value
2021-01-29 09:53:33,871 # Sent echo at: 8821608820 ns
2021-01-29 09:53:42,175 # Received a message via: [fe80::a8c8:16ff:fec2:3c6d]:12345
2021-01-29 09:53:42,179 # Received a message at: 17122866530 ns
2021-01-29 09:53:42,182 # Received a message with: No RSSI value
2021-01-29 09:53:42,185 # Sent echo at: 17134910120 ns
2021-01-29 09:53:42,190 # Received a message via: [fe80::a8c8:16ff:fec2:3c6d]:12345
2021-01-29 09:53:42,193 # Received a message at: 17135254480 ns
2021-01-29 09:53:42,196 # Received a message with: No RSSI value
2021-01-29 09:53:42,199 # Sent echo at: 17149379960 ns
2021-01-29 09:53:43,471 # Received a message via: [fe80::a8c8:16ff:fec2:3c6d]:12345
2021-01-29 09:53:43,474 # Received a message at: 18418614030 ns
2021-01-29 09:53:43,478 # Received a message with: No RSSI value
2021-01-29 09:53:43,481 # Sent echo at: 18430627420 ns
2021-01-29 09:53:43,486 # Received a message via: [fe80::a8c8:16ff:fec2:3c6d]:12345
2021-01-29 09:53:43,489 # Received a message at: 18430879180 ns
2021-01-29 09:53:43,492 # Received a message with: No RSSI value
2021-01-29 09:53:43,495 # Sent echo at: 18445097980 ns
```

### Issues/PRs references

Depends on and includes:

- [ ] https://github.com/RIOT-OS/RIOT/pull/15694
- [ ] https://github.com/RIOT-OS/RIOT/pull/15821
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/15883

-- Commit Summary --

  * drivers/net/netdev: Add NETDEV_TYPE_TEST_6LO
  * sys/net/gnrc/tx_sync: new module
  * tests/gnrc_tx_sync: add test for gnrc_tx_sync
  * sys/net: gnrc_tx_sync conflicts with gnrc_sixlowpand_frag_sfr
  * sys/net/gnrc/netif: use confirm_send(), drop gnrc_netif_events
  * sys/net/gnrc/netif/ethernet: adapt to new API
  * cpu/stm32/periph/eth: update to new API
  * drivers/netdev: add netdev_tx_info_t
  * sys/net/gnrc/tx_sync: make use of netdev_tx_info_t
  * sys/net/gnrc/sock: fetch TX timestamp
  * sys/net/gnrc_tx_sync: add helper function
  * sys/net/grnc_netif: fetch TX info from netdev
  * cpu/stm32/periph_eth: provide TX timestamps

-- File Changes --

    M cpu/stm32/periph/eth.c (37)
    M cpu/stm32/periph/eth_common.c (4)
    M drivers/include/net/netdev.h (27)
    M makefiles/pseudomodules.inc.mk (2)
    M sys/Makefile.dep (11)
    M sys/include/net/gnrc/netif.h (10)
    M sys/include/net/gnrc/nettype.h (5)
    A sys/include/net/gnrc/tx_sync.h (158)
    M sys/net/gnrc/Makefile (3)
    M sys/net/gnrc/netif/ethernet/gnrc_netif_ethernet.c (5)
    M sys/net/gnrc/netif/gnrc_netif.c (446)
    M sys/net/gnrc/netif/gnrc_netif_device_type.c (22)
    M sys/net/gnrc/network_layer/sixlowpan/frag/gnrc_sixlowpan_frag.c (59)
    M sys/net/gnrc/pktbuf/gnrc_pktbuf.c (9)
    M sys/net/gnrc/sock/gnrc_sock.c (27)
    M sys/net/gnrc/sock/include/gnrc_sock_internal.h (21)
    M sys/net/gnrc/sock/ip/gnrc_sock_ip.c (15)
    M sys/net/gnrc/sock/udp/gnrc_sock_udp.c (16)
    A sys/net/gnrc/tx_sync/Makefile (3)
    A sys/net/gnrc/tx_sync/gnrc_tx_sync.c (41)
    A tests/gnrc_tx_sync/Makefile (22)
    A tests/gnrc_tx_sync/Makefile.ci (20)
    A tests/gnrc_tx_sync/main.c (133)
    A tests/gnrc_tx_sync/tests/01-run.py (20)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/15883.patch
https://github.com/RIOT-OS/RIOT/pull/15883.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15883
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210129/90092507/attachment.htm>


More information about the notifications mailing list