[riot-notifications] [RIOT-OS/RIOT] test_utils: add UDP benchmark (#16710)

Karl Fessel notifications at github.com
Thu Aug 26 22:02:44 CEST 2021


@kfessel commented on this pull request.



> +
+        res = sock_udp_recv(&sock, buf, sizeof(buf), 2 * delay_us, NULL);
+        if (res < 0) {
+            if (res != -ETIMEDOUT) {
+                printf("Error receiving message: %zd\n", res);
+            }
+            continue;
+        }
+
+        unsigned state = irq_disable();
+        if (cmd->flags & BENCH_FLAG_CMD_PKT) {
+            ping->seq_no  = 0;
+            ping->replies = 0;
+            ping->flags   = cmd->flags & BENCH_MASK_COOKIE;
+            delay_us      = cmd->delay_us;
+            payload_size  = cmd->payload_len;

```suggestion
            payload_size  = (cmd->payload_len < BENCH_PAYLOAD_SIZE_MAX - sizeof(*ping))?cmd->payload_len: BENCH_PAYLOAD_SIZE_MAX - sizeof(*ping);
```

I think this value should be capped.
maybe BENCH_PAYLOAD_SIZE_MAX should be set to MTU 


-- 
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/16710#pullrequestreview-739882611
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210826/bc54e274/attachment.htm>


More information about the notifications mailing list