Thread (36 messages) 36 messages, 6 authors, 2021-11-26

Re: [PATCH 6/7] net: dsa: b53: Add logic for TX timestamping

From: Martin Kaistra <hidden>
Date: 2021-11-08 09:57:54
Also in: lkml

Am 06.11.21 um 03:50 schrieb Florian Fainelli:

On 11/4/2021 6:32 AM, Martin Kaistra wrote:
quoted
In order to get the switch to generate a timestamp for a transmitted
packet, we need to set the TS bit in the BRCM tag. The switch will then
create a status frame, which gets send back to the cpu.
In b53_port_txtstamp() we put the skb into a waiting position.

When a status frame is received, we extract the timestamp and put the 
time
according to our timecounter into the waiting skb. When
TX_TSTAMP_TIMEOUT is reached and we have no means to correctly get back
a full timestamp, we cancel the process.

As the status frame doesn't contain a reference to the original packet,
only one packet with timestamp request can be sent at a time.

Signed-off-by: Martin Kaistra <redacted>
---
[snip]
quoted
+static long b53_hwtstamp_work(struct ptp_clock_info *ptp)
+{
+    struct b53_device *dev =
+        container_of(ptp, struct b53_device, ptp_clock_info);
+    struct dsa_switch *ds = dev->ds;
+    int i;
+
+    for (i = 0; i < ds->num_ports; i++) {
+        struct b53_port_hwtstamp *ps;
+
+        if (!dsa_is_user_port(ds, i))
+            continue;
Can you also check on !dsa_port_is_unused()?
After the currently implemented check, dp->type should be 
DSA_PORT_TYPE_USER, so it can't be DSA_PORT_TYPE_UNUSED, right?


Thanks,
Martin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help