From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from xc.sipsolutions.net ([83.246.72.84]:35088 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753521AbYEDCWc (ORCPT ); Sat, 3 May 2008 22:22:32 -0400 Subject: Re: mac80211 truesize bugs From: Johannes Berg To: Herbert Xu Cc: David Miller , mb@bu3sch.de, netdev@vger.kernel.org, linux-wireless@vger.kernel.org In-Reply-To: <20080504021213.GA30660@gondor.apana.org.au> References: <1209760731.3608.17.camel@johannes.berg> <20080502.163334.148944203.davem@davemloft.net> <1209815533.3987.21.camel@johannes.berg> <20080503.180300.10562559.davem@davemloft.net> <1209865354.6210.23.camel@johannes.berg> <20080504020203.GA30514@gondor.apana.org.au> <1209866916.6210.39.camel@johannes.berg> <20080504021213.GA30660@gondor.apana.org.au> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-u6bwjd8rB/4JZQJZajxq" Date: Sun, 04 May 2008 04:22:20 +0200 Message-Id: <1209867740.6210.46.camel@johannes.berg> (sfid-20080504_042201_945225_2F4E0F44) Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: --=-u6bwjd8rB/4JZQJZajxq Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun, 2008-05-04 at 10:12 +0800, Herbert Xu wrote: > On Sun, May 04, 2008 at 04:08:36AM +0200, Johannes Berg wrote: > > > > So, what is mac80211 supposed to do? It needs up to 54 bytes of > > available headroom (for an encrypted mesh packet which currently can't > > really happen, but anyway) yet it cannot pskb_expand_head() either. > > Cloning each packet seems even more expensive, and just like skb_orphan > > subverts the purpose of the socket accounting. >=20 > If all/the majority of your packets need the space then put it in > LL_MAX_HEADER. =20 Yes, wireless always needs at least 24 bytes, but more likely 34 (encryption+QoS). However, I just increased LL_MAX_HEADER to 54 and that doesn't seem to have helped. > In any case, you should always expand the packet > if necessary in your output routine since LL_MAX_HEADER is just a > hint. Yes cloning is expensive compared to not having to do it, > but as long as this is only done for the exception then it's > irrelevant. What's wrong with, instead, doing skb_orphan() and then pskb_expand_head()? That seems to have the same effect. johannes --=-u6bwjd8rB/4JZQJZajxq Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Comment: Johannes Berg (powerbook) iQIVAwUASB0d26Vg1VMiehFYAQIPkQ/9EPHYRMvjda0ksMSfhj1qUzhQRrCSXYuC KVnOW2WKWP6WSK2mK9Vz+vLTvPlNsgQCqwM1kYZRZVmlcdfmTD14P/dVeZ1mBGPG Ij2udwlUTBEnTvIoytq5leMtmJ2uPxPj3dk4nwWCFpxtpHYR6xF/8hfkro3ijZCK 9L52w05u4kJVhSXGxebL0D/xu1nBBhHugy/jPAAEeGBWE45+Z6XB3HFHs42VOo9M Y23j2oCKNI6oB9tZ9lTXSZVlTDT6CXrt5JF17Z1h3ByLm2WhprDnG0z0blAQqOll +azgc26ZuQwQncuvmlxv+TqhgbJNqTb6QRHzrFdSBl2rNk3A9CI1QiO/Zmh5huVf hRb2HHhJtTfRw2XLD816POnSQf6ahnC1+uHMEcs35s5WF7PqctIQL3E9IDyc2aQx oYY9B3fd1GFfsjdu+gZagAmxAVCFvPtDkYIuaL83+jpcLq5oSBqWRHYDVHyoW4KO j7/+nop6aNed1x9f8wwnz36+gf4KWmoT4baYnq4kK+HsbzxY8QCdGG8xVRY40cNt lPGi462wdKjxrWN4uCNoQ4FmwOYpkXbA7PjfaqUtmVXa1ocdTBeo49RYWVZwaq6u R1jaWwIp6X0HpxVlgW437xRFNCPIdUtBP7p1vnR10l0QvlQy4bHCN7RIlfOx3w22 5VgOcRCxFCU= =NEsH -----END PGP SIGNATURE----- --=-u6bwjd8rB/4JZQJZajxq--