Re: svn commit: r229633 - stable/9/sys/net
John, On Thu, Jan 05, 2012 at 07:50:12PM +, John Baldwin wrote: J> Author: jhb J> Date: Thu Jan 5 19:50:12 2012 J> New Revision: 229633 J> URL: http://svn.freebsd.org/changeset/base/229633 J> J> Log: J> MFC 228089: J> Change the if_vlan driver to use if_transmit for forwarding packets to the J> parent interface. This avoids the overhead of queueing a packet to an IFQ J> only to immediately dequeue it again. This should have been merged together with r228967. Now a bug that was successfully discovered and fixed in head/ leaked to stable branches. :( Can you please merge r228967 to stable/9 and stable/8 ASAP? -- Totus tuus, Glebius. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229690 - stable/9/sys/net
Author: glebius Date: Fri Jan 6 08:46:26 2012 New Revision: 229690 URL: http://svn.freebsd.org/changeset/base/229690 Log: Merge r226830 from head/: Add macro IF_DEQUEUE_ALL(ifq, m), that takes the entire mbuf chain off the queue. It can be utilized in queue processing to avoid multiple locking/unlocking. Modified: stable/9/sys/net/if_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_var.h == --- stable/9/sys/net/if_var.h Fri Jan 6 05:51:00 2012(r229689) +++ stable/9/sys/net/if_var.h Fri Jan 6 08:46:26 2012(r229690) @@ -321,6 +321,18 @@ void if_maddr_runlock(struct ifnet *ifp) IF_UNLOCK(ifq); \ } while (0) +#define_IF_DEQUEUE_ALL(ifq, m) do {\ + (m) = (ifq)->ifq_head; \ + (ifq)->ifq_head = (ifq)->ifq_tail = NULL; \ + (ifq)->ifq_len = 0; \ +} while (0) + +#defineIF_DEQUEUE_ALL(ifq, m) do { \ + IF_LOCK(ifq); \ + _IF_DEQUEUE_ALL(ifq, m);\ + IF_UNLOCK(ifq); \ +} while (0) + #define_IF_POLL(ifq, m)((m) = (ifq)->ifq_head) #defineIF_POLL(ifq, m) _IF_POLL(ifq, m) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229691 - head/sys/pc98/conf
Author: adrian Date: Fri Jan 6 08:51:20 2012 New Revision: 229691 URL: http://svn.freebsd.org/changeset/base/229691 Log: Flip these options on so the modules build correctly for now. Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC == --- head/sys/pc98/conf/GENERIC Fri Jan 6 08:46:26 2012(r229690) +++ head/sys/pc98/conf/GENERIC Fri Jan 6 08:51:20 2012(r229691) @@ -214,7 +214,7 @@ device xe # Xircom pccard Ethernet #devicewlan# 802.11 support #options IEEE80211_DEBUG # enable debug msgs #options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's -#options IEEE80211_SUPPORT_MESH # enable 802.11s draft support +optionsIEEE80211_SUPPORT_MESH # enable 802.11s draft support #devicewlan_wep# 802.11 WEP support #devicewlan_ccmp # 802.11 CCMP support #devicewlan_tkip # 802.11 TKIP support @@ -223,7 +223,7 @@ device xe # Xircom pccard Ethernet #deviceath # Atheros NIC's #deviceath_pci # Atheros pci/cardbus glue #deviceath_hal # pci/cardbus chip support -#options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors +optionsAH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors #deviceath_rate_sample # SampleRate tx rate control for ath #deviceral # Ralink Technology RT2500 wireless NICs. #devicewi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229692 - head/sys/fs/pseudofs
Author: jh Date: Fri Jan 6 09:17:34 2012 New Revision: 229692 URL: http://svn.freebsd.org/changeset/base/229692 Log: Check the return value of sbuf_finish() in pfs_readlink() and return ENAMETOOLONG if the buffer overflowed. Approved by: des MFC after:2 weeks Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c == --- head/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 6 08:51:20 2012 (r229691) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 6 09:17:34 2012 (r229692) @@ -891,7 +891,11 @@ pfs_readlink(struct vop_readlink_args *v PFS_RETURN (error); } - sbuf_finish(&sb); + if (sbuf_finish(&sb) != 0) { + sbuf_delete(&sb); + PFS_RETURN (ENAMETOOLONG); + } + error = uiomove_frombuf(sbuf_data(&sb), sbuf_len(&sb), uio); sbuf_delete(&sb); PFS_RETURN (error); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229693 - in head/lib/libc: powerpc powerpc64
Author: andreast Date: Fri Jan 6 09:21:40 2012 New Revision: 229693 URL: http://svn.freebsd.org/changeset/base/229693 Log: Use the macro WEAK_ALIAS. Tested on 32 and 64-bit. Modified: head/lib/libc/powerpc/SYS.h head/lib/libc/powerpc64/SYS.h Modified: head/lib/libc/powerpc/SYS.h == --- head/lib/libc/powerpc/SYS.h Fri Jan 6 09:17:34 2012(r229692) +++ head/lib/libc/powerpc/SYS.h Fri Jan 6 09:21:40 2012(r229693) @@ -44,10 +44,8 @@ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .setCNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .setCNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ _SYSCALL(x);\ bso 2b @@ -55,8 +53,7 @@ ENTRY(__CONCAT(__sys_,x)); \ .text; \ .align 2; \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .setCNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ _SYSCALL(x);\ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) @@ -66,10 +63,8 @@ ENTRY(__CONCAT(__sys_,x)); \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .setCNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .setCNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ _SYSCALL(x);\ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) Modified: head/lib/libc/powerpc64/SYS.h == --- head/lib/libc/powerpc64/SYS.h Fri Jan 6 09:17:34 2012 (r229692) +++ head/lib/libc/powerpc64/SYS.h Fri Jan 6 09:21:40 2012 (r229693) @@ -52,10 +52,8 @@ mtlr%r0;\ blr;\ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .setCNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .setCNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ _SYSCALL(x);\ bso 2b @@ -63,8 +61,7 @@ ENTRY(__CONCAT(__sys_,x)); \ .text; \ .align 2; \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .setCNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ _SYSCALL(x);\ bnslr; \ mflr%r0;\ @@ -81,10 +78,8 @@ ENTRY(__CONCAT(__sys_,x)); \ .text; \ .align 2; \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .setCNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .setCNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(x,__CONCAT(__sys_,x));
svn commit: r229694 - head/sys/fs/pseudofs
Author: jh Date: Fri Jan 6 10:12:59 2012 New Revision: 229694 URL: http://svn.freebsd.org/changeset/base/229694 Log: r222004 changed sbuf_finish() to not clear the buffer error status. As a consequence sbuf_len() will return -1 for buffers which had the error status set prior to sbuf_finish() call. This causes a problem in pfs_read() which purposely uses a fixed size sbuf to discard bytes which are not needed to fulfill the read request. Work around the problem by using the full buffer length when sbuf_finish() indicates an overflow. An overflowed sbuf with fixed size is always full. PR: kern/163076 Approved by: des MFC after:2 weeks Modified: head/sys/fs/pseudofs/pseudofs_vnops.c Modified: head/sys/fs/pseudofs/pseudofs_vnops.c == --- head/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 6 09:21:40 2012 (r229693) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 6 10:12:59 2012 (r229694) @@ -630,14 +630,14 @@ pfs_read(struct vop_read_args *va) if (uio->uio_offset < 0 || uio->uio_resid < 0 || (offset = uio->uio_offset) != uio->uio_offset || (resid = uio->uio_resid) != uio->uio_resid || - (buflen = offset + resid + 1) < offset || buflen > INT_MAX) { + (buflen = offset + resid) < offset || buflen >= INT_MAX) { error = EINVAL; goto ret; } - if (buflen > MAXPHYS + 1) - buflen = MAXPHYS + 1; + if (buflen > MAXPHYS) + buflen = MAXPHYS; - sb = sbuf_new(sb, NULL, buflen, 0); + sb = sbuf_new(sb, NULL, buflen + 1, 0); if (sb == NULL) { error = EIO; goto ret; @@ -650,8 +650,14 @@ pfs_read(struct vop_read_args *va) goto ret; } - sbuf_finish(sb); - error = uiomove_frombuf(sbuf_data(sb), sbuf_len(sb), uio); + /* +* XXX: If the buffer overflowed, sbuf_len() will not return +* the data length. Then just use the full length because an +* overflowed sbuf must be full. +*/ + if (sbuf_finish(sb) == 0) + buflen = sbuf_len(sb); + error = uiomove_frombuf(sbuf_data(sb), buflen, uio); sbuf_delete(sb); ret: vn_lock(vn, locked | LK_RETRY); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229695 - stable/9/sys/vm
Author: kib Date: Fri Jan 6 11:06:15 2012 New Revision: 229695 URL: http://svn.freebsd.org/changeset/base/229695 Log: MFC r228838: Optimize the common case of msyncing the whole file mapping with MS_SYNC flag. Modified: stable/9/sys/vm/vm_object.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_object.c == --- stable/9/sys/vm/vm_object.c Fri Jan 6 10:12:59 2012(r229694) +++ stable/9/sys/vm/vm_object.c Fri Jan 6 11:06:15 2012(r229695) @@ -937,7 +937,7 @@ vm_object_sync(vm_object_t object, vm_oo vm_object_t backing_object; struct vnode *vp; struct mount *mp; - int flags; + int flags, fsync_after; if (object == NULL) return; @@ -970,11 +970,26 @@ vm_object_sync(vm_object_t object, vm_oo (void) vn_start_write(vp, &mp, V_WAIT); vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - flags = (syncio || invalidate) ? OBJPC_SYNC : 0; - flags |= invalidate ? OBJPC_INVAL : 0; + if (syncio && !invalidate && offset == 0 && + OFF_TO_IDX(size) == object->size) { + /* +* If syncing the whole mapping of the file, +* it is faster to schedule all the writes in +* async mode, also allowing the clustering, +* and then wait for i/o to complete. +*/ + flags = 0; + fsync_after = TRUE; + } else { + flags = (syncio || invalidate) ? OBJPC_SYNC : 0; + flags |= invalidate ? (OBJPC_SYNC | OBJPC_INVAL) : 0; + fsync_after = FALSE; + } VM_OBJECT_LOCK(object); vm_object_page_clean(object, offset, offset + size, flags); VM_OBJECT_UNLOCK(object); + if (fsync_after) + (void) VOP_FSYNC(vp, MNT_WAIT, curthread); VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); vn_finished_write(mp); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229696 - stable/8/sys/vm
Author: kib Date: Fri Jan 6 11:06:48 2012 New Revision: 229696 URL: http://svn.freebsd.org/changeset/base/229696 Log: MFC r228838: Optimize the common case of msyncing the whole file mapping with MS_SYNC flag. Modified: stable/8/sys/vm/vm_object.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/vm/vm_object.c == --- stable/8/sys/vm/vm_object.c Fri Jan 6 11:06:15 2012(r229695) +++ stable/8/sys/vm/vm_object.c Fri Jan 6 11:06:48 2012(r229696) @@ -942,7 +942,7 @@ vm_object_sync(vm_object_t object, vm_oo vm_object_t backing_object; struct vnode *vp; struct mount *mp; - int flags; + int flags, fsync_after; if (object == NULL) return; @@ -975,14 +975,29 @@ vm_object_sync(vm_object_t object, vm_oo (void) vn_start_write(vp, &mp, V_WAIT); vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - flags = (syncio || invalidate) ? OBJPC_SYNC : 0; - flags |= invalidate ? OBJPC_INVAL : 0; + if (syncio && !invalidate && offset == 0 && + OFF_TO_IDX(size) == object->size) { + /* +* If syncing the whole mapping of the file, +* it is faster to schedule all the writes in +* async mode, also allowing the clustering, +* and then wait for i/o to complete. +*/ + flags = 0; + fsync_after = TRUE; + } else { + flags = (syncio || invalidate) ? OBJPC_SYNC : 0; + flags |= invalidate ? (OBJPC_SYNC | OBJPC_INVAL) : 0; + fsync_after = FALSE; + } VM_OBJECT_LOCK(object); vm_object_page_clean(object, OFF_TO_IDX(offset), OFF_TO_IDX(offset + size + PAGE_MASK), flags); VM_OBJECT_UNLOCK(object); + if (fsync_after) + (void) VOP_FSYNC(vp, MNT_WAIT, curthread); VOP_UNLOCK(vp, 0); VFS_UNLOCK_GIANT(vfslocked); vn_finished_write(mp); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229697 - head/sbin/recoverdisk
Author: uqs Date: Fri Jan 6 11:42:03 2012 New Revision: 229697 URL: http://svn.freebsd.org/changeset/base/229697 Log: Fix mdoc date from previous commit. Modified: head/sbin/recoverdisk/recoverdisk.1 Modified: head/sbin/recoverdisk/recoverdisk.1 == --- head/sbin/recoverdisk/recoverdisk.1 Fri Jan 6 11:06:48 2012 (r229696) +++ head/sbin/recoverdisk/recoverdisk.1 Fri Jan 6 11:42:03 2012 (r229697) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 5, 2012 +.Dd January 5, 2012 .Dt RECOVERDISK 1 .Os .Sh NAME ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229698 - head/sys/net
Author: glebius Date: Fri Jan 6 12:05:43 2012 New Revision: 229698 URL: http://svn.freebsd.org/changeset/base/229698 Log: Since r228571 CARP is no longer an interface. Modified: head/sys/net/if_media.h Modified: head/sys/net/if_media.h == --- head/sys/net/if_media.h Fri Jan 6 11:42:03 2012(r229697) +++ head/sys/net/if_media.h Fri Jan 6 12:05:43 2012(r229698) @@ -247,11 +247,6 @@ uint64_t ifmedia_baudrate(int); #defineIFM_ATM_UNASSIGNED 0x0400 /* unassigned cells */ /* - * CARP Common Address Redundancy Protocol - */ -#defineIFM_CARP0x00c0 - -/* * Shared media sub-types */ #defineIFM_AUTO0 /* Autoselect best media */ @@ -337,7 +332,6 @@ struct ifmedia_description { { IFM_FDDI, "FDDI" }, \ { IFM_IEEE80211,"IEEE 802.11 Wireless Ethernet" }, \ { IFM_ATM, "ATM" },\ - { IFM_CARP, "Common Address Redundancy Protocol" }, \ { 0, NULL },\ } @@ -718,8 +712,6 @@ struct ifmedia_status_description { { "no network", "active" } }, \ { IFM_ATM, IFM_AVALID, IFM_ACTIVE, \ { "no network", "active" } }, \ - { IFM_CARP, IFM_AVALID, IFM_ACTIVE, \ - { "backup", "master" } }, \ { 0,0, 0, \ { NULL, NULL } }\ } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229699 - head/sbin/hastd
Author: pjd Date: Fri Jan 6 12:27:17 2012 New Revision: 229699 URL: http://svn.freebsd.org/changeset/base/229699 Log: Constify argument. MFC after:3 days Modified: head/sbin/hastd/subr.c head/sbin/hastd/subr.h Modified: head/sbin/hastd/subr.c == --- head/sbin/hastd/subr.c Fri Jan 6 12:05:43 2012(r229698) +++ head/sbin/hastd/subr.c Fri Jan 6 12:27:17 2012(r229699) @@ -149,7 +149,7 @@ role2str(int role) } int -drop_privs(struct hast_resource *res) +drop_privs(const struct hast_resource *res) { char jailhost[sizeof(res->hr_name) * 2]; struct jail jailst; Modified: head/sbin/hastd/subr.h == --- head/sbin/hastd/subr.h Fri Jan 6 12:05:43 2012(r229698) +++ head/sbin/hastd/subr.h Fri Jan 6 12:27:17 2012(r229699) @@ -51,6 +51,6 @@ int snprlcat(char *str, size_t size, con int provinfo(struct hast_resource *res, bool dowrite); const char *role2str(int role); -int drop_privs(struct hast_resource *res); +int drop_privs(const struct hast_resource *res); #endif /* !_SUBR_H_ */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229700 - head/sys/netinet
Author: jhb Date: Fri Jan 6 12:49:01 2012 New Revision: 229700 URL: http://svn.freebsd.org/changeset/base/229700 Log: Tweak the last fix to match what was actually tested. Pointy hat to:jhb Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c == --- head/sys/netinet/tcp_timewait.c Fri Jan 6 12:27:17 2012 (r229699) +++ head/sys/netinet/tcp_timewait.c Fri Jan 6 12:49:01 2012 (r229700) @@ -242,7 +242,7 @@ tcp_twstart(struct tcpcb *tp) /* * Recover last window size sent. */ - if (SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt)) + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; else tw->last_win = 0; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r229665 - head/sys/netinet
On Thursday, January 05, 2012 7:19:29 pm Sergey Kandaurov wrote: > Hi, Looks like a typo there: > /usr/src/sys/netinet/tcp_timewait.c: In function 'tcp_twstart': > /usr/src/sys/netinet/tcp_timewait.c:245: warning: implicit declaration > of function 'SEQ_GE' > /usr/src/sys/netinet/tcp_timewait.c:245: warning: nested extern > declaration of 'SEQ_GE' [-Wnested-externs] Yeah, it was supposed to be SEQ_GT (which is what it was in the testing patch I had sent out that was derived from the patch I committed). Thanks for fixing my breakage. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r229693 - in head/lib/libc: powerpc powerpc64
On Fri, 6 Jan 2012, Andreas Tobler wrote: Log: Use the macro WEAK_ALIAS. Tested on 32 and 64-bit. This API should be fixed before using it extensively. It has the args reversed relative to the C API __weak_reference(). Also, its name is different, and the spelling of "=" in its implementation is different. Perhaps the arg order makes sense for both, since for WEAK_ALIAS() the alias is the first arg, while for __weak_reference() the symbol being referred to to create the alias is the first arg. But this is still confusing. The easiest way to fix this is to remove WEAK_ALIAS() and add an asm API WEAK_REFERENCE(). Unfortunately, ALIAS is a better name than REFERENCE. __weak_reference() is not so easy to change since it is used extensively Similarly for STRONG_ALIAS() and __strong_reference(), except STRONG_REFERENCE() doesn't exist for most arches and __strong_reference() didn't exist until this week, so neither is used extensively. More details on current existence and use of these: In the kernel, WEAK_ALIAS is not defined for amd64 or sparc64, and is never used. In libc, WEAK_ALIAS was only used for arm, ia64 and mips. Now it is used for some i386 string functions. In the kernel, STRONG_ALIAS was only defined for mips, and was never used. Now it is also defined for i386, and is never used. In libc, STRONG_ALIAS was not used. It was used for a few days in some i386 string functions. This was a bug. Now WEAK_ALIAS is used instead, and STRONG_ALIAS is not used again. It is another bug that these "optimized" i386 string functions (strchr/index and strrchr/rindex) even exist. amd64 doesn't have them. The MI versions are not very optimal, but neither are the i386 ones. Modified: head/lib/libc/powerpc/SYS.h == --- head/lib/libc/powerpc/SYS.h Fri Jan 6 09:17:34 2012(r229692) +++ head/lib/libc/powerpc/SYS.h Fri Jan 6 09:21:40 2012(r229693) @@ -44,10 +44,8 @@ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .setCNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .setCNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ _SYSCALL(x);\ bso 2b The style bugs in this should be fixed someday. This is still messed up to support K&R. With ancient cpp's, you had to write __CONCAT(x,y) instead of __CONCAT(x, y) to avoid getting a space between x and y. This was fixed in Standard C 22 years ago, but all SYS.h files in libc except ia64's one still use the ugly __CONCAT(x,y) in most places. ia64 hard-codes __CONCAT(x, y) as x ## y instead. The missing space after the comma for the WEAK_ALIAS() parameters is even less necessary. For ancient cpp's, it allowed WEAK_ALIAS to format the asm directives without a space. With STDC cpp's, the formatting is controlled by the macro, but it is still hard to produce nice formatting because cpp may change whitespace. __weak_reference() also difference from WEAK_ALIAS() in the spelling of "=". It uses ".equ". ".set" in the all the SYS.h's except ia64 and mips (*) seems to be yet another spelling. (*) ia64 avoids the hard coded directive using WEAK_ALIAS(). mips hard-codes "=" instead of ".set". Some other gratuitous differences in the SYS.h's: - arm and mips use _C_LABEL() instead of CNAME() - ia64 doesn't use either _C_LABEL() or CNAME() - arm, ia64 and mips don't use HIDENAME() for cerror: - arm uses CERROR and hard-codes this as _C_LABEL(cerror) - ia64 hard-codes it as .cerror - mips hard-codes it as __cerror. - sparc64 doesn't use ENTRY() or END() and has to repeat things like .type and .size found in those when it defines _SYSENTRY() and _SYSEND(). It doesn't use CNAME() in these definitions. Underscores in these names are bogus, since these names are even less public than ENTRY() and END() which don't have them. Some of these differences may be due to FreeBSD's cleaning up or down of the decomposition of SYS.h and only for older arches. Both of these files are MD so you can hard-code things in either, but I think it is best put as much of the details as possible in the lowest level, which is . Using WEAK_ALIAS() from there is a step in this direction. Bruce ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r229633 - stable/9/sys/net
On Friday, January 06, 2012 3:20:05 am Gleb Smirnoff wrote: > John, > > On Thu, Jan 05, 2012 at 07:50:12PM +, John Baldwin wrote: > J> Author: jhb > J> Date: Thu Jan 5 19:50:12 2012 > J> New Revision: 229633 > J> URL: http://svn.freebsd.org/changeset/base/229633 > J> > J> Log: > J> MFC 228089: > J> Change the if_vlan driver to use if_transmit for forwarding packets to > the > J> parent interface. This avoids the overhead of queueing a packet to an > IFQ > J> only to immediately dequeue it again. > > This should have been merged together with r228967. Now a bug that > was successfully discovered and fixed in head/ leaked to stable > branches. :( > > Can you please merge r228967 to stable/9 and stable/8 ASAP? Err, that bug was already present before this change. I did not expose it. I can MFC the stat fixes, but this was already broken in 8 and 9, and is broken in 7 as well (likely in older branches than that). -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229701 - head/etc/rc.d
Author: pjd Date: Fri Jan 6 14:00:31 2012 New Revision: 229701 URL: http://svn.freebsd.org/changeset/base/229701 Log: Add 'nojail' keyword as auditd(8) can't really do anything useful when inside a jail. Discussed with: rwatson MFC after:1 week Modified: head/etc/rc.d/auditd Modified: head/etc/rc.d/auditd == --- head/etc/rc.d/auditdFri Jan 6 12:49:01 2012(r229700) +++ head/etc/rc.d/auditdFri Jan 6 14:00:31 2012(r229701) @@ -8,7 +8,7 @@ # PROVIDE: auditd # REQUIRE: syslogd # BEFORE: DAEMON -# KEYWORD: shutdown +# KEYWORD: nojail shutdown . /etc/rc.subr ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r229633 - stable/9/sys/net
On Fri, Jan 06, 2012 at 08:45:12AM -0500, John Baldwin wrote: J> On Friday, January 06, 2012 3:20:05 am Gleb Smirnoff wrote: J> > John, J> > J> > On Thu, Jan 05, 2012 at 07:50:12PM +, John Baldwin wrote: J> > J> Author: jhb J> > J> Date: Thu Jan 5 19:50:12 2012 J> > J> New Revision: 229633 J> > J> URL: http://svn.freebsd.org/changeset/base/229633 J> > J> J> > J> Log: J> > J> MFC 228089: J> > J> Change the if_vlan driver to use if_transmit for forwarding packets to the J> > J> parent interface. This avoids the overhead of queueing a packet to an IFQ J> > J> only to immediately dequeue it again. J> > J> > This should have been merged together with r228967. Now a bug that J> > was successfully discovered and fixed in head/ leaked to stable J> > branches. :( J> > J> > Can you please merge r228967 to stable/9 and stable/8 ASAP? J> J> Err, that bug was already present before this change. I did not expose it. J> J> I can MFC the stat fixes, but this was already broken in 8 and 9, and is J> broken in 7 as well (likely in older branches than that). Well, on 8.2-STABLE if_obytes are correctly accounted: glebius@xxx:~:|>netstat -hI vlan2 1 input(vlan2) output packets errs idrops bytespackets errs bytes colls 33 0 0 2.3k 4 0840 0 36 0 0 2.4k 4 0442 0 32 0 0 2.3k 6 0887 0 glebius@xxx:~:|>uname -v FreeBSD 8.2-STABLE #2: Wed Jul 6 13:22:13 MSD 2011 While on 228089 =< head < 228967 they are not: glebius@xxx2:~:|>netstat -hI vlan77 1 input (vlan77) output packets errs idrops bytespackets errs bytes colls 9.1k 0 0 2M12k 0 0 0 11k 0 0 4.3M14k 0 0 0 10k 0 0 2.8M14k 0 0 0 9.4k 0 0 2.3M13k 0 0 0 glebius@xxx2:~:|>uname -v FreeBSD 10.0-CURRENT #5 r228769M: Thu Dec 22 19:44:57 MSK 2011 -- Totus tuus, Glebius. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r229633 - stable/9/sys/net
On Friday, January 06, 2012 9:24:59 am Gleb Smirnoff wrote: > On Fri, Jan 06, 2012 at 08:45:12AM -0500, John Baldwin wrote: > J> On Friday, January 06, 2012 3:20:05 am Gleb Smirnoff wrote: > J> > John, > J> > > J> > On Thu, Jan 05, 2012 at 07:50:12PM +, John Baldwin wrote: > J> > J> Author: jhb > J> > J> Date: Thu Jan 5 19:50:12 2012 > J> > J> New Revision: 229633 > J> > J> URL: http://svn.freebsd.org/changeset/base/229633 > J> > J> > J> > J> Log: > J> > J> MFC 228089: > J> > J> Change the if_vlan driver to use if_transmit for forwarding packets > to the > J> > J> parent interface. This avoids the overhead of queueing a packet to > an IFQ > J> > J> only to immediately dequeue it again. > J> > > J> > This should have been merged together with r228967. Now a bug that > J> > was successfully discovered and fixed in head/ leaked to stable > J> > branches. :( > J> > > J> > Can you please merge r228967 to stable/9 and stable/8 ASAP? > J> > J> Err, that bug was already present before this change. I did not expose it. > J> > J> I can MFC the stat fixes, but this was already broken in 8 and 9, and is > J> broken in 7 as well (likely in older branches than that). > > Well, on 8.2-STABLE if_obytes are correctly accounted: > > glebius@xxx:~:|>netstat -hI vlan2 1 > input(vlan2) output >packets errs idrops bytespackets errs bytes colls > 33 0 0 2.3k 4 0840 0 > 36 0 0 2.4k 4 0442 0 > 32 0 0 2.3k 6 0887 0 > > glebius@xxx:~:|>uname -v > FreeBSD 8.2-STABLE #2: Wed Jul 6 13:22:13 MSD 2011 > > While on 228089 =< head < 228967 they are not: > > glebius@xxx2:~:|>netstat -hI vlan77 1 > input (vlan77) output >packets errs idrops bytespackets errs bytes colls > 9.1k 0 0 2M12k 0 0 0 >11k 0 0 4.3M14k 0 0 0 >10k 0 0 2.8M14k 0 0 0 > 9.4k 0 0 2.3M13k 0 0 0 > > glebius@xxx2:~:|>uname -v > FreeBSD 10.0-CURRENT #5 r228769M: Thu Dec 22 19:44:57 MSK 2011 Hmm, it seems to be a side effect of the IFQ macros. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229702 - head/sbin/devd
Author: glebius Date: Fri Jan 6 15:01:05 2012 New Revision: 229702 URL: http://svn.freebsd.org/changeset/base/229702 Log: Fix build. Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc == --- head/sbin/devd/devd.cc Fri Jan 6 14:00:31 2012(r229701) +++ head/sbin/devd/devd.cc Fri Jan 6 15:01:05 2012(r229702) @@ -298,7 +298,6 @@ media::media(config &, const char *var, { IFM_FDDI, "FDDI" }, { IFM_IEEE80211,"802.11" }, { IFM_ATM, "ATM" }, - { IFM_CARP, "CARP" }, { -1, "unknown" }, { 0, NULL }, }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229703 - in stable/9: . sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/devfs sys/fs/nullfs sys/fs/pseudofs sys/kern
Author: kib Date: Fri Jan 6 15:07:28 2012 New Revision: 229703 URL: http://svn.freebsd.org/changeset/base/229703 Log: MFC r227697: Change the interface for VOP_VPTOCNP(), now the dvp must be referenced. Convert all in-tree implementations of VOP_VPTOCNP(). This fixes VOP_VPTOCNP bypass for nullfs. Approved by: re (bz) Modified: stable/9/UPDATING stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/9/sys/fs/devfs/devfs_vnops.c stable/9/sys/fs/nullfs/null_vnops.c stable/9/sys/fs/pseudofs/pseudofs_vnops.c stable/9/sys/kern/vfs_cache.c stable/9/sys/kern/vfs_default.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/UPDATING == --- stable/9/UPDATING Fri Jan 6 15:01:05 2012(r229702) +++ stable/9/UPDATING Fri Jan 6 15:07:28 2012(r229703) @@ -10,6 +10,11 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. 20120106: + The interface of the VOP_VPTOCNP(9) changed, now the returned + vnode shall be referenced, previously it was required to be + only held. All in-tree filesystems are converted. + +20120106: 9.0-RELEASE. 2001: Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c == --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jan 6 15:01:05 2012(r229702) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jan 6 15:07:28 2012(r229703) @@ -1594,7 +1594,7 @@ zfsctl_snapshot_vptocnp(struct vop_vptoc *ap->a_buflen -= len; bcopy(sep->se_name, ap->a_buf + *ap->a_buflen, len); mutex_exit(&sdp->sd_lock); - vhold(dvp); + vref(dvp); *ap->a_vpp = dvp; } VN_RELE(dvp); Modified: stable/9/sys/fs/devfs/devfs_vnops.c == --- stable/9/sys/fs/devfs/devfs_vnops.c Fri Jan 6 15:01:05 2012 (r229702) +++ stable/9/sys/fs/devfs/devfs_vnops.c Fri Jan 6 15:07:28 2012 (r229703) @@ -261,7 +261,7 @@ devfs_vptocnp(struct vop_vptocnp_args *a } else if (vp->v_type == VDIR) { if (dd == dmp->dm_rootdir) { *dvp = vp; - vhold(*dvp); + vref(*dvp); goto finished; } i -= dd->de_dirent->d_namlen; @@ -289,6 +289,8 @@ devfs_vptocnp(struct vop_vptocnp_args *a mtx_unlock(&devfs_de_interlock); vholdl(*dvp); VI_UNLOCK(*dvp); + vref(*dvp); + vdrop(*dvp); } else { mtx_unlock(&devfs_de_interlock); error = ENOENT; Modified: stable/9/sys/fs/nullfs/null_vnops.c == --- stable/9/sys/fs/nullfs/null_vnops.c Fri Jan 6 15:01:05 2012 (r229702) +++ stable/9/sys/fs/nullfs/null_vnops.c Fri Jan 6 15:07:28 2012 (r229703) @@ -784,6 +784,7 @@ null_vptocnp(struct vop_vptocnp_args *ap vhold(lvp); VOP_UNLOCK(vp, 0); /* vp is held by vn_vptocnp_locked that called us */ ldvp = lvp; + vref(lvp); error = vn_vptocnp(&ldvp, cred, ap->a_buf, ap->a_buflen); vdrop(lvp); if (error != 0) { @@ -797,19 +798,17 @@ null_vptocnp(struct vop_vptocnp_args *ap */ error = vn_lock(ldvp, LK_EXCLUSIVE); if (error != 0) { + vrele(ldvp); vn_lock(vp, locked | LK_RETRY); - vdrop(ldvp); return (ENOENT); } vref(ldvp); - vdrop(ldvp); error = null_nodeget(vp->v_mount, ldvp, dvp); if (error == 0) { #ifdef DIAGNOSTIC NULLVPTOLOWERVP(*dvp); #endif - vhold(*dvp); - vput(*dvp); + VOP_UNLOCK(*dvp, 0); /* keep reference on *dvp */ } else vput(ldvp); Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c == --- stable/9/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 6 15:01:05 2012 (r229702) +++ stable/9/sys/fs/pseudofs/pseudofs_vnops.c Fri Jan 6 15:07:28 2012 (r229703) @@ -410,8 +410,7 @@ pfs_vptocnp(struct vop_vptocnp_args *ap) } *buflen = i; - vhold(*dvp); - vput(*dvp); + VOP_UNLOCK(*dvp, 0); vn_lock(vp, locked | LK_RETRY); vfs
svn commit: r229704 - head/include
Author: ed Date: Fri Jan 6 16:20:17 2012 New Revision: 229704 URL: http://svn.freebsd.org/changeset/base/229704 Log: Add an even faster implementation of for the future. Instead of using an exponential number of cases with respect to the number of arguments, this version only uses a linear number. Unfortunately, it works with Clang, GCC 4.6 and GCC 4.7, but not GCC 4.2. Therefore, leave it commented out. Modified: head/include/tgmath.h Modified: head/include/tgmath.h == --- head/include/tgmath.h Fri Jan 6 15:07:28 2012(r229703) +++ head/include/tgmath.h Fri Jan 6 16:20:17 2012(r229704) @@ -59,6 +59,25 @@ #error " not implemented for this compiler" #endif +#if 0 /* XXX: Much shorter and faster to compile, but broken with GCC 4.2. */ +#define__tg_generic(x, cfnl, cfn, cfnf, fnl, fn, fnf) \ + __generic(x, long double _Complex, cfnl,\ + __generic(x, double _Complex, cfn, \ + __generic(x, float _Complex, cfnf, \ + __generic(x, long double, fnl, \ + __generic(x, float, fnf, fn) +#define__tg_type(x) \ + __tg_generic(x, (long double _Complex)0, (double _Complex)0,\ + (float _Complex)0, (long double)0, (double)0, (float)0) +#define__tg_impl_simple(x, y, z, fnl, fn, fnf, ...) \ + __tg_generic( \ + __tg_type(x) + __tg_type(y) + __tg_type(z), \ + fnl, fn, fnf, fnl, fn, fnf)(__VA_ARGS__) +#define__tg_impl_full(x, y, cfnl, cfn, cfnf, fnl, fn, fnf, ...) \ + __tg_generic( \ + __tg_type(x) + __tg_type(y),\ + cfnl, cfn, cfnf, fnl, fn, fnf)(__VA_ARGS__) +#else #define__tg_generic_simple(x, fnl, fn, fnf) \ __generic(x, long double _Complex, fnl, \ __generic(x, double _Complex, fn, \ @@ -94,6 +113,7 @@ __tg_generic_full(y, cfnl, cfn , cfn , fnl , fn , fn ), \ __tg_generic_full(y, cfnl, cfn , cfnf, fnl , fn , fnf )) \ (__VA_ARGS__) +#endif /* Macros to save lots of repetition below */ #define__tg_simple(x, fn) \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229705 - stable/9/sys/sys
Author: trociny Date: Fri Jan 6 16:45:44 2012 New Revision: 229705 URL: http://svn.freebsd.org/changeset/base/229705 Log: MFC r227954: Add const qualifier to rlimit_ident. Modified: stable/9/sys/sys/resource.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/resource.h == --- stable/9/sys/sys/resource.h Fri Jan 6 16:20:17 2012(r229704) +++ stable/9/sys/sys/resource.h Fri Jan 6 16:45:44 2012(r229705) @@ -108,7 +108,7 @@ struct rusage { */ #ifdef _RLIMIT_IDENT -static char *rlimit_ident[RLIM_NLIMITS] = { +static const char *rlimit_ident[RLIM_NLIMITS] = { "cpu", "fsize", "data", ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229706 - stable/8/sys/sys
Author: trociny Date: Fri Jan 6 16:46:52 2012 New Revision: 229706 URL: http://svn.freebsd.org/changeset/base/229706 Log: MFC r227954: Add const qualifier to rlimit_ident. Modified: stable/8/sys/sys/resource.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/sys/resource.h == --- stable/8/sys/sys/resource.h Fri Jan 6 16:45:44 2012(r229705) +++ stable/8/sys/sys/resource.h Fri Jan 6 16:46:52 2012(r229706) @@ -108,7 +108,7 @@ struct rusage { */ #ifdef _RLIMIT_IDENT -static char *rlimit_ident[RLIM_NLIMITS] = { +static const char *rlimit_ident[RLIM_NLIMITS] = { "cpu", "fsize", "data", ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r229667 - head/usr.sbin/daemon
On Jan 5, 2012, at 8:58 PM, Doug Barton wrote: > On 01/05/2012 14:48, Guy Helmer wrote: >> Allow daemon(8) to run pidfile_open() before relenquishing privileges >> so pid files can be written in /var/run when started as root. > > I'm not sure how useful this is since when daemon is exiting it won't be > able to remove the pid file (unless I'm missing something). > > Isn't it better to pre-create the pid file with the proper permissions > for the unprivileged user? > Would it be OK for daemon to hang around and wait for the child process to exit, then remove the pid file? The only other alternative I see would be to create a subdirectory that is writable by the user so the child can create and delete the pid file. Guy This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229707 - in stable/9/sys: kern sys
Author: trociny Date: Fri Jan 6 16:54:16 2012 New Revision: 229707 URL: http://svn.freebsd.org/changeset/base/229707 Log: MFC r227316: Add KVME_FLAG_SUPER and use it in sysctl_kern_proc_vmmap for marking entries with superpages. Submitted by: Mel Flynn Reviewed by: alc, rwatson Modified: stable/9/sys/kern/kern_proc.c stable/9/sys/sys/user.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_proc.c == --- stable/9/sys/kern/kern_proc.c Fri Jan 6 16:46:52 2012 (r229706) +++ stable/9/sys/kern/kern_proc.c Fri Jan 6 16:54:16 2012 (r229707) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -75,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef COMPAT_FREEBSD32 @@ -1710,7 +1712,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR entry = entry->next) { vm_object_t obj, tobj, lobj; vm_offset_t addr; - int vfslocked; + vm_paddr_t locked_pa; + int vfslocked, mincoreinfo; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; @@ -1728,8 +1731,14 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_resident = 0; addr = entry->start; while (addr < entry->end) { - if (pmap_extract(map->pmap, addr)) + locked_pa = 0; + mincoreinfo = pmap_mincore(map->pmap, addr, &locked_pa); + if (locked_pa != 0) + vm_page_unlock(PHYS_TO_VM_PAGE(locked_pa)); + if (mincoreinfo & MINCORE_INCORE) kve->kve_resident++; + if (mincoreinfo & MINCORE_SUPER) + kve->kve_flags |= KVME_FLAG_SUPER; addr += PAGE_SIZE; } Modified: stable/9/sys/sys/user.h == --- stable/9/sys/sys/user.h Fri Jan 6 16:46:52 2012(r229706) +++ stable/9/sys/sys/user.h Fri Jan 6 16:54:16 2012(r229707) @@ -412,6 +412,7 @@ struct kinfo_file { #defineKVME_FLAG_COW 0x0001 #defineKVME_FLAG_NEEDS_COPY0x0002 #defineKVME_FLAG_NOCOREDUMP0x0004 +#defineKVME_FLAG_SUPER 0x0008 #if defined(__amd64__) #defineKINFO_OVMENTRY_SIZE 1168 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229708 - stable/9/sys/net
Author: jhb Date: Fri Jan 6 16:56:09 2012 New Revision: 229708 URL: http://svn.freebsd.org/changeset/base/229708 Log: MFC 228967: Update if_obytes and if_omcast after successful transmit. While I'm here update if_oerrors if parent interface of vlan is not up and running. Previously it updated collision counter and it was confusing to interprete it. Modified: stable/9/sys/net/if_vlan.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/net/if_vlan.c == --- stable/9/sys/net/if_vlan.c Fri Jan 6 16:54:16 2012(r229707) +++ stable/9/sys/net/if_vlan.c Fri Jan 6 16:56:09 2012(r229708) @@ -1010,10 +1010,12 @@ vlan_transmit(struct ifnet *ifp, struct { struct ifvlan *ifv; struct ifnet *p; - int error; + int error, len, mcast; ifv = ifp->if_softc; p = PARENT(ifv); + len = m->m_pkthdr.len; + mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; BPF_MTAP(ifp, m); @@ -1023,7 +1025,7 @@ vlan_transmit(struct ifnet *ifp, struct */ if (!UP_AND_RUNNING(p)) { m_freem(m); - ifp->if_collisions++; + ifp->if_oerrors++; return (0); } @@ -1079,9 +1081,11 @@ vlan_transmit(struct ifnet *ifp, struct * Send it, precisely as ether_output() would have. */ error = (p->if_transmit)(p, m); - if (!error) + if (!error) { ifp->if_opackets++; - else + ifp->if_omcasts += mcast; + ifp->if_obytes += len; + } else ifp->if_oerrors++; return (error); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229709 - stable/8/sys/net
Author: jhb Date: Fri Jan 6 16:57:29 2012 New Revision: 229709 URL: http://svn.freebsd.org/changeset/base/229709 Log: MFC 228967: Update if_obytes and if_omcast after successful transmit. While I'm here update if_oerrors if parent interface of vlan is not up and running. Previously it updated collision counter and it was confusing to interprete it. Modified: stable/8/sys/net/if_vlan.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/net/if_vlan.c == --- stable/8/sys/net/if_vlan.c Fri Jan 6 16:56:09 2012(r229708) +++ stable/8/sys/net/if_vlan.c Fri Jan 6 16:57:29 2012(r229709) @@ -872,10 +872,12 @@ vlan_transmit(struct ifnet *ifp, struct { struct ifvlan *ifv; struct ifnet *p; - int error; + int error, len, mcast; ifv = ifp->if_softc; p = PARENT(ifv); + len = m->m_pkthdr.len; + mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; BPF_MTAP(ifp, m); @@ -885,7 +887,7 @@ vlan_transmit(struct ifnet *ifp, struct */ if (!UP_AND_RUNNING(p)) { m_freem(m); - ifp->if_collisions++; + ifp->if_oerrors++; return (0); } @@ -941,9 +943,11 @@ vlan_transmit(struct ifnet *ifp, struct * Send it, precisely as ether_output() would have. */ error = (p->if_transmit)(p, m); - if (!error) + if (!error) { ifp->if_opackets++; - else + ifp->if_omcasts += mcast; + ifp->if_obytes += len; + } else ifp->if_oerrors++; return (error); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229710 - stable/9/usr.bin/procstat
Author: trociny Date: Fri Jan 6 16:57:56 2012 New Revision: 229710 URL: http://svn.freebsd.org/changeset/base/229710 Log: MFC r227317, r227355: When displaying process virtual memory mappings print superpage mapping flag. Submitted by: Mel Flynn Reviewed by: alc, rwatson Modified: stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat_vm.c Directory Properties: stable/9/usr.bin/procstat/ (props changed) Modified: stable/9/usr.bin/procstat/procstat.1 == --- stable/9/usr.bin/procstat/procstat.1Fri Jan 6 16:57:29 2012 (r229709) +++ stable/9/usr.bin/procstat/procstat.1Fri Jan 6 16:57:56 2012 (r229710) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 14, 2011 +.Dd November 7, 2011 .Dt PROCSTAT 1 .Os .Sh NAME @@ -421,6 +421,8 @@ The following mapping flags may be displ copy-on-write .It N needs copy +.It S +one or more superpage mappings are used .El .Sh EXIT STATUS .Ex -std Modified: stable/9/usr.bin/procstat/procstat_vm.c == --- stable/9/usr.bin/procstat/procstat_vm.c Fri Jan 6 16:57:29 2012 (r229709) +++ stable/9/usr.bin/procstat/procstat_vm.c Fri Jan 6 16:57:56 2012 (r229710) @@ -50,7 +50,7 @@ procstat_vm(struct kinfo_proc *kipp) ptrwidth = 2*sizeof(void *) + 2; if (!hflag) - printf("%5s %*s %*s %3s %4s %4s %3s %3s %2s %-2s %-s\n", + printf("%5s %*s %*s %3s %4s %4s %3s %3s %3s %-2s %-s\n", "PID", ptrwidth, "START", ptrwidth, "END", "PRT", "RES", "PRES", "REF", "SHD", "FL", "TP", "PATH"); @@ -70,8 +70,9 @@ procstat_vm(struct kinfo_proc *kipp) printf("%3d ", kve->kve_ref_count); printf("%3d ", kve->kve_shadow_count); printf("%-1s", kve->kve_flags & KVME_FLAG_COW ? "C" : "-"); - printf("%-1s ", kve->kve_flags & KVME_FLAG_NEEDS_COPY ? "N" : + printf("%-1s", kve->kve_flags & KVME_FLAG_NEEDS_COPY ? "N" : "-"); + printf("%-1s ", kve->kve_flags & KVME_FLAG_SUPER ? "S" : "-"); switch (kve->kve_type) { case KVME_TYPE_NONE: str = "--"; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r229633 - stable/9/sys/net
On Fri, Jan 06, 2012 at 09:50:13AM -0500, John Baldwin wrote: > On Friday, January 06, 2012 9:24:59 am Gleb Smirnoff wrote: > > On Fri, Jan 06, 2012 at 08:45:12AM -0500, John Baldwin wrote: > > J> On Friday, January 06, 2012 3:20:05 am Gleb Smirnoff wrote: > > J> > John, > > J> > > > J> > On Thu, Jan 05, 2012 at 07:50:12PM +, John Baldwin wrote: > > J> > J> Author: jhb > > J> > J> Date: Thu Jan 5 19:50:12 2012 > > J> > J> New Revision: 229633 > > J> > J> URL: http://svn.freebsd.org/changeset/base/229633 > > J> > J> > > J> > J> Log: > > J> > J> MFC 228089: > > J> > J> Change the if_vlan driver to use if_transmit for forwarding > > packets to the > > J> > J> parent interface. This avoids the overhead of queueing a packet > > to an IFQ > > J> > J> only to immediately dequeue it again. > > J> > > > J> > This should have been merged together with r228967. Now a bug that > > J> > was successfully discovered and fixed in head/ leaked to stable > > J> > branches. :( > > J> > > > J> > Can you please merge r228967 to stable/9 and stable/8 ASAP? > > J> > > J> Err, that bug was already present before this change. I did not expose > > it. > > J> > > J> I can MFC the stat fixes, but this was already broken in 8 and 9, and is > > J> broken in 7 as well (likely in older branches than that). > > > > Well, on 8.2-STABLE if_obytes are correctly accounted: > > > > glebius@xxx:~:|>netstat -hI vlan2 1 > > input(vlan2) output > >packets errs idrops bytespackets errs bytes colls > > 33 0 0 2.3k 4 0840 0 > > 36 0 0 2.4k 4 0442 0 > > 32 0 0 2.3k 6 0887 0 > > > > glebius@xxx:~:|>uname -v > > FreeBSD 8.2-STABLE #2: Wed Jul 6 13:22:13 MSD 2011 > > > > While on 228089 =< head < 228967 they are not: > > > > glebius@xxx2:~:|>netstat -hI vlan77 1 > > input (vlan77) output > >packets errs idrops bytespackets errs bytes colls > > 9.1k 0 0 2M12k 0 0 0 > >11k 0 0 4.3M14k 0 0 0 > >10k 0 0 2.8M14k 0 0 0 > > 9.4k 0 0 2.3M13k 0 0 0 > > > > glebius@xxx2:~:|>uname -v > > FreeBSD 10.0-CURRENT #5 r228769M: Thu Dec 22 19:44:57 MSK 2011 > > Hmm, it seems to be a side effect of the IFQ macros. IFQ_HANDOFF() is no longer called in vlan_transmit() so we needed a different approach. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229711 - stable/9/sys/dev/et
Author: yongari Date: Fri Jan 6 18:15:27 2012 New Revision: 229711 URL: http://svn.freebsd.org/changeset/base/229711 Log: MFC r228291-228293,228297-228298: r228291: Remove NetBSD license. r199548 removed all bit macros that were derived from NetBSD. r228292: Implement suspend/resume methods. Driver has no issue with suspend/resume. r228293: Fix alt(4) support. Also add check for number of available TX descriptors before trying to send frames. If we're not able to send a frame, make sure to prepend it to if_snd queue such that alt(4) should work. While I'm here prefer ETHER_BPF_MTAP to BPF_MTAP. ETHER_BPF_MTAP should be used for controllers that support VLAN hardware tag insertion. The controller supports VLAN tag insertion but lacks VLAN tag stripping in RX path though. r228297: et(4) supports VLAN oversized frame so correctly set header length. While I'm here remove initializing if_mtu, it is set by ether_ifattach(9). Also move callout_init_mtx(9) to the right below driver lock initialization. r228298: Make et_probe() return BUS_PROBE_DEFAULT such that allow other driver that has high precedence for the controller override et(4). Add missing callout_drain(9) in device detach and rework detach routine. While I'm here use rman_get_rid(9) instead of using cached resource id because bus methods are free to change the id. Modified: stable/9/sys/dev/et/if_et.c stable/9/sys/dev/et/if_etreg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/et/if_et.c == --- stable/9/sys/dev/et/if_et.c Fri Jan 6 16:57:56 2012(r229710) +++ stable/9/sys/dev/et/if_et.c Fri Jan 6 18:15:27 2012(r229711) @@ -87,6 +87,8 @@ static intet_probe(device_t); static int et_attach(device_t); static int et_detach(device_t); static int et_shutdown(device_t); +static int et_suspend(device_t); +static int et_resume(device_t); static int et_miibus_readreg(device_t, int, int); static int et_miibus_writereg(device_t, int, int, int); @@ -169,6 +171,8 @@ static device_method_t et_methods[] = { DEVMETHOD(device_attach,et_attach), DEVMETHOD(device_detach,et_detach), DEVMETHOD(device_shutdown, et_shutdown), + DEVMETHOD(device_suspend, et_suspend), + DEVMETHOD(device_resume,et_resume), DEVMETHOD(miibus_readreg, et_miibus_readreg), DEVMETHOD(miibus_writereg, et_miibus_writereg), @@ -222,7 +226,7 @@ et_probe(device_t dev) for (d = et_devices; d->desc != NULL; ++d) { if (vid == d->vid && did == d->did) { device_set_desc(dev, d->desc); - return (0); + return (BUS_PROBE_DEFAULT); } } return (ENXIO); @@ -240,6 +244,7 @@ et_attach(device_t dev) sc->dev = dev; mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); + callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0); ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -331,10 +336,10 @@ et_attach(device_t dev) ifp->if_init = et_init; ifp->if_ioctl = et_ioctl; ifp->if_start = et_start; - ifp->if_mtu = ETHERMTU; ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; - IFQ_SET_MAXLEN(&ifp->if_snd, ET_TX_NDESC); + ifp->if_snd.ifq_drv_maxlen = ET_TX_NDESC - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, ET_TX_NDESC - 1); IFQ_SET_READY(&ifp->if_snd); et_chip_attach(sc); @@ -347,7 +352,9 @@ et_attach(device_t dev) } ether_ifattach(ifp, eaddr); - callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0); + + /* Tell the upper layer(s) we support long frames. */ + ifp->if_hdrlen = sizeof(struct ether_vlan_header); error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_NET | INTR_MPSAFE, NULL, et_intr, sc, &sc->sc_irq_handle); @@ -371,31 +378,27 @@ et_detach(device_t dev) struct et_softc *sc = device_get_softc(dev); if (device_is_attached(
svn commit: r229712 - stable/8/sys/dev/et
Author: yongari Date: Fri Jan 6 18:16:57 2012 New Revision: 229712 URL: http://svn.freebsd.org/changeset/base/229712 Log: MFC r228291-228293,228297-228298: r228291: Remove NetBSD license. r199548 removed all bit macros that were derived from NetBSD. r228292: Implement suspend/resume methods. Driver has no issue with suspend/resume. r228293: Fix alt(4) support. Also add check for number of available TX descriptors before trying to send frames. If we're not able to send a frame, make sure to prepend it to if_snd queue such that alt(4) should work. While I'm here prefer ETHER_BPF_MTAP to BPF_MTAP. ETHER_BPF_MTAP should be used for controllers that support VLAN hardware tag insertion. The controller supports VLAN tag insertion but lacks VLAN tag stripping in RX path though. r228297: et(4) supports VLAN oversized frame so correctly set header length. While I'm here remove initializing if_mtu, it is set by ether_ifattach(9). Also move callout_init_mtx(9) to the right below driver lock initialization. r228298: Make et_probe() return BUS_PROBE_DEFAULT such that allow other driver that has high precedence for the controller override et(4). Add missing callout_drain(9) in device detach and rework detach routine. While I'm here use rman_get_rid(9) instead of using cached resource id because bus methods are free to change the id. Modified: stable/8/sys/dev/et/if_et.c stable/8/sys/dev/et/if_etreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/et/if_et.c == --- stable/8/sys/dev/et/if_et.c Fri Jan 6 18:15:27 2012(r229711) +++ stable/8/sys/dev/et/if_et.c Fri Jan 6 18:16:57 2012(r229712) @@ -88,6 +88,8 @@ static intet_probe(device_t); static int et_attach(device_t); static int et_detach(device_t); static int et_shutdown(device_t); +static int et_suspend(device_t); +static int et_resume(device_t); static int et_miibus_readreg(device_t, int, int); static int et_miibus_writereg(device_t, int, int, int); @@ -170,6 +172,8 @@ static device_method_t et_methods[] = { DEVMETHOD(device_attach,et_attach), DEVMETHOD(device_detach,et_detach), DEVMETHOD(device_shutdown, et_shutdown), + DEVMETHOD(device_suspend, et_suspend), + DEVMETHOD(device_resume,et_resume), DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_driver_added, bus_generic_driver_added), @@ -226,7 +230,7 @@ et_probe(device_t dev) for (d = et_devices; d->desc != NULL; ++d) { if (vid == d->vid && did == d->did) { device_set_desc(dev, d->desc); - return (0); + return (BUS_PROBE_DEFAULT); } } return (ENXIO); @@ -244,6 +248,7 @@ et_attach(device_t dev) sc->dev = dev; mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); + callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0); ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -335,10 +340,10 @@ et_attach(device_t dev) ifp->if_init = et_init; ifp->if_ioctl = et_ioctl; ifp->if_start = et_start; - ifp->if_mtu = ETHERMTU; ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; - IFQ_SET_MAXLEN(&ifp->if_snd, ET_TX_NDESC); + ifp->if_snd.ifq_drv_maxlen = ET_TX_NDESC - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, ET_TX_NDESC - 1); IFQ_SET_READY(&ifp->if_snd); et_chip_attach(sc); @@ -351,7 +356,9 @@ et_attach(device_t dev) } ether_ifattach(ifp, eaddr); - callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0); + + /* Tell the upper layer(s) we support long frames. */ + ifp->if_hdrlen = sizeof(struct ether_vlan_header); error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_NET | INTR_MPSAFE, NULL, et_intr, sc, &sc->sc_irq_handle); @@ -375,31 +382,27 @@ et_detach(device_t dev) struct et_softc *sc = device_get_softc(dev); if (device_is_attached(dev)) { - struct ifnet *ifp = sc->ifp; - + ether_ifdetach(sc->ifp); ET_LOCK(sc); et_stop(sc); - bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_handle); ET_UNLOCK(sc); - - ether_ifdetach(ifp); + callout_drain(&sc->sc_tick); } if (sc->sc_miibus != NULL) device_delete_
svn commit: r229713 - stable/7/sys/dev/et
Author: yongari Date: Fri Jan 6 18:18:25 2012 New Revision: 229713 URL: http://svn.freebsd.org/changeset/base/229713 Log: MFC r228291-228293,228297-228298: r228291: Remove NetBSD license. r199548 removed all bit macros that were derived from NetBSD. r228292: Implement suspend/resume methods. Driver has no issue with suspend/resume. r228293: Fix alt(4) support. Also add check for number of available TX descriptors before trying to send frames. If we're not able to send a frame, make sure to prepend it to if_snd queue such that alt(4) should work. While I'm here prefer ETHER_BPF_MTAP to BPF_MTAP. ETHER_BPF_MTAP should be used for controllers that support VLAN hardware tag insertion. The controller supports VLAN tag insertion but lacks VLAN tag stripping in RX path though. r228297: et(4) supports VLAN oversized frame so correctly set header length. While I'm here remove initializing if_mtu, it is set by ether_ifattach(9). Also move callout_init_mtx(9) to the right below driver lock initialization. r228298: Make et_probe() return BUS_PROBE_DEFAULT such that allow other driver that has high precedence for the controller override et(4). Add missing callout_drain(9) in device detach and rework detach routine. While I'm here use rman_get_rid(9) instead of using cached resource id because bus methods are free to change the id. Modified: stable/7/sys/dev/et/if_et.c stable/7/sys/dev/et/if_etreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/et/if_et.c == --- stable/7/sys/dev/et/if_et.c Fri Jan 6 18:16:57 2012(r229712) +++ stable/7/sys/dev/et/if_et.c Fri Jan 6 18:18:25 2012(r229713) @@ -88,6 +88,8 @@ static intet_probe(device_t); static int et_attach(device_t); static int et_detach(device_t); static int et_shutdown(device_t); +static int et_suspend(device_t); +static int et_resume(device_t); static int et_miibus_readreg(device_t, int, int); static int et_miibus_writereg(device_t, int, int, int); @@ -170,6 +172,8 @@ static device_method_t et_methods[] = { DEVMETHOD(device_attach,et_attach), DEVMETHOD(device_detach,et_detach), DEVMETHOD(device_shutdown, et_shutdown), + DEVMETHOD(device_suspend, et_suspend), + DEVMETHOD(device_resume,et_resume), DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_driver_added, bus_generic_driver_added), @@ -226,7 +230,7 @@ et_probe(device_t dev) for (d = et_devices; d->desc != NULL; ++d) { if (vid == d->vid && did == d->did) { device_set_desc(dev, d->desc); - return (0); + return (BUS_PROBE_DEFAULT); } } return (ENXIO); @@ -244,6 +248,7 @@ et_attach(device_t dev) sc->dev = dev; mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); + callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0); ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -335,10 +340,10 @@ et_attach(device_t dev) ifp->if_init = et_init; ifp->if_ioctl = et_ioctl; ifp->if_start = et_start; - ifp->if_mtu = ETHERMTU; ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; - IFQ_SET_MAXLEN(&ifp->if_snd, ET_TX_NDESC); + ifp->if_snd.ifq_drv_maxlen = ET_TX_NDESC - 1; + IFQ_SET_MAXLEN(&ifp->if_snd, ET_TX_NDESC - 1); IFQ_SET_READY(&ifp->if_snd); et_chip_attach(sc); @@ -351,7 +356,9 @@ et_attach(device_t dev) } ether_ifattach(ifp, eaddr); - callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0); + + /* Tell the upper layer(s) we support long frames. */ + ifp->if_hdrlen = sizeof(struct ether_vlan_header); error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_NET | INTR_MPSAFE, NULL, et_intr, sc, &sc->sc_irq_handle); @@ -375,31 +382,27 @@ et_detach(device_t dev) struct et_softc *sc = device_get_softc(dev); if (device_is_attached(dev)) { - struct ifnet *ifp = sc->ifp; - + ether_ifdetach(sc->ifp); ET_LOCK(sc); et_stop(sc); - bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_handle); ET_UNLOCK(sc); - - ether_ifdetach(ifp); + callout_drain(&sc->sc_tick); } if (sc->sc_miibus != NULL) device_delete_child(dev, sc->sc_miibus); bus_generic_detac
svn commit: r229714 - head/sys/netinet
Author: np Date: Fri Jan 6 18:29:40 2012 New Revision: 229714 URL: http://svn.freebsd.org/changeset/base/229714 Log: Always release the inp lock before returning from tcp_detach. MFC after:5 days Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c == --- head/sys/netinet/tcp_usrreq.c Fri Jan 6 18:18:25 2012 (r229713) +++ head/sys/netinet/tcp_usrreq.c Fri Jan 6 18:29:40 2012 (r229714) @@ -204,8 +204,10 @@ tcp_detach(struct socket *so, struct inp tcp_discardcb(tp); in_pcbdetach(inp); in_pcbfree(inp); - } else + } else { in_pcbdetach(inp); + INP_WUNLOCK(inp); + } } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229715 - head/contrib/gcc/config
Author: andreast Date: Fri Jan 6 18:37:49 2012 New Revision: 229715 URL: http://svn.freebsd.org/changeset/base/229715 Log: Silence a warning about redefinition of TARGET_ELF on powerpc. Modified: head/contrib/gcc/config/freebsd.h Modified: head/contrib/gcc/config/freebsd.h == --- head/contrib/gcc/config/freebsd.h Fri Jan 6 18:29:40 2012 (r229714) +++ head/contrib/gcc/config/freebsd.h Fri Jan 6 18:37:49 2012 (r229715) @@ -63,6 +63,7 @@ Boston, MA 02110-1301, USA. */ /* All FreeBSD Architectures support the ELF object file format. */ #undef OBJECT_FORMAT_ELF #define OBJECT_FORMAT_ELF 1 +#undef TARGET_ELF #define TARGET_ELF 1 /* Don't assume anything about the header files. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229716 - head/include
Author: ed Date: Fri Jan 6 19:04:59 2012 New Revision: 229716 URL: http://svn.freebsd.org/changeset/base/229716 Log: Last attempt at : do enable the new code for C11 compilers. I was thinking by myself, if the new code doesn't work with GCC 4.2, why not simply turn it into an efficient version for C11 compilers? By changing the code to use _Generic() directly in that case, I can build the tgmath regression test in a matter of milliseconds with Clang, instead of the 8 seconds it used to take. So by the time C11 becomes the default, it will pick up the new code automatically. And now I will refrain from making more changes to . Modified: head/include/tgmath.h Modified: head/include/tgmath.h == --- head/include/tgmath.h Fri Jan 6 18:37:49 2012(r229715) +++ head/include/tgmath.h Fri Jan 6 19:04:59 2012(r229716) @@ -53,19 +53,23 @@ * Note that these macros cannot be implemented with C's ?: operator, * because the return type of the whole expression would incorrectly be long * double complex regardless of the argument types. + * + * The structure of the C11 implementation of these macros can in + * principle be reused for non-C11 compilers, but due to an integer + * promotion bug for complex types in GCC 4.2, simply let non-C11 + * compilers use an inefficient yet reliable version. */ -#ifndef __generic -#error " not implemented for this compiler" -#endif - -#if 0 /* XXX: Much shorter and faster to compile, but broken with GCC 4.2. */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #define__tg_generic(x, cfnl, cfn, cfnf, fnl, fn, fnf) \ - __generic(x, long double _Complex, cfnl,\ - __generic(x, double _Complex, cfn, \ - __generic(x, float _Complex, cfnf, \ - __generic(x, long double, fnl, \ - __generic(x, float, fnf, fn) + _Generic(x, \ + long double _Complex: cfnl, \ + double _Complex: cfn, \ + float _Complex: cfnf, \ + long double: fnl, \ + default: fn,\ + float: fnf \ + ) #define__tg_type(x) \ __tg_generic(x, (long double _Complex)0, (double _Complex)0,\ (float _Complex)0, (long double)0, (double)0, (float)0) @@ -77,7 +81,7 @@ __tg_generic( \ __tg_type(x) + __tg_type(y),\ cfnl, cfn, cfnf, fnl, fn, fnf)(__VA_ARGS__) -#else +#elif defined(__generic) #define__tg_generic_simple(x, fnl, fn, fnf) \ __generic(x, long double _Complex, fnl, \ __generic(x, double _Complex, fn, \ @@ -113,6 +117,8 @@ __tg_generic_full(y, cfnl, cfn , cfn , fnl , fn , fn ), \ __tg_generic_full(y, cfnl, cfn , cfnf, fnl , fn , fnf )) \ (__VA_ARGS__) +#else +#error " not implemented for this compiler" #endif /* Macros to save lots of repetition below */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r229714 - head/sys/netinet
Navdeep, On Fri, Jan 06, 2012 at 06:29:41PM +, Navdeep Parhar wrote: N> Author: np N> Date: Fri Jan 6 18:29:40 2012 N> New Revision: 229714 N> URL: http://svn.freebsd.org/changeset/base/229714 N> N> Log: N> Always release the inp lock before returning from tcp_detach. ^ after ? N> Modified: N> head/sys/netinet/tcp_usrreq.c N> N> Modified: head/sys/netinet/tcp_usrreq.c N> == N> --- head/sys/netinet/tcp_usrreq.cFri Jan 6 18:18:25 2012 (r229713) N> +++ head/sys/netinet/tcp_usrreq.cFri Jan 6 18:29:40 2012 (r229714) N> @@ -204,8 +204,10 @@ tcp_detach(struct socket *so, struct inp N> tcp_discardcb(tp); N> in_pcbdetach(inp); N> in_pcbfree(inp); N> -} else N> +} else { N> in_pcbdetach(inp); N> +INP_WUNLOCK(inp); N> +} N> } N> } N> -- Totus tuus, Glebius. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229717 - stable/9/sys/dev/et
Author: yongari Date: Fri Jan 6 19:09:47 2012 New Revision: 229717 URL: http://svn.freebsd.org/changeset/base/229717 Log: MFC r228325: Overhaul bus_dma(9) usage in et(4) and clean up TX/RX path. This change should make et(4) work on any architectures. o Remove m_getl inline function and replace it with stanard mbuf interfaces. Previous code tried to minimize code duplication but this came from incorrect use of common DMA tag. Driver may be still use a common RX allocation handler with additional structure changes but I don't see much point to do that it would make it hard to understand the code. o Remove DragonflyBSD specific constant EVL_ENCAPLEN, use ETHER_VLAN_ENCAP_LEN instead. o Add bunch of new RX status definition. It seems controller supports RX checksum offloading but I was not able to make the feature work yet. Currently driver checks whether recevied frame is good one or not. o Avoid a typedef ending in '_t' as style(9) says. o Controller has no restriction on DMA address space, so there is no reason to limit the DMA address to 32bit. Descriptor rings, status blocks and TX/RX buffers now use full 64bit DMA addressing. o Allocate DMA memory shared between host and controller as coherent. o Create 3 separate DMA tags to be used as TX, mini RX ring and stanard RX ring. Previously it created a single DMA tag and it was used to all three rings. o et(4) does not support jumbo frame at this moment and I still don't quite understand how jumbo frame works on this controller so use two RX rings to handle small sized frame and normal sized frame respectively. The mini RX ring will be used to receive frames that are less than or equal to 127 bytes. The second RX ring is used to receive frames that are not handled by the first RX ring. If jumbo frame support is implemented, driver may have to choose better RX scheme by letting the second RX ring handle jumbo frames. This scheme will mimic Broadcom's efficient jumbo frame handling feature. However RAM buffer size(16KB) of the controller is too small to hold 2 jumbo frames, if 9KB jumbo frame is used, I'm not sure how good performance would it have. o In et_rxeof(), make sure to check whether controller received good frame or not. Passing corrupted frame to upper layer is bad idea. o If driver receives a bad frame or driver fails to allocate RX buffer due to resource shortage condition, reuse previously loaded DMA map for RX buffer instead of unloading/loading RX buffer again. o et_init_tx_ring() never fails so change return type to void. o In watchdog handler, show TX DMA write back status of errored frame which could be used as a clue to debug watchdog timeout. o Add missing bus_dmamap_sync() in various places such that et(4) should work with bounce buffers(e.g. PAE). o TX side bus_dmamap_load_mbuf_sg(9) support. o RX side bus_dmamap_load_mbuf_sg(9) support. o Controller has no DMA alignment limit in RX buffer so use m_adj(9) in RX buffer allocation to make IP header align on 2 bytes boundary. Otherwise it would trigger unaligned access error in upper layer on strict alignment architectures. One of down side of controller is it provides limited set of RX buffer length like most Intel controllers. This is not problem at this moment because driver does not support jumbo frame yet but it may require alignment fixup code to support jumbo frame on strict alignment architectures. o In et_txeof(), don't zero TX descriptors for transmitted frames. TX descriptors don't need write access after transmission. Driver sets IFF_DRV_OACTIVE when the number of available TX descriptors are less than or equal to ET_NSEG_SPARE. Make sure to clear IFF_DRV_OACTIVE only when the number of available TX descriptor is greater than ET_NSEG_SPARE. Modified: stable/9/sys/dev/et/if_et.c stable/9/sys/dev/et/if_etvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/et/if_et.c ===
svn commit: r229718 - stable/8/sys/dev/et
Author: yongari Date: Fri Jan 6 19:11:20 2012 New Revision: 229718 URL: http://svn.freebsd.org/changeset/base/229718 Log: MFC r228325: Overhaul bus_dma(9) usage in et(4) and clean up TX/RX path. This change should make et(4) work on any architectures. o Remove m_getl inline function and replace it with stanard mbuf interfaces. Previous code tried to minimize code duplication but this came from incorrect use of common DMA tag. Driver may be still use a common RX allocation handler with additional structure changes but I don't see much point to do that it would make it hard to understand the code. o Remove DragonflyBSD specific constant EVL_ENCAPLEN, use ETHER_VLAN_ENCAP_LEN instead. o Add bunch of new RX status definition. It seems controller supports RX checksum offloading but I was not able to make the feature work yet. Currently driver checks whether recevied frame is good one or not. o Avoid a typedef ending in '_t' as style(9) says. o Controller has no restriction on DMA address space, so there is no reason to limit the DMA address to 32bit. Descriptor rings, status blocks and TX/RX buffers now use full 64bit DMA addressing. o Allocate DMA memory shared between host and controller as coherent. o Create 3 separate DMA tags to be used as TX, mini RX ring and stanard RX ring. Previously it created a single DMA tag and it was used to all three rings. o et(4) does not support jumbo frame at this moment and I still don't quite understand how jumbo frame works on this controller so use two RX rings to handle small sized frame and normal sized frame respectively. The mini RX ring will be used to receive frames that are less than or equal to 127 bytes. The second RX ring is used to receive frames that are not handled by the first RX ring. If jumbo frame support is implemented, driver may have to choose better RX scheme by letting the second RX ring handle jumbo frames. This scheme will mimic Broadcom's efficient jumbo frame handling feature. However RAM buffer size(16KB) of the controller is too small to hold 2 jumbo frames, if 9KB jumbo frame is used, I'm not sure how good performance would it have. o In et_rxeof(), make sure to check whether controller received good frame or not. Passing corrupted frame to upper layer is bad idea. o If driver receives a bad frame or driver fails to allocate RX buffer due to resource shortage condition, reuse previously loaded DMA map for RX buffer instead of unloading/loading RX buffer again. o et_init_tx_ring() never fails so change return type to void. o In watchdog handler, show TX DMA write back status of errored frame which could be used as a clue to debug watchdog timeout. o Add missing bus_dmamap_sync() in various places such that et(4) should work with bounce buffers(e.g. PAE). o TX side bus_dmamap_load_mbuf_sg(9) support. o RX side bus_dmamap_load_mbuf_sg(9) support. o Controller has no DMA alignment limit in RX buffer so use m_adj(9) in RX buffer allocation to make IP header align on 2 bytes boundary. Otherwise it would trigger unaligned access error in upper layer on strict alignment architectures. One of down side of controller is it provides limited set of RX buffer length like most Intel controllers. This is not problem at this moment because driver does not support jumbo frame yet but it may require alignment fixup code to support jumbo frame on strict alignment architectures. o In et_txeof(), don't zero TX descriptors for transmitted frames. TX descriptors don't need write access after transmission. Driver sets IFF_DRV_OACTIVE when the number of available TX descriptors are less than or equal to ET_NSEG_SPARE. Make sure to clear IFF_DRV_OACTIVE only when the number of available TX descriptor is greater than ET_NSEG_SPARE. Modified: stable/8/sys/dev/et/if_et.c stable/8/sys/dev/et/if_etvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/et/if_et.c == --- stable/8/sys/dev/et/if_et.c Fri Jan 6 19:09:47 2012(r229717) +++ stable/8/sys/dev/et/if_et.c Fri Jan 6 19:11:20 2012(r229718) @@ -100,7 +100,7 @@ static void et_init(void *); static int et_ioctl(struct ifnet *, u_long, caddr_t); static voidet_start_locked(struct ifnet *); static voidet_start(struct ifnet *); -static vo
svn commit: r229719 - stable/7/sys/dev/et
Author: yongari Date: Fri Jan 6 19:12:47 2012 New Revision: 229719 URL: http://svn.freebsd.org/changeset/base/229719 Log: MFC r228325: Overhaul bus_dma(9) usage in et(4) and clean up TX/RX path. This change should make et(4) work on any architectures. o Remove m_getl inline function and replace it with stanard mbuf interfaces. Previous code tried to minimize code duplication but this came from incorrect use of common DMA tag. Driver may be still use a common RX allocation handler with additional structure changes but I don't see much point to do that it would make it hard to understand the code. o Remove DragonflyBSD specific constant EVL_ENCAPLEN, use ETHER_VLAN_ENCAP_LEN instead. o Add bunch of new RX status definition. It seems controller supports RX checksum offloading but I was not able to make the feature work yet. Currently driver checks whether recevied frame is good one or not. o Avoid a typedef ending in '_t' as style(9) says. o Controller has no restriction on DMA address space, so there is no reason to limit the DMA address to 32bit. Descriptor rings, status blocks and TX/RX buffers now use full 64bit DMA addressing. o Allocate DMA memory shared between host and controller as coherent. o Create 3 separate DMA tags to be used as TX, mini RX ring and stanard RX ring. Previously it created a single DMA tag and it was used to all three rings. o et(4) does not support jumbo frame at this moment and I still don't quite understand how jumbo frame works on this controller so use two RX rings to handle small sized frame and normal sized frame respectively. The mini RX ring will be used to receive frames that are less than or equal to 127 bytes. The second RX ring is used to receive frames that are not handled by the first RX ring. If jumbo frame support is implemented, driver may have to choose better RX scheme by letting the second RX ring handle jumbo frames. This scheme will mimic Broadcom's efficient jumbo frame handling feature. However RAM buffer size(16KB) of the controller is too small to hold 2 jumbo frames, if 9KB jumbo frame is used, I'm not sure how good performance would it have. o In et_rxeof(), make sure to check whether controller received good frame or not. Passing corrupted frame to upper layer is bad idea. o If driver receives a bad frame or driver fails to allocate RX buffer due to resource shortage condition, reuse previously loaded DMA map for RX buffer instead of unloading/loading RX buffer again. o et_init_tx_ring() never fails so change return type to void. o In watchdog handler, show TX DMA write back status of errored frame which could be used as a clue to debug watchdog timeout. o Add missing bus_dmamap_sync() in various places such that et(4) should work with bounce buffers(e.g. PAE). o TX side bus_dmamap_load_mbuf_sg(9) support. o RX side bus_dmamap_load_mbuf_sg(9) support. o Controller has no DMA alignment limit in RX buffer so use m_adj(9) in RX buffer allocation to make IP header align on 2 bytes boundary. Otherwise it would trigger unaligned access error in upper layer on strict alignment architectures. One of down side of controller is it provides limited set of RX buffer length like most Intel controllers. This is not problem at this moment because driver does not support jumbo frame yet but it may require alignment fixup code to support jumbo frame on strict alignment architectures. o In et_txeof(), don't zero TX descriptors for transmitted frames. TX descriptors don't need write access after transmission. Driver sets IFF_DRV_OACTIVE when the number of available TX descriptors are less than or equal to ET_NSEG_SPARE. Make sure to clear IFF_DRV_OACTIVE only when the number of available TX descriptor is greater than ET_NSEG_SPARE. Modified: stable/7/sys/dev/et/if_et.c stable/7/sys/dev/et/if_etvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/et/if_et.c == --- stable/7/sys/dev/et/if_et.c Fri Jan 6 19:11:20 2012(r229718) +++ stable/7/sys/dev/et/if_et.c Fri Jan 6 19:12:47 2012(r229719) @@ -100,7 +100,7 @@ static void et_init(void *); static int et_ioctl(struct ifnet *, u_long, caddr_t); static voidet_start_locked(struct ifnet *); static voidet_start(struct ifnet *); -static voidet_watchdog(struct et_softc *); +static int
Re: svn commit: r229714 - head/sys/netinet
On Fri, Jan 06, 2012 at 11:05:15PM +0400, Gleb Smirnoff wrote: > Navdeep, > > On Fri, Jan 06, 2012 at 06:29:41PM +, Navdeep Parhar wrote: > N> Author: np > N> Date: Fri Jan 6 18:29:40 2012 > N> New Revision: 229714 > N> URL: http://svn.freebsd.org/changeset/base/229714 > N> > N> Log: > N> Always release the inp lock before returning from tcp_detach. >^ after ? I don't see anything wrong in the message. The lock is released within tcp_detach (before it returns), and not after. Navdeep > > N> Modified: > N> head/sys/netinet/tcp_usrreq.c > N> > N> Modified: head/sys/netinet/tcp_usrreq.c > N> > == > N> --- head/sys/netinet/tcp_usrreq.c Fri Jan 6 18:18:25 2012 > (r229713) > N> +++ head/sys/netinet/tcp_usrreq.c Fri Jan 6 18:29:40 2012 > (r229714) > N> @@ -204,8 +204,10 @@ tcp_detach(struct socket *so, struct inp > N>tcp_discardcb(tp); > N>in_pcbdetach(inp); > N>in_pcbfree(inp); > N> - } else > N> + } else { > N>in_pcbdetach(inp); > N> + INP_WUNLOCK(inp); > N> + } > N>} > N> } > N> > > -- > Totus tuus, Glebius. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229720 - stable/9/sys/dev/et
Author: yongari Date: Fri Jan 6 19:24:33 2012 New Revision: 229720 URL: http://svn.freebsd.org/changeset/base/229720 Log: MFC r228326-228327,228331-228332: r228326: Controller does not require TX start command for every frame. So send a single TX command after setting up all TX frames. This removes unnecessary register accesses and bus_dmamap_sync(9) calls. et(4) uses TX interrupt moderation so it's possible to have TX buffers that were already transmitted but waiting for TX completion interrupt. If the number of available TX descriptor is less then 1/3 of total TX descriptor, try reclaiming first to get enough free TX descriptors before setting up TX descriptors. After r228325, et_txeof() no longer tries to send frames after reclaiming TX buffers. That change was made to give more chance to transmit frames in main interrupt handler since we can still send frames in interrupt handler with RX interrupt. So right before exiting interrupt hander, after enabling interrupt, try to send more frames. This gives slightly better performance numbers. While I'm here reduce number of spare TX descriptors from 8 to 4. Controller does not require reserved TX descriptors, it was just to reduce TX overhead. After r228325, driver has much lower TX overhead so it does not make sense to reserve 8 TX descriptors. r228327: Remove et_enable_intrs(), et_disable_intrs() functions and manipulation of interrupt register access is done through CSR_WRITE_4 macro. Also add disabling interrupt into et_reset() because we want interrupt disabled state after controller reset. While I'm here slightly change interrupt handler to be more readable one. r228331: Rework link state tracking and TX/RX MAC configuration. o Do not report link status if driver is not running. o TX/RX MAC configuration should be done with resolved speed, duplex and flow control after establishing a link so it can't be done in driver initialization routine. Move the configuration to miibus_statchg callback which will be called whenever any link state change is detected. At this moment, flow-control is not enabled yet mainly because I was not able to set correct flow control parameters to generate TX pause frames. o Now TX/RX MAC is enabled only when a valid link is detected. Rearragnge hardware initialization routine a bit to leave enabling MAC to miibus_statchg callback. In order to that, TX/RX DMA engine is enabled in et_init_locked(). o Introduce ET_FLAG_LINK flag to track current link state. o Introduce ET_FLAG_FASTETHER flag to mark whether controller is fast ethernet. This flag is checked in miibus_statchg callback to know whether PHY established a valid link. o In et_stop(), TX/RX MAC is explicitly disabled instead of relying on et_reset(). And move et_reset() from et_stop() to controller initialization. Controler reset is not required here and it would also clear critial registers(i.e station address, RX filter configuration, WOL etc) that are required to make WOL work. o Switching to current media is done in et_init_locked() after setting IFF_DRV_RUNNING flag. This should ensure reliable auto-negotiation/manual link establishment. o In et_start_locked(), check whether driver got a valid link before trying to send frames. o Remove checking a link in et_tick() as this is done by miibus_statchg callback. r228332: Implement hardware MAC statistics counter. Counters could be queried with dev.et.%d.stats sysctl node where %d is an instance of device. Modified: stable/9/sys/dev/et/if_et.c stable/9/sys/dev/et/if_etreg.h stable/9/sys/dev/et/if_etvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/et/if_et.c == --- stable/9/sys/dev/et/if_et.c Fri Jan 6 19:12:47 2012(r229719) +++ stable/9/sys/dev/et/if_et.c Fri Jan 6 19:24:33 2012(r229720) @@ -109,8 +109,6 @@ static int et_sysctl_rx_intr_npkts(SYSCT static int et_sysctl_rx_intr_delay(SYSCTL_HANDLER_ARGS); stat
svn commit: r229721 - stable/8/sys/dev/et
Author: yongari Date: Fri Jan 6 19:26:31 2012 New Revision: 229721 URL: http://svn.freebsd.org/changeset/base/229721 Log: MFC r228326-228327,228331-228332: r228326: Controller does not require TX start command for every frame. So send a single TX command after setting up all TX frames. This removes unnecessary register accesses and bus_dmamap_sync(9) calls. et(4) uses TX interrupt moderation so it's possible to have TX buffers that were already transmitted but waiting for TX completion interrupt. If the number of available TX descriptor is less then 1/3 of total TX descriptor, try reclaiming first to get enough free TX descriptors before setting up TX descriptors. After r228325, et_txeof() no longer tries to send frames after reclaiming TX buffers. That change was made to give more chance to transmit frames in main interrupt handler since we can still send frames in interrupt handler with RX interrupt. So right before exiting interrupt hander, after enabling interrupt, try to send more frames. This gives slightly better performance numbers. While I'm here reduce number of spare TX descriptors from 8 to 4. Controller does not require reserved TX descriptors, it was just to reduce TX overhead. After r228325, driver has much lower TX overhead so it does not make sense to reserve 8 TX descriptors. r228327: Remove et_enable_intrs(), et_disable_intrs() functions and manipulation of interrupt register access is done through CSR_WRITE_4 macro. Also add disabling interrupt into et_reset() because we want interrupt disabled state after controller reset. While I'm here slightly change interrupt handler to be more readable one. r228331: Rework link state tracking and TX/RX MAC configuration. o Do not report link status if driver is not running. o TX/RX MAC configuration should be done with resolved speed, duplex and flow control after establishing a link so it can't be done in driver initialization routine. Move the configuration to miibus_statchg callback which will be called whenever any link state change is detected. At this moment, flow-control is not enabled yet mainly because I was not able to set correct flow control parameters to generate TX pause frames. o Now TX/RX MAC is enabled only when a valid link is detected. Rearragnge hardware initialization routine a bit to leave enabling MAC to miibus_statchg callback. In order to that, TX/RX DMA engine is enabled in et_init_locked(). o Introduce ET_FLAG_LINK flag to track current link state. o Introduce ET_FLAG_FASTETHER flag to mark whether controller is fast ethernet. This flag is checked in miibus_statchg callback to know whether PHY established a valid link. o In et_stop(), TX/RX MAC is explicitly disabled instead of relying on et_reset(). And move et_reset() from et_stop() to controller initialization. Controler reset is not required here and it would also clear critial registers(i.e station address, RX filter configuration, WOL etc) that are required to make WOL work. o Switching to current media is done in et_init_locked() after setting IFF_DRV_RUNNING flag. This should ensure reliable auto-negotiation/manual link establishment. o In et_start_locked(), check whether driver got a valid link before trying to send frames. o Remove checking a link in et_tick() as this is done by miibus_statchg callback. r228332: Implement hardware MAC statistics counter. Counters could be queried with dev.et.%d.stats sysctl node where %d is an instance of device. Modified: stable/8/sys/dev/et/if_et.c stable/8/sys/dev/et/if_etreg.h stable/8/sys/dev/et/if_etvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/et/if_et.c == --- stable/8/sys/dev/et/if_et.c Fri Jan 6 19:24:33 2012(r229720) +++ stable/8/sys/dev/et/if_et.c Fri Jan 6 19:26:31 2012(r229721) @@ -110,8 +110,6 @@ static int et_sysctl_rx_intr_npkts(SYSCT static int et_sysctl_rx_intr_delay(SYSCTL_HANDLER_ARGS); static voidet_intr(void *); -static voidet_enable_intrs(struct et_softc *, uint32_t); -static voidet_disable_intrs(struct et_softc *); static voidet_rxeof(struct et_softc *); static voidet_txeof(struct et_softc *); @@ -144,13 +142,12 @@ static intet_start_rxdma(struct et_soft static int et_start_txdma(struct et_softc *); static int et_stop_rxdma(struct et_softc *); static int et_stop_txd
svn commit: r229722 - stable/7/sys/dev/et
Author: yongari Date: Fri Jan 6 19:27:51 2012 New Revision: 229722 URL: http://svn.freebsd.org/changeset/base/229722 Log: MFC r228326-228327,228331-228332: r228326: Controller does not require TX start command for every frame. So send a single TX command after setting up all TX frames. This removes unnecessary register accesses and bus_dmamap_sync(9) calls. et(4) uses TX interrupt moderation so it's possible to have TX buffers that were already transmitted but waiting for TX completion interrupt. If the number of available TX descriptor is less then 1/3 of total TX descriptor, try reclaiming first to get enough free TX descriptors before setting up TX descriptors. After r228325, et_txeof() no longer tries to send frames after reclaiming TX buffers. That change was made to give more chance to transmit frames in main interrupt handler since we can still send frames in interrupt handler with RX interrupt. So right before exiting interrupt hander, after enabling interrupt, try to send more frames. This gives slightly better performance numbers. While I'm here reduce number of spare TX descriptors from 8 to 4. Controller does not require reserved TX descriptors, it was just to reduce TX overhead. After r228325, driver has much lower TX overhead so it does not make sense to reserve 8 TX descriptors. r228327: Remove et_enable_intrs(), et_disable_intrs() functions and manipulation of interrupt register access is done through CSR_WRITE_4 macro. Also add disabling interrupt into et_reset() because we want interrupt disabled state after controller reset. While I'm here slightly change interrupt handler to be more readable one. r228331: Rework link state tracking and TX/RX MAC configuration. o Do not report link status if driver is not running. o TX/RX MAC configuration should be done with resolved speed, duplex and flow control after establishing a link so it can't be done in driver initialization routine. Move the configuration to miibus_statchg callback which will be called whenever any link state change is detected. At this moment, flow-control is not enabled yet mainly because I was not able to set correct flow control parameters to generate TX pause frames. o Now TX/RX MAC is enabled only when a valid link is detected. Rearragnge hardware initialization routine a bit to leave enabling MAC to miibus_statchg callback. In order to that, TX/RX DMA engine is enabled in et_init_locked(). o Introduce ET_FLAG_LINK flag to track current link state. o Introduce ET_FLAG_FASTETHER flag to mark whether controller is fast ethernet. This flag is checked in miibus_statchg callback to know whether PHY established a valid link. o In et_stop(), TX/RX MAC is explicitly disabled instead of relying on et_reset(). And move et_reset() from et_stop() to controller initialization. Controler reset is not required here and it would also clear critial registers(i.e station address, RX filter configuration, WOL etc) that are required to make WOL work. o Switching to current media is done in et_init_locked() after setting IFF_DRV_RUNNING flag. This should ensure reliable auto-negotiation/manual link establishment. o In et_start_locked(), check whether driver got a valid link before trying to send frames. o Remove checking a link in et_tick() as this is done by miibus_statchg callback. r228332: Implement hardware MAC statistics counter. Counters could be queried with dev.et.%d.stats sysctl node where %d is an instance of device. Modified: stable/7/sys/dev/et/if_et.c stable/7/sys/dev/et/if_etreg.h stable/7/sys/dev/et/if_etvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/et/if_et.c == --- stable/7/sys/dev/et/if_et.c Fri Jan 6 19:26:31 2012(r229721) +++ stable/7/sys/dev/et/if_et.c Fri Jan 6 19:27:51 2012(r229722) @@ -110,8 +110,6 @@ static int et_sysctl_rx_intr_npkts(SYSCT static int et_sysctl_rx_intr_delay(SYSCTL_HANDLER_ARGS); static voidet_intr(void *); -static voidet_enable_intrs(struct et_softc *, uint32_t); -static voidet_disable_intrs(struct et_softc *); static voidet_rxeof(struct et_softc *); static voidet_txeof(struct et_softc *); @@ -144,13 +142,12 @@ static intet_start_rxdma(struct et_soft static int et_start_txdma(struct et_softc *); static int et_stop_rxdma(struct et_softc *); static int et_stop_txdma(struct et_softc *); -static int et_enable_txr
svn commit: r229723 - in stable/9: . lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys sys/vm
Author: jhb Date: Fri Jan 6 19:29:16 2012 New Revision: 229723 URL: http://svn.freebsd.org/changeset/base/229723 Log: MFC 227070,227341,227502: Add the posix_fadvise(2) system call. It is somewhat similar to madvise(2) except that it operates on a file descriptor instead of a memory region. It is currently only supported on regular files. Note that this adds a new VOP, so all filesystem modules must be recompiled. Approved by: re (kib) Added: stable/9/lib/libc/sys/posix_fadvise.2 - copied unchanged from r227070, head/lib/libc/sys/posix_fadvise.2 Modified: stable/9/UPDATING stable/9/lib/libc/sys/Makefile.inc stable/9/lib/libc/sys/Symbol.map stable/9/lib/libc/sys/madvise.2 stable/9/sys/compat/freebsd32/freebsd32_misc.c stable/9/sys/compat/freebsd32/syscalls.master stable/9/sys/kern/syscalls.master stable/9/sys/kern/vfs_default.c stable/9/sys/kern/vfs_subr.c stable/9/sys/kern/vfs_syscalls.c stable/9/sys/kern/vfs_vnops.c stable/9/sys/kern/vnode_if.src stable/9/sys/sys/fcntl.h stable/9/sys/sys/file.h stable/9/sys/sys/param.h stable/9/sys/sys/syscallsubr.h stable/9/sys/sys/unistd.h stable/9/sys/sys/vnode.h stable/9/sys/vm/vm_object.c stable/9/sys/vm/vm_object.h Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/stdtime/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/UPDATING == --- stable/9/UPDATING Fri Jan 6 19:27:51 2012(r229722) +++ stable/9/UPDATING Fri Jan 6 19:29:16 2012(r229723) @@ -10,6 +10,10 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. 20120106: + A new VOP_ADVISE() was added to support posix_fadvise(2). All + filesystem modules must be recompiled. + +20120106: The interface of the VOP_VPTOCNP(9) changed, now the returned vnode shall be referenced, previously it was required to be only held. All in-tree filesystems are converted. Modified: stable/9/lib/libc/sys/Makefile.inc == --- stable/9/lib/libc/sys/Makefile.inc Fri Jan 6 19:27:51 2012 (r229722) +++ stable/9/lib/libc/sys/Makefile.inc Fri Jan 6 19:29:16 2012 (r229723) @@ -96,7 +96,8 @@ MAN+= abort2.2 accept.2 access.2 acct.2 mq_setattr.2 \ msgctl.2 msgget.2 msgrcv.2 msgsnd.2 \ msync.2 munmap.2 nanosleep.2 nfssvc.2 ntp_adjtime.2 open.2 \ - pathconf.2 pdfork.2 pipe.2 poll.2 posix_fallocate.2 posix_openpt.2 profil.2 \ + pathconf.2 pdfork.2 pipe.2 poll.2 posix_fadvise.2 posix_fallocate.2 \ + posix_openpt.2 profil.2 \ pselect.2 ptrace.2 quotactl.2 \ read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \ rtprio.2 Modified: stable/9/lib/libc/sys/Symbol.map == --- stable/9/lib/libc/sys/Symbol.mapFri Jan 6 19:27:51 2012 (r229722) +++ stable/9/lib/libc/sys/Symbol.mapFri Jan 6 19:29:16 2012 (r229723) @@ -378,6 +378,10 @@ FBSD_1.2 { setloginclass; }; +FBSD_1.3 { + posix_fadvise; +}; + FBSDprivate_1.0 { ___acl_aclcheck_fd; __sys___acl_aclcheck_fd; Modified: stable/9/lib/libc/sys/madvise.2 == --- stable/9/lib/libc/sys/madvise.2 Fri Jan 6 19:27:51 2012 (r229722) +++ stable/9/lib/libc/sys/madvise.2 Fri Jan 6 19:29:16 2012 (r229723) @@ -169,7 +169,8 @@ was specified and the process does not h .Xr mincore 2 , .Xr mprotect 2 , .Xr msync 2 , -.Xr munmap 2 +.Xr munmap 2 , +.Xr posix_fadvise 2 .Sh STANDARDS The .Fn posix_madvise Copied: stable/9/lib/libc/sys/posix_fadvise.2 (from r227070, head/lib/libc/sys/posix_fadvise.2) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/sys/posix_fadvise.2 Fri Jan 6 19:29:16 2012 (r229723, copy of r227070, head/lib/libc/sys/posix_fadvise.2) @@ -0,0 +1,139 @@ +.\" Copyright (c) 1991, 1993 +.\"The Rege
svn commit: r229724 - in stable/9/sys: compat/freebsd32 kern sys
Author: jhb Date: Fri Jan 6 19:30:17 2012 New Revision: 229724 URL: http://svn.freebsd.org/changeset/base/229724 Log: Regen. Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h stable/9/sys/compat/freebsd32/freebsd32_syscall.h stable/9/sys/compat/freebsd32/freebsd32_syscalls.c stable/9/sys/compat/freebsd32/freebsd32_sysent.c stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c stable/9/sys/kern/init_sysent.c stable/9/sys/kern/syscalls.c stable/9/sys/kern/systrace_args.c stable/9/sys/sys/syscall.h stable/9/sys/sys/syscall.mk stable/9/sys/sys/sysproto.h Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h == --- stable/9/sys/compat/freebsd32/freebsd32_proto.h Fri Jan 6 19:29:16 2012(r229723) +++ stable/9/sys/compat/freebsd32/freebsd32_proto.h Fri Jan 6 19:30:17 2012(r229724) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 229500 2012-01-04 16:29:45Z jhb + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 229723 2012-01-06 19:29:16Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -575,6 +575,14 @@ struct freebsd32_posix_fallocate_args { char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; }; +struct freebsd32_posix_fadvise_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; +}; #if !defined(PAD64_REQUIRED) && defined(__powerpc__) #define PAD64_REQUIRED #endif @@ -684,6 +692,7 @@ int freebsd32_msgctl(struct thread *, st intfreebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); intfreebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); intfreebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); +intfreebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); #ifdef COMPAT_43 @@ -1058,6 +1067,7 @@ int freebsd7_freebsd32_shmctl(struct thr #defineFREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL #defineFREEBSD32_SYS_AUE_freebsd32_pselect AUE_SELECT #defineFREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL +#defineFREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/9/sys/compat/freebsd32/freebsd32_syscall.h == --- stable/9/sys/compat/freebsd32/freebsd32_syscall.h Fri Jan 6 19:29:16 2012(r229723) +++ stable/9/sys/compat/freebsd32/freebsd32_syscall.h Fri Jan 6 19:30:17 2012(r229724) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 229500 2012-01-04 16:29:45Z jhb + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 229723 2012-01-06 19:29:16Z jhb */ #defineFREEBSD32_SYS_syscall 0 @@ -424,4 +424,5 @@ #defineFREEBSD32_SYS_rctl_add_rule 528 #defineFREEBSD32_SYS_rctl_remove_rule 529 #defineFREEBSD32_SYS_freebsd32_posix_fallocate 530 +#defineFREEBSD32_SYS_freebsd32_posix_fadvise 531 #defineFREEBSD32_SYS_MAXSYSCALL532 Modified: stable/9/sys/compat/freebsd32/freebsd32_syscalls.c == --- stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Fri Jan 6 19:29:16 2012(r229723) +++ stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Fri Jan 6 19:30:17 2012(r229724) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 229500 2012-01-04 16:29:45Z jhb + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 229723 2012-01-06 19:29:16Z jhb */ const char *freebsd32_syscallnames[] = { @@ -554,5 +554,5 @@ const char *freebsd32_syscallnames[] = { "rctl_add_rule",/* 528 = rctl_add_rule */ "rctl_remove_rule", /* 529 = rctl_remove_rule */ "freebsd32_posix_fallocate",/* 530 = freebsd32_posix_fallocate */ - "#531", /* 531 = posix_fadvise */ + "freebsd32_posi
svn commit: r229725 - in stable/8: . lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys sys/vm
Author: jhb Date: Fri Jan 6 19:32:39 2012 New Revision: 229725 URL: http://svn.freebsd.org/changeset/base/229725 Log: MFC 226217,227070,227341,227502: Add the posix_fadvise(2) system call. It is somewhat similar to madvise(2) except that it operates on a file descriptor instead of a memory region. It is currently only supported on regular files. Note that this adds a new VOP, so all filesystem modules must be recompiled. Approved by: re (kib) Added: stable/8/lib/libc/sys/posix_fadvise.2 - copied unchanged from r227070, head/lib/libc/sys/posix_fadvise.2 Modified: stable/8/UPDATING stable/8/lib/libc/sys/Makefile.inc stable/8/lib/libc/sys/Symbol.map stable/8/lib/libc/sys/madvise.2 stable/8/sys/compat/freebsd32/freebsd32_misc.c stable/8/sys/compat/freebsd32/syscalls.master stable/8/sys/kern/syscalls.master stable/8/sys/kern/vfs_default.c stable/8/sys/kern/vfs_subr.c stable/8/sys/kern/vfs_syscalls.c stable/8/sys/kern/vfs_vnops.c stable/8/sys/kern/vnode_if.src stable/8/sys/sys/fcntl.h stable/8/sys/sys/file.h stable/8/sys/sys/param.h stable/8/sys/sys/syscallsubr.h stable/8/sys/sys/unistd.h stable/8/sys/sys/vnode.h stable/8/sys/vm/vm_object.c stable/8/sys/vm/vm_object.h Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/UPDATING == --- stable/8/UPDATING Fri Jan 6 19:30:17 2012(r229724) +++ stable/8/UPDATING Fri Jan 6 19:32:39 2012(r229725) @@ -15,6 +15,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20120106: + A new VOP_ADVISE() was added to support posix_fadvise(2). All + filesystem modules must be recompiled. + +2016: + A new VOP_ALLOCATE() was added to support posix_fallocate(2). All + filesystem modules must be recompiled. + 2001: The broken amd(4) driver has been replaced with esp(4) in the amd64, i386 and pc98 GENERIC kernel configuration files. Modified: stable/8/lib/libc/sys/Makefile.inc == --- stable/8/lib/libc/sys/Makefile.inc Fri Jan 6 19:30:17 2012 (r229724) +++ stable/8/lib/libc/sys/Makefile.inc Fri Jan 6 19:32:39 2012 (r229725) @@ -86,7 +86,8 @@ MAN+= abort2.2 accept.2 access.2 acct.2 mq_setattr.2 \ msgctl.2 msgget.2 msgrcv.2 msgsnd.2 \ msync.2 munmap.2 nanosleep.2 nfssvc.2 ntp_adjtime.2 open.2 \ - pathconf.2 pipe.2 poll.2 posix_fallocate.2 posix_openpt.2 profil.2 \ + pathconf.2 pipe.2 poll.2 posix_fadvise.2 posix_fallocate.2 \ + posix_openpt.2 profil.2 \ pselect.2 ptrace.2 quotactl.2 \ read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \ rtprio.2 Modified: stable/8/lib/libc/sys/Symbol.map == --- stable/8/lib/libc/sys/Symbol.mapFri Jan 6 19:30:17 2012 (r229724) +++ stable/8/lib/libc/sys/Symbol.mapFri Jan 6 19:32:39 2012 (r229725) @@ -364,6 +364,10 @@ FBSD_1.2 { posix_fallocate; }; +FBSD_1.3 { + posix_fadvise; +}; + FBSDprivate_1.0 { ___acl_aclcheck_fd; __sys___acl_aclcheck_fd; Modified: stable/8/lib/libc/sys/madvise.2 == --- stable/8/lib/libc/sys/madvise.2 Fri Jan 6 19:30:17 2012 (r229724) +++ stable/8/lib/libc/sys/madvise.2 Fri Jan 6 19:32:39 2012 (r229725) @@ -169,7 +169,8 @@ was specified and the process does not h .Xr mincore 2 , .Xr mprotect 2 , .Xr msync 2 , -.Xr munmap 2 +.Xr munmap 2 , +.Xr posix_fadvise 2 .Sh STANDARDS The .Fn posix_madvise Copied: stable/8/lib/libc/sys/posix_fadvise.2 (from r227070, head/lib/libc/sys/posix_fadvise.2) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/lib/libc/sys/posix_fadvise.2 Fri Jan 6 19:32:39 2012 (r229725, copy of r227070, head/lib/libc/sys/posix_fadvise.2) @@ -0,0 +1,139 @@ +.\" Copyright (c) 1991, 1993 +.\"The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above cop
svn commit: r229726 - in stable/8/sys: compat/freebsd32 kern sys
Author: jhb Date: Fri Jan 6 19:33:27 2012 New Revision: 229726 URL: http://svn.freebsd.org/changeset/base/229726 Log: Regen. Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h stable/8/sys/compat/freebsd32/freebsd32_syscall.h stable/8/sys/compat/freebsd32/freebsd32_syscalls.c stable/8/sys/compat/freebsd32/freebsd32_sysent.c stable/8/sys/compat/freebsd32/freebsd32_systrace_args.c stable/8/sys/kern/init_sysent.c stable/8/sys/kern/syscalls.c stable/8/sys/kern/systrace_args.c stable/8/sys/sys/syscall.h stable/8/sys/sys/syscall.mk stable/8/sys/sys/sysproto.h Modified: stable/8/sys/compat/freebsd32/freebsd32_proto.h == --- stable/8/sys/compat/freebsd32/freebsd32_proto.h Fri Jan 6 19:32:39 2012(r229725) +++ stable/8/sys/compat/freebsd32/freebsd32_proto.h Fri Jan 6 19:33:27 2012(r229726) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 227573 2011-11-16 18:33:17Z jhb + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 229725 2012-01-06 19:32:39Z jhb */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -575,6 +575,14 @@ struct freebsd32_posix_fallocate_args { char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; }; +struct freebsd32_posix_fadvise_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; +}; #if !defined(PAD64_REQUIRED) && defined(__powerpc__) #define PAD64_REQUIRED #endif @@ -684,6 +692,7 @@ int freebsd32_msgctl(struct thread *, st intfreebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); intfreebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); intfreebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); +intfreebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); #ifdef COMPAT_43 @@ -1015,6 +1024,7 @@ int freebsd7_freebsd32_shmctl(struct thr #defineFREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL #defineFREEBSD32_SYS_AUE_freebsd32_pselect AUE_SELECT #defineFREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL +#defineFREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL #undef PAD_ #undef PADL_ Modified: stable/8/sys/compat/freebsd32/freebsd32_syscall.h == --- stable/8/sys/compat/freebsd32/freebsd32_syscall.h Fri Jan 6 19:32:39 2012(r229725) +++ stable/8/sys/compat/freebsd32/freebsd32_syscall.h Fri Jan 6 19:33:27 2012(r229726) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 227573 2011-11-16 18:33:17Z jhb + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 229725 2012-01-06 19:32:39Z jhb */ #defineFREEBSD32_SYS_syscall 0 @@ -411,4 +411,5 @@ #defineFREEBSD32_SYS_lpathconf 513 #defineFREEBSD32_SYS_freebsd32_pselect 522 #defineFREEBSD32_SYS_freebsd32_posix_fallocate 530 +#defineFREEBSD32_SYS_freebsd32_posix_fadvise 531 #defineFREEBSD32_SYS_MAXSYSCALL532 Modified: stable/8/sys/compat/freebsd32/freebsd32_syscalls.c == --- stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Fri Jan 6 19:32:39 2012(r229725) +++ stable/8/sys/compat/freebsd32/freebsd32_syscalls.c Fri Jan 6 19:33:27 2012(r229726) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 227573 2011-11-16 18:33:17Z jhb + * created from FreeBSD: stable/8/sys/compat/freebsd32/syscalls.master 229725 2012-01-06 19:32:39Z jhb */ const char *freebsd32_syscallnames[] = { @@ -554,5 +554,5 @@ const char *freebsd32_syscallnames[] = { "#528", /* 528 = rctl_add_rule */ "#529", /* 529 = rctl_remove_rule */ "freebsd32_posix_fallocate",/* 530 = freebsd32_posix_fallocate */ - "#531", /* 531 = posix_fadvise */ + "freebsd32_posix_fadvise", /* 531
Re: svn commit: r229714 - head/sys/netinet
On Fri, Jan 06, 2012 at 07:19:57PM +, Navdeep Parhar wrote: N> On Fri, Jan 06, 2012 at 11:05:15PM +0400, Gleb Smirnoff wrote: N> > Navdeep, N> > N> > On Fri, Jan 06, 2012 at 06:29:41PM +, Navdeep Parhar wrote: N> > N> Author: np N> > N> Date: Fri Jan 6 18:29:40 2012 N> > N> New Revision: 229714 N> > N> URL: http://svn.freebsd.org/changeset/base/229714 N> > N> N> > N> Log: N> > N> Always release the inp lock before returning from tcp_detach. N> > ^ after ? N> N> I don't see anything wrong in the message. The lock is released within N> tcp_detach (before it returns), and not after. Ah, sorry. My braino :( -- Totus tuus, Glebius. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r229693 - in head/lib/libc: powerpc powerpc64
Hi Bruce, thank you for the feedback. I wasn't aware about the fine details. I try to understand and implement what you suggest. It may take several iterations until I match everything. On 06.01.12 14:12, Bruce Evans wrote: On Fri, 6 Jan 2012, Andreas Tobler wrote: Log: Use the macro WEAK_ALIAS. Tested on 32 and 64-bit. This API should be fixed before using it extensively. It has the args reversed relative to the C API __weak_reference(). Also, its name is different, and the spelling of "=" in its implementation is different. Perhaps the arg order makes sense for both, since for WEAK_ALIAS() the alias is the first arg, while for __weak_reference() the symbol being referred to to create the alias is the first arg. But this is still confusing. The easiest way to fix this is to remove WEAK_ALIAS() and add an asm API WEAK_REFERENCE(). Unfortunately, ALIAS is a better name than REFERENCE. __weak_reference() is not so easy to change since it is used extensively So, I started with a WEAK_REFERENCE macro in sys/powerpc/asm.h It is like the WEAK_ALIAS but with reversed arguments: +#define WEAK_REFERENCE(sym, alias) \ + .weak alias;\ + alias = sym + Here I do not have a preference for the "=" implementation, is it "=" or is it .set . If we find a final version I'll be able to delete the WEAK_ALIAS. Similarly for STRONG_ALIAS() and __strong_reference(), except STRONG_REFERENCE() doesn't exist for most arches and __strong_reference() didn't exist until this week, so neither is used extensively. More details on current existence and use of these: In the kernel, WEAK_ALIAS is not defined for amd64 or sparc64, and is never used. In libc, WEAK_ALIAS was only used for arm, ia64 and mips. Now it is used for some i386 string functions. In the kernel, STRONG_ALIAS was only defined for mips, and was never used. Now it is also defined for i386, and is never used. In libc, STRONG_ALIAS was not used. It was used for a few days in some i386 string functions. This was a bug. Now WEAK_ALIAS is used instead, and STRONG_ALIAS is not used again. It is another bug that these "optimized" i386 string functions (strchr/index and strrchr/rindex) even exist. amd64 doesn't have them. The MI versions are not very optimal, but neither are the i386 ones. Modified: head/lib/libc/powerpc/SYS.h == --- head/lib/libc/powerpc/SYS.h Fri Jan 6 09:17:34 2012(r229692) +++ head/lib/libc/powerpc/SYS.h Fri Jan 6 09:21:40 2012(r229693) @@ -44,10 +44,8 @@ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .setCNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .setCNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ + WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ + WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ _SYSCALL(x);\ bso 2b The style bugs in this should be fixed someday. This is still messed up to support K&R. With ancient cpp's, you had to write __CONCAT(x,y) instead of __CONCAT(x, y) to avoid getting a space between x and y. This was fixed in Standard C 22 years ago, but all SYS.h files in libc except ia64's one still use the ugly __CONCAT(x,y) in most places. ia64 hard-codes __CONCAT(x, y) as x ## y instead. The missing space after the comma for the WEAK_ALIAS() parameters is even less necessary. For ancient cpp's, it allowed WEAK_ALIAS to format the asm directives without a space. With STDC cpp's, the formatting is controlled by the macro, but it is still hard to produce nice formatting because cpp may change whitespace. If I get the above right, the snippet from above should look like this, right? @@ -51,20 +51,17 @@ ld %r0,16(%r1);\ mtlr%r0;\ blr;\ -ENTRY(__CONCAT(__sys_,x)); \ - .weak CNAME(x); \ - .setCNAME(x),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(_,x)); \ - .setCNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ +ENTRY(__CONCAT(__sys_, x));\ + WEAK_REFERENCE(__CONCAT(__sys_, x), x); \ + WEAK_REFERENCE(__CONCAT(__sys_, x), __CONCAT(_, x));\ _SYSCALL(x);\ bso 2b __weak_
svn commit: r229727 - head/sys/kern
Author: jhb Date: Fri Jan 6 20:05:48 2012 New Revision: 229727 URL: http://svn.freebsd.org/changeset/base/229727 Log: Use proper argument structure types for the extattr post-VOP hooks. The wrong structure happened to work since the only argument used was the vnode which is in the same place in both VOP_SETATTR() and the two extattr VOPs. MFC after:3 days Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cFri Jan 6 19:33:27 2012(r229726) +++ head/sys/kern/vfs_subr.cFri Jan 6 20:05:48 2012(r229727) @@ -4035,7 +4035,7 @@ vop_create_post(void *ap, int rc) void vop_deleteextattr_post(void *ap, int rc) { - struct vop_setattr_args *a = ap; + struct vop_deleteextattr_args *a = ap; if (!rc) VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB); @@ -4125,7 +4125,7 @@ vop_setattr_post(void *ap, int rc) void vop_setextattr_post(void *ap, int rc) { - struct vop_setattr_args *a = ap; + struct vop_setextattr_args *a = ap; if (!rc) VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229728 - head/sys/kern
Author: jhb Date: Fri Jan 6 20:06:45 2012 New Revision: 229728 URL: http://svn.freebsd.org/changeset/base/229728 Log: Add 5 spare VOPs as placeholders to avoid breaking the KBI in the future when new VOPs are MFC'd to a branch. Reviewed by: kib, bz MFC after:3 days Modified: head/sys/kern/vnode_if.src Modified: head/sys/kern/vnode_if.src == --- head/sys/kern/vnode_if.src Fri Jan 6 20:05:48 2012(r229727) +++ head/sys/kern/vnode_if.src Fri Jan 6 20:06:45 2012(r229728) @@ -50,7 +50,7 @@ # X: locked if not nil. # # The paramater named "vpp" is assumed to be always used with double -# indirection (**vpp) and that name is hard-codeed in vnode_if.awk ! +# indirection (**vpp) and that name is hard-coded in vnode_if.awk ! # # Lines starting with %! specify a pre or post-condition function # to call before/after the vop call. @@ -639,3 +639,28 @@ vop_advise { IN off_t end; IN int advice; }; + +# The VOPs below are spares at the end of the table to allow new VOPs to be +# added in stable branches without breaking the KBI. New VOPs in HEAD should +# be added above these spares. When merging a new VOP to a stable branch, +# the new VOP should replace one of the spares. + +vop_spare1 { + IN struct vnode *vp; +}; + +vop_spare2 { + IN struct vnode *vp; +}; + +vop_spare3 { + IN struct vnode *vp; +}; + +vop_spare4 { + IN struct vnode *vp; +}; + +vop_spare5 { + IN struct vnode *vp; +}; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229729 - head/sys/netinet
Author: tuexen Date: Fri Jan 6 20:20:59 2012 New Revision: 229729 URL: http://svn.freebsd.org/changeset/base/229729 Log: Use NULL instead of 0. MFC after: 1 month. Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c == --- head/sys/netinet/sctputil.c Fri Jan 6 20:06:45 2012(r229728) +++ head/sys/netinet/sctputil.c Fri Jan 6 20:20:59 2012(r229729) @@ -1460,7 +1460,7 @@ sctp_timeout_handler(void *t) type = tmr->type; if (inp) { SCTP_INP_INCR_REF(inp); - if ((inp->sctp_socket == 0) && + if ((inp->sctp_socket == NULL) && ((tmr->type != SCTP_TIMER_TYPE_INPKILL) && (tmr->type != SCTP_TIMER_TYPE_INIT) && (tmr->type != SCTP_TIMER_TYPE_SEND) && ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229731 - in stable/9/sys: conf modules/drm/r128 modules/drm/radeon modules/drm/via
Author: dim Date: Fri Jan 6 21:14:54 2012 New Revision: 229731 URL: http://svn.freebsd.org/changeset/base/229731 Log: MFC r228978: For several files in sys/dev/drm, disable -Wunused-value when building with clang. There are several macros in these files that return values, and in some cases nothing is done with them, but it is completely harmless. For some other files, also disable -Wconstant-conversion, since that triggers a false positive with the DMA_BIT_MASK() macro. Modified: stable/9/sys/conf/files stable/9/sys/conf/kern.mk stable/9/sys/modules/drm/r128/Makefile stable/9/sys/modules/drm/radeon/Makefile stable/9/sys/modules/drm/via/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/files == --- stable/9/sys/conf/files Fri Jan 6 20:44:57 2012(r229730) +++ stable/9/sys/conf/files Fri Jan 6 21:14:54 2012(r229731) @@ -985,15 +985,18 @@ dev/drm/mga_irq.c optional mgadrm dev/drm/mga_state.coptional mgadrm \ compile-with "${NORMAL_C} -finline-limit=13500" dev/drm/mga_warp.c optional mgadrm -dev/drm/r128_cce.c optional r128drm +dev/drm/r128_cce.c optional r128drm \ + compile-with "${NORMAL_C} ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION}" dev/drm/r128_drv.c optional r128drm dev/drm/r128_irq.c optional r128drm dev/drm/r128_state.c optional r128drm \ - compile-with "${NORMAL_C} -finline-limit=13500" + compile-with "${NORMAL_C} ${NO_WUNUSED_VALUE} -finline-limit=13500" dev/drm/r300_cmdbuf.c optional radeondrm dev/drm/r600_blit.coptional radeondrm -dev/drm/r600_cp.c optional radeondrm -dev/drm/radeon_cp.coptional radeondrm +dev/drm/r600_cp.c optional radeondrm \ + compile-with "${NORMAL_C} ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION}" +dev/drm/radeon_cp.coptional radeondrm \ + compile-with "${NORMAL_C} ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION}" dev/drm/radeon_cs.coptional radeondrm dev/drm/radeon_drv.c optional radeondrm dev/drm/radeon_irq.c optional radeondrm Modified: stable/9/sys/conf/kern.mk == --- stable/9/sys/conf/kern.mk Fri Jan 6 20:44:57 2012(r229730) +++ stable/9/sys/conf/kern.mk Fri Jan 6 21:14:54 2012(r229731) @@ -20,6 +20,7 @@ NO_WCONSTANT_CONVERSION= -Wno-constant-c NO_WARRAY_BOUNDS= -Wno-array-bounds NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow +NO_WUNUSED_VALUE= -Wno-unused-value # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. Modified: stable/9/sys/modules/drm/r128/Makefile == --- stable/9/sys/modules/drm/r128/Makefile Fri Jan 6 20:44:57 2012 (r229730) +++ stable/9/sys/modules/drm/r128/Makefile Fri Jan 6 21:14:54 2012 (r229731) @@ -6,3 +6,7 @@ SRCS= r128_cce.c r128_drv.c r128_irq.c SRCS +=device_if.h bus_if.h pci_if.h opt_drm.h .include + +CWARNFLAGS.r128_cce.c= ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS.r128_state.c= ${NO_WUNUSED_VALUE} +CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/modules/drm/radeon/Makefile == --- stable/9/sys/modules/drm/radeon/MakefileFri Jan 6 20:44:57 2012 (r229730) +++ stable/9/sys/modules/drm/radeon/MakefileFri Jan 6 21:14:54 2012 (r229731) @@ -7,3 +7,7 @@ SRCS= r300_cmdbuf.c r600_blit.c r600_cp SRCS +=device_if.h bus_if.h pci_if.h opt_drm.h .include + +CWARNFLAGS.r600_cp.c= ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS.radeon_cp.c=${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} Modified: stable/9/sys/modules/drm/via/Makefile == --- stable/9/sys/modules/drm/via/Makefile Fri Jan 6 20:44:57 2012 (r229730) +++ stable/9/sys/modules/drm/via/Makefile Fri Jan 6 21:14:54 2012 (r229731) @@ -20,3 +20,7 @@ opt_drm.h: echo $(DRM_LINUX_OPT) >> opt_drm.h .include + +CWARNFLAGS.via_dma.c= ${NO_WUNUSED_VALUE} +CWARNFLAGS.via_dmablit.c= ${NO_WUNUSED_VALUE} +CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} ___ svn-src-all@freebsd.org maili
svn commit: r229732 - stable/9/sys/dev/drm
Author: dim Date: Fri Jan 6 21:16:51 2012 New Revision: 229732 URL: http://svn.freebsd.org/changeset/base/229732 Log: MFC r228979: In sys/dev/drm/radeon_state.c, use the correct printf length modifiers for ints. Modified: stable/9/sys/dev/drm/radeon_state.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/drm/radeon_state.c == --- stable/9/sys/dev/drm/radeon_state.c Fri Jan 6 21:14:54 2012 (r229731) +++ stable/9/sys/dev/drm/radeon_state.c Fri Jan 6 21:16:51 2012 (r229732) @@ -1745,7 +1745,7 @@ static int radeon_cp_dispatch_texture(st DRM_DEBUG("tex=%dx%d blit=%d\n", tex_width, tex->height, blit_width); do { - DRM_DEBUG("tex: ofs=0x%x p=%d f=%d x=%hd y=%hd w=%hd h=%hd\n", + DRM_DEBUG("tex: ofs=0x%x p=%d f=%d x=%d y=%d w=%d h=%d\n", tex->offset >> 10, tex->pitch, tex->format, image->x, image->y, image->width, image->height); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229733 - in stable/9/sys/dev/ath/ath_hal: ar5210 ar5211
Author: dim Date: Fri Jan 6 21:19:43 2012 New Revision: 229733 URL: http://svn.freebsd.org/changeset/base/229733 Log: MFC r228980: Reapply r228785 now it has been tested by Adrian. Also add comments with the old AR_SCR_SLE_XXX values, with a short explanation why they were changed. Reviewed by: adrian Modified: stable/9/sys/dev/ath/ath_hal/ar5210/ar5210reg.h stable/9/sys/dev/ath/ath_hal/ar5211/ar5211reg.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/ath/ath_hal/ar5210/ar5210reg.h == --- stable/9/sys/dev/ath/ath_hal/ar5210/ar5210reg.h Fri Jan 6 21:16:51 2012(r229732) +++ stable/9/sys/dev/ath/ath_hal/ar5210/ar5210reg.h Fri Jan 6 21:19:43 2012(r229733) @@ -245,9 +245,20 @@ #defineAR_SCR_SLDUR0x /* sleep duration */ #defineAR_SCR_SLE 0x0003 /* sleep enable */ #defineAR_SCR_SLE_S16 -#defineAR_SCR_SLE_WAKE 0x /* force wake */ -#defineAR_SCR_SLE_SLP 0x0001 /* force sleep */ -#defineAR_SCR_SLE_ALLOW0x0002 /* allow to control sleep */ +/* + * The previous values for the following three defines were: + * + * AR_SCR_SLE_WAKE 0x + * AR_SCR_SLE_SLP 0x0001 + * AR_SCR_SLE_ALLOW0x0002 + * + * However, these have been pre-shifted with AR_SCR_SLE_S. The + * OS_REG_READ() macro would attempt to shift them again, effectively + * shifting out any of the set bits completely. + */ +#defineAR_SCR_SLE_WAKE 0 /* force wake */ +#defineAR_SCR_SLE_SLP 1 /* force sleep */ +#defineAR_SCR_SLE_ALLOW2 /* allow to control sleep */ #defineAR_SCR_BITS "\20\20SLE_SLP\21SLE_ALLOW" #defineAR_INTPEND_IP 0x0001 /* interrupt pending */ Modified: stable/9/sys/dev/ath/ath_hal/ar5211/ar5211reg.h == --- stable/9/sys/dev/ath/ath_hal/ar5211/ar5211reg.h Fri Jan 6 21:16:51 2012(r229732) +++ stable/9/sys/dev/ath/ath_hal/ar5211/ar5211reg.h Fri Jan 6 21:19:43 2012(r229733) @@ -618,9 +618,20 @@ #defineAR_SCR_SLDUR_S 0 #defineAR_SCR_SLE 0x0003 /* sleep enable mask */ #defineAR_SCR_SLE_S16 /* sleep enable bits shift */ -#defineAR_SCR_SLE_WAKE 0x /* force wake */ -#defineAR_SCR_SLE_SLP 0x0001 /* force sleep */ -#defineAR_SCR_SLE_NORM 0x0002 /* sleep logic normal operation */ +/* + * The previous values for the following three defines were: + * + * AR_SCR_SLE_WAKE 0x + * AR_SCR_SLE_SLP 0x0001 + * AR_SCR_SLE_NORM 0x0002 + * + * However, these have been pre-shifted with AR_SCR_SLE_S. The + * OS_REG_READ() macro would attempt to shift them again, effectively + * shifting out any of the set bits completely. + */ +#defineAR_SCR_SLE_WAKE 0 /* force wake */ +#defineAR_SCR_SLE_SLP 1 /* force sleep */ +#defineAR_SCR_SLE_NORM 2 /* sleep logic normal operation */ #defineAR_SCR_SLE_UNITS0x0008 /* SCR units/TU */ #defineAR_SCR_BITS "\20\20SLE_SLP\21SLE" ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229734 - in stable/9/sys: conf modules/ipfilter modules/nxge modules/xfs
Author: dim Date: Fri Jan 6 21:23:00 2012 New Revision: 229734 URL: http://svn.freebsd.org/changeset/base/229734 Log: MFC r228994: Disable several instances instances of clang's -Wself-assign warning. All of these are harmless, and are in fact used to shut up warnings from lint. While here, remove -Wno-missing-prototypes from the xfs module Makefile, as I could not reproduce those warnings either with gcc or clang. Modified: stable/9/sys/conf/files stable/9/sys/conf/kern.mk stable/9/sys/modules/ipfilter/Makefile stable/9/sys/modules/nxge/Makefile stable/9/sys/modules/xfs/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/files == --- stable/9/sys/conf/files Fri Jan 6 21:19:43 2012(r229733) +++ stable/9/sys/conf/files Fri Jan 6 21:23:00 2012(r229734) @@ -301,7 +301,7 @@ contrib/dev/acpica/utilities/utstate.c contrib/dev/acpica/utilities/utxface.c optional acpi contrib/dev/acpica/utilities/utxferror.c optional acpi contrib/ipfilter/netinet/fil.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/contrib/ipfilter" + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet \ @@ -313,11 +313,11 @@ contrib/ipfilter/netinet/ip_log.c option contrib/ipfilter/netinet/ip_nat.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_proxy.c optional ipfilter inet \ - compile-with "${NORMAL_C} -I$S/contrib/ipfilter" + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_state.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_lookup.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-error -I$S/contrib/ipfilter" + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -Wno-error -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_pool.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_htable.c optional ipfilter inet \ @@ -1514,17 +1514,25 @@ dev/my/if_my.c optional my dev/ncv/ncr53c500.coptional ncv dev/ncv/ncr53c500_pccard.c optional ncv pccard dev/nge/if_nge.c optional nge -dev/nxge/if_nxge.c optional nxge -dev/nxge/xgehal/xgehal-device.coptional nxge +dev/nxge/if_nxge.c optional nxge \ + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}" +dev/nxge/xgehal/xgehal-device.coptional nxge \ + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}" dev/nxge/xgehal/xgehal-mm.coptional nxge dev/nxge/xgehal/xge-queue.coptional nxge -dev/nxge/xgehal/xgehal-driver.coptional nxge -dev/nxge/xgehal/xgehal-ring.c optional nxge -dev/nxge/xgehal/xgehal-channel.c optional nxge -dev/nxge/xgehal/xgehal-fifo.c optional nxge -dev/nxge/xgehal/xgehal-stats.c optional nxge +dev/nxge/xgehal/xgehal-driver.coptional nxge \ + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}" +dev/nxge/xgehal/xgehal-ring.c optional nxge \ + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}" +dev/nxge/xgehal/xgehal-channel.c optional nxge \ + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}" +dev/nxge/xgehal/xgehal-fifo.c optional nxge \ + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}" +dev/nxge/xgehal/xgehal-stats.c optional nxge \ + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}" dev/nxge/xgehal/xgehal-config.coptional nxge -dev/nxge/xgehal/xgehal-mgmt.c optional nxge +dev/nxge/xgehal/xgehal-mgmt.c optional nxge \ + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN}" dev/nmdm/nmdm.coptional nmdm dev/nsp/nsp.c optional nsp dev/nsp/nsp_pccard.c optional nsp pccard @@ -3469,7 +3477,7 @@ gnu/fs/xfs/FreeBSD/xfs_sysctl.c optional gnu/fs/xfs/FreeBSD/xfs_fs_subr.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_ioctl.c optional xfs \ - compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" + compile-with "${NORMAL_C} ${NO_WSELF_ASSIGN} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/support/debug.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/support/ktrace.coptional xfs \ Modified: stable/9/sys/conf/kern.mk ===
svn commit: r229735 - head/lib/libdevstat
Author: ghelmer Date: Fri Jan 6 21:28:29 2012 New Revision: 229735 URL: http://svn.freebsd.org/changeset/base/229735 Log: Handle memory allocation failures in devstat_getdevs(), devstat_selectdevs(), and devstat_buildmatch(). PR: bin/83359 Reviewed by: ken Modified: head/lib/libdevstat/devstat.c Modified: head/lib/libdevstat/devstat.c == --- head/lib/libdevstat/devstat.c Fri Jan 6 21:23:00 2012 (r229734) +++ head/lib/libdevstat/devstat.c Fri Jan 6 21:28:29 2012 (r229735) @@ -365,6 +365,12 @@ devstat_getdevs(kvm_t *kd, struct statin dssize = (dinfo->numdevs * sizeof(struct devstat)) + sizeof(long); dinfo->mem_ptr = (u_int8_t *)malloc(dssize); + if (dinfo->mem_ptr == NULL) { + snprintf(devstat_errbuf, sizeof(devstat_errbuf), +"%s: Cannot allocate memory for mem_ptr element", +__func__); + return(-1); + } } else dssize = (dinfo->numdevs * sizeof(struct devstat)) + sizeof(long); @@ -567,7 +573,7 @@ devstat_selectdevs(struct device_selecti * either enlarge or reduce the size of the device selection list. */ } else if (*num_selections != numdevs) { - *dev_select = (struct device_selection *)realloc(*dev_select, + *dev_select = (struct device_selection *)reallocf(*dev_select, numdevs * sizeof(struct device_selection)); *select_generation = current_generation; init_selections = 1; @@ -581,6 +587,13 @@ devstat_selectdevs(struct device_selecti init_selections = 1; } + if (*dev_select == NULL) { + snprintf(devstat_errbuf, sizeof(devstat_errbuf), +"%s: Cannot (re)allocate memory for dev_select argument", +__func__); + return(-1); + } + /* * If we're in "only" mode, we want to clear out the selected * variable since we're going to select exactly what the user wants @@ -608,6 +621,12 @@ devstat_selectdevs(struct device_selecti || (perf_select != 0)) && (changed == 0)){ old_dev_select = (struct device_selection *)malloc( *num_selections * sizeof(struct device_selection)); + if (old_dev_select == NULL) { + snprintf(devstat_errbuf, sizeof(devstat_errbuf), +"%s: Cannot allocate memory for selection list backup", +__func__); + return(-1); + } old_num_selections = *num_selections; bcopy(*dev_select, old_dev_select, sizeof(struct device_selection) * *num_selections); @@ -1028,16 +1047,17 @@ devstat_buildmatch(char *match_str, stru return(-1); } - /* -* Since you can't realloc a pointer that hasn't been malloced -* first, we malloc first and then realloc. -*/ if (*num_matches == 0) - *matches = (struct devstat_match *)malloc( - sizeof(struct devstat_match)); - else - *matches = (struct devstat_match *)realloc(*matches, - sizeof(struct devstat_match) * (*num_matches + 1)); + *matches = NULL; + + *matches = (struct devstat_match *)reallocf(*matches, + sizeof(struct devstat_match) * (*num_matches + 1)); + + if (*matches == NULL) { + snprintf(devstat_errbuf, sizeof(devstat_errbuf), +"%s: Cannot allocate memory for matches list", __func__); + return(-1); + } /* Make sure the current entry is clear */ bzero(&matches[0][*num_matches], sizeof(struct devstat_match)); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229736 - stable/9/sys/dev/et
Author: yongari Date: Fri Jan 6 21:43:26 2012 New Revision: 229736 URL: http://svn.freebsd.org/changeset/base/229736 Log: MFC r228333,228335-228336,228362,228368-228369,228381: r228333: Protect SIOCSIFMTU ioctl handler with driver lock. Don't blindly re-initialize controller whenever MTU is changed. Now, reinitializing is done only when driver is running. While here, remove unnecessary assignment of error value since it was already initialized to 0. r228335: Consistently use a tab character instead of using either a space or tab after #define. While I'm here consistently use capital letters when it uses hexadecimal notation. No functional changes. r228336: Disable all clocks and put PHY into COMA before entering into suspend state. This will save more power. On resume, make sure to enable all clocks. While I'm here, if controller is not fast ethernet, enable gigabit PHY. r228362: Do not disable interrupt without knowing whether the raised interrupt is ours. Note, interrupts are automatically ACKed when the status register is read. Add RX/TX DMA error to interrupt handler and do full controller reset if driver happen to encounter these errors. There is no way to recover from these DMA errors without controller reset. Rename local variable name intrs with status to enhance readability. While I'm here, rename ET_INTR_TXEOF and ET_INTR_RXEOF to ET_INTR_TXDMA and ET_INTR_RXDMA respectively. These interrupts indicate that a frame is successfully DMAed to controller's internal FIFO and they have nothing to do with EOF(end of frame). Driver does not need to wait actual end of TX/RX of a frame(e.g. no need to wait the end signal of TX which is generated when a frame in TX FIFO is emptied by MAC). Previous names were somewhat confusing. r228368: Remove unnecessary definition of ET_PCIR_BAR. Controller support I/O memory only. While here, use pci_set_max_read_req(9) rather than directly manipulating PCIe device control register. r228369: Announce flow control ability to PHY driver and enable RX flow control. Controller does not automatically generate pause frames based on number of available RX buffers so it's very hard to know when driver should generate XON frame in time. The only mechanism driver can detect low number of RX buffer condition is ET_INTR_RXRING0_LOW or ET_INTR_RXRING1_LOW interrupt. This interrupt is generated whenever controller notices the number of available RX buffers are lower than pre-programmed value( ET_RX_RING0_MINCNT and ET_RX_RING1_MINCNT register). This scheme does not provide a way to detect when controller sees enough number of RX buffers again such that efficient generation of XON/XOFF frame is not easy. While here, add more flow control related register definition. r228381: FreeBSD driver does not require arpcom structure in softc. Modified: stable/9/sys/dev/et/if_et.c stable/9/sys/dev/et/if_etreg.h stable/9/sys/dev/et/if_etvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/et/if_et.c == --- stable/9/sys/dev/et/if_et.c Fri Jan 6 21:28:29 2012(r229735) +++ stable/9/sys/dev/et/if_et.c Fri Jan 6 21:43:26 2012(r229736) @@ -220,6 +220,7 @@ et_attach(device_t dev) struct et_softc *sc; struct ifnet *ifp; uint8_t eaddr[ETHER_ADDR_LEN]; + uint32_t pmcfg; int cap, error, msic; sc = device_get_softc(dev); @@ -249,9 +250,9 @@ et_attach(device_t dev) /* * Allocate IO memory */ - sc->sc_mem_rid = ET_PCIR_BAR; + sc->sc_mem_rid = PCIR_BAR(0); sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->sc_mem_rid, RF_ACTIVE); + &sc->sc_mem_rid, RF_ACTIVE); if (sc->sc_mem_res == NULL) { device_printf(dev, "can't allocate IO memory\n"); return (ENXIO); @@ -304,8 +305,11 @@ et_attach(device_t dev) et_get_eaddr(dev, eaddr); - CSR_WRITE_4(sc, ET_PM, - ET_PM_SYSCLK
svn commit: r229737 - stable/8/sys/dev/et
Author: yongari Date: Fri Jan 6 21:45:08 2012 New Revision: 229737 URL: http://svn.freebsd.org/changeset/base/229737 Log: MFC r228333,228335-228336,228362,228368-228369,228381: r228333: Protect SIOCSIFMTU ioctl handler with driver lock. Don't blindly re-initialize controller whenever MTU is changed. Now, reinitializing is done only when driver is running. While here, remove unnecessary assignment of error value since it was already initialized to 0. r228335: Consistently use a tab character instead of using either a space or tab after #define. While I'm here consistently use capital letters when it uses hexadecimal notation. No functional changes. r228336: Disable all clocks and put PHY into COMA before entering into suspend state. This will save more power. On resume, make sure to enable all clocks. While I'm here, if controller is not fast ethernet, enable gigabit PHY. r228362: Do not disable interrupt without knowing whether the raised interrupt is ours. Note, interrupts are automatically ACKed when the status register is read. Add RX/TX DMA error to interrupt handler and do full controller reset if driver happen to encounter these errors. There is no way to recover from these DMA errors without controller reset. Rename local variable name intrs with status to enhance readability. While I'm here, rename ET_INTR_TXEOF and ET_INTR_RXEOF to ET_INTR_TXDMA and ET_INTR_RXDMA respectively. These interrupts indicate that a frame is successfully DMAed to controller's internal FIFO and they have nothing to do with EOF(end of frame). Driver does not need to wait actual end of TX/RX of a frame(e.g. no need to wait the end signal of TX which is generated when a frame in TX FIFO is emptied by MAC). Previous names were somewhat confusing. r228368: Remove unnecessary definition of ET_PCIR_BAR. Controller support I/O memory only. While here, use pci_set_max_read_req(9) rather than directly manipulating PCIe device control register. r228369: Announce flow control ability to PHY driver and enable RX flow control. Controller does not automatically generate pause frames based on number of available RX buffers so it's very hard to know when driver should generate XON frame in time. The only mechanism driver can detect low number of RX buffer condition is ET_INTR_RXRING0_LOW or ET_INTR_RXRING1_LOW interrupt. This interrupt is generated whenever controller notices the number of available RX buffers are lower than pre-programmed value( ET_RX_RING0_MINCNT and ET_RX_RING1_MINCNT register). This scheme does not provide a way to detect when controller sees enough number of RX buffers again such that efficient generation of XON/XOFF frame is not easy. While here, add more flow control related register definition. r228381: FreeBSD driver does not require arpcom structure in softc. Modified: stable/8/sys/dev/et/if_et.c stable/8/sys/dev/et/if_etreg.h stable/8/sys/dev/et/if_etvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/et/if_et.c == --- stable/8/sys/dev/et/if_et.c Fri Jan 6 21:43:26 2012(r229736) +++ stable/8/sys/dev/et/if_et.c Fri Jan 6 21:45:08 2012(r229737) @@ -224,6 +224,7 @@ et_attach(device_t dev) struct et_softc *sc; struct ifnet *ifp; uint8_t eaddr[ETHER_ADDR_LEN]; + uint32_t pmcfg; int cap, error, msic; sc = device_get_softc(dev); @@ -253,9 +254,9 @@ et_attach(device_t dev) /* * Allocate IO memory */ - sc->sc_mem_rid = ET_PCIR_BAR; + sc->sc_mem_rid = PCIR_BAR(0); sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->sc_mem_rid, RF_ACTIVE); + &sc->sc_mem_rid, RF_ACTIVE); if (sc->sc_mem_res == NULL) { device_printf(dev, "can't allocate IO memory\n"); return (ENXIO); @@ -308,8 +309,11 @@ et_attach(device_t dev) et_get_eaddr(dev, eaddr); - CSR_WRITE_4(sc, ET_PM, - ET_PM_SYSCLK_GATE | ET_PM_TXCLK_GATE | ET_PM_RXCLK_GATE); + /* Take PHY out of COMA and enable clocks. */ + pmcfg = ET_PM_SYSCLK_GATE | ET_PM_TXCLK_GATE | ET_PM_RXCLK_GATE; + if ((sc->sc_flags & ET_FLAG_FASTETHER) == 0) + pmcfg |= EM_PM_GIGEPHY_ENB; + CSR_WRITE_4(sc, ET_PM, pmcfg); et_reset(sc); @@ -332,7 +336,8 @@ et_attach(device_t dev) et_chip_attach(sc); error = mii_atta
svn commit: r229738 - stable/7/sys/dev/et
Author: yongari Date: Fri Jan 6 21:46:35 2012 New Revision: 229738 URL: http://svn.freebsd.org/changeset/base/229738 Log: MFC r228333,228335-228336,228362,228368-228369,228381: r228333: Protect SIOCSIFMTU ioctl handler with driver lock. Don't blindly re-initialize controller whenever MTU is changed. Now, reinitializing is done only when driver is running. While here, remove unnecessary assignment of error value since it was already initialized to 0. r228335: Consistently use a tab character instead of using either a space or tab after #define. While I'm here consistently use capital letters when it uses hexadecimal notation. No functional changes. r228336: Disable all clocks and put PHY into COMA before entering into suspend state. This will save more power. On resume, make sure to enable all clocks. While I'm here, if controller is not fast ethernet, enable gigabit PHY. r228362: Do not disable interrupt without knowing whether the raised interrupt is ours. Note, interrupts are automatically ACKed when the status register is read. Add RX/TX DMA error to interrupt handler and do full controller reset if driver happen to encounter these errors. There is no way to recover from these DMA errors without controller reset. Rename local variable name intrs with status to enhance readability. While I'm here, rename ET_INTR_TXEOF and ET_INTR_RXEOF to ET_INTR_TXDMA and ET_INTR_RXDMA respectively. These interrupts indicate that a frame is successfully DMAed to controller's internal FIFO and they have nothing to do with EOF(end of frame). Driver does not need to wait actual end of TX/RX of a frame(e.g. no need to wait the end signal of TX which is generated when a frame in TX FIFO is emptied by MAC). Previous names were somewhat confusing. r228368: Remove unnecessary definition of ET_PCIR_BAR. Controller support I/O memory only. While here, use pci_set_max_read_req(9) rather than directly manipulating PCIe device control register. r228369: Announce flow control ability to PHY driver and enable RX flow control. Controller does not automatically generate pause frames based on number of available RX buffers so it's very hard to know when driver should generate XON frame in time. The only mechanism driver can detect low number of RX buffer condition is ET_INTR_RXRING0_LOW or ET_INTR_RXRING1_LOW interrupt. This interrupt is generated whenever controller notices the number of available RX buffers are lower than pre-programmed value( ET_RX_RING0_MINCNT and ET_RX_RING1_MINCNT register). This scheme does not provide a way to detect when controller sees enough number of RX buffers again such that efficient generation of XON/XOFF frame is not easy. While here, add more flow control related register definition. r228381: FreeBSD driver does not require arpcom structure in softc. Modified: stable/7/sys/dev/et/if_et.c stable/7/sys/dev/et/if_etreg.h stable/7/sys/dev/et/if_etvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/et/if_et.c == --- stable/7/sys/dev/et/if_et.c Fri Jan 6 21:45:08 2012(r229737) +++ stable/7/sys/dev/et/if_et.c Fri Jan 6 21:46:35 2012(r229738) @@ -224,6 +224,7 @@ et_attach(device_t dev) struct et_softc *sc; struct ifnet *ifp; uint8_t eaddr[ETHER_ADDR_LEN]; + uint32_t pmcfg; int cap, error, msic; sc = device_get_softc(dev); @@ -253,9 +254,9 @@ et_attach(device_t dev) /* * Allocate IO memory */ - sc->sc_mem_rid = ET_PCIR_BAR; + sc->sc_mem_rid = PCIR_BAR(0); sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->sc_mem_rid, RF_ACTIVE); + &sc->sc_mem_rid, RF_ACTIVE); if (sc->sc_mem_res == NULL) { device_printf(dev, "can't allocate IO memory\n"); return (ENXIO); @@ -308,8 +309,11 @@ et_attach(device_t dev) et_get_eaddr(dev, eaddr); - CSR_WRITE_4(sc, ET_PM, - ET_PM_SYSCLK_GATE | ET_PM_TXCLK_GATE | ET_PM_RXCLK_GATE); + /* Take PHY out of COMA and enable clocks. */ + pmcfg = ET_PM_SYSCLK_GATE | ET_PM_TXCLK_GATE | ET_PM_RXCLK_GATE; + if ((sc->sc_flags & ET_FLAG_FASTETHER) == 0) + pmcfg |= EM_PM_GIGEPHY_ENB; + CSR_WRITE_4(sc, ET_PM, pmcfg); et_reset(sc); @@ -332,7 +336,8 @@ et_attach(device_t dev) et_chip_attach(sc); error = mii_attach(dev, &sc->sc_miibus, ifp, et_ifmedia_upd, -
svn commit: r229739 - stable/9/sys/compat/ndis
Author: dim Date: Fri Jan 6 22:15:58 2012 New Revision: 229739 URL: http://svn.freebsd.org/changeset/base/229739 Log: MFC r229004: In sys/compat/ndis/subr_ntoskrnl.c, change the RtlFillMemory function definition from K&R to ANSI, to avoid a clang warning about the uint8_t parameter being promoted to int, which is not compatible with the type declared in the earlier prototype. Modified: stable/9/sys/compat/ndis/subr_ntoskrnl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/ndis/subr_ntoskrnl.c == --- stable/9/sys/compat/ndis/subr_ntoskrnl.cFri Jan 6 21:46:35 2012 (r229738) +++ stable/9/sys/compat/ndis/subr_ntoskrnl.cFri Jan 6 22:15:58 2012 (r229739) @@ -3016,10 +3016,7 @@ RtlSecureZeroMemory(dst, len) } static void -RtlFillMemory(dst, len, c) - void*dst; - size_t len; - uint8_t c; +RtlFillMemory(void *dst, size_t len, uint8_t c) { memset(dst, c, len); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229740 - in stable/9/sys/dev/ath/ath_hal: ar5212 ar5416
Author: dim Date: Fri Jan 6 22:18:13 2012 New Revision: 229740 URL: http://svn.freebsd.org/changeset/base/229740 Log: MFC r228817: Use the correct types when calling the decompression mask function. There's currently no public code which uses this feature and the current reference driver doesn't enable this feature at all. It's possible it was used by a previous version of the driver and that indeed it should return HAL_STATUS; but at this point I'm happy to require that they complain and submit a patch. This was found by LLVM compile-time type checking. Modified: stable/9/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c == --- stable/9/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Jan 6 22:15:58 2012(r229739) +++ stable/9/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c Fri Jan 6 22:18:13 2012(r229740) @@ -573,7 +573,7 @@ ar5212SetDecompMask(struct ath_hal *ah, struct ath_hal_5212 *ahp = AH5212(ah); if (keyidx >= HAL_DECOMP_MASK_SIZE) -return HAL_EINVAL; +return AH_FALSE; OS_REG_WRITE(ah, AR_DCM_A, keyidx); OS_REG_WRITE(ah, AR_DCM_D, en ? AR_DCM_D_EN : 0); ahp->ah_decompMask[keyidx] = en; Modified: stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c == --- stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Jan 6 22:15:58 2012(r229739) +++ stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Jan 6 22:18:13 2012(r229740) @@ -155,7 +155,7 @@ ar5416SetAntennaSwitch(struct ath_hal *a HAL_BOOL ar5416SetDecompMask(struct ath_hal *ah, uint16_t keyidx, int en) { - return HAL_OK; + return AH_TRUE; } /* Setup coverage class */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229741 - stable/8/sys/dev/usb/controller
Author: hselasky Date: Fri Jan 6 22:54:03 2012 New Revision: 229741 URL: http://svn.freebsd.org/changeset/base/229741 Log: Fix build of ehci_mbus.c by applying patches similar to ones in r228483. This file was missed by a recent MFC because the file is named differently in 10-current. Pointy hat: hselasky @ Reported by: jhb Modified: stable/8/sys/dev/usb/controller/ehci_mbus.c Modified: stable/8/sys/dev/usb/controller/ehci_mbus.c == --- stable/8/sys/dev/usb/controller/ehci_mbus.c Fri Jan 6 22:18:13 2012 (r229740) +++ stable/8/sys/dev/usb/controller/ehci_mbus.c Fri Jan 6 22:54:03 2012 (r229741) @@ -78,9 +78,6 @@ __FBSDID("$FreeBSD$"); static device_attach_t ehci_mbus_attach; static device_detach_t ehci_mbus_detach; -static device_shutdown_t ehci_mbus_shutdown; -static device_suspend_t ehci_mbus_suspend; -static device_resume_t ehci_mbus_resume; static int err_intr(void *arg); @@ -99,45 +96,6 @@ static void *ih_err; #defineMV_USB_DEVICE_UNDERFLOW (1 << 3) static int -ehci_mbus_suspend(device_t self) -{ - ehci_softc_t *sc = device_get_softc(self); - int err; - - err = bus_generic_suspend(self); - if (err) - return (err); - ehci_suspend(sc); - return (0); -} - -static int -ehci_mbus_resume(device_t self) -{ - ehci_softc_t *sc = device_get_softc(self); - - ehci_resume(sc); - - bus_generic_resume(self); - - return (0); -} - -static int -ehci_mbus_shutdown(device_t self) -{ - ehci_softc_t *sc = device_get_softc(self); - int err; - - err = bus_generic_shutdown(self); - if (err) - return (err); - ehci_shutdown(sc); - - return (0); -} - -static int ehci_mbus_probe(device_t self) { @@ -361,20 +319,17 @@ static device_method_t ehci_methods[] = DEVMETHOD(device_probe, ehci_mbus_probe), DEVMETHOD(device_attach, ehci_mbus_attach), DEVMETHOD(device_detach, ehci_mbus_detach), - DEVMETHOD(device_suspend, ehci_mbus_suspend), - DEVMETHOD(device_resume, ehci_mbus_resume), - DEVMETHOD(device_shutdown, ehci_mbus_shutdown), - - /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), - {0, 0} + DEVMETHOD_END }; static driver_t ehci_driver = { - "ehci", - ehci_methods, - sizeof(ehci_softc_t), + .name = "ehci", + .methods = ehci_methods, + .size = sizeof(ehci_softc_t), }; static devclass_t ehci_devclass; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229742 - head/tools/regression/bin/sh/builtins
Author: jilles Date: Fri Jan 6 23:20:33 2012 New Revision: 229742 URL: http://svn.freebsd.org/changeset/base/229742 Log: sh: Avoid possible echo options in a testcase. Modified: head/tools/regression/bin/sh/builtins/getopts1.0 Modified: head/tools/regression/bin/sh/builtins/getopts1.0 == --- head/tools/regression/bin/sh/builtins/getopts1.0Fri Jan 6 22:54:03 2012(r229741) +++ head/tools/regression/bin/sh/builtins/getopts1.0Fri Jan 6 23:20:33 2012(r229742) @@ -1,6 +1,6 @@ # $FreeBSD$ -echo '-1-' +printf -- '-1-\n' set -- -abc getopts "ab:" OPTION echo ${OPTION} @@ -11,7 +11,7 @@ echo ${OPTION} # ksh93 20090505; pdksh 5.2.14p2; mksh R39c; bash 4.1 PL7; and zsh 4.3.10. # all recognize that "b" is missing its argument on the *first* iteration # of 'getopts' and do not produce the "a" in $OPTION. -echo '-2-' +printf -- '-2-\n' set -- -ab getopts "ab:" OPTION echo ${OPTION} @@ -19,7 +19,7 @@ getopts "ab:" OPTION echo ${OPTION} # The 'shift' is aimed at causing an error. -echo '-3-' +printf -- '-3-\n' shift 1 getopts "ab:" OPTION echo ${OPTION} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229744 - head/sbin/hastd
Author: pjd Date: Fri Jan 6 23:44:26 2012 New Revision: 229744 URL: http://svn.freebsd.org/changeset/base/229744 Log: fork(2) returns -1 on failure, not some random negative number. MFC after:3 days Modified: head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/primary.c == --- head/sbin/hastd/primary.c Fri Jan 6 23:33:33 2012(r229743) +++ head/sbin/hastd/primary.c Fri Jan 6 23:44:26 2012(r229744) @@ -886,7 +886,7 @@ hastd_primary(struct hast_resource *res) } pid = fork(); - if (pid < 0) { + if (pid == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_TEMPFAIL, "Unable to fork"); Modified: head/sbin/hastd/secondary.c == --- head/sbin/hastd/secondary.c Fri Jan 6 23:33:33 2012(r229743) +++ head/sbin/hastd/secondary.c Fri Jan 6 23:44:26 2012(r229744) @@ -401,7 +401,7 @@ hastd_secondary(struct hast_resource *re } pid = fork(); - if (pid < 0) { + if (pid == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to fork"); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229745 - stable/9/share/man/man4
Author: yongari Date: Fri Jan 6 23:57:21 2012 New Revision: 229745 URL: http://svn.freebsd.org/changeset/base/229745 Log: MFC r228370: After r228293, et(4) supports altq(4). Modified: stable/9/share/man/man4/altq.4 stable/9/share/man/man4/et.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/altq.4 == --- stable/9/share/man/man4/altq.4 Fri Jan 6 23:44:26 2012 (r229744) +++ stable/9/share/man/man4/altq.4 Fri Jan 6 23:57:21 2012 (r229745) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2011 +.Dd December 9, 2011 .Dt ALTQ 4 .Os .Sh NAME @@ -134,6 +134,7 @@ They have been applied to the following .Xr em 4 , .Xr ep 4 , .Xr epair 4 , +.Xr et 4 , .Xr fxp 4 , .Xr gem 4 , .Xr hme 4 , Modified: stable/9/share/man/man4/et.4 == --- stable/9/share/man/man4/et.4Fri Jan 6 23:44:26 2012 (r229744) +++ stable/9/share/man/man4/et.4Fri Jan 6 23:57:21 2012 (r229745) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 25, 2010 +.Dd December 9, 2011 .Dt ET 4 .Os .Sh NAME @@ -156,6 +156,7 @@ to achieve TX interrupt moderation. The default value is 10 (nanoseconds). .El .Sh SEE ALSO +.Xr altq 4 , .Xr arp 4 , .Xr miibus 4 , .Xr netintro 4 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229746 - stable/8/share/man/man4
Author: yongari Date: Fri Jan 6 23:59:25 2012 New Revision: 229746 URL: http://svn.freebsd.org/changeset/base/229746 Log: MFC r215835,228370: r215835: Add a HARDWARE section. r228370: After r228293, et(4) supports altq(4). Modified: stable/8/share/man/man4/altq.4 stable/8/share/man/man4/et.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/altq.4 == --- stable/8/share/man/man4/altq.4 Fri Jan 6 23:57:21 2012 (r229745) +++ stable/8/share/man/man4/altq.4 Fri Jan 6 23:59:25 2012 (r229746) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2011 +.Dd December 9, 2011 .Dt ALTQ 4 .Os .Sh NAME @@ -134,6 +134,7 @@ They have been applied to the following .Xr em 4 , .Xr ep 4 , .Xr epair 4 , +.Xr et 4 , .Xr fxp 4 , .Xr gem 4 , .Xr hme 4 , Modified: stable/8/share/man/man4/et.4 == --- stable/8/share/man/man4/et.4Fri Jan 6 23:57:21 2012 (r229745) +++ stable/8/share/man/man4/et.4Fri Jan 6 23:59:25 2012 (r229746) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2008 +.Dd December 9, 2011 .Dt ET 4 .Os .Sh NAME @@ -122,6 +122,11 @@ Note that the 1000baseT media type is on if it is supported by the adapter. For more information on configuring this device, see .Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports Agere ET1310 10/100/Gigabit +Ethernet adapters. .Sh TUNABLES .Bl -tag -width ".Va hw.et.rx_intr_npkts" .It Va hw.et.rx_intr_npkts @@ -151,6 +156,7 @@ to achieve TX interrupt moderation. The default value is 10 (nanoseconds). .El .Sh SEE ALSO +.Xr altq 4 , .Xr arp 4 , .Xr miibus 4 , .Xr netintro 4 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229747 - stable/7/share/man/man4
Author: yongari Date: Sat Jan 7 00:05:20 2012 New Revision: 229747 URL: http://svn.freebsd.org/changeset/base/229747 Log: MFC r180509,181362,215835,228370: Belatedly add man page for et(4) and catch up with all changes. r180509: Manpage for the et(4) driver. r181362: Comment out information about Jumbo Frame support, it's not implemented yet. While here, fix a whitespace nit. r215835: Add a HARDWARE section. r228370: After r228293, et(4) supports altq(4). Added: stable/7/share/man/man4/et.4 - copied, changed from r180509, head/share/man/man4/et.4 Modified: stable/7/share/man/man4/Makefile stable/7/share/man/man4/altq.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/Makefile == --- stable/7/share/man/man4/MakefileFri Jan 6 23:59:25 2012 (r229746) +++ stable/7/share/man/man4/MakefileSat Jan 7 00:05:20 2012 (r229747) @@ -85,6 +85,7 @@ MAN= aac.4 \ en.4 \ enc.4 \ esp.4 \ + et.4 \ exca.4 \ faith.4 \ fatm.4 \ @@ -469,6 +470,7 @@ MLINKS+=edsc.4 if_edsc.4 MLINKS+=ef.4 if_ef.4 MLINKS+=em.4 if_em.4 MLINKS+=en.4 if_en.4 +MLINKS+=et.4 if_et.4 MLINKS+=faith.4 if_faith.4 MLINKS+=fatm.4 if_fatm.4 MLINKS+=fd.4 stderr.4 \ Modified: stable/7/share/man/man4/altq.4 == --- stable/7/share/man/man4/altq.4 Fri Jan 6 23:59:25 2012 (r229746) +++ stable/7/share/man/man4/altq.4 Sat Jan 7 00:05:20 2012 (r229747) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2011 +.Dd December 9, 2011 .Dt ALTQ 4 .Os .Sh NAME @@ -133,6 +133,7 @@ They have been applied to the following .Xr ed 4 , .Xr em 4 , .Xr ep 4 , +.Xr et 4 , .Xr fxp 4 , .Xr gem 4 , .Xr hme 4 , Copied and modified: stable/7/share/man/man4/et.4 (from r180509, head/share/man/man4/et.4) == --- head/share/man/man4/et.4Mon Jul 14 18:15:43 2008(r180509, copy source) +++ stable/7/share/man/man4/et.4Sat Jan 7 00:05:20 2012 (r229747) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2008 +.Dd December 9, 2011 .Dt ET 4 .Os .Sh NAME @@ -54,14 +54,14 @@ if_et_load="YES" .Sh DESCRIPTION The .Nm -driver supports PCI Express Ethernet adapters based on the Agere ET1310 chip. -.Pp -Support for Jumbo Frames is provided via the interface MTU setting. -Selecting an MTU larger than 1500 bytes with the -.Xr ifconfig 8 -utility configures the adapter to receive and transmit Jumbo Frames. -The maximum MTU setting for Jumbo Frames is 15572. -This value coincides with the maximum Jumbo Frames size of 15594. +driver supports PCI Express Ethernet adapters based on the Agere ET1310 chip. +.\".Pp +.\"Support for Jumbo Frames is provided via the interface MTU setting. +.\"Selecting an MTU larger than 1500 bytes with the +.\".Xr ifconfig 8 +.\"utility configures the adapter to receive and transmit Jumbo Frames. +.\"The maximum MTU setting for Jumbo Frames is 15572. +.\"This value coincides with the maximum Jumbo Frames size of 15594. .Pp The .Nm @@ -122,6 +122,11 @@ Note that the 1000baseT media type is on if it is supported by the adapter. For more information on configuring this device, see .Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports Agere ET1310 10/100/Gigabit +Ethernet adapters. .Sh TUNABLES .Bl -tag -width ".Va hw.et.rx_intr_npkts" .It Va hw.et.rx_intr_npkts @@ -151,6 +156,7 @@ to achieve TX interrupt moderation. The default value is 10 (nanoseconds). .El .Sh SEE ALSO +.Xr altq 4 , .Xr arp 4 , .Xr miibus 4 , .Xr netintro 4 , ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229748 - stable/9/usr.sbin/pkg_install/add
Author: kensmith Date: Sat Jan 7 00:07:23 2012 New Revision: 229748 URL: http://svn.freebsd.org/changeset/base/229748 Log: MFC the rest of r225757 that applies to the package set directories. Modified: stable/9/usr.sbin/pkg_install/add/main.c Modified: stable/9/usr.sbin/pkg_install/add/main.c == --- stable/9/usr.sbin/pkg_install/add/main.cSat Jan 7 00:05:20 2012 (r229747) +++ stable/9/usr.sbin/pkg_install/add/main.cSat Jan 7 00:07:23 2012 (r229748) @@ -95,7 +95,8 @@ struct { { 600100, 699000, "/packages-6-stable" }, { 700100, 799000, "/packages-7-stable" }, { 800500, 899000, "/packages-8-stable" }, - { 90, 999000, "/packages-9-current" }, + { 900500, 999000, "/packages-9-stable" }, + { 1000500, 1099000, "/packages-10-current" }, { 0, 999, "/packages-current" }, { 0, 0, NULL } }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229749 - head/sys/netinet
Author: eadler (ports committer) Date: Sat Jan 7 00:11:36 2012 New Revision: 229749 URL: http://svn.freebsd.org/changeset/base/229749 Log: - Fix sysctl description PR: 163623 Submitted by: Eugene Grosbein Approved by: bz Modified: head/sys/netinet/ip_icmp.c Modified: head/sys/netinet/ip_icmp.c == --- head/sys/netinet/ip_icmp.c Sat Jan 7 00:07:23 2012(r229748) +++ head/sys/netinet/ip_icmp.c Sat Jan 7 00:11:36 2012(r229749) @@ -89,7 +89,7 @@ static VNET_DEFINE(int, icmplim_output) #defineV_icmplim_outputVNET(icmplim_output) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW, &VNET_NAME(icmplim_output), 0, - "Enable rate limiting of ICMP responses"); + "Enable logging of ICMP response rate limiting"); #ifdef INET VNET_DEFINE(struct icmpstat, icmpstat); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r229667 - head/usr.sbin/daemon
On 01/06/2012 08:18, Guy Helmer wrote: > On Jan 5, 2012, at 8:58 PM, Doug Barton wrote: > >> On 01/05/2012 14:48, Guy Helmer wrote: >>> Allow daemon(8) to run pidfile_open() before relenquishing >>> privileges so pid files can be written in /var/run when started >>> as root. >> >> I'm not sure how useful this is since when daemon is exiting it >> won't be able to remove the pid file (unless I'm missing >> something). >> >> Isn't it better to pre-create the pid file with the proper >> permissions for the unprivileged user? >> > > Would it be OK for daemon to hang around and wait for the child > process to exit, then remove the pid file? Without having given it any kind of careful thought, that sounds Ok ... but I don't understand how daemon could remove a pid file written as root after it's already dropped privileges. (IOW that's the same problem I was bringing up.) > The only other alternative I see would be to create a subdirectory > that is writable by the user so the child can create and delete the > pid file. That's functionally equivalent to pre-creating the pid file with the right permissions, so it would be Ok. Various ports use each of these approaches. I'm generally in favor of using the pid file only solution since rc.d/cleanvar will clean all that stuff up at boot, and it's preferable to not leave stale directories around for stuff that is no longer running and/or installed. Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229751 - stable/9/usr.sbin/pkg_install/add
Author: kensmith Date: Sat Jan 7 00:33:13 2012 New Revision: 229751 URL: http://svn.freebsd.org/changeset/base/229751 Log: When copying/pasting a line to create a line you want to add make sure to change all pieces of it, not just some of them. Submitted by: A helpful soul on IRC Pointy hat: me Modified: stable/9/usr.sbin/pkg_install/add/main.c Modified: stable/9/usr.sbin/pkg_install/add/main.c == --- stable/9/usr.sbin/pkg_install/add/main.cSat Jan 7 00:15:02 2012 (r229750) +++ stable/9/usr.sbin/pkg_install/add/main.cSat Jan 7 00:33:13 2012 (r229751) @@ -96,7 +96,7 @@ struct { { 700100, 799000, "/packages-7-stable" }, { 800500, 899000, "/packages-8-stable" }, { 900500, 999000, "/packages-9-stable" }, - { 1000500, 1099000, "/packages-10-current" }, + { 100, 1099000, "/packages-10-current" }, { 0, 999, "/packages-current" }, { 0, 0, NULL } }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229752 - in stable/9/sys/fs: nfs nfsclient
Author: rmacklem Date: Sat Jan 7 00:36:17 2012 New Revision: 229752 URL: http://svn.freebsd.org/changeset/base/229752 Log: MFC: r228217 Post r223774, the NFSv4 client no longer has multiple instances of the same lock_owner4 string. As such, the handling of cleanup of lock_owners could be simplified. This simplification permitted the client to do a ReleaseLockOwner operation when the process that the lock_owner4 string represents, has exited. This permits the server to release any storage related to the lock_owner4 string before the associated open is closed. Without this change, it is possible to exhaust a server's storage when a long running process opens a file and then many child processes do locking on the file, because the open doesn't get closed. A similar patch was applied to the Linux NFSv4 client recently so that it wouldn't exhaust a server's storage. Modified: stable/9/sys/fs/nfs/nfsclstate.h stable/9/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfs/nfsclstate.h == --- stable/9/sys/fs/nfs/nfsclstate.hSat Jan 7 00:33:13 2012 (r229751) +++ stable/9/sys/fs/nfs/nfsclstate.hSat Jan 7 00:36:17 2012 (r229752) @@ -34,6 +34,7 @@ */ LIST_HEAD(nfsclopenhead, nfsclopen); LIST_HEAD(nfscllockownerhead, nfscllockowner); +SLIST_HEAD(nfscllockownerfhhead, nfscllockownerfh); LIST_HEAD(nfscllockhead, nfscllock); LIST_HEAD(nfsclhead, nfsclclient); LIST_HEAD(nfsclownerhead, nfsclowner); @@ -149,8 +150,8 @@ struct nfscllockowner { struct nfsclopen*nfsl_open; NFSPROC_T *nfsl_inprog; nfsv4stateid_t nfsl_stateid; + int nfsl_lockflags; u_int32_t nfsl_seqid; - u_int32_t nfsl_defunct; struct nfsv4locknfsl_rwlock; u_int8_tnfsl_owner[NFSV4CL_LOCKNAMELEN]; u_int8_tnfsl_openowner[NFSV4CL_LOCKNAMELEN]; @@ -166,6 +167,14 @@ struct nfscllock { short nfslo_type; }; +/* This structure is used to collect a list of lockowners to free up. */ +struct nfscllockownerfh { + SLIST_ENTRY(nfscllockownerfh) nfslfh_list; + struct nfscllockownerhead nfslfh_lock; + int nfslfh_len; + uint8_t nfslfh_fh[NFSX_V4FHMAX]; +}; + /* * Macro for incrementing the seqid#. */ Modified: stable/9/sys/fs/nfsclient/nfs_clstate.c == --- stable/9/sys/fs/nfsclient/nfs_clstate.c Sat Jan 7 00:33:13 2012 (r229751) +++ stable/9/sys/fs/nfsclient/nfs_clstate.c Sat Jan 7 00:36:17 2012 (r229752) @@ -143,6 +143,8 @@ static void nfscl_freeopenowner(struct n static void nfscl_cleandeleg(struct nfscldeleg *); static int nfscl_trydelegreturn(struct nfscldeleg *, struct ucred *, struct nfsmount *, NFSPROC_T *); +static void nfscl_emptylockowner(struct nfscllockowner *, +struct nfscllockownerfhhead *); static short nfscberr_null[] = { 0, @@ -1030,7 +1032,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t NFSBCOPY(op->nfso_own->nfsow_owner, nlp->nfsl_openowner, NFSV4CL_LOCKNAMELEN); nlp->nfsl_seqid = 0; - nlp->nfsl_defunct = 0; + nlp->nfsl_lockflags = flags; nlp->nfsl_inprog = NULL; nfscl_lockinit(&nlp->nfsl_rwlock); LIST_INIT(&nlp->nfsl_lock); @@ -1638,7 +1640,6 @@ static void nfscl_cleanup_common(struct nfsclclient *clp, u_int8_t *own) { struct nfsclowner *owp, *nowp; - struct nfsclopen *op; struct nfscllockowner *lp, *nlp; struct nfscldeleg *dp; @@ -1667,15 +1668,6 @@ nfscl_cleanup_common(struct nfsclclient nfscl_freeopenowner(owp, 0); else owp->nfsow_defunct = 1; - } else { - /* look for lockowners on other opens */ - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { - LIST_FOR
svn commit: r229753 - head/sys/contrib/rdma
Author: dim Date: Sat Jan 7 00:47:27 2012 New Revision: 229753 URL: http://svn.freebsd.org/changeset/base/229753 Log: In sys/contrib/rdma/ib_addr.h, bump MAX_ADDR_LEN to 20 bytes (the same value used in sys/ofed/include/linux/netdevice.h), so there will be no buffer overruns in the rest of the inline functions in this file. Reviewed by: kmacy MFC after:1 week Modified: head/sys/contrib/rdma/ib_addr.h Modified: head/sys/contrib/rdma/ib_addr.h == --- head/sys/contrib/rdma/ib_addr.h Sat Jan 7 00:36:17 2012 (r229752) +++ head/sys/contrib/rdma/ib_addr.h Sat Jan 7 00:47:27 2012 (r229753) @@ -42,7 +42,7 @@ #include -#define MAX_ADDR_LEN ETHER_ADDR_LEN/* XXX doesn't support IB! */ +#define MAX_ADDR_LEN 20 struct rdma_addr_client { int refcount; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229754 - in stable/8/sys/dev: bce mxge
Author: yongari Date: Sat Jan 7 01:08:17 2012 New Revision: 229754 URL: http://svn.freebsd.org/changeset/base/229754 Log: MFC r207761: Belatedly merge r207761. For unknown reason r207761 was not fully merged (r208073) to stable/8 but mergeinfo was recorded. Add a fastpath to allocate from packet zone when using m_getjcl. This will add support for packet zone for at least igb and ixgbe and will avoid to check for that in bce and mxge. Modified: stable/8/sys/dev/bce/if_bce.c stable/8/sys/dev/mxge/if_mxge.c Modified: stable/8/sys/dev/bce/if_bce.c == --- stable/8/sys/dev/bce/if_bce.c Sat Jan 7 00:47:27 2012 (r229753) +++ stable/8/sys/dev/bce/if_bce.c Sat Jan 7 01:08:17 2012 (r229754) @@ -5017,11 +5017,8 @@ bce_get_rx_buf(struct bce_softc *sc, str #ifdef BCE_JUMBO_HDRSPLIT MGETHDR(m_new, M_DONTWAIT, MT_DATA); #else - if (sc->rx_bd_mbuf_alloc_size <= MCLBYTES) - m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - else - m_new = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, - sc->rx_bd_mbuf_alloc_size); + m_new = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + sc->rx_bd_mbuf_alloc_size); #endif if (m_new == NULL) { Modified: stable/8/sys/dev/mxge/if_mxge.c == --- stable/8/sys/dev/mxge/if_mxge.c Sat Jan 7 00:47:27 2012 (r229753) +++ stable/8/sys/dev/mxge/if_mxge.c Sat Jan 7 01:08:17 2012 (r229754) @@ -2411,10 +2411,7 @@ mxge_get_buf_big(struct mxge_slice_state mxge_rx_ring_t *rx = &ss->rx_big; int cnt, err, i; - if (rx->cl_size == MCLBYTES) - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - else - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, rx->cl_size); + m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, rx->cl_size); if (m == NULL) { rx->alloc_fail++; err = ENOBUFS; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229755 - in stable/7/sys: dev/bce dev/mxge sys
Author: yongari Date: Sat Jan 7 01:12:21 2012 New Revision: 229755 URL: http://svn.freebsd.org/changeset/base/229755 Log: MFC r207761: Add a fastpath to allocate from packet zone when using m_getjcl. This will add support for packet zone for at least igb and ixgbe and will avoid to check for that in bce and mxge. Modified: stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/mxge/if_mxge.c stable/7/sys/sys/mbuf.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bce/if_bce.c == --- stable/7/sys/dev/bce/if_bce.c Sat Jan 7 01:08:17 2012 (r229754) +++ stable/7/sys/dev/bce/if_bce.c Sat Jan 7 01:12:21 2012 (r229755) @@ -5017,11 +5017,8 @@ bce_get_rx_buf(struct bce_softc *sc, str #ifdef BCE_JUMBO_HDRSPLIT MGETHDR(m_new, M_DONTWAIT, MT_DATA); #else - if (sc->rx_bd_mbuf_alloc_size <= MCLBYTES) - m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - else - m_new = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, - sc->rx_bd_mbuf_alloc_size); + m_new = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + sc->rx_bd_mbuf_alloc_size); #endif if (m_new == NULL) { Modified: stable/7/sys/dev/mxge/if_mxge.c == --- stable/7/sys/dev/mxge/if_mxge.c Sat Jan 7 01:08:17 2012 (r229754) +++ stable/7/sys/dev/mxge/if_mxge.c Sat Jan 7 01:12:21 2012 (r229755) @@ -2260,10 +2260,7 @@ mxge_get_buf_big(struct mxge_slice_state mxge_rx_ring_t *rx = &ss->rx_big; int cnt, err, i; - if (rx->cl_size == MCLBYTES) - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - else - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, rx->cl_size); + m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, rx->cl_size); if (m == NULL) { rx->alloc_fail++; err = ENOBUFS; Modified: stable/7/sys/sys/mbuf.h == --- stable/7/sys/sys/mbuf.h Sat Jan 7 01:08:17 2012(r229754) +++ stable/7/sys/sys/mbuf.h Sat Jan 7 01:12:21 2012(r229755) @@ -484,6 +484,9 @@ m_getjcl(int how, short type, int flags, struct mbuf *m, *n; uma_zone_t zone; + if (size == MCLBYTES) + return m_getcl(how, type, flags); + args.flags = flags; args.type = type; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229756 - stable/7/usr.bin/du
Author: gjb (doc committer) Date: Sat Jan 7 01:39:38 2012 New Revision: 229756 URL: http://svn.freebsd.org/changeset/base/229756 Log: MFC r209362, r210933, r228356: r209362 (brian) [1]: - Add a -t switch for masking output that's above or below certain thresholds. This switch makes it a lot easier to locate problem areas when a process is threatening to consume all of your disk space. r210933 (joel): - Fix typos and spelling mistakes. r228356 [2]: - Update du(1): - Sort arguments alphabetically where appropriate - '-B blocksize' is not mutually exclusive of '-h|-k|-m' - Mention '-t' in synopsis - Other wording improvements - Update usage() output to reflect the new synopsis - Other miscellaneous improvements Approved by: brian [1] PR: 162438 [2] Modified: stable/7/usr.bin/du/du.1 stable/7/usr.bin/du/du.c Directory Properties: stable/7/usr.bin/du/ (props changed) Modified: stable/7/usr.bin/du/du.1 == --- stable/7/usr.bin/du/du.1Sat Jan 7 01:12:21 2012(r229755) +++ stable/7/usr.bin/du/du.1Sat Jan 7 01:39:38 2012(r229756) @@ -32,7 +32,7 @@ .\"@(#)du.18.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd November 6, 2008 +.Dd December 8, 2011 .Dt DU 1 .Os .Sh NAME @@ -40,15 +40,13 @@ .Nd display disk usage statistics .Sh SYNOPSIS .Nm -.Op Fl A +.Op Fl Aclnx .Op Fl H | L | P +.Op Fl h | k | m .Op Fl a | s | d Ar depth -.Op Fl c -.Op Fl l -.Op Fl h | k | m | B Ar blocksize -.Op Fl n -.Op Fl x +.Op Fl B Ar blocksize .Op Fl I Ar mask +.Op Fl t Ar threshold .Op Ar .Sh DESCRIPTION The @@ -69,10 +67,12 @@ Calculate block counts in .Ar blocksize byte blocks. This is different from the -.Fl k, m +.Fl h, k +and +.Fl m options or setting .Ev BLOCKSIZE -and gives an estimate of how much space the examined file hierachy would +and gives an estimate of how much space the examined file hierarchy would require on a filesystem with the given .Ar blocksize . Unless in @@ -83,40 +83,31 @@ is rounded up to the next multiple of 51 .It Fl H Symbolic links on the command line are followed, symbolic links in file hierarchies are not followed. -.It Fl L -Symbolic links on the command line and in file hierarchies are followed. .It Fl I Ar mask Ignore files and directories matching the specified .Ar mask . +.It Fl L +Symbolic links on the command line and in file hierarchies are followed. .It Fl P No symbolic links are followed. This is the default. .It Fl a Display an entry for each file in a file hierarchy. -.It Fl h -"Human-readable" output. -Use unit suffixes: Byte, Kilobyte, Megabyte, -Gigabyte, Terabyte and Petabyte. -.It Fl r -Generate messages about directories that cannot be read, files -that cannot be opened, and so on. -This is the default case. -This option exists solely for conformance with -.St -xpg4 . -.It Fl s -Display an entry for each specified file. -(Equivalent to -.Fl d Li 0 ) +.It Fl c +Display a grand total. .It Fl d Ar depth Display an entry for all files and directories .Ar depth directories deep. -.It Fl c -Display a grand total. +.It Fl h +.Dq Human-readable +output. +Use unit suffixes: Byte, Kilobyte, Megabyte, +Gigabyte, Terabyte and Petabyte. .It Fl k Display block counts in 1024-byte (1-Kbyte) blocks. .It Fl l -If a file has multiple hard links, count its size many times. +If a file has multiple hard links, count its size multiple times. The default behavior of .Nm is to count files with multiple hard links only once. @@ -132,6 +123,24 @@ Ignore files and directories with user flag .Pq Dv UF_NODUMP set. +.It Fl r +Generate messages about directories that cannot be read, files +that cannot be opened, and so on. +This is the default case. +This option exists solely for conformance with +.St -xpg4 . +.It Fl s +Display an entry for each specified file. +(Equivalent to +.Fl d Li 0 ) +.It Fl t Ar threshold +Display only entries for which size exceeds +.Ar threshold . +If +.Ar threshold +is negative, display only entries for which size is less than the absolute +value of +.Ar threshold . .It Fl x File system mount points are not traversed. .El @@ -148,25 +157,32 @@ If either the .Fl H or .Fl L -options are specified, storage used by any symbolic links which are -followed is not counted or displayed. +option is specified, storage used by any symbolic links which are +followed is not counted (or displayed). +.Pp +The +.Fl h, k +and +.Fl m +options all override each other; the last one specified determines +the block counts used. .Sh ENVIRONMENT .Bl -tag -width BLOCKSIZE .It Ev BLOCKSIZE If the environment variable .Ev BLOCKSIZE is set, and the -.Fl k, m +.Fl h, k or -.Fl h +.Fl m options are not specified, the block counts will be displayed in units of that block size. If .Ev BLOCKSIZE is not set, and the -.Fl k, m +.Fl h, k or -.Fl h +.Fl m options are
svn commit: r229757 - stable/9/share/man/man5
Author: gjb (doc committer) Date: Sat Jan 7 02:03:07 2012 New Revision: 229757 URL: http://svn.freebsd.org/changeset/base/229757 Log: MFC r228355: - As of r226865, daily_scrub_zfs_default_threshold is 35 days. PR: 162890 Modified: stable/9/share/man/man5/periodic.conf.5 Directory Properties: stable/9/share/man/man5/ (props changed) Modified: stable/9/share/man/man5/periodic.conf.5 == --- stable/9/share/man/man5/periodic.conf.5 Sat Jan 7 01:39:38 2012 (r229756) +++ stable/9/share/man/man5/periodic.conf.5 Sat Jan 7 02:03:07 2012 (r229757) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 15, 2010 +.Dd December 8, 2011 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -631,7 +631,7 @@ If the list is empty or not set, all zfs .It Va daily_scrub_zfs_default_threshold .Pq Vt int Number of days between a scrub if no pool-specific threshold is set. -The default value if no value is set is 30. +If not set, the default value is 35, corresponding to 5 weeks. .It Va daily_scrub_zfs_ Ns Ao Ar poolname Ac Ns Va _threshold .Pq Vt int The same as ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229758 - stable/8/share/man/man5
Author: gjb (doc committer) Date: Sat Jan 7 02:03:42 2012 New Revision: 229758 URL: http://svn.freebsd.org/changeset/base/229758 Log: MFC r228355: - As of r226865, daily_scrub_zfs_default_threshold is 35 days. PR: 162890 Modified: stable/8/share/man/man5/periodic.conf.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/periodic.conf.5 == --- stable/8/share/man/man5/periodic.conf.5 Sat Jan 7 02:03:07 2012 (r229757) +++ stable/8/share/man/man5/periodic.conf.5 Sat Jan 7 02:03:42 2012 (r229758) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 15, 2010 +.Dd December 8, 2011 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -631,7 +631,7 @@ If the list is empty or not set, all zfs .It Va daily_scrub_zfs_default_threshold .Pq Vt int Number of days between a scrub if no pool-specific threshold is set. -The default value if no value is set is 30. +If not set, the default value is 35, corresponding to 5 weeks. .It Va daily_scrub_zfs_ Ns Ao Ar poolname Ac Ns Va _threshold .Pq Vt int The same as ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229759 - in stable/8/sys/fs: nfs nfsclient
Author: rmacklem Date: Sat Jan 7 02:09:49 2012 New Revision: 229759 URL: http://svn.freebsd.org/changeset/base/229759 Log: MFC: r228217 Post r223774, the NFSv4 client no longer has multiple instances of the same lock_owner4 string. As such, the handling of cleanup of lock_owners could be simplified. This simplification permitted the client to do a ReleaseLockOwner operation when the process that the lock_owner4 string represents, has exited. This permits the server to release any storage related to the lock_owner4 string before the associated open is closed. Without this change, it is possible to exhaust a server's storage when a long running process opens a file and then many child processes do locking on the file, because the open doesn't get closed. A similar patch was applied to the Linux NFSv4 client recently so that it wouldn't exhaust a server's storage. Modified: stable/8/sys/fs/nfs/nfsclstate.h stable/8/sys/fs/nfsclient/nfs_clstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfsclstate.h == --- stable/8/sys/fs/nfs/nfsclstate.hSat Jan 7 02:03:42 2012 (r229758) +++ stable/8/sys/fs/nfs/nfsclstate.hSat Jan 7 02:09:49 2012 (r229759) @@ -34,6 +34,7 @@ */ LIST_HEAD(nfsclopenhead, nfsclopen); LIST_HEAD(nfscllockownerhead, nfscllockowner); +SLIST_HEAD(nfscllockownerfhhead, nfscllockownerfh); LIST_HEAD(nfscllockhead, nfscllock); LIST_HEAD(nfsclhead, nfsclclient); LIST_HEAD(nfsclownerhead, nfsclowner); @@ -149,8 +150,8 @@ struct nfscllockowner { struct nfsclopen*nfsl_open; NFSPROC_T *nfsl_inprog; nfsv4stateid_t nfsl_stateid; + int nfsl_lockflags; u_int32_t nfsl_seqid; - u_int32_t nfsl_defunct; struct nfsv4locknfsl_rwlock; u_int8_tnfsl_owner[NFSV4CL_LOCKNAMELEN]; u_int8_tnfsl_openowner[NFSV4CL_LOCKNAMELEN]; @@ -166,6 +167,14 @@ struct nfscllock { short nfslo_type; }; +/* This structure is used to collect a list of lockowners to free up. */ +struct nfscllockownerfh { + SLIST_ENTRY(nfscllockownerfh) nfslfh_list; + struct nfscllockownerhead nfslfh_lock; + int nfslfh_len; + uint8_t nfslfh_fh[NFSX_V4FHMAX]; +}; + /* * Macro for incrementing the seqid#. */ Modified: stable/8/sys/fs/nfsclient/nfs_clstate.c == --- stable/8/sys/fs/nfsclient/nfs_clstate.c Sat Jan 7 02:03:42 2012 (r229758) +++ stable/8/sys/fs/nfsclient/nfs_clstate.c Sat Jan 7 02:09:49 2012 (r229759) @@ -143,6 +143,8 @@ static void nfscl_freeopenowner(struct n static void nfscl_cleandeleg(struct nfscldeleg *); static int nfscl_trydelegreturn(struct nfscldeleg *, struct ucred *, struct nfsmount *, NFSPROC_T *); +static void nfscl_emptylockowner(struct nfscllockowner *, +struct nfscllockownerfhhead *); static short nfscberr_null[] = { 0, @@ -1030,7 +1032,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t NFSBCOPY(op->nfso_own->nfsow_owner, nlp->nfsl_openowner, NFSV4CL_LOCKNAMELEN); nlp->nfsl_seqid = 0; - nlp->nfsl_defunct = 0; + nlp->nfsl_lockflags = flags; nlp->nfsl_inprog = NULL; nfscl_lockinit(&nlp->nfsl_rwlock); LIST_INIT(&nlp->nfsl_lock); @@ -1638,7 +1640,6 @@ static void nfscl_cleanup_common(struct nfsclclient *clp, u_int8_t *own) { struct nfsclowner *owp, *nowp; - struct nfsclopen *op; struct nfscllockowner *lp, *nlp; struct nfscldeleg *dp; @@ -1667,15 +1668,6 @@ nfscl_cleanup_common(struct nfsclclient nfscl_freeopenowner(owp, 0); else owp->nfsow_defunct = 1; - } else { - /* look for lockowners on other opens */ - LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { - LIST_FOREACH(lp, &op->nfso_lock, nfsl_list) { - if (!NFSBCMP(lp->nfsl_owner, own, - NFSV4CL_LOCKNAMELEN)) - lp->nfsl_defunct = 1; - } - } } owp = nowp; } @@ -1685,13 +1677,21 @@ nfscl_cleanup_common(struct nfsclclient *
svn commit: r229760 - in stable/8/sys: boot/zfs cddl/boot/zfs
Author: mm Date: Sat Jan 7 02:23:58 2012 New Revision: 229760 URL: http://svn.freebsd.org/changeset/base/229760 Log: MFC r226549,r226550,r226551,r226552,r226553,r226568 MFC r226549 (pjd): Remove redundant size calculation. MFC r226550 (pjd): Initialize 'rc' properly before using it. This error could lead to infinite loop when data reconstruction was needed. MFC r226551 (pjd): Don't mark vdev as healthy too soon, so we won't try to use invalid vdevs. MFC r226552 (pjd): Never pass NULL block pointer when reading. This is neither expected nor handled by lower layers like vdev_raidz, which uses bp for checksum verification. This bug could lead to NULL pointer reference and resets during boot. MFC r226553 (pjd): Always pass data size for checksum verification function, as using physical block size declared in bp may not always be what we want. For example in case of gang block header physical block size declared in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum calculation failed. This bug could lead to accessing unallocated memory and resets/failures during boot. MFC r226568 (pjd) [1]: - Correctly read gang header from raidz. - Decompress assembled gang block data if compressed. - Verify checksum of a gang header. - Verify checksum of assembled gang block data. - Verify checksum of uber block. Submitted by: avg [1] Modified: stable/8/sys/boot/zfs/zfsimpl.c stable/8/sys/cddl/boot/zfs/zfssubr.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/boot/zfs/zfsimpl.c == --- stable/8/sys/boot/zfs/zfsimpl.c Sat Jan 7 02:09:49 2012 (r229759) +++ stable/8/sys/boot/zfs/zfsimpl.c Sat Jan 7 02:23:58 2012 (r229760) @@ -347,7 +347,7 @@ vdev_read_phys(vdev_t *vdev, const blkpt rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); if (rc) return (rc); - if (bp && zio_checksum_error(bp, buf, offset)) + if (bp && zio_checksum_verify(bp, buf)) return (EIO); return (0); @@ -543,8 +543,6 @@ vdev_init_from_nvlist(const unsigned cha vdev->v_state = VDEV_STATE_DEGRADED; else if (isnt_present) vdev->v_state = VDEV_STATE_CANT_OPEN; - else - vdev->v_state = VDEV_STATE_HEALTHY; } rc = nvlist_find(nvlist, ZPOOL_CONFIG_CHILDREN, @@ -800,6 +798,7 @@ vdev_probe(vdev_phys_read_t *read, void BP_SET_PSIZE(&bp, sizeof(vdev_phys_t)); BP_SET_CHECKSUM(&bp, ZIO_CHECKSUM_LABEL); BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); + DVA_SET_OFFSET(BP_IDENTITY(&bp), off); ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); if (vdev_read_phys(&vtmp, &bp, vdev_label, off, 0)) return (EIO); @@ -912,6 +911,7 @@ vdev_probe(vdev_phys_read_t *read, void if (vdev) { vdev->v_phys_read = read; vdev->v_read_priv = read_priv; + vdev->v_state = VDEV_STATE_HEALTHY; } else { printf("ZFS: inconsistent nvlist contents\n"); return (EIO); @@ -941,7 +941,7 @@ vdev_probe(vdev_phys_read_t *read, void BP_SET_COMPRESS(&bp, ZIO_COMPRESS_OFF); ZIO_SET_CHECKSUM(&bp.blk_cksum, off, 0, 0, 0); - if (vdev_read_phys(vdev, NULL, upbuf, off, VDEV_UBERBLOCK_SIZE(vdev))) + if (vdev_read_phys(vdev, &bp, upbuf, off, 0)) continue; if (up->ub_magic != UBERBLOCK_MAGIC) @@ -974,34 +974,39 @@ ilog2(int n) } static int -zio_read_gang(spa_t *spa, const blkptr_t *bp, const dva_t *dva, void *buf) +zio_read_gang(spa_t *spa, const blkptr_t *bp, void *buf) { + blkptr_t gbh_bp; zio_gbh_phys_t zio_gb; - vdev_t *vdev; - int vdevid; - off_t offset; + char *pbuf; int i; - vdevid = DVA_GET_VDEV(dva); - offset = DVA_GET_OFFSET(dva); - STAILQ_FOREACH(vdev, &spa->spa_vdevs, v_childlink) - if (vdev->v_id == vdevid) - break; - if (!vdev || !vdev->v_read) - return (EIO); - if (vdev->v_read(vdev, NULL, &zio_gb, offset, SPA_GANGBLOCKSIZE)) + /* Artificial BP for gang block header. */ + gbh_bp = *bp; + BP_SET_PSIZE(&gbh_bp, SPA_GANGBLOCKSIZE); + BP_SET_LSIZE(&gbh_bp, SPA_GANGBLOCKSIZE); + BP_SET_CHECKSUM(&gbh_bp, ZIO_CHECKSUM_GANG_HEADER); + BP_SET_COMPRESS(&gbh_bp, ZIO_COMPRESS_OFF); + for (i = 0; i < SPA_DVAS_PER_BP; i++) + DVA_SET_GANG(&gbh_bp.blk_dva[i], 0); + + /* Read gang header block using the artificial BP. */ + if (zio_read(spa, &gbh_bp, &zio_gb)) return (EIO); + pbuf = buf; for (i = 0; i < SPA_GBH_NBLKPTRS; i
svn commit: r229761 - stable/8/tools/tools/zfsboottest
Author: mm Date: Sat Jan 7 02:35:00 2012 New Revision: 229761 URL: http://svn.freebsd.org/changeset/base/229761 Log: MFC zfsboottest: r225608 (partial), r225609, r226611, r226612 MFC r225608 (avg, tools/ part): zfstest: rename to zfsboottest and move to tools MFC r225609 (avg): zfsboottest: some additional enhancements - redirect diagnostics printfs in the boot code to stderr - do not read trailing garbage from a trailing block of a file Also add my copyright to the file after making so many changes. MFC r226611 (pjd): - Allow to specify multiple files to check, eg. zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel /boot/zfsloader - Instead of printing file's content calculate MD5 hash of the file, so it can be easly compared to the hash calculated via file system. - Some other minor improvements. MFC r226612 (pjd): Because ZFS boot code was very fragile in the past and real PITA to debug, introduce zfsboottest.sh script that will verify if it will be possible to boot from the given pool. # zfsboottest.sh system Where "system" is pool name of the pool we want to boot from. What is being verified by the script: - Does the pool exist? - Does it have bootfs property configured? - Is mountpoint property of the boot dataset set to 'legacy'? Dataset configured in bootfs property has to be mounted to perform more checks: - Does the /boot directory in boot dataset exist? - Is this dataset configured as root file system in /etc/fstab or set in vfs.root.mountfrom variable in /boot/loader.conf? By using zfsboottest tool the script will read all the files in /boot directory using ZFS boot code and calculate their checksums. Then, it will walk /boot directory using find(1) though regular file sytem and also read all the files in /boot directory and calculate their checksums. If any of the files cannot be looked up, read or checksum is invalid it will be reported and booting off of this pool is probably not possible. Some additional checks may be interesting as well. For example if the disks contain proper pmbr and gptzfsboot code or if all expected files in /boot/ are present. When upgrading FreeBSD, one should snapshot datasets that contain operating system, upgrade (install new world and kernel) and use zfsboottest.sh to verify if it will be possible to boot from new configuration. If all is good one should upgrade boot blocks, by eg.: # gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1 If something is wrong, one should rollback datasets and report the problems. Added: stable/8/tools/tools/zfsboottest/ - copied from r225608, head/tools/tools/zfsboottest/ stable/8/tools/tools/zfsboottest/zfsboottest.sh - copied unchanged from r226612, head/tools/tools/zfsboottest/zfsboottest.sh Modified: stable/8/tools/tools/zfsboottest/Makefile stable/8/tools/tools/zfsboottest/zfsboottest.c Directory Properties: stable/8/tools/ (props changed) stable/8/tools/tools/ (props changed) Modified: stable/8/tools/tools/zfsboottest/Makefile == --- head/tools/tools/zfsboottest/Makefile Fri Sep 16 08:22:48 2011 (r225608) +++ stable/8/tools/tools/zfsboottest/Makefile Sat Jan 7 02:35:00 2012 (r229761) @@ -2,7 +2,12 @@ .PATH: ${.CURDIR}/../../../sys/boot/zfs ${.CURDIR}/../../../sys/cddl/boot/zfs +BINDIR?= /usr/bin +SCRIPTSDIR?= /usr/bin + PROG= zfsboottest +SCRIPTS= zfsboottest.sh +SCRIPTSNAME= zfsboottest.sh NO_MAN= CFLAGS=-O1 \ @@ -12,8 +17,9 @@ CFLAGS= -O1 \ -fdiagnostics-show-option \ -W -Wextra -Wno-sign-compare -Wno-unused-parameter \ -Werror +LDFLAGS+=-lmd -.if ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_ARCH} == "amd64" beforedepend zfsboottest.o: machine CLEANFILES+= machine machine: Modified: stable/8/tools/tools/zfsboottest/zfsboottest.c == --- head/tools/tools/zfsboottest/zfsboottest.c Fri Sep 16 08:22:48 2011 (r225608) +++ stable/8/tools/tools/zfsboottest/zfsboottest.c Sat Jan 7 02:35:00 2012(r229761) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2010 Doug Rabson + * Copyright (c) 2011 Andriy Gapon + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,14 +26,13 @@ * SUCH DAMAGE. */ /* $FreeBSD$ */ -/* - * Compile with 'cc -I. -I../../cddl/boot/zfs zfstest.c -o zfstest' - */ #include #include +#include #include #include +#include #include #include #include @@ -45,15 +46,19 @@ void pager_output(const char *line) { + fprintf(stderr, "%s", line); } +#define ZFS_TEST +#defineprintf(...) fprintf(stderr, __VA_ARGS__)
svn commit: r229762 - stable/7/sbin/md5
Author: eadler (ports committer) Date: Sat Jan 7 03:31:40 2012 New Revision: 229762 URL: http://svn.freebsd.org/changeset/base/229762 Log: MFC r227491: - new sentence should start on new line. Approved by: gjb Modified: stable/7/sbin/md5/md5.1 Directory Properties: stable/7/sbin/md5/ (props changed) Modified: stable/7/sbin/md5/md5.1 == --- stable/7/sbin/md5/md5.1 Sat Jan 7 02:35:00 2012(r229761) +++ stable/7/sbin/md5/md5.1 Sat Jan 7 03:31:40 2012(r229762) @@ -69,8 +69,8 @@ The hexadecimal checksum of each file li after the options are processed. .Bl -tag -width indent .It Fl c Ar string -Compare files to this md5 string. (Note that this option is not yet useful -if multiple files are specified.) +Compare files to this md5 string. +(Note that this option is not yet useful if multiple files are specified.) .It Fl s Ar string Print a checksum of the given .Ar string . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229763 - stable/8/sbin/md5
Author: eadler (ports committer) Date: Sat Jan 7 03:32:24 2012 New Revision: 229763 URL: http://svn.freebsd.org/changeset/base/229763 Log: MFC r227491: - new sentence should start on new line. Approved by: gjb Modified: stable/8/sbin/md5/md5.1 Directory Properties: stable/8/sbin/md5/ (props changed) Modified: stable/8/sbin/md5/md5.1 == --- stable/8/sbin/md5/md5.1 Sat Jan 7 03:31:40 2012(r229762) +++ stable/8/sbin/md5/md5.1 Sat Jan 7 03:32:24 2012(r229763) @@ -78,8 +78,8 @@ The hexadecimal checksum of each file li after the options are processed. .Bl -tag -width indent .It Fl c Ar string -Compare files to this md5 string. (Note that this option is not yet useful -if multiple files are specified.) +Compare files to this md5 string. +(Note that this option is not yet useful if multiple files are specified.) .It Fl s Ar string Print a checksum of the given .Ar string . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229764 - stable/9/sbin/md5
Author: eadler (ports committer) Date: Sat Jan 7 03:32:47 2012 New Revision: 229764 URL: http://svn.freebsd.org/changeset/base/229764 Log: MFC r227491: - new sentence should start on new line. Approved by: gjb Modified: stable/9/sbin/md5/md5.1 Directory Properties: stable/9/sbin/md5/ (props changed) Modified: stable/9/sbin/md5/md5.1 == --- stable/9/sbin/md5/md5.1 Sat Jan 7 03:32:24 2012(r229763) +++ stable/9/sbin/md5/md5.1 Sat Jan 7 03:32:47 2012(r229764) @@ -78,8 +78,8 @@ The hexadecimal checksum of each file li after the options are processed. .Bl -tag -width indent .It Fl c Ar string -Compare files to this md5 string. (Note that this option is not yet useful -if multiple files are specified.) +Compare files to this md5 string. +(Note that this option is not yet useful if multiple files are specified.) .It Fl s Ar string Print a checksum of the given .Ar string . ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r229765 - head/sys/mips/atheros
Author: adrian Date: Sat Jan 7 04:13:25 2012 New Revision: 229765 URL: http://svn.freebsd.org/changeset/base/229765 Log: Fix the ar724x shift calculation when writing to the PCI config space. This was preventing the ath driver from being loaded at runtime. It worked fine when compiled statically into the kernel but not when kldload'ed after the system booted. The root cause was that PCIR_INTLINE (register 60) was being overwritten by zeros when register 62 was being written to. A subsequent read of this register would return 0, and thus the rest of the PCI glue assumed an IRQ resource had already been allocated. This caused the device to fail to attach at runtime as the device itself didn't contain any IRQ resources. TODO: go back over the ar71xx and ar724x PCI config read/write code and ensure it's correct. Modified: head/sys/mips/atheros/ar724x_pci.c Modified: head/sys/mips/atheros/ar724x_pci.c == --- head/sys/mips/atheros/ar724x_pci.c Sat Jan 7 03:32:47 2012 (r229764) +++ head/sys/mips/atheros/ar724x_pci.c Sat Jan 7 04:13:25 2012 (r229765) @@ -93,7 +93,7 @@ ar724x_pci_write(uint32_t reg, uint32_t uint32_t val, mask, shift; /* Register access is 32-bit aligned */ - shift = 8 * (offset & (bytes % 4)); + shift = (offset & 3) * 8; if (bytes % 4) mask = (1 << (bytes * 8)) - 1; else ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"