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
2226 * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this2226 * @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this
2227 * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.2227 * u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
2228 *2228 *
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 *
2229 * @NUM_NL80211_ATTR: total number of nl80211_attrs available2239 * @NUM_NL80211_ATTR: total number of nl80211_attrs available
2230 * @NL80211_ATTR_MAX: highest attribute number currently defined2240 * @NL80211_ATTR_MAX: highest attribute number currently defined
2231 * @__NL80211_ATTR_AFTER_LAST: internal use2241 * @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2660,6 +2670,11 @@ enum nl80211_attrs { · 428 unmodified lines
2660 2670
2661 NL80211_ATTR_CONTROL_PORT_OVER_NL80211,2671 NL80211_ATTR_CONTROL_PORT_OVER_NL80211,
2662 2672
2673 NL80211_ATTR_TXQ_STATS,
2674 NL80211_ATTR_TXQ_LIMIT,
2675 NL80211_ATTR_TXQ_MEMORY_LIMIT,
2676 NL80211_ATTR_TXQ_QUANTUM,
2677
2663 /* add attributes here, update the policy in nl80211.c */2678 /* add attributes here, update the policy in nl80211.c */
2664 2679
2665 __NL80211_ATTR_AFTER_LAST,2680 __NL80211_ATTR_AFTER_LAST,
@@ -3040,6 +3055,7 @@ enum nl80211_sta_info { · 374 unmodified lines
3040 * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted3055 * @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted
3041 * MSDUs (u64)3056 * MSDUs (u64)
3042 * @NL80211_TID_STATS_PAD: attribute used for padding for 64-bit alignment3057 * @NL80211_TID_STATS_PAD: attribute used for padding for 64-bit alignment
3058 * @NL80211_TID_STATS_TXQ_STATS: TXQ stats (nested attribute)
3043 * @NUM_NL80211_TID_STATS: number of attributes here3059 * @NUM_NL80211_TID_STATS: number of attributes here
3044 * @NL80211_TID_STATS_MAX: highest numbered attribute here3060 * @NL80211_TID_STATS_MAX: highest numbered attribute here
3045 */3061 */
@@ -3050,12 +3066,51 @@ enum nl80211_tid_stats { · 4 unmodified lines
3050 NL80211_TID_STATS_TX_MSDU_RETRIES,3066 NL80211_TID_STATS_TX_MSDU_RETRIES,
3051 NL80211_TID_STATS_TX_MSDU_FAILED,3067 NL80211_TID_STATS_TX_MSDU_FAILED,
3052 NL80211_TID_STATS_PAD,3068 NL80211_TID_STATS_PAD,
3069 NL80211_TID_STATS_TXQ_STATS,
3053 3070
3054 /* keep last */3071 /* keep last */
3055 NUM_NL80211_TID_STATS,3072 NUM_NL80211_TID_STATS,
3056 NL80211_TID_STATS_MAX = NUM_NL80211_TID_STATS - 13073 NL80211_TID_STATS_MAX = NUM_NL80211_TID_STATS - 1
3057};3074};
3058 3075
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 */
3095enum 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
3059/**3114/**
3060 * enum nl80211_mpath_flags - nl80211 mesh path flags3115 * enum nl80211_mpath_flags - nl80211 mesh path flags
3061 *3116 *
@@ -5072,6 +5127,8 @@ enum nl80211_feature_flags { · 2010 unmodified lines
5072 * @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: This Driver support data ack5127 * @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: This Driver support data ack
5073 * rssi if firmware support, this flag is to intimate about ack rssi5128 * rssi if firmware support, this flag is to intimate about ack rssi
5074 * support to nl80211.5129 * support to nl80211.
5130 * @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate
5131 * TXQs.
5075 *5132 *
5076 * @NUM_NL80211_EXT_FEATURES: number of extended features.5133 * @NUM_NL80211_EXT_FEATURES: number of extended features.
5077 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.5134 * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
@@ -5105,6 +5162,7 @@ enum nl80211_ext_feature_index { · 27 unmodified lines
5105 NL80211_EXT_FEATURE_DFS_OFFLOAD,5162 NL80211_EXT_FEATURE_DFS_OFFLOAD,
5106 NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211,5163 NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211,
5107 NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT,5164 NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT,
5165 NL80211_EXT_FEATURE_TXQS,
5108 5166
5109 /* add new features before the definition below */5167 /* add new features before the definition below */
5110 NUM_NL80211_EXT_FEATURES,5168 NUM_NL80211_EXT_FEATURES,