From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sipsolutions.net (s3.sipsolutions.net [5.9.151.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id A518D3B260 for ; Wed, 17 Aug 2016 15:49:11 -0400 (EDT) Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1ba6pp-0001SN-9O; Wed, 17 Aug 2016 21:49:09 +0200 Message-ID: <1471463348.5173.16.camel@sipsolutions.net> From: Johannes Berg To: Toke =?ISO-8859-1?Q?H=F8iland-J=F8rgensen?= , make-wifi-fast@lists.bufferbloat.net, linux-wireless@vger.kernel.org Cc: Felix Fietkau Date: Wed, 17 Aug 2016 21:49:08 +0200 In-Reply-To: <20160817144531.4285-1-toke@toke.dk> (sfid-20160817_164550_842827_E5D1AFAC) References: <20160817125800.19154-1-toke@toke.dk> <20160817144531.4285-1-toke@toke.dk> (sfid-20160817_164550_842827_E5D1AFAC) Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.4-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Make-wifi-fast] [PATCH v2] mac80211: Move crypto IV generation to after TXQ dequeue. X-BeenThere: make-wifi-fast@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2016 19:49:11 -0000 Hi, You need to work on coding style, a lot of your indentation is completely messed up. > + switch (sdata->vif.type) { > + case NL80211_IFTYPE_STATION: > + if (sdata->u.mgd.use_4addr) { > + pn_offs = 30; > + break; > + } > + pn_offs = 24; > + break; > + case NL80211_IFTYPE_AP_VLAN: > + if (sdata->wdev.use_4addr) { > + pn_offs = 30; > + break; > + } > + /* fall through */ > + case NL80211_IFTYPE_ADHOC: > + case NL80211_IFTYPE_AP: > + pn_offs = 24; > + break; > + default: > + return; > + } > + > + if (sta->sta.wme) { > + pn_offs += 2; > + } I think you just reinvented ieee80211_hdrlen(). No? > - if (fast_tx->pn_offs) { > - u64 pn; > - u8 *crypto_hdr = skb->data + fast_tx->pn_offs; No need to undo the pn_offs optimisation for the !txq case, you can pass it in to the new function that will fill it. However, you're still doing it wrong - now you haven't fixed anything for TKIP, which won't hit the fastpath. johannes