From patchwork Tue Jul 24 03:52:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yeow Yeoh X-Patchwork-Id: 1230141 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 3A16FDFFCD for ; Tue, 24 Jul 2012 03:55:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755276Ab2GXDyk (ORCPT ); Mon, 23 Jul 2012 23:54:40 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:50863 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753538Ab2GXDyg (ORCPT ); Mon, 23 Jul 2012 23:54:36 -0400 Received: by pbbrp8 with SMTP id rp8so11971451pbb.19 for ; Mon, 23 Jul 2012 20:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=ZeeJMkACXUpHDDR+mJNfZ0HVNUOvkSBGeX35WQGT9mk=; b=JrUQFl36LhmkZnxkvr6PEV1i8Z/l7KDuV64JXaFX20KrFdJSJfZh6wdkLKa7rJw7j5 h8npiTBySDMvsmt+nGTeHKJBOddUZquTFpwcjF9ost1EgMKh3OUzd2+i1e5q7XGS7v6A 2xZLMM8FvoOWypsPE0Qop6xz0knJ6tXfsHNMbrzUaSmSITI4B2UYYC/DWvUnqKURgUjJ qoV/ghd4+S4w4JyEaY77D9qZu/p92zY9NFi6W8W7Znb4HMRHaJEUe+e6Azu5RdgmYOdT XUxdpkIONGxKVbu+veIb1kn+OlRIRJPRFfscawmI26fSqXLbW7UVo0LWLutFbEFKu1PW BROw== Received: by 10.68.130.163 with SMTP id of3mr41884522pbb.108.1343102075777; Mon, 23 Jul 2012 20:54:35 -0700 (PDT) Received: from localhost.localdomain ([58.26.233.146]) by mx.google.com with ESMTPS id nj4sm11269784pbc.5.2012.07.23.20.54.33 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Jul 2012 20:54:35 -0700 (PDT) From: Chun-Yeow Yeoh To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, devel@lists.open80211s.org, Chun-Yeow Yeoh Subject: [PATCH v4] mac80211: add extra checking for RC init upon receiving mesh beacon Date: Tue, 24 Jul 2012 11:52:35 +0800 Message-Id: <1343101955-16710-1-git-send-email-yeohchunyeow@gmail.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Rate control statistic is flushed whenever the mesh beacon is received. This may not optimizes the performance of rate control algorithm. This patch ensures that we return early from mesh_peer_init if the plink_state is ESTAB. Thus, avoid calling the rate_control_rate_init again for established mesh STA. Signed-off-by: Chun-Yeow Yeoh --- v2: simplify the logic checking (Thomas Pedersen) v3: updating the sta last rx activity (Thomas Pedersen) v4: avoid duplicate assignment (Thomas Pedersen) net/mac80211/mesh_plink.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 4256859..dfeb243 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c @@ -361,6 +361,11 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, spin_lock_bh(&sta->lock); sta->last_rx = jiffies; + if (sta->plink_state == NL80211_PLINK_ESTAB) { + spin_unlock_bh(&sta->lock); + return sta; + } + sta->sta.supp_rates[band] = rates; if (elems->ht_cap_elem && sdata->local->_oper_channel_type != NL80211_CHAN_NO_HT)