madwifi/net80211/Makefile.kernel
mtaylor ebe8ee9736 This patch augments the current reference counting code with:
* Counters for total outstanding instances for each resource type (skb, ath_node and ath_buf)
* One pair of acquisition/release functions per resource type in unlocked and one in locked
* Adds some more _debug versions of functions in the call chain that acquire/release resources so that the original func/line in the driver as well as the func/line that affected the resource use can be shown in the trace.  Intermediate stack frames aren't necessary to trace the leaks.
* Changes naming convention for "lock-required" functions to suffix _locked for the versions that expect locking, to be consistent with some other places in the code.
* Consolidate debug messages to the helper functions that actually affect the reference count or acquire/release a resource
* Additional sanity checks and leak detection (esp for detecting node ref leaks through skb)
* skb references are nulled out by the new sbk unref/free function.

I've tested these changes extensively and found lots of cases where we didn't get enough node references when cloning skbuff, and where the kernel drops packets due to performance issues and leaks our node references.

With these changes and the tracing enabled I have verified that:

* TX BUF: tx buffers always go down to zero when the tx queue is done, and you can watch tx queue usage ratio go up and down again as the driver is working.  There are no leaks here at the moment, although there *are* some in the madwifi-dfs branch during CAC at the moment.

* skbuff leaks in all the common flows are fixed.  We were leaking node references in a lot of places where kernel was dropping skb's due to congestion and we were failing to increment node references when cloning skbuffs.  These are now detected, as are skbuffs that are reaped by the kernel while still holding a node reference.

* the ath_node count works correctly and on an idle system we get about 5 references per station table node, with 2 node instances per VAP.  One for the bss and one for the node in the station table, I believe.  The ath_node count goes up and down but always lands back at the stable number based on the vaps you have configured and the number of actual stations in the station table.  The point here is that it's pretty constant what you will see over time, despite excessive node creation/release in our code during input (esp input_all).  Thank god for the slab allocator.



git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2902 0192ed92-7a03-0410-a25b-9323aeb14dbd
2007-11-21 20:14:11 +00:00

87 lines
3.0 KiB
Makefile

#
# Makefile for the 802.11 NET80211 module.
#
src ?= .
srctree ?= .
TOP = $(srctree)/$(src)/..
include $(TOP)/BuildCaps.inc
include $(TOP)/ath_hal/ah_target.inc
COMPAT = $(TOP)/include
ATH_HAL = $(TOP)/ath_hal
HAL = $(TOP)/hal
INCS = -include $(COMPAT)/compat.h -I$(COMPAT)
INCS += -I$(TOP) -I$(ATH_HAL) -I$(HAL)
EXTRA_CFLAGS += $(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\"
#
# There are two authenticator mechanisms: an in-kernel implementation
# (wlan_auth+wlan_radius) and an external implementation (wlan_xauth) that
# requires a user process to manage the authentication process. By default
# the external authenticator is used. ieee80211_proto.c has a table of module
# names that defines the default module to auto-load for each authentication
# scheme; to get the in-kernel authenticator by default modify it to load
# wlan_auth instead of wlan_xauth or manually load wlan_auth prior to use.
#
MOD_AUTH := wlan_xauth.o
#
# Scanning policy is split into modules. The default policy modules
# separate station-mode scanning support from ap-mode scanning support.
#
MOD_SCAN := wlan_scan_sta.o wlan_scan_ap.o
obj-$(CONFIG_ATHEROS) += wlan.o wlan_wep.o wlan_tkip.o wlan_ccmp.o wlan_acl.o \
$(MOD_AUTH) $(MOD_SCAN)
wlan-objs := if_media.o \
ieee80211.o ieee80211_beacon.o ieee80211_crypto.o \
ieee80211_crypto_none.o ieee80211_input.o ieee80211_node.o \
ieee80211_output.o ieee80211_proto.o ieee80211_power.o \
ieee80211_scan.o ieee80211_wireless.o ieee80211_linux.o \
ieee80211_monitor.o ieee80211_rate.o ieee80211_skb.o
wlan_wep-objs := ieee80211_crypto_wep.o
wlan_tkip-objs := ieee80211_crypto_tkip.o
wlan_ccmp-objs := ieee80211_crypto_ccmp.o
wlan_xauth-objs := ieee80211_xauth.o
wlan_acl-objs := ieee80211_acl.o
wlan_scan_sta-objs := ieee80211_scan_sta.o
wlan_scan_ap-objs := ieee80211_scan_ap.o
ifeq ($(VERSION).$(PATCHLEVEL),2.4)
export-objs := if_media.o \
ieee80211.o ieee80211_beacon.o ieee80211_crypto.o \
ieee80211_crypto_none.o ieee80211_input.o ieee80211_node.o \
ieee80211_output.o ieee80211_power.o ieee80211_proto.o \
ieee80211_scan.o ieee80211_wireless.o ieee80211_linux.o \
ieee80211_crypto_wep.o ieee80211_crypto_tkip.o \
ieee80211_crypto_ccmp.o ieee80211_xauth.o ieee80211_rate.o \
ieee80211_skb.o
list-multi := wlan.o wlan_wep.o wlan_tkip.o wlan_ccmp.o wlan_acl.o \
$(MOD_AUTH) $(MOD_SCAN)
O_TARGET := net80211.o
include $(TOPDIR)/Rules.make
wlan.o: $(wlan-objs)
$(LD) -o wlan.o -r $(wlan-objs)
wlan_wep.o: $(wlan_wep-objs)
$(LD) -o wlan_wep.o -r $(wlan_wep-objs)
wlan_tkip.o: $(wlan_tkip-objs)
$(LD) -o wlan_tkip.o -r $(wlan_tkip-objs)
wlan_ccmp.o: $(wlan_ccmp-objs)
$(LD) -o wlan_ccmp.o -r $(wlan_ccmp-objs)
wlan_xauth.o: $(wlan_xauth-objs)
$(LD) -o wlan_xauth.o -r $(wlan_xauth-objs)
wlan_acl.o: $(wlan_acl-objs)
$(LD) -o wlan_acl.o -r $(wlan_acl-objs)
wlan_scan_sta.o: $(wlan_scan_sta-objs)
$(LD) -o wlan_scan_sta.o -r $(wlan_scan_sta-objs)
wlan_scan_ap.o: $(wlan_scan_ap-objs)
$(LD) -o wlan_scan_ap.o -r $(wlan_scan_ap-objs)
endif