From owner-svn-src-user@FreeBSD.ORG Mon Aug 1 22:36:29 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76022106566C; Mon, 1 Aug 2011 22:36:29 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 661E18FC0C; Mon, 1 Aug 2011 22:36:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p71MaTxL015448; Mon, 1 Aug 2011 22:36:29 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p71MaTI3015446; Mon, 1 Aug 2011 22:36:29 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201108012236.p71MaTI3015446@svn.freebsd.org> From: Doug Barton Date: Mon, 1 Aug 2011 22:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224585 - user/dougb/portmaster X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 22:36:29 -0000 Author: dougb Date: Mon Aug 1 22:36:28 2011 New Revision: 224585 URL: http://svn.freebsd.org/changeset/base/224585 Log: Avoid duplicate word in a composite sentence Submitted by: Dan Allen Modified: user/dougb/portmaster/portmaster Modified: user/dougb/portmaster/portmaster ============================================================================== --- user/dougb/portmaster/portmaster Mon Aug 1 22:21:18 2011 (r224584) +++ user/dougb/portmaster/portmaster Mon Aug 1 22:36:28 2011 (r224585) @@ -2946,7 +2946,7 @@ all_first_pass () { safe_exit fi - post_first_pass 'for ports that need updating' + post_first_pass 'ports that need updating' [ -n "$PM_BUILD_ONLY_LIST" ] && clean_build_only_list fi From owner-svn-src-user@FreeBSD.ORG Tue Aug 2 08:31:24 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69C81106566B; Tue, 2 Aug 2011 08:31:24 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 563E38FC08; Tue, 2 Aug 2011 08:31:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p728VOwu036570; Tue, 2 Aug 2011 08:31:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p728VNlH036542; Tue, 2 Aug 2011 08:31:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108020831.p728VNlH036542@svn.freebsd.org> From: Adrian Chadd Date: Tue, 2 Aug 2011 08:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224599 - in user/adrian/if_ath_tx: cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common contrib/bsnmp/snmp_usm contrib/gcc/cp etc/rc.d lib/libmemstat lib/libus... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2011 08:31:24 -0000 Author: adrian Date: Tue Aug 2 08:31:23 2011 New Revision: 224599 URL: http://svn.freebsd.org/changeset/base/224599 Log: MFC Added: user/adrian/if_ath_tx/tools/tools/ath/athradar/ - copied from r224594, head/tools/tools/ath/athradar/ Modified: user/adrian/if_ath_tx/cddl/contrib/opensolaris/cmd/ztest/ztest.c user/adrian/if_ath_tx/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c user/adrian/if_ath_tx/contrib/bsnmp/snmp_usm/snmp_usm.3 user/adrian/if_ath_tx/contrib/gcc/cp/ChangeLog user/adrian/if_ath_tx/contrib/gcc/cp/decl.c user/adrian/if_ath_tx/etc/rc.d/kld user/adrian/if_ath_tx/lib/libmemstat/libmemstat.3 user/adrian/if_ath_tx/lib/libmemstat/memstat.c user/adrian/if_ath_tx/lib/libmemstat/memstat.h user/adrian/if_ath_tx/lib/libmemstat/memstat_internal.h user/adrian/if_ath_tx/lib/libmemstat/memstat_malloc.c user/adrian/if_ath_tx/lib/libmemstat/memstat_uma.c user/adrian/if_ath_tx/lib/libusbhid/parse.c user/adrian/if_ath_tx/libexec/tftpd/tftp-transfer.c user/adrian/if_ath_tx/libexec/tftpd/tftpd.8 user/adrian/if_ath_tx/release/amd64/make-memstick.sh user/adrian/if_ath_tx/release/doc/en_US.ISO8859-1/hardware/article.sgml user/adrian/if_ath_tx/release/i386/make-memstick.sh user/adrian/if_ath_tx/release/powerpc/make-memstick.sh user/adrian/if_ath_tx/sbin/mount/mount.c user/adrian/if_ath_tx/share/man/man4/dc.4 user/adrian/if_ath_tx/share/man/man4/gif.4 user/adrian/if_ath_tx/share/man/man4/hptiop.4 user/adrian/if_ath_tx/share/man/man4/lmc.4 user/adrian/if_ath_tx/share/man/man4/mpt.4 user/adrian/if_ath_tx/share/man/man4/pcm.4 user/adrian/if_ath_tx/share/man/man4/rue.4 user/adrian/if_ath_tx/share/man/man4/smp.4 user/adrian/if_ath_tx/share/man/man4/stf.4 user/adrian/if_ath_tx/share/man/man4/wi.4 user/adrian/if_ath_tx/share/man/man5/reiserfs.5 user/adrian/if_ath_tx/share/man/man8/crash.8 user/adrian/if_ath_tx/share/man/man9/taskqueue.9 user/adrian/if_ath_tx/share/man/man9/vfs_getopt.9 user/adrian/if_ath_tx/sys/amd64/amd64/machdep.c user/adrian/if_ath_tx/sys/boot/forth/loader.conf user/adrian/if_ath_tx/sys/cam/ata/ata_da.c user/adrian/if_ath_tx/sys/cam/cam_periph.c user/adrian/if_ath_tx/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c user/adrian/if_ath_tx/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c user/adrian/if_ath_tx/sys/compat/linprocfs/linprocfs.c user/adrian/if_ath_tx/sys/conf/NOTES user/adrian/if_ath_tx/sys/conf/newvers.sh user/adrian/if_ath_tx/sys/conf/options user/adrian/if_ath_tx/sys/dev/ahci/ahci.c user/adrian/if_ath_tx/sys/dev/ahci/ahci.h user/adrian/if_ath_tx/sys/dev/ata/ata-pci.c user/adrian/if_ath_tx/sys/dev/ata/ata-pci.h user/adrian/if_ath_tx/sys/dev/ata/chipsets/ata-acard.c user/adrian/if_ath_tx/sys/dev/ata/chipsets/ata-acerlabs.c user/adrian/if_ath_tx/sys/dev/ata/chipsets/ata-intel.c user/adrian/if_ath_tx/sys/dev/ata/chipsets/ata-promise.c user/adrian/if_ath_tx/sys/dev/ath/ath_dfs/null/dfs_null.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah.h user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah_desc.h user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah_eeprom.h user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah_eeprom_9287.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah_eeprom_v14.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah_eeprom_v14.h user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ah_eeprom_v4k.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416.h user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280.c user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c user/adrian/if_ath_tx/sys/dev/ath/if_ath.c user/adrian/if_ath_tx/sys/dev/ath/if_ath_sysctl.c user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h user/adrian/if_ath_tx/sys/dev/hptiop/hptiop.c user/adrian/if_ath_tx/sys/dev/mpt/mpt.c user/adrian/if_ath_tx/sys/dev/mpt/mpt.h user/adrian/if_ath_tx/sys/dev/mpt/mpt_cam.c user/adrian/if_ath_tx/sys/dev/mpt/mpt_debug.c user/adrian/if_ath_tx/sys/dev/mpt/mpt_pci.c user/adrian/if_ath_tx/sys/dev/mpt/mpt_raid.c user/adrian/if_ath_tx/sys/dev/mpt/mpt_raid.h user/adrian/if_ath_tx/sys/dev/mpt/mpt_user.c user/adrian/if_ath_tx/sys/dev/pci/pci.c user/adrian/if_ath_tx/sys/dev/re/if_re.c user/adrian/if_ath_tx/sys/dev/usb/input/ums.c user/adrian/if_ath_tx/sys/fs/cd9660/iso.h user/adrian/if_ath_tx/sys/fs/msdosfs/msdosfsmount.h user/adrian/if_ath_tx/sys/fs/nfsclient/nfs_clvnops.c user/adrian/if_ath_tx/sys/fs/nfsserver/nfs_nfsdserv.c user/adrian/if_ath_tx/sys/fs/ntfs/ntfs.h user/adrian/if_ath_tx/sys/fs/smbfs/smbfs.h user/adrian/if_ath_tx/sys/i386/i386/machdep.c user/adrian/if_ath_tx/sys/kern/kern_conf.c user/adrian/if_ath_tx/sys/kern/kern_jail.c user/adrian/if_ath_tx/sys/kern/kern_linker.c user/adrian/if_ath_tx/sys/kern/kern_lock.c user/adrian/if_ath_tx/sys/kern/kern_shutdown.c user/adrian/if_ath_tx/sys/kern/subr_smp.c user/adrian/if_ath_tx/sys/kern/sys_capability.c user/adrian/if_ath_tx/sys/kern/vfs_mount.c user/adrian/if_ath_tx/sys/kern/vfs_subr.c user/adrian/if_ath_tx/sys/net/if_lagg.c user/adrian/if_ath_tx/sys/netgraph/ng_ether.c user/adrian/if_ath_tx/sys/netgraph/ng_mppc.c user/adrian/if_ath_tx/sys/netgraph/ng_parse.c user/adrian/if_ath_tx/sys/netinet/ip_divert.c user/adrian/if_ath_tx/sys/pc98/pc98/machdep.c user/adrian/if_ath_tx/sys/pci/if_rlreg.h user/adrian/if_ath_tx/sys/powerpc/aim/locore32.S user/adrian/if_ath_tx/sys/powerpc/booke/locore.S user/adrian/if_ath_tx/sys/powerpc/conf/MPC85XX user/adrian/if_ath_tx/sys/powerpc/mpc85xx/atpic.c user/adrian/if_ath_tx/sys/powerpc/powermac/fcu.c user/adrian/if_ath_tx/sys/sys/mount.h user/adrian/if_ath_tx/sys/sys/systm.h user/adrian/if_ath_tx/sys/ufs/ffs/ffs_alloc.c user/adrian/if_ath_tx/sys/ufs/ffs/ffs_softdep.c user/adrian/if_ath_tx/sys/ufs/ffs/ffs_vfsops.c user/adrian/if_ath_tx/sys/ufs/ffs/ffs_vnops.c user/adrian/if_ath_tx/sys/ufs/ufs/inode.h user/adrian/if_ath_tx/sys/vm/device_pager.c user/adrian/if_ath_tx/sys/vm/swap_pager.c user/adrian/if_ath_tx/sys/vm/swap_pager.h user/adrian/if_ath_tx/tools/tools/ath/Makefile user/adrian/if_ath_tx/tools/tools/sysdoc/tunables.mdoc user/adrian/if_ath_tx/usr.bin/cpio/Makefile user/adrian/if_ath_tx/usr.bin/netstat/sctp.c user/adrian/if_ath_tx/usr.bin/tar/Makefile user/adrian/if_ath_tx/usr.bin/unzip/unzip.1 user/adrian/if_ath_tx/usr.bin/usbhidaction/usbhidaction.c user/adrian/if_ath_tx/usr.bin/usbhidctl/usbhid.c user/adrian/if_ath_tx/usr.sbin/bsdinstall/scripts/netconfig_ipv4 user/adrian/if_ath_tx/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 user/adrian/if_ath_tx/usr.sbin/faithd/faithd.8 user/adrian/if_ath_tx/usr.sbin/jail/jail.8 user/adrian/if_ath_tx/usr.sbin/mfiutil/mfi_show.c user/adrian/if_ath_tx/usr.sbin/pw/pw_user.c Directory Properties: user/adrian/if_ath_tx/ (props changed) user/adrian/if_ath_tx/cddl/contrib/opensolaris/ (props changed) user/adrian/if_ath_tx/contrib/compiler-rt/ (props changed) user/adrian/if_ath_tx/contrib/ee/ (props changed) user/adrian/if_ath_tx/contrib/expat/ (props changed) user/adrian/if_ath_tx/contrib/file/ (props changed) user/adrian/if_ath_tx/contrib/gdb/ (props changed) user/adrian/if_ath_tx/contrib/gnu-sort/ (props changed) user/adrian/if_ath_tx/contrib/groff/ (props changed) user/adrian/if_ath_tx/contrib/less/ (props changed) user/adrian/if_ath_tx/contrib/libpcap/ (props changed) user/adrian/if_ath_tx/contrib/ncurses/ (props changed) user/adrian/if_ath_tx/contrib/one-true-awk/ (props changed) user/adrian/if_ath_tx/contrib/openbsm/ (props changed) user/adrian/if_ath_tx/contrib/openpam/ (props changed) user/adrian/if_ath_tx/contrib/pf/ (props changed) user/adrian/if_ath_tx/contrib/tcpdump/ (props changed) user/adrian/if_ath_tx/contrib/tcsh/ (props changed) user/adrian/if_ath_tx/contrib/tnftp/ (props changed) user/adrian/if_ath_tx/contrib/tzcode/stdtime/ (props changed) user/adrian/if_ath_tx/contrib/tzcode/zic/ (props changed) user/adrian/if_ath_tx/contrib/tzdata/ (props changed) user/adrian/if_ath_tx/contrib/wpa/ (props changed) user/adrian/if_ath_tx/lib/libutil/ (props changed) user/adrian/if_ath_tx/lib/libz/ (props changed) user/adrian/if_ath_tx/sbin/ (props changed) user/adrian/if_ath_tx/sbin/ipfw/ (props changed) user/adrian/if_ath_tx/share/mk/bsd.arch.inc.mk (props changed) user/adrian/if_ath_tx/sys/contrib/dev/acpica/ (props changed) user/adrian/if_ath_tx/usr.bin/csup/ (props changed) user/adrian/if_ath_tx/usr.bin/procstat/ (props changed) user/adrian/if_ath_tx/usr.sbin/rtadvctl/ (props changed) user/adrian/if_ath_tx/usr.sbin/rtadvd/ (props changed) Modified: user/adrian/if_ath_tx/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- user/adrian/if_ath_tx/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/cddl/contrib/opensolaris/cmd/ztest/ztest.c Tue Aug 2 08:31:23 2011 (r224599) @@ -205,6 +205,7 @@ typedef struct ztest_od { */ typedef struct ztest_ds { objset_t *zd_os; + rwlock_t zd_zilog_lock; zilog_t *zd_zilog; uint64_t zd_seq; ztest_od_t *zd_od; /* debugging aid */ @@ -238,6 +239,7 @@ ztest_func_t ztest_dmu_commit_callbacks; ztest_func_t ztest_zap; ztest_func_t ztest_zap_parallel; ztest_func_t ztest_zil_commit; +ztest_func_t ztest_zil_remount; ztest_func_t ztest_dmu_read_write_zcopy; ztest_func_t ztest_dmu_objset_create_destroy; ztest_func_t ztest_dmu_prealloc; @@ -273,6 +275,7 @@ ztest_info_t ztest_info[] = { { ztest_zap_parallel, 100, &zopt_always }, { ztest_split_pool, 1, &zopt_always }, { ztest_zil_commit, 1, &zopt_incessant }, + { ztest_zil_remount, 1, &zopt_sometimes }, { ztest_dmu_read_write_zcopy, 1, &zopt_often }, { ztest_dmu_objset_create_destroy, 1, &zopt_often }, { ztest_dsl_prop_get_set, 1, &zopt_often }, @@ -986,6 +989,7 @@ ztest_zd_init(ztest_ds_t *zd, objset_t * zd->zd_seq = 0; dmu_objset_name(os, zd->zd_name); + VERIFY(rwlock_init(&zd->zd_zilog_lock, USYNC_THREAD, NULL) == 0); VERIFY(_mutex_init(&zd->zd_dirobj_lock, USYNC_THREAD, NULL) == 0); for (int l = 0; l < ZTEST_OBJECT_LOCKS; l++) @@ -1965,6 +1969,8 @@ ztest_io(ztest_ds_t *zd, uint64_t object if (ztest_random(2) == 0) io_type = ZTEST_IO_WRITE_TAG; + (void) rw_rdlock(&zd->zd_zilog_lock); + switch (io_type) { case ZTEST_IO_WRITE_TAG: @@ -2000,6 +2006,8 @@ ztest_io(ztest_ds_t *zd, uint64_t object break; } + (void) rw_unlock(&zd->zd_zilog_lock); + umem_free(data, blocksize); } @@ -2054,6 +2062,8 @@ ztest_zil_commit(ztest_ds_t *zd, uint64_ { zilog_t *zilog = zd->zd_zilog; + (void) rw_rdlock(&zd->zd_zilog_lock); + zil_commit(zilog, ztest_random(ZTEST_OBJECTS)); /* @@ -2065,6 +2075,31 @@ ztest_zil_commit(ztest_ds_t *zd, uint64_ ASSERT(zd->zd_seq <= zilog->zl_commit_lr_seq); zd->zd_seq = zilog->zl_commit_lr_seq; mutex_exit(&zilog->zl_lock); + + (void) rw_unlock(&zd->zd_zilog_lock); +} + +/* + * This function is designed to simulate the operations that occur during a + * mount/unmount operation. We hold the dataset across these operations in an + * attempt to expose any implicit assumptions about ZIL management. + */ +/* ARGSUSED */ +void +ztest_zil_remount(ztest_ds_t *zd, uint64_t id) +{ + objset_t *os = zd->zd_os; + + (void) rw_wrlock(&zd->zd_zilog_lock); + + /* zfsvfs_teardown() */ + zil_close(zd->zd_zilog); + + /* zfsvfs_setup() */ + VERIFY(zil_open(os, ztest_get_data) == zd->zd_zilog); + zil_replay(os, zd, ztest_replay_vector); + + (void) rw_unlock(&zd->zd_zilog_lock); } /* Modified: user/adrian/if_ath_tx/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- user/adrian/if_ath_tx/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Aug 2 08:31:23 2011 (r224599) @@ -4289,7 +4289,8 @@ zfs_jail(zfs_handle_t *zhp, int jailid, libzfs_handle_t *hdl = zhp->zfs_hdl; zfs_cmd_t zc = { 0 }; char errbuf[1024]; - int cmd, ret; + unsigned long cmd; + int ret; if (attach) { (void) snprintf(errbuf, sizeof (errbuf), Modified: user/adrian/if_ath_tx/contrib/bsnmp/snmp_usm/snmp_usm.3 ============================================================================== --- user/adrian/if_ath_tx/contrib/bsnmp/snmp_usm/snmp_usm.3 Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/contrib/bsnmp/snmp_usm/snmp_usm.3 Tue Aug 2 08:31:23 2011 (r224599) @@ -115,7 +115,7 @@ allowed. This column is used to create new USM user entries or delete existing ones from the table. .El -.EL +.El .Sh FILES .Bl -tag -width "XXXXXXXXX" .It Pa /usr/share/snmp/defs/usm_tree.def Modified: user/adrian/if_ath_tx/contrib/gcc/cp/ChangeLog ============================================================================== --- user/adrian/if_ath_tx/contrib/gcc/cp/ChangeLog Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/contrib/gcc/cp/ChangeLog Tue Aug 2 08:31:23 2011 (r224599) @@ -1,3 +1,9 @@ +2007-09-29 Jason Merrill + + PR c++/33094 + * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member + constant to not have DECL_EXTERNAL if it's file-local. + 2007-08-24 Jakub Jelinek PR c++/31941 Modified: user/adrian/if_ath_tx/contrib/gcc/cp/decl.c ============================================================================== --- user/adrian/if_ath_tx/contrib/gcc/cp/decl.c Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/contrib/gcc/cp/decl.c Tue Aug 2 08:31:23 2011 (r224599) @@ -4968,7 +4968,7 @@ make_rtl_for_nonlocal_decl (tree decl, t /* An in-class declaration of a static data member should be external; it is only a declaration, and not a definition. */ if (init == NULL_TREE) - gcc_assert (DECL_EXTERNAL (decl)); + gcc_assert (DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)); } /* We don't create any RTL for local variables. */ Modified: user/adrian/if_ath_tx/etc/rc.d/kld ============================================================================== --- user/adrian/if_ath_tx/etc/rc.d/kld Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/etc/rc.d/kld Tue Aug 2 08:31:23 2011 (r224599) @@ -41,24 +41,11 @@ kld_start() { [ -n "$kld_list" ] || return - local _kernel_path _module_path _kld _path - - _kernel_path=`$SYSCTL_N kern.bootfile` - _kernel_path="${_kernel_path%/*}" - - _module_path=`$SYSCTL_N kern.module_path` - _module_path="${_module_path#*\;}" - _module_path="$_kernel_path `ltr $_module_path \; ' '`" + local _kld echo 'Loading kernel modules:' for _kld in $kld_list ; do - for _path in $_module_path ; do - if [ -x "${_path}/${_kld}.ko" ]; then - load_kld -e ${_kld}.ko ${_path}/${_kld}.ko - continue 2 - fi - done - warn "${_kld}.ko not found in $_module_path" + load_kld -e ${_kld}.ko $_kld done } Modified: user/adrian/if_ath_tx/lib/libmemstat/libmemstat.3 ============================================================================== --- user/adrian/if_ath_tx/lib/libmemstat/libmemstat.3 Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/lib/libmemstat/libmemstat.3 Tue Aug 2 08:31:23 2011 (r224599) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 27, 2005 +.Dd July 21, 2011 .Dt LIBMEMSTAT 3 .Os .Sh NAME @@ -412,10 +412,6 @@ values of .Er EACCES or .Er EPERM . -.It Dv MEMSTAT_ERROR_TOOMANYCPUS -Returned if the compile-time limit on the number of CPUs in -.Nm -is lower than the number of CPUs returned by a statistics data source. .It Dv MEMSTAT_ERROR_DATAERROR Returned if .Nm Modified: user/adrian/if_ath_tx/lib/libmemstat/memstat.c ============================================================================== --- user/adrian/if_ath_tx/lib/libmemstat/memstat.c Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/lib/libmemstat/memstat.c Tue Aug 2 08:31:23 2011 (r224599) @@ -49,8 +49,6 @@ memstat_strerror(int error) return ("Version mismatch"); case MEMSTAT_ERROR_PERMISSION: return ("Permission denied"); - case MEMSTAT_ERROR_TOOMANYCPUS: - return ("Too many CPUs"); case MEMSTAT_ERROR_DATAERROR: return ("Data format error"); case MEMSTAT_ERROR_KVM: @@ -99,6 +97,8 @@ _memstat_mtl_empty(struct memory_type_li struct memory_type *mtp; while ((mtp = LIST_FIRST(&list->mtl_list))) { + free(mtp->mt_percpu_alloc); + free(mtp->mt_percpu_cache); LIST_REMOVE(mtp, mt_list); free(mtp); } @@ -147,7 +147,7 @@ memstat_mtl_find(struct memory_type_list */ struct memory_type * _memstat_mt_allocate(struct memory_type_list *list, int allocator, - const char *name) + const char *name, int maxcpus) { struct memory_type *mtp; @@ -158,6 +158,10 @@ _memstat_mt_allocate(struct memory_type_ bzero(mtp, sizeof(*mtp)); mtp->mt_allocator = allocator; + mtp->mt_percpu_alloc = malloc(sizeof(struct mt_percpu_alloc_s) * + maxcpus); + mtp->mt_percpu_cache = malloc(sizeof(struct mt_percpu_cache_s) * + maxcpus); strlcpy(mtp->mt_name, name, MEMTYPE_MAXNAME); LIST_INSERT_HEAD(&list->mtl_list, mtp, mt_list); return (mtp); @@ -171,7 +175,7 @@ _memstat_mt_allocate(struct memory_type_ * libmemstat(3) internal function. */ void -_memstat_mt_reset_stats(struct memory_type *mtp) +_memstat_mt_reset_stats(struct memory_type *mtp, int maxcpus) { int i; @@ -193,7 +197,7 @@ _memstat_mt_reset_stats(struct memory_ty mtp->mt_zonefree = 0; mtp->mt_kegfree = 0; - for (i = 0; i < MEMSTAT_MAXCPU; i++) { + for (i = 0; i < maxcpus; i++) { mtp->mt_percpu_alloc[i].mtp_memalloced = 0; mtp->mt_percpu_alloc[i].mtp_memfreed = 0; mtp->mt_percpu_alloc[i].mtp_numallocs = 0; Modified: user/adrian/if_ath_tx/lib/libmemstat/memstat.h ============================================================================== --- user/adrian/if_ath_tx/lib/libmemstat/memstat.h Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/lib/libmemstat/memstat.h Tue Aug 2 08:31:23 2011 (r224599) @@ -30,12 +30,6 @@ #define _MEMSTAT_H_ /* - * Number of CPU slots in library-internal data structures. This should be - * at least the value of MAXCPU from param.h. - */ -#define MEMSTAT_MAXCPU 32 - -/* * Amount of caller data to maintain for each caller data slot. Applications * must not request more than this number of caller save data, or risk * corrupting internal libmemstat(3) data structures. A compile time check @@ -70,7 +64,6 @@ #define MEMSTAT_ERROR_NOMEMORY 1 /* Out of memory. */ #define MEMSTAT_ERROR_VERSION 2 /* Unsupported version. */ #define MEMSTAT_ERROR_PERMISSION 3 /* Permission denied. */ -#define MEMSTAT_ERROR_TOOMANYCPUS 4 /* Too many CPUs. */ #define MEMSTAT_ERROR_DATAERROR 5 /* Error in stat data. */ #define MEMSTAT_ERROR_KVM 6 /* See kvm_geterr() for err. */ #define MEMSTAT_ERROR_KVM_NOSYMBOL 7 /* Symbol not available. */ Modified: user/adrian/if_ath_tx/lib/libmemstat/memstat_internal.h ============================================================================== --- user/adrian/if_ath_tx/lib/libmemstat/memstat_internal.h Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/lib/libmemstat/memstat_internal.h Tue Aug 2 08:31:23 2011 (r224599) @@ -92,7 +92,7 @@ struct memory_type { * Per-CPU measurements fall into two categories: per-CPU allocation, * and per-CPU cache state. */ - struct { + struct mt_percpu_alloc_s { uint64_t mtp_memalloced;/* Per-CPU mt_memalloced. */ uint64_t mtp_memfreed; /* Per-CPU mt_memfreed. */ uint64_t mtp_numallocs; /* Per-CPU mt_numallocs. */ @@ -100,11 +100,11 @@ struct memory_type { uint64_t mtp_sizemask; /* Per-CPU mt_sizemask. */ void *mtp_caller_pointer[MEMSTAT_MAXCALLER]; uint64_t mtp_caller_uint64[MEMSTAT_MAXCALLER]; - } mt_percpu_alloc[MEMSTAT_MAXCPU]; + } *mt_percpu_alloc; - struct { + struct mt_percpu_cache_s { uint64_t mtp_free; /* Per-CPU cache free items. */ - } mt_percpu_cache[MEMSTAT_MAXCPU]; + } *mt_percpu_cache; LIST_ENTRY(memory_type) mt_list; /* List of types. */ }; @@ -119,7 +119,8 @@ struct memory_type_list { void _memstat_mtl_empty(struct memory_type_list *list); struct memory_type *_memstat_mt_allocate(struct memory_type_list *list, - int allocator, const char *name); -void _memstat_mt_reset_stats(struct memory_type *mtp); + int allocator, const char *name, int maxcpus); +void _memstat_mt_reset_stats(struct memory_type *mtp, + int maxcpus); #endif /* !_MEMSTAT_INTERNAL_H_ */ Modified: user/adrian/if_ath_tx/lib/libmemstat/memstat_malloc.c ============================================================================== --- user/adrian/if_ath_tx/lib/libmemstat/memstat_malloc.c Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/lib/libmemstat/memstat_malloc.c Tue Aug 2 08:31:23 2011 (r224599) @@ -96,11 +96,6 @@ retry: return (-1); } - if (maxcpus > MEMSTAT_MAXCPU) { - list->mtl_error = MEMSTAT_ERROR_TOOMANYCPUS; - return (-1); - } - size = sizeof(count); if (sysctlbyname("kern.malloc_count", &count, &size, NULL, 0) < 0) { if (errno == EACCES || errno == EPERM) @@ -160,12 +155,6 @@ retry: return (-1); } - if (mtshp->mtsh_maxcpus > MEMSTAT_MAXCPU) { - list->mtl_error = MEMSTAT_ERROR_TOOMANYCPUS; - free(buffer); - return (-1); - } - /* * For the remainder of this function, we are quite trusting about * the layout of structures and sizes, since we've determined we have @@ -184,7 +173,7 @@ retry: mtp = NULL; if (mtp == NULL) mtp = _memstat_mt_allocate(list, ALLOCATOR_MALLOC, - mthp->mth_name); + mthp->mth_name, maxcpus); if (mtp == NULL) { _memstat_mtl_empty(list); free(buffer); @@ -195,7 +184,7 @@ retry: /* * Reset the statistics on a current node. */ - _memstat_mt_reset_stats(mtp); + _memstat_mt_reset_stats(mtp, maxcpus); for (j = 0; j < maxcpus; j++) { mtsp = (struct malloc_type_stats *)p; @@ -295,7 +284,7 @@ memstat_kvm_malloc(struct memory_type_li void *kmemstatistics; int hint_dontsearch, j, mp_maxcpus, ret; char name[MEMTYPE_MAXNAME]; - struct malloc_type_stats mts[MEMSTAT_MAXCPU], *mtsp; + struct malloc_type_stats *mts, *mtsp; struct malloc_type_internal *mtip; struct malloc_type type, *typep; kvm_t *kvm; @@ -322,11 +311,6 @@ memstat_kvm_malloc(struct memory_type_li return (-1); } - if (mp_maxcpus > MEMSTAT_MAXCPU) { - list->mtl_error = MEMSTAT_ERROR_TOOMANYCPUS; - return (-1); - } - ret = kread_symbol(kvm, X_KMEMSTATISTICS, &kmemstatistics, sizeof(kmemstatistics), 0); if (ret != 0) { @@ -334,10 +318,17 @@ memstat_kvm_malloc(struct memory_type_li return (-1); } + mts = malloc(sizeof(struct malloc_type_stats) * mp_maxcpus); + if (mts == NULL) { + list->mtl_error = MEMSTAT_ERROR_NOMEMORY; + return (-1); + } + for (typep = kmemstatistics; typep != NULL; typep = type.ks_next) { ret = kread(kvm, typep, &type, sizeof(type), 0); if (ret != 0) { _memstat_mtl_empty(list); + free(mts); list->mtl_error = ret; return (-1); } @@ -345,6 +336,7 @@ memstat_kvm_malloc(struct memory_type_li MEMTYPE_MAXNAME); if (ret != 0) { _memstat_mtl_empty(list); + free(mts); list->mtl_error = ret; return (-1); } @@ -358,6 +350,7 @@ memstat_kvm_malloc(struct memory_type_li sizeof(struct malloc_type_stats), 0); if (ret != 0) { _memstat_mtl_empty(list); + free(mts); list->mtl_error = ret; return (-1); } @@ -368,9 +361,10 @@ memstat_kvm_malloc(struct memory_type_li mtp = NULL; if (mtp == NULL) mtp = _memstat_mt_allocate(list, ALLOCATOR_MALLOC, - name); + name, mp_maxcpus); if (mtp == NULL) { _memstat_mtl_empty(list); + free(mts); list->mtl_error = MEMSTAT_ERROR_NOMEMORY; return (-1); } @@ -379,7 +373,7 @@ memstat_kvm_malloc(struct memory_type_li * This logic is replicated from kern_malloc.c, and should * be kept in sync. */ - _memstat_mt_reset_stats(mtp); + _memstat_mt_reset_stats(mtp, mp_maxcpus); for (j = 0; j < mp_maxcpus; j++) { mtsp = &mts[j]; mtp->mt_memalloced += mtsp->mts_memalloced; Modified: user/adrian/if_ath_tx/lib/libmemstat/memstat_uma.c ============================================================================== --- user/adrian/if_ath_tx/lib/libmemstat/memstat_uma.c Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/lib/libmemstat/memstat_uma.c Tue Aug 2 08:31:23 2011 (r224599) @@ -79,7 +79,7 @@ memstat_sysctl_uma(struct memory_type_li struct uma_type_header *uthp; struct uma_percpu_stat *upsp; struct memory_type *mtp; - int count, hint_dontsearch, i, j, maxcpus; + int count, hint_dontsearch, i, j, maxcpus, maxid; char *buffer, *p; size_t size; @@ -93,24 +93,19 @@ memstat_sysctl_uma(struct memory_type_li * from the header. */ retry: - size = sizeof(maxcpus); - if (sysctlbyname("kern.smp.maxcpus", &maxcpus, &size, NULL, 0) < 0) { + size = sizeof(maxid); + if (sysctlbyname("kern.smp.maxid", &maxid, &size, NULL, 0) < 0) { if (errno == EACCES || errno == EPERM) list->mtl_error = MEMSTAT_ERROR_PERMISSION; else list->mtl_error = MEMSTAT_ERROR_DATAERROR; return (-1); } - if (size != sizeof(maxcpus)) { + if (size != sizeof(maxid)) { list->mtl_error = MEMSTAT_ERROR_DATAERROR; return (-1); } - if (maxcpus > MEMSTAT_MAXCPU) { - list->mtl_error = MEMSTAT_ERROR_TOOMANYCPUS; - return (-1); - } - size = sizeof(count); if (sysctlbyname("vm.zone_count", &count, &size, NULL, 0) < 0) { if (errno == EACCES || errno == EPERM) @@ -125,7 +120,7 @@ retry: } size = sizeof(*uthp) + count * (sizeof(*uthp) + sizeof(*upsp) * - maxcpus); + (maxid + 1)); buffer = malloc(size); if (buffer == NULL) { @@ -170,12 +165,6 @@ retry: return (-1); } - if (ushp->ush_maxcpus > MEMSTAT_MAXCPU) { - list->mtl_error = MEMSTAT_ERROR_TOOMANYCPUS; - free(buffer); - return (-1); - } - /* * For the remainder of this function, we are quite trusting about * the layout of structures and sizes, since we've determined we have @@ -194,7 +183,7 @@ retry: mtp = NULL; if (mtp == NULL) mtp = _memstat_mt_allocate(list, ALLOCATOR_UMA, - uthp->uth_name); + uthp->uth_name, maxid + 1); if (mtp == NULL) { _memstat_mtl_empty(list); free(buffer); @@ -205,7 +194,7 @@ retry: /* * Reset the statistics on a current node. */ - _memstat_mt_reset_stats(mtp); + _memstat_mt_reset_stats(mtp, maxid + 1); mtp->mt_numallocs = uthp->uth_allocs; mtp->mt_numfrees = uthp->uth_frees; @@ -398,7 +387,7 @@ memstat_kvm_uma(struct memory_type_list mtp = NULL; if (mtp == NULL) mtp = _memstat_mt_allocate(list, ALLOCATOR_UMA, - name); + name, mp_maxid + 1); if (mtp == NULL) { free(ucp_array); _memstat_mtl_empty(list); @@ -408,7 +397,7 @@ memstat_kvm_uma(struct memory_type_list /* * Reset the statistics on a current node. */ - _memstat_mt_reset_stats(mtp); + _memstat_mt_reset_stats(mtp, mp_maxid + 1); mtp->mt_numallocs = uz.uz_allocs; mtp->mt_numfrees = uz.uz_frees; mtp->mt_failures = uz.uz_fails; Modified: user/adrian/if_ath_tx/lib/libusbhid/parse.c ============================================================================== --- user/adrian/if_ath_tx/lib/libusbhid/parse.c Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/lib/libusbhid/parse.c Tue Aug 2 08:31:23 2011 (r224599) @@ -322,6 +322,8 @@ hid_get_item(hid_data_t s, hid_item_t *h * one and one item: */ c->report_count = 1; + c->usage_minimum = 0; + c->usage_maximum = 0; } else { s->ncount = 1; } @@ -512,13 +514,14 @@ hid_report_size(report_desc_t r, enum hi uint32_t temp; uint32_t hpos; uint32_t lpos; + int report_id = 0; hpos = 0; lpos = 0xFFFFFFFF; memset(&h, 0, sizeof h); for (d = hid_start_parse(r, 1 << k, id); hid_get_item(d, &h); ) { - if (h.report_ID == id && h.kind == k) { + if ((h.report_ID == id || id < 0) && h.kind == k) { /* compute minimum */ if (lpos > h.pos) lpos = h.pos; @@ -527,6 +530,8 @@ hid_report_size(report_desc_t r, enum hi /* compute maximum */ if (hpos < temp) hpos = temp; + if (h.report_ID != 0) + report_id = 1; } } hid_end_parse(d); @@ -537,11 +542,8 @@ hid_report_size(report_desc_t r, enum hi else temp = hpos - lpos; - if (id) - temp += 8; - /* return length in bytes rounded up */ - return ((temp + 7) / 8); + return ((temp + 7) / 8 + report_id); } int Modified: user/adrian/if_ath_tx/libexec/tftpd/tftp-transfer.c ============================================================================== --- user/adrian/if_ath_tx/libexec/tftpd/tftp-transfer.c Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/libexec/tftpd/tftp-transfer.c Tue Aug 2 08:31:23 2011 (r224599) @@ -129,14 +129,16 @@ tftp_send(int peer, uint16_t *block, str (*block)++; if (oldblock > *block) { if (options[OPT_ROLLOVER].o_request == NULL) { - tftp_log(LOG_ERR, - "Block rollover but not allowed."); - send_error(peer, EBADOP); - gettimeofday(&(ts->tstop), NULL); - return; + /* + * "rollover" option not specified in + * tftp client. Default to rolling block + * counter to 0. + */ + *block = 0; + } else { + *block = atoi(options[OPT_ROLLOVER].o_request); } - *block = atoi(options[OPT_ROLLOVER].o_request); ts->rollovers++; } gettimeofday(&(ts->tstop), NULL); @@ -196,14 +198,16 @@ tftp_receive(int peer, uint16_t *block, (*block)++; if (oldblock > *block) { if (options[OPT_ROLLOVER].o_request == NULL) { - tftp_log(LOG_ERR, - "Block rollover but not allowed."); - send_error(peer, EBADOP); - gettimeofday(&(ts->tstop), NULL); - return; + /* + * "rollover" option not specified in + * tftp client. Default to rolling block + * counter to 0. + */ + *block = 0; + } else { + *block = atoi(options[OPT_ROLLOVER].o_request); } - *block = atoi(options[OPT_ROLLOVER].o_request); ts->rollovers++; } Modified: user/adrian/if_ath_tx/libexec/tftpd/tftpd.8 ============================================================================== --- user/adrian/if_ath_tx/libexec/tftpd/tftpd.8 Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/libexec/tftpd/tftpd.8 Tue Aug 2 08:31:23 2011 (r224599) @@ -300,8 +300,15 @@ and .Xr tftp 1 code to support RFC2348. .Sh NOTES -Files larger than 33488896 octets (65535 blocks) cannot be transferred -without client and server supporting the TFTP blocksize option (RFC2348), +Files larger than 33,553,919 octets (65535 blocks, last one <512 +octets) cannot be correctly transferred without client and server +supporting blocksize negotiation (RFCs 2347 and 2348), or the non-standard TFTP rollover option. +As a kludge, +.Nm +accepts a sequence of block number which wrap to zero after 65535, +even if the rollover option is not specified. .Pp -Many tftp clients will not transfer files over 16744448 octets (32767 blocks). +Many tftp clients will not transfer files over 16,776,703 octets +(32767 blocks), as they incorrectly count the block number using +a signed rather than unsigned 16-bit integer. Modified: user/adrian/if_ath_tx/release/amd64/make-memstick.sh ============================================================================== --- user/adrian/if_ath_tx/release/amd64/make-memstick.sh Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/release/amd64/make-memstick.sh Tue Aug 2 08:31:23 2011 (r224599) @@ -32,7 +32,7 @@ if [ -e ${2} ]; then exit 1 fi -echo '/dev/gpt/FreeBSD_Install / ufs rw,noatime 1 1' > ${1}/etc/fstab +echo '/dev/gpt/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab rm -f ${tempfile} makefs -B little ${tempfile} ${1} if [ $? -ne 0 ]; then Modified: user/adrian/if_ath_tx/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- user/adrian/if_ath_tx/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/release/doc/en_US.ISO8859-1/hardware/article.sgml Tue Aug 2 08:31:23 2011 (r224599) @@ -195,11 +195,9 @@ resources between logical processors within the same CPU. Because this naive scheduling can result in suboptimal performance, under certain circumstances it may be useful to - disable the logical processors with the the - machdep.hlt_logical_cpus sysctl variable. - It is also possible to halt any CPU in the idle loop with the - machdep.hlt_cpus sysctl variable. The - &man.smp.4; manual page has more details. + disable the logical processors with the + machdep.hyperthreading_allowed tunable. + The &man.smp.4; manual page has more details. &os; will take advantage of Physical Address Extensions (PAE) support on CPUs that support this feature. A kernel Modified: user/adrian/if_ath_tx/release/i386/make-memstick.sh ============================================================================== --- user/adrian/if_ath_tx/release/i386/make-memstick.sh Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/release/i386/make-memstick.sh Tue Aug 2 08:31:23 2011 (r224599) @@ -32,7 +32,7 @@ if [ -e ${2} ]; then exit 1 fi -echo '/dev/gpt/FreeBSD_Install / ufs rw,noatime 1 1' > ${1}/etc/fstab +echo '/dev/gpt/FreeBSD_Install / ufs ro,noatime 1 1' > ${1}/etc/fstab rm -f ${tempfile} makefs -B little ${tempfile} ${1} if [ $? -ne 0 ]; then Modified: user/adrian/if_ath_tx/release/powerpc/make-memstick.sh ============================================================================== --- user/adrian/if_ath_tx/release/powerpc/make-memstick.sh Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/release/powerpc/make-memstick.sh Tue Aug 2 08:31:23 2011 (r224599) @@ -32,7 +32,7 @@ if [ -e ${2} ]; then exit 1 fi -echo '/dev/da0s3 / ufs rw,noatime 1 1' > ${1}/etc/fstab +echo '/dev/da0s3 / ufs ro,noatime 1 1' > ${1}/etc/fstab rm -f ${tempfile} makefs -B big ${tempfile} ${1} if [ $? -ne 0 ]; then Modified: user/adrian/if_ath_tx/sbin/mount/mount.c ============================================================================== --- user/adrian/if_ath_tx/sbin/mount/mount.c Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/sbin/mount/mount.c Tue Aug 2 08:31:23 2011 (r224599) @@ -109,6 +109,7 @@ static struct opt { { MNT_NOCLUSTERW, "noclusterw" }, { MNT_SUIDDIR, "suiddir" }, { MNT_SOFTDEP, "soft-updates" }, + { MNT_SUJ, "journaled soft-updates" }, { MNT_MULTILABEL, "multilabel" }, { MNT_ACLS, "acls" }, { MNT_NFS4ACLS, "nfsv4acls" }, Modified: user/adrian/if_ath_tx/share/man/man4/dc.4 ============================================================================== --- user/adrian/if_ath_tx/share/man/man4/dc.4 Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/share/man/man4/dc.4 Tue Aug 2 08:31:23 2011 (r224599) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt DC 4 .Os .Sh NAME @@ -357,7 +357,7 @@ the card should be configured correctly. .Re .Rs .%T Davicom DM9102 data sheet -.%U http://www.davicom8.com +.%U http://www.davicom.com.tw/userfile/24247/DM9102H-DS-F01-021508.pdf .Re .Rs .%T Intel 21143 Hardware Reference Manual Modified: user/adrian/if_ath_tx/share/man/man4/gif.4 ============================================================================== --- user/adrian/if_ath_tx/share/man/man4/gif.4 Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/share/man/man4/gif.4 Tue Aug 2 08:31:23 2011 (r224599) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd August 1, 2011 .Dt GIF 4 .Os .Sh NAME @@ -198,7 +198,7 @@ to 1. .%B RFC2893 .%T Transition Mechanisms for IPv6 Hosts and Routers .%D August 2000 -.%U ftp://ftp.isi.edu/in-notes/rfc2893.txt +.%U http://tools.ietf.org/html/rfc2893 .Re .Rs .%A Sally Floyd Modified: user/adrian/if_ath_tx/share/man/man4/hptiop.4 ============================================================================== --- user/adrian/if_ath_tx/share/man/man4/hptiop.4 Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/share/man/man4/hptiop.4 Tue Aug 2 08:31:23 2011 (r224599) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 12, 2007 +.Dd August 1, 2011 .Dt HPTIOP 4 .Os .Sh NAME @@ -60,6 +60,10 @@ driver supports the following SAS and SA .It HighPoint RocketRAID 4320 .It +HighPoint RocketRAID 4321 +.It +HighPoint RocketRAID 4322 +.It HighPoint RocketRAID 3220 .It HighPoint RocketRAID 3320 Modified: user/adrian/if_ath_tx/share/man/man4/lmc.4 ============================================================================== --- user/adrian/if_ath_tx/share/man/man4/lmc.4 Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/share/man/man4/lmc.4 Tue Aug 2 08:31:23 2011 (r224599) @@ -43,7 +43,7 @@ .\" this program; if not, write to the Free Software Foundation, Inc., 59 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" -.Dd May 20, 2006 +.Dd July 23, 2011 .Dt LMC 4 .Os .\" @@ -723,8 +723,6 @@ Thus, cable length does not affect data/ .Xr ngctl 8 , .Xr ping 8 , .Xr ifnet 9 -.Pp -.Pa http://www.sbei.com/ .\" .Sh HISTORY .\" Modified: user/adrian/if_ath_tx/share/man/man4/mpt.4 ============================================================================== --- user/adrian/if_ath_tx/share/man/man4/mpt.4 Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/share/man/man4/mpt.4 Tue Aug 2 08:31:23 2011 (r224599) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2010 +.Dd July 23, 2011 .Dt MPT 4 .Os .Sh NAME @@ -161,7 +161,7 @@ can take on - no separate compilation is .Xr gmultipath 8 .Rs .%T "LSI Logic Website" -.%U http://www.lsilogic.com/ +.%U http://www.lsi.com/ .Re .Sh HISTORY The Modified: user/adrian/if_ath_tx/share/man/man4/pcm.4 ============================================================================== --- user/adrian/if_ath_tx/share/man/man4/pcm.4 Tue Aug 2 08:09:12 2011 (r224598) +++ user/adrian/if_ath_tx/share/man/man4/pcm.4 Tue Aug 2 08:31:23 2011 (r224599) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 1998, Luigi Rizzo +.\" Copyright (c) 2009-2011 Joel Dahl .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 13, 2009 +.Dd July 31, 2011 .Dt SOUND 4 .Os .Sh NAME @@ -41,7 +41,122 @@ kernel configuration file: .Bd -ragged -offset indent .Cd "device sound" .Ed +.Sh DESCRIPTION +The +.Nm +driver is the main component of the +.Fx +sound system. +It works in conjunction with a bridge device driver on supported devices +and provides PCM audio record and playback once it attaches. +Each bridge device driver supports a specific set of audio chipsets and +needs to be enabled together with the +.Nm +driver. +PCI and ISA PnP audio devices identify themselves so users are usually not +required to add anything to +.Pa /boot/device.hints . +.Pp +Some of the main features of the +.Nm +driver are: multichannel audio, per-application +volume control, dynamic mixing through virtual sound channels, true full +duplex operation, bit perfect audio, rate conversion and low latency +modes. +.Pp +The +.Nm +driver is enabled by default, along with several bridge device drivers. +Those not enabled by default can be loaded during runtime with +.Xr kldload 8 +or during boot via +.Xr loader.conf 5 . +The following bridge device drivers are available: +.Pp +.Bl -bullet -compact +.It +.Xr snd_ad1816 4 +.It +.Xr snd_ai2s 4 (enabled by default on powerpc) +.It +.Xr snd_als4000 4 +.It +.Xr snd_atiixp 4 +.It +.Xr snd_audiocs 4 (enabled by default on sparc64) +.It +.Xr snd_cmi 4 +.It +.Xr snd_cs4281 4 +.It +.Xr snd_csa 4 +.It +.Xr snd_davbus 4 (enabled by default on powerpc) +.It +.Xr snd_ds1 4 +.It +.Xr snd_emu10k1 4 +.It +.Xr snd_emu10kx 4 +.It +.Xr snd_envy24 4 +.It +.Xr snd_envy24ht 4 +.It +.Xr snd_es137x 4 (enabled by default on amd64, i386, sparc64) +.It +.Xr snd_ess 4 +.It +.Xr snd_fm801 4 +.It +.Xr snd_gusc 4 +.It +.Xr snd_hda 4 (enabled by default on amd64, i386) +.It +.Xr snd_ich 4 (enabled by default on amd64, i386) +.It +.Xr snd_maestro 4 +.It +.Xr snd_maestro3 4 +.It +.Xr snd_mss 4 +.It +.Xr snd_neomagic 4 +.It +snd_sb16 +.It +snd_sb8 +.It +.Xr snd_sbc 4 +.It +.Xr snd_solo 4 +.It +.Xr snd_spicds 4 +.It +.Xr snd_t4dwave 4 (enabled by default on sparc64) +.It +.Xr snd_uaudio 4 (enabled by default on amd64, i386, powerpc, sparc64) +.It +.Xr snd_via8233 4 (enabled by default on amd64, i386) +.It +.Xr snd_via82c686 4 +.It +.Xr snd_vibes 4 +.El .Pp +Refer to the manual page for each bridge device driver for driver specific +settings and information. +.Ss Legacy Hardware +For old legacy +.Tn ISA +cards, the driver looks for +.Tn MSS +cards at addresses +.Dv 0x530 +and +.Dv 0x604 . +These values can be overridden in +.Pa /boot/device.hints . Non-PnP sound cards require the following lines in .Xr device.hints 5 : .Bd -literal -offset indent @@ -50,33 +165,6 @@ hint.pcm.0.irq="5" hint.pcm.0.drq="1" hint.pcm.0.flags="0x0" .Ed -.Sh DESCRIPTION -The -.Nm -driver provides support for -.Tn PCM -audio play and capture. -This driver also supports various -.Tn PCI , -.Tn ISA , -.Tn WSS/MSS -compatible -sound cards, AC97 mixer and High Definition Audio. -Once the -.Nm -driver attaches, supported devices provide audio record and -playback channels. -The -.Fx -sound system provides dynamic mixing -.Dq VCHAN -and rate conversion -.Dq soft formats . -True full duplex operation is available on most sound cards. -.Pp -If the sound card is supported by a bridge driver, the -.Nm -driver works in conjunction with the bridge driver. .Pp Apart from the usual parameters, the flags field is used to specify the secondary @@ -85,24 +173,6 @@ channel (generally used for capture in f Flags are set to 0 for cards not using a secondary .Tn DMA channel, or to 0x10 + C to specify channel C. -.Pp -The driver does its best to recognize the installed hardware and drive -it correctly so the user is not required to add several lines in -.Pa /boot/device.hints . -For -.Tn PCI -and -.Tn ISA -.Tn PnP -cards this is actually easy -since they identify themselves. -For legacy -.Tn ISA -cards, the driver looks for -.Tn MSS *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Wed Aug 3 01:33:34 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70926106564A; Wed, 3 Aug 2011 01:33:34 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F92C8FC15; Wed, 3 Aug 2011 01:33:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p731XYh2079725; Wed, 3 Aug 2011 01:33:34 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p731XY6N079716; Wed, 3 Aug 2011 01:33:34 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201108030133.p731XY6N079716@svn.freebsd.org> From: Hiroki Sato Date: Wed, 3 Aug 2011 01:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224619 - in user/hrs/ipv6/usr.sbin: rtadvctl rtadvd X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 01:33:34 -0000 Author: hrs Date: Wed Aug 3 01:33:34 2011 New Revision: 224619 URL: http://svn.freebsd.org/changeset/base/224619 Log: s/cmsg_/cm_/ to avoid conflict with CMSG_* symbols for struct cmsghdr. Modified: user/hrs/ipv6/usr.sbin/rtadvctl/rtadvctl.c user/hrs/ipv6/usr.sbin/rtadvd/control.c user/hrs/ipv6/usr.sbin/rtadvd/control.h user/hrs/ipv6/usr.sbin/rtadvd/control_client.c user/hrs/ipv6/usr.sbin/rtadvd/control_client.h user/hrs/ipv6/usr.sbin/rtadvd/control_server.c user/hrs/ipv6/usr.sbin/rtadvd/control_server.h user/hrs/ipv6/usr.sbin/rtadvd/rtadvd.c Modified: user/hrs/ipv6/usr.sbin/rtadvctl/rtadvctl.c ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvctl/rtadvctl.c Tue Aug 2 23:49:23 2011 (r224618) +++ user/hrs/ipv6/usr.sbin/rtadvctl/rtadvctl.c Wed Aug 3 01:33:34 2011 (r224619) @@ -260,13 +260,13 @@ action_plgeneric(int action, char *plstr *q++ = '\0'; cp.cp_val = q; } - cm->cm_len += cmsg_pl2bin(msg, &cp); + cm->cm_len += cm_pl2bin(msg, &cp); mysyslog(LOG_DEBUG, "<%s> key=%s, val_len=%d, ifname=%s", __func__,cp.cp_key, cp.cp_val_len, cp.cp_ifname); } - return (cmsg_handler_client(s->si_fd, CM_STATE_MSG_DISPATCH, buf)); + return (cm_handler_client(s->si_fd, CM_STATE_MSG_DISPATCH, buf)); } static int @@ -285,7 +285,7 @@ action_propget(char *argv, struct ctrl_m if (error || cm->cm_len <= sizeof(*cm)) return (1); - cmsg_bin2pl(msg, cp); + cm_bin2pl(msg, cp); mysyslog(LOG_DEBUG, "<%s> type=%d, len=%d", __func__, cm->cm_type, cm->cm_len); mysyslog(LOG_DEBUG, "<%s> key=%s, val_len=%d, ifname=%s", Modified: user/hrs/ipv6/usr.sbin/rtadvd/control.c ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvd/control.c Tue Aug 2 23:49:23 2011 (r224618) +++ user/hrs/ipv6/usr.sbin/rtadvd/control.c Wed Aug 3 01:33:34 2011 (r224619) @@ -54,10 +54,10 @@ #include "pathnames.h" #include "control.h" -#define CMSG_RECV_TIMEOUT 30 +#define CM_RECV_TIMEOUT 30 int -cmsg_recv(int fd, char *buf) +cm_recv(int fd, char *buf) { int n; struct ctrl_msg_hdr *cm; @@ -76,7 +76,7 @@ cmsg_recv(int fd, char *buf) for (;;) { i = poll(pfds, sizeof(pfds)/sizeof(pfds[0]), - CMSG_RECV_TIMEOUT); + CM_RECV_TIMEOUT); if (i == 0) continue; @@ -101,22 +101,22 @@ cmsg_recv(int fd, char *buf) if (n != sizeof(*cm)) { syslog(LOG_WARNING, "<%s> received a too small message.", __func__); - goto cmsg_recv_err; + goto cm_recv_err; } if (cm->cm_len > CM_MSG_MAXLEN) { syslog(LOG_WARNING, "<%s> received a too large message.", __func__); - goto cmsg_recv_err; + goto cm_recv_err; } if (cm->cm_version != CM_VERSION) { syslog(LOG_WARNING, "<%s> version mismatch", __func__); - goto cmsg_recv_err; + goto cm_recv_err; } if (cm->cm_type >= CM_TYPE_MAX) { syslog(LOG_WARNING, "<%s> invalid msg type.", __func__); - goto cmsg_recv_err; + goto cm_recv_err; } syslog(LOG_DEBUG, @@ -132,7 +132,7 @@ cmsg_recv(int fd, char *buf) for (;;) { i = poll(pfds, sizeof(pfds)/sizeof(pfds[0]), - CMSG_RECV_TIMEOUT); + CM_RECV_TIMEOUT); if (i == 0) continue; @@ -156,20 +156,20 @@ cmsg_recv(int fd, char *buf) if (n != msglen) { syslog(LOG_WARNING, "<%s> payload size mismatch.", __func__); - goto cmsg_recv_err; + goto cm_recv_err; } buf[CM_MSG_MAXLEN - 1] = '\0'; } return (0); -cmsg_recv_err: +cm_recv_err: close(fd); return (-1); } int -cmsg_send(int fd, char *buf) +cm_send(int fd, char *buf) { struct iovec iov[2]; int iovcnt; @@ -340,7 +340,7 @@ csock_open_err: } struct ctrl_msg_pl * -cmsg_bin2pl(char *str, struct ctrl_msg_pl *cp) +cm_bin2pl(char *str, struct ctrl_msg_pl *cp) { size_t len; size_t *lenp; @@ -400,7 +400,7 @@ cmsg_bin2pl(char *str, struct ctrl_msg_p } size_t -cmsg_pl2bin(char *str, struct ctrl_msg_pl *cp) +cm_pl2bin(char *str, struct ctrl_msg_pl *cp) { size_t len; size_t *lenp; @@ -463,7 +463,7 @@ cmsg_pl2bin(char *str, struct ctrl_msg_p } size_t -cmsg_str2bin(char *bin, void *str, size_t len) +cm_str2bin(char *bin, void *str, size_t len) { struct ctrl_msg_hdr *cm; @@ -481,7 +481,7 @@ cmsg_str2bin(char *bin, void *str, size_ } void * -cmsg_bin2str(char *bin, void *str, size_t len) +cm_bin2str(char *bin, void *str, size_t len) { syslog(LOG_DEBUG, "<%s> enter", __func__); Modified: user/hrs/ipv6/usr.sbin/rtadvd/control.h ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvd/control.h Tue Aug 2 23:49:23 2011 (r224618) +++ user/hrs/ipv6/usr.sbin/rtadvd/control.h Wed Aug 3 01:33:34 2011 (r224619) @@ -65,10 +65,10 @@ int csock_open(struct sockinfo *, mode_t int csock_close(struct sockinfo *); int csock_listen(struct sockinfo *); int csock_accept(struct sockinfo *); -int cmsg_send(int, char *); -int cmsg_recv(int, char *); +int cm_send(int, char *); +int cm_recv(int, char *); -size_t cmsg_pl2bin(char *, struct ctrl_msg_pl *); -struct ctrl_msg_pl *cmsg_bin2pl(char *, struct ctrl_msg_pl *); -size_t cmsg_str2bin(char *, void *, size_t); -void *cmsg_bin2str(char *, void *, size_t); +size_t cm_pl2bin(char *, struct ctrl_msg_pl *); +struct ctrl_msg_pl *cm_bin2pl(char *, struct ctrl_msg_pl *); +size_t cm_str2bin(char *, void *, size_t); +void *cm_bin2str(char *, void *, size_t); Modified: user/hrs/ipv6/usr.sbin/rtadvd/control_client.c ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvd/control_client.c Tue Aug 2 23:49:23 2011 (r224618) +++ user/hrs/ipv6/usr.sbin/rtadvd/control_client.c Wed Aug 3 01:33:34 2011 (r224619) @@ -55,7 +55,7 @@ #include "control_client.h" int -cmsg_handler_client(int fd, int state, char *buf_orig) +cm_handler_client(int fd, int state, char *buf_orig) { char buf[CM_MSG_MAXLEN]; struct ctrl_msg_hdr *cm; @@ -91,17 +91,17 @@ cmsg_handler_client(int fd, int state, c break; case CM_STATE_MSG_DISPATCH: cm->cm_version = CM_VERSION; - error = cmsg_send(fd, buf); + error = cm_send(fd, buf); if (error) syslog(LOG_WARNING, - "<%s> cmsg_send()", __func__); + "<%s> cm_send()", __func__); state = CM_STATE_ACK_WAIT; break; case CM_STATE_ACK_WAIT: - error = cmsg_recv(fd, buf); + error = cm_recv(fd, buf); if (error) { syslog(LOG_ERR, - "<%s> cmsg_recv()", __func__); + "<%s> cm_recv()", __func__); close(fd); return (-1); } Modified: user/hrs/ipv6/usr.sbin/rtadvd/control_client.h ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvd/control_client.h Tue Aug 2 23:49:23 2011 (r224618) +++ user/hrs/ipv6/usr.sbin/rtadvd/control_client.h Wed Aug 3 01:33:34 2011 (r224619) @@ -27,4 +27,4 @@ * */ -int cmsg_handler_client(int, int, char *); +int cm_handler_client(int, int, char *); Modified: user/hrs/ipv6/usr.sbin/rtadvd/control_server.c ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvd/control_server.c Tue Aug 2 23:49:23 2011 (r224618) +++ user/hrs/ipv6/usr.sbin/rtadvd/control_server.c Wed Aug 3 01:33:34 2011 (r224619) @@ -69,28 +69,28 @@ int is_do_reload(void) { return (do_rel int is_do_shutdown(void) { return (do_shutdown); } char *reload_ifname(void) { return (do_reload_ifname); } -#define DEF_PL_HANDLER(key) { #key, cmsg_getprop_##key } +#define DEF_PL_HANDLER(key) { #key, cm_getprop_##key } -static int cmsg_getprop_echo(struct ctrl_msg_pl *); -static int cmsg_getprop_version(struct ctrl_msg_pl *); -static int cmsg_getprop_ifilist(struct ctrl_msg_pl *); -static int cmsg_getprop_ifi(struct ctrl_msg_pl *); -static int cmsg_getprop_ifi_ra_timer(struct ctrl_msg_pl *); -static int cmsg_getprop_rai(struct ctrl_msg_pl *); -static int cmsg_getprop_pfx(struct ctrl_msg_pl *); -static int cmsg_getprop_rdnss(struct ctrl_msg_pl *); -static int cmsg_getprop_dnssl(struct ctrl_msg_pl *); -static int cmsg_getprop_rti(struct ctrl_msg_pl *); - -static int cmsg_setprop_reload(struct ctrl_msg_pl *); -static int cmsg_setprop_enable(struct ctrl_msg_pl *); -static int cmsg_setprop_disable(struct ctrl_msg_pl *); +static int cm_getprop_echo(struct ctrl_msg_pl *); +static int cm_getprop_version(struct ctrl_msg_pl *); +static int cm_getprop_ifilist(struct ctrl_msg_pl *); +static int cm_getprop_ifi(struct ctrl_msg_pl *); +static int cm_getprop_ifi_ra_timer(struct ctrl_msg_pl *); +static int cm_getprop_rai(struct ctrl_msg_pl *); +static int cm_getprop_pfx(struct ctrl_msg_pl *); +static int cm_getprop_rdnss(struct ctrl_msg_pl *); +static int cm_getprop_dnssl(struct ctrl_msg_pl *); +static int cm_getprop_rti(struct ctrl_msg_pl *); + +static int cm_setprop_reload(struct ctrl_msg_pl *); +static int cm_setprop_enable(struct ctrl_msg_pl *); +static int cm_setprop_disable(struct ctrl_msg_pl *); static struct dispatch_table { const char *dt_comm; int (*dt_act)(struct ctrl_msg_pl *cp); } getprop_dtable[] = { - { "", cmsg_getprop_echo }, + { "", cm_getprop_echo }, DEF_PL_HANDLER(echo), DEF_PL_HANDLER(version), DEF_PL_HANDLER(ifilist), @@ -104,7 +104,7 @@ static struct dispatch_table { }; static int -cmsg_getprop_echo(struct ctrl_msg_pl *cp) +cm_getprop_echo(struct ctrl_msg_pl *cp) { syslog(LOG_DEBUG, "<%s> enter", __func__); @@ -115,7 +115,7 @@ cmsg_getprop_echo(struct ctrl_msg_pl *cp } static int -cmsg_getprop_version(struct ctrl_msg_pl *cp) +cm_getprop_version(struct ctrl_msg_pl *cp) { syslog(LOG_DEBUG, "<%s> enter", __func__); @@ -126,7 +126,7 @@ cmsg_getprop_version(struct ctrl_msg_pl } static int -cmsg_getprop_ifilist(struct ctrl_msg_pl *cp) +cm_getprop_ifilist(struct ctrl_msg_pl *cp) { struct ifinfo *ifi; char *p; @@ -160,7 +160,7 @@ cmsg_getprop_ifilist(struct ctrl_msg_pl } static int -cmsg_getprop_ifi(struct ctrl_msg_pl *cp) +cm_getprop_ifi(struct ctrl_msg_pl *cp) { struct ifinfo *ifi; char *p; @@ -181,7 +181,7 @@ cmsg_getprop_ifi(struct ctrl_msg_pl *cp) p = malloc(sizeof(*ifi)); if (p == NULL) exit(1); - len = cmsg_str2bin(p, ifi, sizeof(*ifi)); + len = cm_str2bin(p, ifi, sizeof(*ifi)); syslog(LOG_DEBUG, "<%s> len = %zu", __func__, len); @@ -195,7 +195,7 @@ cmsg_getprop_ifi(struct ctrl_msg_pl *cp) } static int -cmsg_getprop_rai(struct ctrl_msg_pl *cp) +cm_getprop_rai(struct ctrl_msg_pl *cp) { struct ifinfo *ifi; struct rainfo *rai; @@ -222,7 +222,7 @@ cmsg_getprop_rai(struct ctrl_msg_pl *cp) p = malloc(sizeof(*rai)); if (p == NULL) exit(1); - len = cmsg_str2bin(p, rai, sizeof(*rai)); + len = cm_str2bin(p, rai, sizeof(*rai)); syslog(LOG_DEBUG, "<%s> len = %zu", __func__, len); @@ -236,7 +236,7 @@ cmsg_getprop_rai(struct ctrl_msg_pl *cp) } static int -cmsg_getprop_ifi_ra_timer(struct ctrl_msg_pl *cp) +cm_getprop_ifi_ra_timer(struct ctrl_msg_pl *cp) { struct ifinfo *ifi; struct rainfo *rai; @@ -268,7 +268,7 @@ cmsg_getprop_ifi_ra_timer(struct ctrl_ms p = malloc(sizeof(*rtimer)); if (p == NULL) exit(1); - len = cmsg_str2bin(p, rtimer, sizeof(*rtimer)); + len = cm_str2bin(p, rtimer, sizeof(*rtimer)); syslog(LOG_DEBUG, "<%s> len = %zu", __func__, len); @@ -282,7 +282,7 @@ cmsg_getprop_ifi_ra_timer(struct ctrl_ms } static int -cmsg_getprop_rti(struct ctrl_msg_pl *cp) +cm_getprop_rti(struct ctrl_msg_pl *cp) { struct ifinfo *ifi; struct rainfo *rai; @@ -331,7 +331,7 @@ cmsg_getprop_rti(struct ctrl_msg_pl *cp) } static int -cmsg_getprop_pfx(struct ctrl_msg_pl *cp) +cm_getprop_pfx(struct ctrl_msg_pl *cp) { struct ifinfo *ifi; struct rainfo *rai; @@ -380,7 +380,7 @@ cmsg_getprop_pfx(struct ctrl_msg_pl *cp) } static int -cmsg_getprop_rdnss(struct ctrl_msg_pl *cp) +cm_getprop_rdnss(struct ctrl_msg_pl *cp) { struct ifinfo *ifi; struct rainfo *rai; @@ -449,7 +449,7 @@ cmsg_getprop_rdnss(struct ctrl_msg_pl *c } static int -cmsg_getprop_dnssl(struct ctrl_msg_pl *cp) +cm_getprop_dnssl(struct ctrl_msg_pl *cp) { struct ifinfo *ifi; struct rainfo *rai; @@ -517,7 +517,7 @@ cmsg_getprop_dnssl(struct ctrl_msg_pl *c } int -cmsg_getprop(struct ctrl_msg_pl *cp) +cm_getprop(struct ctrl_msg_pl *cp) { size_t i; @@ -536,7 +536,7 @@ cmsg_getprop(struct ctrl_msg_pl *cp) } int -cmsg_setprop(struct ctrl_msg_pl *cp) +cm_setprop(struct ctrl_msg_pl *cp) { syslog(LOG_DEBUG, "<%s> enter", __func__); @@ -544,13 +544,13 @@ cmsg_setprop(struct ctrl_msg_pl *cp) return (1); if (strncmp(cp->cp_key, "reload", sizeof("reload")) == 0) - cmsg_setprop_reload(cp); + cm_setprop_reload(cp); else if (strncmp(cp->cp_key, "shutdown", sizeof("shutdown")) == 0) set_do_shutdown(0); else if (strncmp(cp->cp_key, "enable", sizeof("enable")) == 0) - cmsg_setprop_enable(cp); + cm_setprop_enable(cp); else if (strncmp(cp->cp_key, "disable", sizeof("disable")) == 0) - cmsg_setprop_disable(cp); + cm_setprop_disable(cp); else if (strncmp(cp->cp_key, "echo", 8) == 0) ; /* do nothing */ else @@ -560,7 +560,7 @@ cmsg_setprop(struct ctrl_msg_pl *cp) } static int -cmsg_setprop_reload(struct ctrl_msg_pl *cp) +cm_setprop_reload(struct ctrl_msg_pl *cp) { syslog(LOG_DEBUG, "<%s> enter", __func__); @@ -572,7 +572,7 @@ cmsg_setprop_reload(struct ctrl_msg_pl * } static int -cmsg_setprop_enable(struct ctrl_msg_pl *cp) +cm_setprop_enable(struct ctrl_msg_pl *cp) { struct ifinfo *ifi; @@ -596,7 +596,7 @@ cmsg_setprop_enable(struct ctrl_msg_pl * } static int -cmsg_setprop_disable(struct ctrl_msg_pl *cp) +cm_setprop_disable(struct ctrl_msg_pl *cp) { struct ifinfo *ifi; @@ -627,7 +627,7 @@ cmsg_setprop_disable(struct ctrl_msg_pl } int -cmsg_handler_server(int fd) +cm_handler_server(int fd) { int state; char *msg; @@ -654,17 +654,17 @@ cmsg_handler_server(int fd) break; case CM_STATE_MSG_DISPATCH: cm->cm_version = CM_VERSION; - error = cmsg_send(fd, buf); + error = cm_send(fd, buf); if (error) syslog(LOG_WARNING, - "<%s> cmsg_send()", __func__); + "<%s> cm_send()", __func__); state = CM_STATE_EOM; break; case CM_STATE_ACK_WAIT: - error = cmsg_recv(fd, buf); + error = cm_recv(fd, buf); if (error) { syslog(LOG_ERR, - "<%s> cmsg_recv()", __func__); + "<%s> cm_recv()", __func__); close(fd); return (-1); } @@ -686,11 +686,11 @@ cmsg_handler_server(int fd) state = CM_STATE_EOM; break; case CM_STATE_MSG_RECV: - error = cmsg_recv(fd, buf); + error = cm_recv(fd, buf); if (error) { syslog(LOG_ERR, - "<%s> cmsg_recv()", __func__); + "<%s> cm_recv()", __func__); close(fd); return (-1); } @@ -709,22 +709,22 @@ cmsg_handler_server(int fd) cm->cm_len = sizeof(*cm); break; case CM_TYPE_REQ_GET_PROP: - cmsg_bin2pl(msg, &cp); - error = cmsg_getprop(&cp); + cm_bin2pl(msg, &cp); + error = cm_getprop(&cp); if (error) { cm->cm_type = CM_TYPE_ERR; cm->cm_len = sizeof(*cm); } else { cm->cm_type = CM_TYPE_ACK; cm->cm_len = sizeof(*cm); - cm->cm_len += cmsg_pl2bin(msg, &cp); + cm->cm_len += cm_pl2bin(msg, &cp); } if (cp.cp_val != NULL) free(cp.cp_val); break; case CM_TYPE_REQ_SET_PROP: - cmsg_bin2pl(msg, &cp); - error = cmsg_setprop(&cp); + cm_bin2pl(msg, &cp); + error = cm_setprop(&cp); if (error) { cm->cm_type = CM_TYPE_ERR; cm->cm_len = sizeof(*cm); Modified: user/hrs/ipv6/usr.sbin/rtadvd/control_server.h ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvd/control_server.h Tue Aug 2 23:49:23 2011 (r224618) +++ user/hrs/ipv6/usr.sbin/rtadvd/control_server.h Wed Aug 3 01:33:34 2011 (r224619) @@ -27,10 +27,10 @@ * */ -int cmsg_getprop(struct ctrl_msg_pl *); -int cmsg_setprop(struct ctrl_msg_pl *); +int cm_getprop(struct ctrl_msg_pl *); +int cm_setprop(struct ctrl_msg_pl *); -int cmsg_handler_server(int); +int cm_handler_server(int); void set_do_reload(int); void set_do_reload_ifname(char *); Modified: user/hrs/ipv6/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvd/rtadvd.c Tue Aug 2 23:49:23 2011 (r224618) +++ user/hrs/ipv6/usr.sbin/rtadvd/rtadvd.c Wed Aug 3 01:33:34 2011 (r224619) @@ -353,7 +353,7 @@ main(int argc, char *argv[]) if (fd == -1) syslog(LOG_ERR, "<%s> accept", __func__); else { - cmsg_handler_server(fd); + cm_handler_server(fd); close(fd); } } From owner-svn-src-user@FreeBSD.ORG Wed Aug 3 02:02:23 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E9C5106564A; Wed, 3 Aug 2011 02:02:23 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F1928FC15; Wed, 3 Aug 2011 02:02:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7322NXH080609; Wed, 3 Aug 2011 02:02:23 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7322Nl1080607; Wed, 3 Aug 2011 02:02:23 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201108030202.p7322Nl1080607@svn.freebsd.org> From: Hiroki Sato Date: Wed, 3 Aug 2011 02:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224620 - user/hrs/ipv6/usr.sbin/rtadvd X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 02:02:23 -0000 Author: hrs Date: Wed Aug 3 02:02:23 2011 New Revision: 224620 URL: http://svn.freebsd.org/changeset/base/224620 Log: Ignore an interface that never sent RAs for graceful shut-down. Modified: user/hrs/ipv6/usr.sbin/rtadvd/rtadvd.c Modified: user/hrs/ipv6/usr.sbin/rtadvd/rtadvd.c ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvd/rtadvd.c Wed Aug 3 01:33:34 2011 (r224619) +++ user/hrs/ipv6/usr.sbin/rtadvd/rtadvd.c Wed Aug 3 02:02:23 2011 (r224620) @@ -405,6 +405,18 @@ rtadvd_shutdown(void) continue; if (ifi->ifi_ra_timer == NULL) continue; + if (ifi->ifi_ra_lastsent.tv_sec == 0 && + ifi->ifi_ra_lastsent.tv_usec == 0 && + ifi->ifi_ra_timer != NULL) { + /* + * When RA configured but never sent, + * ignore the IF immediately. + */ + rtadvd_remove_timer(ifi->ifi_ra_timer); + ifi->ifi_ra_timer = NULL; + ifi->ifi_state = IFI_STATE_UNCONFIGURED; + continue; + } ifi->ifi_state = IFI_STATE_TRANSITIVE; From owner-svn-src-user@FreeBSD.ORG Wed Aug 3 07:00:56 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F6591065670; Wed, 3 Aug 2011 07:00:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DE8B8FC08; Wed, 3 Aug 2011 07:00:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7370uCV090673; Wed, 3 Aug 2011 07:00:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7370tOH090668; Wed, 3 Aug 2011 07:00:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108030700.p7370tOH090668@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 07:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224625 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 07:00:56 -0000 Author: adrian Date: Wed Aug 3 07:00:55 2011 New Revision: 224625 URL: http://svn.freebsd.org/changeset/base/224625 Log: Do a majorish rework of the software TX queue handling. * Eliminate the per-node lock, it was annoying and is mostly unneeded just for now * Eliminate the per-node list of active TX nodes * Add a per-TID list of active TX nodes, linked off of the hardware ath_txq * Sprinkle lots of lock assertions around to make sure I've got things locked in the right places. The major locking change here is inspired by what the older reference code does. Here, the locking for the per-TID stuff is hidden behind that hardware TXQ, rather than having per-node and per-TID locks. It's more coarse grained but it'll be enough to get the code bootstrapped. I'll worry about more fine-grained locking later on once the rest of this first pass has been completed. Note - the freebsd TX processq function only locks the hardware TXQ as long as it needs to add/remove buffers from it. The reference code grabs the lock and holds it for as long as the processing takes. This means that the completion function also hides behind the same lock as the setup/queue functions. I'll likely do that in a subsequent commit. Note - I'm not properly pausing or unpausing the tid when ADDBA is in progress, I'm just not TX'ing on it. I'll worry about the pause/unpause later on. This just means that extra CPU is burnt during ADDBA exchange. Obtained from: Atheros Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Aug 3 06:51:14 2011 (r224624) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Aug 3 07:00:55 2011 (r224625) @@ -751,12 +751,6 @@ ath_attach(u_int16_t devid, struct ath_s ath_sysctl_stats_attach(sc); ath_sysctl_hal_attach(sc); - /* Setup software TX queue related bits */ - STAILQ_INIT(&sc->sc_txnodeq); - snprintf(sc->sc_txnodeq_name, sizeof(sc->sc_txnodeq_name), - "%s: txnodeq\n", device_get_nameunit(sc->sc_dev)); - ATH_TXNODE_LOCK_INIT(sc); - if (bootverbose) ieee80211_announce(ic); ath_announce(sc); @@ -808,7 +802,6 @@ ath_detach(struct ath_softc *sc) ath_desc_free(sc); ath_tx_cleanup(sc); ath_hal_detach(sc->sc_ah); /* NB: sets chip in full sleep */ - ATH_TXNODE_LOCK_DESTROY(sc); if_free(ifp); return 0; @@ -1951,12 +1944,6 @@ ath_start(struct ifnet *ifp) sc->sc_wd_timer = 5; } - - /* - * Since there's no nicer place to put this for now, - * stick the software TXQ punt call here. - */ - ath_txq_sched(sc); } static int @@ -3863,6 +3850,7 @@ ath_txq_init(struct ath_softc *sc, struc txq->axq_intrcnt = 0; txq->axq_link = NULL; STAILQ_INIT(&txq->axq_q); + STAILQ_INIT(&txq->axq_tidq); ATH_TXQ_LOCK_INIT(sc, txq); } @@ -4233,6 +4221,21 @@ ath_tx_processq(struct ath_softc *sc, st if (txq->axq_depth <= 1) ieee80211_ff_flush(ic, txq->axq_ac); #endif + + /* Kick the TXQ scheduler */ + /* + * XXX for now, (whilst the completion functions aren't doing anything), + * XXX re-lock the hardware txq here. + * + * Later on though, those completion functions may grovel around + * in the per-tid state. That's going to require locking. + * The reference code kept TXQ locked for the whole of this duration + * so the completion functions didn't race. + */ + ATH_TXQ_LOCK(txq); + ath_txq_sched(sc, txq); + ATH_TXQ_UNLOCK(txq); + return nacked; } Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Aug 3 06:51:14 2011 (r224624) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Aug 3 07:00:55 2011 (r224625) @@ -236,8 +236,7 @@ ath_tx_dmasetup(struct ath_softc *sc, st } static void -ath_tx_chaindesclist(struct ath_softc *sc, struct ath_txq *txq, - struct ath_buf *bf) +ath_tx_chaindesclist(struct ath_softc *sc, struct ath_buf *bf) { struct ath_hal *ah = sc->sc_ah; struct ath_desc *ds, *ds0; @@ -270,7 +269,7 @@ ath_tx_chaindesclist(struct ath_softc *s static void ath_tx_handoff_mcast(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf) { - ATH_TXQ_LOCK(txq); + ATH_TXQ_LOCK_ASSERT(txq); KASSERT((bf->bf_flags & ATH_BUF_BUSY) == 0, ("busy status 0x%x", bf->bf_flags)); if (txq->axq_link != NULL) { @@ -288,7 +287,6 @@ ath_tx_handoff_mcast(struct ath_softc *s } ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); txq->axq_link = &bf->bf_desc[bf->bf_nseg - 1].ds_link; - ATH_TXQ_UNLOCK(txq); } @@ -309,7 +307,7 @@ ath_tx_handoff_hw(struct ath_softc *sc, * the SWBA handler since frames only go out on DTIM and * to avoid possible races. */ - ATH_TXQ_LOCK(txq); + ATH_TXQ_LOCK_ASSERT(txq); KASSERT((bf->bf_flags & ATH_BUF_BUSY) == 0, ("busy status 0x%x", bf->bf_flags)); KASSERT(txq->axq_qnum != ATH_TXQ_SWQ, @@ -391,12 +389,17 @@ ath_tx_handoff_hw(struct ath_softc *sc, txq->axq_link = &bf->bf_desc[bf->bf_nseg - 1].ds_link; ath_hal_txstart(ah, txq->axq_qnum); } - ATH_TXQ_UNLOCK(txq); } +/* + * Hand off a packet to the hardware (or mcast queue.) + * The relevant hardware txq should be locked. + */ static void ath_tx_handoff(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf) { + ATH_TXQ_LOCK_ASSERT(txq); + if (txq->axq_qnum == ATH_TXQ_SWQ) ath_tx_handoff_mcast(sc, txq, bf); else @@ -939,12 +942,6 @@ ath_tx_start(struct ath_softc *sc, struc ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); /* A-MPDU TX */ - /* - * XXX This doesn't hold the node lock! - * XXX So it's possible that another TX process can change - * XXX the AMPDU status from underneath us. This needs to be - * XXX further investigated! - */ is_ampdu_tx = ath_tx_ampdu_running(sc, ATH_NODE(ni), tid); is_ampdu_pending = ath_tx_ampdu_pending(sc, ATH_NODE(ni), tid); is_ampdu = is_ampdu_tx | is_ampdu_pending; @@ -989,11 +986,15 @@ ath_tx_start(struct ath_softc *sc, struc //m0 = bf->bf_m; /* Fill in the details in the descriptor list */ - ath_tx_chaindesclist(sc, txq, bf); + ath_tx_chaindesclist(sc, bf); #if 1 + ATH_TXQ_LOCK(txq); /* add to software queue */ ath_tx_swq(sc, ni, txq, bf, m0); + /* Kick txq */ + ath_txq_sched(sc, txq); + ATH_TXQ_UNLOCK(txq); #else /* @@ -1215,7 +1216,7 @@ ath_tx_raw_start(struct ath_softc *sc, s } /* Fill in the details in the descriptor list */ - ath_tx_chaindesclist(sc, sc->sc_ac2q[pri], bf); + ath_tx_chaindesclist(sc, bf); /* * If we're overiding the ADDBA destination, dump directly @@ -1223,6 +1224,7 @@ ath_tx_raw_start(struct ath_softc *sc, s * frames to that node are. */ + ATH_TXQ_LOCK(sc->sc_ac2q[pri]); if (do_override) ath_tx_handoff(sc, sc->sc_ac2q[pri], bf); else { @@ -1230,8 +1232,9 @@ ath_tx_raw_start(struct ath_softc *sc, s ath_tx_swq(sc, ni, sc->sc_ac2q[pri], bf, m0); /* Kick txq */ - ath_txq_sched(sc); + ath_txq_sched(sc, sc->sc_ac2q[pri]); } + ATH_TXQ_UNLOCK(sc->sc_ac2q[pri]); return 0; } @@ -1393,42 +1396,48 @@ ath_tx_action_frame_override_queue(struc /* * Mark the current node/TID as ready to TX. * - * This is done to make it easy for the software scheduler to + * This is done to make it easy for the software scheduler to * find which nodes have data to send. * - * The node and txnode locks should be held. + * The relevant hw txq lock should be held. */ static void ath_tx_node_sched(struct ath_softc *sc, struct ath_node *an, int tid) { - ATH_NODE_LOCK_ASSERT(an); - ATH_TXNODE_LOCK_ASSERT(sc); + struct ath_tid *atid = &an->an_tid[tid]; + int ac = TID_TO_WME_AC(tid); + struct ath_txq *txq = sc->sc_ac2q[ac]; + + ATH_TXQ_LOCK_ASSERT(txq); - if (an->sched) + if (atid->sched) return; /* already scheduled */ - an->sched = 1; + atid->sched = 1; - STAILQ_INSERT_TAIL(&sc->sc_txnodeq, an, an_list); + STAILQ_INSERT_TAIL(&txq->axq_tidq, atid, axq_qelem); } /* * Mark the current node as no longer needing to be polled for * TX packets. * - * The node and txnode locks should be held. + * The relevant hw txq lock should be held. */ static void ath_tx_node_unsched(struct ath_softc *sc, struct ath_node *an, int tid) { - ATH_NODE_LOCK_ASSERT(an); - ATH_TXNODE_LOCK_ASSERT(sc); + struct ath_tid *atid = &an->an_tid[tid]; + int ac = TID_TO_WME_AC(tid); + struct ath_txq *txq = sc->sc_ac2q[ac]; - if (an->sched == 0) + ATH_TXQ_LOCK_ASSERT(txq); + + if (atid->sched == 0) return; - an->sched = 0; - STAILQ_REMOVE(&sc->sc_txnodeq, an, ath_node, an_list); + atid->sched = 0; + STAILQ_REMOVE(&txq->axq_tidq, atid, ath_tid, axq_qelem); } /* @@ -1477,6 +1486,8 @@ ath_tx_swq(struct ath_softc *sc, struct struct ath_tid *atid; int pri, tid; + ATH_TXQ_LOCK_ASSERT(txq); + /* Fetch the TID - non-QoS frames get assigned to TID 16 */ wh = mtod(m0, struct ieee80211_frame *); pri = M_WME_GETAC(m0); /* honor classification */ @@ -1488,22 +1499,10 @@ ath_tx_swq(struct ath_softc *sc, struct bf->bf_state.bfs_txq = txq; /* Queue frame to the tail of the software queue */ - ATH_TXQ_LOCK(atid); ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); - ATH_TXQ_UNLOCK(atid); - /* - * ATH_TXNODE must be acquired before ATH_NODE is acquired - * if they're both needed. - */ - ATH_TXNODE_LOCK(sc); - ATH_NODE_LOCK(an); - /* Bump queued packet counter */ - an->an_qdepth++; - /* Mark the given node as having packets to dequeue */ + /* Mark the given tid as having packets to dequeue */ ath_tx_node_sched(sc, an, tid); - ATH_NODE_UNLOCK(an); - ATH_TXNODE_UNLOCK(sc); } /* @@ -1533,16 +1532,12 @@ ath_tx_tid_init(struct ath_softc *sc, st { int i; struct ath_tid *atid; - struct ieee80211_node *ni = &an->an_node; for (i = 0; i < IEEE80211_TID_SIZE; i++) { atid = &an->an_tid[i]; STAILQ_INIT(&atid->axq_q); - snprintf(atid->axq_name, sizeof(atid->axq_name), - "%s_a%d_t%d\n", device_get_nameunit(sc->sc_dev), - ni->ni_associd, - i); - mtx_init(&atid->axq_lock, atid->axq_name, NULL, MTX_DEF); + atid->tid = i; + atid->an = an; } } @@ -1570,8 +1565,6 @@ ath_tx_tid_txq_unmark(struct ath_softc * * * It can also be called on an active node during an interface * reset or state transition. - * - * This doesn't update an->an_qdepth! */ static void ath_tx_tid_free_pkts(struct ath_softc *sc, struct ath_node *an, @@ -1579,17 +1572,18 @@ ath_tx_tid_free_pkts(struct ath_softc *s { struct ath_tid *atid = &an->an_tid[tid]; struct ath_buf *bf; + int ac = TID_TO_WME_AC(tid); + struct ath_txq *txq = sc->sc_ac2q[ac]; + + ATH_TXQ_LOCK_ASSERT(txq); /* Walk the queue, free frames */ for (;;) { - ATH_TXQ_LOCK(atid); bf = STAILQ_FIRST(&atid->axq_q); if (bf == NULL) { - ATH_TXQ_UNLOCK(atid); break; } ATH_TXQ_REMOVE_HEAD(atid, bf_list); - ATH_TXQ_UNLOCK(atid); ath_tx_freebuf(sc, bf, -1); } } @@ -1602,8 +1596,18 @@ ath_tx_node_flush(struct ath_softc *sc, { int tid; - for (tid = 0; tid < IEEE80211_TID_SIZE; tid++) + for (tid = 0; tid < IEEE80211_TID_SIZE; tid++) { + int ac = TID_TO_WME_AC(tid); + struct ath_txq *txq = sc->sc_ac2q[ac]; + + ATH_TXQ_LOCK(txq); + /* Remove this tid from the list of active tids */ + ath_tx_node_unsched(sc, an, tid); + + /* Free packets */ ath_tx_tid_free_pkts(sc, an, tid); + ATH_TXQ_UNLOCK(txq); + } /* * Don't hold the node lock across free_pkts; @@ -1611,9 +1615,6 @@ ath_tx_node_flush(struct ath_softc *sc, * that will acquire the IEEE80211_NODE_LOCK (node table). * That then causes a lock reversal. */ - ATH_NODE_LOCK(an); - an->an_qdepth = 0; - ATH_NODE_UNLOCK(an); } /* @@ -1625,35 +1626,16 @@ ath_tx_node_flush(struct ath_softc *sc, void ath_tx_tid_cleanup(struct ath_softc *sc, struct ath_node *an) { - int i; + int tid; struct ath_tid *atid; - struct ieee80211_node *ni = &an->an_node; - - for (i = 0; i < IEEE80211_TID_SIZE; i++) { - atid = &an->an_tid[i]; - /* Free packets in sw queue */ - /* For now, just print a loud warning if it occurs */ - ATH_TXQ_LOCK(atid); - if (! STAILQ_EMPTY(&atid->axq_q)) - device_printf(sc->sc_dev, "%s: AID %d TID %d queue not " - "empty on queue destroy!\n", - __func__, ni->ni_associd, i); - ATH_TXQ_UNLOCK(atid); - ath_tx_tid_free_pkts(sc, an, i); + /* Flush all packets currently in the sw queues for this node */ + ath_tx_node_flush(sc, an); + for (tid = 0; tid < IEEE80211_TID_SIZE; tid++) { + atid = &an->an_tid[tid]; /* Mark hw-queued packets as having no parent now */ - ath_tx_tid_txq_unmark(sc, an, i); - - /* Remove any pending hardware TXQ scheduling */ - ATH_TXNODE_LOCK(sc); - ATH_NODE_LOCK(an); - ath_tx_node_unsched(sc, an, i); - ATH_NODE_UNLOCK(an); - ATH_TXNODE_UNLOCK(sc); - - /* Free mutex */ - mtx_destroy(&atid->axq_lock); + ath_tx_tid_txq_unmark(sc, an, tid); } } @@ -1695,10 +1677,8 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft struct ath_tid *atid = &an->an_tid[tid]; for (;;) { - ATH_TXQ_LOCK(atid); bf = STAILQ_FIRST(&atid->axq_q); if (bf == NULL) { - ATH_TXQ_UNLOCK(atid); break; } @@ -1712,14 +1692,10 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft * XXX and progress can be made. */ ATH_TXQ_REMOVE_HEAD(atid, bf_list); - ATH_TXQ_UNLOCK(atid); - - /* Remove from queue */ - ATH_NODE_LOCK(an); - an->an_qdepth--; - ATH_NODE_UNLOCK(an); txq = bf->bf_state.bfs_txq; + ATH_TXQ_LOCK_ASSERT(txq); + /* Sanity check! */ if (tid != bf->bf_state.bfs_tid) { device_printf(sc->sc_dev, "%s: bfs_tid %d !=" @@ -1735,8 +1711,6 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft } } - - /* * Schedule some packets from the given node/TID to the hardware. */ @@ -1748,21 +1722,14 @@ ath_tx_tid_hw_queue_norm(struct ath_soft struct ath_tid *atid = &an->an_tid[tid]; for (;;) { - ATH_TXQ_LOCK(atid); bf = STAILQ_FIRST(&atid->axq_q); if (bf == NULL) { - ATH_TXQ_UNLOCK(atid); break; } ATH_TXQ_REMOVE_HEAD(atid, bf_list); - ATH_TXQ_UNLOCK(atid); - - /* Remove from queue */ - ATH_NODE_LOCK(an); - an->an_qdepth--; - ATH_NODE_UNLOCK(an); txq = bf->bf_state.bfs_txq; + ATH_TXQ_LOCK_ASSERT(txq); /* Sanity check! */ if (tid != bf->bf_state.bfs_tid) { device_printf(sc->sc_dev, "%s: bfs_tid %d !=" @@ -1781,6 +1748,7 @@ ath_tx_tid_hw_queue_norm(struct ath_soft void ath_tx_hw_queue(struct ath_softc *sc, struct ath_node *an) { +#if 0 struct ath_tid *atid; int tid; int isempty; @@ -1792,12 +1760,9 @@ ath_tx_hw_queue(struct ath_softc *sc, st */ for (tid = 0; tid < IEEE80211_TID_SIZE; tid++) { atid = &an->an_tid[tid]; - ATH_NODE_LOCK(an); if (ath_tx_ampdu_pending(sc, an, tid)) { - ATH_NODE_UNLOCK(an); continue; } - ATH_NODE_UNLOCK(an); if (ath_tx_ampdu_running(sc, an, tid)) ath_tx_tid_hw_queue_aggr(sc, an, tid); else @@ -1820,36 +1785,45 @@ ath_tx_hw_queue(struct ath_softc *sc, st } ATH_TXQ_UNLOCK(atid); } -} - -#if 0 -static int -ath_txq_node_qlen(struct ath_softc *sc, struct ath_node *an) -{ - ATH_NODE_LOCK_ASSERT(an); - return an->an_qdepth; -} #endif +} /* - * Handle scheduling some packets from whichever nodes have - * signaled they're (potentially) ready. + * Schedule some packets to the given hardware queue. + * + * This function walks the list of TIDs (ie, ath_node TIDs + * with queued traffic) and attempts to schedule traffic + * from them. + * + * This must be called with the HW TXQ lock held. */ void -ath_txq_sched(struct ath_softc *sc) +ath_txq_sched(struct ath_softc *sc, struct ath_txq *txq) { - struct ath_node *an, *next; + ATH_TXQ_LOCK_ASSERT(txq); + struct ath_tid *atid, *next; + + /* + * For now, let's not worry about QoS, fair-scheduling + * or the like. That's a later problem. Just throw + * packets at the hardware. + */ + STAILQ_FOREACH_SAFE(atid, &txq->axq_tidq, axq_qelem, next) { + if (ath_tx_ampdu_pending(sc, atid->an, atid->tid)) { + /* XXX TODO should remove it from the list */ + continue; + } + if (ath_tx_ampdu_running(sc, atid->an, atid->tid)) + ath_tx_tid_hw_queue_aggr(sc, atid->an, atid->tid); + else + ath_tx_tid_hw_queue_norm(sc, atid->an, atid->tid); - ATH_TXNODE_LOCK(sc); - /* Iterate over the list of active nodes, queuing packets */ - STAILQ_FOREACH_SAFE(an, &sc->sc_txnodeq, an_list, next) { - /* Try dequeueing packets from the current node */ - ath_tx_hw_queue(sc, an); + /* Empty? Remove */ + if (atid->axq_depth == 0) + ath_tx_node_unsched(sc, atid->an, atid->tid); } - ATH_TXNODE_UNLOCK(sc); } - /* * TX addba handling */ @@ -1875,16 +1849,12 @@ ath_tx_get_tx_tid(struct ath_node *an, i /* * Is AMPDU-TX running? - * - * The ATH_NODE lock must be held. */ static int ath_tx_ampdu_running(struct ath_softc *sc, struct ath_node *an, int tid) { struct ieee80211_tx_ampdu *tap; -// ATH_NODE_LOCK_ASSERT(an); - tap = ath_tx_get_tx_tid(an, tid); if (tap == NULL) return 0; /* Not valid; default to not running */ @@ -1894,16 +1864,12 @@ ath_tx_ampdu_running(struct ath_softc *s /* * Is AMPDU-TX negotiation pending? - * - * The ATH_NODE lock must be held. */ static int ath_tx_ampdu_pending(struct ath_softc *sc, struct ath_node *an, int tid) { struct ieee80211_tx_ampdu *tap; -// ATH_NODE_LOCK_ASSERT(an); - tap = ath_tx_get_tx_tid(an, tid); if (tap == NULL) return 0; /* Not valid; default to not pending */ @@ -1914,8 +1880,6 @@ ath_tx_ampdu_pending(struct ath_softc *s /* * Is AMPDU-TX pending for the given TID? - * - * The ATH_NODE lock must be held. */ @@ -1949,6 +1913,11 @@ ath_addba_response(struct ieee80211_node int dialogtoken, int code, int batimeout) { struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; + + /* + * XXX todo: resume the ath_node/TID now, rather than + * XXX waiting for the next packet to trigger a TX. + */ return sc->sc_addba_response(ni, tap, dialogtoken, code, batimeout); } Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Wed Aug 3 06:51:14 2011 (r224624) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Wed Aug 3 07:00:55 2011 (r224625) @@ -52,7 +52,7 @@ extern void ath_tx_tid_hw_queue_aggr(str extern void ath_tx_tid_hw_queue_norm(struct ath_softc *sc, struct ath_node *an, int tid); extern void ath_tx_hw_queue(struct ath_softc *sc, struct ath_node *an); -extern void ath_txq_sched(struct ath_softc *sc); +extern void ath_txq_sched(struct ath_softc *sc, struct ath_txq *txq); /* TX addba handling */ extern int ath_addba_request(struct ieee80211_node *ni, Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Wed Aug 3 06:51:14 2011 (r224624) +++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Wed Aug 3 07:00:55 2011 (r224625) @@ -93,8 +93,15 @@ struct ath_buf; struct ath_tid { STAILQ_HEAD(,ath_buf) axq_q; /* pending buffers */ u_int axq_depth; /* SW queue depth */ - struct mtx axq_lock; /* lock on queue, tx_buf */ - char axq_name[24]; /* e.g. "wlan0_a1_t5" */ + struct ath_node *an; /* pointer to parent */ + int tid; /* tid */ + + /* + * Entry on the ath_txq; when there's traffic + * to send + */ + STAILQ_ENTRY(ath_tid) axq_qelem; + int sched; /* * The following implements a ring representing @@ -115,13 +122,8 @@ struct ath_node { struct ieee80211_node an_node; /* base class */ u_int8_t an_mgmtrix; /* min h/w rate index */ u_int8_t an_mcastrix; /* mcast h/w rate index */ - STAILQ_ENTRY(ath_node) an_list; /* Per hw-txq entry, added if there - * is traffic in this queue to send */ - int sched; /* Whether this node has been - * added to the txq axq_nodeq */ struct ath_buf *an_ff_buf[WME_NUM_AC]; /* ff staging area */ struct ath_tid an_tid[IEEE80211_TID_SIZE]; /* per-TID state */ - u_int an_qdepth; /* Current queue depth of all TIDs */ char an_name[32]; /* eg "wlan0_a1" */ struct mtx an_mtx; /* protecting the ath_node state */ /* variable-length rate control state follows */ @@ -219,6 +221,9 @@ struct ath_txq { STAILQ_HEAD(, ath_buf) axq_q; /* transmit queue */ struct mtx axq_lock; /* lock on q and link */ char axq_name[12]; /* e.g. "ath0_txq4" */ + + /* Per-TID traffic queue for software -> hardware TX */ + STAILQ_HEAD(,ath_tid) axq_tidq; }; #define ATH_NODE_LOCK(_an) mtx_lock(&(_an)->an_mtx) @@ -425,11 +430,6 @@ struct ath_softc { int sc_dodfs; /* Whether to enable DFS rx filter bits */ struct task sc_dfstask; /* DFS processing task */ - /* Software TX queue related state */ - struct mtx sc_txnodeq_mtx; /* mutex protecting the below */ - STAILQ_HEAD(, ath_node) sc_txnodeq; /* Nodes which have traffic to send */ - char sc_txnodeq_name[16]; /* mutex name */ - /* TX AMPDU handling */ int (*sc_addba_request)(struct ieee80211_node *, struct ieee80211_tx_ampdu *, int, int, int); @@ -447,14 +447,6 @@ struct ath_softc { #define ATH_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define ATH_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) -#define ATH_TXNODE_LOCK_INIT(_sc) \ - mtx_init(&(_sc)->sc_txnodeq_mtx, (sc)->sc_txnodeq_name, \ - NULL, MTX_DEF | MTX_RECURSE) -#define ATH_TXNODE_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_txnodeq_mtx) -#define ATH_TXNODE_LOCK(_sc) mtx_lock(&(_sc)->sc_txnodeq_mtx) -#define ATH_TXNODE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_txnodeq_mtx) -#define ATH_TXNODE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_txnodeq_mtx, MA_OWNED) - #define ATH_TXQ_SETUP(sc, i) ((sc)->sc_txqsetup & (1< Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FD7A1065743; Wed, 3 Aug 2011 07:36:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 658E98FC12; Wed, 3 Aug 2011 07:36:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p737aAub091730; Wed, 3 Aug 2011 07:36:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p737aAD1091728; Wed, 3 Aug 2011 07:36:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108030736.p737aAD1091728@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 07:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224626 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 07:36:10 -0000 Author: adrian Date: Wed Aug 3 07:36:10 2011 New Revision: 224626 URL: http://svn.freebsd.org/changeset/base/224626 Log: Since the hardware TXQ lock now protects all the node TIDs that are behind it, the completion functions also need protecting by the same lock. So, shuffle the TXQ lock to protect the whole loop, including the TXQ dequeue, completion check/function, and txq schedule. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Aug 3 07:00:55 2011 (r224625) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Aug 3 07:36:10 2011 (r224626) @@ -4144,12 +4144,11 @@ ath_tx_processq(struct ath_softc *sc, st (caddr_t)(uintptr_t) ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum), txq->axq_link); nacked = 0; + ATH_TXQ_LOCK(txq); for (;;) { - ATH_TXQ_LOCK(txq); txq->axq_intrcnt = 0; /* reset periodic desc intr count */ bf = STAILQ_FIRST(&txq->axq_q); if (bf == NULL) { - ATH_TXQ_UNLOCK(txq); break; } ds0 = &bf->bf_desc[0]; @@ -4162,7 +4161,6 @@ ath_tx_processq(struct ath_softc *sc, st status == HAL_OK); #endif if (status == HAL_EINPROGRESS) { - ATH_TXQ_UNLOCK(txq); break; } ATH_TXQ_REMOVE_HEAD(txq, bf_list); @@ -4179,7 +4177,6 @@ ath_tx_processq(struct ath_softc *sc, st if (txq->axq_depth == 0) #endif txq->axq_link = NULL; - ATH_TXQ_UNLOCK(txq); ni = bf->bf_node; /* @@ -4223,16 +4220,6 @@ ath_tx_processq(struct ath_softc *sc, st #endif /* Kick the TXQ scheduler */ - /* - * XXX for now, (whilst the completion functions aren't doing anything), - * XXX re-lock the hardware txq here. - * - * Later on though, those completion functions may grovel around - * in the per-tid state. That's going to require locking. - * The reference code kept TXQ locked for the whole of this duration - * so the completion functions didn't race. - */ - ATH_TXQ_LOCK(txq); ath_txq_sched(sc, txq); ATH_TXQ_UNLOCK(txq); From owner-svn-src-user@FreeBSD.ORG Wed Aug 3 07:44:15 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A040010656DA; Wed, 3 Aug 2011 07:44:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 769BF8FC17; Wed, 3 Aug 2011 07:44:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p737iFlQ092004; Wed, 3 Aug 2011 07:44:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p737iFfm092001; Wed, 3 Aug 2011 07:44:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108030744.p737iFfm092001@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 07:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224627 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 07:44:15 -0000 Author: adrian Date: Wed Aug 3 07:44:15 2011 New Revision: 224627 URL: http://svn.freebsd.org/changeset/base/224627 Log: Remove a now unused function Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Aug 3 07:36:10 2011 (r224626) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Aug 3 07:44:15 2011 (r224627) @@ -1743,52 +1743,6 @@ ath_tx_tid_hw_queue_norm(struct ath_soft } /* - * Attempt to schedule packets from the given node to the hardware. - */ -void -ath_tx_hw_queue(struct ath_softc *sc, struct ath_node *an) -{ -#if 0 - struct ath_tid *atid; - int tid; - int isempty; - - /* - * For now, just queue from all TIDs in order. - * This is very likely absolutely wrong from a QoS - * perspective but it'll do for now. - */ - for (tid = 0; tid < IEEE80211_TID_SIZE; tid++) { - atid = &an->an_tid[tid]; - if (ath_tx_ampdu_pending(sc, an, tid)) { - continue; - } - if (ath_tx_ampdu_running(sc, an, tid)) - ath_tx_tid_hw_queue_aggr(sc, an, tid); - else - ath_tx_tid_hw_queue_norm(sc, an, tid); - - /* - * Check if anything is left in the queue; - * if not, unschedule it. - * Checking this only requires the TXQ lock. - * Unscheduling it requires all the locks. - */ - ATH_TXQ_LOCK(atid); - isempty = (atid->axq_depth == 0); - if (isempty) { - ATH_TXNODE_LOCK(sc); - ATH_NODE_LOCK(an); - ath_tx_node_unsched(sc, an, tid); - ATH_NODE_UNLOCK(an); - ATH_TXNODE_UNLOCK(sc); - } - ATH_TXQ_UNLOCK(atid); - } -#endif -} - -/* * Schedule some packets to the given hardware queue. * * This function walks the list of TIDs (ie, ath_node TIDs Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Wed Aug 3 07:36:10 2011 (r224626) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.h Wed Aug 3 07:44:15 2011 (r224627) @@ -51,7 +51,6 @@ extern void ath_tx_tid_hw_queue_aggr(str int tid); extern void ath_tx_tid_hw_queue_norm(struct ath_softc *sc, struct ath_node *an, int tid); -extern void ath_tx_hw_queue(struct ath_softc *sc, struct ath_node *an); extern void ath_txq_sched(struct ath_softc *sc, struct ath_txq *txq); /* TX addba handling */ From owner-svn-src-user@FreeBSD.ORG Wed Aug 3 08:55:51 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5976D1065672; Wed, 3 Aug 2011 08:55:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3378FC0A; Wed, 3 Aug 2011 08:55:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p738tpxh094097; Wed, 3 Aug 2011 08:55:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p738tpJ8094094; Wed, 3 Aug 2011 08:55:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108030855.p738tpJ8094094@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 08:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224628 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 08:55:51 -0000 Author: adrian Date: Wed Aug 3 08:55:50 2011 New Revision: 224628 URL: http://svn.freebsd.org/changeset/base/224628 Log: Implement TID TX queue pause and unpause. This is needed for a clean implementation of ADDBA packet buffering. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Aug 3 07:44:15 2011 (r224627) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Aug 3 08:55:50 2011 (r224628) @@ -1542,6 +1542,38 @@ ath_tx_tid_init(struct ath_softc *sc, st } /* + * Pause the current TID. This stops packets from being transmitted + * on it. + */ +static void +ath_tx_tid_pause(struct ath_softc *sc, struct ath_tid *tid) +{ + int ac = TID_TO_WME_AC(tid->tid); + struct ath_txq *txq = sc->sc_ac2q[ac]; + + ATH_TXQ_LOCK_ASSERT(txq); + tid->paused++; +} + +static void +ath_tx_tid_resume(struct ath_softc *sc, struct ath_tid *tid) +{ + int ac = TID_TO_WME_AC(tid->tid); + struct ath_txq *txq = sc->sc_ac2q[ac]; + + ATH_TXQ_LOCK_ASSERT(txq); + tid->paused--; + + if (tid->paused) + return; + if (tid->axq_depth == 0) + return; + + ath_tx_node_sched(sc, tid->an, tid->tid); + ath_txq_sched(sc, txq); +} + +/* * Mark packets currently in the hardware TXQ from this TID * as now having no parent software TXQ. * @@ -1763,8 +1795,12 @@ ath_txq_sched(struct ath_softc *sc, stru * packets at the hardware. */ STAILQ_FOREACH_SAFE(atid, &txq->axq_tidq, axq_qelem, next) { - if (ath_tx_ampdu_pending(sc, atid->an, atid->tid)) { - /* XXX TODO should remove it from the list */ + /* + * Suspend paused queues here; they'll be resumed + * once the addba completes or times out. + */ + if (atid->paused) { + ath_tx_node_unsched(sc, atid->an, atid->tid); continue; } if (ath_tx_ampdu_running(sc, atid->an, atid->tid)) @@ -1850,6 +1886,14 @@ ath_addba_request(struct ieee80211_node int dialogtoken, int baparamset, int batimeout) { struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; + int tid = WME_AC_TO_TID(tap->txa_ac); + struct ath_node *an = ATH_NODE(ni); + struct ath_tid *atid = &an->an_tid[tid]; + + ATH_TXQ_LOCK(sc->sc_ac2q[tap->txa_ac]); + ath_tx_tid_pause(sc, atid); + ATH_TXQ_UNLOCK(sc->sc_ac2q[tap->txa_ac]); + return sc->sc_addba_request(ni, tap, dialogtoken, baparamset, batimeout); } @@ -1867,11 +1911,13 @@ ath_addba_response(struct ieee80211_node int dialogtoken, int code, int batimeout) { struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; + int tid = WME_AC_TO_TID(tap->txa_ac); + struct ath_node *an = ATH_NODE(ni); + struct ath_tid *atid = &an->an_tid[tid]; - /* - * XXX todo: resume the ath_node/TID now, rather than - * XXX waiting for the next packet to trigger a TX. - */ + ATH_TXQ_LOCK(sc->sc_ac2q[tap->txa_ac]); + ath_tx_tid_resume(sc, atid); + ATH_TXQ_UNLOCK(sc->sc_ac2q[tap->txa_ac]); return sc->sc_addba_response(ni, tap, dialogtoken, code, batimeout); } @@ -1887,5 +1933,11 @@ void ath_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) { struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; +#if 0 + int tid = WME_AC_TO_TID(tap->txa_ac); + struct ath_node *an = ATH_NODE(ni); + struct ath_tid *atid = an->an_tid[tid]; +#endif + sc->sc_addba_stop(ni, tap); } Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Wed Aug 3 07:44:15 2011 (r224627) +++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Wed Aug 3 08:55:50 2011 (r224628) @@ -102,6 +102,7 @@ struct ath_tid { */ STAILQ_ENTRY(ath_tid) axq_qelem; int sched; + int paused; /* >0 if the TID has been paused */ /* * The following implements a ring representing From owner-svn-src-user@FreeBSD.ORG Wed Aug 3 09:21:53 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAD7F106566C; Wed, 3 Aug 2011 09:21:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0D908FC0A; Wed, 3 Aug 2011 09:21:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p739LqD4094958; Wed, 3 Aug 2011 09:21:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p739LqcF094956; Wed, 3 Aug 2011 09:21:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108030921.p739LqcF094956@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 09:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224629 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 09:21:53 -0000 Author: adrian Date: Wed Aug 3 09:21:52 2011 New Revision: 224629 URL: http://svn.freebsd.org/changeset/base/224629 Log: * Rename the tid schedule function, it doesn't schedule the node anymore, just that tid Fix a LOR that I introduced: * Remove the locking requirement for ath_tx_tid_free_pkts - it should only occur in one place - when the ieee80211_node is being freed (and thus the IEEE80211_NODE_LOCK is held.) There's still another LOR which needs sorting out. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Aug 3 08:55:50 2011 (r224628) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Wed Aug 3 09:21:52 2011 (r224629) @@ -1402,7 +1402,7 @@ ath_tx_action_frame_override_queue(struc * The relevant hw txq lock should be held. */ static void -ath_tx_node_sched(struct ath_softc *sc, struct ath_node *an, int tid) +ath_tx_tid_sched(struct ath_softc *sc, struct ath_node *an, int tid) { struct ath_tid *atid = &an->an_tid[tid]; int ac = TID_TO_WME_AC(tid); @@ -1425,7 +1425,7 @@ ath_tx_node_sched(struct ath_softc *sc, * The relevant hw txq lock should be held. */ static void -ath_tx_node_unsched(struct ath_softc *sc, struct ath_node *an, int tid) +ath_tx_tid_unsched(struct ath_softc *sc, struct ath_node *an, int tid) { struct ath_tid *atid = &an->an_tid[tid]; int ac = TID_TO_WME_AC(tid); @@ -1502,7 +1502,7 @@ ath_tx_swq(struct ath_softc *sc, struct ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); /* Mark the given tid as having packets to dequeue */ - ath_tx_node_sched(sc, an, tid); + ath_tx_tid_sched(sc, an, tid); } /* @@ -1569,7 +1569,7 @@ ath_tx_tid_resume(struct ath_softc *sc, if (tid->axq_depth == 0) return; - ath_tx_node_sched(sc, tid->an, tid->tid); + ath_tx_tid_sched(sc, tid->an, tid->tid); ath_txq_sched(sc, txq); } @@ -1604,10 +1604,6 @@ ath_tx_tid_free_pkts(struct ath_softc *s { struct ath_tid *atid = &an->an_tid[tid]; struct ath_buf *bf; - int ac = TID_TO_WME_AC(tid); - struct ath_txq *txq = sc->sc_ac2q[ac]; - - ATH_TXQ_LOCK_ASSERT(txq); /* Walk the queue, free frames */ for (;;) { @@ -1634,11 +1630,11 @@ ath_tx_node_flush(struct ath_softc *sc, ATH_TXQ_LOCK(txq); /* Remove this tid from the list of active tids */ - ath_tx_node_unsched(sc, an, tid); + ath_tx_tid_unsched(sc, an, tid); + ATH_TXQ_UNLOCK(txq); /* Free packets */ ath_tx_tid_free_pkts(sc, an, tid); - ATH_TXQ_UNLOCK(txq); } /* @@ -1800,7 +1796,7 @@ ath_txq_sched(struct ath_softc *sc, stru * once the addba completes or times out. */ if (atid->paused) { - ath_tx_node_unsched(sc, atid->an, atid->tid); + ath_tx_tid_unsched(sc, atid->an, atid->tid); continue; } if (ath_tx_ampdu_running(sc, atid->an, atid->tid)) @@ -1810,7 +1806,7 @@ ath_txq_sched(struct ath_softc *sc, stru /* Empty? Remove */ if (atid->axq_depth == 0) - ath_tx_node_unsched(sc, atid->an, atid->tid); + ath_tx_tid_unsched(sc, atid->an, atid->tid); } } From owner-svn-src-user@FreeBSD.ORG Wed Aug 3 09:32:58 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34CF21065767; Wed, 3 Aug 2011 09:32:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B3C38FC15; Wed, 3 Aug 2011 09:32:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p739Wvoc095314; Wed, 3 Aug 2011 09:32:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p739WvIL095312; Wed, 3 Aug 2011 09:32:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108030932.p739WvIL095312@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 09:32:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224630 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 09:32:58 -0000 Author: adrian Date: Wed Aug 3 09:32:57 2011 New Revision: 224630 URL: http://svn.freebsd.org/changeset/base/224630 Log: Revert the previous commit - it meant a LOR was unavoidable between the TXQ lock and the IEEE80211_NODE_LOCK. Eg: 1st 0xc086c6cc ath1_node_lock (ath1_node_lock) @ /data/freebsd/mips/if_ath_tx/src/sys/net80211/ieee80211_node.c:1702 2nd 0x80a02738 ath1_txq1 (ath1_txq1) @ /data/freebsd/mips/if_ath_tx/src/sys/dev/ath/if_ath_tx.c:1631 1st 0x80a027c8 ath1_txq3 (ath1_txq3) @ /data/freebsd/mips/if_ath_tx/src/sys/dev/ath/if_ath.c:4147 2nd 0xc086c6cc ath1_node_lock (ath1_node_lock) @ /data/freebsd/mips/if_ath_tx/src/sys/net80211/ieee80211_node.c:1702 I'm going to do some digging to see whether this is a false LOR - ie, whether it's possible for the LOR to involve the same node AND TXQ. For now, this means completion functions need to do their own TXQ locking if they're going to fiddle with TID state. This introduces a few potential race conditions - which is why I'd like to hold this lock across the completion function if possible. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Aug 3 09:21:52 2011 (r224629) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Aug 3 09:32:57 2011 (r224630) @@ -4146,9 +4146,11 @@ ath_tx_processq(struct ath_softc *sc, st nacked = 0; ATH_TXQ_LOCK(txq); for (;;) { + ATH_TXQ_LOCK(txq); txq->axq_intrcnt = 0; /* reset periodic desc intr count */ bf = STAILQ_FIRST(&txq->axq_q); if (bf == NULL) { + ATH_TXQ_UNLOCK(txq); break; } ds0 = &bf->bf_desc[0]; @@ -4161,6 +4163,7 @@ ath_tx_processq(struct ath_softc *sc, st status == HAL_OK); #endif if (status == HAL_EINPROGRESS) { + ATH_TXQ_UNLOCK(txq); break; } ATH_TXQ_REMOVE_HEAD(txq, bf_list); @@ -4177,6 +4180,7 @@ ath_tx_processq(struct ath_softc *sc, st if (txq->axq_depth == 0) #endif txq->axq_link = NULL; + ATH_TXQ_UNLOCK(txq); ni = bf->bf_node; /* @@ -4220,6 +4224,14 @@ ath_tx_processq(struct ath_softc *sc, st #endif /* Kick the TXQ scheduler */ + /* + * We can't hold the TXQ lock across the completion function; + * the IEEE80211_NODE_LOCK is likely going to be held there + * during buffer/node free. It's up to the completion + * function to grab the TXQ lock before updating TID state + * (eg sliding the BAW along.) + */ + ATH_TXQ_LOCK(txq); ath_txq_sched(sc, txq); ATH_TXQ_UNLOCK(txq); From owner-svn-src-user@FreeBSD.ORG Wed Aug 3 09:42:48 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B8F51065674; Wed, 3 Aug 2011 09:42:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BE1D8FC13; Wed, 3 Aug 2011 09:42:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p739gmip095631; Wed, 3 Aug 2011 09:42:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p739gmdg095629; Wed, 3 Aug 2011 09:42:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108030942.p739gmdg095629@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 09:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224631 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 09:42:48 -0000 Author: adrian Date: Wed Aug 3 09:42:48 2011 New Revision: 224631 URL: http://svn.freebsd.org/changeset/base/224631 Log: Ooops.. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Aug 3 09:32:57 2011 (r224630) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Aug 3 09:42:48 2011 (r224631) @@ -4144,7 +4144,6 @@ ath_tx_processq(struct ath_softc *sc, st (caddr_t)(uintptr_t) ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum), txq->axq_link); nacked = 0; - ATH_TXQ_LOCK(txq); for (;;) { ATH_TXQ_LOCK(txq); txq->axq_intrcnt = 0; /* reset periodic desc intr count */ From owner-svn-src-user@FreeBSD.ORG Wed Aug 3 23:36:04 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A4F6106564A; Wed, 3 Aug 2011 23:36:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BF038FC12; Wed, 3 Aug 2011 23:36:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p73Na4mC034908; Wed, 3 Aug 2011 23:36:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p73Na4W6034906; Wed, 3 Aug 2011 23:36:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108032336.p73Na4W6034906@svn.freebsd.org> From: Adrian Chadd Date: Wed, 3 Aug 2011 23:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224643 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2011 23:36:04 -0000 Author: adrian Date: Wed Aug 3 23:36:04 2011 New Revision: 224643 URL: http://svn.freebsd.org/changeset/base/224643 Log: Hold the ath_node lock when doing TX completion so the rate control code doesn't trample over itself. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Aug 3 20:21:52 2011 (r224642) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Wed Aug 3 23:36:04 2011 (r224643) @@ -4205,8 +4205,11 @@ ath_tx_processq(struct ath_softc *sc, st * Hand the descriptor to the rate control algorithm. */ if ((ts->ts_status & HAL_TXERR_FILT) == 0 && - (bf->bf_txflags & HAL_TXDESC_NOACK) == 0) + (bf->bf_txflags & HAL_TXDESC_NOACK) == 0) { + ATH_NODE_LOCK(an); ath_rate_tx_complete(sc, an, bf); + ATH_NODE_UNLOCK(an); + } } if (bf->bf_comp == NULL) From owner-svn-src-user@FreeBSD.ORG Fri Aug 5 06:57:44 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B36351065670; Fri, 5 Aug 2011 06:57:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A28D18FC0C; Fri, 5 Aug 2011 06:57:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p756vibc094539; Fri, 5 Aug 2011 06:57:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p756viGF094536; Fri, 5 Aug 2011 06:57:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108050657.p756viGF094536@svn.freebsd.org> From: Adrian Chadd Date: Fri, 5 Aug 2011 06:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224654 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2011 06:57:44 -0000 Author: adrian Date: Fri Aug 5 06:57:44 2011 New Revision: 224654 URL: http://svn.freebsd.org/changeset/base/224654 Log: Flip back to having the TXQ lock held during the whole of ath_tx_processq(). I'll deal with correcting the locking later so LORs don't occur. For now, this will let me write TX packet completion functions to implement BAW tracking and aggregation, which will update per-TID state. Having the TXQ locked in this way means that: (a) the order of TXQ completions being processed will be correct - ie, multiple concurrent calls to ath_tx_processq() for the same TXQ won't mess things up; (b) the per-TID state is correctly locked, so concurrent TX scheduling and TX completion isn't going to end up with subtle race conditions. As long as completions are only ever called from ath_tx_proc(), this should be fine - it won't race with itself. The race conditions are what I'm worried about. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Thu Aug 4 17:17:57 2011 (r224653) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Fri Aug 5 06:57:44 2011 (r224654) @@ -4139,17 +4139,16 @@ ath_tx_processq(struct ath_softc *sc, st int nacked; HAL_STATUS status; + ATH_TXQ_LOCK(txq); DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: tx queue %u head %p link %p\n", __func__, txq->axq_qnum, (caddr_t)(uintptr_t) ath_hal_gettxbuf(sc->sc_ah, txq->axq_qnum), txq->axq_link); nacked = 0; for (;;) { - ATH_TXQ_LOCK(txq); txq->axq_intrcnt = 0; /* reset periodic desc intr count */ bf = STAILQ_FIRST(&txq->axq_q); if (bf == NULL) { - ATH_TXQ_UNLOCK(txq); break; } ds0 = &bf->bf_desc[0]; @@ -4162,7 +4161,6 @@ ath_tx_processq(struct ath_softc *sc, st status == HAL_OK); #endif if (status == HAL_EINPROGRESS) { - ATH_TXQ_UNLOCK(txq); break; } ATH_TXQ_REMOVE_HEAD(txq, bf_list); @@ -4179,7 +4177,6 @@ ath_tx_processq(struct ath_softc *sc, st if (txq->axq_depth == 0) #endif txq->axq_link = NULL; - ATH_TXQ_UNLOCK(txq); ni = bf->bf_node; /* @@ -4226,14 +4223,6 @@ ath_tx_processq(struct ath_softc *sc, st #endif /* Kick the TXQ scheduler */ - /* - * We can't hold the TXQ lock across the completion function; - * the IEEE80211_NODE_LOCK is likely going to be held there - * during buffer/node free. It's up to the completion - * function to grab the TXQ lock before updating TID state - * (eg sliding the BAW along.) - */ - ATH_TXQ_LOCK(txq); ath_txq_sched(sc, txq); ATH_TXQ_UNLOCK(txq); From owner-svn-src-user@FreeBSD.ORG Fri Aug 5 17:15:47 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 602411065677; Fri, 5 Aug 2011 17:15:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FCF78FC1A; Fri, 5 Aug 2011 17:15:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p75HFlV9014473; Fri, 5 Aug 2011 17:15:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p75HFlpN014470; Fri, 5 Aug 2011 17:15:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108051715.p75HFlpN014470@svn.freebsd.org> From: Adrian Chadd Date: Fri, 5 Aug 2011 17:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224658 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2011 17:15:47 -0000 Author: adrian Date: Fri Aug 5 17:15:46 2011 New Revision: 224658 URL: http://svn.freebsd.org/changeset/base/224658 Log: Begin fleshing out BAW tracking. baw_head/baw_tail implement a sliding window. tx_buf is an array of active frames inside the BAW. Frames that are being TXed are added to the relevant spot in tx_buf, with the baw_head/baw_tail sliding window updated. Frames that have been transmitted (successfully or not) are removed from the tx_buf array, and txa_start (the BAW left edge) is then updated. This is in no way complete and is missing a few things, notably keeping the BAW up to date when flushing a TID/node, or when a TID/node aggregation session is being torn down. There's no software retransmit, and there's currently no support yet for sending a BAR when the TX window has been forcibly moved after a TX failure. There's also a "gap" between the advertised BAW start during ADDBA and the first sequence number that is queued as an aggregate frame. Obtained from: Atheros Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Fri Aug 5 15:07:28 2011 (r224657) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Fri Aug 5 17:15:46 2011 (r224658) @@ -100,6 +100,27 @@ __FBSDID("$FreeBSD$"); #include #include +/* + * some general macros + */ +#define INCR(_l, _sz) (_l) ++; (_l) &= ((_sz) - 1) +/* + * return block-ack bitmap index given sequence and starting sequence + */ +#define ATH_BA_INDEX(_st, _seq) (((_seq) - (_st)) & (IEEE80211_SEQ_RANGE - 1)) + +/* extracting the seqno from buffer seqno */ +#define SEQNO(_a) ((_a) >> IEEE80211_SEQ_SEQ_SHIFT) + +/* + * Whether the current sequence number is within the + * BAW. + */ +#define BAW_WITHIN(_start, _bawsz, _seqno) \ + ((((_seqno) - (_start)) & 4095) < (_bawsz)) + +static struct ieee80211_tx_ampdu * ath_tx_get_tx_tid(struct ath_node *an, + int tid); static int ath_tx_ampdu_pending(struct ath_softc *sc, struct ath_node *an, int tid); static int ath_tx_ampdu_running(struct ath_softc *sc, struct ath_node *an, @@ -946,8 +967,10 @@ ath_tx_start(struct ath_softc *sc, struc is_ampdu_pending = ath_tx_ampdu_pending(sc, ATH_NODE(ni), tid); is_ampdu = is_ampdu_tx | is_ampdu_pending; - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, ac=%d, is_ampdu=%d\n", +#if 0 + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, ac=%d, is_ampdu=%d\n", __func__, tid, pri, is_ampdu); +#endif /* Multicast frames go onto the software multicast queue */ if (ismcast) @@ -966,7 +989,7 @@ ath_tx_start(struct ath_softc *sc, struc * If needed, the sequence number has been assigned. * Squirrel it away somewhere easy to get to. */ - bf->bf_state.bfs_seqno = M_SEQNO_GET(m0); + bf->bf_state.bfs_seqno = M_SEQNO_GET(m0) << IEEE80211_SEQ_SEQ_SHIFT; #if 0 /* Is ampdu pending? fetch the seqno and print it out */ @@ -1394,6 +1417,90 @@ ath_tx_action_frame_override_queue(struc /* Per-node software queue operations */ /* + * Add the current packet to the given BAW. + * It is assumed that the current packet + * + * + fits inside the BAW; + * + already has had a sequence number allocated. + */ +static void +ath_tx_addto_baw(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid, struct ath_buf *bf) +{ + int index, cindex; + struct ieee80211_tx_ampdu *tap; + + if (bf->bf_state.bfs_isretried) + return; + + tap = ath_tx_get_tx_tid(an, tid->tid); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, seqno %d; window %d:%d\n", + __func__, tid->tid, SEQNO(bf->bf_state.bfs_seqno), + tap->txa_start, tap->txa_wnd); + + /* + * ni->ni_txseqs[] is the currently allocated seqno. + * the txa state contains the current baw start. + */ + #if 0 + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tap->txa_start: %d, seqno: %d\n", + __func__, tap->txa_start, SEQNO(bf->bf_state.bfs_seqno)); +#endif + index = ATH_BA_INDEX(tap->txa_start, SEQNO(bf->bf_state.bfs_seqno)); + cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); +#if 0 + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: index=%d, cindex=%d, baw head=%d, tail=%d\n", + __func__, index, cindex, tid->baw_head, tid->baw_tail); +#endif + +#if 0 + assert(tid->tx_buf[cindex] == NULL); +#endif + if (tid->tx_buf[cindex] != NULL) { + device_printf(sc->sc_dev, + "%s: ba packet dup (index=%d, cindex=%d, " + "head=%d, tail=%d)\n", + __func__, index, cindex, tid->baw_head, tid->baw_tail); + } + tid->tx_buf[cindex] = bf; + + if (index >= ((tid->baw_tail - tid->baw_head) & (ATH_TID_MAX_BUFS - 1))) { + tid->baw_tail = cindex; + INCR(tid->baw_tail, ATH_TID_MAX_BUFS); + } +} + +/* + * seq_start - left edge of BAW + * seq_next - current/next sequence number to allocate + */ +static void +ath_tx_update_baw(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid, int seqno) +{ + int index, cindex; + struct ieee80211_tx_ampdu *tap; + + tap = ath_tx_get_tx_tid(an, tid->tid); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, baw=%d:%d, seqno=%d\n", + __func__, tid->tid, tap->txa_start, tap->txa_wnd, seqno); + + index = ATH_BA_INDEX(tap->txa_start, seqno); + cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); +#if 0 + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: index=%d, cindex=%d, baw head=%d, tail=%d\n", + __func__, index, cindex, tid->baw_head, tid->baw_tail); +#endif + + tid->tx_buf[cindex] = NULL; + + while (tid->baw_head != tid->baw_tail && !tid->tx_buf[tid->baw_head]) { + INCR(tap->txa_start, IEEE80211_SEQ_RANGE); + INCR(tid->baw_head, ATH_TID_MAX_BUFS); + } +} + +/* * Mark the current node/TID as ready to TX. * * This is done to make it easy for the software scheduler to @@ -1463,7 +1570,8 @@ ath_tx_tid_seqno_assign(struct ath_softc return -1; /* Manually assign sequence number */ - seqno = ni->ni_txseqs[tid]++; + seqno = ni->ni_txseqs[tid]; + INCR(ni->ni_txseqs[tid], IEEE80211_SEQ_RANGE); *(uint16_t *)&wh->i_seq[0] = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); M_SEQNO_SET(m0, seqno); @@ -1530,7 +1638,7 @@ ath_tx_swq(struct ath_softc *sc, struct void ath_tx_tid_init(struct ath_softc *sc, struct ath_node *an) { - int i; + int i, j; struct ath_tid *atid; for (i = 0; i < IEEE80211_TID_SIZE; i++) { @@ -1538,6 +1646,11 @@ ath_tx_tid_init(struct ath_softc *sc, st STAILQ_INIT(&atid->axq_q); atid->tid = i; atid->an = an; + for (j = 0; j < ATH_TID_MAX_BUFS; j++) + atid->tx_buf[j] = NULL; + atid->baw_head = atid->baw_tail = 0; + atid->paused = 0; + atid->sched = 0; } } @@ -1611,6 +1724,7 @@ ath_tx_tid_free_pkts(struct ath_softc *s if (bf == NULL) { break; } + /* XXX update BAW if needed? */ ATH_TXQ_REMOVE_HEAD(atid, bf_list); ath_tx_freebuf(sc, bf, -1); } @@ -1673,9 +1787,10 @@ ath_tx_tid_cleanup(struct ath_softc *sc, static void ath_tx_aggr_comp(struct ath_softc *sc, struct ath_buf *bf) { - /* Success? Complete */ - ath_tx_default_comp(sc, bf); - + struct ieee80211_node *ni = bf->bf_node; + struct ath_node *an = ATH_NODE(ni); + int tid = bf->bf_state.bfs_tid; + struct ath_tid *atid = &an->an_tid[tid]; /* * Not success and have retries left? * @@ -1690,6 +1805,14 @@ ath_tx_aggr_comp(struct ath_softc *sc, s * wasn't, we send a BAR to advance the pointer to that * place. */ + + /* Success? Complete */ + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: seqno %d\n", + __func__, SEQNO(bf->bf_state.bfs_seqno)); + ath_tx_update_baw(sc, an, atid, SEQNO(bf->bf_state.bfs_seqno)); + + ath_tx_default_comp(sc, bf); + /* bf is freed at this point */ } /* @@ -1703,14 +1826,26 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft struct ath_buf *bf; struct ath_txq *txq; struct ath_tid *atid = &an->an_tid[tid]; + struct ieee80211_tx_ampdu *tap; for (;;) { bf = STAILQ_FIRST(&atid->axq_q); if (bf == NULL) { break; } + tap = ath_tx_get_tx_tid(an, tid); /* XXX check if seqno is outside of BAW, if so don't queue it */ + if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, + SEQNO(bf->bf_state.bfs_seqno))) { + DPRINTF(sc, ATH_DEBUG_SW_TX, + "%s: seq %d outside of %d/%d; waiting\n", + __func__, SEQNO(bf->bf_state.bfs_seqno), + tap->txa_start, tap->txa_wnd); + break; + } + + ath_tx_addto_baw(sc, an, atid, bf); /* * XXX If the seqno is out of BAW, then we should pause this TID @@ -1825,7 +1960,7 @@ ath_tx_get_tx_tid(struct ath_node *an, i int ac; if (tid == IEEE80211_NONQOS_TID) - return 0; + return NULL; ac = TID_TO_WME_AC(tid); Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Fri Aug 5 15:07:28 2011 (r224657) +++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Fri Aug 5 17:15:46 2011 (r224658) @@ -113,9 +113,12 @@ struct ath_tid { * shifted the head/tail of the array are also * appropriately shifted. */ - struct ath_buf *tx_buf[ATH_TID_MAX_BUFS]; /* active tx buffers, beginning at current BAW */ - int baw_head; /* where the baw head is in the array */ - int baw_tail; /* where the BAW tail is in the array */ + /* active tx buffers, beginning at current BAW */ + struct ath_buf *tx_buf[ATH_TID_MAX_BUFS]; + /* where the baw head is in the array */ + int baw_head; + /* where the BAW tail is in the array */ + int baw_tail; }; /* driver-specific node state */ From owner-svn-src-user@FreeBSD.ORG Sat Aug 6 04:49:25 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96A60106566B; Sat, 6 Aug 2011 04:49:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85EF28FC08; Sat, 6 Aug 2011 04:49:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p764nPpj035524; Sat, 6 Aug 2011 04:49:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p764nP87035521; Sat, 6 Aug 2011 04:49:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108060449.p764nP87035521@svn.freebsd.org> From: Adrian Chadd Date: Sat, 6 Aug 2011 04:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224669 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 04:49:25 -0000 Author: adrian Date: Sat Aug 6 04:49:25 2011 New Revision: 224669 URL: http://svn.freebsd.org/changeset/base/224669 Log: Now that aggregation and BAW tracking are in place, a whole lot of bad assumptions (on my part, unfortunately) have crept up. * Add some more debugging. * Store away the original packet priority in ath_buf * The TID is being incorrectly assigned. The TID should be 16 for non-QoS packets, regardless of what the priority is. The trouble is, the rest of the code assumes all packets in the given TID are destined for the same hardware txq - ie, they all have the same WME access class/priority value. For example, if a packet has priority 0 (via M_WME_GETAC()) and is a QoS enabled packet, it'll get a TID of 0. When aggregation is enabled, these packets will also be tossed into the aggregation state. Fine. If a packet has priority 0 but isn't a QoS enabled packet, it'll also get a TID of 0. This breaks things - non-QoS packets get thrown into the aggregation state and suddenly everything is unhappy. If I put non-QoS packets into TID 16, then I'm in the unhappy situation that the packet priority may be non-zero (well, it may be non-constant) and things suddenly crash. This actually occurs in ieee80211_mgmt_output(): ieee80211_send_setup(ni, m, IEEE80211_FC0_TYPE_MGT | type, IEEE80211_NONQOS_TID, vap->iv_myaddr, ni->ni_macaddr, ni->ni_bssid); ... M_WME_SETAC(m, params->ibp_pri); So before I can continue, I likely need to correctly handle TID=16 (non-QoS frames) which can have differing AC/PRI, and thus different hardware TX queues. This influences what the locking requirements are. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Sat Aug 6 03:40:33 2011 (r224668) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Sat Aug 6 04:49:25 2011 (r224669) @@ -967,10 +967,8 @@ ath_tx_start(struct ath_softc *sc, struc is_ampdu_pending = ath_tx_ampdu_pending(sc, ATH_NODE(ni), tid); is_ampdu = is_ampdu_tx | is_ampdu_pending; -#if 0 DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, ac=%d, is_ampdu=%d\n", __func__, tid, pri, is_ampdu); -#endif /* Multicast frames go onto the software multicast queue */ if (ismcast) @@ -991,13 +989,11 @@ ath_tx_start(struct ath_softc *sc, struc */ bf->bf_state.bfs_seqno = M_SEQNO_GET(m0) << IEEE80211_SEQ_SEQ_SHIFT; -#if 0 /* Is ampdu pending? fetch the seqno and print it out */ if (is_ampdu_pending) - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid %d: ampdu pending, seqno %d\n", __func__, tid, M_SEQNO_GET(m0)); -#endif /* This also sets up the DMA map */ r = ath_tx_normal_setup(sc, ni, bf, m0); @@ -1564,6 +1560,8 @@ ath_tx_tid_seqno_assign(struct ath_softc wh = mtod(m0, struct ieee80211_frame *); pri = M_WME_GETAC(m0); /* honor classification */ tid = WME_AC_TO_TID(pri); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: pri=%d, tid=%d, qos has seq=%d\n", + __func__, pri, tid, IEEE80211_QOS_HAS_SEQ(wh)); /* Does the packet require a sequence number? */ if (! IEEE80211_QOS_HAS_SEQ(wh)) @@ -1576,6 +1574,7 @@ ath_tx_tid_seqno_assign(struct ath_softc M_SEQNO_SET(m0, seqno); /* Return so caller can do something with it if needed */ + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: -> seqno=%d\n", __func__, seqno); return seqno; } @@ -1600,11 +1599,34 @@ ath_tx_swq(struct ath_softc *sc, struct wh = mtod(m0, struct ieee80211_frame *); pri = M_WME_GETAC(m0); /* honor classification */ tid = WME_AC_TO_TID(pri); +#if 0 + /* + * XXX This is correct! + * + * It however breaks the rest of the code, which currently assumes + * a constant mapping from TID->WME AC->hardware queue. + * Non-QoS frames will have a TID of 16. They may end up with a TXQ + * that differs to what the classification states? + * + * I'll have to go back over the code and audit exactly what's going + * on before I can flip this on. + * + * With this off, non-QoS traffic in pri=0 gets thorwn into tid=0, + * which means it gets punted to the aggregation code. + * This breaks things. + */ + if (! IEEE80211_QOS_HAS_SEQ(wh)) + tid = IEEE80211_NONQOS_TID; +#endif atid = &an->an_tid[tid]; + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: pri=%d, tid=%d, qos=%d\n", + __func__, pri, tid, IEEE80211_QOS_HAS_SEQ(wh)); + /* Set local packet state, used to queue packets to hardware */ bf->bf_state.bfs_tid = tid; bf->bf_state.bfs_txq = txq; + bf->bf_state.bfs_pri = pri; /* Queue frame to the tail of the software queue */ ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); @@ -1828,12 +1850,21 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft struct ath_tid *atid = &an->an_tid[tid]; struct ieee80211_tx_ampdu *tap; + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d\n", __func__, tid); + + tap = ath_tx_get_tx_tid(an, tid); + for (;;) { bf = STAILQ_FIRST(&atid->axq_q); if (bf == NULL) { break; } - tap = ath_tx_get_tx_tid(an, tid); + if (bf->bf_state.bfs_tid != tid) + device_printf(sc->sc_dev, "%s: TID: tid=%d, ac=%d, bf tid=%d\n", + __func__, tid, TID_TO_WME_AC(tid), bf->bf_state.bfs_tid); + if (sc->sc_ac2q[TID_TO_WME_AC(tid)] != bf->bf_state.bfs_txq) + device_printf(sc->sc_dev, "%s: TXQ: tid=%d, ac=%d, bf tid=%d\n", + __func__, tid, TID_TO_WME_AC(tid), bf->bf_state.bfs_tid); /* XXX check if seqno is outside of BAW, if so don't queue it */ if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, @@ -1998,7 +2029,6 @@ ath_tx_ampdu_pending(struct ath_softc *s return !! (tap->txa_flags & IEEE80211_AGGR_XCHGPEND); } - /* * Is AMPDU-TX pending for the given TID? */ Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Sat Aug 6 03:40:33 2011 (r224668) +++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Sat Aug 6 04:49:25 2011 (r224669) @@ -175,6 +175,7 @@ struct ath_buf { int bfs_seqno; /* sequence number of this packet */ int bfs_retries; /* retry count */ uint16_t bfs_tid; /* packet TID (or TID_MAX for no QoS) */ + uint16_t bfs_pri; /* packet AC priority */ struct ath_txq *bfs_txq; /* eventual dest hardware TXQ */ uint16_t bfs_al; /* length of aggregate */ uint16_t bfs_pktdur; /* packet duration (at current rate?) */ From owner-svn-src-user@FreeBSD.ORG Sat Aug 6 10:13:00 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC430106564A; Sat, 6 Aug 2011 10:12:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D15038FC13; Sat, 6 Aug 2011 10:12:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76ACx9i045240; Sat, 6 Aug 2011 10:12:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76ACxJs045237; Sat, 6 Aug 2011 10:12:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108061012.p76ACxJs045237@svn.freebsd.org> From: Adrian Chadd Date: Sat, 6 Aug 2011 10:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224675 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 10:13:00 -0000 Author: adrian Date: Sat Aug 6 10:12:59 2011 New Revision: 224675 URL: http://svn.freebsd.org/changeset/base/224675 Log: Introduce some rather annoying work arounds to make the TID->AC map consistent. The introduction of BAW tracking and blocking have shown short-comings in my code. Specifically, I assumed that the TID->AC mapping would be consistent. I've found a few things that get that wrong, specifically: * frames with no QOS bit set were being dumped into TID=0, regardless of the access category; * That resulted in raw management frames with no TID getting TID=0 instead of TID=16 (IEEE80211_NONQOS_TID), but with AC's that could vary; * So frames were being scheduled in the wrong TID, then unscheduling them ended up selecting the wrong AC and thus hardware queue, and the lock assertions would trigger. The workarounds: * store the per-TID AC in ath_tid, just as a short-cut; * make TID 16 map to AC WME_AC_BE (best effort); * override the priority/TID that net80211 gives us, so frames that don't have the QOS bit set will end up being shovelled into WME_AC_BE and TID 16; * direct-dispatch multicast frames to the multicast software queue. This still hasn't resolved the BAW issues I've begun seeing. I'll investigate those shortly. It does however fix all the lock assertions from incorrect/inconsistent hardware queue / AC / TID mapping. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Sat Aug 6 09:16:53 2011 (r224674) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Sat Aug 6 10:12:59 2011 (r224675) @@ -139,6 +139,56 @@ ath_tx_is_11n(struct ath_softc *sc) return (sc->sc_ah->ah_magic == 0x20065416); } +/* + * Obtain the current TID from the given frame. + * + * Non-QoS frames need to go into TID 16 (IEEE80211_NONQOS_TID.) + * This has implications for which AC/priority the packet is placed + * in. + */ +static int +ath_tx_gettid(struct ath_softc *sc, const struct mbuf *m0) +{ + const struct ieee80211_frame *wh; + int pri = M_WME_GETAC(m0); + + wh = mtod(m0, const struct ieee80211_frame *); + if (! IEEE80211_QOS_HAS_SEQ(wh)) + return IEEE80211_NONQOS_TID; + else + return WME_AC_TO_TID(pri); +} + +/* + * Determine what the correct AC queue for the given frame + * should be. + * + * This code assumes that the TIDs map consistently to + * the underlying hardware (or software) ath_txq. + * Since the sender may try to set an AC which is + * arbitrary, non-QoS TIDs may end up being put on + * completely different ACs. There's no way to put a + * TID into multiple ath_txq's for scheduling, so + * for now we override the AC/TXQ selection and set + * non-QOS TID frames into the BE queue. + * + * This may be completely incorrect - specifically, + * some management frames may end up out of order + * compared to the QoS traffic they're controlling. + * I'll look into this later. + */ +static int +ath_tx_getac(struct ath_softc *sc, const struct mbuf *m0) +{ + const struct ieee80211_frame *wh; + int pri = M_WME_GETAC(m0); + wh = mtod(m0, const struct ieee80211_frame *); + if (IEEE80211_QOS_HAS_SEQ(wh)) + return pri; + + return WME_AC_BE; +} + void ath_txfrag_cleanup(struct ath_softc *sc, ath_bufhead *frags, struct ieee80211_node *ni) @@ -288,7 +338,8 @@ ath_tx_chaindesclist(struct ath_softc *s } static void -ath_tx_handoff_mcast(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf) +ath_tx_handoff_mcast(struct ath_softc *sc, struct ath_txq *txq, + struct ath_buf *bf) { ATH_TXQ_LOCK_ASSERT(txq); KASSERT((bf->bf_flags & ATH_BUF_BUSY) == 0, @@ -955,9 +1006,23 @@ ath_tx_start(struct ath_softc *sc, struc int is_ampdu, is_ampdu_tx, is_ampdu_pending; ieee80211_seq seqno; - /* Determine the target hardware queue! */ - pri = M_WME_GETAC(m0); /* honor classification */ - tid = WME_AC_TO_TID(pri); + /* + * Determine the target hardware queue. + * + * For multicast frames, the txq gets overridden to be the + * software TXQ and it's done via direct-dispatch. + * + * For any other frame, we do a TID/QoS lookup inside the frame + * to see what the TID should be. If it's a non-QoS frame, the + * AC and TID are overridden. The TID/TXQ code assumes the + * TID is on a predictable hardware TXQ, so we don't support + * having a node TID queued to multiple hardware TXQs. + * This may change in the future but would require some locking + * fudgery. + */ + pri = ath_tx_getac(sc, m0); + tid = ath_tx_gettid(sc, m0); + txq = sc->sc_ac2q[pri]; wh = mtod(m0, struct ieee80211_frame *); ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); @@ -1008,12 +1073,21 @@ ath_tx_start(struct ath_softc *sc, struc ath_tx_chaindesclist(sc, bf); #if 1 - ATH_TXQ_LOCK(txq); - /* add to software queue */ - ath_tx_swq(sc, ni, txq, bf, m0); - /* Kick txq */ - ath_txq_sched(sc, txq); - ATH_TXQ_UNLOCK(txq); + /* + * If it's a multicast frame, do a direct-dispatch to the + * destination hardware queue. Don't bother software + * queuing it. + */ + if (ismcast) + ath_tx_handoff_mcast(sc, txq, bf); + else { + ATH_TXQ_LOCK(txq); + /* add to software queue */ + ath_tx_swq(sc, ni, txq, bf, m0); + /* Kick txq */ + ath_txq_sched(sc, txq); + ATH_TXQ_UNLOCK(txq); + } #else /* @@ -1121,6 +1195,10 @@ ath_tx_raw_start(struct ath_softc *sc, s ctsrate = 0; pri = params->ibp_pri & 3; + /* Override pri if the frame isn't a QoS one */ + if (! IEEE80211_QOS_HAS_SEQ(wh)) + pri = ath_tx_getac(sc, m0); + /* * NB: we mark all packets as type PSPOLL so the h/w won't * set the sequence number, duration, etc. @@ -1438,7 +1516,7 @@ ath_tx_addto_baw(struct ath_softc *sc, s * ni->ni_txseqs[] is the currently allocated seqno. * the txa state contains the current baw start. */ - #if 0 +#if 0 DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tap->txa_start: %d, seqno: %d\n", __func__, tap->txa_start, SEQNO(bf->bf_state.bfs_seqno)); #endif @@ -1508,8 +1586,7 @@ static void ath_tx_tid_sched(struct ath_softc *sc, struct ath_node *an, int tid) { struct ath_tid *atid = &an->an_tid[tid]; - int ac = TID_TO_WME_AC(tid); - struct ath_txq *txq = sc->sc_ac2q[ac]; + struct ath_txq *txq = sc->sc_ac2q[atid->ac]; ATH_TXQ_LOCK_ASSERT(txq); @@ -1531,8 +1608,7 @@ static void ath_tx_tid_unsched(struct ath_softc *sc, struct ath_node *an, int tid) { struct ath_tid *atid = &an->an_tid[tid]; - int ac = TID_TO_WME_AC(tid); - struct ath_txq *txq = sc->sc_ac2q[ac]; + struct ath_txq *txq = sc->sc_ac2q[atid->ac]; ATH_TXQ_LOCK_ASSERT(txq); @@ -1578,7 +1654,6 @@ ath_tx_tid_seqno_assign(struct ath_softc return seqno; } - /* * Queue the given packet on the relevant software queue. * @@ -1597,27 +1672,8 @@ ath_tx_swq(struct ath_softc *sc, struct /* Fetch the TID - non-QoS frames get assigned to TID 16 */ wh = mtod(m0, struct ieee80211_frame *); - pri = M_WME_GETAC(m0); /* honor classification */ - tid = WME_AC_TO_TID(pri); -#if 0 - /* - * XXX This is correct! - * - * It however breaks the rest of the code, which currently assumes - * a constant mapping from TID->WME AC->hardware queue. - * Non-QoS frames will have a TID of 16. They may end up with a TXQ - * that differs to what the classification states? - * - * I'll have to go back over the code and audit exactly what's going - * on before I can flip this on. - * - * With this off, non-QoS traffic in pri=0 gets thorwn into tid=0, - * which means it gets punted to the aggregation code. - * This breaks things. - */ - if (! IEEE80211_QOS_HAS_SEQ(wh)) - tid = IEEE80211_NONQOS_TID; -#endif + pri = ath_tx_getac(sc, m0); + tid = ath_tx_gettid(sc, m0); atid = &an->an_tid[tid]; DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: pri=%d, tid=%d, qos=%d\n", @@ -1673,6 +1729,10 @@ ath_tx_tid_init(struct ath_softc *sc, st atid->baw_head = atid->baw_tail = 0; atid->paused = 0; atid->sched = 0; + if (i == IEEE80211_NONQOS_TID) + atid->ac = WME_AC_BE; + else + atid->ac = TID_TO_WME_AC(i); } } @@ -1683,8 +1743,7 @@ ath_tx_tid_init(struct ath_softc *sc, st static void ath_tx_tid_pause(struct ath_softc *sc, struct ath_tid *tid) { - int ac = TID_TO_WME_AC(tid->tid); - struct ath_txq *txq = sc->sc_ac2q[ac]; + struct ath_txq *txq = sc->sc_ac2q[tid->ac]; ATH_TXQ_LOCK_ASSERT(txq); tid->paused++; @@ -1693,8 +1752,7 @@ ath_tx_tid_pause(struct ath_softc *sc, s static void ath_tx_tid_resume(struct ath_softc *sc, struct ath_tid *tid) { - int ac = TID_TO_WME_AC(tid->tid); - struct ath_txq *txq = sc->sc_ac2q[ac]; + struct ath_txq *txq = sc->sc_ac2q[tid->ac]; ATH_TXQ_LOCK_ASSERT(txq); tid->paused--; @@ -1761,8 +1819,8 @@ ath_tx_node_flush(struct ath_softc *sc, int tid; for (tid = 0; tid < IEEE80211_TID_SIZE; tid++) { - int ac = TID_TO_WME_AC(tid); - struct ath_txq *txq = sc->sc_ac2q[ac]; + struct ath_tid *atid = &an->an_tid[tid]; + struct ath_txq *txq = sc->sc_ac2q[atid->ac]; ATH_TXQ_LOCK(txq); /* Remove this tid from the list of active tids */ @@ -1861,10 +1919,10 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft } if (bf->bf_state.bfs_tid != tid) device_printf(sc->sc_dev, "%s: TID: tid=%d, ac=%d, bf tid=%d\n", - __func__, tid, TID_TO_WME_AC(tid), bf->bf_state.bfs_tid); + __func__, tid, atid->ac, bf->bf_state.bfs_tid); if (sc->sc_ac2q[TID_TO_WME_AC(tid)] != bf->bf_state.bfs_txq) device_printf(sc->sc_dev, "%s: TXQ: tid=%d, ac=%d, bf tid=%d\n", - __func__, tid, TID_TO_WME_AC(tid), bf->bf_state.bfs_tid); + __func__, tid, atid->ac, bf->bf_state.bfs_tid); /* XXX check if seqno is outside of BAW, if so don't queue it */ if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, Modified: user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Sat Aug 6 09:16:53 2011 (r224674) +++ user/adrian/if_ath_tx/sys/dev/ath/if_athvar.h Sat Aug 6 10:12:59 2011 (r224675) @@ -95,6 +95,7 @@ struct ath_tid { u_int axq_depth; /* SW queue depth */ struct ath_node *an; /* pointer to parent */ int tid; /* tid */ + int ac; /* which AC gets this trafic */ /* * Entry on the ath_txq; when there's traffic From owner-svn-src-user@FreeBSD.ORG Sat Aug 6 11:43:00 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4454106564A; Sat, 6 Aug 2011 11:43:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C48B88FC16; Sat, 6 Aug 2011 11:43:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76Bh0mQ050297; Sat, 6 Aug 2011 11:43:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76Bh08h050294; Sat, 6 Aug 2011 11:43:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108061143.p76Bh08h050294@svn.freebsd.org> From: Adrian Chadd Date: Sat, 6 Aug 2011 11:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224677 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 11:43:01 -0000 Author: adrian Date: Sat Aug 6 11:43:00 2011 New Revision: 224677 URL: http://svn.freebsd.org/changeset/base/224677 Log: Try to figure out why an A-MPDU session hangs shortly after the session is established. * Add ATH_DEBUG_SW_TX_BAW, specifically for doing BAW debugging * Enforce that the relevant TXQ lock is held in the BAW update functions. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_debug.h user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_debug.h ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_debug.h Sat Aug 6 11:33:17 2011 (r224676) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_debug.h Sat Aug 6 11:43:00 2011 (r224677) @@ -58,6 +58,7 @@ enum { ATH_DEBUG_TDMA_TIMER = 0x01000000, /* TDMA timer processing */ ATH_DEBUG_REGDOMAIN = 0x02000000, /* regulatory processing */ ATH_DEBUG_SW_TX = 0x04000000, + ATH_DEBUG_SW_TX_BAW = 0x08000000, ATH_DEBUG_FATAL = 0x80000000, /* fatal errors */ ATH_DEBUG_ANY = 0xffffffff }; Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Sat Aug 6 11:33:17 2011 (r224676) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Sat Aug 6 11:43:00 2011 (r224677) @@ -1507,8 +1507,10 @@ ath_tx_addto_baw(struct ath_softc *sc, s if (bf->bf_state.bfs_isretried) return; + ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); + tap = ath_tx_get_tx_tid(an, tid->tid); - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, seqno %d; window %d:%d\n", + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: tid=%d, seqno %d; window %d:%d\n", __func__, tid->tid, SEQNO(bf->bf_state.bfs_seqno), tap->txa_start, tap->txa_wnd); @@ -1516,16 +1518,13 @@ ath_tx_addto_baw(struct ath_softc *sc, s * ni->ni_txseqs[] is the currently allocated seqno. * the txa state contains the current baw start. */ -#if 0 - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tap->txa_start: %d, seqno: %d\n", + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: tap->txa_start: %d, seqno: %d\n", __func__, tap->txa_start, SEQNO(bf->bf_state.bfs_seqno)); -#endif index = ATH_BA_INDEX(tap->txa_start, SEQNO(bf->bf_state.bfs_seqno)); cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); -#if 0 - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: index=%d, cindex=%d, baw head=%d, tail=%d\n", + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + "%s: index=%d, cindex=%d, baw head=%d, tail=%d\n", __func__, index, cindex, tid->baw_head, tid->baw_tail); -#endif #if 0 assert(tid->tx_buf[cindex] == NULL); @@ -1555,16 +1554,18 @@ ath_tx_update_baw(struct ath_softc *sc, int index, cindex; struct ieee80211_tx_ampdu *tap; + ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); + tap = ath_tx_get_tx_tid(an, tid->tid); DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, baw=%d:%d, seqno=%d\n", __func__, tid->tid, tap->txa_start, tap->txa_wnd, seqno); index = ATH_BA_INDEX(tap->txa_start, seqno); cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); -#if 0 - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: index=%d, cindex=%d, baw head=%d, tail=%d\n", + + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + "%s: index=%d, cindex=%d, baw head=%d, tail=%d\n", __func__, index, cindex, tid->baw_head, tid->baw_tail); -#endif tid->tx_buf[cindex] = NULL; @@ -1927,7 +1928,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft /* XXX check if seqno is outside of BAW, if so don't queue it */ if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, SEQNO(bf->bf_state.bfs_seqno))) { - DPRINTF(sc, ATH_DEBUG_SW_TX, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: seq %d outside of %d/%d; waiting\n", __func__, SEQNO(bf->bf_state.bfs_seqno), tap->txa_start, tap->txa_wnd); From owner-svn-src-user@FreeBSD.ORG Sat Aug 6 12:08:54 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E01FA106564A; Sat, 6 Aug 2011 12:08:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D10058FC12; Sat, 6 Aug 2011 12:08:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76C8rDx051069; Sat, 6 Aug 2011 12:08:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76C8ruq051067; Sat, 6 Aug 2011 12:08:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108061208.p76C8ruq051067@svn.freebsd.org> From: Adrian Chadd Date: Sat, 6 Aug 2011 12:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224678 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 12:08:54 -0000 Author: adrian Date: Sat Aug 6 12:08:53 2011 New Revision: 224678 URL: http://svn.freebsd.org/changeset/base/224678 Log: Add a comment about a recursive lock which I've discovered whilst debugging. Primarily so I don't forget. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Sat Aug 6 11:43:00 2011 (r224677) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath_tx.c Sat Aug 6 12:08:53 2011 (r224678) @@ -1813,6 +1813,28 @@ ath_tx_tid_free_pkts(struct ath_softc *s /* * Flush all software queued packets for the given node. + * + * XXX there's a recursive lock here which currently panics + * XXX the kernel. + * + * bringing the interface down/up causes a flush on interface + * _up_; the stack looks like this: + * + * + * ath_tx_node_flush - locks each hardware txq + * ieee80211_free_node + * ath_tx_freebuf + * ath_tx_default_comp + * ath_tx_processq - locks the hardware txq + * + * To fix? Not (yet) sure. Perhaps unsched the TID in freebuf + * if there's no further buffers for it; then only flush + * nodes w/ a lock below if the qlen is 0. But can the tid + * txq length be checked without having the txq locked? + * It'll be locked by someone, but if this node is being freed, + * in theory all references to the node should be released + * and thus there shouldn't be any packets in the TIDs for that + * node. Hm. */ void ath_tx_node_flush(struct ath_softc *sc, struct ath_node *an) From owner-svn-src-user@FreeBSD.ORG Sat Aug 6 14:25:12 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E887106566C; Sat, 6 Aug 2011 14:25:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F38828FC1A; Sat, 6 Aug 2011 14:25:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p76EPBXN055146; Sat, 6 Aug 2011 14:25:11 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p76EPBvV055144; Sat, 6 Aug 2011 14:25:11 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201108061425.p76EPBvV055144@svn.freebsd.org> From: Adrian Chadd Date: Sat, 6 Aug 2011 14:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224679 - user/adrian/if_ath_tx/sys/dev/ath X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Aug 2011 14:25:12 -0000 Author: adrian Date: Sat Aug 6 14:25:11 2011 New Revision: 224679 URL: http://svn.freebsd.org/changeset/base/224679 Log: The HT methods get overridden by ieee80211_ht_attach(), so we have to set them up -after- we call ieee80211_attach(). The addba setup/teardown routines are now properly being called. Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Modified: user/adrian/if_ath_tx/sys/dev/ath/if_ath.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Sat Aug 6 12:08:53 2011 (r224678) +++ user/adrian/if_ath_tx/sys/dev/ath/if_ath.c Sat Aug 6 14:25:11 2011 (r224679) @@ -647,14 +647,6 @@ ath_attach(u_int16_t devid, struct ath_s | IEEE80211_HTCAP_SMPS_OFF; /* SM power save off */ ; - sc->sc_addba_request = ic->ic_addba_request; - sc->sc_addba_response = ic->ic_addba_response; - sc->sc_addba_stop = ic->ic_addba_stop; - - ic->ic_addba_request = ath_addba_request; - ic->ic_addba_response = ath_addba_response; - ic->ic_addba_stop = ath_addba_stop; - /* * Enable short-GI for HT20 only if the hardware * advertises support. @@ -737,6 +729,15 @@ ath_attach(u_int16_t devid, struct ath_s ic->ic_scan_end = ath_scan_end; ic->ic_set_channel = ath_set_channel; + /* 802.11n specific - but just override anyway */ + sc->sc_addba_request = ic->ic_addba_request; + sc->sc_addba_response = ic->ic_addba_response; + sc->sc_addba_stop = ic->ic_addba_stop; + + ic->ic_addba_request = ath_addba_request; + ic->ic_addba_response = ath_addba_response; + ic->ic_addba_stop = ath_addba_stop; + ieee80211_radiotap_attach(ic, &sc->sc_tx_th.wt_ihdr, sizeof(sc->sc_tx_th), ATH_TX_RADIOTAP_PRESENT,