aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorMatti Gottlieb <matti.gottlieb@intel.com>2013-11-18 12:06:45 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-12-02 05:51:50 -0500
commitad38bfc916da6aee9160bfa5335aed8d6c190e39 (patch)
treebc00170187f5e2036a8c804f546c32d94bdee349 /net/mac80211/tx.c
parent1d940aaab881b0ee62557ffbaad877ac5a1b51db (diff)
mac80211: Tx frame latency statistics
Measure TX latency and jitter statistics per station per TID. These Measurements are disabled by default and can be enabled via debugfs. Features included for each station's TID: 1. Keep count of the maximum and average latency of Tx frames. 2. Keep track of many frames arrived in a specific time range (need to enable through debugfs and configure the bins ranges) Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index e541856b4007..6d59e21cdb9f 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -19,6 +19,7 @@
19#include <linux/bitmap.h> 19#include <linux/bitmap.h>
20#include <linux/rcupdate.h> 20#include <linux/rcupdate.h>
21#include <linux/export.h> 21#include <linux/export.h>
22#include <linux/time.h>
22#include <net/net_namespace.h> 23#include <net/net_namespace.h>
23#include <net/ieee80211_radiotap.h> 24#include <net/ieee80211_radiotap.h>
24#include <net/cfg80211.h> 25#include <net/cfg80211.h>
@@ -1741,6 +1742,26 @@ fail:
1741 return NETDEV_TX_OK; /* meaning, we dealt with the skb */ 1742 return NETDEV_TX_OK; /* meaning, we dealt with the skb */
1742} 1743}
1743 1744
1745/*
1746 * Measure Tx frame arrival time for Tx latency statistics calculation
1747 * A single Tx frame latency should be measured from when it is entering the
1748 * Kernel until we receive Tx complete confirmation indication and the skb is
1749 * freed.
1750 */
1751static void ieee80211_tx_latency_start_msrmnt(struct ieee80211_local *local,
1752 struct sk_buff *skb)
1753{
1754 struct timespec skb_arv;
1755 struct ieee80211_tx_latency_bin_ranges *tx_latency;
1756
1757 tx_latency = rcu_dereference(local->tx_latency);
1758 if (!tx_latency)
1759 return;
1760
1761 ktime_get_ts(&skb_arv);
1762 skb->tstamp = ktime_set(skb_arv.tv_sec, skb_arv.tv_nsec);
1763}
1764
1744/** 1765/**
1745 * ieee80211_subif_start_xmit - netif start_xmit function for Ethernet-type 1766 * ieee80211_subif_start_xmit - netif start_xmit function for Ethernet-type
1746 * subinterfaces (wlan#, WDS, and VLAN interfaces) 1767 * subinterfaces (wlan#, WDS, and VLAN interfaces)
@@ -1791,6 +1812,9 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1791 1812
1792 rcu_read_lock(); 1813 rcu_read_lock();
1793 1814
1815 /* Measure frame arrival for Tx latency statistics calculation */
1816 ieee80211_tx_latency_start_msrmnt(local, skb);
1817
1794 switch (sdata->vif.type) { 1818 switch (sdata->vif.type) {
1795 case NL80211_IFTYPE_AP_VLAN: 1819 case NL80211_IFTYPE_AP_VLAN:
1796 sta = rcu_dereference(sdata->u.vlan.sta); 1820 sta = rcu_dereference(sdata->u.vlan.sta);