Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp234738ybb; Fri, 3 Apr 2020 01:32:25 -0700 (PDT) X-Google-Smtp-Source: APiQypKlgkWypxwC3dPAxs+rR/ZqLdFQtsZ8dSaYvodYv1WzBQwzdS4arm+K0FSo6zt6QD+zVdaz X-Received: by 2002:a9d:4102:: with SMTP id o2mr5316409ote.98.1585902745456; Fri, 03 Apr 2020 01:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585902745; cv=none; d=google.com; s=arc-20160816; b=RK3eF/BtJoo9KW2kJ9fUn+3Orw2WRFGZLT1yFglMdGYYxIaJ+UZvEvQX7jq8CqmZxY 0YNoM6tjQwIorvVNfFIWuyBUqnBLQB9Ekem0/UqIgXArSHKUFkkZhiDxe+/kI5RjBmUJ u2/nbG76UJWU+H4r78qLFy2+cmUPorI4VknqgdpouS2QeaBuqTPN47fo0s7DcK5xmCUF YuMADtnRfJkRggUBicXFa/+oFjBEyNI14psx6q34svzsKviXPKJY0io6pFJ/l1oIuh1U +/7iFRlVwK92LRnqmibM/YyN6u/qmY1bMtHmILEff7kyK/bZRfQ1WP7/CqDdrHZZ7kYQ +Tkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from; bh=Z3AdacM8B73g0hBf7ZxmaEwCOx9L9aSbUKgXK1wZZcQ=; b=bycpGsNN5iZoeaCKVQognQWAIg/0v2p/amAGMggJtkdsWEQ5V/nKoT+FQQK4h7o96d N+HanAI38QDzwUfX6YZfZniDP++OquMBidDjjLxYm/JioseMiL23vEfHyQviG8C/A3bl V7ql0oUER/9q23zlrx/8hx23uSIyb7t4NDjUCiFHiv/55D4r+TchkDsmU1SZ3tAyPViS yR7nIp4shCiiqltSy9JeA4vyrdEiXR7BQrq1/TWqTH1KlJlam6b0IiJAE5tp524+i/AV SH5/ILbFBBKzef27Lh1urG1KALkm4Cvn87RVzRD9ktlBPinLwuVy4XQju2fU21gSHSjK V/tw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q12si3392505ooi.0.2020.04.03.01.32.14; Fri, 03 Apr 2020 01:32:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390432AbgDCIaH (ORCPT + 99 others); Fri, 3 Apr 2020 04:30:07 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:45444 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727835AbgDCIaH (ORCPT ); Fri, 3 Apr 2020 04:30:07 -0400 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jKHiH-0008yu-3P; Fri, 03 Apr 2020 11:30:05 +0300 From: Luca Coelho To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org Date: Fri, 3 Apr 2020 11:29:49 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200403082955.1126339-1-luca@coelho.fi> References: <20200403082955.1126339-1-luca@coelho.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on farmhouse.coelho.fi X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, TVD_RCVD_IP autolearn=ham autolearn_force=no version=3.4.4 Subject: [PATCH v5.7 2/8] iwlwifi: mvm: beacon statistics shouldn't go backwards Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Mordechay Goodstein We reset statistics also in case that we didn't reassoc so in this cases keep last beacon counter. Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho --- drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c index 5ee33c8ae9d2..77b8def26edb 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c @@ -8,7 +8,7 @@ * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH - * Copyright(c) 2018 - 2019 Intel Corporation + * Copyright(c) 2018 - 2020 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as @@ -31,7 +31,7 @@ * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH * Copyright(c) 2016 - 2017 Intel Deutschland GmbH - * Copyright(c) 2018 - 2019 Intel Corporation + * Copyright(c) 2018 - 2020 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -566,6 +566,7 @@ void iwl_mvm_rx_rx_mpdu(struct iwl_mvm *mvm, struct napi_struct *napi, struct iwl_mvm_stat_data { struct iwl_mvm *mvm; + __le32 flags; __le32 mac_id; u8 beacon_filter_average_energy; void *general; @@ -606,6 +607,13 @@ static void iwl_mvm_stat_iterator(void *_data, u8 *mac, -general->beacon_average_energy[vif_id]; } + /* make sure that beacon statistics don't go backwards with TCM + * request to clear statistics + */ + if (le32_to_cpu(data->flags) & IWL_STATISTICS_REPLY_FLG_CLEAR) + mvmvif->beacon_stats.accu_num_beacons += + mvmvif->beacon_stats.num_beacons; + if (mvmvif->id != id) return; @@ -763,6 +771,7 @@ void iwl_mvm_handle_rx_statistics(struct iwl_mvm *mvm, flags = stats->flag; } + data.flags = flags; iwl_mvm_rx_stats_check_trigger(mvm, pkt); -- 2.25.1