Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp90578ybj; Mon, 4 May 2020 16:43:05 -0700 (PDT) X-Google-Smtp-Source: APiQypIHx84rqtrQDdy1yCRYiHKS5r2D2WlKnLgE+GC2vPpmqoxAFXiesDk6NH4FbWmsk6/yaT5J X-Received: by 2002:a05:6402:1052:: with SMTP id e18mr437374edu.63.1588635785325; Mon, 04 May 2020 16:43:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588635785; cv=none; d=google.com; s=arc-20160816; b=vgp8j8hRcroJxMB2Va4Z9mVS79RyL2NRlqWwqmTNQvZsn5s7agDLD/ruCkbOheCly8 3I/RtgDp/LEiHU6jMt2XgmgN+3Lsx/THTxodkyUYGE/Z/+PwCXE35L+Tgi1Ovv0QCaxy 0Qfx4LpbVPftdyebVTb8oQClNFwrsVJK8ybIl/0d6DkSdPqJA8Azbs14snxEMGPg1CeE li7RpioRtQMDpH+oG4ub08xz8RFqRJM51o1U9z4PtR7a6wPD3GGzIZ3zQuCMg4ogj1Iy 6DQ8msz07hXF4DCv8+KU9EXsG0zgxf8/Hauyoy9/OwqFGKf3C7MObuSEnll0bwXWISKK 6R4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=lOZ4tyU3hhbnZJSh2lBCxUEl4+xkzrxlUN3eXX+6mN8=; b=Aw8Xa1dJp4HtGa+8m3qfC/lioSOEt0ww8m6ESLFOe4JqFXIOJ1Q4RbHaCnSjLQ1LvH lA3NWUVI2DPlu9IZF+mp+E/6pMoU7Yy6JmZpAYwwWwpIo3bAyTq/Jl4L46ukCZUklNQR 2OgxldgqcIDBEUkI0fZI02CoDXScnnkilrHokvfwyLnf213TpM04JWTI9AYytINStFva Ofk+Ps6hmk0jmBWSZ9vNgOatV4qU1QL2DB+0kLbSeYc1ehXbqBFquaZ2wjJasee3bB7E +M2eCO5HToJgCzIVL3Jrunv+8tFhGcbyO9CDqKjiMb7thvb3fsfGiAHPq8Vb3aKLye0U VS0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=ZuiOEIBs; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qn4si58655ejb.209.2020.05.04.16.42.27; Mon, 04 May 2020 16:43:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=ZuiOEIBs; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728476AbgEDXiP (ORCPT + 99 others); Mon, 4 May 2020 19:38:15 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:18747 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728475AbgEDXiO (ORCPT ); Mon, 4 May 2020 19:38:14 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1588635493; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=lOZ4tyU3hhbnZJSh2lBCxUEl4+xkzrxlUN3eXX+6mN8=; b=ZuiOEIBsnh/4pdsy2UUCYWi4PVJVNLRt1HaHc2CGe2Rt4mlfxyX+YuJAT7DK/DefMIedgWen LBjLBmrsL0FQBAvOMhlKij5GZKAVy4GwXvXyYtYqfrrskHrsDqXpKVk6mfuBjMwQhPbSRlmJ Ic6ejUNaEvGh7iNtw6F5dJnUvfo= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5eb0a747.7ffa973a50a0-smtp-out-n04; Mon, 04 May 2020 23:37:43 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 6CFCAC4478F; Mon, 4 May 2020 23:37:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: rmanohar) by smtp.codeaurora.org (Postfix) with ESMTPSA id 91D9EC433BA; Mon, 4 May 2020 23:37:41 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 04 May 2020 16:37:41 -0700 From: Rajkumar Manoharan To: Markus Theil Cc: linux-wireless@vger.kernel.org, kvalo@codeaurora.org, ath10k@lists.infradead.org, ath11k@lists.infradead.org, linux-wireless-owner@vger.kernel.org Subject: Re: [PATCH 2/2] ath11k: use cumulative survey statistics In-Reply-To: <20200504154122.91862-2-markus.theil@tu-ilmenau.de> References: <20200504154122.91862-1-markus.theil@tu-ilmenau.de> <20200504154122.91862-2-markus.theil@tu-ilmenau.de> Message-ID: <85fa2d5f9183b3a12c5283b800f3750f@codeaurora.org> X-Sender: rmanohar@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2020-05-04 08:41, Markus Theil wrote: > ath11k currently reports survey results for the last interval between > each > invocation of NL80211_CMD_GET_SURVEY. For concurrent invocations, this > can lead to unexpectedly small results, e.g. when hostapd uses survey > data and iw survey dump is invoked in parallel. Fix this by returning > cumulative results, that don't depend on the last invocation. Other > drivers, e.g. ath9k or mt76 also use this behavior. > > Signed-off-by: Markus Theil > --- > drivers/net/wireless/ath/ath11k/wmi.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/wireless/ath/ath11k/wmi.c > b/drivers/net/wireless/ath/ath11k/wmi.c > index c2a972377687..322ddfda5bfd 100644 > --- a/drivers/net/wireless/ath/ath11k/wmi.c > +++ b/drivers/net/wireless/ath/ath11k/wmi.c > @@ -5610,16 +5610,16 @@ ath11k_pdev_bss_chan_info_event(struct > ath11k_base *ab, struct sk_buff *skb) > > survey = &ar->survey[idx]; > > - survey->noise = bss_ch_info_ev.noise_floor; > - survey->time = div_u64(total, cc_freq_hz); > - survey->time_busy = div_u64(busy, cc_freq_hz); > - survey->time_rx = div_u64(rx_bss, cc_freq_hz); > - survey->time_tx = div_u64(tx, cc_freq_hz); > - survey->filled |= (SURVEY_INFO_NOISE_DBM | > - SURVEY_INFO_TIME | > - SURVEY_INFO_TIME_BUSY | > - SURVEY_INFO_TIME_RX | > - SURVEY_INFO_TIME_TX); > + survey->noise = bss_ch_info_ev.noise_floor; > + survey->time += div_u64(total, cc_freq_hz); > + survey->time_busy += div_u64(busy, cc_freq_hz); > + survey->time_rx += div_u64(rx_bss, cc_freq_hz); > + survey->time_tx += div_u64(tx, cc_freq_hz); > + survey->filled |= (SURVEY_INFO_NOISE_DBM | > + SURVEY_INFO_TIME | > + SURVEY_INFO_TIME_BUSY | > + SURVEY_INFO_TIME_RX | > + SURVEY_INFO_TIME_TX); Markus, It depends on type of survey request is given to firmware. In ath11k, firmware reports accumulated values. So the above addition is wrong and report double value. Have you tested this change? -Rajkumar