diff options
author | Shengzhou Liu <Shengzhou.Liu@freescale.com> | 2013-05-07 05:25:02 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-05-17 18:16:13 (GMT) |
commit | 698391e8c3a353979bedbb66c990754d35e35ec9 (patch) | |
tree | dbbe0a3f2b6eb116064ce36265e52f55a0518f72 /drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c | |
parent | bf753cd09caf2cd9bf027baf5007704d22227b39 (diff) | |
download | linux-fsl-qoriq-698391e8c3a353979bedbb66c990754d35e35ec9.tar.xz |
powerpc/dpaa_eth: some fix for timestamp
- fix issue that 1588 didn't work.
- use common API dpa_get_timestamp_ns for both CONFIG_FSL_DPAA_1588
and CONFIG_FSL_DPAA_TS cases.
- correct timestamp unit for CONFIG_FSL_DPAA_TS case.
Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Change-Id: Iebdd4935b5ecf4fccca9b5683d8f18fc81b75276
Reviewed-on: http://git.am.freescale.net:8181/2216
Reviewed-by: Bucur Madalin-Cristian-B32716 <madalin.bucur@freescale.com>
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c index 8307f77..8369374 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sg.c @@ -247,15 +247,19 @@ struct sk_buff *_dpa_cleanup_tx_fd(const struct dpa_priv_s *priv, * The sgt page is guaranteed to reside in lowmem. */ sgt = phys_to_virt(addr + dpa_fd_offset(fd)); - +#ifdef CONFIG_FSL_DPAA_1588 + if (priv->tsu && priv->tsu->valid && + priv->tsu->hwts_tx_en_ioctl) + dpa_ptp_store_txstamp(priv, skb, (void *)skbh); +#endif #ifdef CONFIG_FSL_DPAA_TS - if (unlikely(priv->ts_tx_en && + if (unlikely(priv->ts_tx_en && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) { - struct skb_shared_hwtstamps shhwtstamps; + struct skb_shared_hwtstamps shhwtstamps; - dpa_get_ts(priv, TX, &shhwtstamps, (void *)skbh); - skb_tstamp_tx(skb, &shhwtstamps); - } + dpa_get_ts(priv, TX, &shhwtstamps, (void *)skbh); + skb_tstamp_tx(skb, &shhwtstamps); + } #endif /* CONFIG_FSL_DPAA_TS */ /* sgt[0] is from lowmem, was dma_map_single()-ed */ @@ -279,9 +283,15 @@ struct sk_buff *_dpa_cleanup_tx_fd(const struct dpa_priv_s *priv, /* Free separately the pages that we allocated on Tx */ free_page((unsigned long)phys_to_virt(addr)); } -#ifdef CONFIG_FSL_DPAA_TS +#if defined(CONFIG_FSL_DPAA_1588) || defined(CONFIG_FSL_DPAA_TS) else { /* get the timestamp for non-SG frames */ +#ifdef CONFIG_FSL_DPAA_1588 + if (priv->tsu && priv->tsu->valid && + priv->tsu->hwts_tx_en_ioctl) + dpa_ptp_store_txstamp(priv, skb, (void *)skbh); +#endif +#ifdef CONFIG_FSL_DPAA_TS if (unlikely(priv->ts_tx_en && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) { struct skb_shared_hwtstamps shhwtstamps; @@ -289,8 +299,9 @@ struct sk_buff *_dpa_cleanup_tx_fd(const struct dpa_priv_s *priv, dpa_get_ts(priv, TX, &shhwtstamps, (void *)skbh); skb_tstamp_tx(skb, &shhwtstamps); } +#endif } -#endif /* CONFIG_FSL_DPAA_TS */ +#endif return skb; } @@ -319,7 +330,7 @@ static void __hot contig_fd_to_skb(const struct dpa_priv_s *priv, /* do we need the timestamp for bad frames? */ #ifdef CONFIG_FSL_DPAA_1588 if (priv->tsu && priv->tsu->valid && priv->tsu->hwts_rx_en_ioctl) - dpa_ptp_store_rxstamp(priv->net_dev, skb, fd); + dpa_ptp_store_rxstamp(priv, skb, vaddr); #endif /* Peek at the parse results for csum validation and headers size */ @@ -383,6 +394,10 @@ static void __hot sg_fd_to_skb(const struct dpa_priv_s *priv, const t_FmPrsResult *parse_results; vaddr = phys_to_virt(addr); +#ifdef CONFIG_FSL_DPAA_1588 + if (priv->tsu && priv->tsu->valid && priv->tsu->hwts_rx_en_ioctl) + dpa_ptp_store_rxstamp(priv, skb, vaddr); +#endif /* * In the case of a SG frame, FMan stores the Internal Context * in the buffer containing the sgt. @@ -450,11 +465,6 @@ static void __hot sg_fd_to_skb(const struct dpa_priv_s *priv, break; } -#ifdef CONFIG_FSL_DPAA_1588 - if (priv->tsu && priv->tsu->valid && priv->tsu->hwts_rx_en_ioctl) - dpa_ptp_store_rxstamp(priv->net_dev, skb, fd); -#endif - /* recycle the SGT page */ dpa_bp = dpa_bpid2pool(fd->bpid); BUG_ON(IS_ERR(dpa_bp)); |