Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74abc9b1 authored by Miroslav Lichvar's avatar Miroslav Lichvar Committed by David S. Miller
Browse files

net: ethernet: update drivers to make both SW and HW TX timestamps



Some drivers were calling the skb_tx_timestamp() function only when
a hardware timestamp was not requested. Now that applications can use
the SOF_TIMESTAMPING_OPT_TX_SWHW option to request both software and
hardware timestamps, the drivers need to be modified to unconditionally
call skb_tx_timestamp().

CC: Richard Cochran <richardcochran@gmail.com>
CC: Willem de Bruijn <willemb@google.com>
Signed-off-by: default avatarMiroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b50a5c70
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1391,7 +1391,6 @@ 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);
}

+2 −2
Original line number Diff line number Diff line
@@ -5868,10 +5868,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. */
+1 −2
Original line number Diff line number Diff line
@@ -1418,7 +1418,6 @@ 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);

	priv->hw->dma->enable_dma_transmission(priv->ioaddr, txq_index);
+2 −4
Original line number Diff line number Diff line
@@ -2880,7 +2880,6 @@ 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);

	if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) &&
@@ -3084,7 +3083,6 @@ 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);

	/* Ready to fill the first descriptor and set the OWN bit w/o any