From: Miroslav Lichvar <mlichvar@redhat.com>
To: netdev@vger.kernel.org
Cc: Richard Cochran <richardcochran@gmail.com>,
Willem de Bruijn <willemb@google.com>,
Soheil Hassas Yeganeh <soheil@google.com>,
"Keller, Jacob E" <jacob.e.keller@intel.com>,
Denny Page <dennypage@me.com>, Jiri Benc <jbenc@redhat.com>
Subject: [RFC PATCH 7/7] net: ethernet: update drivers to make both SW and HW TX timestamps
Date: Wed, 12 Apr 2017 16:17:37 +0200 [thread overview]
Message-ID: <20170412141737.5881-8-mlichvar@redhat.com> (raw)
In-Reply-To: <20170412141737.5881-1-mlichvar@redhat.com>
Some drivers were calling the skb_tx_timestamp() function only when
hardware timestamp was not requested. Now that applications have an
option to receive both timestamps in separate messages, the drivers need
to be modified to always call skb_tx_timestamp().
CC: Richard Cochran <richardcochran@gmail.com>
CC: Willem de Bruijn <willemb@google.com>
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
---
drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 3 +--
drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 3 +--
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ++----
4 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index 89b21d7..5a2ad9c 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -1391,8 +1391,7 @@ static void xgbe_prep_tx_tstamp(struct xgbe_prv_data *pdata,
spin_unlock_irqrestore(&pdata->tstamp_lock, flags);
}
- if (!XGMAC_GET_BITS(packet->attributes, TX_PACKET_ATTRIBUTES, PTP))
- skb_tx_timestamp(skb);
+ skb_tx_timestamp(skb);
}
static void xgbe_prep_vlan(struct sk_buff *skb, struct xgbe_packet_data *packet)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 097b1ec2..eee047b 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -5850,10 +5850,10 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
adapter->tx_hwtstamp_skb = skb_get(skb);
adapter->tx_hwtstamp_start = jiffies;
schedule_work(&adapter->tx_hwtstamp_work);
- } else {
- skb_tx_timestamp(skb);
}
+ skb_tx_timestamp(skb);
+
netdev_sent_queue(netdev, skb->len);
e1000_tx_queue(tx_ring, tx_flags, count);
/* Make sure there is space in the ring for the next send. */
diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
index d54490d..50c182c 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
@@ -1418,8 +1418,7 @@ static netdev_tx_t sxgbe_xmit(struct sk_buff *skb, struct net_device *dev)
priv->hw->desc->tx_enable_tstamp(first_desc);
}
- if (!tqueue->hwts_tx_en)
- skb_tx_timestamp(skb);
+ skb_tx_timestamp(skb);
priv->hw->dma->enable_dma_transmission(priv->ioaddr, txq_index);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index a290c50..b866985 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2880,8 +2880,7 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
priv->xstats.tx_set_ic_bit++;
}
- if (!priv->hwts_tx_en)
- skb_tx_timestamp(skb);
+ skb_tx_timestamp(skb);
if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
priv->hwts_tx_en)) {
@@ -3083,8 +3082,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
priv->xstats.tx_set_ic_bit++;
}
- if (!priv->hwts_tx_en)
- skb_tx_timestamp(skb);
+ skb_tx_timestamp(skb);
/* Ready to fill the first descriptor and set the OWN bit w/o any
* problems because all the descriptors are actually ready to be
--
2.9.3
next prev parent reply other threads:[~2017-04-12 14:17 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-12 14:17 [RFC PATCH 0/7] Extend socket timestamping API Miroslav Lichvar
2017-04-12 14:17 ` [RFC PATCH 1/7] net: define receive timestamp filter for NTP Miroslav Lichvar
2017-04-12 14:17 ` [RFC PATCH 2/7] net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL Miroslav Lichvar
2017-04-12 19:49 ` Richard Cochran
2017-04-13 9:00 ` Keller, Jacob E
2017-04-12 14:17 ` [RFC PATCH 3/7] net: add option to get information about timestamped packets Miroslav Lichvar
2017-04-13 14:37 ` Willem de Bruijn
2017-04-13 15:18 ` Miroslav Lichvar
2017-04-13 16:16 ` Willem de Bruijn
2017-04-24 9:00 ` Miroslav Lichvar
2017-04-24 15:18 ` Willem de Bruijn
2017-04-25 13:56 ` Miroslav Lichvar
2017-04-25 17:23 ` Willem de Bruijn
2017-04-12 14:17 ` [RFC PATCH 4/7] net: ethernet: update drivers to provide timestamping packet info Miroslav Lichvar
2017-04-13 9:04 ` Keller, Jacob E
2017-04-12 14:17 ` [RFC PATCH 5/7] net: don't make false software transmit timestamps Miroslav Lichvar
2017-04-12 14:17 ` [RFC PATCH 6/7] net: allow simultaneous SW and HW transmit timestamping Miroslav Lichvar
2017-04-13 14:30 ` Willem de Bruijn
2017-04-13 14:59 ` Miroslav Lichvar
2017-04-13 15:24 ` Keller, Jacob E
2017-04-13 16:17 ` Willem de Bruijn
2017-04-12 14:17 ` Miroslav Lichvar [this message]
2017-04-13 9:08 ` [RFC PATCH 0/7] Extend socket timestamping API Keller, Jacob E
2017-04-13 9:53 ` Miroslav Lichvar
2017-04-13 10:45 ` Keller, Jacob E
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170412141737.5881-8-mlichvar@redhat.com \
--to=mlichvar@redhat.com \
--cc=dennypage@me.com \
--cc=jacob.e.keller@intel.com \
--cc=jbenc@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=soheil@google.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).