From patchwork Wed Aug 29 19:03:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10580759 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 730DB139B for ; Wed, 29 Aug 2018 19:03:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63A75285A3 for ; Wed, 29 Aug 2018 19:03:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57C3C2871E; Wed, 29 Aug 2018 19:03:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB222285A3 for ; Wed, 29 Aug 2018 19:03:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727692AbeH2XCE (ORCPT ); Wed, 29 Aug 2018 19:02:04 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:50436 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726633AbeH2XCE (ORCPT ); Wed, 29 Aug 2018 19:02:04 -0400 Received: by mail-wm0-f67.google.com with SMTP id s12-v6so6314939wmc.0 for ; Wed, 29 Aug 2018 12:03:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=g4Qev6OKiHrQB4ySntpbm0P0zi7czXq0uKngU9e3oDc=; b=R0IshmWFCs71Tlq32PfgEsEKNBHpkX1G1w/v43VjQb8kzifWqb60PILVXI6H2+ufbe qH2C9PiG8S9o6THVklrM1wAmoYblTmMTF7A2t49pCoDukSErijKx7ElS3BpWyfkPQL14 L5ZEbdZPVZsI3+zED5fBlgwsdP1rjIw59RBbCDU/CUe5toAJ1UvwFl3vJlWpFcE3YJhy V3VN2gUIwvP/2vWC8hX7gH9pMGgcy4OKboC22hD4dQ5jAIqAaZ2H00oZYTaSySy1jLaB 4HBExwyoD71i+tn1EcTA1jgEirxOGVeKZ6jpgGTGgrlxacqzs5xEdtma1XMaRzryoQ0J 9/EQ== X-Gm-Message-State: APzg51ABkoIRGnxSduk5yYLNU7qtStn4GSK5lbicK8HWlzI4hajaa6At eaPCRb6pITvM+i/KX6LTW25OhNMF1Ks= X-Google-Smtp-Source: ANB0Vdatw+1yVM+jqgUiZWFKYzwTLv0oUKrPB3oFJt3mzGVGzmy3EOvA+RPWpoVW6MFx8yMrwcc8Ow== X-Received: by 2002:a1c:d785:: with SMTP id o127-v6mr4972435wmg.67.1535569428267; Wed, 29 Aug 2018 12:03:48 -0700 (PDT) Received: from localhost.lan ([151.66.53.29]) by smtp.gmail.com with ESMTPSA id y5-v6sm6554566wrd.5.2018.08.29.12.03.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Aug 2018 12:03:47 -0700 (PDT) From: Lorenzo Bianconi To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, nbd@nbd.name, sara.sharon@intel.com Subject: [PATCH v2] mac80211: do not aggregate frames if max_frags is set to one Date: Wed, 29 Aug 2018 21:03:25 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Do not try to aggregate packets in a A-MSDU frame and add A-MSDU header on the first packet if max_tx_fragments or max_amsdu_subframes are set to one Signed-off-by: Lorenzo Bianconi --- Changes since v1: - rebased on top of mac80211 master branch - removed ieee80211_amsdu_realloc_pad chunk --- net/mac80211/tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 6a362b2882d3..75646e3fb3d9 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3213,9 +3213,6 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata, if (skb->len + head->len > max_amsdu_len) goto out; - if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head)) - goto out; - nfrags = 1 + skb_shinfo(skb)->nr_frags; nfrags += 1 + skb_shinfo(head)->nr_frags; frag_tail = &skb_shinfo(head)->frag_list; @@ -3231,6 +3228,9 @@ static bool ieee80211_amsdu_aggregate(struct ieee80211_sub_if_data *sdata, if (max_frags && nfrags > max_frags) goto out; + if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head)) + goto out; + /* * Pad out the previous subframe to a multiple of 4 by adding the * padding to the next one, that's being added. Note that head->len