diff options
author | Vladimir Oltean | 2019-06-08 15:04:27 +0300 |
---|---|---|
committer | David S. Miller | 2019-06-08 15:20:39 -0700 |
commit | 146d442c2357539589da14d374a25c9a82eb7f1e (patch) | |
tree | 9bdcb98e6f11c78de5e2c4ec9de5844cc4a13f5a /net/dsa | |
parent | a6cdeeb16bff89c8486324f53577db058cbe81ba (diff) |
net: dsa: Keep a pointer to the skb clone for TX timestamping
For drivers that use deferred_xmit for PTP frames (such as sja1105),
there is no need to perform matching between PTP frames and their egress
timestamps, since the sending process can be serialized.
In that case, it makes sense to have the pointer to the skb clone that
DSA made directly in the skb->cb. It will be used for pushing the egress
timestamp back in the application socket's error queue.
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/slave.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 5bab82d46f0c..289a6aa4b51c 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -423,6 +423,8 @@ static void dsa_skb_tx_timestamp(struct dsa_slave_priv *p, if (!clone) return; + DSA_SKB_CB(skb)->clone = clone; + if (ds->ops->port_txtstamp(ds, p->dp->index, clone, type)) return; @@ -460,6 +462,7 @@ static netdev_tx_t dsa_slave_xmit(struct sk_buff *skb, struct net_device *dev) u64_stats_update_end(&s->syncp); DSA_SKB_CB(skb)->deferred_xmit = false; + DSA_SKB_CB(skb)->clone = NULL; /* Identify PTP protocol packets, clone them, and pass them to the * switch driver |