linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used
@ 2020-03-06 19:30 Remi Pommarel
  2020-03-07 17:34 ` Jose Abreu
  0 siblings, 1 reply; 3+ messages in thread
From: Remi Pommarel @ 2020-03-06 19:30 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu
  Cc: netdev, linux-kernel, Remi Pommarel, linux-amlogic,
	David S. Miller, linux-arm-kernel

ACS (auto PAD/FCS stripping) removes FCS off 802.3 packets (LLC) so that
there is no need to manually strip it for such packets. The enhanced DMA
descriptors allow to flag LLC packets so that the receiving callback can
use that to strip FCS manually or not. On the other hand, normal
descriptors do not support that.

Thus in order to not truncate LLC packet ACS should be disabled when
using normal DMA descriptors.

Signed-off-by: Remi Pommarel <repk@triplefau.lt>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
index d0356fbd1e43..b468acf03b00 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -25,6 +25,7 @@ static void dwmac1000_core_init(struct mac_device_info *hw,
 				struct net_device *dev)
 {
 	void __iomem *ioaddr = hw->pcsr;
+	struct stmmac_priv *priv = netdev_priv(dev);
 	u32 value = readl(ioaddr + GMAC_CONTROL);
 	int mtu = dev->mtu;
 
@@ -35,7 +36,7 @@ static void dwmac1000_core_init(struct mac_device_info *hw,
 	 * Broadcom tags can look like invalid LLC/SNAP packets and cause the
 	 * hardware to truncate packets on reception.
 	 */
-	if (netdev_uses_dsa(dev))
+	if (netdev_uses_dsa(dev) || !priv->plat->enh_desc)
 		value &= ~GMAC_CONTROL_ACS;
 
 	if (mtu > 1500)
-- 
2.25.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used
  2020-03-06 19:30 [PATCH] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used Remi Pommarel
@ 2020-03-07 17:34 ` Jose Abreu
  2020-03-08  9:25   ` Remi Pommarel
  0 siblings, 1 reply; 3+ messages in thread
From: Jose Abreu @ 2020-03-07 17:34 UTC (permalink / raw)
  To: Remi Pommarel, Giuseppe Cavallaro, Alexandre Torgue
  Cc: netdev, linux-amlogic, David S. Miller, linux-arm-kernel, linux-kernel

From: Remi Pommarel <repk@triplefau.lt>
Date: Mar/06/2020, 19:30:36 (UTC+00:00)

>  	void __iomem *ioaddr = hw->pcsr;
> +	struct stmmac_priv *priv = netdev_priv(dev);
>  	u32 value = readl(ioaddr + GMAC_CONTROL);
>  	int mtu = dev->mtu;

Please use reverse Christmas tree order and also provide a Fixes tag.

---
Thanks,
Jose Miguel Abreu

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used
  2020-03-07 17:34 ` Jose Abreu
@ 2020-03-08  9:25   ` Remi Pommarel
  0 siblings, 0 replies; 3+ messages in thread
From: Remi Pommarel @ 2020-03-08  9:25 UTC (permalink / raw)
  To: Jose Abreu
  Cc: Alexandre Torgue, netdev, linux-kernel, linux-amlogic,
	Giuseppe Cavallaro, David S. Miller, linux-arm-kernel

On Sat, Mar 07, 2020 at 05:34:28PM +0000, Jose Abreu wrote:
> From: Remi Pommarel <repk@triplefau.lt>
> Date: Mar/06/2020, 19:30:36 (UTC+00:00)
> 
> >  	void __iomem *ioaddr = hw->pcsr;
> > +	struct stmmac_priv *priv = netdev_priv(dev);
> >  	u32 value = readl(ioaddr + GMAC_CONTROL);
> >  	int mtu = dev->mtu;
> 
> Please use reverse Christmas tree order and also provide a Fixes tag.

Done in v2.

Thanks,
-- 
Remi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-08  9:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 19:30 [PATCH] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used Remi Pommarel
2020-03-07 17:34 ` Jose Abreu
2020-03-08  9:25   ` Remi Pommarel

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).