[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c29ae5b4-fa2f-4dad-b32f-86838d846d35@quicinc.com>
Date: Wed, 4 Sep 2024 18:12:21 -0700
From: Sagar Cheluvegowda <quic_scheluve@...cinc.com>
To: Abhishek Chauhan <quic_abchauha@...cinc.com>,
Alexandre Torgue
<alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
"David S.
Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
"Jakub
Kicinski" <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin
<mcoquelin.stm32@...il.com>, <netdev@...r.kernel.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-arm-kernel@...ts.infradead.org>,
Andrew Halaney <ahalaney@...hat.com>
CC: <kernel@...cinc.com>
Subject: Re: [PATCH net-next v1] net: stmmac: Programming sequence for VLAN
packets with split header
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
> index e0165358c4ac..dbd1be4e4a92 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
> @@ -526,6 +526,17 @@ static void dwmac4_enable_sph(struct stmmac_priv *priv, void __iomem *ioaddr,
> value |= GMAC_CONFIG_HDSMS_256; /* Segment max 256 bytes */
> writel(value, ioaddr + GMAC_EXT_CONFIG);
>
> + /* Additional configuration to handle VLAN tagged packets */
> + value = readl(ioaddr + GMAC_EXT_CFG1);
> + value &= ~GMAC_CONFIG1_SPLM;
> + /* Enable Split mode for header and payload at L2 */
> + value |= GMAC_CONFIG1_SPLM_L2OFST_EN << GMAC_CONFIG1_SPLM_SHIFT;
> + value &= ~GMAC_CONFIG1_SAVO;
> + /* Enables the MAC to distinguish between tagged vs untagged pkts */
> + value |= 4 << GMAC_CONFIG1_SAVO_SHIFT;
I checked the data book internally and see SAVO bit is used to indicate the
valueof the offset from the beginning of Length/Type field at which the header
should be split, i see the length/type field remains to be 2bytes even in case
of tagged packets may be you need to keep the value of this field to 2bytes as
it was before but one thing which i am still not able to understand is that even
with the value of this field configured to 4 i don't see any packet corruption
issue, something which needs to be checked with HW folks.
> + value |= GMAC_CONFIG1_SAVE_EN;
> + writel(value, ioaddr + GMAC_EXT_CFG1);
> +
> value = readl(ioaddr + DMA_CHAN_CONTROL(dwmac4_addrs, chan));
> if (en)
> value |= DMA_CONTROL_SPH;
Powered by blists - more mailing lists