[PATCH wireless-next 2/4] wifi: mac80211: take the TID of an 802.3 frame from the driver
From: Julius Bairaktaris
Date: Sun Nov 22 2026 - 08:42:43 EST
__ieee80211_rx_handle_8023() clears struct ieee80211_rx_data and never
sets seqno_idx, so ieee80211_rx_8023() counts every frame received with
RX_FLAG_8023 in rx_stats.msdu[0], whatever its TID. The native path
takes the TID from the QoS header, which an 802.3 frame no longer has.
Add a tid field to struct ieee80211_rx_status for the driver to fill,
and use it as seqno_idx on the 802.3 path. A driver that does not set it
leaves it 0, which counts the frame on TID 0 as before.
Fixes: 80a915ec4427 ("mac80211: add rx decapsulation offload support")
Signed-off-by: Julius Bairaktaris <julius@xxxxxxxxxxxxxx>
---
include/net/mac80211.h | 4 ++++
net/mac80211/rx.c | 3 +++
2 files changed, 7 insertions(+)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 8eac4d50d06c..d601070810fb 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1770,6 +1770,9 @@ enum mac80211_rx_encoding {
* @ampdu_reference: A-MPDU reference number, must be a different value for
* each A-MPDU but the same for each subframe within one A-MPDU
* @zero_length_psdu_type: radiotap type of the 0-length PSDU
+ * @tid: the TID of a frame received in 802.3 format (%RX_FLAG_8023), or
+ * %IEEE80211_NUM_TIDS if it has none; counts the frame in the per-TID
+ * statistics of its station. Not read for other frames.
* @link_id: id of the link used to receive the packet. Set and used by
* mac80211 internally, it uses @freq set by the driver to identify the
* correct link per vif. Set to %IEEE80211_LINK_UNSPECIFIED for non-MLD
@@ -1813,6 +1816,7 @@ struct ieee80211_rx_status {
u8 chains;
s8 chain_signal[IEEE80211_MAX_CHAINS];
u8 zero_length_psdu_type;
+ u8 tid;
u8 link_id:4;
};
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index a2356cd17691..9fabc9b5a976 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -5303,6 +5303,7 @@ static void __ieee80211_rx_handle_8023(struct ieee80211_hw *hw,
struct sk_buff *skb,
struct list_head *list)
{
+ struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
struct ieee80211_local *local = hw_to_local(hw);
struct ieee80211_fast_rx *fast_rx;
struct ieee80211_rx_data rx;
@@ -5313,6 +5314,8 @@ static void __ieee80211_rx_handle_8023(struct ieee80211_hw *hw,
rx.skb = skb;
rx.local = local;
rx.list = list;
+ /* the MSDU count of the station is kept per TID */
+ rx.seqno_idx = min_t(u8, status->tid, IEEE80211_NUM_TIDS);
I802_DEBUG_INC(local->dot11ReceivedFragmentCount);
--
2.53.0