All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ong Boon Leong <boon.leong.ong@intel.com>
To: netdev@vger.kernel.org
Cc: Tan Tee Min <tee.min.tan@intel.com>,
	Voon Weifeng <weifeng.voon@intel.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre TORGUE <alexandre.torgue@st.com>,
	Jose Abreu <Jose.Abreu@synopsys.com>,
	"David S . Miller" <davem@davemloft.net>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Joao Pinto <Joao.Pinto@synopsys.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Alexandru Ardelean <alexandru.ardelean@analog.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net v3 3/5] net: stmmac: fix missing IFF_MULTICAST check in dwmac4_set_filter
Date: Wed, 22 Jan 2020 17:09:34 +0800	[thread overview]
Message-ID: <20200122090936.28555-4-boon.leong.ong@intel.com> (raw)
In-Reply-To: <20200122090936.28555-1-boon.leong.ong@intel.com>

From: "Verma, Aashish" <aashishx.verma@intel.com>

Without checking for IFF_MULTICAST flag, it is wrong to assume multicast
filtering is always enabled. By checking against IFF_MULTICAST, now
the driver behaves correctly when the multicast support is toggled by below
command:-

  ip link set <devname> multicast off|on

Fixes: 477286b53f55 ("stmmac: add GMAC4 core support")
Signed-off-by: Verma, Aashish <aashishx.verma@intel.com>
Tested-by: Tan, Tee Min <tee.min.tan@intel.com>
Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index 6e3d0ab0ecd6..53be936137d0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -420,7 +420,7 @@ static void dwmac4_set_filter(struct mac_device_info *hw,
 		value |= GMAC_PACKET_FILTER_PM;
 		/* Set all the bits of the HASH tab */
 		memset(mc_filter, 0xff, sizeof(mc_filter));
-	} else if (!netdev_mc_empty(dev)) {
+	} else if (!netdev_mc_empty(dev) && (dev->flags & IFF_MULTICAST)) {
 		struct netdev_hw_addr *ha;
 
 		/* Hash filter for multicast */
-- 
2.17.1


WARNING: multiple messages have this Message-ID (diff)
From: Ong Boon Leong <boon.leong.ong@intel.com>
To: netdev@vger.kernel.org
Cc: Jose Abreu <Jose.Abreu@synopsys.com>,
	Joao Pinto <Joao.Pinto@synopsys.com>,
	Alexandre TORGUE <alexandre.torgue@st.com>,
	Voon Weifeng <weifeng.voon@intel.com>,
	linux-kernel@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	Arnd Bergmann <arnd@arndb.de>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Tan Tee Min <tee.min.tan@intel.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandru Ardelean <alexandru.ardelean@analog.com>,
	"David S . Miller" <davem@davemloft.net>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH net v3 3/5] net: stmmac: fix missing IFF_MULTICAST check in dwmac4_set_filter
Date: Wed, 22 Jan 2020 17:09:34 +0800	[thread overview]
Message-ID: <20200122090936.28555-4-boon.leong.ong@intel.com> (raw)
In-Reply-To: <20200122090936.28555-1-boon.leong.ong@intel.com>

From: "Verma, Aashish" <aashishx.verma@intel.com>

Without checking for IFF_MULTICAST flag, it is wrong to assume multicast
filtering is always enabled. By checking against IFF_MULTICAST, now
the driver behaves correctly when the multicast support is toggled by below
command:-

  ip link set <devname> multicast off|on

Fixes: 477286b53f55 ("stmmac: add GMAC4 core support")
Signed-off-by: Verma, Aashish <aashishx.verma@intel.com>
Tested-by: Tan, Tee Min <tee.min.tan@intel.com>
Signed-off-by: Ong Boon Leong <boon.leong.ong@intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index 6e3d0ab0ecd6..53be936137d0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -420,7 +420,7 @@ static void dwmac4_set_filter(struct mac_device_info *hw,
 		value |= GMAC_PACKET_FILTER_PM;
 		/* Set all the bits of the HASH tab */
 		memset(mc_filter, 0xff, sizeof(mc_filter));
-	} else if (!netdev_mc_empty(dev)) {
+	} else if (!netdev_mc_empty(dev) && (dev->flags & IFF_MULTICAST)) {
 		struct netdev_hw_addr *ha;
 
 		/* Hash filter for multicast */
-- 
2.17.1


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

  parent reply	other threads:[~2020-01-22  9:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22  9:09 [PATCH net v3 0/5] net: stmmac: general fixes for Ethernet functionality Ong Boon Leong
2020-01-22  9:09 ` Ong Boon Leong
2020-01-22  9:09 ` [PATCH net v3 1/5] net: stmmac: Fix incorrect location to set real_num_rx|tx_queues Ong Boon Leong
2020-01-22  9:09   ` Ong Boon Leong
2020-01-22  9:55   ` Jose Abreu
2020-01-22  9:55     ` Jose Abreu
2020-01-24  8:56     ` Ong, Boon Leong
2020-01-24  8:56       ` Ong, Boon Leong
2020-01-24  9:06       ` Jose Abreu
2020-01-24  9:06         ` Jose Abreu
2020-01-22  9:09 ` [PATCH net v3 2/5] net: stmmac: fix incorrect GMAC_VLAN_TAG register writting in GMAC4+ Ong Boon Leong
2020-01-22  9:09   ` Ong Boon Leong
2020-01-22 10:31   ` Jose Abreu
2020-01-22 10:31     ` Jose Abreu
2020-01-24  8:56     ` Ong, Boon Leong
2020-01-24  8:56       ` Ong, Boon Leong
2020-01-22  9:09 ` Ong Boon Leong [this message]
2020-01-22  9:09   ` [PATCH net v3 3/5] net: stmmac: fix missing IFF_MULTICAST check in dwmac4_set_filter Ong Boon Leong
2020-01-22  9:09 ` [PATCH net v3 4/5] net: stmmac: xgmac: fix missing IFF_MULTICAST checki in dwxgmac2_set_filter Ong Boon Leong
2020-01-22  9:09   ` Ong Boon Leong
2020-01-22  9:09 ` [PATCH net v3 5/5] net: stmmac: update pci platform data to use phy_interface Ong Boon Leong
2020-01-22  9:09   ` Ong Boon Leong

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=20200122090936.28555-4-boon.leong.ong@intel.com \
    --to=boon.leong.ong@intel.com \
    --cc=Joao.Pinto@synopsys.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=alexandre.torgue@st.com \
    --cc=alexandru.ardelean@analog.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=tee.min.tan@intel.com \
    --cc=weifeng.voon@intel.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 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.