MTU Question
Subsystems (2)
I have a bridge that has gigabit interfaces. The machine in question has the fun job of being a Bridge, Firewall and SMB server. Both of the Gigabit interfaces are connected to workstations directly via Xover cable (well MDI-X to be exact). My question is, if I enable jumbo frames on the gigabit interfaces will that make any difference in overall transfer rate of the bridge? I was thinking it might because even though the NIC is enslaved, it IS the device that the workstations communicate to. But also it might not because when applications talk to the network they're using BR(n) at 1500bytes.. can a bridging guru shed some light on this for me?
-Thank you in advance
Chris
Quoted 13 lines
I have a bridge that has gigabit interfaces. The machine in question has the
fun job of being a Bridge, Firewall and SMB server. Both of the Gigabit interfaces are connected to workstations directly via Xover cable (well MDI-X to be exact). My question is, if I enable jumbo frames on the gigabit
interfaces will that make any difference in overall transfer rate of the bridge? I was thinking it might because even though the NIC is enslaved, it
IS the device that the workstations communicate to. But also it might not because when applications talk to the network they're using BR(n) at 1500bytes.. can a bridging guru shed some light on this for me?
Quoted 2 lines
-Thank you in advance
Chris
The bridge does not care about frame size at all. It should be able to handle large frames, provided:
* all interfaces in the bridge can handle the same big mtu, there is no way a bridge can fragment.
* also, the mtu of the bridge itself will always appear as 1500, but you could change that with ifconfig. Thought about having bridge mtu appear as min(ports mtu), but don't think that is in the current version.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Try the following (2.4) patch to allow bridge to be MTU aware.
net/bridge/br_device.c +17 -0
@@ -121,6 +121,22 @@return -1 ; } +static int br_change_mtu (struct net_device *dev,int new_mtu) +{ +struct net_bridge *br = dev->priv; +int max_mtu; + +read_lock_bh (&br->lock); + max_mtu =br_min_mtu (br); +read_unlock_bh (&br->lock); + +if (new_mtu <68 || new_mtu > max_mtu) +return -EINVAL ; + + dev->mtu = new_mtu; +return 0 ; +} +void br_dev_setup (struct net_device *dev) {memset (dev->dev_addr,0 ,ETH_ALEN );
@@ -134,4 +150,5 @@ dev->accept_fastpath = br_dev_accept_fastpath; dev->tx_queue_len =0 ; dev->set_mac_address =NULL ; + dev->change_mtu = br_change_mtu; }
net/bridge/br_if.c +19 -0
@@ -220,6 +220,24 @@return 0 ; } +int br_min_mtu (struct net_bridge *br) +{ +struct net_bridge_port *p; +int mtu; + + p = br->port_list; +if (!p) + mtu =1500 ; +else { + mtu = p->dev->mtu; +while ((p = p->next) !=NULL ) { +if (p->dev->mtu < mtu) + mtu = p->dev->mtu; + } + } +return mtu; +} +int br_add_if (struct net_bridge *br,struct net_device *dev) {struct net_bridge_port *p;
@@ -250,6 +268,7 @@br_fdb_insert (br, p, dev->dev_addr,1 );if ((br->dev.flags &IFF_UP ) && (dev->flags &IFF_UP ))br_stp_enable_port (p); + br->dev.mtu =br_min_mtu (dev->priv);write_unlock_bh (&br->lock);return 0 ;
net/bridge/br_private.h +1 -0
@@ -164,6 +164,7 @@ int num);extern void br_get_port_ifindices (struct net_bridge *br,int *ifindices); +extern int br_min_mtu (struct net_bridge *br);/* br_input.c */ extern void br_handle_frame (struct sk_buff *skb);