History

cfg80211: Expose TXQ stats and parameters to userspace

This adds support for exporting the mac80211 TXQ stats via nl80211 by way of a nested TXQ stats attribute, as well as for configuring the quantum and limits that were previously only changeable through debugfs. This commit adds just the nl80211 API, a subsequent commit adds support to mac80211 itself.

Toke Høiland-Jørgensen committed 8 years ago

Commit 52539ca1 parent cc60dbb7 files · +343 −48Browse files

Showing the changes to include/uapi/linux (1 of 7 files). Show all

Unified · Split

include/uapi/linux/nl80211.h+58−0
@@ -2226,6 +2226,16 @@ enum nl80211_commands { · 2225 unmodified lines
22262226 * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this
22272227 * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
22282228 *
2229+ * @NL80211_ATTR_TXQ_STATS: TXQ statistics (nested attribute, see &enum
2230+ * nl80211_txq_stats)
2231+ * @NL80211_ATTR_TXQ_LIMIT: Total packet limit for the TXQ queues for this phy.
2232+ * The smaller of this and the memory limit is enforced.
2233+ * @NL80211_ATTR_TXQ_MEMORY_LIMIT: Total memory memory limit (in bytes) for the
2234+ * TXQ queues for this phy. The smaller of this and the packet limit is
2235+ * enforced.
2236+ * @NL80211_ATTR_TXQ_QUANTUM: TXQ scheduler quantum (bytes). Number of bytes
2237+ * a flow is assigned on each round of the DRR scheduler.
2238+ *
22292239 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
22302240 * @NL80211_ATTR_MAX: highest attribute number currently defined
22312241 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2660,6 +2670,11 @@ enum nl80211_attrs { · 428 unmodified lines
26602670
26612671 NL80211_ATTR_CONTROL_PORT_OVER_NL80211,
26622672
2673+ NL80211_ATTR_TXQ_STATS,
2674+ NL80211_ATTR_TXQ_LIMIT,
2675+ NL80211_ATTR_TXQ_MEMORY_LIMIT,
2676+ NL80211_ATTR_TXQ_QUANTUM,
2677+
26632678 /* add attributes here, update the policy in nl80211.c */
26642679
26652680 __NL80211_ATTR_AFTER_LAST,
@@ -3040,6 +3055,7 @@ enum nl80211_sta_info { · 374 unmodified lines
30403055 * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted
30413056 * MSDUs (u64)
30423057 * @NL80211_TID_STATS_PAD: attribute used for padding for 64-bit alignment
3058+ * @NL80211_TID_STATS_TXQ_STATS: TXQ stats (nested attribute)
30433059 * @NUM_NL80211_TID_STATS: number of attributes here
30443060 * @NL80211_TID_STATS_MAX: highest numbered attribute here
30453061 */
@@ -3050,12 +3066,51 @@ enum nl80211_tid_stats { · 4 unmodified lines
30503066 NL80211_TID_STATS_TX_MSDU_RETRIES,
30513067 NL80211_TID_STATS_TX_MSDU_FAILED,
30523068 NL80211_TID_STATS_PAD,
3069+ NL80211_TID_STATS_TXQ_STATS,
30533070
30543071 /* keep last */
30553072 NUM_NL80211_TID_STATS,
30563073 NL80211_TID_STATS_MAX = NUM_NL80211_TID_STATS - 1
30573074 };
30583075
3076+/**
3077+ * enum nl80211_txq_stats - per TXQ statistics attributes
3078+ * @__NL80211_TXQ_STATS_INVALID: attribute number 0 is reserved
3079+ * @NUM_NL80211_TXQ_STATS: number of attributes here
3080+ * @NL80211_TXQ_STATS_BACKLOG_BYTES: number of bytes currently backlogged
3081+ * @NL80211_TXQ_STATS_BACKLOG_PACKETS: number of packets currently
3082+ * backlogged
3083+ * @NL80211_TXQ_STATS_FLOWS: total number of new flows seen
3084+ * @NL80211_TXQ_STATS_DROPS: total number of packet drops
3085+ * @NL80211_TXQ_STATS_ECN_MARKS: total number of packet ECN marks
3086+ * @NL80211_TXQ_STATS_OVERLIMIT: number of drops due to queue space overflow
3087+ * @NL80211_TXQ_STATS_OVERMEMORY: number of drops due to memory limit overflow
3088+ * (only for per-phy stats)
3089+ * @NL80211_TXQ_STATS_COLLISIONS: number of hash collisions
3090+ * @NL80211_TXQ_STATS_TX_BYTES: total number of bytes dequeued from TXQ
3091+ * @NL80211_TXQ_STATS_TX_PACKETS: total number of packets dequeued from TXQ
3092+ * @NL80211_TXQ_STATS_MAX_FLOWS: number of flow buckets for PHY
3093+ * @NL80211_TXQ_STATS_MAX: highest numbered attribute here
3094+ */
3095+enum nl80211_txq_stats {
3096+ __NL80211_TXQ_STATS_INVALID,
3097+ NL80211_TXQ_STATS_BACKLOG_BYTES,
3098+ NL80211_TXQ_STATS_BACKLOG_PACKETS,
3099+ NL80211_TXQ_STATS_FLOWS,
3100+ NL80211_TXQ_STATS_DROPS,
3101+ NL80211_TXQ_STATS_ECN_MARKS,
3102+ NL80211_TXQ_STATS_OVERLIMIT,
3103+ NL80211_TXQ_STATS_OVERMEMORY,
3104+ NL80211_TXQ_STATS_COLLISIONS,
3105+ NL80211_TXQ_STATS_TX_BYTES,
3106+ NL80211_TXQ_STATS_TX_PACKETS,
3107+ NL80211_TXQ_STATS_MAX_FLOWS,
3108+
3109+ /* keep last */
3110+ NUM_NL80211_TXQ_STATS,
3111+ NL80211_TXQ_STATS_MAX = NUM_NL80211_TXQ_STATS - 1
3112+};
3113+
30593114 /**
30603115 * enum nl80211_mpath_flags - nl80211 mesh path flags
30613116 *
@@ -5072,6 +5127,8 @@ enum nl80211_feature_flags { · 2010 unmodified lines
50725127 * @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: This Driver support data ack
50735128 * rssi if firmware support, this flag is to intimate about ack rssi
50745129 * support to nl80211.
5130+ * @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate
5131+ * TXQs.
50755132 *
50765133 * @NUM_NL80211_EXT_FEATURES: number of extended features.
50775134 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
@@ -5105,6 +5162,7 @@ enum nl80211_ext_feature_index { · 27 unmodified lines
51055162 NL80211_EXT_FEATURE_DFS_OFFLOAD,
51065163 NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211,
51075164 NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT,
5165+ NL80211_EXT_FEATURE_TXQS,
51085166
51095167 /* add new features before the definition below */
51105168 NUM_NL80211_EXT_FEATURES,