lkml.org 
[lkml]   [1996]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: 2.0 ethX bogus packet size messages ...
Date
- From Alex Pikus (gen_mail@webexpress.net)
Thu, 13 Jun 1996 11:02:27 -0500

> I have 2 pcs running 2.0 connected via NE2000 to SMC WD8* cards ...
>
> Both ethX are set to MTU 2000 ...
^^^^^^^^
Hello, McFly? Ethernet by design specifies the max packet size as 1518
bytes. Broken ring and FDDI can handle larger packets, wheras arcnet
can only do about 0.5k per packet and has to resort to trickery like
that described in the relevant RFCs.

The SIOCSIFMTU ioctl only checks that your value is > 67. I suppose
it should ensure that you have given it a sane value. [Patch follows]

> All goes well until i run rlogin and then pico ...

All is well until a packet > 1518 gets queued up for transmission.

[[ Note that as an undocumented feature, most 8390 clone NICs can
actually Tx and Rx giant packets up to 4k in size! Don't try this
on anything other than a "home-net" or somebody is likely to come
after you with an axe and blood in their eyes. Besides, it doesn't
gain you much -- see the Boggs paper on measured capaicty of ethernet
for a good read of packet size vs # of hosts vs network loading. ]]

Alan, I think the following patch (to use your dev->change_mtu) to keep
ether users honest, is probably a good idea.

Paul.


--- linux-foo/drivers/net/net_init.c Mon Mar 25 17:58:21 1996
+++ linux/drivers/net/net_init.c Fri Jun 14 16:56:19 1996
@@ -20,6 +20,8 @@
Use dev_close cleanly so we always shut things down tidily.

Changed 29/10/95, Alan Cox to pass sockaddr's around for mac addresses.
+
+ 14/06/96 - Paul Gortmaker: Add generic eth_change_mtu() function.
*/

#include <linux/config.h>
@@ -144,6 +146,14 @@
return 0;
}

+static int eth_change_mtu(struct device *dev, int new_mtu)
+{
+ if ((new_mtu < 68) || (new_mtu > 1500))
+ return -EINVAL;
+ dev->mtu = new_mtu;
+ return 0;
+}
+
void ether_setup(struct device *dev)
{
int i;
@@ -165,6 +175,7 @@
}
}

+ dev->change_mtu = eth_change_mtu;
dev->hard_header = eth_header;
dev->rebuild_header = eth_rebuild_header;
dev->set_mac_address = eth_mac_addr;


\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.051 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site