From: Salah Ahmed <haddad2inc@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>,
linux-wireless@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] wifi: mac80211: count the tpt LED trigger from delivered data only
Date: Sat, 31 Oct 2026 00:59:36 +0300 [thread overview]
Message-ID: <20261030215937.18103-2-haddad2inc@gmail.com> (raw)
In-Reply-To: <20261030215937.18103-1-haddad2inc@gmail.com>
The phy tpt trigger adds every received frame with the data-present bit
set to its RX byte count in ieee80211_rx_list(), before the frame is
matched to a BSS or delivered to an interface. On a busy band an access
point with zero associated clients still hears data frames from
neighbouring networks, so the throughput LED blinks continuously and
gives no indication of actual transfer. Management frames such as
beacons are already excluded by the data-present check, and the TX side
only counts data submitted through the interface transmit paths, so
overheard data is the only remaining source of idle blinking.
Move the RX count to the two places where a frame is actually handed to
an interface, right next to the dev_sw_netstats_rx_add() calls in
ieee80211_deliver_skb() and ieee80211_rx_8023() (the latter also covers
the fast-RX and the 802.3-offload delivery paths). The trigger then
counts exactly the data delivered to the wiphy's interfaces, in every
mode - AP, client or mesh - which matches what the per-interface
counters report and what users read from a throughput LED.
This scopes the RX side only. The TX side is untouched, and an access
point still transmits the broadcast and multicast it bridges with zero
associated stations - measured at roughly 2 KiB/s on a quiet LAN - which
keeps the counter moving and the blink table stepping, so an idle radio is
not solid yet. Treating a rate below an idle floor as no traffic is a
separate change.
Monitor copies are deliberately not counted: they are clones of frames
whose original delivery is already counted once at its own interface,
and counting them would double the reported rate whenever a monitor
interface is up.
The deleted block was the only user of the local hdr pointer in
ieee80211_rx_list(), so drop its declaration too - mac80211 is built
with -Werror=unused-variable and the file would not compile otherwise.
Signed-off-by: Salah Ahmed <haddad2inc@gmail.com>
---
net/mac80211/rx.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 905fd7049..559cc2101 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2756,6 +2756,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
xmit_skb = NULL;
dev_sw_netstats_rx_add(dev, skb->len);
+ ieee80211_tpt_led_trig_rx(rx->local, skb->len);
if (rx->sta) {
/* The seqno index has the same property as needed
@@ -4970,6 +4971,7 @@ static void ieee80211_rx_8023(struct ieee80211_rx_data *rx,
skb->dev = fast_rx->dev;
dev_sw_netstats_rx_add(fast_rx->dev, skb->len);
+ ieee80211_tpt_led_trig_rx(rx->local, skb->len);
/* The seqno index has the same property as needed
* for the rx_msdu field, i.e. it is IEEE80211_NUM_TIDS
@@ -5583,7 +5585,6 @@ void ieee80211_rx_list(struct ieee80211_hw *hw,
struct ieee80211_rate *rate = NULL;
struct ieee80211_supported_band *sband;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
WARN_ON_ONCE(softirq_count() == 0);
@@ -5727,10 +5728,6 @@ void ieee80211_rx_list(struct ieee80211_hw *hw,
if (!(status->flag & RX_FLAG_8023))
skb = ieee80211_rx_monitor(local, skb, rate);
if (skb) {
- if ((status->flag & RX_FLAG_8023) ||
- ieee80211_is_data_present(hdr->frame_control))
- ieee80211_tpt_led_trig_rx(local, skb->len);
-
if (status->flag & RX_FLAG_8023)
__ieee80211_rx_handle_8023(hw, link_pubsta, skb, list);
else
--
2.53.0
next prev parent reply other threads:[~2026-10-30 21:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 21:59 [PATCH 0/2] wifi: mac80211: make the phy tpt LED indicate real traffic Salah Ahmed
2026-10-30 21:59 ` Salah Ahmed [this message]
2026-10-30 21:59 ` [PATCH 2/2] wifi: mac80211: keep the tpt LED solid below an idle threshold Salah Ahmed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261030215937.18103-2-haddad2inc@gmail.com \
--to=haddad2inc@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®