From patchwork Thu May 11 17:49:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 99665 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp851475qge; Thu, 11 May 2017 10:49:49 -0700 (PDT) X-Received: by 10.99.119.137 with SMTP id s131mr14042pgc.116.1494524989654; Thu, 11 May 2017 10:49:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494524989; cv=none; d=google.com; s=arc-20160816; b=ERs7HMC8/Wi1TToB3OTCSG4oJ1bydEs+h9cxybunRTa8bL/6QHaQ0N9EQa12gRQdLn D5tUIbZSu3IybqeFlNGfE5XgfMiUXI8eX8lQzrWXjt56sQUzmwKYm5R/BIxSdNCmJMmc nOcXb1+ouH+gOx3ry/s0oAXqPhN5e8XK3ZAb7Nt7lOqCdtPF5S6hl07IFCtjbp2x6s/p pJfI+OfYADPXZdk/0NBSeMIlcpvQMW14VRrW+K9Eu2WfOzH8QvaQUl/+j3eP/gkNvmjq MpDS86osUJhvY4k7Ps0YNxfUhOguP43aovLzb3HTKQRPYNBkL8Pme6aoFhfDfB6AdQzY AvSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=G6f173Y/V3F50yJIa0F/jz8mCiuyRxdCvrDy/Nqk2U8=; b=F7271ckQKOeF/pD0cfIaW8lfn5Rwvb5RzhOZIYl/LVmb2FPyaxR/0SuO7RlE5wdbJi PljlDK5yjb2Aph4cWVuC82Ilqm6D+114HGizoYMqxe9+8mGs9qFEKj3vgM/9+70drm6i gu+7vfvUWOL9Vv9tyuMAUqY/ukndufND0KBFQEGvHLI+4XATAkJgs0QLWFq4fpVl7fn0 jatTaoc2lGAHk6tvd6CRiFaLzhpBJ04WTITlJnByIoJ7zvya3+JrI6Yifz3ZbsWCAh+e aXy2kIVNIIFCE5nmAhny0RqfqiZqoD2dW/qLmL+QkGV8MwXJN6DMZQDrTws0/XnhV0pn xL3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g1si712796pgc.15.2017.05.11.10.49.49; Thu, 11 May 2017 10:49:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933172AbdEKRts (ORCPT + 6 others); Thu, 11 May 2017 13:49:48 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:36601 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933087AbdEKRts (ORCPT ); Thu, 11 May 2017 13:49:48 -0400 Received: by mail-pg0-f48.google.com with SMTP id 64so18067204pgb.3 for ; Thu, 11 May 2017 10:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=G6f173Y/V3F50yJIa0F/jz8mCiuyRxdCvrDy/Nqk2U8=; b=RF7VvNa4yBUDGTqhU/9KlfXT9mjVlugA6Mp84iChw5/g/87er6cFyQVQkwd29eOV9B XdTZgPveQ/L/FECDgUehXGc1Km0dYM0iatsf7EaY+A/kseGmLyB82Bv20Utc5hZjAIwn nH56uUmuLxBNXn676EZny0brc+E1niRlWStbc= 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=G6f173Y/V3F50yJIa0F/jz8mCiuyRxdCvrDy/Nqk2U8=; b=L3jZkbJy+vUktUCR+xnK9mHf7sRAuXbU4KbMIR951h7oLDzr00AniVXpol8YAGVRmd 2iC7K/kDr14oyE1Nfe9kxA7RSb3g0r46nh9F+di4QS7T32BpXqIfjHYh0LE9PWsEAxcB Vm8TJmRUbYAZ+JlxmbyCWtkpg/P0hl3T+woTjeR/zcxDgLD2gzgjuXLCKq8F4ki2s3ZB eoTzIWWdWSYX+dIQFtK6rc2joU499ZG7mL2/alCO1B7sATwTFPBEsiHUrRPlE9CQ9Zmo 0IfIIUdE2pe9dTjU+DsZMRg/E3mPNVfUsVRXeMhxr75Pkth5ypseSjp1gTLw5O6seD/3 RgeQ== X-Gm-Message-State: AODbwcCGTY+Cr3i1xTFAhV+OjYMh9CAb/Br68q/nQSsKr5izEQLYEMS+ c+Nc/p4w4IC0WiuaKgD44A== X-Received: by 10.84.236.70 with SMTP id h6mr369069pln.145.1494524987415; Thu, 11 May 2017 10:49:47 -0700 (PDT) Received: from localhost.localdomain ([106.51.135.126]) by smtp.gmail.com with ESMTPSA id b72sm1200986pfd.118.2017.05.11.10.49.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 May 2017 10:49:46 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Maxim Altshul , Sara Sharon , Johannes Berg Subject: [PATCH for-4.4 3/5] mac80211: RX BA support for sta max_rx_aggregation_subframes Date: Thu, 11 May 2017 23:19:33 +0530 Message-Id: <1494524975-2352-4-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1494524975-2352-1-git-send-email-amit.pundir@linaro.org> References: <1494524975-2352-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Maxim Altshul commit 480dd46b9d6812e5fb7172c305ee0f1154c26eed upstream. The ability to change the max_rx_aggregation frames is useful in cases of IOP. There exist some devices (latest mobile phones and some AP's) that tend to not respect a BA sessions maximum size (in Kbps). These devices won't respect the AMPDU size that was negotiated during association (even though they do respect the maximal number of packets). This violation is characterized by a valid number of packets in a single AMPDU. Even so, the total size will exceed the size negotiated during association. Eventually, this will cause some undefined behavior, which in turn causes the hw to drop packets, causing the throughput to plummet. This patch will make the subframe limitation to be held by each station, instead of being held only by hw. Signed-off-by: Maxim Altshul Signed-off-by: Johannes Berg Signed-off-by: Amit Pundir --- include/net/mac80211.h | 4 ++++ net/mac80211/agg-rx.c | 7 +++++-- net/mac80211/sta_info.c | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/include/net/mac80211.h b/include/net/mac80211.h index ebd73169d53b..4e51f9a5a177 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1662,6 +1662,9 @@ struct ieee80211_sta_rates { * @supp_rates: Bitmap of supported rates (per band) * @ht_cap: HT capabilities of this STA; restricted to our own capabilities * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities + * @max_rx_aggregation_subframes: maximal amount of frames in a single AMPDU + * that this station is allowed to transmit to us. + * Can be modified by driver. * @wme: indicates whether the STA supports QoS/WME (if local devices does, * otherwise always false) * @drv_priv: data area for driver use, will always be aligned to @@ -1688,6 +1691,7 @@ struct ieee80211_sta { u16 aid; struct ieee80211_sta_ht_cap ht_cap; struct ieee80211_sta_vht_cap vht_cap; + u8 max_rx_aggregation_subframes; bool wme; u8 uapsd_queues; u8 max_sp; diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c index f598ff80b30e..a830356b94ac 100644 --- a/net/mac80211/agg-rx.c +++ b/net/mac80211/agg-rx.c @@ -290,10 +290,13 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta, buf_size = IEEE80211_MAX_AMPDU_BUF; /* make sure the size doesn't exceed the maximum supported by the hw */ - if (buf_size > local->hw.max_rx_aggregation_subframes) - buf_size = local->hw.max_rx_aggregation_subframes; + if (buf_size > sta->sta.max_rx_aggregation_subframes) + buf_size = sta->sta.max_rx_aggregation_subframes; params.buf_size = buf_size; + ht_dbg(sta->sdata, "AddBA Req buf_size=%d for %pM\n", + buf_size, sta->sta.addr); + /* examine state machine */ mutex_lock(&sta->ampdu_mlme.mtx); diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 67066d048e6f..63ea6cbac5ad 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -329,6 +329,9 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, memcpy(sta->addr, addr, ETH_ALEN); memcpy(sta->sta.addr, addr, ETH_ALEN); + sta->sta.max_rx_aggregation_subframes = + local->hw.max_rx_aggregation_subframes; + sta->local = local; sta->sdata = sdata; sta->rx_stats.last_rx = jiffies;