From: Simon Horman <horms@kernel.org>
To: Abhishek Chauhan <quic_abchauha@quicinc.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
Andrew Halaney <ahalaney@redhat.com>,
kernel@quicinc.com
Subject: Re: [PATCH net-next v1] net: stmmac: Programming sequence for VLAN packets with split header
Date: Fri, 6 Sep 2024 11:28:39 +0100 [thread overview]
Message-ID: <20240906102839.GE2097826@kernel.org> (raw)
In-Reply-To: <20240904235456.2663335-1-quic_abchauha@quicinc.com>
On Wed, Sep 04, 2024 at 04:54:56PM -0700, Abhishek Chauhan wrote:
> Currently reset state configuration of split header works fine for
> non-tagged packets and we see no corruption in payload of any size
>
> We need additional programming sequence with reset configuration to
> handle VLAN tagged packets to avoid corruption in payload for packets
> of size greater than 256 bytes.
>
> Without this change ping application complains about corruption
> in payload when the size of the VLAN packet exceeds 256 bytes.
>
> With this change tagged and non-tagged packets of any size works fine
> and there is no corruption seen.
>
> Signed-off-by: Abhishek Chauhan <quic_abchauha@quicinc.com>
...
> 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;
> + value |= GMAC_CONFIG1_SAVE_EN;
> + writel(value, ioaddr + GMAC_EXT_CFG1);
Hi Abhishek,
Perhaps it is inconsistent with the code elsewhere in this file,
in which case I would suggest a follow-up clean-up, but I
expect that using FIELD_PREP would both lead to cleaner code here
and remove the need for *_SHIFT.
> +
> value = readl(ioaddr + DMA_CHAN_CONTROL(dwmac4_addrs, chan));
> if (en)
> value |= DMA_CONTROL_SPH;
> --
> 2.25.1
>
>
next prev parent reply other threads:[~2024-09-06 10:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 23:54 [PATCH net-next v1] net: stmmac: Programming sequence for VLAN packets with split header Abhishek Chauhan
2024-09-05 1:12 ` Sagar Cheluvegowda
2024-09-05 2:05 ` Abhishek Chauhan (ABC)
2024-09-06 10:28 ` Simon Horman [this message]
2024-09-10 23:19 ` Abhishek Chauhan (ABC)
2024-09-06 21:49 ` Andrew Halaney
2024-09-10 23:25 ` Abhishek Chauhan (ABC)
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=20240906102839.GE2097826@kernel.org \
--to=horms@kernel.org \
--cc=ahalaney@redhat.com \
--cc=alexandre.torgue@foss.st.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=kernel@quicinc.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_abchauha@quicinc.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).