* [PATCH net] stmmac: correct mc_filter local variable in set_filter and set_mac_addr call
@ 2014-10-09 15:10 Vince Bridgers
2014-10-10 5:47 ` Giuseppe CAVALLARO
2014-10-10 18:48 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Vince Bridgers @ 2014-10-09 15:10 UTC (permalink / raw)
To: peppe.cavallaro, netdev, linux-kernel; +Cc: vbridger, vbridger
Testing revealed that the local variable mc_filter was dimensioned
incorrectly for all possible configurations and get_mac_addr should
have been set_mac_addr (a typo). Make sure mc_filter is dimensioned
to 8 32-bit unsigned longs - the largest size of the Synopsys
multicast filter register set.
Signed-off-by: Vince Bridgers <vbridger@opensource.altera.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
index 5efe60e..0adcf73 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
@@ -134,7 +134,7 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
void __iomem *ioaddr = (void __iomem *)dev->base_addr;
unsigned int value = 0;
unsigned int perfect_addr_number = hw->unicast_filter_entries;
- u32 mc_filter[2];
+ u32 mc_filter[8];
int mcbitslog2 = hw->mcast_bits_log2;
pr_debug("%s: # mcasts %d, # unicast %d\n", __func__,
@@ -182,7 +182,7 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
struct netdev_hw_addr *ha;
netdev_for_each_uc_addr(ha, dev) {
- stmmac_get_mac_addr(ioaddr, ha->addr,
+ stmmac_set_mac_addr(ioaddr, ha->addr,
GMAC_ADDR_HIGH(reg),
GMAC_ADDR_LOW(reg));
reg++;
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] stmmac: correct mc_filter local variable in set_filter and set_mac_addr call
2014-10-09 15:10 [PATCH net] stmmac: correct mc_filter local variable in set_filter and set_mac_addr call Vince Bridgers
@ 2014-10-10 5:47 ` Giuseppe CAVALLARO
2014-10-10 18:48 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Giuseppe CAVALLARO @ 2014-10-10 5:47 UTC (permalink / raw)
To: Vince Bridgers, netdev, linux-kernel; +Cc: vbridger
On 10/9/2014 5:10 PM, Vince Bridgers wrote:
> Testing revealed that the local variable mc_filter was dimensioned
> incorrectly for all possible configurations and get_mac_addr should
> have been set_mac_addr (a typo). Make sure mc_filter is dimensioned
> to 8 32-bit unsigned longs - the largest size of the Synopsys
> multicast filter register set.
>
> Signed-off-by: Vince Bridgers <vbridger@opensource.altera.com>
Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> index 5efe60e..0adcf73 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
> @@ -134,7 +134,7 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
> void __iomem *ioaddr = (void __iomem *)dev->base_addr;
> unsigned int value = 0;
> unsigned int perfect_addr_number = hw->unicast_filter_entries;
> - u32 mc_filter[2];
> + u32 mc_filter[8];
> int mcbitslog2 = hw->mcast_bits_log2;
>
> pr_debug("%s: # mcasts %d, # unicast %d\n", __func__,
> @@ -182,7 +182,7 @@ static void dwmac1000_set_filter(struct mac_device_info *hw,
> struct netdev_hw_addr *ha;
>
> netdev_for_each_uc_addr(ha, dev) {
> - stmmac_get_mac_addr(ioaddr, ha->addr,
> + stmmac_set_mac_addr(ioaddr, ha->addr,
> GMAC_ADDR_HIGH(reg),
> GMAC_ADDR_LOW(reg));
> reg++;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] stmmac: correct mc_filter local variable in set_filter and set_mac_addr call
2014-10-09 15:10 [PATCH net] stmmac: correct mc_filter local variable in set_filter and set_mac_addr call Vince Bridgers
2014-10-10 5:47 ` Giuseppe CAVALLARO
@ 2014-10-10 18:48 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-10-10 18:48 UTC (permalink / raw)
To: vbridger; +Cc: peppe.cavallaro, netdev, linux-kernel, vbridger
From: Vince Bridgers <vbridger@opensource.altera.com>
Date: Thu, 9 Oct 2014 10:10:36 -0500
> Testing revealed that the local variable mc_filter was dimensioned
> incorrectly for all possible configurations and get_mac_addr should
> have been set_mac_addr (a typo). Make sure mc_filter is dimensioned
> to 8 32-bit unsigned longs - the largest size of the Synopsys
> multicast filter register set.
>
> Signed-off-by: Vince Bridgers <vbridger@opensource.altera.com>
Applied, thanks vince.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-10 18:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-09 15:10 [PATCH net] stmmac: correct mc_filter local variable in set_filter and set_mac_addr call Vince Bridgers
2014-10-10 5:47 ` Giuseppe CAVALLARO
2014-10-10 18:48 ` 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).