netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][net-next][v2] bridge: allow the maximum mtu to 64k
@ 2016-02-23  1:00 roy.qing.li
  2016-02-24 20:57 ` David Miller
  2016-02-24 21:44 ` Stephen Hemminger
  0 siblings, 2 replies; 5+ messages in thread
From: roy.qing.li @ 2016-02-23  1:00 UTC (permalink / raw)
  To: netdev

From: Li RongQing <roy.qing.li@gmail.com>

A linux bridge always adopts the smallest MTU of the enslaved devices.
When no device are enslaved, it defaults to a MTU of 1500 and refuses to
use a larger one. This is problematic when using bridges enslaving only
virtual NICs (vnetX) like it's common with KVM guests.

Steps to reproduce the problem

1) sudo ip link add br-test0 type bridge # create an empty bridge
2) sudo ip link set br-test0 mtu 9000 # attempt to set MTU > 1500
3) ip link show dev br-test0 # confirm MTU

Here, 2) returns "RTNETLINK answers: Invalid argument". One (cumbersome)
way around this is:

4) sudo modprobe dummy
5) sudo ip link set dummy0 mtu 9000 master br-test0

Then the bridge's MTU can be changed from anywhere to 9000.

This is especially annoying for the virtualization case because the
KVM's tap driver will by default adopt the bridge's MTU on startup
making it impossible (without the workaround) to use a large MTU on the
guest VMs.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1399064

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 net/bridge/br_if.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index c367b3e..a2ed99d 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -390,7 +390,9 @@ int br_del_bridge(struct net *net, const char *name)
 	return ret;
 }
 
-/* MTU of the bridge pseudo-device: ETH_DATA_LEN or the minimum of the ports */
+/* MTU of the bridge pseudo-device: the maximum IP packet size
+ * or the minimum of the ports
+ */
 int br_min_mtu(const struct net_bridge *br)
 {
 	const struct net_bridge_port *p;
@@ -399,7 +401,7 @@ int br_min_mtu(const struct net_bridge *br)
 	ASSERT_RTNL();
 
 	if (list_empty(&br->port_list))
-		mtu = ETH_DATA_LEN;
+		mtu = 64 * 1024;
 	else {
 		list_for_each_entry(p, &br->port_list, list) {
 			if (!mtu  || p->dev->mtu < mtu)
-- 
2.1.4

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

* Re: [PATCH][net-next][v2] bridge: allow the maximum mtu to 64k
  2016-02-23  1:00 [PATCH][net-next][v2] bridge: allow the maximum mtu to 64k roy.qing.li
@ 2016-02-24 20:57 ` David Miller
  2016-02-24 21:44 ` Stephen Hemminger
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2016-02-24 20:57 UTC (permalink / raw)
  To: roy.qing.li; +Cc: netdev

From: roy.qing.li@gmail.com
Date: Tue, 23 Feb 2016 09:00:56 +0800

> This is especially annoying for the virtualization case because the
> KVM's tap driver will by default adopt the bridge's MTU on startup
> making it impossible (without the workaround) to use a large MTU on the
> guest VMs.

So if the TAP device adopts the bridge's MTU, and then a device is
enslaved to the bridge that has a "smaller than 64k" MTU, what
propagates that MTU change back to the TAP device?

I really want to understand how this is supposed to work.

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

* Re: [PATCH][net-next][v2] bridge: allow the maximum mtu to 64k
  2016-02-23  1:00 [PATCH][net-next][v2] bridge: allow the maximum mtu to 64k roy.qing.li
  2016-02-24 20:57 ` David Miller
@ 2016-02-24 21:44 ` Stephen Hemminger
  2016-02-25  1:50   ` Li RongQing
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2016-02-24 21:44 UTC (permalink / raw)
  To: roy.qing.li; +Cc: netdev

On Tue, 23 Feb 2016 09:00:56 +0800
roy.qing.li@gmail.com wrote:

> This is especially annoying for the virtualization case because the
> KVM's tap driver will by default adopt the bridge's MTU on startup
> making it impossible (without the workaround) to use a large MTU on the
> guest VMs.
> 
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1399064

This use case looks like KVM misusing bridge MTU. I.e it should set TAP
MTU to what it wants then enslave it, not vice versa.

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

* Re: [PATCH][net-next][v2] bridge: allow the maximum mtu to 64k
  2016-02-24 21:44 ` Stephen Hemminger
@ 2016-02-25  1:50   ` Li RongQing
  2016-02-25 19:28     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Li RongQing @ 2016-02-25  1:50 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

On Thu, Feb 25, 2016 at 5:44 AM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
>> This is especially annoying for the virtualization case because the
>> KVM's tap driver will by default adopt the bridge's MTU on startup
>> making it impossible (without the workaround) to use a large MTU on the
>> guest VMs.
>>
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1399064
>
> This use case looks like KVM misusing bridge MTU. I.e it should set TAP
> MTU to what it wants then enslave it, not vice versa.

1. a use should be able to configure an empty bridge MTU to a higher
mtu than 1500

2. if first configure the tap MTU a higher value, other port is lower
value, the pmtu
will be used, it maybe lower performance.
the configuration process is written into libvirt, located in
virnetdevtap.c, of cause it can
be improved to fix this issue.
https://www.redhat.com/archives/libvir-list/2008-December/msg00083.html

-R

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

* Re: [PATCH][net-next][v2] bridge: allow the maximum mtu to 64k
  2016-02-25  1:50   ` Li RongQing
@ 2016-02-25 19:28     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2016-02-25 19:28 UTC (permalink / raw)
  To: roy.qing.li; +Cc: stephen, netdev

From: Li RongQing <roy.qing.li@gmail.com>
Date: Thu, 25 Feb 2016 09:50:41 +0800

> On Thu, Feb 25, 2016 at 5:44 AM, Stephen Hemminger
> <stephen@networkplumber.org> wrote:
>>> This is especially annoying for the virtualization case because the
>>> KVM's tap driver will by default adopt the bridge's MTU on startup
>>> making it impossible (without the workaround) to use a large MTU on the
>>> guest VMs.
>>>
>>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1399064
>>
>> This use case looks like KVM misusing bridge MTU. I.e it should set TAP
>> MTU to what it wants then enslave it, not vice versa.
> 
> 1. a use should be able to configure an empty bridge MTU to a higher
> mtu than 1500
> 
> 2. if first configure the tap MTU a higher value, other port is lower
> value, the pmtu
> will be used, it maybe lower performance.
> the configuration process is written into libvirt, located in
> virnetdevtap.c, of cause it can
> be improved to fix this issue.
> https://www.redhat.com/archives/libvir-list/2008-December/msg00083.html

You are saying that it is possible to achieve the behavior the user wants
with the mechanisms provided, which means this patch isn't necessary.

And if I added the patch it would be of limited value, since proper software
would have to cope with the behavior of older kernels anyways.

I'm not applying this, sorry.

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

end of thread, other threads:[~2016-02-25 19:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-23  1:00 [PATCH][net-next][v2] bridge: allow the maximum mtu to 64k roy.qing.li
2016-02-24 20:57 ` David Miller
2016-02-24 21:44 ` Stephen Hemminger
2016-02-25  1:50   ` Li RongQing
2016-02-25 19:28     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).