From patchwork Tue Jul 24 01:15:54 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: 1229851 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 34DF33FD4F for ; Tue, 24 Jul 2012 01:18:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755341Ab2GXBSB (ORCPT ); Mon, 23 Jul 2012 21:18:01 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:41444 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755159Ab2GXBSA (ORCPT ); Mon, 23 Jul 2012 21:18:00 -0400 Received: by yenl2 with SMTP id l2so6152204yen.19 for ; Mon, 23 Jul 2012 18:17:59 -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=9H19nWM7ktvQj8Gx8sQybZt3bru6gL4ci22azC8xRwo=; b=k/LAQV761huqrufmkh3BfuhAga0lcAuMfRASk+com2YvrmTmya3wQwSHm1j+oXAElc IceQf6F1ijXWCbco0VM32VF1yEjxPjRZZbKzE4zDCTY19ZDxFRdGrgyWM5XK6bUM8vMM eVL0XZTJhSatI7VOgSGicFjAK23ldhUQThh4hheT5V7FgIixlyzR25JRT5Of7VquUVbc Ymqw4eK8yg2BfVC/oBHuFnenhEpDrXmyXpFzeHMEOhT7lMXxv8biq95DHlPgGjh3g6e/ Lx8AYSjYLdFOTUissaz+z0byySFTNFzfKc1HvTOLXGRC5dagRBZsQWCj4XulH1tXVQxa mkiw== Received: by 10.66.75.74 with SMTP id a10mr782167paw.46.1343092679324; Mon, 23 Jul 2012 18:17:59 -0700 (PDT) Received: from localhost.localdomain ([58.26.233.146]) by mx.google.com with ESMTPS id wk10sm6407226pbc.71.2012.07.23.18.17.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Jul 2012 18:17:58 -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 v3] mac80211: add extra checking for RC init upon receiving mesh beacon Date: Tue, 24 Jul 2012 09:15:54 +0800 Message-Id: <1343092554-17734-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) net/mac80211/mesh_plink.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 4256859..4f5740e 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c @@ -360,6 +360,12 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, } spin_lock_bh(&sta->lock); + if (sta->plink_state == NL80211_PLINK_ESTAB) { + sta->last_rx = jiffies; + spin_unlock_bh(&sta->lock); + return sta; + } + sta->last_rx = jiffies; sta->sta.supp_rates[band] = rates; if (elems->ht_cap_elem &&