Skip to contentSkip to conversation

net: ethernet: aquantia: set net_device mtu when mtu is changed

PATCH Applied David Arcari 4 participants 4 messages Mar 13, 2017 – Mar 17, 2017

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

PATCH 1/1 net: ethernet: aquantia: set net_device mtu when mtu is changed

When the aquantia device mtu is changed the net_device structure is not updated. As a result the ip command does not properly reflect the mtu change.

Commit 5513e16421cb incorrectly assumed that __dev_set_mtu() was making the assignment ndev->mtu = new_mtu; This is not true in the case where the driver has a ndo_change_mtu routine.

Fixes 5513e16421cb ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu")
---
 drivers/net/ethernet/aquantia/atlantic/aq_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/aquantia/atlantic/aq_main.c +1 -0
index dad6362..d05fbfd 100644
@@ -98,6 +98,7 @@ static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu)
 
 	if (err < 0)
 		goto err_exit;
+	ndev->mtu = new_mtu;
 
 	if (netif_running(ndev)) {
 		aq_ndev_close(ndev);
Signature · 1 line
1.8.3.1
Tested-by on v1 1/1
#1 lore raw
Quoted 21 lines · David Arcari

When the aquantia device mtu is changed the net_device structure is not updated. As a result the ip command does not properly reflect the mtu change.

Commit 5513e16421cb incorrectly assumed that __dev_set_mtu() was making the assignment ndev->mtu = new_mtu; This is not true in the case where the driver has a ndo_change_mtu routine.

Fixes 5513e16421cb ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu")
---
 drivers/net/ethernet/aquantia/atlantic/aq_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/aquantia/atlantic/aq_main.c +0 -0
index dad6362..d05fbfd 100644

drivers/net/ethernet/aquantia/atlantic/aq_main.c static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu) · line 104

Quoted 7 lines
drivers/net/ethernet/aquantia/atlantic/aq_main.c +1 -0
@@ -98,6 +98,7 @@ static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu)
 
 	if (err < 0)
 		goto err_exit;
+	ndev->mtu = new_mtu;
 
 	if (netif_running(ndev)) {
 		aq_ndev_close(ndev);
Reviewed-by on v1 1/1
#2 lore raw
In reply to David Arcari
Quoted 11 lines · David Arcari

When the aquantia device mtu is changed the net_device structure is not updated. As a result the ip command does not properly reflect the mtu change.

Commit 5513e16421cb incorrectly assumed that __dev_set_mtu() was making the assignment ndev->mtu = new_mtu; This is not true in the case where the driver has a ndo_change_mtu routine.

Fixes 5513e16421cb ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu")

Would help if I replied to the proper version of the patch. To reiterate, patch looks appropriate and necessary.

Signature · 2 lines
Jarod Wilson
[email protected]
maintainer Applied
#3 lore raw
In reply to David Arcari

From: David Arcari <[email protected]>
Date: Mon, 13 Mar 2017 19:07:16 -0400

Quoted 11 lines

When the aquantia device mtu is changed the net_device structure is not updated. As a result the ip command does not properly reflect the mtu change.

Commit 5513e16421cb incorrectly assumed that __dev_set_mtu() was making the assignment ndev->mtu = new_mtu; This is not true in the case where the driver has a ndo_change_mtu routine.

Fixes 5513e16421cb ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu")

Applied.