Skip to contentSkip to conversation

mv643xx_eth: fix unicast address filter corruption on mtu change

PATCH Applied Lennert Buytenhek 2 participants 2 messages Mar 10, 2009 – Mar 13, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mv643xx_eth: fix unicast address filter corruption on mtu change

When mv643xx_eth_open() is called to up an interface, port_start() will first re-program the unicast address filter, and then re-initialise the PORT_CONFIG register, but that will disable unicast promiscuous mode if it was enabled by the unicast address filter setup.

This isn't a problem on ifconfig up, as ->set_rx_mode() will be called shortly afterwards which will program the filters again, but it does trigger when changing the MTU, which calls mv643xx_eth_stop() and then mv643xx_eth_open() by hand to repopulate the receive rings with skbuffs of the new size.

Swap the initialisation of the PORT_START register and the call to the unicast filter setup function to fix this.

---
 drivers/net/mv643xx_eth.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/mv643xx_eth.c +5 -5
index e920198..19ceeac 100644
@@ -2289,11 +2289,6 @@ static void port_start(struct mv643xx_eth_private *mp)
 	}
 
 	/*
-	 * Add configured unicast address to address filter table.
-	 */
-	mv643xx_eth_program_unicast_filter(mp->dev);
-
-	/*
 	 * Receive all unmatched unicast, TCP, UDP, BPDU and broadcast
 	 * frames to RX queue #0, and include the pseudo-header when
 	 * calculating receive checksums.
@@ -2306,6 +2301,11 @@ static void port_start(struct mv643xx_eth_private *mp)
 	wrlp(mp, PORT_CONFIG_EXT, 0x00000000);
 
 	/*
+	 * Add configured unicast addresses to address filter table.
+	 */
+	mv643xx_eth_program_unicast_filter(mp->dev);
+
+	/*
 	 * Enable the receive queues.
 	 */
 	for (i = 0; i < mp->rxq_count; i++) {
Signature · 1 line
1.5.6.4
maintainer Applied
#1 lore raw

From: Lennert Buytenhek <[email protected]>
Date: Tue, 10 Mar 2009 09:22:48 +0100

Quoted 11 lines

When mv643xx_eth_open() is called to up an interface, port_start() will first re-program the unicast address filter, and then re-initialise the PORT_CONFIG register, but that will disable unicast promiscuous mode if it was enabled by the unicast address filter setup.

This isn't a problem on ifconfig up, as ->set_rx_mode() will be called shortly afterwards which will program the filters again, but it does trigger when changing the MTU, which calls mv643xx_eth_stop() and then mv643xx_eth_open() by hand to repopulate the receive rings with skbuffs of the new size.

Quoted 4 lines

Swap the initialisation of the PORT_START register and the call to the unicast filter setup function to fix this.

Applied, thanks Lennert!