netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] net: stmmac: Fix multicast filter on IPQ806x
@ 2020-08-12 19:36 Jonathan McDowell
  2020-08-12 19:37 ` [PATCH net 1/2] net: stmmac: dwmac1000: provide multicast filter fallback Jonathan McDowell
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jonathan McDowell @ 2020-08-12 19:36 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu, David Miller,
	Jakub Kicinski, Maxime Coquelin, netdev, linux-stm32,
	linux-arm-kernel, linux-arm-msm, linux-kernel

This pair of patches are the result of discovering a failure to
correctly receive IPv6 multicast packets on such a device (in particular
DHCPv6 requests and RA solicitations). Putting the device into
promiscuous mode, or allmulti, both resulted in such packets correctly
being received. Examination of the vendor driver (nss-gmac from the
qsdk) shows that it does not enable the multicast filter and instead
falls back to allmulti.

Extend the base dwmac1000 driver to fall back when there's no suitable
hardware filter, and update the ipq806x platform to request this.

Jonathan McDowell (2):
  net: stmmac: dwmac1000: provide multicast filter fallback
  net: ethernet: stmmac: Disable hardware multicast filter

 drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c  | 1 +
 drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 3 +++
 2 files changed, 4 insertions(+)

-- 
2.20.1


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

* [PATCH net 1/2] net: stmmac: dwmac1000: provide multicast filter fallback
  2020-08-12 19:36 [PATCH net 0/2] net: stmmac: Fix multicast filter on IPQ806x Jonathan McDowell
@ 2020-08-12 19:37 ` Jonathan McDowell
  2020-08-12 19:37 ` [PATCH net 2/2] net: ethernet: stmmac: Disable hardware multicast filter Jonathan McDowell
  2020-08-12 20:13 ` [PATCH net 0/2] net: stmmac: Fix multicast filter on IPQ806x David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jonathan McDowell @ 2020-08-12 19:37 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu, David Miller,
	Jakub Kicinski, Maxime Coquelin, netdev, linux-stm32,
	linux-arm-kernel, linux-arm-msm, linux-kernel

If we don't have a hardware multicast filter available then instead of
silently failing to listen for the requested ethernet broadcast
addresses fall back to receiving all multicast packets, in a similar
fashion to other drivers with no multicast filter.

Cc: stable@vger.kernel.org
Signed-off-by: Jonathan McDowell <noodles@earth.li>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
index efc6ec1b8027..fc8759f146c7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -164,6 +164,9 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
 		value = GMAC_FRAME_FILTER_PR | GMAC_FRAME_FILTER_PCF;
 	} else if (dev->flags & IFF_ALLMULTI) {
 		value = GMAC_FRAME_FILTER_PM;	/* pass all multi */
+	} else if (!netdev_mc_empty(dev) && (mcbitslog2 == 0)) {
+		/* Fall back to all multicast if we've no filter */
+		value = GMAC_FRAME_FILTER_PM;
 	} else if (!netdev_mc_empty(dev)) {
 		struct netdev_hw_addr *ha;
 
-- 
2.20.1


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

* [PATCH net 2/2] net: ethernet: stmmac: Disable hardware multicast filter
  2020-08-12 19:36 [PATCH net 0/2] net: stmmac: Fix multicast filter on IPQ806x Jonathan McDowell
  2020-08-12 19:37 ` [PATCH net 1/2] net: stmmac: dwmac1000: provide multicast filter fallback Jonathan McDowell
@ 2020-08-12 19:37 ` Jonathan McDowell
  2020-08-12 20:13 ` [PATCH net 0/2] net: stmmac: Fix multicast filter on IPQ806x David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Jonathan McDowell @ 2020-08-12 19:37 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu, David Miller,
	Jakub Kicinski, Maxime Coquelin, netdev, linux-stm32,
	linux-arm-kernel, linux-arm-msm, linux-kernel

The IPQ806x does not appear to have a functional multicast ethernet
address filter. This was observed as a failure to correctly receive IPv6
packets on a LAN to the all stations address. Checking the vendor driver
shows that it does not attempt to enable the multicast filter and
instead falls back to receiving all multicast packets, internally
setting ALLMULTI.

Use the new fallback support in the dwmac1000 driver to correctly
achieve the same with the mainline IPQ806x driver. Confirmed to fix IPv6
functionality on an RB3011 router.

Cc: stable@vger.kernel.org
Signed-off-by: Jonathan McDowell <noodles@earth.li>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
index 02102c781a8c..bf3250e0e59c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
@@ -351,6 +351,7 @@ static int ipq806x_gmac_probe(struct platform_device *pdev)
 	plat_dat->has_gmac = true;
 	plat_dat->bsp_priv = gmac;
 	plat_dat->fix_mac_speed = ipq806x_gmac_fix_mac_speed;
+	plat_dat->multicast_filter_bins = 0;
 
 	err = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
 	if (err)
-- 
2.20.1


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

* Re: [PATCH net 0/2] net: stmmac: Fix multicast filter on IPQ806x
  2020-08-12 19:36 [PATCH net 0/2] net: stmmac: Fix multicast filter on IPQ806x Jonathan McDowell
  2020-08-12 19:37 ` [PATCH net 1/2] net: stmmac: dwmac1000: provide multicast filter fallback Jonathan McDowell
  2020-08-12 19:37 ` [PATCH net 2/2] net: ethernet: stmmac: Disable hardware multicast filter Jonathan McDowell
@ 2020-08-12 20:13 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-08-12 20:13 UTC (permalink / raw)
  To: noodles
  Cc: peppe.cavallaro, alexandre.torgue, joabreu, kuba,
	mcoquelin.stm32, netdev, linux-stm32, linux-arm-kernel,
	linux-arm-msm, linux-kernel

From: Jonathan McDowell <noodles@earth.li>
Date: Wed, 12 Aug 2020 20:36:54 +0100

> This pair of patches are the result of discovering a failure to
> correctly receive IPv6 multicast packets on such a device (in particular
> DHCPv6 requests and RA solicitations). Putting the device into
> promiscuous mode, or allmulti, both resulted in such packets correctly
> being received. Examination of the vendor driver (nss-gmac from the
> qsdk) shows that it does not enable the multicast filter and instead
> falls back to allmulti.
> 
> Extend the base dwmac1000 driver to fall back when there's no suitable
> hardware filter, and update the ipq806x platform to request this.

Series applied, thank you.

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

end of thread, other threads:[~2020-08-12 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 19:36 [PATCH net 0/2] net: stmmac: Fix multicast filter on IPQ806x Jonathan McDowell
2020-08-12 19:37 ` [PATCH net 1/2] net: stmmac: dwmac1000: provide multicast filter fallback Jonathan McDowell
2020-08-12 19:37 ` [PATCH net 2/2] net: ethernet: stmmac: Disable hardware multicast filter Jonathan McDowell
2020-08-12 20:13 ` [PATCH net 0/2] net: stmmac: Fix multicast filter on IPQ806x David Miller

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