From patchwork Mon Jul 23 04:06:09 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: 1226301 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 9C7763FD4F for ; Mon, 23 Jul 2012 04:08:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750927Ab2GWEIA (ORCPT ); Mon, 23 Jul 2012 00:08:00 -0400 Received: from mail-gg0-f174.google.com ([209.85.161.174]:48501 "EHLO mail-gg0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872Ab2GWEH7 (ORCPT ); Mon, 23 Jul 2012 00:07:59 -0400 Received: by gglu4 with SMTP id u4so5062613ggl.19 for ; Sun, 22 Jul 2012 21:07: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=8LYm4+1d+CaM3XgZBQcZNgjQCRHB5VZ4zhHxJAYA/XU=; b=tFtlQWEkgDVL6G2NUhZepJlBIiE6/44LK3We8gghaWwIz/GF1YcLoAqMmGU1BbGhMK aqHzSidJ7xi7Bs3RWU5iFV9fWnWtkYV0mx2AARitBg7AKjT+qQk0Y1E7t28N9iDbqKeu REq9PPK/maAQC6hdbcVhIvf+LBuaAu4Kf2odhVxNHNT6lHNjTd57RT25ecIxmiu6fiN8 fh/MHfWNP+8uACjk8GlsiHuM6GjYApKSG6pMtdiFAyJHypyZWkeo5OFP9X/X5RKJeC1O BYRHT9eonZl8Cewtrzn/ScgWviO4RqOlkwCCAoKmxHQmvkY/UEiGDliu7ZPJBWg7SOYV KTOw== Received: by 10.66.83.69 with SMTP id o5mr27754936pay.34.1343016479071; Sun, 22 Jul 2012 21:07:59 -0700 (PDT) Received: from localhost.localdomain ([58.26.233.146]) by mx.google.com with ESMTPS id jv6sm9096483pbc.40.2012.07.22.21.07.56 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 Jul 2012 21:07: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 v2] mac80211: add extra checking for RC init upon receiving mesh beacon Date: Mon, 23 Jul 2012 12:06:09 +0800 Message-Id: <1343016370-31163-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) net/mac80211/mesh_plink.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 4256859..a73741c 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c @@ -359,6 +359,9 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata, insert = true; } + if (sta->plink_state == NL80211_PLINK_ESTAB) + return sta; + spin_lock_bh(&sta->lock); sta->last_rx = jiffies; sta->sta.supp_rates[band] = rates;