From 93efeeea0fe6b3352e492e855a7262bc5645af14 Mon Sep 17 00:00:00 2001 From: Nguyen Dinh Phi Date: Tue, 22 Jun 2021 23:24:29 +0800 Subject: [PATCH] mac80211_hwsim: record stats in non-netlink path The data go through mac80211_hwsim_tx_frame_no_nl() wasn't counted. Signed-off-by: Nguyen Dinh Phi Link: https://lore.kernel.org/r/20210622152429.881230-1-phind.uet@gmail.com Signed-off-by: Johannes Berg --- drivers/net/wireless/mac80211_hwsim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 7a5764003f81..ffa894f7312a 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -1779,6 +1779,8 @@ static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw, if (_pid || hwsim_virtio_enabled) return mac80211_hwsim_tx_frame_nl(hw, skb, _pid, chan); + data->tx_pkts++; + data->tx_bytes += skb->len; mac80211_hwsim_tx_frame_no_nl(hw, skb, chan); dev_kfree_skb(skb); } -- GitLab