diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-10-16 04:27:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:08 -0400 |
commit | b53f35a8093e6aed7e8e880eaa0b89a3d2fdfb0a (patch) | |
tree | 50e19688753650e27b1f7fc1d48eb8683666e6b7 /arch/um/drivers/vde_user.c | |
parent | cd1ae0e49bdd814cfaa2e5ab28cff21a30e20085 (diff) |
uml: network driver MTU cleanups
A bunch of MTU-related cleanups in the network code.
First, there is the addition of the notion of a maximally-sized packet, which
is the MTU plus headers. This is used to size the skb that will receive a
packet. This allows ether_adjust_skb to go away, as it was used to resize the
skb after it was allocated.
Since the skb passed into the low-level read routine is no longer resized, and
possibly reallocated, there, they (and the write routines) don't need to get
an sk_buff **. They just need the sk_buff * now. The callers of
ether_adjust_skb still need to do the skb_put, so that's now inlined.
The MAX_PACKET definitions in most of the drivers are gone.
The set_mtu methods were all the same and did nothing, so they can be
removed.
The ethertap driver had a typo which doubled the size of the packet rather
than adding two bytes to it. It also wasn't defining its setup_size, causing
a zero-byte kmalloc and crash when the invalid pointer returned from kmalloc
was dereferenced.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/drivers/vde_user.c')
-rw-r--r-- | arch/um/drivers/vde_user.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/arch/um/drivers/vde_user.c b/arch/um/drivers/vde_user.c index 7533cd3cbba4..d9941fe5f931 100644 --- a/arch/um/drivers/vde_user.c +++ b/arch/um/drivers/vde_user.c | |||
@@ -12,8 +12,6 @@ | |||
12 | #include "user.h" | 12 | #include "user.h" |
13 | #include "vde.h" | 13 | #include "vde.h" |
14 | 14 | ||
15 | #define MAX_PACKET (ETH_MAX_PACKET + ETH_HEADER_OTHER) | ||
16 | |||
17 | static int vde_user_init(void *data, void *dev) | 15 | static int vde_user_init(void *data, void *dev) |
18 | { | 16 | { |
19 | struct vde_data *pri = data; | 17 | struct vde_data *pri = data; |
@@ -65,20 +63,15 @@ static void vde_remove(void *data) | |||
65 | printk(UM_KERN_WARNING "vde_remove - we have no VDECONN to remove"); | 63 | printk(UM_KERN_WARNING "vde_remove - we have no VDECONN to remove"); |
66 | } | 64 | } |
67 | 65 | ||
68 | static int vde_set_mtu(int mtu, void *data) | ||
69 | { | ||
70 | return mtu; | ||
71 | } | ||
72 | |||
73 | const struct net_user_info vde_user_info = { | 66 | const struct net_user_info vde_user_info = { |
74 | .init = vde_user_init, | 67 | .init = vde_user_init, |
75 | .open = vde_user_open, | 68 | .open = vde_user_open, |
76 | .close = NULL, | 69 | .close = NULL, |
77 | .remove = vde_remove, | 70 | .remove = vde_remove, |
78 | .set_mtu = vde_set_mtu, | ||
79 | .add_address = NULL, | 71 | .add_address = NULL, |
80 | .delete_address = NULL, | 72 | .delete_address = NULL, |
81 | .max_packet = MAX_PACKET - ETH_HEADER_OTHER | 73 | .mtu = ETH_MAX_PACKET, |
74 | .max_packet = ETH_MAX_PACKET + ETH_HEADER_OTHER, | ||
82 | }; | 75 | }; |
83 | 76 | ||
84 | void vde_init_libstuff(struct vde_data *vpri, struct vde_init *init) | 77 | void vde_init_libstuff(struct vde_data *vpri, struct vde_init *init) |