Re: Netlink MTU

From: Andi Kleen (ak@suse.de)
Date: Wed Jun 21 2000 - 06:43:41 EST


On Wed, Jun 21, 2000 at 01:30:51PM +0200, Guus Sliepen wrote:
> Hello,
>
> I was trying to remove the limit on the maximum MTU for the ethertap
> device (it uses the default ethernet routines which limit it to 1500). I
> have successfully altered the ethertap driver (patch attached), but
> there's a problem with the netlink routines. It appears that the maximum
> message size is limitted by some kind of malloc that appears in
> linux/net/netlink/af_netlink.c line 732:
>
> skb = sock_rmalloc(sk, NLMSG_GOODSIZE, 0, GFP_KERNEL);
>
> Where according to /usr/include/linux/netlink.h:
>
> #define NLMSG_GOODSIZE (PAGE_SIZE - ((sizeof(struct sk_buff)+0xF)&~0xF))
>
> I guess this malloc enlarges the size of the sk to the next page boundary
> but then again, I might be completely wrong. Nevertheless, this seems to
> limit the size of the packets that are sent to userspace to somewhere near
> PAGE_SIZE. I'd like to see that restriction removed, but I don't know if
> this is possible or perhaps dangerous?

First the define is outdated. It could be PAGE_SIZE-sizeof(atomic_t) now --
sk_buff header is stored separately now. The problem is that allocations
> PAGE_SIZE tend to be unreliable when the system runs longer and the
memory is fragmented. Upto 8K is probably safe, for bigger values it is up
to your testing (some people run with 32K nfs blocks, but that is probably
not a good idea).

You also may need to increase the socket buffer limits on the netlink socket
via /proc/sys/net/core/[rw]mem_max and SO_{SND,RCV}BUF

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:21 EST