Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3927778imm; Mon, 8 Oct 2018 11:49:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV60SnSY98/rnAG54EwFFPvKNVYM6YoJXfFeKWa27f1/zFDngyM/KIJeTmPJ+lhsjyT0w2FL3 X-Received: by 2002:a17:902:8606:: with SMTP id f6-v6mr25116303plo.271.1539024594828; Mon, 08 Oct 2018 11:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024594; cv=none; d=google.com; s=arc-20160816; b=JrNgryzsKH+xi8M7J31iaU1wSn9cZDt0qb82YNDsoemCwvRSdDya7RgAB9FnhxhdCO +r8zs5JncWqA7EkO2QBJKB44NognCEFJJS783JmtZsIhVbL0OqWv50Q5k1+kqwD260d8 K/l+H5x7F5Es8KCEfN7pPXIg4ic4b0gq/+xPHvn2hi5FJaKMhVrF0X2GrnhW5yegMnlH ZFkNKq/KWhBkIoXbZvWtyGJJ2ooc2yOYKRHkEUGuX6zgNZMxtzPog7T5sr843Fq66Brq aRsDeMOcsn7x1ulC7Q3zoZx11NNKF1ulkfBME6SJcTYR1sJn5/Aj8DroE9Agg7h2VPfb kZNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7ttTtUIZlYMtvuJZT4yIT2F50xx1gUxiYqmsB81yJCE=; b=qdRiGxkTdlMrOFt+wBQHniSYH73G/15xWSeboAP6pWpXfpmxNM0TFzh2Kgqm7e8YWN skHRAGJcMNiRDVudOyuhvtmQZQqffrlQpc6HSciQH9VPsXvBX0HcdCm8OH2DbxO3q4lJ jv2a3iTJ5tD7/xpzA06zGKk+oo8BHmevXnjJcHtqJIJPrFC5jmMT0O1eBluHmWe9KfYX 8JLHdOR3KIh7o1ytV3CZeFi/F+fD/3o5Vt0sf4Eh6OafqqYhxZNHP8GzWHFwgoOIJISE uDMwM9zzT14oo97h9KfUXI91uh6jhsuFOf+sl19LTD61N8b/dAYemgIBFabd/r/tmCa8 Y+wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CUQJ477K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17-v6si15649324pgm.317.2018.10.08.11.49.39; Mon, 08 Oct 2018 11:49:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CUQJ477K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731652AbeJICB3 (ORCPT + 99 others); Mon, 8 Oct 2018 22:01:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:50490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727452AbeJICB1 (ORCPT ); Mon, 8 Oct 2018 22:01:27 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 90C822087D; Mon, 8 Oct 2018 18:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024501; bh=dEPVjobHczXf4DJOX0ZIyndwSCdhJb1jpffvPWaGYF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CUQJ477Kxrc3lJp0EECGsUBL482PJxA7G70cF3ZGqQlDMnncn+W69j6P314IoecP3 6DdNja79C4UEbyTebj0ZMf/WkjMoXav5pAUWe5KSTTqC+2GK0W6eAA3ffgYLwwgWCP /ZfEKBFOMXzWHvXrMXP5yVWIdL5HReiXEnoOx5D4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lorenzo Bianconi , Johannes Berg , Sasha Levin Subject: [PATCH 4.18 038/168] mac80211: do not convert to A-MSDU if frag/subframe limited Date: Mon, 8 Oct 2018 20:30:18 +0200 Message-Id: <20181008175621.496071660@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lorenzo Bianconi [ Upstream commit 1eb507903665442360a959136dfa3234c43db085 ] Do not start to aggregate packets in a A-MSDU frame (converting the first subframe to A-MSDU, adding the header) if max_tx_fragments or max_amsdu_subframes limits are already exceeded by it. In particular, this happens when drivers set the limit to 1 to avoid A-MSDUs at all. Signed-off-by: Lorenzo Bianconi [reword commit message to be more precise] Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/mac80211/tx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -3208,9 +3208,6 @@ static bool ieee80211_amsdu_aggregate(st 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; @@ -3226,6 +3223,9 @@ static bool ieee80211_amsdu_aggregate(st 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