From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 546E4CE7AFB for ; Fri, 6 Sep 2024 10:29:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=xihNDZZtKUN7Ss7rbgoeIgjVeB2YXfqdTGQMxxefamA=; b=jSwH6XD2YkVeVBpNll4TtLDphL QIJofcANOve5sygTdZqaH99IdU88Ibnrgy70HQ+0P9If0MsZorZ1jlkgjkxx+z5bxPD+xRRLI5+S0 RqcVVydYOtJ+rqBv0f4snj00L1gAW9TO+1nYnucXfpEUUdJOZm/vh2G5HBPPhvkYfpppdzFQ5hdot JJ302GNBAwPtyNanhQYX5tUMaHyPDz4x/fkZLFg/ylFXM2sF1D6hZDLtdamBWrsFg+zCndYSEMi2G iIPuQpq4M6Dl1KjepBIhgMPUgHGnZWm+aPEfSaVsoRkG7DS7pnkV+BfeJ1Y4m9dRC45Hu1nx633Fd KZPO/beg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWDq-0000000Bldv-0FBS; Fri, 06 Sep 2024 10:29:46 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smWCr-0000000BlTN-1V6O for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 10:28:46 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 3EB75A44DEA; Fri, 6 Sep 2024 10:28:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6BC3C4CEC5; Fri, 6 Sep 2024 10:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725618524; bh=5BaC5tCLM4cokqPfWLvVsqm1VrOzWOAlQptFMFimM6E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VRY4rgFwAaGeU+O2i3eNekIjwHhEv82vc0hJpdLKTbZEKw2Py8dNtjYbd8m+i8rGt q+EcxuziyrxlyvXET2tCtFrn5aBY26Y6pS3oOHWk2xuPkVawRg/mnkuyaExxTvaJRB DHDBf93Jlqccz124foEm630PTwPncEAQZPvWpSYVoQgtSy6FRqdwfWy84seckqNQkd 7c+eh3AftQqeVHOiCRH0iVGdH4CXSjz8X/QBBQihIO2hk19rCNgJE4YsNkXZkcWq+O w5Ewa8tROis3p6jmCCCfKP6uXBO9WJ15SjhL1O73iDiwXFi9Qyd9xFY969cSmjy+Z4 UyPDAFTF5pg8Q== Date: Fri, 6 Sep 2024 11:28:39 +0100 From: Simon Horman To: Abhishek Chauhan Cc: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Andrew Halaney , kernel@quicinc.com Subject: Re: [PATCH net-next v1] net: stmmac: Programming sequence for VLAN packets with split header Message-ID: <20240906102839.GE2097826@kernel.org> References: <20240904235456.2663335-1-quic_abchauha@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240904235456.2663335-1-quic_abchauha@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_032845_485371_CA6245C8 X-CRM114-Status: GOOD ( 19.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 ... > 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 > >