[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aK8a3+gA52I6Ffcy@lizhi-Precision-Tower-5810>
Date: Wed, 27 Aug 2025 10:49:03 -0400
From: Frank Li <Frank.li@....com>
To: Wei Fang <wei.fang@....com>
Cc: robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
richardcochran@...il.com, claudiu.manoil@....com,
vladimir.oltean@....com, xiaoning.wang@....com,
andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, vadim.fedorenko@...ux.dev,
shawnguo@...nel.org, fushi.peng@....com, devicetree@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
imx@...ts.linux.dev
Subject: Re: [PATCH v6 net-next 14/17] net: enetc: move sync packet
modification before dma_map_single()
On Wed, Aug 27, 2025 at 02:33:29PM +0800, Wei Fang wrote:
> Move sync packet content modification before dma_map_single() to follow
> correct DMA usage process, even though the previous sequence worked due
> to hardware DMA-coherence support (LS1028A). But for the upcoming i.MX95,
> its ENETC (v4) does not support "dma-coherent", so this step is very
> necessary. Otherwise, the originTimestamp and correction fields of the
> sent packets will still be the values before the modification.
>
> Signed-off-by: Wei Fang <wei.fang@....com>
Reviewed-by: Frank Li <Frank.Li@....com>
>
> ---
> v6 changes:
> new patch, separated from the patch "net: enetc: add PTP synchronization
> support for ENETC v4"
> ---
> drivers/net/ethernet/freescale/enetc/enetc.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
> index 4325eb3d9481..25379ac7d69d 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
> @@ -303,6 +303,7 @@ static int enetc_map_tx_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb)
> unsigned int f;
> dma_addr_t dma;
> u8 flags = 0;
> + u32 tstamp;
>
> enetc_clear_tx_bd(&temp_bd);
> if (skb->ip_summed == CHECKSUM_PARTIAL) {
> @@ -327,6 +328,13 @@ static int enetc_map_tx_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb)
> }
> }
>
> + if (enetc_cb->flag & ENETC_F_TX_ONESTEP_SYNC_TSTAMP) {
> + do_onestep_tstamp = true;
> + tstamp = enetc_update_ptp_sync_msg(priv, skb);
> + } else if (enetc_cb->flag & ENETC_F_TX_TSTAMP) {
> + do_twostep_tstamp = true;
> + }
> +
> i = tx_ring->next_to_use;
> txbd = ENETC_TXBD(*tx_ring, i);
> prefetchw(txbd);
> @@ -346,11 +354,6 @@ static int enetc_map_tx_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb)
> count++;
>
> do_vlan = skb_vlan_tag_present(skb);
> - if (enetc_cb->flag & ENETC_F_TX_ONESTEP_SYNC_TSTAMP)
> - do_onestep_tstamp = true;
> - else if (enetc_cb->flag & ENETC_F_TX_TSTAMP)
> - do_twostep_tstamp = true;
> -
> tx_swbd->do_twostep_tstamp = do_twostep_tstamp;
> tx_swbd->qbv_en = !!(priv->active_offloads & ENETC_F_QBV);
> tx_swbd->check_wb = tx_swbd->do_twostep_tstamp || tx_swbd->qbv_en;
> @@ -393,8 +396,6 @@ static int enetc_map_tx_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb)
> }
>
> if (do_onestep_tstamp) {
> - u32 tstamp = enetc_update_ptp_sync_msg(priv, skb);
> -
> /* Configure extension BD */
> temp_bd.ext.tstamp = cpu_to_le32(tstamp);
> e_flags |= ENETC_TXBD_E_FLAGS_ONE_STEP_PTP;
> --
> 2.34.1
>
Powered by blists - more mailing lists