aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ath/if_athvar.h
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2012-10-15 00:07:18 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2012-10-15 00:07:18 +0000
commitcf0c92d600e382b5f1c947a61970e910736ac9d7 (patch)
tree9f4d743334f7ba994a1d5afaf9383210354e18bf /sys/dev/ath/if_athvar.h
parent13aa9ee5c275952bb689ed6ad53a85ee1d51e7c0 (diff)
downloadsrc-cf0c92d600e382b5f1c947a61970e910736ac9d7.tar.gz
src-cf0c92d600e382b5f1c947a61970e910736ac9d7.zip
Track the total number of software queued frames in an atomic variable
stashed away in ath_node. As much as I tried to stuff that behind the ATH_NODE lock, unfortunately the locking is just too plain hairy (for me! And I wrote it!) to do cleanly. Hence using atomics here instead of a lock. The ATH_NODE lock just isn't currently used anywhere besides the rate control updates. If in the future everything gets migrated back to using a single ATH_NODE lock or a single global ATH_TX lock (ie, a single TX lock for all TX and TX completion) then fine, I'll remove the atomics.
Notes
Notes: svn path=/head/; revision=241567
Diffstat (limited to 'sys/dev/ath/if_athvar.h')
-rw-r--r--sys/dev/ath/if_athvar.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h
index 183f28bc067d..146b809288da 100644
--- a/sys/dev/ath/if_athvar.h
+++ b/sys/dev/ath/if_athvar.h
@@ -35,6 +35,8 @@
#ifndef _DEV_ATH_ATHVAR_H
#define _DEV_ATH_ATHVAR_H
+#include <machine/atomic.h>
+
#include <dev/ath/ath_hal/ah.h>
#include <dev/ath/ath_hal/ah_desc.h>
#include <net80211/ieee80211_radiotap.h>
@@ -175,6 +177,8 @@ struct ath_node {
struct ath_tid an_tid[IEEE80211_TID_SIZE]; /* per-TID state */
char an_name[32]; /* eg "wlan0_a1" */
struct mtx an_mtx; /* protecting the ath_node state */
+ uint32_t an_swq_depth; /* how many SWQ packets for this
+ node */
/* variable-length rate control state follows */
};
#define ATH_NODE(ni) ((struct ath_node *)(ni))
@@ -379,14 +383,17 @@ struct ath_txq {
#define ATH_TID_INSERT_HEAD(_tq, _elm, _field) do { \
TAILQ_INSERT_HEAD(&(_tq)->tid_q, (_elm), _field); \
(_tq)->axq_depth++; \
+ atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \
} while (0)
#define ATH_TID_INSERT_TAIL(_tq, _elm, _field) do { \
TAILQ_INSERT_TAIL(&(_tq)->tid_q, (_elm), _field); \
(_tq)->axq_depth++; \
+ atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \
} while (0)
#define ATH_TID_REMOVE(_tq, _elm, _field) do { \
TAILQ_REMOVE(&(_tq)->tid_q, _elm, _field); \
(_tq)->axq_depth--; \
+ atomic_subtract_rel_32( &((_tq)->an)->an_swq_depth, 1); \
} while (0)
#define ATH_TID_FIRST(_tq) TAILQ_FIRST(&(_tq)->tid_q)
#define ATH_TID_LAST(_tq, _field) TAILQ_LAST(&(_tq)->tid_q, _field)
@@ -397,14 +404,17 @@ struct ath_txq {
#define ATH_TID_FILT_INSERT_HEAD(_tq, _elm, _field) do { \
TAILQ_INSERT_HEAD(&(_tq)->filtq.tid_q, (_elm), _field); \
(_tq)->axq_depth++; \
+ atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \
} while (0)
#define ATH_TID_FILT_INSERT_TAIL(_tq, _elm, _field) do { \
TAILQ_INSERT_TAIL(&(_tq)->filtq.tid_q, (_elm), _field); \
(_tq)->axq_depth++; \
+ atomic_add_rel_32( &((_tq)->an)->an_swq_depth, 1); \
} while (0)
#define ATH_TID_FILT_REMOVE(_tq, _elm, _field) do { \
TAILQ_REMOVE(&(_tq)->filtq.tid_q, _elm, _field); \
(_tq)->axq_depth--; \
+ atomic_subtract_rel_32( &((_tq)->an)->an_swq_depth, 1); \
} while (0)
#define ATH_TID_FILT_FIRST(_tq) TAILQ_FIRST(&(_tq)->filtq.tid_q)
#define ATH_TID_FILT_LAST(_tq, _field) TAILQ_LAST(&(_tq)->filtq.tid_q,_field)