From patchwork Tue Jan 8 18:10:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 1947041 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D27EDDF23A for ; Tue, 8 Jan 2013 18:10:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756888Ab3AHSK4 (ORCPT ); Tue, 8 Jan 2013 13:10:56 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:55079 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756834Ab3AHSK4 (ORCPT ); Tue, 8 Jan 2013 13:10:56 -0500 Received: from 64-126-113-177.dyn.everestkc.net ([64.126.113.177] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TsddX-000282-4g; Tue, 08 Jan 2013 18:10:55 +0000 From: Seth Forshee To: Johannes Berg Cc: linux-wireless@vger.kernel.org Subject: [RFC 3/3] mac80211: Disable off-channel powersave when software scans are suspended Date: Tue, 8 Jan 2013 12:10:45 -0600 Message-Id: <1357668645-5101-4-git-send-email-seth.forshee@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1357668645-5101-1-git-send-email-seth.forshee@canonical.com> References: <1357668645-5101-1-git-send-email-seth.forshee@canonical.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Leaving powersave enabled while the scan is suspended requires the use of PS-Poll to retrieve frames buffered at the AP. PS-Poll isn't a very efficient means of data transfer and may not even work with drivers not supporting powersave. These problems can largely be avoided by simply disabling off-channel powersave when the scan is suspended and enabling it again when returning to off-channel operation. The results of this change are fantastic. Previously when using iperf I would see greatly decreased throughput (often dropping to 0 bits/sec for several seconds) and very high packet loss during software scans. This patch completely eliminates the packet loss and reduces the loss in throughput to very reasonable levels. Signed-off-by: Seth Forshee --- net/mac80211/scan.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index a875f74..f982dda 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -699,11 +699,11 @@ static void ieee80211_scan_state_suspend(struct ieee80211_local *local, ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); /* - * Re-enable vifs and beaconing. Leave PS - * in off-channel state..will put that back - * on-channel at the end of scanning. + * Re-enable vifs and beaconing. Disable PS + * while the scan is suspended for more + * efficient frame rx than with PS-Poll. */ - ieee80211_offchannel_return(local, false); + ieee80211_offchannel_return(local, true); *next_delay = HZ / 5; /* afterwards, resume scan & go to next channel */ @@ -713,8 +713,8 @@ static void ieee80211_scan_state_suspend(struct ieee80211_local *local, static void ieee80211_scan_state_resume(struct ieee80211_local *local, unsigned long *next_delay) { - /* PS already is in off-channel mode */ - ieee80211_offchannel_stop_vifs(local, false); + /* Put PS back in off-channel mode */ + ieee80211_offchannel_stop_vifs(local, true); if (local->ops->flush) { drv_flush(local, false);