madwifi/net80211/Makefile
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

124 lines
4.7 KiB
Makefile

#
# Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer,
# without modification.
# 2. Redistributions in binary form must reproduce at minimum a disclaimer
# similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
# redistribution must be conditioned upon including a substantially
# similar Disclaimer requirement for further binary redistribution.
# 3. Neither the names of the above-listed copyright holders nor the names
# of any contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# Alternatively, this software may be distributed under the terms of the
# GNU General Public License ("GPL") version 2 as published by the Free
# Software Foundation.
#
# NO WARRANTY
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGES.
#
# $Id: //depot/sw/linuxsrc/src/802_11/madwifi/madwifi/net80211/Makefile#12 $
#
#
# Makefile for the 802.11 WLAN modules.
#
ifeq ($(obj),)
obj= .
endif
TOP = $(obj)/..
#
# 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
#
# Modules to be built+installed
#
MOD_INSTALL := wlan.o wlan_wep.o wlan_tkip.o wlan_ccmp.o wlan_acl.o \
$(MOD_AUTH) $(MOD_SCAN)
obj-m += $(MOD_INSTALL)
wlan-objs := if_media.o \
ieee80211_skb.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_monitor.o ieee80211_rate.o
wlan_wep-objs := ieee80211_crypto_wep.o
wlan_tkip-objs := ieee80211_crypto_tkip.o
wlan_ccmp-objs := ieee80211_crypto_ccmp.o
wlan_acl-objs := ieee80211_acl.o
wlan_xauth-objs := ieee80211_xauth.o
wlan_scan_sta-objs :=ieee80211_scan_sta.o
wlan_scan_ap-objs := ieee80211_scan_ap.o
include $(TOP)/Makefile.inc
INCS += -I$(TOP) -I$(ATH_HAL) -I$(HAL)
EXTRA_CFLAGS+=$(INCS) $(COPTS) -DOPT_AH_H=\"public/$(TARGET).opt_ah.h\"
-include $(TOPDIR)/Rules.make
all:
$(MAKE) -C $(KERNELPATH) SUBDIRS=$(shell pwd) modules
wlan.o: $(wlan-objs)
$(LD) $(LDOPTS) -o wlan.$(KMODSUF) -r $(wlan-objs)
wlan_wep.o: $(wlan_wep-objs)
$(LD) $(LDOPTS) -o wlan_wep.$(KMODSUF) -r $(wlan_wep-objs)
wlan_tkip.o: $(wlan_tkip-objs)
$(LD) $(LDOPTS) -o wlan_tkip.$(KMODSUF) -r $(wlan_tkip-objs)
wlan_ccmp.o: $(wlan_ccmp-objs)
$(LD) $(LDOPTS) -o wlan_ccmp.$(KMODSUF) -r $(wlan_ccmp-objs)
wlan_scan_sta.o: $(wlan_scan_sta-objs)
$(LD) $(LDOPTS) -o wlan_scan_sta.$(KMODSUF) -r $(wlan_scan_sta-objs)
wlan_scan_ap.o: $(wlan_scan_ap-objs)
$(LD) $(LDOPTS) -o wlan_scan_ap.$(KMODSUF) -r $(wlan_scan_ap-objs)
wlan_xauth.o: $(wlan_xauth-objs)
$(LD) $(LDOPTS) -o wlan_xauth.$(KMODSUF) -r $(wlan_xauth-objs)
wlan_acl.o: $(wlan_acl-objs)
$(LD) $(LDOPTS) -o wlan_acl.$(KMODSUF) -r $(wlan_acl-objs)
install:
test -d $(DESTDIR)/$(KMODPATH) || mkdir -p $(DESTDIR)/$(KMODPATH)
for i in $(MOD_INSTALL); do \
f=`basename $$i .o`; \
install -m 0644 $$f.$(KMODSUF) $(DESTDIR)/$(KMODPATH); \
done
clean:
-rm -f *~ *.o *.ko *.mod.c
-rm -f .depend .version .*.o.flags .*.o.d .*.o.cmd .*.ko.cmd
-rm -rf .tmp_versions