[riot-notifications] [RIOT-OS/RIOT] drivers/stm32_eth: add RX timestamps (#15610)

Marian Buschsieweke notifications at github.com
Mon Jan 25 21:11:03 CET 2021


@maribu commented on this pull request.



> +        if (rx_curr->status & RX_DESC_STAT_LS) {
+            if (IS_USED(MODULE_PERIPH_PTP)) {
+                info->timestamp = rx_curr->ts_low;
+                info->timestamp += (uint64_t)rx_curr->ts_high * NS_PER_SEC;
+                info->flags |= NETDEV_ETH_RX_INFO_FLAG_TIMESTAMP;
+            }
+            rx_curr->status = RX_DESC_STAT_OWN;
+            rx_curr = rx_curr->desc_next;
+            break;
+        }
         rx_curr->status = RX_DESC_STAT_OWN;
         rx_curr = rx_curr->desc_next;

It is now a single loop, but there is now an `if` to handle each iteration. But keeping in mind that there are usually very few (if even more than one) iteration of the loop, this is little value in optimizing the loop for low cycle count anyway.

-- 
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/15610#discussion_r564011922
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210125/f60d83dd/attachment.htm>


More information about the notifications mailing list