From patchwork Thu Mar 17 13:41:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 8610991 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C188C9F3D1 for ; Thu, 17 Mar 2016 13:41:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EDE1D20304 for ; Thu, 17 Mar 2016 13:41:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 032EF201F5 for ; Thu, 17 Mar 2016 13:41:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933619AbcCQNls (ORCPT ); Thu, 17 Mar 2016 09:41:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:2314 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756430AbcCQNlq (ORCPT ); Thu, 17 Mar 2016 09:41:46 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 17 Mar 2016 06:41:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,350,1455004800"; d="scan'208";a="766078348" Received: from egrumbacbox.jer.intel.com ([10.12.127.95]) by orsmga003.jf.intel.com with ESMTP; 17 Mar 2016 06:41:44 -0700 From: Emmanuel Grumbach To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Emmanuel Grumbach Subject: [PATCH 3/5] mac80211: avoid useless memory write on each frame RX Date: Thu, 17 Mar 2016 15:41:37 +0200 Message-Id: <1458222099-30301-3-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458222099-30301-1-git-send-email-emmanuel.grumbach@intel.com> References: <1458222099-30301-1-git-send-email-emmanuel.grumbach@intel.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Johannes Berg In the likely case that probe_count is 0 and the flag is clear, don't write to the memory there. This will avoid cache bouncing when adding parallel RX support. Also use ifmgd consistently in the function, instead of using sdata->u.mgd as well. Signed-off-by: Johannes Berg Signed-off-by: Emmanuel Grumbach --- net/mac80211/mlme.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 8968a96..219e34d 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -122,16 +122,18 @@ void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata) { struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; - if (unlikely(!sdata->u.mgd.associated)) + if (unlikely(!ifmgd->associated)) return; - ifmgd->probe_send_count = 0; - sdata->u.mgd.flags &= ~IEEE80211_STA_BEACON_LOSS_REPORTED; + if (ifmgd->probe_send_count) + ifmgd->probe_send_count = 0; + if (ifmgd->flags & IEEE80211_STA_BEACON_LOSS_REPORTED) + ifmgd->flags &= ~IEEE80211_STA_BEACON_LOSS_REPORTED; if (ieee80211_hw_check(&sdata->local->hw, CONNECTION_MONITOR)) return; - mod_timer(&sdata->u.mgd.conn_mon_timer, + mod_timer(&ifmgd->conn_mon_timer, round_jiffies_up(jiffies + IEEE80211_CONNECTION_IDLE_TIME)); }