Return-path: Received: from mail-it0-f46.google.com ([209.85.214.46]:38811 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752924AbcJNJf5 (ORCPT ); Fri, 14 Oct 2016 05:35:57 -0400 Received: by mail-it0-f46.google.com with SMTP id o19so6298135ito.1 for ; Fri, 14 Oct 2016 02:35:57 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1476437149.31114.27.camel@sipsolutions.net> References: <20161010150358.GA514@swordfish> <20161010153050.GA836@swordfish> <1476263106.5271.23.camel@sipsolutions.net> <20161012141245.GA436@swordfish> <1476282127.5271.30.camel@sipsolutions.net> <1476338524.4904.1.camel@sipsolutions.net> <20161013134252.GA583@swordfish> <1476366354.4904.31.camel@sipsolutions.net> <1476429916.4382.12.camel@sipsolutions.net> <1476433699.31114.6.camel@sipsolutions.net> <1476434561.31114.7.camel@sipsolutions.net> <1476435303.31114.14.camel@sipsolutions.net> <1476436248.31114.21.camel@sipsolutions.net> <1476437149.31114.27.camel@sipsolutions.net> From: Ard Biesheuvel Date: Fri, 14 Oct 2016 10:35:56 +0100 Message-ID: (sfid-20161014_113622_059133_729CC929) Subject: Re: [mac80211] BUG_ON with current -git (4.8.0-11417-g24532f7) To: Johannes Berg Cc: Andy Lutomirski , Stephen Rothwell , "linux-next@vger.kernel.org" , Sergey Senozhatsky , Network Development , Sergey Senozhatsky , Herbert Xu , "David S. Miller" , Linux Wireless List , "linux-kernel@vger.kernel.org" , Jouni Malinen Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: On 14 October 2016 at 10:25, Johannes Berg wrote: > On Fri, 2016-10-14 at 10:21 +0100, Ard Biesheuvel wrote: > >> It is annotated with a TODO, though :-) >> >> 38320c70d282b (Herbert Xu 2008-01-28 19:35:05 >> -0800 41) >> * TODO: Use spare space in skb for this where possible. > > I saw that, but I don't think generally there will be spare space for > it - the stuff there is likely far too big. Anyway ... same problem > that we have. > > I'm not inclined to allocate ~500 bytes temporarily for every frame > either though. > > Maybe we could try to manage it in mac80211, we'd "only" need 5 AEAD > structs (which are today on the stack) in parallel for each key (4 TX, > 1 RX), but in a typical case of having 3 keys that's already 7.5K worth > of memory that we almost never use. Again, with more complexity, we > could know that the TX will not be used if the driver does the TX, but > the single RX one we'd need unconditionally... decisions decisions... > So why is the performance hit acceptable for ESP but not for WPA? We could easily implement the same thing, i.e., kmalloc(GFP_ATOMIC)/kfree the aead_req struct rather than allocate it on the stack