All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND net-next] bonding: don't permit slaves to change their mtu independently
@ 2014-01-25  4:55 Ding Tianhong
  2014-02-02  0:53 ` David Miller
  2014-02-07  3:41 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Ding Tianhong @ 2014-01-25  4:55 UTC (permalink / raw)
  To: Jay Vosburgh, Veaceslav Falico, Andy Gospodarek, David S. Miller, Netdev

I have come to a conclusion by testing all modes for mtu changing:

1). If the slaves support changing mtu and no need to restart the device,
    just like virtual nic, the master will not lost any packages for all
    mode.

2). If the slaves support changing mtu and need to restart the device,
    just like Intel 82599, the AB, 802.3, ALB and TLB mode may lost
    packages, but other modes could work well.

The reason is that when the slave's mtu has been changed, the slave's hw will
restart, if the slave is current active slave, the master may set the
slave to backup state and reselect a new slave, after the reselect processing,
the master could work again, but if in load-balance mode, the master could
select another active slave to send and recv packages.

So the best way to fix the problem is don't permit slave to change their
mtu independently.

Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Veaceslav Falico <vfalico@redhat.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/bonding/bond_main.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 2ca949f..e127031c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2808,20 +2808,12 @@ static int bond_slave_netdev_event(unsigned long event,
 		 * ... Or is it this?
 		 */
 		break;
-	case NETDEV_CHANGEMTU:
-		/*
-		 * TODO: Should slaves be allowed to
-		 * independently alter their MTU?  For
-		 * an active-backup bond, slaves need
-		 * not be the same type of device, so
-		 * MTUs may vary.  For other modes,
-		 * slaves arguably should have the
-		 * same MTUs. To do this, we'd need to
-		 * take over the slave's change_mtu
-		 * function for the duration of their
-		 * servitude.
+	case NETDEV_PRECHANGEMTU:
+		/* The master and slaves should have the
+		 * same mtu, so don't permit slaves to
+		 * change their mtu independently.
 		 */
-		break;
+		return NOTIFY_BAD;
 	case NETDEV_CHANGENAME:
 		/* we don't care if we don't have primary set */
 		if (!USES_PRIMARY(bond->params.mode) ||
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND net-next] bonding: don't permit slaves to change their mtu independently
  2014-01-25  4:55 [PATCH RESEND net-next] bonding: don't permit slaves to change their mtu independently Ding Tianhong
@ 2014-02-02  0:53 ` David Miller
  2014-02-07  4:19   ` Ding Tianhong
  2014-02-07  3:41 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2014-02-02  0:53 UTC (permalink / raw)
  To: dingtianhong; +Cc: fubar, vfalico, andy, netdev

From: Ding Tianhong <dingtianhong@huawei.com>
Date: Sat, 25 Jan 2014 12:55:09 +0800

> I have come to a conclusion by testing all modes for mtu changing:
> 
> 1). If the slaves support changing mtu and no need to restart the device,
>     just like virtual nic, the master will not lost any packages for all
>     mode.
> 
> 2). If the slaves support changing mtu and need to restart the device,
>     just like Intel 82599, the AB, 802.3, ALB and TLB mode may lost
>     packages, but other modes could work well.
> 
> The reason is that when the slave's mtu has been changed, the slave's hw will
> restart, if the slave is current active slave, the master may set the
> slave to backup state and reselect a new slave, after the reselect processing,
> the master could work again, but if in load-balance mode, the master could
> select another active slave to send and recv packages.
> 
> So the best way to fix the problem is don't permit slave to change their
> mtu independently.
> 
> Cc: Jay Vosburgh <fubar@us.ibm.com>
> Cc: Veaceslav Falico <vfalico@redhat.com>
> Cc: Andy Gospodarek <andy@greyhouse.net>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>

This has been rotting in patchwork for a week, and desperately needs
someone to review it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND net-next] bonding: don't permit slaves to change their mtu independently
  2014-01-25  4:55 [PATCH RESEND net-next] bonding: don't permit slaves to change their mtu independently Ding Tianhong
  2014-02-02  0:53 ` David Miller
@ 2014-02-07  3:41 ` David Miller
  2014-02-07  3:56   ` Ding Tianhong
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2014-02-07  3:41 UTC (permalink / raw)
  To: dingtianhong; +Cc: fubar, vfalico, andy, netdev

From: Ding Tianhong <dingtianhong@huawei.com>
Date: Sat, 25 Jan 2014 12:55:09 +0800

> I have come to a conclusion by testing all modes for mtu changing:
> 
> 1). If the slaves support changing mtu and no need to restart the device,
>     just like virtual nic, the master will not lost any packages for all
>     mode.
> 
> 2). If the slaves support changing mtu and need to restart the device,
>     just like Intel 82599, the AB, 802.3, ALB and TLB mode may lost
>     packages, but other modes could work well.
> 
> The reason is that when the slave's mtu has been changed, the slave's hw will
> restart, if the slave is current active slave, the master may set the
> slave to backup state and reselect a new slave, after the reselect processing,
> the master could work again, but if in load-balance mode, the master could
> select another active slave to send and recv packages.
> 
> So the best way to fix the problem is don't permit slave to change their
> mtu independently.
> 
> Cc: Jay Vosburgh <fubar@us.ibm.com>
> Cc: Veaceslav Falico <vfalico@redhat.com>
> Cc: Andy Gospodarek <andy@greyhouse.net>
> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>

Without any review, I'm not applying this patch, sorry.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND net-next] bonding: don't permit slaves to change their mtu independently
  2014-02-07  3:41 ` David Miller
@ 2014-02-07  3:56   ` Ding Tianhong
  0 siblings, 0 replies; 5+ messages in thread
From: Ding Tianhong @ 2014-02-07  3:56 UTC (permalink / raw)
  To: David Miller; +Cc: fubar, vfalico, andy, netdev

On 2014/2/7 11:41, David Miller wrote:
> From: Ding Tianhong <dingtianhong@huawei.com>
> Date: Sat, 25 Jan 2014 12:55:09 +0800
> 
>> I have come to a conclusion by testing all modes for mtu changing:
>>
>> 1). If the slaves support changing mtu and no need to restart the device,
>>     just like virtual nic, the master will not lost any packages for all
>>     mode.
>>
>> 2). If the slaves support changing mtu and need to restart the device,
>>     just like Intel 82599, the AB, 802.3, ALB and TLB mode may lost
>>     packages, but other modes could work well.
>>
>> The reason is that when the slave's mtu has been changed, the slave's hw will
>> restart, if the slave is current active slave, the master may set the
>> slave to backup state and reselect a new slave, after the reselect processing,
>> the master could work again, but if in load-balance mode, the master could
>> select another active slave to send and recv packages.
>>
>> So the best way to fix the problem is don't permit slave to change their
>> mtu independently.
>>
>> Cc: Jay Vosburgh <fubar@us.ibm.com>
>> Cc: Veaceslav Falico <vfalico@redhat.com>
>> Cc: Andy Gospodarek <andy@greyhouse.net>
>> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> 
> Without any review, I'm not applying this patch, sorry.
> 
> 
Ok, and I found some new issue for this patch, maybe need more discussion.

Regards
Ding

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH RESEND net-next] bonding: don't permit slaves to change their mtu independently
  2014-02-02  0:53 ` David Miller
@ 2014-02-07  4:19   ` Ding Tianhong
  0 siblings, 0 replies; 5+ messages in thread
From: Ding Tianhong @ 2014-02-07  4:19 UTC (permalink / raw)
  To: David Miller; +Cc: fubar, vfalico, andy, netdev

On 2014/2/2 8:53, David Miller wrote:
> From: Ding Tianhong <dingtianhong@huawei.com>
> Date: Sat, 25 Jan 2014 12:55:09 +0800
> 
>> I have come to a conclusion by testing all modes for mtu changing:
>>
>> 1). If the slaves support changing mtu and no need to restart the device,
>>     just like virtual nic, the master will not lost any packages for all
>>     mode.
>>
>> 2). If the slaves support changing mtu and need to restart the device,
>>     just like Intel 82599, the AB, 802.3, ALB and TLB mode may lost
>>     packages, but other modes could work well.
>>
>> The reason is that when the slave's mtu has been changed, the slave's hw will
>> restart, if the slave is current active slave, the master may set the
>> slave to backup state and reselect a new slave, after the reselect processing,
>> the master could work again, but if in load-balance mode, the master could
>> select another active slave to send and recv packages.
>>
>> So the best way to fix the problem is don't permit slave to change their
>> mtu independently.
>>
>> Cc: Jay Vosburgh <fubar@us.ibm.com>
>> Cc: Veaceslav Falico <vfalico@redhat.com>
>> Cc: Andy Gospodarek <andy@greyhouse.net>
>> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> 
> This has been rotting in patchwork for a week, and desperately needs
> someone to review it.
> 
> 
Self Naked, this patch did not consider the bond dev MTU changing, because
if I forbidden the slave to change mtu in any way, the bond will not change
its own mtu anymore, so I should think more about this situation. Sorry for the
noise.

Regards
Ding

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-02-07  4:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-25  4:55 [PATCH RESEND net-next] bonding: don't permit slaves to change their mtu independently Ding Tianhong
2014-02-02  0:53 ` David Miller
2014-02-07  4:19   ` Ding Tianhong
2014-02-07  3:41 ` David Miller
2014-02-07  3:56   ` Ding Tianhong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.