svn commit: r224566 - in head/usr.bin: cpio tar
Author: mm Date: Mon Aug 1 08:22:40 2011 New Revision: 224566 URL: http://svn.freebsd.org/changeset/base/224566 Log: Correctly link bsdcpio and bsdtar against libmd and libcrpyto by applying the change from r221472 (libarchive). Reviewed by: kientzle Approved by: re (kib) MFC after:3 days Modified: head/usr.bin/cpio/Makefile head/usr.bin/tar/Makefile Modified: head/usr.bin/cpio/Makefile == --- head/usr.bin/cpio/Makefile Mon Aug 1 08:17:54 2011(r224565) +++ head/usr.bin/cpio/Makefile Mon Aug 1 08:22:40 2011(r224566) @@ -19,11 +19,14 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../.. # statically linked, cannot use -lcrypto, and are size sensitive. CFLAGS+= -DSMALLER .endif -DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} ${LIBMD} ${LIBLZMA} ${LIBBSDXML} -LDADD= -larchive -lz -lbz2 -lmd -llzma -lbsdxml +DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} ${LIBLZMA} ${LIBBSDXML} +LDADD= -larchive -lz -lbz2 -llzma -lbsdxml .if ${MK_OPENSSL} != no DPADD+=${LIBCRYPTO} LDADD+= -lcrypto +.else +DPADD+= ${LIBMD} +LDADD+= -lmd .endif SYMLINKS=bsdcpio ${BINDIR}/cpio Modified: head/usr.bin/tar/Makefile == --- head/usr.bin/tar/Makefile Mon Aug 1 08:17:54 2011(r224565) +++ head/usr.bin/tar/Makefile Mon Aug 1 08:22:40 2011(r224566) @@ -18,12 +18,16 @@ SRCS+= err.c \ matching.c \ pathmatch.c -DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBLZMA} ${LIBBSDXML} -LDADD= -larchive -lbz2 -lz -lmd -llzma -lbsdxml +DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA} ${LIBBSDXML} +LDADD= -larchive -lbz2 -lz -llzma -lbsdxml .if ${MK_OPENSSL} != no DPADD+=${LIBCRYPTO} LDADD+= -lcrypto +.else +DPADD+= ${LIBMD} +LDADD+= -lmd .endif + CFLAGS+= -DBSDTAR_VERSION_STRING=\${BSDTAR_VERSION_STRING}\ CFLAGS+= -DPLATFORM_CONFIG_H=\config_freebsd.h\ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../lib/libarchive ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r224568 - head/share/man/man9
Author: kib Date: Mon Aug 1 08:52:05 2011 New Revision: 224568 URL: http://svn.freebsd.org/changeset/base/224568 Log: Fix markup. Approved by: re (hrs) Modified: head/share/man/man9/taskqueue.9 Modified: head/share/man/man9/taskqueue.9 == --- head/share/man/man9/taskqueue.9 Mon Aug 1 08:34:00 2011 (r224567) +++ head/share/man/man9/taskqueue.9 Mon Aug 1 08:52:05 2011 (r224568) @@ -188,7 +188,8 @@ The count is cleared, and the old value returned in the reference parameter .Fa pendp , -if it is non- Dv NULL . +if it is non- +.Dv NULL . If the task is currently running, .Dv EBUSY is returned, otherwise 0. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r224569 - head/lib/libmemstat
Author: pluknet Date: Mon Aug 1 09:43:35 2011 New Revision: 224569 URL: http://svn.freebsd.org/changeset/base/224569 Log: Get rid of MAXCPU knowledge used for internal needs only. Switch to dynamic memory allocation to hold per-CPU memory types data (sized to mp_maxid for UMA, and to mp_maxcpus for malloc to match the kernel). That fixes libmemstat with arbitrary large MAXCPU values and therefore eliminates MEMSTAT_ERROR_TOOMANYCPUS error type. Reviewed by: jhb Approved by: re (kib) Modified: head/lib/libmemstat/libmemstat.3 head/lib/libmemstat/memstat.c head/lib/libmemstat/memstat.h head/lib/libmemstat/memstat_internal.h head/lib/libmemstat/memstat_malloc.c head/lib/libmemstat/memstat_uma.c Modified: head/lib/libmemstat/libmemstat.3 == --- head/lib/libmemstat/libmemstat.3Mon Aug 1 08:52:05 2011 (r224568) +++ head/lib/libmemstat/libmemstat.3Mon Aug 1 09:43:35 2011 (r224569) @@ -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: head/lib/libmemstat/memstat.c == --- head/lib/libmemstat/memstat.c Mon Aug 1 08:52:05 2011 (r224568) +++ head/lib/libmemstat/memstat.c Mon Aug 1 09:43:35 2011 (r224569) @@ -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: head/lib/libmemstat/memstat.h == --- head/lib/libmemstat/memstat.h Mon Aug 1 08:52:05 2011 (r224568) +++ head/lib/libmemstat/memstat.h Mon Aug 1 09:43:35 2011 (r224569) @@ -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. - */ -#defineMEMSTAT_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 @@ #defineMEMSTAT_ERROR_NOMEMORY 1 /* Out of memory. */ #defineMEMSTAT_ERROR_VERSION 2 /* Unsupported version. */ #defineMEMSTAT_ERROR_PERMISSION3 /* Permission denied. */ -#defineMEMSTAT_ERROR_TOOMANYCPUS 4 /* Too many CPUs. */ #defineMEMSTAT_ERROR_DATAERROR 5 /* Error in stat data. */ #defineMEMSTAT_ERROR_KVM 6 /* See kvm_geterr() for err. */ #define
svn commit: r224571 - head/sys/net
Author: pluknet Date: Mon Aug 1 11:24:55 2011 New Revision: 224571 URL: http://svn.freebsd.org/changeset/base/224571 Log: Add missing MODULE_VERSION() definition to protect against duplicating module loads. PR: kern/159345 Reported by: Eugene Grosbein egrosbein att rdtc ru Tested by:Eugene Grosbein egrosbein att rdtc ru Approved by: re (kib) MFC after:1 week Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c == --- head/sys/net/if_lagg.c Mon Aug 1 10:57:54 2011(r224570) +++ head/sys/net/if_lagg.c Mon Aug 1 11:24:55 2011(r224571) @@ -208,6 +208,7 @@ static moduledata_t lagg_mod = { }; DECLARE_MODULE(if_lagg, lagg_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +MODULE_VERSION(if_lagg, 1); #if __FreeBSD_version = 80 /* ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r224284 - in head: share/man/man4 share/man/man5 share/man/man8 usr.sbin/faithd
Doug Barton wrote: On 07/23/2011 15:55, Glen Barber wrote: +.%U http://www.ietf.org/rfc/rfc2893.txt References to IETF documents in our documentation should use the tools.ietf.org site. It gives a much nicer experience, including working HTML tags, etc. For instance, the link for this page should be: http://tools.ietf.org/html/rfc2893 Thanks, Doug. I'll fix this later today. -- Glen Barber | g...@freebsd.org FreeBSD Documentation Project pgppbaNQs3cuI.pgp Description: PGP signature
svn commit: r224575 - head/sys/netinet
Author: glebius Date: Mon Aug 1 13:41:38 2011 New Revision: 224575 URL: http://svn.freebsd.org/changeset/base/224575 Log: Add missing break; in r223593. Submitted by: sem Pointy hat to:glebius Approved by: re (kib) Modified: head/sys/netinet/ip_divert.c Modified: head/sys/netinet/ip_divert.c == --- head/sys/netinet/ip_divert.cMon Aug 1 13:40:48 2011 (r224574) +++ head/sys/netinet/ip_divert.cMon Aug 1 13:41:38 2011 (r224575) @@ -410,6 +410,7 @@ div_output(struct socket *so, struct mbu } ip6-ip6_plen = ntohs(ip6-ip6_plen); + break; } #endif default: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r224579 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mm Date: Mon Aug 1 14:50:31 2011 New Revision: 224579 URL: http://svn.freebsd.org/changeset/base/224579 Log: Fix integer overflow in txg_delay() by initializing the variable timeout as clock_t. Filed as Illumos Bug #1313 Reviewed by: avg Approved by: re (kib) MFC after:3 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Mon Aug 1 14:13:08 2011(r224578) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Mon Aug 1 14:50:31 2011(r224579) @@ -488,7 +488,7 @@ void txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks) { tx_state_t *tx = dp-dp_tx; - int timeout = ddi_get_lbolt() + ticks; + clock_t timeout = ddi_get_lbolt() + ticks; /* don't delay if this txg could transition to quiesing immediately */ if (tx-tx_open_txg txg || ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r224580 - head/share/man/man4
Author: joel (doc committer) Date: Mon Aug 1 15:56:40 2011 New Revision: 224580 URL: http://svn.freebsd.org/changeset/base/224580 Log: I've rewritten most of this file so assign the copyright to me. Approved by: re (kib) Modified: head/share/man/man4/pcm.4 Modified: head/share/man/man4/pcm.4 == --- head/share/man/man4/pcm.4 Mon Aug 1 14:50:31 2011(r224579) +++ head/share/man/man4/pcm.4 Mon Aug 1 15:56:40 2011(r224580) @@ -1,5 +1,5 @@ .\ -.\ Copyright (c) 1998, Luigi Rizzo +.\ Copyright (c) 2009-2011 Joel Dahl j...@freebsd.org .\ All rights reserved. .\ .\ Redistribution and use in source and binary forms, with or without ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r224533 - head/share/man/man4
On 01-08-2011 12:12, Hiroki Sato wrote: Hi Joel, Joel Dahl j...@freebsd.org wrote in 201107302309.p6un9rhj019...@svn.freebsd.org: jo Author: joel (doc committer) jo Date: Sat Jul 30 23:09:52 2011 jo New Revision: 224533 jo URL: http://svn.freebsd.org/changeset/base/224533 jo jo Log: jo Add a better description, a few examples and a couple of minor fixes. jo jo Reviewed by:brueffer jo Approved by:re (kib) jo jo Modified: jo head/share/man/man4/pcm.4 jo jo Modified: head/share/man/man4/pcm.4 jo == (snip) jo @@ -173,7 +244,7 @@ controls (bass and treble). jo Commonly used for ear-candy or frequency compensation due to the vast jo difference in hardware quality. jo EQ is disabled by default, but can be enabled with the jo -.Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq jo +.Va hint.pcm.%d.eq : jo -.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .eq jo +.It Va hint.pcm.%d.eq : jo -.It Va hint.pcm. Ns Ao Ar X Ac Ns Va .vpc jo +.It Va hint.pcm.%d.vpc I know several manual pages are also using this expression (%d) for replaceables, but I am wondering if this is friendly for average users. Is .Ar N for an integer problematic, for example? I would like comments since other documents in DocBook have used such a notation for a long time and I feel we need consistency with them. I changed it to be consistent with the rest of the manual page, but I'm also not a big fan of using %d as it might be a bit confusing for some users... -- Joel ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r224582 - in head/sys: compat/linprocfs vm
Author: kib Date: Mon Aug 1 19:12:15 2011 New Revision: 224582 URL: http://svn.freebsd.org/changeset/base/224582 Log: Implement the linprocfs swaps file, providing information about the configured swap devices in the Linux-compatible format. Based on the submission by: Robert Millan rmh debian org PR: kern/159281 Reviewed by: bde Approved by: re (kensmith) MFC after:2 weeks Modified: head/sys/compat/linprocfs/linprocfs.c head/sys/vm/swap_pager.c head/sys/vm/swap_pager.h Modified: head/sys/compat/linprocfs/linprocfs.c == --- head/sys/compat/linprocfs/linprocfs.c Mon Aug 1 19:07:03 2011 (r224581) +++ head/sys/compat/linprocfs/linprocfs.c Mon Aug 1 19:12:15 2011 (r224582) @@ -502,6 +502,33 @@ linprocfs_dostat(PFS_FILL_ARGS) return (0); } +static int +linprocfs_doswaps(PFS_FILL_ARGS) +{ + struct xswdev xsw; + uintmax_t total, used; + int n; + char devname[SPECNAMELEN + 1]; + + sbuf_printf(sb, Filename\t\t\t\tType\t\tSize\tUsed\tPriority\n); + mtx_lock(Giant); + for (n = 0; ; n++) { + if (swap_dev_info(n, xsw, devname, sizeof(devname)) != 0) + break; + total = (uintmax_t)xsw.xsw_nblks * PAGE_SIZE / 1024; + used = (uintmax_t)xsw.xsw_used * PAGE_SIZE / 1024; + + /* +* The space and not tab after the device name is on +* purpose. Linux does so. +*/ + sbuf_printf(sb, /dev/%-34s unknown\t\t%jd\t%jd\t-1\n, + devname, total, used); + } + mtx_unlock(Giant); + return (0); +} + /* * Filler function for proc/uptime */ @@ -1490,6 +1517,8 @@ linprocfs_init(PFS_INIT_ARGS) NULL, NULL, NULL, 0); pfs_create_file(root, stat, linprocfs_dostat, NULL, NULL, NULL, PFS_RD); + pfs_create_file(root, swaps, linprocfs_doswaps, + NULL, NULL, NULL, PFS_RD); pfs_create_file(root, uptime, linprocfs_douptime, NULL, NULL, NULL, PFS_RD); pfs_create_file(root, version, linprocfs_doversion, Modified: head/sys/vm/swap_pager.c == --- head/sys/vm/swap_pager.cMon Aug 1 19:07:03 2011(r224581) +++ head/sys/vm/swap_pager.cMon Aug 1 19:12:15 2011(r224582) @@ -2365,35 +2365,53 @@ swap_pager_status(int *total, int *used) mtx_unlock(sw_dev_mtx); } -static int -sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) +int +swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len) { - int *name = (int *)arg1; - int error, n; - struct xswdev xs; struct swdevt *sp; - - if (arg2 != 1) /* name length */ - return (EINVAL); + char *tmp_devname; + int error, n; n = 0; + error = ENOENT; mtx_lock(sw_dev_mtx); TAILQ_FOREACH(sp, swtailq, sw_list) { - if (n == *name) { - mtx_unlock(sw_dev_mtx); - xs.xsw_version = XSWDEV_VERSION; - xs.xsw_dev = sp-sw_dev; - xs.xsw_flags = sp-sw_flags; - xs.xsw_nblks = sp-sw_nblks; - xs.xsw_used = sp-sw_used; - - error = SYSCTL_OUT(req, xs, sizeof(xs)); - return (error); + if (n != name) { + n++; + continue; + } + xs-xsw_version = XSWDEV_VERSION; + xs-xsw_dev = sp-sw_dev; + xs-xsw_flags = sp-sw_flags; + xs-xsw_nblks = sp-sw_nblks; + xs-xsw_used = sp-sw_used; + if (devname != NULL) { + if (vn_isdisk(sp-sw_vp, NULL)) + tmp_devname = sp-sw_vp-v_rdev-si_name; + else + tmp_devname = [file]; + strncpy(devname, tmp_devname, len); } - n++; + error = 0; + break; } mtx_unlock(sw_dev_mtx); - return (ENOENT); + return (error); +} + +static int +sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS) +{ + struct xswdev xs; + int error; + + if (arg2 != 1) /* name length */ + return (EINVAL); + error = swap_dev_info(*(int *)arg1, xs, NULL, 0); + if (error != 0) + return (error); + error = SYSCTL_OUT(req, xs, sizeof(xs)); + return (error); } SYSCTL_INT(_vm, OID_AUTO, nswapdev, CTLFLAG_RD, nswapdev, 0, Modified: head/sys/vm/swap_pager.h == --- head/sys/vm/swap_pager.hMon Aug 1 19:07:03 2011
svn commit: r224583 - in head: share/man/man4 sys/dev/hptiop
Author: delphij Date: Mon Aug 1 21:12:41 2011 New Revision: 224583 URL: http://svn.freebsd.org/changeset/base/224583 Log: Add PCI ID for RocketRAID 4321 and 4322. A FreeNAS user have tested the change on RocketRAID 4322. Sponsored by: iXsystems, Inc. MFC after:3 days Approved by: re (kib) Modified: head/share/man/man4/hptiop.4 head/sys/dev/hptiop/hptiop.c Modified: head/share/man/man4/hptiop.4 == --- head/share/man/man4/hptiop.4Mon Aug 1 19:12:15 2011 (r224582) +++ head/share/man/man4/hptiop.4Mon Aug 1 21:12:41 2011 (r224583) @@ -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: head/sys/dev/hptiop/hptiop.c == --- head/sys/dev/hptiop/hptiop.cMon Aug 1 19:12:15 2011 (r224582) +++ head/sys/dev/hptiop/hptiop.cMon Aug 1 21:12:41 2011 (r224583) @@ -1269,6 +1269,8 @@ static int hptiop_probe(device_t dev) id = pci_get_device(dev); switch (id) { + case 0x4322: + case 0x4321: case 0x4320: sas = 1; case 0x3220: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r224284 - in head: share/man/man4 share/man/man5 share/man/man8 usr.sbin/faithd
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 08/01/2011 05:25, Glen Barber wrote: Doug Barton wrote: On 07/23/2011 15:55, Glen Barber wrote: +.%U http://www.ietf.org/rfc/rfc2893.txt References to IETF documents in our documentation should use the tools.ietf.org site. It gives a much nicer experience, including working HTML tags, etc. For instance, the link for this page should be: http://tools.ietf.org/html/rfc2893 Thanks, Doug. I'll fix this later today. Awesome. :) Sorry it took so long for me to send the message btw, but I'm totally swamped atm. Doug - -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBCAAGBQJONzE+AAoJEFzGhvEaGryEk7wIAKEikbS6a+2DDub3AMYm7pzs T5cLLwEIGClS0KEMJWv6P/XnLx/LdJnc2E6aZlbnFu7A1DSjofXtUMv2LLOH2oQ1 kjkDkrXMdgM7oeYOUHGzRBkdJZe2y7UIyIgTHYAFyjx8smKcWz5/Coiv3HyrDD/I OFL/3QRK4ddZdSHVqNjcAAzGDwHgpVFE0tv60Q/cnCCys1g3GPHYHIdtAQexQhTp DnckOReblJUCi7IGaYjVx0dgWGpxdF63yl3rH91lg69ECxuzoSs29XepiOEndnmg 1mOw7XD7qeni5LwMWbCh198KYxWhL148ytJi9DGmyn5bLU1UbpO0Kz5fhE+Sjyk= =jb2s -END PGP SIGNATURE- ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r224588 - head/sys/dev/ath
Author: adrian Date: Tue Aug 2 02:46:03 2011 New Revision: 224588 URL: http://svn.freebsd.org/changeset/base/224588 Log: Fix a corner case in RXEOL handling which was likely introduced by yours truly. Before 802.11n, the RX descriptor list would employ the self-linked tail descriptor trick which linked the last descriptor back to itself. This way, the RX engine would never hit the end of the list and stop processing RX (and assert RXEOL) as it never hit a descriptor whose next pointer was 0. It would just keep overwriting the last descriptor until the software freed up some more RX descriptors and chained them onto the end. For 802.11n, this needs to stop as a self-linked RX descriptor tickles the block-ack logic into ACK'ing whatever frames are received into that self-linked descriptor - so in very busy periods, you could end up with A-MPDU traffic that is ACKed but never received by the 802.11 stack. This would cause some confusion as the ADDBA windows would suddenly be out of sync. So when that occured here, the last descriptor would be hit and the PCU logic would stop. It would only start again when the RX descriptor list was updated and the PCU RX engine was re-tickled. That wasn't being done, so RXEOL would be continuously asserted and no RX would continue. This patch introduces a new flag - sc-sc_kickpcu - which when set, signals the RX task to kick the PCU after its processed whatever packets it can. This way completed packets aren't discarded. In case some other task gets called which resets the hardware, don't update sc-sc_imask - instead, just update the hardware interrupt mask directly and let either ath_rx_proc() or ath_reset() restore the imask to its former setting. Note: this bug was only triggered when doing a whole lot of frame snooping with serial console IO in the RX task. This would defer interrupt processing enough to cause an RX descriptor overflow. It doesn't happen in normal conditions. Approved by: re (kib, blanket) Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c == --- head/sys/dev/ath/if_ath.c Tue Aug 2 01:48:45 2011(r224587) +++ head/sys/dev/ath/if_ath.c Tue Aug 2 02:46:03 2011(r224588) @@ -1389,6 +1389,7 @@ ath_intr(void *arg) } } if (status HAL_INT_RXEOL) { + int imask = sc-sc_imask; /* * NB: the hardware should re-read the link when * RXE bit is written, but it doesn't work at @@ -1398,10 +1399,22 @@ ath_intr(void *arg) /* * Disable RXEOL/RXORN - prevent an interrupt * storm until the PCU logic can be reset. +* In case the interface is reset some other +* way before sc_kickpcu is called, don't +* modify sc_imask - that way if it is reset +* by a call to ath_reset() somehow, the +* interrupt mask will be correctly reprogrammed. */ - sc-sc_imask = ~(HAL_INT_RXEOL | HAL_INT_RXORN); - ath_hal_intrset(ah, sc-sc_imask); + imask = ~(HAL_INT_RXEOL | HAL_INT_RXORN); + ath_hal_intrset(ah, imask); + /* +* Enqueue an RX proc, to handled whatever +* is in the RX queue. +* This will then kick the PCU. +*/ + taskqueue_enqueue(sc-sc_tq, sc-sc_rxtask); sc-sc_rxlink = NULL; + sc-sc_kickpcu = 1; } if (status HAL_INT_TXURN) { sc-sc_stats.ast_txurn++; @@ -3776,6 +3789,25 @@ rx_next: if (ath_dfs_tasklet_needed(sc, sc-sc_curchan)) taskqueue_enqueue(sc-sc_tq, sc-sc_dfstask); + /* +* Now that all the RX frames were handled that +* need to be handled, kick the PCU if there's +* been an RXEOL condition. +*/ + if (sc-sc_kickpcu) { + sc-sc_kickpcu = 0; + ath_stoprecv(sc); + sc-sc_imask |= (HAL_INT_RXEOL | HAL_INT_RXORN); + if (ath_startrecv(sc) != 0) { + if_printf(ifp, + %s: couldn't restart RX after RXEOL; resetting\n, + __func__); + ath_reset(ifp); + return; + } + ath_hal_intrset(ah, sc-sc_imask); + } + if ((ifp-if_drv_flags IFF_DRV_OACTIVE) == 0) { #ifdef IEEE80211_SUPPORT_SUPERG