Skip to contentSkip to conversation

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

PATCH Applied David Arcari 4 participants 10 messages Mar 8, 2017 – Mar 15, 2017

Subsystems (3)

v1 of 2 Applied Latest is v2 →

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
#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);

Thank you, David.

I think we should also remove closing/opening net-device after mtu changed.

Regards,
Pavel

#2 lore raw
Quoted 30 lines · Pavel Belous
Quoted 27 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 +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;
 
Quoted 7 lines
Quoted 3 lines
drivers/net/ethernet/aquantia/atlantic/aq_main.c +0 -0
     if (netif_running(ndev)) {
         aq_ndev_close(ndev);

Thank you, David.

I think we should also remove closing/opening net-device after mtu changed.

Hi Pavel,

I'll go ahead and submit v2.

Thanks,

-Dave

Quoted 3 lines

Regards,
Pavel

#3 lore raw
Quoted 39 lines · David Arcari
Quoted 30 lines · Pavel Belous
Quoted 27 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 +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;
 
Quoted 7 lines
Quoted 3 lines
drivers/net/ethernet/aquantia/atlantic/aq_main.c +0 -0
     if (netif_running(ndev)) {
         aq_ndev_close(ndev);

Thank you, David.

I think we should also remove closing/opening net-device after mtu changed.

Quoted 7 lines

Hi Pavel,

I'll go ahead and submit v2.

Thanks,

-Dave

Hi Pavel,

Before I post v2, won't that mean that if the interface is up that the user will have to manually toggle it for the new mtu to take effect?

Is that the desired behavior?

Thanks,

-Dave

Quoted 5 lines
Quoted 4 lines

Regards,
Pavel

#4 lore raw
Quoted 50 lines · David Arcari
Quoted 39 lines · David Arcari
Quoted 30 lines · Pavel Belous
Quoted 27 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 +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;
 
Quoted 7 lines
Quoted 3 lines
drivers/net/ethernet/aquantia/atlantic/aq_main.c +0 -0
     if (netif_running(ndev)) {
         aq_ndev_close(ndev);

Thank you, David.

I think we should also remove closing/opening net-device after mtu changed.

Quoted 7 lines

Hi Pavel,

I'll go ahead and submit v2.

Thanks,

-Dave

Hi Pavel,

Quoted 15 lines

Before I post v2, won't that mean that if the interface is up that the user will have to manually toggle it for the new mtu to take effect?

Is that the desired behavior?

Thanks,

-Dave

Quoted 5 lines
Quoted 4 lines

Regards,
Pavel

No. The new mtu will take effect immediately.
Closing/opening is not needed at all.

Regards,
Pavel

maintainer Applied
#5 lore raw
In reply to David Arcari

From: David Arcari <[email protected]>
Date: Wed, 8 Mar 2017 16:33:21 -0500

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, thanks.

#6 lore raw
Quoted 10 lines · David Miller

From: David Arcari <[email protected]>
Date: Wed, 8 Mar 2017 16:33:21 -0500

Quoted 7 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.

Quoted 7 lines
Quoted 4 lines
Fixes 5513e16421cb ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu")

Applied, thanks.

Hi David,

I see that my patch:

"net: ethernet: aquantia: call set_irq_affinity_hint before free_irq"

has been applied to net, but I don't see that this patch has been applied.

Is there any chance that you replied to the wrong patch? Or am I missing something?

Thanks,

-Dave

maintainer
#7 lore raw

From: David Arcari <[email protected]>
Date: Mon, 13 Mar 2017 11:50:50 -0400

Quoted 19 lines · David Miller
Quoted 10 lines

From: David Arcari <[email protected]>
Date: Wed, 8 Mar 2017 16:33:21 -0500

Quoted 7 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.

Quoted 7 lines
Quoted 4 lines
Fixes 5513e16421cb ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu")

Applied, thanks.

Quoted 7 lines

Hi David,

I see that my patch:

"net: ethernet: aquantia: call set_irq_affinity_hint before free_irq"

has been applied to net, but I don't see that this patch has been applied.

It is marked as "changes requested" in patchwork, because you were asked to do the restart label removal in a separate patch.

#8 lore raw
Quoted 24 lines · David Miller

From: David Arcari <[email protected]>
Date: Mon, 13 Mar 2017 11:50:50 -0400

Quoted 21 lines · David Miller
Quoted 10 lines

From: David Arcari <[email protected]>
Date: Wed, 8 Mar 2017 16:33:21 -0500

Quoted 7 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.

Quoted 7 lines
Quoted 4 lines
Fixes 5513e16421cb ("net: ethernet: aquantia: Fixes for aq_ndev_change_mtu")

Applied, thanks.

Hi David,

Quoted 9 lines
Quoted 5 lines

I see that my patch:

"net: ethernet: aquantia: call set_irq_affinity_hint before free_irq"

has been applied to net, but I don't see that this patch has been applied.

It is marked as "changes requested" in patchwork, because you were asked to do the restart label removal in a separate patch.

Sorry, I was not clear. I was trying to ask if your "Applied, thanks" reply (above) was meant for this email thread. I believe it was meant for the set_irq_affinity_hint patch.

Thanks,

-DA

Reviewed-by on v1 1/1
#9 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")

Looks like an appropriate and necessary fix to me.

Signature · 2 lines
Jarod Wilson
[email protected]