All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used
@ 2020-03-08  9:25 ` Remi Pommarel
  0 siblings, 0 replies; 7+ messages in thread
From: Remi Pommarel @ 2020-03-08  9:25 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu
  Cc: David S. Miller, netdev, linux-arm-kernel, linux-kernel,
	linux-amlogic, Remi Pommarel, stable

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.

Fixes: 47dd7a540b8a0 ("net: add support for STMicroelectronics Ethernet controllers.")
Cc: stable@vger.kernel.org
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
---
Changes since v1:
  - Use reverse christmas tree like declaration
  - Add Fixes tag
---
 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..542784300620 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -24,6 +24,7 @@
 static void dwmac1000_core_init(struct mac_device_info *hw,
 				struct net_device *dev)
 {
+	struct stmmac_priv *priv = netdev_priv(dev);
 	void __iomem *ioaddr = hw->pcsr;
 	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


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

* [PATCH v2] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used
@ 2020-03-08  9:25 ` Remi Pommarel
  0 siblings, 0 replies; 7+ messages in thread
From: Remi Pommarel @ 2020-03-08  9:25 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu
  Cc: netdev, linux-kernel, stable, 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.

Fixes: 47dd7a540b8a0 ("net: add support for STMicroelectronics Ethernet controllers.")
Cc: stable@vger.kernel.org
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
---
Changes since v1:
  - Use reverse christmas tree like declaration
  - Add Fixes tag
---
 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..542784300620 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -24,6 +24,7 @@
 static void dwmac1000_core_init(struct mac_device_info *hw,
 				struct net_device *dev)
 {
+	struct stmmac_priv *priv = netdev_priv(dev);
 	void __iomem *ioaddr = hw->pcsr;
 	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] 7+ messages in thread

* [PATCH v2] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used
@ 2020-03-08  9:25 ` Remi Pommarel
  0 siblings, 0 replies; 7+ messages in thread
From: Remi Pommarel @ 2020-03-08  9:25 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu
  Cc: netdev, linux-kernel, stable, 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.

Fixes: 47dd7a540b8a0 ("net: add support for STMicroelectronics Ethernet controllers.")
Cc: stable@vger.kernel.org
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
---
Changes since v1:
  - Use reverse christmas tree like declaration
  - Add Fixes tag
---
 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..542784300620 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -24,6 +24,7 @@
 static void dwmac1000_core_init(struct mac_device_info *hw,
 				struct net_device *dev)
 {
+	struct stmmac_priv *priv = netdev_priv(dev);
 	void __iomem *ioaddr = hw->pcsr;
 	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-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v2] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used
  2020-03-08  9:25 ` Remi Pommarel
  (?)
@ 2020-03-09  4:29   ` David Miller
  -1 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2020-03-09  4:29 UTC (permalink / raw)
  To: repk
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, netdev,
	linux-arm-kernel, linux-kernel, linux-amlogic, stable

From: Remi Pommarel <repk@triplefau.lt>
Date: Sun,  8 Mar 2020 10:25:56 +0100

> 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.
> 
> Fixes: 47dd7a540b8a0 ("net: add support for STMicroelectronics Ethernet controllers.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Remi Pommarel <repk@triplefau.lt>

Please don't CC: stable for networking fixes as per the netdev FAQ.

Applied and queued up for -stable, thank you.

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

* Re: [PATCH v2] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used
@ 2020-03-09  4:29   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2020-03-09  4:29 UTC (permalink / raw)
  To: repk
  Cc: alexandre.torgue, netdev, linux-kernel, stable, joabreu,
	linux-amlogic, peppe.cavallaro, linux-arm-kernel

From: Remi Pommarel <repk@triplefau.lt>
Date: Sun,  8 Mar 2020 10:25:56 +0100

> 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.
> 
> Fixes: 47dd7a540b8a0 ("net: add support for STMicroelectronics Ethernet controllers.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Remi Pommarel <repk@triplefau.lt>

Please don't CC: stable for networking fixes as per the netdev FAQ.

Applied and queued up for -stable, thank you.

_______________________________________________
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] 7+ messages in thread

* Re: [PATCH v2] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used
@ 2020-03-09  4:29   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2020-03-09  4:29 UTC (permalink / raw)
  To: repk
  Cc: alexandre.torgue, netdev, linux-kernel, stable, joabreu,
	linux-amlogic, peppe.cavallaro, linux-arm-kernel

From: Remi Pommarel <repk@triplefau.lt>
Date: Sun,  8 Mar 2020 10:25:56 +0100

> 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.
> 
> Fixes: 47dd7a540b8a0 ("net: add support for STMicroelectronics Ethernet controllers.")
> Cc: stable@vger.kernel.org
> Signed-off-by: Remi Pommarel <repk@triplefau.lt>

Please don't CC: stable for networking fixes as per the netdev FAQ.

Applied and queued up for -stable, thank you.

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

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

* Re: [PATCH v2] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used
  2020-03-08  9:25 ` Remi Pommarel
                   ` (2 preceding siblings ...)
  (?)
@ 2020-03-09 12:25 ` Sasha Levin
  -1 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2020-03-09 12:25 UTC (permalink / raw)
  To: Sasha Levin, Remi Pommarel, Giuseppe Cavallaro
  Cc: David S. Miller, netdev, stable, stable

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1789 bytes --]

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: 47dd7a540b8a ("net: add support for STMicroelectronics Ethernet controllers.").

The bot has tested the following trees: v5.5.8, v5.4.24, v4.19.108, v4.14.172, v4.9.215, v4.4.215.

v5.5.8: Build OK!
v5.4.24: Build OK!
v4.19.108: Build OK!
v4.14.172: Build failed! Errors:
    drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c:48:35: error: dereferencing pointer to incomplete type ‘struct stmmac_priv’

v4.9.215: Failed to apply! Possible dependencies:
    270c7759fbbc ("net: stmmac: add set_mac to the stmmac_ops")
    8cad443eacf6 ("net: stmmac: Fix reception of Broadcom switches tags")
    9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i")
    d8256121a91a ("stmmac: adding new glue driver dwmac-dwc-qos-eth")

v4.4.215: Failed to apply! Possible dependencies:
    0e80bdc9a72d ("stmmac: first frame prep at the end of xmit routine")
    270c7759fbbc ("net: stmmac: add set_mac to the stmmac_ops")
    293e4365a1ad ("stmmac: change descriptor layout")
    2a6d8e172639 ("stmmac: add last_segment field to dma data")
    477286b53f55 ("stmmac: add GMAC4 core support")
    553e2ab3130e ("stmmac: add length field to dma data")
    753a71090f33 ("stmmac: add descriptors function for GMAC 4.xx")
    8cad443eacf6 ("net: stmmac: Fix reception of Broadcom switches tags")
    be434d5075d6 ("stmmac: optimize tx desc management")
    c1fa3212be55 ("stmmac: merge get_rx_owner into rx_status routine.")
    d0225e7de622 ("stmmac: rework the routines to show the ring status")
    e3ad57c96715 ("stmmac: review RX/TX ring management")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

end of thread, other threads:[~2020-03-09 12:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-08  9:25 [PATCH v2] net: stmmac: dwmac1000: Disable ACS if enhanced descs are not used Remi Pommarel
2020-03-08  9:25 ` Remi Pommarel
2020-03-08  9:25 ` Remi Pommarel
2020-03-09  4:29 ` David Miller
2020-03-09  4:29   ` David Miller
2020-03-09  4:29   ` David Miller
2020-03-09 12:25 ` Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.