提交 6877f54e 编写于 作者: P Prabhanjan Sarnaik 提交者: David S. Miller

mv643xx_eth: fix unicast filter programming in promiscuous mode

The Unicast Promiscious Mode (UPM) bit in the mv643xx_eth port
configuration register doesn't do exactly what its name would suggest:
setting this bit merely enables reception of all unicast frames with a
destination address that differs from our local MAC address in bits
[47:4].  In particular, it doesn't have any effect on unicast frames
with a destination address that matches our MAC address in bits [47:4]
-- these will still be tested against the 16-entry unicast address
filter table.

Therefore, if the interface is set to promiscuous mode, just setting
the unicast promiscuous bit isn't enough -- we need to set all filter
bits in the unicast filter table to 1 as well.
Reported-by: NSachin Sanap <ssanap@marvell.com>
Signed-off-by: NPrabhanjan Sarnaik <sarnaik@marvell.com>
Tested-by: NSiddarth Gore <gores@marvell.com>
Tested-by: NMahavir Jain <mjain@marvell.com>
Signed-off-by: NLennert Buytenhek <buytenh@marvell.com>
Cc: stable@kernel.org
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 40c27eea
...@@ -1750,12 +1750,12 @@ static void mv643xx_eth_program_unicast_filter(struct net_device *dev) ...@@ -1750,12 +1750,12 @@ static void mv643xx_eth_program_unicast_filter(struct net_device *dev)
uc_addr_set(mp, dev->dev_addr); uc_addr_set(mp, dev->dev_addr);
port_config = rdlp(mp, PORT_CONFIG); port_config = rdlp(mp, PORT_CONFIG) & ~UNICAST_PROMISCUOUS_MODE;
nibbles = uc_addr_filter_mask(dev); nibbles = uc_addr_filter_mask(dev);
if (!nibbles) { if (!nibbles) {
port_config |= UNICAST_PROMISCUOUS_MODE; port_config |= UNICAST_PROMISCUOUS_MODE;
wrlp(mp, PORT_CONFIG, port_config); nibbles = 0xffff;
return;
} }
for (i = 0; i < 16; i += 4) { for (i = 0; i < 16; i += 4) {
...@@ -1776,7 +1776,6 @@ static void mv643xx_eth_program_unicast_filter(struct net_device *dev) ...@@ -1776,7 +1776,6 @@ static void mv643xx_eth_program_unicast_filter(struct net_device *dev)
wrl(mp, off, v); wrl(mp, off, v);
} }
port_config &= ~UNICAST_PROMISCUOUS_MODE;
wrlp(mp, PORT_CONFIG, port_config); wrlp(mp, PORT_CONFIG, port_config);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册