> On 8Mar 2018, at 17:37, Richard Cochran <richardcoch...@gmail.com> wrote:
> 
> If you know of any outstanding bugs or issues, please report them right away!

I ran into this a few months ago and won't be able to reproduce it soon, so 
please excuse the slim bug report.
This was on Linux 4.4.52 (as well as 4.14 IIRC) with linuxptp 1.8 as provided 
by Debian. I believe the underlying issue still exists:

In a DSA setup, transmitted packets may be timestamped more than once causing 
ptp4l to fail,
as it expects only a single Tx timestamp to be looped back to the socket's 
error queue.

Setup was a Marvell ESPRESSObin with ptp4l listening on one of the external 
switch's ports with the attached patch applied. In that configuration,
there will be two Tx timestamps: One from the DSA driver which then hands 
frames to the mvneta driver, where it's timestamped a second time.

Workaround is easy enough and it doesn't happen in a vanilla kernel (yet), but 
there is already a RFC patch to add hardware timestamping for the Topaz switch 
and combining that with say the IGB driver would trigger this as well, so I 
thought I should mention it.

The language in the kernel's Documentation/networking/timestamping.txt doesn't 
suggest that userspace should expect multiple Tx timestamps,
so I am not sure this is intended behavior. If you raise this upstream, please 
CC me, as I'd be interested in following the discussion.

Cheers and thanks for linuxptp
Ahmad

---
 drivers/net/ethernet/marvell/mvneta.c | 3 +++
 net/dsa/slave.c                       | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mvneta.c 
b/drivers/net/ethernet/marvell/mvneta.c
index 25e9a551cc8c..060da1d1b8e6 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2397,6 +2397,8 @@ static int mvneta_tx(struct sk_buff *skb, struct 
net_device *dev)
                if (txq->count >= txq->tx_stop_threshold)
                        netif_tx_stop_queue(nq);
 
+               skb_tx_timestamp(skb);
+
                if (!skb->xmit_more || netif_xmit_stopped(nq) ||
                    txq->pending + frags > MVNETA_TXQ_DEC_SENT_MASK)
                        mvneta_txq_pend_desc_add(pp, txq, frags);
@@ -4167,6 +4169,7 @@ static const struct ethtool_ops mvneta_eth_tool_ops = {
        .get_module_eeprom = mvneta_ethtool_get_module_eeprom,
        .get_eee        = mvneta_ethtool_get_eee,
        .set_eee        = mvneta_ethtool_set_eee,
+       .get_ts_info    = ethtool_op_get_ts_info,
 };
 
 /* Initialize hw */
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index f52307296de4..6e89c7fea5f4 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -406,6 +406,8 @@ static netdev_tx_t dsa_slave_xmit(struct sk_buff *skb, 
struct net_device *dev)
                return NETDEV_TX_OK;
        }
 
+       skb_tx_timestamp(nskb);
+
        /* SKB for netpoll still need to be mangled with the protocol-specific
         * tag to be successfully transmitted
         */
@@ -938,6 +940,7 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = {
        .set_link_ksettings     = phy_ethtool_set_link_ksettings,
        .get_rxnfc              = dsa_slave_get_rxnfc,
        .set_rxnfc              = dsa_slave_set_rxnfc,
+       .get_ts_info    = ethtool_op_get_ts_info,
 };
 
 /* legacy way, bypassing the bridge *****************************************/
-- 
2.11.0



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to