Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1000230ybj; Tue, 5 May 2020 11:10:01 -0700 (PDT) X-Google-Smtp-Source: APiQypJM9W8e8wMs0WxQeu8dfLe+lDmUWvEcwuGKjTCUEVA6b6Eu32JwzKopqJfKspeMZLX5BwVS X-Received: by 2002:a17:906:6b1b:: with SMTP id q27mr3882222ejr.158.1588702201385; Tue, 05 May 2020 11:10:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588702201; cv=none; d=google.com; s=arc-20160816; b=dbx6lNtFP9j89RG0BdjXcOlLcyuIWYFplWT/Sylnh9XlADflV9e3vaAhFT05NpO6bp UeXWxDssRC6ku+LGOfiThMcf9b9YDM2tEW815pJOZZz10DUG3Qpi2q8eZiFICJHeMGQ7 yg+hJFKQn8fsZtzAYL2T6uv/t8gptL6dkDa/OQBKGSQiDmuYJNVQBwk6J9/dUxFNpe1i sSv7Bv4bUPlrHMNeY1tp7rZR6wXAFPfyTP+jK+1koqAnvK0uKvSLn33JUoSPBl445mGC r9l1vCl5lxBJ7pc8y7flrSzGq9ttIJzEJDHA0MA28+I47BVu8YZNQaTSR4nbYHlvg0jn Iukg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=e+cNv4pp0MnD6PBcCuO7QvvHJHPqO4LqyJPULd9ZkI8=; b=n5O/oCLxghT/fbuz2HCvUKjIpXllRZebmUDyKpRjUteAwOHjLrEaNgArxIq4IqJ4dh FuZR/56/OIgpK7PQ5ekzcl10kyhQuWMWZQJeBLhORwjnZYzDvS2jNmgsA0Tz7SEoRWJ+ mKLGk8DCE74XETZ1TgRpoqq+ADZICj8/n9C8sFS6L2Gq/WC+kKBeTIXPTZlgU7X5fAW6 HeZHawktDWOD1BZf/FLGWdNFtzOJg0WsSHcR/HX0pE8xF5v89mRxsncK0NcD3vlReVK4 hTZuovPfTu0IEyBZebXLsIW5a8qi67ZW94Seqv2NJsDJF/relBcO65iPuDfMZ3NyPgKz 0LbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=dHUBkdW7; 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 w13si1571483ejj.231.2020.05.05.11.09.32; Tue, 05 May 2020 11:10:01 -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=dHUBkdW7; 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 S1730475AbgEESJ3 (ORCPT + 99 others); Tue, 5 May 2020 14:09:29 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:57266 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729315AbgEESJ3 (ORCPT ); Tue, 5 May 2020 14:09:29 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1588702168; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=e+cNv4pp0MnD6PBcCuO7QvvHJHPqO4LqyJPULd9ZkI8=; b=dHUBkdW7rgBQFWK7VRNszL9UJOAKuiwqhxS3HunsfEzfncPevM3Aw8a0y86GDz6iGqF4GfZ/ 92xBShVgFS/eJqwU2amHl+FvkZOYw3Ev7+3n8DsHjCG4xR0Xu0UG4lhxBsHYVBjvIYObVf/k 5hl3cmdIxA/+hMFfClHMkbkHv7w= 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 5eb1abc9.7fea82f08928-smtp-out-n01; Tue, 05 May 2020 18:09:13 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 5EF66C433CB; Tue, 5 May 2020 18:09:13 +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,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from c-gsamin-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: seevalam) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4E1F2C433F2; Tue, 5 May 2020 18:09:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4E1F2C433F2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=seevalam@codeaurora.org From: Seevalamuthu Mariappan To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Seevalamuthu Mariappan Subject: [PATCH] mac80211: Fix station dump inactive time after sta connection Date: Tue, 5 May 2020 23:38:46 +0530 Message-Id: <1588702126-11364-1-git-send-email-seevalam@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When USES_RSS is enabled, last_rx becomes zero in first few minutes after sta connection in sta_get_last_rx_stats. This leads to inactive time showing current jiffies in msecs. Station 8c:fd:f0:02:10:dd (on wlan0) inactive time: 4294701656 ms . . connected time: 2 seconds Fix this by avoid overwriting last_rx with percpu_stat's last_rx if it is zero. Signed-off-by: Seevalamuthu Mariappan --- net/mac80211/sta_info.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index f8d5c25..df40c0a 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -2089,6 +2089,9 @@ u8 sta_info_tx_streams(struct sta_info *sta) cpustats = per_cpu_ptr(sta->pcpu_rx_stats, cpu); + if (!cpustats->last_rx) + continue; + if (time_after(cpustats->last_rx, stats->last_rx)) stats = cpustats; } -- 1.9.1