From owner-svn-src-stable-7@FreeBSD.ORG Sun Apr 12 17:43:41 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96FB6106564A; Sun, 12 Apr 2009 17:43:41 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 846F88FC0C; Sun, 12 Apr 2009 17:43:41 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CHhfqZ032783; Sun, 12 Apr 2009 17:43:41 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CHhfUV032779; Sun, 12 Apr 2009 17:43:41 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200904121743.n3CHhfUV032779@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 12 Apr 2009 17:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190970 - in stable/7/sys: kern nfsclient sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 17:43:42 -0000 Author: kan Date: Sun Apr 12 17:43:41 2009 New Revision: 190970 URL: http://svn.freebsd.org/changeset/base/190970 Log: Reimplement r189287 for -stable: Change vfs_busy to wait until an outcome of pending unmount operation is known and to retry or fail accordingly to that outcome. This fixes the problem with namespace traversing programs failing with random ENOENT errors if someone just happened to try to unmount that same filesystem at the same time. Prodded by: dhw, obrien Approved by: re(kib) Sponsored by: Juniper Networks, Inc. Modified: stable/7/sys/kern/vfs_mount.c stable/7/sys/kern/vfs_subr.c stable/7/sys/nfsclient/nfs_vfsops.c stable/7/sys/sys/mount.h Modified: stable/7/sys/kern/vfs_mount.c ============================================================================== --- stable/7/sys/kern/vfs_mount.c Sun Apr 12 16:53:56 2009 (r190969) +++ stable/7/sys/kern/vfs_mount.c Sun Apr 12 17:43:41 2009 (r190970) @@ -508,6 +508,11 @@ vfs_mount_destroy(struct mount *mp) int i; MNT_ILOCK(mp); + mp->mnt_kern_flag |= MNTK_REFEXPIRE; + if (mp->mnt_kern_flag & MNTK_MWAIT) { + mp->mnt_kern_flag &= ~MNTK_MWAIT; + wakeup(mp); + } for (i = 0; mp->mnt_ref && i < 3; i++) msleep(mp, MNT_MTX(mp), PVFS, "mntref", hz); /* Modified: stable/7/sys/kern/vfs_subr.c ============================================================================== --- stable/7/sys/kern/vfs_subr.c Sun Apr 12 16:53:56 2009 (r190969) +++ stable/7/sys/kern/vfs_subr.c Sun Apr 12 17:43:41 2009 (r190970) @@ -337,8 +337,8 @@ vfs_busy(struct mount *mp, int flags, st MNT_ILOCK(mp); MNT_REF(mp); - if (mp->mnt_kern_flag & MNTK_UNMOUNT) { - if (flags & LK_NOWAIT) { + while (mp->mnt_kern_flag & MNTK_UNMOUNT) { + if (flags & LK_NOWAIT || mp->mnt_kern_flag & MNTK_REFEXPIRE) { MNT_REL(mp); MNT_IUNLOCK(mp); return (ENOENT); @@ -353,11 +353,8 @@ vfs_busy(struct mount *mp, int flags, st * exclusive lock at the end of dounmount. */ msleep(mp, MNT_MTX(mp), PVFS, "vfs_busy", 0); - MNT_REL(mp); - MNT_IUNLOCK(mp); if (interlkp) mtx_lock(interlkp); - return (ENOENT); } if (interlkp) mtx_unlock(interlkp); Modified: stable/7/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/7/sys/nfsclient/nfs_vfsops.c Sun Apr 12 16:53:56 2009 (r190969) +++ stable/7/sys/nfsclient/nfs_vfsops.c Sun Apr 12 17:43:41 2009 (r190970) @@ -256,7 +256,7 @@ nfs_statfs(struct mount *mp, struct stat #ifndef nolint sfp = NULL; #endif - error = vfs_busy(mp, LK_NOWAIT, NULL, td); + error = vfs_busy(mp, 0, NULL, td); if (error) return (error); error = nfs_nget(mp, (nfsfh_t *)nmp->nm_fh, nmp->nm_fhsize, &np, LK_EXCLUSIVE); Modified: stable/7/sys/sys/mount.h ============================================================================== --- stable/7/sys/sys/mount.h Sun Apr 12 16:53:56 2009 (r190969) +++ stable/7/sys/sys/mount.h Sun Apr 12 17:43:41 2009 (r190970) @@ -319,6 +319,7 @@ void __mnt_vnode_markerfree(str #define MNTK_ASYNC 0x00000002 /* filtered async flag */ #define MNTK_SOFTDEP 0x00000004 /* async disabled by softdep */ #define MNTK_NOINSMNTQ 0x00000008 /* insmntque is not allowed */ +#define MNTK_REFEXPIRE 0x00000020 /* refcount expiring is happening */ #define MNTK_UNMOUNT 0x01000000 /* unmount in progress */ #define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */ #define MNTK_SUSPEND 0x08000000 /* request write suspension */ From owner-svn-src-stable-7@FreeBSD.ORG Sun Apr 12 19:06:41 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64B791065672; Sun, 12 Apr 2009 19:06:41 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50A2B8FC18; Sun, 12 Apr 2009 19:06:41 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CJ6fJu035642; Sun, 12 Apr 2009 19:06:41 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CJ6fmq035641; Sun, 12 Apr 2009 19:06:41 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200904121906.n3CJ6fmq035641@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 12 Apr 2009 19:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190972 - in stable/7/lib/libc: . net string X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 19:06:42 -0000 Author: ume Date: Sun Apr 12 19:06:41 2009 New Revision: 190972 URL: http://svn.freebsd.org/changeset/base/190972 Log: MFH r190382,190416,190525: - getaddrinfo(3) should accept numeric when ai_socktype is not specified in hint or hints is NULL. - Add support for SCTP to getaddrinfo(3). Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and IPPROTO_SCTP. It confuses some programs. If getaddrinfo(3) returns IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at least Apache doesn't work. So, I made getaddrinfo(3) to return IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified explicitly by hints.ai_protocol. - Query DNS only once per an address family. Approved by: re (kib) Modified: stable/7/lib/libc/ (props changed) stable/7/lib/libc/net/getaddrinfo.c stable/7/lib/libc/string/ffsll.c (props changed) stable/7/lib/libc/string/flsll.c (props changed) Modified: stable/7/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/7/lib/libc/net/getaddrinfo.c Sun Apr 12 19:04:27 2009 (r190971) +++ stable/7/lib/libc/net/getaddrinfo.c Sun Apr 12 19:06:41 2009 (r190972) @@ -102,7 +102,6 @@ __FBSDID("$FreeBSD$"); # define FAITH #endif -#define SUCCESS 0 #define ANY 0 #define YES 1 #define NO 0 @@ -165,19 +164,20 @@ struct explore { static const struct explore explore[] = { #if 0 - { PF_LOCAL, 0, ANY, ANY, NULL, 0x01 }, + { PF_LOCAL, ANY, ANY, NULL, 0x01 }, #endif #ifdef INET6 { PF_INET6, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 }, { PF_INET6, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 }, + { PF_INET6, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 }, + { PF_INET6, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 }, { PF_INET6, SOCK_RAW, ANY, NULL, 0x05 }, #endif { PF_INET, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 }, { PF_INET, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 }, + { PF_INET, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 }, + { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 }, { PF_INET, SOCK_RAW, ANY, NULL, 0x05 }, - { PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 }, - { PF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 }, - { PF_UNSPEC, SOCK_RAW, ANY, NULL, 0x05 }, { -1, 0, 0, NULL, 0 }, }; @@ -227,6 +227,8 @@ typedef union { } querybuf; static int str2number(const char *, int *); +static int explore_copy(const struct addrinfo *, const struct addrinfo *, + struct addrinfo **); static int explore_null(const struct addrinfo *, const char *, struct addrinfo **); static int explore_numeric(const struct addrinfo *, const char *, @@ -237,6 +239,7 @@ static int get_canonname(const struct ad struct addrinfo *, const char *); static struct addrinfo *get_ai(const struct addrinfo *, const struct afd *, const char *); +static struct addrinfo *copy_ai(const struct addrinfo *); static int get_portmatch(const struct addrinfo *, const char *); static int get_port(struct addrinfo *, const char *, int); static const struct afd *find_afd(int); @@ -365,12 +368,23 @@ getaddrinfo(const char *hostname, const struct addrinfo sentinel; struct addrinfo *cur; int error = 0; - struct addrinfo ai; - struct addrinfo ai0; + struct addrinfo ai, ai0, *afai; struct addrinfo *pai; + const struct afd *afd; const struct explore *ex; + struct addrinfo *afailist[sizeof(afdl)/sizeof(afdl[0])]; + struct addrinfo *afai_unspec; + int found; int numeric = 0; + /* ensure we return NULL on errors */ + *res = NULL; + + memset(&ai, 0, sizeof(ai)); + + memset(afailist, 0, sizeof(afailist)); + afai_unspec = NULL; + memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; pai = &ai; @@ -410,17 +424,22 @@ getaddrinfo(const char *hostname, const */ if (pai->ai_socktype != ANY && pai->ai_protocol != ANY) { for (ex = explore; ex->e_af >= 0; ex++) { - if (pai->ai_family != ex->e_af) + if (!MATCH_FAMILY(pai->ai_family, ex->e_af, + WILD_AF(ex))) continue; - if (ex->e_socktype == ANY) + if (!MATCH(pai->ai_socktype, ex->e_socktype, + WILD_SOCKTYPE(ex))) continue; - if (ex->e_protocol == ANY) + if (!MATCH(pai->ai_protocol, ex->e_protocol, + WILD_PROTOCOL(ex))) continue; - if (pai->ai_socktype == ex->e_socktype && - pai->ai_protocol != ex->e_protocol) { - ERR(EAI_BADHINTS); - } + + /* matched */ + break; } + + if (ex->e_af < 0) + ERR(EAI_BADHINTS); } } @@ -473,49 +492,48 @@ getaddrinfo(const char *hostname, const ai0 = *pai; - /* NULL hostname, or numeric hostname */ - for (ex = explore; ex->e_af >= 0; ex++) { + /* + * NULL hostname, or numeric hostname. + * If numeric representation of AF1 can be interpreted as FQDN + * representation of AF2, we need to think again about the code below. + */ + found = 0; + for (afd = afdl; afd->a_af; afd++) { *pai = ai0; - /* PF_UNSPEC entries are prepared for DNS queries only */ - if (ex->e_af == PF_UNSPEC) - continue; - - if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex))) - continue; - if (!MATCH(pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex))) - continue; - if (!MATCH(pai->ai_protocol, ex->e_protocol, WILD_PROTOCOL(ex))) + if (!MATCH_FAMILY(pai->ai_family, afd->a_af, 1)) continue; if (pai->ai_family == PF_UNSPEC) - pai->ai_family = ex->e_af; - if (pai->ai_socktype == ANY && ex->e_socktype != ANY) - pai->ai_socktype = ex->e_socktype; - if (pai->ai_protocol == ANY && ex->e_protocol != ANY) - pai->ai_protocol = ex->e_protocol; + pai->ai_family = afd->a_af; - if (hostname == NULL) - error = explore_null(pai, servname, &cur->ai_next); - else + if (hostname == NULL) { + error = explore_null(pai, servname, + &afailist[afd - afdl]); + + /* + * Errors from explore_null should be unexpected and + * be caught to avoid returning an incomplete result. + */ + if (error != 0) + goto bad; + } else { error = explore_numeric_scope(pai, hostname, servname, - &cur->ai_next); + &afailist[afd - afdl]); - if (error) - goto free; + /* + * explore_numeric_scope returns an error for address + * families that do not match that of hostname. + * Thus we should not catch the error at this moment. + */ + } - while (cur && cur->ai_next) - cur = cur->ai_next; + if (!error && afailist[afd - afdl]) + found++; } - - /* - * XXX - * If numreic representation of AF1 can be interpreted as FQDN - * representation of AF2, we need to think again about the code below. - */ - if (sentinel.ai_next) { + if (found) { numeric = 1; - goto good; + goto globcopy; } if (hostname == NULL) @@ -528,42 +546,55 @@ getaddrinfo(const char *hostname, const /* * hostname as alphabetical name. - * we would like to prefer AF_INET6 than AF_INET, so we'll make a - * outer loop by AFs. */ + *pai = ai0; + error = explore_fqdn(pai, hostname, servname, &afai_unspec); + +globcopy: for (ex = explore; ex->e_af >= 0; ex++) { *pai = ai0; - /* require exact match for family field */ - if (pai->ai_family != ex->e_af) + if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex))) continue; - if (!MATCH(pai->ai_socktype, ex->e_socktype, - WILD_SOCKTYPE(ex))) { + WILD_SOCKTYPE(ex))) continue; - } if (!MATCH(pai->ai_protocol, ex->e_protocol, - WILD_PROTOCOL(ex))) { + WILD_PROTOCOL(ex))) continue; - } + if (pai->ai_family == PF_UNSPEC) + pai->ai_family = ex->e_af; if (pai->ai_socktype == ANY && ex->e_socktype != ANY) pai->ai_socktype = ex->e_socktype; if (pai->ai_protocol == ANY && ex->e_protocol != ANY) pai->ai_protocol = ex->e_protocol; - error = explore_fqdn(pai, hostname, servname, - &cur->ai_next); + /* + * if the servname does not match socktype/protocol, ignore it. + */ + if (get_portmatch(pai, servname) != 0) + continue; + + if (afai_unspec) + afai = afai_unspec; + else { + if ((afd = find_afd(pai->ai_family)) == NULL) + continue; + /* XXX assumes that afd points inside afdl[] */ + afai = afailist[afd - afdl]; + } + if (!afai) + continue; + + error = explore_copy(pai, afai, &cur->ai_next); + if (error != 0) + goto bad; while (cur && cur->ai_next) cur = cur->ai_next; } - /* XXX inhibit errors if we have the result */ - if (sentinel.ai_next) - error = 0; - -good: /* * ensure we return either: * - error == 0, non-NULL *res @@ -599,16 +630,22 @@ good: } } *res = sentinel.ai_next; - return SUCCESS; } else error = EAI_FAIL; } -free: + bad: - if (sentinel.ai_next) - freeaddrinfo(sentinel.ai_next); - *res = NULL; - return error; + if (afai_unspec) + freeaddrinfo(afai_unspec); + for (afd = afdl; afd->a_af; afd++) { + if (afailist[afd - afdl]) + freeaddrinfo(afailist[afd - afdl]); + } + if (!*res) + if (sentinel.ai_next) + freeaddrinfo(sentinel.ai_next); + + return (error); } static int @@ -1060,6 +1097,41 @@ gai_addr2scopetype(struct sockaddr *sa) } } +static int +explore_copy(const struct addrinfo *pai, const struct addrinfo *src0, + struct addrinfo **res) +{ + int error; + struct addrinfo sentinel, *cur; + const struct addrinfo *src; + + error = 0; + sentinel.ai_next = NULL; + cur = &sentinel; + + for (src = src0; src != NULL; src = src->ai_next) { + if (src->ai_family != pai->ai_family) + continue; + + cur->ai_next = copy_ai(src); + if (!cur->ai_next) { + error = EAI_MEMORY; + goto fail; + } + + cur->ai_next->ai_socktype = pai->ai_socktype; + cur->ai_next->ai_protocol = pai->ai_protocol; + cur = cur->ai_next; + } + + *res = sentinel.ai_next; + return 0; + +fail: + freeaddrinfo(sentinel.ai_next); + return error; +} + /* * hostname == NULL. * passive socket -> anyaddr (0.0.0.0 or ::) @@ -1088,12 +1160,6 @@ explore_null(const struct addrinfo *pai, } else _close(s); - /* - * if the servname does not match socktype/protocol, ignore it. - */ - if (get_portmatch(pai, servname) != 0) - return 0; - afd = find_afd(pai->ai_family); if (afd == NULL) return 0; @@ -1130,12 +1196,6 @@ explore_numeric(const struct addrinfo *p *res = NULL; ai = NULL; - /* - * if the servname does not match socktype/protocol, ignore it. - */ - if (get_portmatch(pai, servname) != 0) - return 0; - afd = find_afd(pai->ai_family); if (afd == NULL) return 0; @@ -1202,12 +1262,6 @@ explore_numeric_scope(const struct addri char *cp, *hostname2 = NULL, *scope, *addr; struct sockaddr_in6 *sin6; - /* - * if the servname does not match socktype/protocol, ignore it. - */ - if (get_portmatch(pai, servname) != 0) - return 0; - afd = find_afd(pai->ai_family); if (afd == NULL) return 0; @@ -1240,6 +1294,8 @@ explore_numeric_scope(const struct addri sin6 = (struct sockaddr_in6 *)(void *)cur->ai_addr; if (ip6_str2scopeid(scope, sin6, &scopeid) == -1) { free(hostname2); + freeaddrinfo(*res); + *res = NULL; return(EAI_NONAME); /* XXX: is return OK? */ } sin6->sin6_scope_id = scopeid; @@ -1248,6 +1304,10 @@ explore_numeric_scope(const struct addri free(hostname2); + if (error && *res) { + freeaddrinfo(*res); + *res = NULL; + } return error; #endif } @@ -1331,6 +1391,38 @@ get_ai(const struct addrinfo *pai, const return ai; } +/* XXX need to malloc() the same way we do from other functions! */ +static struct addrinfo * +copy_ai(const struct addrinfo *pai) +{ + struct addrinfo *ai; + size_t l; + + l = sizeof(*ai) + pai->ai_addrlen; + if ((ai = (struct addrinfo *)malloc(l)) == NULL) + return NULL; + memset(ai, 0, l); + memcpy(ai, pai, sizeof(*ai)); + ai->ai_addr = (struct sockaddr *)(void *)(ai + 1); + memcpy(ai->ai_addr, pai->ai_addr, pai->ai_addrlen); + + if (pai->ai_canonname) { + l = strlen(pai->ai_canonname) + 1; + if ((ai->ai_canonname = malloc(l)) == NULL) { + free(ai); + return NULL; + } + strlcpy(ai->ai_canonname, pai->ai_canonname, l); + } else { + /* just to make sure */ + ai->ai_canonname = NULL; + } + + ai->ai_next = NULL; + + return ai; +} + static int get_portmatch(const struct addrinfo *ai, const char *servname) { @@ -1365,10 +1457,21 @@ get_port(struct addrinfo *ai, const char return EAI_SERVICE; case SOCK_DGRAM: case SOCK_STREAM: + case SOCK_SEQPACKET: allownumeric = 1; break; case ANY: - allownumeric = 0; + switch (ai->ai_family) { + case AF_INET: +#ifdef AF_INET6 + case AF_INET6: +#endif + allownumeric = 1; + break; + default: + allownumeric = 0; + break; + } break; default: return EAI_SOCKTYPE; @@ -1384,13 +1487,17 @@ get_port(struct addrinfo *ai, const char } else { if (ai->ai_flags & AI_NUMERICSERV) return EAI_NONAME; - switch (ai->ai_socktype) { - case SOCK_DGRAM: + + switch (ai->ai_protocol) { + case IPPROTO_UDP: proto = "udp"; break; - case SOCK_STREAM: + case IPPROTO_TCP: proto = "tcp"; break; + case IPPROTO_SCTP: + proto = "sctp"; + break; default: proto = NULL; break; From owner-svn-src-stable-7@FreeBSD.ORG Sun Apr 12 19:41:17 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E835106564A; Sun, 12 Apr 2009 19:41:17 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEFCA8FC1B; Sun, 12 Apr 2009 19:41:16 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CJfGY5036942; Sun, 12 Apr 2009 19:41:16 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CJfGHV036939; Sun, 12 Apr 2009 19:41:16 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200904121941.n3CJfGHV036939@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 12 Apr 2009 19:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190973 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 19:41:18 -0000 Author: kan Date: Sun Apr 12 19:41:16 2009 New Revision: 190973 URL: http://svn.freebsd.org/changeset/base/190973 Log: MFC changes 190533 and 190945: Replace v_dd vnode pointer with v_cache_dd pointer to struct namecache in directory vnodes. Allow namecache dotdot entry to be created pointing from child vnode to parent vnode if no existing links in opposite direction exist. Use direct link from parent to child for dotdot lookups otherwise. This restores more efficient dotdot caching in NFS filesystems which was lost when vnodes stoppped being type stable. Majority of backporting work for this was done by jhb. Reviewed by: jhb, kib Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/vfs_cache.c stable/7/sys/kern/vfs_subr.c stable/7/sys/sys/vnode.h Modified: stable/7/sys/kern/vfs_cache.c ============================================================================== --- stable/7/sys/kern/vfs_cache.c Sun Apr 12 19:06:41 2009 (r190972) +++ stable/7/sys/kern/vfs_cache.c Sun Apr 12 19:41:16 2009 (r190973) @@ -182,7 +182,8 @@ static MALLOC_DEFINE(M_VFSCACHE, "vfscac /* * Flags in namecache.nc_flag */ -#define NCF_WHITE 1 +#define NCF_WHITE 0x01 +#define NCF_ISDOTDOT 0x02 #ifdef DIAGNOSTIC /* @@ -283,14 +284,20 @@ cache_zap(ncp) CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, ncp->nc_vp); vp = NULL; LIST_REMOVE(ncp, nc_hash); - LIST_REMOVE(ncp, nc_src); - if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { - vp = ncp->nc_dvp; - numcachehv--; + if (ncp->nc_flag & NCF_ISDOTDOT) { + if (ncp == ncp->nc_dvp->v_cache_dd) + ncp->nc_dvp->v_cache_dd = NULL; + } else { + LIST_REMOVE(ncp, nc_src); + if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { + vp = ncp->nc_dvp; + numcachehv--; + } } if (ncp->nc_vp) { TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); - ncp->nc_vp->v_dd = NULL; + if (ncp == ncp->nc_vp->v_cache_dd) + ncp->nc_vp->v_cache_dd = NULL; } else { TAILQ_REMOVE(&ncneg, ncp, nc_dst); numneg--; @@ -348,12 +355,21 @@ retry: } if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { dotdothits++; - if (dvp->v_dd == NULL || - (cnp->cn_flags & MAKEENTRY) == 0) { + if (dvp->v_cache_dd == NULL) { CACHE_UNLOCK(); return (0); } - *vpp = dvp->v_dd; + if ((cnp->cn_flags & MAKEENTRY) == 0) { + if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) + cache_zap(dvp->v_cache_dd); + dvp->v_cache_dd = NULL; + CACHE_UNLOCK(); + return (0); + } + if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) + *vpp = dvp->v_cache_dd->nc_vp; + else + *vpp = dvp->v_cache_dd->nc_dvp; CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", dvp, cnp->cn_nameptr, *vpp); goto success; @@ -484,6 +500,7 @@ cache_enter(dvp, vp, cnp) struct namecache *ncp, *n2; struct nchashhead *ncpp; u_int32_t hash; + int flag; int hold; int zap; int len; @@ -501,23 +518,33 @@ cache_enter(dvp, vp, cnp) if (numcache >= desiredvnodes * 2) return; + flag = 0; if (cnp->cn_nameptr[0] == '.') { - if (cnp->cn_namelen == 1) { + if (cnp->cn_namelen == 1) return; - } - /* - * For dotdot lookups only cache the v_dd pointer if the - * directory has a link back to its parent via v_cache_dst. - * Without this an unlinked directory would keep a soft - * reference to its parent which could not be NULLd at - * cache_purge() time. - */ if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { CACHE_LOCK(); - if (!TAILQ_EMPTY(&dvp->v_cache_dst)) - dvp->v_dd = vp; + /* + * If dotdot entry already exists, just retarget it + * to new parent vnode, otherwise continue with new + * namecache entry allocation. + */ + if ((ncp = dvp->v_cache_dd) != NULL) { + if (ncp->nc_flag & NCF_ISDOTDOT) { + KASSERT(ncp->nc_dvp == dvp, + ("wrong isdotdot parent")); + TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, + ncp, nc_dst); + TAILQ_INSERT_HEAD(&vp->v_cache_dst, + ncp, nc_dst); + ncp->nc_vp = vp; + CACHE_UNLOCK(); + return; + } + } + dvp->v_cache_dd = NULL; CACHE_UNLOCK(); - return; + flag = NCF_ISDOTDOT; } } @@ -531,6 +558,7 @@ cache_enter(dvp, vp, cnp) ncp = cache_alloc(cnp->cn_namelen); ncp->nc_vp = vp; ncp->nc_dvp = dvp; + ncp->nc_flag = flag; len = ncp->nc_nlen = cnp->cn_namelen; hash = fnv_32_buf(cnp->cn_nameptr, len, FNV1_32_INIT); bcopy(cnp->cn_nameptr, ncp->nc_name, len); @@ -553,14 +581,35 @@ cache_enter(dvp, vp, cnp) } } + if (flag == NCF_ISDOTDOT) { + /* + * See if we are trying to add .. entry, but some other lookup + * has populated v_cache_dd pointer already. + */ + if (dvp->v_cache_dd != NULL) { + CACHE_UNLOCK(); + cache_free(ncp); + return; + } + KASSERT(vp == NULL || vp->v_type == VDIR, + ("wrong vnode type %p", vp)); + dvp->v_cache_dd = ncp; + } + numcache++; if (!vp) { numneg++; - ncp->nc_flag = cnp->cn_flags & ISWHITEOUT ? NCF_WHITE : 0; + if (cnp->cn_flags & ISWHITEOUT) + ncp->nc_flag |= NCF_WHITE; } else if (vp->v_type == VDIR) { - vp->v_dd = dvp; + if (flag != NCF_ISDOTDOT) { + if ((n2 = vp->v_cache_dd) != NULL && + (n2->nc_flag & NCF_ISDOTDOT) != 0) + cache_zap(n2); + vp->v_cache_dd = ncp; + } } else { - vp->v_dd = NULL; + vp->v_cache_dd = NULL; } /* @@ -568,11 +617,14 @@ cache_enter(dvp, vp, cnp) * within the cache entries table. */ LIST_INSERT_HEAD(ncpp, ncp, nc_hash); - if (LIST_EMPTY(&dvp->v_cache_src)) { - hold = 1; - numcachehv++; + if (flag != NCF_ISDOTDOT) { + if (LIST_EMPTY(&dvp->v_cache_src)) { + hold = 1; + numcachehv++; + } + LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); } - LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); + /* * If the entry is "negative", we place it into the * "negative" cache queue, otherwise, we place it into the @@ -627,7 +679,12 @@ cache_purge(vp) cache_zap(LIST_FIRST(&vp->v_cache_src)); while (!TAILQ_EMPTY(&vp->v_cache_dst)) cache_zap(TAILQ_FIRST(&vp->v_cache_dst)); - vp->v_dd = NULL; + if (vp->v_cache_dd != NULL) { + KASSERT(vp->v_cache_dd->nc_flag & NCF_ISDOTDOT, + ("lost dotdot link")); + cache_zap(vp->v_cache_dd); + } + KASSERT(vp->v_cache_dd == NULL, ("incomplete purge")); CACHE_UNLOCK(); } @@ -877,18 +934,19 @@ vn_fullpath1(struct thread *td, struct v vp = vp->v_mount->mnt_vnodecovered; continue; } - if (vp->v_dd == NULL) { + if (vp->v_type != VDIR) { numfullpathfail1++; error = ENOTDIR; break; } - ncp = TAILQ_FIRST(&vp->v_cache_dst); + TAILQ_FOREACH(ncp, &vp->v_cache_dst, nc_dst) + if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) + break; if (!ncp) { numfullpathfail2++; error = ENOENT; break; } - MPASS(ncp->nc_dvp == vp->v_dd); for (i = ncp->nc_nlen - 1; i >= 0 && bp != buf; i--) *--bp = ncp->nc_name[i]; if (bp == buf) { Modified: stable/7/sys/kern/vfs_subr.c ============================================================================== --- stable/7/sys/kern/vfs_subr.c Sun Apr 12 19:06:41 2009 (r190972) +++ stable/7/sys/kern/vfs_subr.c Sun Apr 12 19:41:16 2009 (r190973) @@ -800,6 +800,7 @@ vdestroy(struct vnode *vp) VNASSERT(bo->bo_dirty.bv_root == NULL, vp, ("dirtyblkroot not NULL")); VNASSERT(TAILQ_EMPTY(&vp->v_cache_dst), vp, ("vp has namecache dst")); VNASSERT(LIST_EMPTY(&vp->v_cache_src), vp, ("vp has namecache src")); + VNASSERT(vp->v_cache_dd == NULL, vp, ("vp has namecache for ..")); VI_UNLOCK(vp); #ifdef MAC mac_destroy_vnode(vp); Modified: stable/7/sys/sys/vnode.h ============================================================================== --- stable/7/sys/sys/vnode.h Sun Apr 12 19:06:41 2009 (r190972) +++ stable/7/sys/sys/vnode.h Sun Apr 12 19:41:16 2009 (r190973) @@ -138,7 +138,7 @@ struct vnode { */ LIST_HEAD(, namecache) v_cache_src; /* c Cache entries from us */ TAILQ_HEAD(, namecache) v_cache_dst; /* c Cache entries to us */ - struct vnode *v_dd; /* c .. vnode */ + struct namecache *v_cache_dd; /* c Cache entry for .. vnode */ /* * clustering stuff From owner-svn-src-stable-7@FreeBSD.ORG Sun Apr 12 19:50:46 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B0DF1065673; Sun, 12 Apr 2009 19:50:46 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 886DC8FC08; Sun, 12 Apr 2009 19:50:46 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CJokNG037357; Sun, 12 Apr 2009 19:50:46 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CJok7e037356; Sun, 12 Apr 2009 19:50:46 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200904121950.n3CJok7e037356@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 12 Apr 2009 19:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190975 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/dcons X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 19:50:47 -0000 Author: kan Date: Sun Apr 12 19:50:46 2009 New Revision: 190975 URL: http://svn.freebsd.org/changeset/base/190975 Log: MFC change 190756: Fix logic in MOD_LOAD handler to call dcons_attach after all successful dcons_drv_init invocations. Testing return value for 0 does not work for cases where dcons_drv_init was called already as part of low level onsole initialization. Approved by: re(kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/dcons/dcons_os.c Modified: stable/7/sys/dev/dcons/dcons_os.c ============================================================================== --- stable/7/sys/dev/dcons/dcons_os.c Sun Apr 12 19:42:25 2009 (r190974) +++ stable/7/sys/dev/dcons/dcons_os.c Sun Apr 12 19:50:46 2009 (r190975) @@ -683,8 +683,9 @@ dcons_modevent(module_t mode, int type, case MOD_LOAD: ret = dcons_drv_init(1); #if __FreeBSD_version >= 500000 - if (ret == 0) { + if (ret != -1) dcons_attach(); + if (ret == 0) { dcons_cnprobe(&dcons_consdev); dcons_cninit(&dcons_consdev); cnadd(&dcons_consdev); From owner-svn-src-stable-7@FreeBSD.ORG Sun Apr 12 23:06:24 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AE791065672; Sun, 12 Apr 2009 23:06:24 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DF3B8FC14; Sun, 12 Apr 2009 23:06:24 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CN6Onb043988; Sun, 12 Apr 2009 23:06:24 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CN6OrZ043986; Sun, 12 Apr 2009 23:06:24 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200904122306.n3CN6OrZ043986@svn.freebsd.org> From: Maxim Sobolev Date: Sun, 12 Apr 2009 23:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190980 - in stable/7/sys: . amd64/amd64 contrib/pf dev/ath/ath_hal dev/cxgb i386/i386 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 23:06:25 -0000 Author: sobomax Date: Sun Apr 12 23:06:23 2009 New Revision: 190980 URL: http://svn.freebsd.org/changeset/base/190980 Log: MFC: Make machdep.hyperthreading_allowed working. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/amd64/amd64/mp_machdep.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/i386/i386/mp_machdep.c Modified: stable/7/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/mp_machdep.c Sun Apr 12 22:16:14 2009 (r190979) +++ stable/7/sys/amd64/amd64/mp_machdep.c Sun Apr 12 23:06:23 2009 (r190980) @@ -153,6 +153,7 @@ struct cpu_info { int cpu_present:1; int cpu_bsp:1; int cpu_disabled:1; + int cpu_hyperthread:1; } static cpu_info[MAX_APIC_ID + 1]; int cpu_apic_ids[MAXCPU]; @@ -355,11 +356,6 @@ cpu_mp_start(void) ("BSP's APIC ID doesn't match boot_cpu_id")); cpu_apic_ids[0] = boot_cpu_id; - assign_cpu_ids(); - - /* Start each Application Processor */ - start_all_aps(); - /* Setup the initial logical CPUs info. */ logical_cpus = logical_cpus_mask = 0; if (cpu_feature & CPUID_HTT) @@ -407,6 +403,11 @@ cpu_mp_start(void) hyperthreading_cpus = logical_cpus; } + assign_cpu_ids(); + + /* Start each Application Processor */ + start_all_aps(); + set_interrupt_apic_ids(); /* Last, setup the cpu topology now that we have probed CPUs */ @@ -421,18 +422,26 @@ void cpu_mp_announce(void) { int i, x; + const char *hyperthread; /* List CPUs */ printf(" cpu0 (BSP): APIC ID: %2d\n", boot_cpu_id); for (i = 1, x = 0; x <= MAX_APIC_ID; x++) { if (!cpu_info[x].cpu_present || cpu_info[x].cpu_bsp) continue; + if (cpu_info[x].cpu_hyperthread) { + hyperthread = "/HT"; + } else { + hyperthread = ""; + } if (cpu_info[x].cpu_disabled) - printf(" cpu (AP): APIC ID: %2d (disabled)\n", x); + printf(" cpu (AP%s): APIC ID: %2d (disabled)\n", + hyperthread, x); else { KASSERT(i < mp_ncpus, ("mp_ncpus and actual cpus are out of whack")); - printf(" cpu%d (AP): APIC ID: %2d\n", i++, x); + printf(" cpu%d (AP%s): APIC ID: %2d\n", i++, + hyperthread, x); } } } @@ -638,11 +647,28 @@ assign_cpu_ids(void) { u_int i; + TUNABLE_INT_FETCH("machdep.hyperthreading_allowed", + &hyperthreading_allowed); + /* Check for explicitly disabled CPUs. */ for (i = 0; i <= MAX_APIC_ID; i++) { if (!cpu_info[i].cpu_present || cpu_info[i].cpu_bsp) continue; + if (hyperthreading_cpus > 1 && i % hyperthreading_cpus != 0) { + cpu_info[i].cpu_hyperthread = 1; +#if defined(SCHED_ULE) + /* + * Don't use HT CPU if it has been disabled by a + * tunable. + */ + if (hyperthreading_allowed == 0) { + cpu_info[i].cpu_disabled = 1; + continue; + } +#endif + } + /* Don't use this CPU if it has been disabled by a tunable. */ if (resource_disabled("lapic", i)) { cpu_info[i].cpu_disabled = 1; @@ -1229,6 +1255,16 @@ sysctl_hyperthreading_allowed(SYSCTL_HAN if (error || !req->newptr) return (error); +#ifdef SCHED_ULE + /* + * SCHED_ULE doesn't allow enabling/disabling HT cores at + * run-time. + */ + if (allowed != hyperthreading_allowed) + return (ENOTSUP); + return (error); +#endif + if (allowed) hlt_cpus_mask &= ~hyperthreading_cpus_mask; else @@ -1273,8 +1309,6 @@ cpu_hlt_setup(void *dummy __unused) * of hlt_logical_cpus. */ if (hyperthreading_cpus_mask) { - TUNABLE_INT_FETCH("machdep.hyperthreading_allowed", - &hyperthreading_allowed); SYSCTL_ADD_PROC(&logical_cpu_clist, SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO, "hyperthreading_allowed", CTLTYPE_INT|CTLFLAG_RW, Modified: stable/7/sys/i386/i386/mp_machdep.c ============================================================================== --- stable/7/sys/i386/i386/mp_machdep.c Sun Apr 12 22:16:14 2009 (r190979) +++ stable/7/sys/i386/i386/mp_machdep.c Sun Apr 12 23:06:23 2009 (r190980) @@ -209,6 +209,7 @@ struct cpu_info { int cpu_present:1; int cpu_bsp:1; int cpu_disabled:1; + int cpu_hyperthread:1; } static cpu_info[MAX_APIC_ID + 1]; int cpu_apic_ids[MAXCPU]; @@ -405,11 +406,6 @@ cpu_mp_start(void) ("BSP's APIC ID doesn't match boot_cpu_id")); cpu_apic_ids[0] = boot_cpu_id; - assign_cpu_ids(); - - /* Start each Application Processor */ - start_all_aps(); - /* Setup the initial logical CPUs info. */ logical_cpus = logical_cpus_mask = 0; if (cpu_feature & CPUID_HTT) @@ -457,6 +453,11 @@ cpu_mp_start(void) hyperthreading_cpus = logical_cpus; } + assign_cpu_ids(); + + /* Start each Application Processor */ + start_all_aps(); + set_interrupt_apic_ids(); /* Last, setup the cpu topology now that we have probed CPUs */ @@ -471,18 +472,26 @@ void cpu_mp_announce(void) { int i, x; + const char *hyperthread; /* List CPUs */ printf(" cpu0 (BSP): APIC ID: %2d\n", boot_cpu_id); for (i = 1, x = 0; x <= MAX_APIC_ID; x++) { if (!cpu_info[x].cpu_present || cpu_info[x].cpu_bsp) continue; + if (cpu_info[x].cpu_hyperthread) { + hyperthread = "/HT"; + } else { + hyperthread = ""; + } if (cpu_info[x].cpu_disabled) - printf(" cpu (AP): APIC ID: %2d (disabled)\n", x); + printf(" cpu (AP%s): APIC ID: %2d (disabled)\n", + hyperthread, x); else { KASSERT(i < mp_ncpus, ("mp_ncpus and actual cpus are out of whack")); - printf(" cpu%d (AP): APIC ID: %2d\n", i++, x); + printf(" cpu%d (AP%s): APIC ID: %2d\n", i++, + hyperthread, x); } } } @@ -691,11 +700,28 @@ assign_cpu_ids(void) { u_int i; + TUNABLE_INT_FETCH("machdep.hyperthreading_allowed", + &hyperthreading_allowed); + /* Check for explicitly disabled CPUs. */ for (i = 0; i <= MAX_APIC_ID; i++) { if (!cpu_info[i].cpu_present || cpu_info[i].cpu_bsp) continue; + if (hyperthreading_cpus > 1 && i % hyperthreading_cpus != 0) { + cpu_info[i].cpu_hyperthread = 1; +#if defined(SCHED_ULE) + /* + * Don't use HT CPU if it has been disabled by a + * tunable. + */ + if (hyperthreading_allowed == 0) { + cpu_info[i].cpu_disabled = 1; + continue; + } +#endif + } + /* Don't use this CPU if it has been disabled by a tunable. */ if (resource_disabled("lapic", i)) { cpu_info[i].cpu_disabled = 1; @@ -1410,6 +1436,16 @@ sysctl_hyperthreading_allowed(SYSCTL_HAN if (error || !req->newptr) return (error); +#ifdef SCHED_ULE + /* + * SCHED_ULE doesn't allow enabling/disabling HT cores at + * run-time. + */ + if (allowed != hyperthreading_allowed) + return (ENOTSUP); + return (error); +#endif + if (allowed) hlt_cpus_mask &= ~hyperthreading_cpus_mask; else @@ -1454,8 +1490,6 @@ cpu_hlt_setup(void *dummy __unused) * of hlt_logical_cpus. */ if (hyperthreading_cpus_mask) { - TUNABLE_INT_FETCH("machdep.hyperthreading_allowed", - &hyperthreading_allowed); SYSCTL_ADD_PROC(&logical_cpu_clist, SYSCTL_STATIC_CHILDREN(_machdep), OID_AUTO, "hyperthreading_allowed", CTLTYPE_INT|CTLFLAG_RW, From owner-svn-src-stable-7@FreeBSD.ORG Sun Apr 12 23:10:02 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06988106566B; Sun, 12 Apr 2009 23:10:02 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C97848FC1B; Sun, 12 Apr 2009 23:10:01 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3CNA1Rx044139; Sun, 12 Apr 2009 23:10:01 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3CNA1Ei044138; Sun, 12 Apr 2009 23:10:01 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <200904122310.n3CNA1Ei044138@svn.freebsd.org> From: Maxim Sobolev Date: Sun, 12 Apr 2009 23:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190981 - in stable/7/sys: . boot/i386/btx/btxldr contrib/pf dev/cxgb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 23:10:02 -0000 Author: sobomax Date: Sun Apr 12 23:10:01 2009 New Revision: 190981 URL: http://svn.freebsd.org/changeset/base/190981 Log: MFC: Respect RBX_MUTE flag from boot[012]. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/boot/i386/btx/btxldr/btxldr.S stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) Modified: stable/7/sys/boot/i386/btx/btxldr/btxldr.S ============================================================================== --- stable/7/sys/boot/i386/btx/btxldr/btxldr.S Sun Apr 12 23:06:23 2009 (r190980) +++ stable/7/sys/boot/i386/btx/btxldr/btxldr.S Sun Apr 12 23:10:01 2009 (r190981) @@ -15,6 +15,9 @@ * $FreeBSD$ */ +#define RBX_MUTE 0x10 /* -m */ +#define OPT_SET(opt) (1 << (opt)) + /* * Prototype BTX loader program, written in a couple of hours. The * real thing should probably be more flexible, and in C. @@ -64,6 +67,8 @@ * BTX program loader for ELF clients. */ start: cld # String ops inc + testl $OPT_SET(RBX_MUTE), 4(%esp) # Check first argument + setnz muted # for RBX_MUTE, set flag movl $m_logo,%esi # Identify call putstr # ourselves movzwl BDA_MEM,%eax # Get base memory @@ -288,7 +293,9 @@ putstr: lodsb # Load char /* * Output character AL to the console. */ -putchr: pusha # Save +putchr: testb $1,muted # Check muted + jnz putchr.5 # do a nop + pusha # Save xorl %ecx,%ecx # Zero for loops movb $SCR_MAT,%ah # Mode/attribute movl $BDA_POS,%ebx # BDA pointer @@ -325,7 +332,7 @@ putchr.3: cmpb $SCR_ROW,%dh # Beyond sc movb $SCR_ROW-1,%dh # Bottom line putchr.4: movw %dx,(%ebx) # Update position popa # Restore - ret # To caller +putchr.5: ret # To caller /* * Convert EAX, AX, or AL to hex, saving the result to [EDI]. */ @@ -390,6 +397,12 @@ m_segs: .asciz "text segment: offset=" .asciz " memsz=\0\n" m_done: .asciz "Loading complete\n" #endif + +/* + * Flags + */ +muted: .byte 0x0 + /* * Uninitialized data area. */ From owner-svn-src-stable-7@FreeBSD.ORG Mon Apr 13 09:22:03 2009 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93F8D106564A; Mon, 13 Apr 2009 09:22:03 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F8208FC0A; Mon, 13 Apr 2009 09:22:03 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3D9M3D2064428; Mon, 13 Apr 2009 09:22:03 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3D9M3IM064425; Mon, 13 Apr 2009 09:22:03 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200904130922.n3D9M3IM064425@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 13 Apr 2009 09:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190992 - stable/7/share/zoneinfo X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 09:22:04 -0000 Author: edwin Date: Mon Apr 13 09:22:03 2009 New Revision: 190992 URL: http://svn.freebsd.org/changeset/base/190992 Log: MFC of tzdata2009d: - Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 - Tunisia will not observe DST this year. - Syria will start DST on 2009-03-27 00:00 this year - the Province of San Luis will go to utc-04:00 Approved by: re (kib) Modified: stable/7/share/zoneinfo/ (props changed) stable/7/share/zoneinfo/africa stable/7/share/zoneinfo/asia stable/7/share/zoneinfo/southamerica Modified: stable/7/share/zoneinfo/africa ============================================================================== --- stable/7/share/zoneinfo/africa Mon Apr 13 09:17:40 2009 (r190991) +++ stable/7/share/zoneinfo/africa Mon Apr 13 09:22:03 2009 (r190992) @@ -1,4 +1,4 @@ -# @(#)africa 8.17 +# @(#)africa 8.18 #
 
 # This data is by no means authoritative; if you think you know better,
@@ -564,6 +564,40 @@ Zone	Indian/Mayotte	3:00:56 -	LMT	1911 J
 # 
 # http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
 # 
+
+# From Steffen Thorsen (2009-03-17):
+# Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 according
+# to many sources, such as
+# 
+# http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html
+# 
+# 
+# http://www.medi1sat.ma/fr/depeche.aspx?idp=2312
+# 
+# (French)
+#
+# Our summary:
+# 
+# http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
+# 
+
+# From Alexander Krivenyshev (2009-03-17):
+# Here is a link to official document from Royaume du Maroc Premier Ministre,
+# Ministere de la Modernisation des Secteurs Publics
+#
+# Under Article 1 of Royal Decree No. 455-67 of Act 23 safar 1387 (2 june 1967)
+# concerning the amendment of the legal time, the Ministry of Modernization of
+# Public Sectors announced that the official time in the Kingdom will be
+# advanced 60 minutes from Sunday 31 May 2009 at midnight.
+#
+# 
+# http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf
+# 
+#
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
+# 
+
 # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 
 Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
@@ -583,6 +617,8 @@ Rule	Morocco	1978	only	-	Jun	 1	 0:00	1:
 Rule	Morocco	1978	only	-	Aug	 4	 0:00	0	-
 Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:00	S
 Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
+Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
+Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
 			 0:00	Morocco	WE%sT	1984 Mar 16
@@ -787,6 +823,43 @@ Zone	Africa/Lome	0:04:52 -	LMT	1893
 # Ending         : the last Sunday of October at 03:00 ...
 # http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=1188&Itemid=50
 
+# From Steffen Thorsen (2009-03-16):
+# According to several news sources, Tunisia will not observe DST this year.
+# (Arabic)
+# 
+# http://www.elbashayer.com/?page=viewn&nid=42546
+# 
+# 
+# http://www.babnet.net/kiwidetail-15295.asp
+# 
+#
+# We have also confirmed this with the US embassy in Tunisia.
+# We have a wrap-up about this on the following page:
+# 
+# http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
+# 
+
+# From Alexander Krivenyshev (2009-03-17):
+# Here is a link to Tunis Afrique Presse News Agency
+#
+# Standard time to be kept the whole year long (tap.info.tn):
+#
+# (in English)
+# 
+# http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157
+# 
+#
+# (in Arabic)
+# 
+# http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1
+# 
+
+# From Arthur David Olson (2009--3-18):
+# The Tunis Afrique Presse News Agency notice contains this: "This measure is due to the fact
+# that the fasting month of ramadan coincides with the period concerned by summer time.
+# Therefore, the standard time will be kept unchanged the whole year long."
+# So foregoing DST seems to be an exception (albeit one that may be repeated in the  future).
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Tunisia	1939	only	-	Apr	15	23:00s	1:00	S
 Rule	Tunisia	1939	only	-	Nov	18	23:00s	0	-
@@ -811,8 +884,10 @@ Rule	Tunisia	1989	only	-	Mar	26	 0:00s	1
 Rule	Tunisia	1990	only	-	May	 1	 0:00s	1:00	S
 Rule	Tunisia	2005	only	-	May	 1	 0:00s	1:00	S
 Rule	Tunisia	2005	only	-	Sep	30	 1:00s	0	-
-Rule	Tunisia	2006	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Tunisia	2006	max	-	Oct	lastSun	 2:00s	0	-
+Rule	Tunisia	2006	2008	-	Mar	lastSun	 2:00s	1:00	S
+Rule	Tunisia	2006	2008	-	Oct	lastSun	 2:00s	0	-
+Rule	Tunisia	2010	max	-	Mar	lastSun	 2:00s	1:00	S
+Rule	Tunisia	2010	max	-	Oct	lastSun	 2:00s	0	-
 # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
 # more precise 0:09:21.
 # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Mon Apr 13 09:17:40 2009	(r190991)
+++ stable/7/share/zoneinfo/asia	Mon Apr 13 09:22:03 2009	(r190992)
@@ -1,4 +1,4 @@
-# @(#)asia	8.25
+# @(#)asia	8.26
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -1969,8 +1969,29 @@ Rule	Syria	2007	only	-	Nov	 Fri>=1	0:00	
 # http://sana.sy/ara/2/2008/10/07/195459.htm
 # 
 
-Rule	Syria	2008	max	-	Apr	Fri>=1	0:00	1:00	S
+# From Steffen Thorsen (2009-03-19):
+# Syria will start DST on 2009-03-27 00:00 this year according to many sources,
+# two examples:
+#
+# 
+# http://www.sana.sy/eng/21/2009/03/17/217563.htm
+# 
+# (English, Syrian Arab News # Agency)
+# 
+# http://thawra.alwehda.gov.sy/_View_news2.asp?FileName=94459258720090318012209
+# 
+# (Arabic, gov-site)
+#
+# We have not found any sources saying anything about when DST ends this year.
+#
+# Our summary
+# 
+# http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
+# 
+
+Rule	Syria	2008	only	-	Apr	Fri>=1	0:00	1:00	S
 Rule	Syria	2008	max	-	Nov	1	0:00	0	-
+Rule	Syria	2009	max	-	Mar	lastFri	0:00	1:00	S
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Damascus	2:25:12 -	LMT	1920	# Dimashq

Modified: stable/7/share/zoneinfo/southamerica
==============================================================================
--- stable/7/share/zoneinfo/southamerica	Mon Apr 13 09:17:40 2009	(r190991)
+++ stable/7/share/zoneinfo/southamerica	Mon Apr 13 09:22:03 2009	(r190992)
@@ -1,4 +1,4 @@
-# @(#)southamerica	8.33
+# @(#)southamerica	8.34
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -351,6 +351,50 @@ Rule	Arg	2008	max	-	Oct	Sun>=15	0:00	1:0
 # keep America/Cordoba a single region rather than splitting it into the
 # other 5 subregions.
 
+# From Mariano Absatz (2009-03-13):
+# Yesterday (with our usual 2-day notice) the Province of San Luis
+# decided that next Sunday instead of "staying" @utc-03:00 they will go
+# to utc-04:00 until the second Saturday in October...
+#
+# The press release is at
+# 
+# http://www.sanluis.gov.ar/SL/Paginas/NoticiaDetalle.asp?TemaId=1&InfoPrensaId=3102
+# 
+# (I couldn't find the decree, but
+# 
+# www.sanluis.gov.ar
+# 
+# is the official page for the Province Government).
+#
+# There's also a note in only one of the major national papers (La Nación) at
+# 
+# http://www.lanacion.com.ar/nota.asp?nota_id=1107912
+# 
+# 
+# The press release says:
+#  (...) anunció que el próximo domingo a las 00:00 los puntanos deberán
+# atrasar una hora sus relojes.
+#
+# A partir de entonces, San Luis establecerá el huso horario propio de
+# la Provincia. De esta manera, durante el periodo del calendario anual
+# 2009, el cambio horario quedará comprendido entre las 00:00 del tercer
+# domingo de marzo y las 24:00 del segundo sábado de octubre.
+# Quick&dirty translation
+# (...) announced that next Sunday, at 00:00, Puntanos (the San Luis
+# inhabitants) will have to turn back one hour their clocks
+#
+# Since then, San Luis will establish its own Province timezone. Thus,
+# during 2009, this timezone change will run from 00:00 the third Sunday
+# in March until 24:00 of the second Saturday in October.
+
+# From Arthur David Olson (2009-03-16):
+# The unofficial claim at
+# 
+# http://www.timeanddate.com/news/time/san-luis-new-time-zone.html
+# 
+# is that "The province will most likely follow the next daylight saving schedule,
+# which is planned for the second Sunday in October."
+
 #
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 #
@@ -498,7 +542,8 @@ Zone America/Argentina/San_Luis -4:25:24
 			-3:00	-	ART	2004 May 31
 			-4:00	-	WART	2004 Jul 25
 			-3:00	Arg	AR%sT	2008 Jan 21
-			-3:00	-	ART
+			-3:00	-	ART	2009 Mar 15
+			-4:00	Arg	WAR%sT
 #
 # Santa Cruz (SC)
 Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31

From owner-svn-src-stable-7@FreeBSD.ORG  Mon Apr 13 10:41:26 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 205891065674;
	Mon, 13 Apr 2009 10:41:26 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D2668FC19;
	Mon, 13 Apr 2009 10:41:26 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DAfPHI069630;
	Mon, 13 Apr 2009 10:41:25 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DAfPKG069629;
	Mon, 13 Apr 2009 10:41:25 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200904131041.n3DAfPKG069629@svn.freebsd.org>
From: Edwin Groothuis 
Date: Mon, 13 Apr 2009 10:41:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190995 - stable/7/share/zoneinfo
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 13 Apr 2009 10:41:26 -0000

Author: edwin
Date: Mon Apr 13 10:41:25 2009
New Revision: 190995
URL: http://svn.freebsd.org/changeset/base/190995

Log:
  MFC of tzdata2009e
  
  - Jordan went into DST in the last Thursday in March instead of the
    last Friday in March.
  - Palestine has extended the DST time with one week before and one
    month after.
  
  Approved by:	re (kip)

Modified:
  stable/7/share/zoneinfo/   (props changed)
  stable/7/share/zoneinfo/asia

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Mon Apr 13 09:45:03 2009	(r190994)
+++ stable/7/share/zoneinfo/asia	Mon Apr 13 10:41:25 2009	(r190995)
@@ -1,4 +1,4 @@
-# @(#)asia	8.26
+# @(#)asia	8.29
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -1049,6 +1049,40 @@ Zone	Asia/Tokyo	9:18:59	-	LMT	1887 Dec 3
 # http://www.petranews.gov.jo/nepras/2006/Sep/05/4000.htm
 # "Jordan will switch to winter time on Friday, October 27".
 #
+
+# From Phil Pizzey (2009-04-02):
+# ...I think I may have spotted an error in the timezone data for
+# Jordan.
+# The current (2009d) asia file shows Jordan going to daylight
+# saving
+# time on the last Thursday in March.
+#
+# Rule  Jordan      2000  max	-  Mar   lastThu     0:00s 1:00  S
+#
+# However timeanddate.com, which I usually find reliable, shows Jordan
+# going to daylight saving time on the last Friday in March since 2002.
+# Please see
+# 
+# http://www.timeanddate.com/worldclock/timezone.html?n=11
+# 
+
+# From Steffen Thorsen (2009-04-02):
+# This single one might be good enough, (2009-03-24, Arabic):
+# 
+# http://petra.gov.jo/Artical.aspx?Lng=2&Section=8&Artical=95279
+# 
+#
+# Google's translation:
+#
+# > The Council of Ministers decided in 2002 to adopt the principle of timely
+# > submission of the summer at 60 minutes as of midnight on the last Thursday
+# > of the month of March of each year.
+#
+# So - this means the midnight between Thursday and Friday since 2002.
+
+# From Arthur David Olson (2009-04-06):
+# We still have Jordan switching to DST on Thursdays in 2000 and 2001.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Jordan	1973	only	-	Jun	6	0:00	1:00	S
 Rule	Jordan	1973	1975	-	Oct	1	0:00	0	-
@@ -1071,8 +1105,9 @@ Rule	Jordan	1993	1998	-	Apr	Fri>=1	0:00	
 Rule	Jordan	1994	only	-	Sep	Fri>=15	0:00	0	-
 Rule	Jordan	1995	1998	-	Sep	Fri>=15	0:00s	0	-
 Rule	Jordan	1999	only	-	Jul	 1	0:00s	1:00	S
-Rule	Jordan	1999	2002	-	Sep	lastThu	0:00s	0	-
-Rule	Jordan	2000	max	-	Mar	lastThu	0:00s	1:00	S
+Rule	Jordan	1999	2002	-	Sep	lastFri	0:00s	0	-
+Rule	Jordan	2000	2001	-	Mar	lastThu	0:00s	1:00	S
+Rule	Jordan	2002	max	-	Mar	lastFri	0:00s	1:00	S
 Rule	Jordan	2003	only	-	Oct	24	0:00s	0	-
 Rule	Jordan	2004	only	-	Oct	15	0:00s	0	-
 Rule	Jordan	2005	only	-	Sep	lastFri	0:00s	0	-
@@ -1695,6 +1730,22 @@ Zone	Asia/Karachi	4:28:12 -	LMT	1907
 # http://www.worldtimezone.com/dst_news/dst_news_gazastrip01.html
 # 
 
+# From Alexander Krivenyshev (2009-03-26):
+# According to the Palestine News Network (arabic.pnn.ps), Palestinian
+# government decided to start Daylight Time on Thursday night March
+# 26 and continue until the night of 27 September 2009.
+#
+# (in Arabic)
+# 
+# http://arabic.pnn.ps/index.php?option=com_content&task=view&id=50850
+# 
+#
+# or
+# (English translation)
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_westbank01.html
+# 
+
 # The rules for Egypt are stolen from the `africa' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -1708,10 +1759,12 @@ Rule Palestine	1999	2005	-	Apr	Fri>=15	0
 Rule Palestine	1999	2003	-	Oct	Fri>=15	0:00	0	-
 Rule Palestine	2004	only	-	Oct	 1	1:00	0	-
 Rule Palestine	2005	only	-	Oct	 4	2:00	0	-
-Rule Palestine	2006	max	-	Apr	 1	0:00	1:00	S
+Rule Palestine	2006	2008	-	Apr	 1	0:00	1:00	S
 Rule Palestine	2006	only	-	Sep	22	0:00	0	-
 Rule Palestine	2007	only	-	Sep	Thu>=8	2:00	0	-
-Rule Palestine	2008	max	-	Aug	lastThu	2:00	0	-
+Rule Palestine	2008	only	-	Aug	lastFri	2:00	0	-
+Rule Palestine	2009	max	-	Mar	lastFri	0:00	1:00	S
+Rule Palestine	2009	max	-	Sep	lastMon	2:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct

From owner-svn-src-stable-7@FreeBSD.ORG  Mon Apr 13 11:54:23 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 411DF1065674;
	Mon, 13 Apr 2009 11:54:23 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0F4FB8FC12;
	Mon, 13 Apr 2009 11:54:23 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DBsMHG071074;
	Mon, 13 Apr 2009 11:54:22 GMT (envelope-from rwatson@svn.freebsd.org)
Received: (from rwatson@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DBsMI2071073;
	Mon, 13 Apr 2009 11:54:22 GMT (envelope-from rwatson@svn.freebsd.org)
Message-Id: <200904131154.n3DBsMI2071073@svn.freebsd.org>
From: Robert Watson 
Date: Mon, 13 Apr 2009 11:54:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r190997 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb kern
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 13 Apr 2009 11:54:24 -0000

Author: rwatson
Date: Mon Apr 13 11:54:22 2009
New Revision: 190997
URL: http://svn.freebsd.org/changeset/base/190997

Log:
  Merge r190996 from head to stable/7:
  
    When writing out updated pollfd records when returning from
    poll(), only copy out the revents field, not the whole pollfd
    structure.  Otherwise, if the events field is updated
    concurrently by another thread, that update may be lost.
  
    This issue apparently causes problems for the JDK on FreeBSD,
    which expects the Linux behavior of not updating all fields
    (somewhat oddly, Solaris does not implement the required
    behavior, but presumably our adaptation of the JDK is based
    on the Linux port?).
  
    MFC after:      2 weeks
    PR:             kern/130924
    Submitted by:   Kurt Miller 
    Discussed with: kib
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/sys_generic.c

Modified: stable/7/sys/kern/sys_generic.c
==============================================================================
--- stable/7/sys/kern/sys_generic.c	Mon Apr 13 10:41:41 2009	(r190996)
+++ stable/7/sys/kern/sys_generic.c	Mon Apr 13 11:54:22 2009	(r190997)
@@ -73,6 +73,7 @@ static MALLOC_DEFINE(M_IOCTLOPS, "ioctlo
 static MALLOC_DEFINE(M_SELECT, "select", "select() buffer");
 MALLOC_DEFINE(M_IOV, "iov", "large iov's");
 
+static int	pollout(struct pollfd *, struct pollfd *, u_int);
 static int	pollscan(struct thread *, struct pollfd *, u_int);
 static int	selscan(struct thread *, fd_mask **, fd_mask **, int);
 static int	dofileread(struct thread *, int, struct file *, struct uio *,
@@ -992,7 +993,7 @@ done_nosellock:
 	if (error == EWOULDBLOCK)
 		error = 0;
 	if (error == 0) {
-		error = copyout(bits, uap->fds, ni);
+		error = pollout(bits, uap->fds, nfds);
 		if (error)
 			goto out;
 	}
@@ -1004,6 +1005,26 @@ done2:
 }
 
 static int
+pollout(fds, ufds, nfd)
+	struct pollfd *fds;
+	struct pollfd *ufds;
+	u_int nfd;
+{
+	int error = 0;
+	u_int i = 0;
+
+	for (i = 0; i < nfd; i++) {
+		error = copyout(&fds->revents, &ufds->revents,
+		    sizeof(ufds->revents));
+		if (error)
+			return (error);
+		fds++;
+		ufds++;
+	}
+	return (0);
+}
+
+static int
 pollscan(td, fds, nfd)
 	struct thread *td;
 	struct pollfd *fds;

From owner-svn-src-stable-7@FreeBSD.ORG  Mon Apr 13 11:56:20 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D45B3106564A;
	Mon, 13 Apr 2009 11:56:20 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id AEC3D8FC18;
	Mon, 13 Apr 2009 11:56:20 +0000 (UTC)
	(envelope-from rwatson@FreeBSD.org)
Received: from fledge.watson.org (fledge.watson.org [65.122.17.41])
	by cyrus.watson.org (Postfix) with ESMTPS id 5469C46B09;
	Mon, 13 Apr 2009 07:56:20 -0400 (EDT)
Date: Mon, 13 Apr 2009 12:56:20 +0100 (BST)
From: Robert Watson 
X-X-Sender: robert@fledge.watson.org
To: src-committers@freebsd.org, svn-src-all@freebsd.org, 
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
In-Reply-To: <200904131154.n3DBsMI2071073@svn.freebsd.org>
Message-ID: 
References: <200904131154.n3DBsMI2071073@svn.freebsd.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: 
Subject: Re: svn commit: r190997 - in stable/7/sys: . contrib/pf
 dev/ath/ath_hal dev/cxgb kern
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 13 Apr 2009 11:56:21 -0000

On Mon, 13 Apr 2009, Robert Watson wrote:

> Author: rwatson
> Date: Mon Apr 13 11:54:22 2009
> New Revision: 190997
> URL: http://svn.freebsd.org/changeset/base/190997
>
> Log:
>  Merge r190996 from head to stable/7:

Due to a clerical error, this is not the right revision number.  The actual 
merged revision is r189708.

Robert N M Watson
Computer Laboratory
University of Cambridge

>
>    When writing out updated pollfd records when returning from
>    poll(), only copy out the revents field, not the whole pollfd
>    structure.  Otherwise, if the events field is updated
>    concurrently by another thread, that update may be lost.
>
>    This issue apparently causes problems for the JDK on FreeBSD,
>    which expects the Linux behavior of not updating all fields
>    (somewhat oddly, Solaris does not implement the required
>    behavior, but presumably our adaptation of the JDK is based
>    on the Linux port?).
>
>    MFC after:      2 weeks
>    PR:             kern/130924
>    Submitted by:   Kurt Miller 
>    Discussed with: kib
>
>  Approved by:	re (kib)
>
> Modified:
>  stable/7/sys/   (props changed)
>  stable/7/sys/contrib/pf/   (props changed)
>  stable/7/sys/dev/ath/ath_hal/   (props changed)
>  stable/7/sys/dev/cxgb/   (props changed)
>  stable/7/sys/kern/sys_generic.c
>
> Modified: stable/7/sys/kern/sys_generic.c
> ==============================================================================
> --- stable/7/sys/kern/sys_generic.c	Mon Apr 13 10:41:41 2009	(r190996)
> +++ stable/7/sys/kern/sys_generic.c	Mon Apr 13 11:54:22 2009	(r190997)
> @@ -73,6 +73,7 @@ static MALLOC_DEFINE(M_IOCTLOPS, "ioctlo
> static MALLOC_DEFINE(M_SELECT, "select", "select() buffer");
> MALLOC_DEFINE(M_IOV, "iov", "large iov's");
>
> +static int	pollout(struct pollfd *, struct pollfd *, u_int);
> static int	pollscan(struct thread *, struct pollfd *, u_int);
> static int	selscan(struct thread *, fd_mask **, fd_mask **, int);
> static int	dofileread(struct thread *, int, struct file *, struct uio *,
> @@ -992,7 +993,7 @@ done_nosellock:
> 	if (error == EWOULDBLOCK)
> 		error = 0;
> 	if (error == 0) {
> -		error = copyout(bits, uap->fds, ni);
> +		error = pollout(bits, uap->fds, nfds);
> 		if (error)
> 			goto out;
> 	}
> @@ -1004,6 +1005,26 @@ done2:
> }
>
> static int
> +pollout(fds, ufds, nfd)
> +	struct pollfd *fds;
> +	struct pollfd *ufds;
> +	u_int nfd;
> +{
> +	int error = 0;
> +	u_int i = 0;
> +
> +	for (i = 0; i < nfd; i++) {
> +		error = copyout(&fds->revents, &ufds->revents,
> +		    sizeof(ufds->revents));
> +		if (error)
> +			return (error);
> +		fds++;
> +		ufds++;
> +	}
> +	return (0);
> +}
> +
> +static int
> pollscan(td, fds, nfd)
> 	struct thread *td;
> 	struct pollfd *fds;
>

From owner-svn-src-stable-7@FreeBSD.ORG  Mon Apr 13 14:15:37 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0826F1065677;
	Mon, 13 Apr 2009 14:15:37 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E88D08FC43;
	Mon, 13 Apr 2009 14:15:36 +0000 (UTC)
	(envelope-from nwhitehorn@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DEFaFg074036;
	Mon, 13 Apr 2009 14:15:36 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DEFaxk074035;
	Mon, 13 Apr 2009 14:15:36 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <200904131415.n3DEFaxk074035@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Mon, 13 Apr 2009 14:15:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191001 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb powerpc/powerpc
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 13 Apr 2009 14:15:38 -0000

Author: nwhitehorn
Date: Mon Apr 13 14:15:36 2009
New Revision: 191001
URL: http://svn.freebsd.org/changeset/base/191001

Log:
  MFC r190946:
  
  Fix recognition of kernel-mode traps that pass through the KDB trap handler
  but do not actually invoke KDB. This includes recoverable machine checks
  encountered in kernel mode.
  
  This patch causes machines with Grackle host-PCI bridges to be able to
  correctly enumerate them again.
  
  Reviewed by:	marcel
  Approved by:	re

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/powerpc/powerpc/trap_subr.S

Modified: stable/7/sys/powerpc/powerpc/trap_subr.S
==============================================================================
--- stable/7/sys/powerpc/powerpc/trap_subr.S	Mon Apr 13 13:51:53 2009	(r191000)
+++ stable/7/sys/powerpc/powerpc/trap_subr.S	Mon Apr 13 14:15:36 2009	(r191001)
@@ -539,7 +539,7 @@ dbtrap:
 	mflr	%r28
 	mfcr	%r29
 	lwz	%r31,(PC_DBSAVE+CPUSAVE_R31)(%r1)
-	mtlr	%r31
+	mtsprg3	%r31			/* SPRG3 was clobbered by FRAME_LEAVE */
 	mfsprg1	%r1
 	b	realtrap
 dbleave:

From owner-svn-src-stable-7@FreeBSD.ORG  Mon Apr 13 14:25:36 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B0E0510656C5;
	Mon, 13 Apr 2009 14:25:36 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D6658FC24;
	Mon, 13 Apr 2009 14:25:36 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DEPaom074281;
	Mon, 13 Apr 2009 14:25:36 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DEPaBq074280;
	Mon, 13 Apr 2009 14:25:36 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <200904131425.n3DEPaBq074280@svn.freebsd.org>
From: David Xu 
Date: Mon, 13 Apr 2009 14:25:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191002 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb kern
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 13 Apr 2009 14:25:37 -0000

Author: davidxu
Date: Mon Apr 13 14:25:36 2009
New Revision: 191002
URL: http://svn.freebsd.org/changeset/base/191002

Log:
  MFC r190987 from head to stable/7:
  
      Make UMTX_OP_WAIT_UINT actually wait for an unsigned integer on 64-bits
      machine.
  
  Approved by:    re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/kern_umtx.c

Modified: stable/7/sys/kern/kern_umtx.c
==============================================================================
--- stable/7/sys/kern/kern_umtx.c	Mon Apr 13 14:15:36 2009	(r191001)
+++ stable/7/sys/kern/kern_umtx.c	Mon Apr 13 14:25:36 2009	(r191002)
@@ -975,7 +975,7 @@ do_wait(struct thread *td, void *addr, u
 	if (compat32 == 0)
 		tmp = fuword(addr);
         else
-		tmp = fuword32(addr);
+		tmp = (unsigned int)fuword32(addr);
 	if (tmp != id) {
 		umtxq_lock(&uq->uq_key);
 		umtxq_remove(uq);

From owner-svn-src-stable-7@FreeBSD.ORG  Mon Apr 13 20:19:28 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAE7F106566C;
	Mon, 13 Apr 2009 20:19:28 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C96BA8FC15;
	Mon, 13 Apr 2009 20:19:28 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DKJS2n082384;
	Mon, 13 Apr 2009 20:19:28 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DKJS5G082383;
	Mon, 13 Apr 2009 20:19:28 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <200904132019.n3DKJS5G082383@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Mon, 13 Apr 2009 20:19:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191014 - stable/7/usr.sbin/ppp
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 13 Apr 2009 20:19:30 -0000

Author: bz
Date: Mon Apr 13 20:19:28 2009
New Revision: 191014
URL: http://svn.freebsd.org/changeset/base/191014

Log:
  MFC r186308 by qingli:
  
    The ppp application relies on the if_tun interface to properly
    install a ptp host route between the end points. The ppp module
    upates this router based on user configuration later on. The
    rt_Update() seems to always set the RTF_GATEWAY flag, which is
    broken.
  
  PR:		bin/130159
  Approved by:	re (kensmith)

Modified:
  stable/7/usr.sbin/ppp/   (props changed)
  stable/7/usr.sbin/ppp/route.c

Modified: stable/7/usr.sbin/ppp/route.c
==============================================================================
--- stable/7/usr.sbin/ppp/route.c	Mon Apr 13 19:54:33 2009	(r191013)
+++ stable/7/usr.sbin/ppp/route.c	Mon Apr 13 20:19:28 2009	(r191014)
@@ -902,8 +902,10 @@ rt_Update(struct bundle *bundle, const s
     p += memcpy_roundup(p, dst, dst->sa_len);
   }
 
-  rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY;
+  if (gw != NULL && (gw->sa_family != AF_LINK))
+    rtmes.m_rtm.rtm_addrs |= RTA_GATEWAY;
   p += memcpy_roundup(p, gw, gw->sa_len);
+
   if (mask) {
     rtmes.m_rtm.rtm_addrs |= RTA_NETMASK;
     p += memcpy_roundup(p, mask, mask->sa_len);

From owner-svn-src-stable-7@FreeBSD.ORG  Mon Apr 13 22:17:03 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EADC5106566B;
	Mon, 13 Apr 2009 22:17:03 +0000 (UTC)
	(envelope-from mlaier@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BDCFD8FC13;
	Mon, 13 Apr 2009 22:17:03 +0000 (UTC)
	(envelope-from mlaier@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3DMH3Fw085162;
	Mon, 13 Apr 2009 22:17:03 GMT (envelope-from mlaier@svn.freebsd.org)
Received: (from mlaier@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3DMH3no085161;
	Mon, 13 Apr 2009 22:17:03 GMT (envelope-from mlaier@svn.freebsd.org)
Message-Id: <200904132217.n3DMH3no085161@svn.freebsd.org>
From: Max Laier 
Date: Mon, 13 Apr 2009 22:17:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191025 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb net
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Mon, 13 Apr 2009 22:17:04 -0000

Author: mlaier
Date: Mon Apr 13 22:17:03 2009
New Revision: 191025
URL: http://svn.freebsd.org/changeset/base/191025

Log:
  MFH r190903 & r190895:
    Remove interfaces from interface groups on detach.
  
  Reported by:	various
  Submitted by:	Mikolaj Golub (r190895)
  PR:		kern/130977, kern/131310
  Approved by:	re (gnn)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/net/if.c

Modified: stable/7/sys/net/if.c
==============================================================================
--- stable/7/sys/net/if.c	Mon Apr 13 21:04:53 2009	(r191024)
+++ stable/7/sys/net/if.c	Mon Apr 13 22:17:03 2009	(r191025)
@@ -128,6 +128,7 @@ static void	if_start_deferred(void *cont
 static void	do_link_state_change(void *, int);
 static int	if_getgroup(struct ifgroupreq *, struct ifnet *);
 static int	if_getgroupmembers(struct ifgroupreq *);
+static void	if_delgroups(struct ifnet *);
 #ifdef INET6
 /*
  * XXX: declare here to avoid to include many inet6 related files..
@@ -828,6 +829,7 @@ if_detach(struct ifnet *ifp)
 	rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
 	EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
 	devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL);
+	if_delgroups(ifp);
 
 	IF_AFDATA_LOCK(ifp);
 	for (dp = domains; dp; dp = dp->dom_next) {
@@ -963,6 +965,53 @@ if_delgroup(struct ifnet *ifp, const cha
 }
 
 /*
+ * Remove an interface from all groups
+ */
+static void
+if_delgroups(struct ifnet *ifp)
+{
+	struct ifg_list		*ifgl;
+	struct ifg_member	*ifgm;
+	char groupname[IFNAMSIZ];
+
+	IFNET_WLOCK();
+	while (!TAILQ_EMPTY(&ifp->if_groups)) {
+		ifgl = TAILQ_FIRST(&ifp->if_groups);
+
+		strlcpy(groupname, ifgl->ifgl_group->ifg_group, IFNAMSIZ);
+
+		IF_ADDR_LOCK(ifp);
+		TAILQ_REMOVE(&ifp->if_groups, ifgl, ifgl_next);
+		IF_ADDR_UNLOCK(ifp);
+
+		TAILQ_FOREACH(ifgm, &ifgl->ifgl_group->ifg_members, ifgm_next)
+			if (ifgm->ifgm_ifp == ifp)
+				break;
+
+		if (ifgm != NULL) {
+			TAILQ_REMOVE(&ifgl->ifgl_group->ifg_members, ifgm,
+			    ifgm_next);
+			free(ifgm, M_TEMP);
+		}
+
+		if (--ifgl->ifgl_group->ifg_refcnt == 0) {
+			TAILQ_REMOVE(&ifg_head, ifgl->ifgl_group, ifg_next);
+			EVENTHANDLER_INVOKE(group_detach_event,
+			    ifgl->ifgl_group);
+			free(ifgl->ifgl_group, M_TEMP);
+		}
+		IFNET_WUNLOCK();
+
+		free(ifgl, M_TEMP);
+
+		EVENTHANDLER_INVOKE(group_change_event, groupname);
+
+		IFNET_WLOCK();
+	}
+	IFNET_WUNLOCK();
+}
+
+/*
  * Stores all groups from an interface in memory pointed
  * to by data
  */

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Apr 14 00:23:14 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1E586106566C;
	Tue, 14 Apr 2009 00:23:14 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A6258FC16;
	Tue, 14 Apr 2009 00:23:14 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E0NEEw088344;
	Tue, 14 Apr 2009 00:23:14 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E0NDiT088341;
	Tue, 14 Apr 2009 00:23:13 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <200904140023.n3E0NDiT088341@svn.freebsd.org>
From: Jack F Vogel 
Date: Tue, 14 Apr 2009 00:23:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191030 - stable/7/sys/dev/ixgbe
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Apr 2009 00:23:14 -0000

Author: jfv
Date: Tue Apr 14 00:23:13 2009
New Revision: 191030
URL: http://svn.freebsd.org/changeset/base/191030

Log:
  MFC ixgbe version 1.7.4 for FreeBSD 7.2, this is earlier
  than planned but coordinated with and approved by RE.
  
  Most important reason for this was so that FreeBSD 7.2
  will have native support for the 82599 controller which
  is part of the Nehalem launch.
  
  The driver now does pluggable optics, multispeed fiber,
  and header split. I am adding this to the GENERIC kernel
  only in the amd64 architecture since its where I expect
  most use and others were untested.
  
  Enjoy!
  
  Approved by: re

Added:
  stable/7/sys/dev/ixgbe/ixgbe_82599.c   (contents, props changed)
Modified:
  stable/7/sys/dev/ixgbe/LICENSE
  stable/7/sys/dev/ixgbe/ixgbe.c
  stable/7/sys/dev/ixgbe/ixgbe.h
  stable/7/sys/dev/ixgbe/ixgbe_82598.c
  stable/7/sys/dev/ixgbe/ixgbe_api.c
  stable/7/sys/dev/ixgbe/ixgbe_api.h
  stable/7/sys/dev/ixgbe/ixgbe_common.c
  stable/7/sys/dev/ixgbe/ixgbe_common.h
  stable/7/sys/dev/ixgbe/ixgbe_osdep.h
  stable/7/sys/dev/ixgbe/ixgbe_phy.c
  stable/7/sys/dev/ixgbe/ixgbe_phy.h
  stable/7/sys/dev/ixgbe/ixgbe_type.h

Modified: stable/7/sys/dev/ixgbe/LICENSE
==============================================================================
--- stable/7/sys/dev/ixgbe/LICENSE	Mon Apr 13 23:50:44 2009	(r191029)
+++ stable/7/sys/dev/ixgbe/LICENSE	Tue Apr 14 00:23:13 2009	(r191030)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2008, Intel Corporation 
+  Copyright (c) 2001-2009, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 

Modified: stable/7/sys/dev/ixgbe/ixgbe.c
==============================================================================
--- stable/7/sys/dev/ixgbe/ixgbe.c	Mon Apr 13 23:50:44 2009	(r191029)
+++ stable/7/sys/dev/ixgbe/ixgbe.c	Tue Apr 14 00:23:13 2009	(r191030)
@@ -1,6 +1,6 @@
 /******************************************************************************
 
-  Copyright (c) 2001-2008, Intel Corporation 
+  Copyright (c) 2001-2009, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -46,7 +46,7 @@ int             ixgbe_display_debug_stat
 /*********************************************************************
  *  Driver version
  *********************************************************************/
-char ixgbe_driver_version[] = "1.6.2";
+char ixgbe_driver_version[] = "1.7.4";
 
 /*********************************************************************
  *  PCI Device ID Table
@@ -71,6 +71,8 @@ static ixgbe_vendor_info_t ixgbe_vendor_
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT, 0, 0, 0},
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM, 0, 0, 0},
 	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_SFP_LOM, 0, 0, 0},
+	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4, 0, 0, 0},
+	{IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP, 0, 0, 0},
 	/* required last entry */
 	{0, 0, 0, 0, 0}
 };
@@ -104,7 +106,9 @@ static int      ixgbe_allocate_pci_resou
 static int      ixgbe_allocate_msix(struct adapter *);
 static int      ixgbe_allocate_legacy(struct adapter *);
 static int	ixgbe_allocate_queues(struct adapter *);
+#if __FreeBSD_version >= 602105
 static int	ixgbe_setup_msix(struct adapter *);
+#endif
 static void	ixgbe_free_pci_resources(struct adapter *);
 static void     ixgbe_local_timer(void *);
 static int      ixgbe_hardware_init(struct adapter *);
@@ -124,6 +128,7 @@ static void     ixgbe_initialize_receive
 static void     ixgbe_free_receive_structures(struct adapter *);
 static void     ixgbe_free_receive_buffers(struct rx_ring *);
 
+static void	ixgbe_init_moderation(struct adapter *);
 static void     ixgbe_enable_intr(struct adapter *);
 static void     ixgbe_disable_intr(struct adapter *);
 static void     ixgbe_update_stats_counters(struct adapter *);
@@ -146,7 +151,7 @@ static int	ixgbe_dma_malloc(struct adapt
 static void     ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *);
 static void	ixgbe_add_rx_process_limit(struct adapter *, const char *,
 		    const char *, int *, int);
-static boolean_t ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *);
+static int	ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *);
 static boolean_t ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *);
 static void	ixgbe_set_ivar(struct adapter *, u16, u8, s8);
 static void	ixgbe_configure_ivars(struct adapter *);
@@ -157,6 +162,12 @@ static void	ixgbe_register_vlan(void *, 
 static void	ixgbe_unregister_vlan(void *, struct ifnet *, u16);
 #endif
 
+#ifdef IXGBE_TIMESYNC
+/* Precision Time sync support */
+static int ixgbe_tsync_init(struct adapter *);
+static void ixgbe_tsync_disable(struct adapter *);
+#endif
+
 static void	ixgbe_update_aim(struct rx_ring *);
 
 /* Support for pluggable optic modules */
@@ -165,14 +176,19 @@ static bool	ixgbe_sfp_probe(struct adapt
 /* Legacy (single vector interrupt handler */
 static void	ixgbe_legacy_irq(void *);
 
+#if __FreeBSD_version >= 602105
 /* The MSI/X Interrupt handlers */
 static void	ixgbe_msix_tx(void *);
 static void	ixgbe_msix_rx(void *);
 static void	ixgbe_msix_link(void *);
+#endif
 
-/* Legacy interrupts use deferred handlers */
-static void	ixgbe_handle_tx(void *context, int pending);
-static void	ixgbe_handle_rx(void *context, int pending);
+/* Deferred interrupt tasklets */
+static void	ixgbe_handle_tx(void *, int);
+static void	ixgbe_handle_rx(void *, int);
+static void	ixgbe_handle_link(void *, int);
+static void	ixgbe_handle_msf(void *, int);
+static void	ixgbe_handle_mod(void *, int);
 
 
 /*********************************************************************
@@ -213,8 +229,8 @@ static int ixgbe_enable_aim = TRUE;
 TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim);
 static int ixgbe_low_latency = IXGBE_LOW_LATENCY;
 TUNABLE_INT("hw.ixgbe.low_latency", &ixgbe_low_latency);
-static int ixgbe_ave_latency = IXGBE_LOW_LATENCY;
-TUNABLE_INT("hw.ixgbe.ave_latency", &ixgbe_low_latency);
+static int ixgbe_ave_latency = IXGBE_AVE_LATENCY;
+TUNABLE_INT("hw.ixgbe.ave_latency", &ixgbe_ave_latency);
 static int ixgbe_bulk_latency = IXGBE_BULK_LATENCY;
 TUNABLE_INT("hw.ixgbe.bulk_latency", &ixgbe_bulk_latency);
 
@@ -222,8 +238,8 @@ TUNABLE_INT("hw.ixgbe.bulk_latency", &ix
 static int ixgbe_rx_process_limit = 100;
 TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit);
 
-/* Flow control setting, default to full */
-static int ixgbe_flow_control = ixgbe_fc_none;
+/* Flow control setting, default to off */
+static int ixgbe_flow_control = ixgbe_fc_full;
 TUNABLE_INT("hw.ixgbe.flow_control", &ixgbe_flow_control);
 
 /*
@@ -239,11 +255,16 @@ TUNABLE_INT("hw.ixgbe.enable_lro", &ixgb
  * MSIX should be the default for best performance,
  * but this allows it to be forced off for testing.
  */
+#if __FreeBSD_version >= 602105
 static int ixgbe_enable_msix = 1;
+#else
+static int ixgbe_enable_msix = 0;
+#endif
 TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix);
 
 /*
  * Enable RX Header Split
+ *   WARNING: disable this if bridging or forwarding!!
  */
 static int ixgbe_rx_hdr_split = 1;
 TUNABLE_INT("hw.ixgbe.rx_hdr_split", &ixgbe_rx_hdr_split);
@@ -268,6 +289,13 @@ TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd);
 /* Total number of Interfaces - need for config sanity check */
 static int ixgbe_total_ports;
 
+/*
+** The number of scatter-gather segments
+** differs for 82598 and 82599, default to
+** the former.
+*/
+static int ixgbe_num_segs = IXGBE_82598_SCATTER;
+
 /*********************************************************************
  *  Device identification routine
  *
@@ -312,6 +340,7 @@ ixgbe_probe(device_t dev)
 				ixgbe_strings[ent->index],
 				ixgbe_driver_version);
 			device_set_desc_copy(dev, adapter_name);
+			++ixgbe_total_ports;
 			return (0);
 		}
 		ent++;
@@ -333,6 +362,7 @@ static int
 ixgbe_attach(device_t dev)
 {
 	struct adapter *adapter;
+	struct ixgbe_hw *hw;
 	int             error = 0;
 	u16		pci_device_id;
 	u32		ctrl_ext;
@@ -342,37 +372,34 @@ ixgbe_attach(device_t dev)
 	/* Allocate, clear, and link in our adapter structure */
 	adapter = device_get_softc(dev);
 	adapter->dev = adapter->osdep.dev = dev;
+	hw = &adapter->hw;
 
 	/* Core Lock Init*/
 	IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev));
 
-	/* Keep track of number of ports and optics */
+	/* Keep track of optics */
 	pci_device_id = pci_get_device(dev);
 	switch (pci_device_id) {
 		case IXGBE_DEV_ID_82598_CX4_DUAL_PORT :
+		case IXGBE_DEV_ID_82598EB_CX4 :
 			adapter->optics = IFM_10G_CX4;
-			ixgbe_total_ports += 2;
 			break;
 		case IXGBE_DEV_ID_82598AF_DUAL_PORT :
-			adapter->optics = IFM_10G_SR;
-			ixgbe_total_ports += 2;
-			break;
+		case IXGBE_DEV_ID_82598_DA_DUAL_PORT :
 		case IXGBE_DEV_ID_82598AF_SINGLE_PORT :
+		case IXGBE_DEV_ID_82598AT :
 			adapter->optics = IFM_10G_SR;
-			ixgbe_total_ports += 1;
 			break;
 		case IXGBE_DEV_ID_82598EB_XF_LR :
 			adapter->optics = IFM_10G_LR;
-			ixgbe_total_ports += 1;
 			break;
-		case IXGBE_DEV_ID_82598EB_CX4 :
-			adapter->optics = IFM_10G_CX4;
-			ixgbe_total_ports += 1;
+		case IXGBE_DEV_ID_82599_SFP :
+			adapter->optics = IFM_10G_SR;
+			ixgbe_num_segs = IXGBE_82599_SCATTER;
 			break;
-		case IXGBE_DEV_ID_82598AT :
-			ixgbe_total_ports += 1;
-		case IXGBE_DEV_ID_82598_DA_DUAL_PORT :
-			ixgbe_total_ports += 2;
+		case IXGBE_DEV_ID_82599_KX4 :
+			adapter->optics = IFM_10G_CX4;
+			ixgbe_num_segs = IXGBE_82599_SCATTER;
 		default:
 			break;
 	}
@@ -474,7 +501,7 @@ ixgbe_attach(device_t dev)
 	}
 
 	/* Initialize the shared code */
-	error = ixgbe_init_shared_code(&adapter->hw);
+	error = ixgbe_init_shared_code(hw);
 	if (error == IXGBE_ERR_SFP_NOT_PRESENT) {
 		/*
 		** No optics in this port, set up
@@ -525,11 +552,11 @@ ixgbe_attach(device_t dev)
 	adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig,
 	    ixgbe_unregister_vlan, 0, EVENTHANDLER_PRI_FIRST);
 #endif
-                
+
 	/* let hardware know driver is loaded */
-	ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT);
+	ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
 	ctrl_ext |= IXGBE_CTRL_EXT_DRV_LOAD;
-	IXGBE_WRITE_REG(&adapter->hw, IXGBE_CTRL_EXT, ctrl_ext);
+	IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext);
 
 	INIT_DEBUGOUT("ixgbe_attach: end");
 	return (0);
@@ -590,6 +617,14 @@ ixgbe_detach(device_t dev)
 		}
 	}
 
+	/* Drain the Link queue */
+	if (adapter->tq) {
+		taskqueue_drain(adapter->tq, &adapter->link_task);
+		taskqueue_drain(adapter->tq, &adapter->mod_task);
+		taskqueue_drain(adapter->tq, &adapter->msf_task);
+		taskqueue_free(adapter->tq);
+	}
+
 	/* let hardware know driver is unloading */
 	ctrl_ext = IXGBE_READ_REG(&adapter->hw, IXGBE_CTRL_EXT);
 	ctrl_ext &= ~IXGBE_CTRL_EXT_DRV_LOAD;
@@ -662,6 +697,19 @@ ixgbe_start_locked(struct tx_ring *txr, 
 		IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
 		if (m_head == NULL)
 			break;
+		/*
+		 * Force a cleanup if number of TX descriptors
+		 * available is below the threshold. If it fails
+		 * to get above, then abort transmit.
+		 */
+		if (txr->tx_avail <= IXGBE_TX_CLEANUP_THRESHOLD) {
+			ixgbe_txeof(txr);
+			/* Make sure things have improved */
+			if (txr->tx_avail <= IXGBE_TX_OP_THRESHOLD) {
+				txr->no_tx_desc_avail++;
+				break;
+			}
+		}
 
 		if (ixgbe_xmit(txr, &m_head)) {
 			if (m_head == NULL)
@@ -701,7 +749,8 @@ ixgbe_start(struct ifnet *ifp)
 	txr = &adapter->tx_rings[queue];
 
 	if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
-		IXGBE_TX_LOCK(txr);
+		if (IXGBE_TX_TRYLOCK(txr) == 0)
+			return;
 		ixgbe_start_locked(txr, ifp);
 		IXGBE_TX_UNLOCK(txr);
 	}
@@ -803,6 +852,67 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
 #endif
 		break;
 	}
+#ifdef IXGBE_TIMESYNC
+	/*
+	** IOCTL support for Precision Time (IEEE 1588) Support
+	*/
+	case IXGBE_TIMESYNC_READTS:
+	    {
+		u32 rx_ctl, tx_ctl;
+		struct ixgbe_tsync_read *tdata;
+
+		tdata = (struct ixgbe_tsync_read *) ifr->ifr_data;
+
+		if (tdata->read_current_time) {
+                        getnanotime(&tdata->system_time);
+                        tdata->network_time = IXGBE_READ_REG(&adapter->hw,
+                            IXGBE_SYSTIML);
+                        tdata->network_time |=
+                            (u64)IXGBE_READ_REG(&adapter->hw,
+                            IXGBE_SYSTIMH ) << 32;
+		}
+  
+		rx_ctl = IXGBE_READ_REG(&adapter->hw, IXGBE_TSYNCRXCTL);
+		tx_ctl = IXGBE_READ_REG(&adapter->hw, IXGBE_TSYNCTXCTL);
+ 
+		if (rx_ctl & 0x1) {
+			u32 tmp;
+			unsigned char *tmp_cp;
+
+			tdata->rx_valid = 1;
+			tdata->rx_stamp = IXGBE_READ_REG(&adapter->hw,
+			    IXGBE_RXSTMPL);
+			tdata->rx_stamp |= (u64)IXGBE_READ_REG(&adapter->hw,
+                            IXGBE_RXSTMPH) << 32;
+
+			tmp = IXGBE_READ_REG(&adapter->hw, IXGBE_RXSATRL);
+			tmp_cp = (unsigned char *) &tmp;
+			tdata->srcid[0] = tmp_cp[0];
+			tdata->srcid[1] = tmp_cp[1];
+			tdata->srcid[2] = tmp_cp[2];
+			tdata->srcid[3] = tmp_cp[3];
+			tmp = IXGBE_READ_REG(&adapter->hw, IXGBE_RXSATRH);
+			tmp_cp = (unsigned char *) &tmp;
+			tdata->srcid[4] = tmp_cp[0];
+			tdata->srcid[5] = tmp_cp[1];
+			tdata->seqid = tmp >> 16;
+			tdata->seqid = htons(tdata->seqid);
+		} else
+                        tdata->rx_valid = 0;
+
+		if (tx_ctl & 0x1) {
+			tdata->tx_valid = 1;
+			tdata->tx_stamp = IXGBE_READ_REG(&adapter->hw,
+			    IXGBE_TXSTMPL);
+			tdata->tx_stamp |= (u64) IXGBE_READ_REG(&adapter->hw,
+			    IXGBE_TXSTMPH) << 32;
+		} else
+			tdata->tx_valid = 0;
+
+		return (0);
+	    }
+#endif  /* IXGBE_TIMESYNC */
+
 	default:
 		IOCTL_DEBUGOUT1("ioctl: UNKNOWN (0x%X)\n", (int)command);
 		error = ether_ioctl(ifp, command, data);
@@ -905,13 +1015,12 @@ ixgbe_watchdog(struct adapter *adapter)
 static void
 ixgbe_init_locked(struct adapter *adapter)
 {
-	struct rx_ring *rxr = adapter->rx_rings;
-	struct tx_ring *txr = adapter->tx_rings;
 	struct ifnet   *ifp = adapter->ifp;
 	device_t 	dev = adapter->dev;
 	struct ixgbe_hw *hw;
 	u32		k, txdctl, mhadd, gpie;
 	u32		rxdctl, rxctrl;
+	int		err;
 
 	INIT_DEBUGOUT("ixgbe_init: begin");
 
@@ -951,13 +1060,6 @@ ixgbe_init_locked(struct adapter *adapte
 
 	ixgbe_initialize_transmit_units(adapter);
 
-	/* TX irq moderation rate is fixed */
-	for (int i = 0; i < adapter->num_tx_queues; i++, txr++) {
-		IXGBE_WRITE_REG(&adapter->hw,
-		    IXGBE_EITR(txr->msix), ixgbe_ave_latency);
-		txr->watchdog_timer = FALSE;
-	}
-
 	/* Setup Multicast table */
 	ixgbe_set_multi(adapter);
 
@@ -980,23 +1082,21 @@ ixgbe_init_locked(struct adapter *adapte
 	/* Configure RX settings */
 	ixgbe_initialize_receive_units(adapter);
 
-	/* RX moderation will be adapted over time, set default */
-	for (int i = 0; i < adapter->num_rx_queues; i++, rxr++) {
-		IXGBE_WRITE_REG(&adapter->hw,
-		    IXGBE_EITR(rxr->msix), ixgbe_low_latency);
-	}
-
-	/* Set Link moderation */
-	IXGBE_WRITE_REG(&adapter->hw,
-	    IXGBE_EITR(adapter->linkvec), IXGBE_LINK_ITR);
+	/* Configure Interrupt Moderation */
+	ixgbe_init_moderation(adapter);
 
 	gpie = IXGBE_READ_REG(&adapter->hw, IXGBE_GPIE);
 
+	if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
+		gpie |= IXGBE_SDP1_GPIEN;
+		gpie |= IXGBE_SDP2_GPIEN;
+	}
+
 	/* Enable Fan Failure Interrupt */
-	if (adapter->hw.phy.media_type == ixgbe_media_type_copper)
+	if (hw->device_id == IXGBE_DEV_ID_82598AT)
 		gpie |= IXGBE_SDP1_GPIEN;
 
-	if (adapter->msix) {
+	if (adapter->msix > 2) {
 		/* Enable Enhanced MSIX mode */
 		gpie |= IXGBE_GPIE_MSIX_MODE;
 		gpie |= IXGBE_GPIE_EIAME | IXGBE_GPIE_PBA_SUPPORT |
@@ -1058,9 +1158,40 @@ ixgbe_init_locked(struct adapter *adapte
 	/* Set up MSI/X routing */
 	if (ixgbe_enable_msix)
 		ixgbe_configure_ivars(adapter);
+	else {	/* Simple settings for Legacy/MSI */
+                ixgbe_set_ivar(adapter, 0, 0, 0);
+                ixgbe_set_ivar(adapter, 0, 0, 1);
+	}
 
 	ixgbe_enable_intr(adapter);
 
+	/*
+	** Check on any SFP devices that
+	** need to be kick-started
+	*/
+	err = hw->phy.ops.identify(hw);
+	if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
+                device_printf(dev,
+		    "Unsupported SFP+ module type was detected.\n");
+		ixgbe_detach(dev);
+		return;
+        }
+	if (ixgbe_is_sfp(hw)) { 
+		if (hw->phy.multispeed_fiber) {
+			hw->mac.ops.setup_sfp(hw);
+			taskqueue_enqueue(adapter->tq, &adapter->msf_task);
+		} else
+			taskqueue_enqueue(adapter->tq, &adapter->mod_task);
+	} else
+		taskqueue_enqueue(adapter->tq, &adapter->link_task);
+
+
+#ifdef IXGBE_TIMESYNC
+	/* Initialize IEEE 1588 support */
+	if (adapter->hw.mac.type == ixgbe_mac_82599EB)
+		ixgbe_tsync_init(adapter);
+#endif
+
 	/* Now inform the stack we're ready */
 	ifp->if_drv_flags |= IFF_DRV_RUNNING;
 	ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
@@ -1081,7 +1212,7 @@ ixgbe_init(void *arg)
 
 
 /*
-** MSIX Interrupt Handlers
+** MSIX Interrupt Tasklets
 */
 
 static void
@@ -1136,7 +1267,8 @@ ixgbe_legacy_irq(void *arg)
 	struct ixgbe_hw	*hw = &adapter->hw;
 	struct 		tx_ring *txr = adapter->tx_rings;
 	struct		rx_ring *rxr = adapter->rx_rings;
-	u32       	reg_eicr;
+	bool		more;
+	u32       	reg_eicr, loop = MAX_LOOP;
 
 
 	reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
@@ -1148,7 +1280,15 @@ ixgbe_legacy_irq(void *arg)
 
 	if (ixgbe_rxeof(rxr, adapter->rx_process_limit))
 		taskqueue_enqueue(rxr->tq, &rxr->rx_task);
-	if (ixgbe_txeof(txr))
+
+	IXGBE_TX_LOCK(txr);
+	++txr->tx_irq;
+	do {
+		more = ixgbe_txeof(txr);
+	} while (loop-- && more);
+	IXGBE_TX_UNLOCK(txr);
+
+	if (more)
 		taskqueue_enqueue(txr->tq, &txr->tx_task);
 
 	/* Check for fan failure */
@@ -1160,20 +1300,27 @@ ixgbe_legacy_irq(void *arg)
 	}
 
 	/* Link status change */
-	if (reg_eicr & IXGBE_EICR_LSC)
+	if (reg_eicr & IXGBE_EICR_LSC) {
+		ixgbe_check_link(&adapter->hw,
+		    &adapter->link_speed, &adapter->link_up, 0);
         	ixgbe_update_link_status(adapter);
+	}
+
+	/* Update interrupt rate */
+	if (ixgbe_enable_aim == TRUE)
+		ixgbe_update_aim(rxr);
 
 	ixgbe_enable_intr(adapter);
 	return;
 }
 
 
+#if __FreeBSD_version >= 602105
 /*********************************************************************
  *
  *  MSI TX Interrupt Service routine
  *
  **********************************************************************/
-
 void
 ixgbe_msix_tx(void *arg)
 {
@@ -1181,6 +1328,8 @@ ixgbe_msix_tx(void *arg)
 	struct adapter  *adapter = txr->adapter;
 	bool		more;
 
+	IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, txr->eims);
+
 	IXGBE_TX_LOCK(txr);
 	++txr->tx_irq;
 	more = ixgbe_txeof(txr);
@@ -1198,7 +1347,6 @@ ixgbe_msix_tx(void *arg)
  *  MSIX RX Interrupt Service routine
  *
  **********************************************************************/
-
 static void
 ixgbe_msix_rx(void *arg)
 {
@@ -1206,18 +1354,72 @@ ixgbe_msix_rx(void *arg)
 	struct adapter  *adapter = rxr->adapter;
 	bool		more;
 
+       	IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, rxr->eims);
+
 	++rxr->rx_irq;
-	more = ixgbe_rxeof(rxr, -1);
+	more = ixgbe_rxeof(rxr, adapter->rx_process_limit);
+
+	/* Update interrupt rate */
+	if (ixgbe_enable_aim == TRUE)
+		ixgbe_update_aim(rxr);
+
 	if (more)
 		taskqueue_enqueue(rxr->tq, &rxr->rx_task);
 	else
         	IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, rxr->eims);
-	/* Update interrupt rate */
-	if (ixgbe_enable_aim == TRUE)
-		ixgbe_update_aim(rxr);
 	return;
 }
 
+
+static void
+ixgbe_msix_link(void *arg)
+{
+	struct adapter	*adapter = arg;
+	struct ixgbe_hw *hw = &adapter->hw;
+	u32		reg_eicr;
+
+	++adapter->link_irq;
+
+	/* First get the cause */
+	IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, IXGBE_EIMS_OTHER);
+	reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICS);
+	/* Clear with write */
+	IXGBE_WRITE_REG(hw, IXGBE_EICR, reg_eicr);
+
+	/* Link status change */
+	if (reg_eicr & IXGBE_EICR_LSC)
+		taskqueue_enqueue(adapter->tq, &adapter->link_task);
+
+	if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
+		if (reg_eicr & IXGBE_EICR_ECC) {
+                	device_printf(adapter->dev, "\nCRITICAL: ECC ERROR!! "
+			    "Please Reboot!!\n");
+			IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_ECC);
+		}
+		if (reg_eicr & IXGBE_EICR_GPI_SDP1) {
+                	/* Clear the interrupt */
+                	IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1);
+			taskqueue_enqueue(adapter->tq, &adapter->msf_task);
+        	} else if (reg_eicr & IXGBE_EICR_GPI_SDP2) {
+                	/* Clear the interrupt */
+                	IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP2);
+			taskqueue_enqueue(adapter->tq, &adapter->mod_task);
+		}
+        } 
+
+	/* Check for fan failure */
+	if ((hw->device_id == IXGBE_DEV_ID_82598AT) &&
+	    (reg_eicr & IXGBE_EICR_GPI_SDP1)) {
+                device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! "
+		    "REPLACE IMMEDIATELY!!\n");
+		IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1);
+	}
+
+	IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
+	return;
+}
+#endif /* FreeBSD_version >= 602105 */
+
 /*
 ** Routine to do adjust the RX EITR value based on traffic,
 ** its a simple three state model, but seems to help.
@@ -1267,33 +1469,36 @@ ixgbe_update_aim(struct rx_ring *rxr)
 	return;
 }
 
-
 static void
-ixgbe_msix_link(void *arg)
+ixgbe_init_moderation(struct adapter *adapter)
 {
-	struct adapter	*adapter = arg;
-	struct ixgbe_hw *hw = &adapter->hw;
-	u32		reg_eicr;
-
-	++adapter->link_irq;
+	struct rx_ring *rxr = adapter->rx_rings;
+	struct tx_ring *txr = adapter->tx_rings;
 
-	reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
+	/* Single interrupt - MSI or Legacy? */
+	if (adapter->msix < 2) {
+		IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(0), 100);
+		return;
+	}
 
-	if (reg_eicr & IXGBE_EICR_LSC)
-        	ixgbe_update_link_status(adapter);
+	/* TX irq moderation rate is fixed */
+	for (int i = 0; i < adapter->num_tx_queues; i++, txr++) {
+		IXGBE_WRITE_REG(&adapter->hw,
+		    IXGBE_EITR(txr->msix), ixgbe_ave_latency);
+		txr->watchdog_timer = FALSE;
+	}
 
-	/* Check for fan failure */
-	if ((hw->phy.media_type == ixgbe_media_type_copper) &&
-	    (reg_eicr & IXGBE_EICR_GPI_SDP1)) {
-                device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! "
-		    "REPLACE IMMEDIATELY!!\n");
-		IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EICR_GPI_SDP1);
+	/* RX moderation will be adapted over time, set default */
+	for (int i = 0; i < adapter->num_rx_queues; i++, rxr++) {
+		IXGBE_WRITE_REG(&adapter->hw,
+		    IXGBE_EITR(rxr->msix), ixgbe_low_latency);
 	}
 
-	IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
-	return;
-}
+	/* Set Link moderation */
+	IXGBE_WRITE_REG(&adapter->hw,
+	    IXGBE_EITR(adapter->linkvec), IXGBE_LINK_ITR);
 
+}
 
 /*********************************************************************
  *
@@ -1382,12 +1587,12 @@ static int
 ixgbe_xmit(struct tx_ring *txr, struct mbuf **m_headp)
 {
 	struct adapter  *adapter = txr->adapter;
-	u32		olinfo_status = 0, cmd_type_len = 0;
+	u32		olinfo_status = 0, cmd_type_len;
 	u32		paylen = 0;
 	int             i, j, error, nsegs;
-	int		first, last = 0;
+	int		first, last = 0, offload = 0;
 	struct mbuf	*m_head;
-	bus_dma_segment_t segs[IXGBE_MAX_SCATTER];
+	bus_dma_segment_t segs[ixgbe_num_segs];
 	bus_dmamap_t	map;
 	struct ixgbe_tx_buf *txbuf, *txbuf_mapped;
 	union ixgbe_adv_tx_desc *txd = NULL;
@@ -1395,26 +1600,12 @@ ixgbe_xmit(struct tx_ring *txr, struct m
 	m_head = *m_headp;
 
 	/* Basic descriptor defines */
-        cmd_type_len |= IXGBE_ADVTXD_DTYP_DATA;
-        cmd_type_len |= IXGBE_ADVTXD_DCMD_IFCS | IXGBE_ADVTXD_DCMD_DEXT;
+        cmd_type_len = (IXGBE_ADVTXD_DTYP_DATA |
+	    IXGBE_ADVTXD_DCMD_IFCS | IXGBE_ADVTXD_DCMD_DEXT);
 
 	if (m_head->m_flags & M_VLANTAG)
         	cmd_type_len |= IXGBE_ADVTXD_DCMD_VLE;
 
-	/*
-	 * Force a cleanup if number of TX descriptors
-	 * available is below the threshold. If it fails
-	 * to get above, then abort transmit.
-	 */
-	if (txr->tx_avail <= IXGBE_TX_CLEANUP_THRESHOLD) {
-		ixgbe_txeof(txr);
-		/* Make sure things have improved */
-		if (txr->tx_avail <= IXGBE_TX_OP_THRESHOLD) {
-			txr->no_tx_desc_avail++;
-			return (ENOBUFS);
-		}
-	}
-
         /*
          * Important to capture the first descriptor
          * used because it will contain the index of
@@ -1475,19 +1666,27 @@ ixgbe_xmit(struct tx_ring *txr, struct m
 	m_head = *m_headp;
 
 	/*
-	** Set the appropriate offload context
+	** Set up the appropriate offload context
 	** this becomes the first descriptor of 
 	** a packet.
 	*/
-	if (ixgbe_tso_setup(txr, m_head, &paylen)) {
-		cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE;
-		olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8;
-		olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8;
-		olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT;
-		++adapter->tso_tx;
-	} else if (ixgbe_tx_ctx_setup(txr, m_head))
+	if (m_head->m_pkthdr.csum_flags & CSUM_TSO) {
+		if (ixgbe_tso_setup(txr, m_head, &paylen)) {
+			cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE;
+			olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8;
 			olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8;
-
+			olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT;
+			++adapter->tso_tx;
+		} else
+			return (ENXIO);
+	} else /* Offloads other than TSO */
+		offload = ixgbe_tx_ctx_setup(txr, m_head);
+	if (offload == TRUE)
+		olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8;
+#ifdef IXGBE_TIMESYNC
+	if (offload == IXGBE_TIMESTAMP)
+		cmd_type_len |= IXGBE_ADVTXD_TSTAMP;
+#endif
         /* Record payload length */
 	if (paylen == 0)
         	olinfo_status |= m_head->m_pkthdr.len <<
@@ -1513,6 +1712,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m
 			i = 0;
 
 		txbuf->m_head = NULL;
+		txbuf->eop_index = -1;
 	}
 
 	txd->read.cmd_type_len |=
@@ -1526,6 +1726,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m
 
         /* Set the index of the descriptor that will be marked done */
         txbuf = &txr->tx_buffers[first];
+	txbuf->eop_index = last;
 
         bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map,
             BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
@@ -1685,17 +1886,20 @@ out:
 	callout_reset(&adapter->timer, hz, ixgbe_local_timer, adapter);
 }
 
+/*
+** Note: this routine updates the OS on the link state
+**	the real check of the hardware only happens with
+**	a link interrupt.
+*/
 static void
 ixgbe_update_link_status(struct adapter *adapter)
 {
-	boolean_t link_up = FALSE;
 	struct ifnet	*ifp = adapter->ifp;
 	struct tx_ring *txr = adapter->tx_rings;
 	device_t dev = adapter->dev;
 
-	ixgbe_check_link(&adapter->hw, &adapter->link_speed, &link_up, 0);
 
-	if (link_up){ 
+	if (adapter->link_up){ 
 		if (adapter->link_active == FALSE) {
 			if (bootverbose)
 				device_printf(dev,"Link is up %d Gbps %s \n",
@@ -1720,7 +1924,6 @@ ixgbe_update_link_status(struct adapter 
 }
 
 
-
 /*********************************************************************
  *
  *  This routine disables all traffic on the adapter by issuing a
@@ -1743,6 +1946,11 @@ ixgbe_stop(void *arg)
 	/* Tell the stack that the interface is no longer active */
 	ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
 
+#ifdef IXGBE_TIMESYNC
+	/* Disable IEEE 1588 support */
+	if (adapter->hw.mac.type == ixgbe_mac_82599EB)
+		ixgbe_tsync_disable(adapter);
+#endif
 	ixgbe_reset_hw(&adapter->hw);
 	adapter->hw.adapter_stopped = FALSE;
 	ixgbe_stop_adapter(&adapter->hw);
@@ -1817,8 +2025,13 @@ ixgbe_allocate_legacy(struct adapter *ad
             device_get_nameunit(adapter->dev));
 	taskqueue_start_threads(&rxr->tq, 1, PI_NET, "%s rxq",
             device_get_nameunit(adapter->dev));
+
 	if ((error = bus_setup_intr(dev, adapter->res[0],
+#if __FreeBSD_version >= 700000
             INTR_TYPE_NET | INTR_MPSAFE, NULL, ixgbe_legacy_irq,
+#else
+            INTR_TYPE_NET | INTR_MPSAFE, ixgbe_legacy_irq,
+#endif
             adapter, &adapter->tag[0])) != 0) {
 		device_printf(dev, "Failed to register fast interrupt "
 		    "handler: %d\n", error);
@@ -1833,6 +2046,7 @@ ixgbe_allocate_legacy(struct adapter *ad
 }
 
 
+#if __FreeBSD_version >= 602105
 /*********************************************************************
  *
  *  Setup MSIX Interrupt resources and handlers 
@@ -1859,7 +2073,10 @@ ixgbe_allocate_msix(struct adapter *adap
 		}
 		/* Set the handler function */
 		error = bus_setup_intr(dev, adapter->res[vector],
-		    INTR_TYPE_NET | INTR_MPSAFE, NULL,
+		    INTR_TYPE_NET | INTR_MPSAFE,
+#if __FreeBSD_version > 700000
+		    NULL,
+#endif
 		    ixgbe_msix_tx, txr, &adapter->tag[vector]);
 		if (error) {
 			adapter->res[vector] = NULL;
@@ -1867,7 +2084,7 @@ ixgbe_allocate_msix(struct adapter *adap
 			return (error);
 		}
 		txr->msix = vector;
-		txr->eims = IXGBE_IVAR_TX_QUEUE(vector);
+		txr->eims = 1 << vector;
 		TASK_INIT(&txr->tx_task, 0, ixgbe_handle_tx, txr);
 		txr->tq = taskqueue_create_fast("ixgbe_txq", M_NOWAIT,
 		    taskqueue_thread_enqueue, &txr->tq);
@@ -1888,15 +2105,18 @@ ixgbe_allocate_msix(struct adapter *adap
 		}
 		/* Set the handler function */
 		error = bus_setup_intr(dev, adapter->res[vector],
-		    INTR_TYPE_NET | INTR_MPSAFE, NULL, ixgbe_msix_rx,
-		    rxr, &adapter->tag[vector]);
+		    INTR_TYPE_NET | INTR_MPSAFE,
+#if __FreeBSD_version > 700000
+		    NULL,
+#endif
+		    ixgbe_msix_rx, rxr, &adapter->tag[vector]);
 		if (error) {
 			adapter->res[vector] = NULL;
 			device_printf(dev, "Failed to register RX handler");
 			return (error);
 		}
 		rxr->msix = vector;
-		rxr->eims = IXGBE_IVAR_RX_QUEUE(vector);
+		rxr->eims = 1 << vector;
 		/* used in local timer */
 		adapter->rx_mask |= rxr->eims;
 		TASK_INIT(&rxr->rx_task, 0, ixgbe_handle_rx, rxr);
@@ -1916,19 +2136,37 @@ ixgbe_allocate_msix(struct adapter *adap
 	}
 	/* Set the link handler function */
 	error = bus_setup_intr(dev, adapter->res[vector],
-	    INTR_TYPE_NET | INTR_MPSAFE, NULL, ixgbe_msix_link,
-	    adapter, &adapter->tag[vector]);
+	    INTR_TYPE_NET | INTR_MPSAFE,
+#if __FreeBSD_version > 700000
+		    NULL,
+#endif
+	    ixgbe_msix_link, adapter, &adapter->tag[vector]);
 	if (error) {
 		adapter->res[vector] = NULL;
 		device_printf(dev, "Failed to register LINK handler");
 		return (error);
 	}
 	adapter->linkvec = vector;
+	/* Tasklets for Link, SFP and Multispeed Fiber */
+	TASK_INIT(&adapter->link_task, 0, ixgbe_handle_link, adapter);
+	TASK_INIT(&adapter->mod_task, 0, ixgbe_handle_mod, adapter);
+	TASK_INIT(&adapter->msf_task, 0, ixgbe_handle_msf, adapter);
+	adapter->tq = taskqueue_create_fast("ixgbe_link", M_NOWAIT,
+	    taskqueue_thread_enqueue, &adapter->tq);
+	taskqueue_start_threads(&adapter->tq, 1, PI_NET, "%s linkq",
+	    device_get_nameunit(adapter->dev));
 
 	return (0);
 }
+#else  /* Freebsd 6.1/2 */
+static int
+ixgbe_allocate_msix(struct adapter *adapter)
+{
+	return (1);
+}
+#endif
 
-
+#if __FreeBSD_version >= 602105
 /*
  * Setup Either MSI/X or MSI
  */
@@ -1996,6 +2234,7 @@ msi:
                	device_printf(adapter->dev,"Using MSI interrupt\n");
 	return (msgs);
 }
+#endif /* FreeBSD_version >= 602105 */
 
 static int
 ixgbe_allocate_pci_resources(struct adapter *adapter)
@@ -2031,9 +2270,10 @@ ixgbe_allocate_pci_resources(struct adap
 	adapter->num_tx_queues = 1;
 	adapter->num_rx_queues = 1;
 
+#if __FreeBSD_version >= 602105
 	/* Now setup MSI or MSI/X */
 	adapter->msix = ixgbe_setup_msix(adapter);
-
+#endif
 	adapter->hw.back = &adapter->osdep;
 	return (0);
 }
@@ -2051,7 +2291,10 @@ ixgbe_free_pci_resources(struct adapter 
 	if (adapter->msix == 0)
 		adapter->msix = 1;
 
-	rid = PCIR_BAR(MSIX_82598_BAR);
+	if (adapter->hw.mac.type == ixgbe_mac_82598EB)
+		rid = PCIR_BAR(MSIX_82598_BAR);
+	else
+		rid = PCIR_BAR(MSIX_82599_BAR);
 
 	/*
 	 * First release all the interrupt resources:
@@ -2071,12 +2314,14 @@ ixgbe_free_pci_resources(struct adapter 
 		}
 	}
 
+#if __FreeBSD_version >= 602105
 	if (adapter->msix)
 		pci_release_msi(dev);
 
 	if (adapter->msix_mem != NULL)
 		bus_release_resource(dev, SYS_RES_MEMORY,
 		    rid, adapter->msix_mem);
+#endif
 
 	if (adapter->pci_mem != NULL)
 		bus_release_resource(dev, SYS_RES_MEMORY,
@@ -2215,7 +2460,7 @@ ixgbe_dma_malloc(struct adapter *adapter
 	int             r;
 
 	r = bus_dma_tag_create(NULL,	/* parent */
-			       PAGE_SIZE, 0,	/* alignment, bounds */
+			       1, 0,	/* alignment, bounds */
 			       BUS_SPACE_MAXADDR,	/* lowaddr */
 			       BUS_SPACE_MAXADDR,	/* highaddr */
 			       NULL, NULL,	/* filter, filterarg */
@@ -2415,12 +2660,12 @@ ixgbe_allocate_transmit_buffers(struct t
 	 * Setup DMA descriptor areas.
 	 */
 	if ((error = bus_dma_tag_create(NULL,		/* parent */
-			       PAGE_SIZE, 0,		/* alignment, bounds */
+			       1, 0,		/* alignment, bounds */
 			       BUS_SPACE_MAXADDR,	/* lowaddr */
 			       BUS_SPACE_MAXADDR,	/* highaddr */
 			       NULL, NULL,		/* filter, filterarg */
 			       IXGBE_TSO_SIZE,		/* maxsize */
-			       IXGBE_MAX_SCATTER,	/* nsegments */
+			       ixgbe_num_segs,		/* nsegments */
 			       PAGE_SIZE,		/* maxsegsize */
 			       0,			/* flags */
 			       NULL,			/* lockfunc */
@@ -2484,6 +2729,8 @@ ixgbe_setup_transmit_ring(struct tx_ring
 			m_freem(txbuf->m_head);
 			txbuf->m_head = NULL;
 		}
+		/* Clear the EOP index */
+		txbuf->eop_index = -1;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Apr 14 00:25:00 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4F8A9106571D;
	Tue, 14 Apr 2009 00:25:00 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 575F58FC0C;
	Tue, 14 Apr 2009 00:24:59 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E0OxuI088426;
	Tue, 14 Apr 2009 00:24:59 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E0OxY4088425;
	Tue, 14 Apr 2009 00:24:59 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <200904140024.n3E0OxY4088425@svn.freebsd.org>
From: Jack F Vogel 
Date: Tue, 14 Apr 2009 00:24:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191031 - stable/7/sys/conf
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Apr 2009 00:25:04 -0000

Author: jfv
Date: Tue Apr 14 00:24:59 2009
New Revision: 191031
URL: http://svn.freebsd.org/changeset/base/191031

Log:
  Add extra file for the ixgbe driver checkin
  
  Approved by: re

Modified:
  stable/7/sys/conf/files

Modified: stable/7/sys/conf/files
==============================================================================
--- stable/7/sys/conf/files	Tue Apr 14 00:23:13 2009	(r191030)
+++ stable/7/sys/conf/files	Tue Apr 14 00:24:59 2009	(r191031)
@@ -911,6 +911,8 @@ dev/ixgbe/ixgbe_common.c	optional ixgbe 
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_82598.c		optional ixgbe \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
+dev/ixgbe/ixgbe_82598.c		optional ixgbe \
+	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/jme/if_jme.c		optional jme pci
 dev/joy/joy.c			optional joy
 dev/joy/joy_isa.c		optional joy isa

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Apr 14 00:27:05 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A4F3410656C6;
	Tue, 14 Apr 2009 00:27:05 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9226B8FC0C;
	Tue, 14 Apr 2009 00:27:05 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E0R5nG088512;
	Tue, 14 Apr 2009 00:27:05 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E0R5qX088511;
	Tue, 14 Apr 2009 00:27:05 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <200904140027.n3E0R5qX088511@svn.freebsd.org>
From: Jack F Vogel 
Date: Tue, 14 Apr 2009 00:27:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191032 - stable/7/sys/modules/ixgbe
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Apr 2009 00:27:06 -0000

Author: jfv
Date: Tue Apr 14 00:27:05 2009
New Revision: 191032
URL: http://svn.freebsd.org/changeset/base/191032

Log:
  Update Makefile with new file for ixgbe driver
  
  Approved by: re

Modified:
  stable/7/sys/modules/ixgbe/Makefile

Modified: stable/7/sys/modules/ixgbe/Makefile
==============================================================================
--- stable/7/sys/modules/ixgbe/Makefile	Tue Apr 14 00:24:59 2009	(r191031)
+++ stable/7/sys/modules/ixgbe/Makefile	Tue Apr 14 00:27:05 2009	(r191032)
@@ -4,7 +4,9 @@ KMOD    = ixgbe
 SRCS    = device_if.h bus_if.h pci_if.h opt_bdg.h
 SRCS    += ixgbe.c 
 # Shared source
-SRCS    += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_82598.c
+SRCS    += ixgbe_common.c ixgbe_api.c ixgbe_phy.c
+SRCS    += ixgbe_82598.c ixgbe_82599.c
+
 CFLAGS+= -I${.CURDIR}/../../dev/ixgbe
 
 clean:

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Apr 14 00:35:56 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 91C14106564A;
	Tue, 14 Apr 2009 00:35:56 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7F2128FC0A;
	Tue, 14 Apr 2009 00:35:56 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E0ZuSU088776;
	Tue, 14 Apr 2009 00:35:56 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E0ZuVf088775;
	Tue, 14 Apr 2009 00:35:56 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <200904140035.n3E0ZuVf088775@svn.freebsd.org>
From: Jack F Vogel 
Date: Tue, 14 Apr 2009 00:35:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191034 - stable/7/sys/amd64/conf
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Apr 2009 00:35:57 -0000

Author: jfv
Date: Tue Apr 14 00:35:56 2009
New Revision: 191034
URL: http://svn.freebsd.org/changeset/base/191034

Log:
  Add ixgbe and remove ixgb driver support from GENERIC
  in the amd64 architecture.
  
  Approved by: re

Modified:
  stable/7/sys/amd64/conf/GENERIC

Modified: stable/7/sys/amd64/conf/GENERIC
==============================================================================
--- stable/7/sys/amd64/conf/GENERIC	Tue Apr 14 00:27:59 2009	(r191033)
+++ stable/7/sys/amd64/conf/GENERIC	Tue Apr 14 00:35:56 2009	(r191034)
@@ -184,7 +184,7 @@ device		ppi		# Parallel port interface d
 device		de		# DEC/Intel DC21x4x (``Tulip'')
 device		em		# Intel PRO/1000 Gigabit Ethernet Family
 device		igb		# Intel PRO/1000 PCIE Server Gigabit Family
-device		ixgb		# Intel PRO/10GbE Ethernet Card
+device		ixgbe		# Intel PRO/10GbE PCIE Ethernet Family
 device		le		# AMD Am7900 LANCE and Am79C9xx PCnet
 device		txp		# 3Com 3cR990 (``Typhoon'')
 device		vx		# 3Com 3c590, 3c595 (``Vortex'')

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Apr 14 00:38:03 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C11E11065670;
	Tue, 14 Apr 2009 00:38:03 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AEB568FC18;
	Tue, 14 Apr 2009 00:38:03 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3E0c3g5088849;
	Tue, 14 Apr 2009 00:38:03 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3E0c3fC088847;
	Tue, 14 Apr 2009 00:38:03 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <200904140038.n3E0c3fC088847@svn.freebsd.org>
From: Jack F Vogel 
Date: Tue, 14 Apr 2009 00:38:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191035 - stable/7/sys/conf
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Apr 2009 00:38:04 -0000

Author: jfv
Date: Tue Apr 14 00:38:02 2009
New Revision: 191035
URL: http://svn.freebsd.org/changeset/base/191035

Log:
  OK, been a long weekend and fingers are getting tired,
  missed changing the file name :*(
  
  Approved by: re

Modified:
  stable/7/sys/conf/files

Modified: stable/7/sys/conf/files
==============================================================================
--- stable/7/sys/conf/files	Tue Apr 14 00:35:56 2009	(r191034)
+++ stable/7/sys/conf/files	Tue Apr 14 00:38:02 2009	(r191035)
@@ -911,7 +911,7 @@ dev/ixgbe/ixgbe_common.c	optional ixgbe 
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/ixgbe/ixgbe_82598.c		optional ixgbe \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
-dev/ixgbe/ixgbe_82598.c		optional ixgbe \
+dev/ixgbe/ixgbe_82599.c		optional ixgbe \
 	compile-with "${NORMAL_C} -I$S/dev/ixgbe"
 dev/jme/if_jme.c		optional jme pci
 dev/joy/joy.c			optional joy

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Apr 14 16:48:50 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3B2311065674;
	Tue, 14 Apr 2009 16:48:50 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 27D6C8FC0C;
	Tue, 14 Apr 2009 16:48:50 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EGmoie013873;
	Tue, 14 Apr 2009 16:48:50 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EGmoUW013872;
	Tue, 14 Apr 2009 16:48:50 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <200904141648.n3EGmoUW013872@svn.freebsd.org>
From: Jack F Vogel 
Date: Tue, 14 Apr 2009 16:48:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191064 - stable/7/sys/dev/e1000
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Apr 2009 16:48:51 -0000

Author: jfv
Date: Tue Apr 14 16:48:49 2009
New Revision: 191064
URL: http://svn.freebsd.org/changeset/base/191064

Log:
  Change default on RX queues to 1, this has been found
  as a more stable config.
  
  Approved by: re

Modified:
  stable/7/sys/dev/e1000/if_igb.c

Modified: stable/7/sys/dev/e1000/if_igb.c
==============================================================================
--- stable/7/sys/dev/e1000/if_igb.c	Tue Apr 14 16:45:17 2009	(r191063)
+++ stable/7/sys/dev/e1000/if_igb.c	Tue Apr 14 16:48:49 2009	(r191064)
@@ -291,7 +291,7 @@ TUNABLE_INT("hw.igb.bulk_latency", &igb_
 ** 0, it will then be based on number of cpus.
 */
 static int igb_tx_queues = 1;
-static int igb_rx_queues = 4;
+static int igb_rx_queues = 1;
 TUNABLE_INT("hw.igb.tx_queues", &igb_tx_queues);
 TUNABLE_INT("hw.igb.rx_queues", &igb_rx_queues);
 

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Apr 14 18:52:40 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 29FDC10656F7;
	Tue, 14 Apr 2009 18:52:40 +0000 (UTC) (envelope-from gnn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 15E738FC14;
	Tue, 14 Apr 2009 18:52:40 +0000 (UTC) (envelope-from gnn@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EIqd76016588;
	Tue, 14 Apr 2009 18:52:39 GMT (envelope-from gnn@svn.freebsd.org)
Received: (from gnn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EIqdeu016587;
	Tue, 14 Apr 2009 18:52:39 GMT (envelope-from gnn@svn.freebsd.org)
Message-Id: <200904141852.n3EIqdeu016587@svn.freebsd.org>
From: "George V. Neville-Neil" 
Date: Tue, 14 Apr 2009 18:52:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191070 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Apr 2009 18:52:41 -0000

Author: gnn
Date: Tue Apr 14 18:52:39 2009
New Revision: 191070
URL: http://svn.freebsd.org/changeset/base/191070

Log:
  MFC of a Chelsio bug fix.
  
  Fix a bug in the recent update to the Chelsio driver.
  The tick routine was not being restarted in the init_locked routine
  which could resulted in loss of carrier when updating the MTU.
  
  Approved by:	re (kensmith)
  Obtained from:	Chelsio Inc.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/cxgb/cxgb_main.c

Modified: stable/7/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/7/sys/dev/cxgb/cxgb_main.c	Tue Apr 14 18:32:37 2009	(r191069)
+++ stable/7/sys/dev/cxgb/cxgb_main.c	Tue Apr 14 18:52:39 2009	(r191070)
@@ -1880,6 +1880,7 @@ cxgb_init_locked(struct port_info *p)
 	device_printf(sc->dev, "enabling interrupts on port=%d\n", p->port_id);
 	t3_port_intr_enable(sc, p->port_id);
 
+ 	callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc);
 	t3_sge_reset_adapter(sc);
 
 	ifp->if_drv_flags |= IFF_DRV_RUNNING;

From owner-svn-src-stable-7@FreeBSD.ORG  Tue Apr 14 20:10:54 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 03A3B106579B;
	Tue, 14 Apr 2009 20:10:54 +0000 (UTC)
	(envelope-from scottl@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E4BFE8FC27;
	Tue, 14 Apr 2009 20:10:53 +0000 (UTC)
	(envelope-from scottl@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3EKArjI018541;
	Tue, 14 Apr 2009 20:10:53 GMT (envelope-from scottl@svn.freebsd.org)
Received: (from scottl@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3EKAr9R018540;
	Tue, 14 Apr 2009 20:10:53 GMT (envelope-from scottl@svn.freebsd.org)
Message-Id: <200904142010.n3EKAr9R018540@svn.freebsd.org>
From: Scott Long 
Date: Tue, 14 Apr 2009 20:10:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191075 - stable/7/sys/dev/amr
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Tue, 14 Apr 2009 20:10:56 -0000

Author: scottl
Date: Tue Apr 14 20:10:53 2009
New Revision: 191075
URL: http://svn.freebsd.org/changeset/base/191075

Log:
  Don't register the CAM passthrough interface until interrupts are running.
  This fixes some problems at boot for some that are happening in fairly
  rare cases.  It's just a hack, though, which is why it's only going into
  stable/7 for now.  Note that this hack has a side effect of possibly not
  scanning the AMR buses for /dev/passN devices at boot.  These devices are
  not required for access to the RAID arrays, and only a few tools use them.
  If this affects you, let me know.
  
  Approved by:	re

Modified:
  stable/7/sys/dev/amr/amr.c

Modified: stable/7/sys/dev/amr/amr.c
==============================================================================
--- stable/7/sys/dev/amr/amr.c	Tue Apr 14 19:51:14 2009	(r191074)
+++ stable/7/sys/dev/amr/amr.c	Tue Apr 14 20:10:53 2009	(r191075)
@@ -259,15 +259,6 @@ amr_attach(struct amr_softc *sc)
      */
     amr_init_sysctl(sc);
 
-#if AMR_ENABLE_CAM != 0
-    /*
-     * Attach our 'real' SCSI channels to CAM.
-     */
-    if (amr_cam_attach(sc))
-	return(ENXIO);
-    debug(2, "CAM attach done");
-#endif
-
     /*
      * Create the control device.
      */
@@ -357,6 +348,15 @@ amr_startup(void *arg)
      */
 /*    sc->amr_timeout = timeout(amr_periodic, sc, hz);*/
 
+#if AMR_ENABLE_CAM != 0
+    /*
+     * Attach our 'real' SCSI channels to CAM.
+     */
+    if (amr_cam_attach(sc))
+	device_printf(sc->amr_dev, "CAM passthrough attachment failed\n");
+    debug(2, "CAM attach done");
+#endif
+
     return;
 }
 

From owner-svn-src-stable-7@FreeBSD.ORG  Wed Apr 15 03:41:16 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AFC1C106566B;
	Wed, 15 Apr 2009 03:41:16 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9C1AC8FC08;
	Wed, 15 Apr 2009 03:41:16 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3F3fGAm030440;
	Wed, 15 Apr 2009 03:41:16 GMT
	(envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3F3fGid030439;
	Wed, 15 Apr 2009 03:41:16 GMT
	(envelope-from kensmith@svn.freebsd.org)
Message-Id: <200904150341.n3F3fGid030439@svn.freebsd.org>
From: Ken Smith 
Date: Wed, 15 Apr 2009 03:41:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191089 - stable/7/gnu/usr.bin/groff/tmac
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 15 Apr 2009 03:41:17 -0000

Author: kensmith
Date: Wed Apr 15 03:41:16 2009
New Revision: 191089
URL: http://svn.freebsd.org/changeset/base/191089

Log:
  Make 7.2 the default OS version for manual pages.
  
  Approved by:	re (implicit)

Modified:
  stable/7/gnu/usr.bin/groff/tmac/mdoc.local

Modified: stable/7/gnu/usr.bin/groff/tmac/mdoc.local
==============================================================================
--- stable/7/gnu/usr.bin/groff/tmac/mdoc.local	Wed Apr 15 03:17:07 2009	(r191088)
+++ stable/7/gnu/usr.bin/groff/tmac/mdoc.local	Wed Apr 15 03:41:16 2009	(r191089)
@@ -64,12 +64,13 @@
 .ds doc-volume-as-arm      arm
 .
 .\" Default .Os value
-.ds doc-default-operating-system FreeBSD\~7.1
+.ds doc-default-operating-system FreeBSD\~7.2
 .
 .\" FreeBSD releases not found in doc-common
 .ds doc-operating-system-FreeBSD-6.3    6.3
 .ds doc-operating-system-FreeBSD-6.4    6.4
 .ds doc-operating-system-FreeBSD-7.1    7.1
+.ds doc-operating-system-FreeBSD-7.1    7.2
 .ds doc-operating-system-FreeBSD-8.0    8.0
 .
 .ec

From owner-svn-src-stable-7@FreeBSD.ORG  Wed Apr 15 03:43:00 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E9DA31065675;
	Wed, 15 Apr 2009 03:43:00 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D707B8FC14;
	Wed, 15 Apr 2009 03:43:00 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3F3gxwf030502;
	Wed, 15 Apr 2009 03:42:59 GMT
	(envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3F3gxXP030501;
	Wed, 15 Apr 2009 03:42:59 GMT
	(envelope-from kensmith@svn.freebsd.org)
Message-Id: <200904150342.n3F3gxXP030501@svn.freebsd.org>
From: Ken Smith 
Date: Wed, 15 Apr 2009 03:42:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191090 - stable/7/release
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 15 Apr 2009 03:43:01 -0000

Author: kensmith
Date: Wed Apr 15 03:42:59 2009
New Revision: 191090
URL: http://svn.freebsd.org/changeset/base/191090

Log:
  Bump version number 7.1 to 7.2.
  
  Approved by:	re (implicit)

Modified:
  stable/7/release/Makefile

Modified: stable/7/release/Makefile
==============================================================================
--- stable/7/release/Makefile	Wed Apr 15 03:41:16 2009	(r191089)
+++ stable/7/release/Makefile	Wed Apr 15 03:42:59 2009	(r191090)
@@ -18,11 +18,11 @@
 # Set these, release builder!
 #
 # Fixed version:
-#BUILDNAME=7.1-STABLE
+#BUILDNAME=7.2-STABLE
 #
 # Automatic SNAP versioning:
 DATE != date +%Y%m%d
-BASE = 7.1
+BASE = 7.2
 BUILDNAME?=${BASE}-${DATE}-SNAP
 #
 #CHROOTDIR=/junk/release

From owner-svn-src-stable-7@FreeBSD.ORG  Wed Apr 15 03:45:32 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 77673106564A;
	Wed, 15 Apr 2009 03:45:32 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 645FC8FC18;
	Wed, 15 Apr 2009 03:45:32 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3F3jWmQ030606;
	Wed, 15 Apr 2009 03:45:32 GMT
	(envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3F3jWkH030605;
	Wed, 15 Apr 2009 03:45:32 GMT
	(envelope-from kensmith@svn.freebsd.org)
Message-Id: <200904150345.n3F3jWkH030605@svn.freebsd.org>
From: Ken Smith 
Date: Wed, 15 Apr 2009 03:45:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191091 - stable/7/sys/sys
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 15 Apr 2009 03:45:33 -0000

Author: kensmith
Date: Wed Apr 15 03:45:32 2009
New Revision: 191091
URL: http://svn.freebsd.org/changeset/base/191091

Log:
  Bump __FreeBSD_version now that the svn cp for release/7.2 is done.
  
  Approved by:	re (implicit)

Modified:
  stable/7/sys/sys/param.h

Modified: stable/7/sys/sys/param.h
==============================================================================
--- stable/7/sys/sys/param.h	Wed Apr 15 03:42:59 2009	(r191090)
+++ stable/7/sys/sys/param.h	Wed Apr 15 03:45:32 2009	(r191091)
@@ -57,7 +57,7 @@
  *		is created, otherwise 1.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 701106	/* Master, propagated to newvers */
+#define __FreeBSD_version 702100	/* Master, propagated to newvers */
 
 #ifndef LOCORE
 #include 

From owner-svn-src-stable-7@FreeBSD.ORG  Wed Apr 15 03:48:34 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E53FA106566C;
	Wed, 15 Apr 2009 03:48:34 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D19248FC0C;
	Wed, 15 Apr 2009 03:48:34 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3F3mYF3030706;
	Wed, 15 Apr 2009 03:48:34 GMT
	(envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3F3mYtQ030705;
	Wed, 15 Apr 2009 03:48:34 GMT
	(envelope-from kensmith@svn.freebsd.org)
Message-Id: <200904150348.n3F3mYtQ030705@svn.freebsd.org>
From: Ken Smith 
Date: Wed, 15 Apr 2009 03:48:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191092 - stable/7/usr.sbin/pkg_install/add
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 15 Apr 2009 03:48:35 -0000

Author: kensmith
Date: Wed Apr 15 03:48:34 2009
New Revision: 191092
URL: http://svn.freebsd.org/changeset/base/191092

Log:
  Add package directory for 7.2-REL (and 6.4-REL while here).
  
  Approved by:	re (implicit)

Modified:
  stable/7/usr.sbin/pkg_install/add/main.c

Modified: stable/7/usr.sbin/pkg_install/add/main.c
==============================================================================
--- stable/7/usr.sbin/pkg_install/add/main.c	Wed Apr 15 03:45:32 2009	(r191091)
+++ stable/7/usr.sbin/pkg_install/add/main.c	Wed Apr 15 03:48:34 2009	(r191092)
@@ -78,8 +78,10 @@ struct {
 	{ 601000, 601099, "/packages-6.1-release" },
 	{ 602000, 602099, "/packages-6.2-release" },
 	{ 603000, 603099, "/packages-6.3-release" },
+	{ 604000, 604099, "/packages-6.4-release" },
 	{ 700000, 700099, "/packages-7.0-release" },
 	{ 701000, 701099, "/packages-7.1-release" },
+	{ 702000, 702099, "/packages-7.2-release" },
 	{ 300000, 399000, "/packages-3-stable" },
 	{ 400000, 499000, "/packages-4-stable" },
 	{ 502100, 502128, "/packages-5-current" },

From owner-svn-src-stable-7@FreeBSD.ORG  Wed Apr 15 04:18:06 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 431AC106564A;
	Wed, 15 Apr 2009 04:18:06 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2FAF98FC13;
	Wed, 15 Apr 2009 04:18:06 +0000 (UTC)
	(envelope-from kensmith@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3F4I6TD031478;
	Wed, 15 Apr 2009 04:18:06 GMT
	(envelope-from kensmith@svn.freebsd.org)
Received: (from kensmith@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3F4I67u031477;
	Wed, 15 Apr 2009 04:18:06 GMT
	(envelope-from kensmith@svn.freebsd.org)
Message-Id: <200904150418.n3F4I67u031477@svn.freebsd.org>
From: Ken Smith 
Date: Wed, 15 Apr 2009 04:18:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191093 - stable/7/gnu/usr.bin/groff/tmac
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 15 Apr 2009 04:18:07 -0000

Author: kensmith
Date: Wed Apr 15 04:18:05 2009
New Revision: 191093
URL: http://svn.freebsd.org/changeset/base/191093

Log:
  Oops, missed one of the 2's that needed to be changed when copying the
  line from above...
  
  Submitted by:	lstewart
  Approved by:	re (implicit)

Modified:
  stable/7/gnu/usr.bin/groff/tmac/mdoc.local

Modified: stable/7/gnu/usr.bin/groff/tmac/mdoc.local
==============================================================================
--- stable/7/gnu/usr.bin/groff/tmac/mdoc.local	Wed Apr 15 03:48:34 2009	(r191092)
+++ stable/7/gnu/usr.bin/groff/tmac/mdoc.local	Wed Apr 15 04:18:05 2009	(r191093)
@@ -70,7 +70,7 @@
 .ds doc-operating-system-FreeBSD-6.3    6.3
 .ds doc-operating-system-FreeBSD-6.4    6.4
 .ds doc-operating-system-FreeBSD-7.1    7.1
-.ds doc-operating-system-FreeBSD-7.1    7.2
+.ds doc-operating-system-FreeBSD-7.2    7.2
 .ds doc-operating-system-FreeBSD-8.0    8.0
 .
 .ec

From owner-svn-src-stable-7@FreeBSD.ORG  Wed Apr 15 16:05:26 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E72E106566B;
	Wed, 15 Apr 2009 16:05:26 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0587A8FC12;
	Wed, 15 Apr 2009 16:05:26 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3FG5Pec047365;
	Wed, 15 Apr 2009 16:05:25 GMT (envelope-from kan@svn.freebsd.org)
Received: (from kan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3FG5Per047364;
	Wed, 15 Apr 2009 16:05:25 GMT (envelope-from kan@svn.freebsd.org)
Message-Id: <200904151605.n3FG5Per047364@svn.freebsd.org>
From: Alexander Kabaev 
Date: Wed, 15 Apr 2009 16:05:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191106 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb kern
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Wed, 15 Apr 2009 16:05:27 -0000

Author: kan
Date: Wed Apr 15 16:05:25 2009
New Revision: 191106
URL: http://svn.freebsd.org/changeset/base/191106

Log:
  MFC r191081-191082:
  
  Properly handle negative cache enries found through dotdot lookups.
  
  Submitted by:	tor
  Approved by:	re(kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/vfs_cache.c

Modified: stable/7/sys/kern/vfs_cache.c
==============================================================================
--- stable/7/sys/kern/vfs_cache.c	Wed Apr 15 15:02:37 2009	(r191105)
+++ stable/7/sys/kern/vfs_cache.c	Wed Apr 15 16:05:25 2009	(r191106)
@@ -370,6 +370,11 @@ retry:
 				*vpp = dvp->v_cache_dd->nc_vp;
 			else
 				*vpp = dvp->v_cache_dd->nc_dvp;
+			/* Return failure if negative entry was found. */
+			if (*vpp == NULL) {
+				ncp = dvp->v_cache_dd;
+				goto negative_success;
+			}
 			CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..",
 			    dvp, cnp->cn_nameptr, *vpp);
 			goto success;
@@ -416,6 +421,7 @@ retry:
 		goto success;
 	}
 
+negative_success:
 	/* We found a negative match, and want to create it, so purge */
 	if (cnp->cn_nameiop == CREATE) {
 		numnegzaps++;

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Apr 17 15:35:16 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FBA81065670;
	Fri, 17 Apr 2009 15:35:16 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7D0178FC1E;
	Fri, 17 Apr 2009 15:35:16 +0000 (UTC) (envelope-from alc@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HFZGBT026440;
	Fri, 17 Apr 2009 15:35:16 GMT (envelope-from alc@svn.freebsd.org)
Received: (from alc@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HFZGoH026439;
	Fri, 17 Apr 2009 15:35:16 GMT (envelope-from alc@svn.freebsd.org)
Message-Id: <200904171535.n3HFZGoH026439@svn.freebsd.org>
From: Alan Cox 
Date: Fri, 17 Apr 2009 15:35:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191204 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb vm
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 17 Apr 2009 15:35:17 -0000

Author: alc
Date: Fri Apr 17 15:35:16 2009
New Revision: 191204
URL: http://svn.freebsd.org/changeset/base/191204

Log:
  MFC r175055
    Defer setting either PG_CACHED or PG_FREE until after the free page
    queues lock is acquired.  Otherwise, the state of a reservation's
    pages' flags and its population count can be inconsistent.  That could
    result in a page being freed twice.
  
  (This change should have been included in the MFC of the superpages
  support.)
  
  Thanks to:	pho for an illuminating crash
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/vm/vm_page.c

Modified: stable/7/sys/vm/vm_page.c
==============================================================================
--- stable/7/sys/vm/vm_page.c	Fri Apr 17 14:58:02 2009	(r191203)
+++ stable/7/sys/vm/vm_page.c	Fri Apr 17 15:35:16 2009	(r191204)
@@ -1402,8 +1402,8 @@ vm_page_free_toq(vm_page_t m)
 		m->flags &= ~PG_ZERO;
 		vm_page_enqueue(PQ_HOLD, m);
 	} else {
-		m->flags |= PG_FREE;
 		mtx_lock(&vm_page_queue_free_mtx);
+		m->flags |= PG_FREE;
 		cnt.v_free_count++;
 #if VM_NRESERVLEVEL > 0
 		if (!vm_reserv_free_page(m))
@@ -1654,9 +1654,9 @@ vm_page_cache(vm_page_t m)
 	 * Insert the page into the object's collection of cached pages
 	 * and the physical memory allocator's cache/free page queues.
 	 */
-	vm_page_flag_set(m, PG_CACHED);
 	vm_page_flag_clear(m, PG_ZERO);
 	mtx_lock(&vm_page_queue_free_mtx);
+	m->flags |= PG_CACHED;
 	cnt.v_cache_count++;
 	root = object->cache;
 	if (root == NULL) {

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Apr 17 15:57:09 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C50D61065672;
	Fri, 17 Apr 2009 15:57:09 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 952018FC12;
	Fri, 17 Apr 2009 15:57:09 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 3459346B2C;
	Fri, 17 Apr 2009 11:57:09 -0400 (EDT)
Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8])
	by bigwig.baldwin.cx (Postfix) with ESMTPA id 0490B8A01B;
	Fri, 17 Apr 2009 11:57:08 -0400 (EDT)
From: John Baldwin 
To: Alan Cox 
Date: Fri, 17 Apr 2009 11:44:51 -0400
User-Agent: KMail/1.9.7
References: <200904171535.n3HFZGoH026439@svn.freebsd.org>
In-Reply-To: <200904171535.n3HFZGoH026439@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200904171144.51791.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Fri, 17 Apr 2009 11:57:08 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=0.1 required=4.2 tests=RDNS_NONE autolearn=no
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r191204 - in stable/7/sys: . contrib/pf
	dev/ath/ath_hal dev/cxgb vm
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 17 Apr 2009 15:57:10 -0000

On Friday 17 April 2009 11:35:16 am Alan Cox wrote:
> Author: alc
> Date: Fri Apr 17 15:35:16 2009
> New Revision: 191204
> URL: http://svn.freebsd.org/changeset/base/191204
> 
> Log:
>   MFC r175055
>     Defer setting either PG_CACHED or PG_FREE until after the free page
>     queues lock is acquired.  Otherwise, the state of a reservation's
>     pages' flags and its population count can be inconsistent.  That could
>     result in a page being freed twice.
>   
>   (This change should have been included in the MFC of the superpages
>   support.)
>   
>   Thanks to:	pho for an illuminating crash

Thanks.

Pointy hat to:	jhb

-- 
John Baldwin

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Apr 17 16:42:58 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 87B2A1065679;
	Fri, 17 Apr 2009 16:42:58 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 714928FC14;
	Fri, 17 Apr 2009 16:42:58 +0000 (UTC)
	(envelope-from dchagin@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HGgwZF028290;
	Fri, 17 Apr 2009 16:42:58 GMT (envelope-from dchagin@svn.freebsd.org)
Received: (from dchagin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HGgvu8028279;
	Fri, 17 Apr 2009 16:42:57 GMT (envelope-from dchagin@svn.freebsd.org)
Message-Id: <200904171642.n3HGgvu8028279@svn.freebsd.org>
From: Dmitry Chagin 
Date: Fri, 17 Apr 2009 16:42:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191210 - in stable/7/sys: . amd64/amd64 amd64/linux32
	arm/arm compat/ia32 contrib/pf dev/ath/ath_hal dev/cxgb
	i386/i386 i386/linux ia64/ia64 kern powerpc/powerpc
	sparc64/sparc64 sys
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 17 Apr 2009 16:42:59 -0000

Author: dchagin
Date: Fri Apr 17 16:42:57 2009
New Revision: 191210
URL: http://svn.freebsd.org/changeset/base/191210

Log:
  Merge r190708 from HEAD to stable/7:
  Fix KBI breakage by r190520 which affects older linux.ko binaries:
  
  1) Move the new field (brand_note) to the end of the Brandinfo structure.
  2) Add a new flag BI_BRAND_NOTE that indicates that the brand_note pointer
     is valid.
  3) Use the brand_note field if the flag BI_BRAND_NOTE is set and as old
     modules won't have the flag set, so the new field brand_note would be
     ignored.
  
  Suggested by:   jhb
  Reviewed by:	jhb
  Approved by:	re (Ken Smith), kib (mentor)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/amd64/amd64/elf_machdep.c
  stable/7/sys/amd64/linux32/linux32_sysvec.c
  stable/7/sys/arm/arm/elf_machdep.c
  stable/7/sys/compat/ia32/ia32_sysvec.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/i386/i386/elf_machdep.c
  stable/7/sys/i386/linux/linux_sysvec.c
  stable/7/sys/ia64/ia64/elf_machdep.c
  stable/7/sys/kern/imgact_elf.c
  stable/7/sys/powerpc/powerpc/elf_machdep.c
  stable/7/sys/sparc64/sparc64/elf_machdep.c
  stable/7/sys/sys/imgact_elf.h

Modified: stable/7/sys/amd64/amd64/elf_machdep.c
==============================================================================
--- stable/7/sys/amd64/amd64/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/amd64/amd64/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -84,7 +84,7 @@ static Elf64_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -100,7 +100,7 @@ static Elf64_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- stable/7/sys/amd64/linux32/linux32_sysvec.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/amd64/linux32/linux32_sysvec.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -1066,7 +1066,7 @@ static Elf32_Brandinfo linux_brand = {
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux32_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 static Elf32_Brandinfo linux_glibc2brand = {
@@ -1078,7 +1078,7 @@ static Elf32_Brandinfo linux_glibc2brand
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux32_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 Elf32_Brandinfo *linux_brandlist[] = {

Modified: stable/7/sys/arm/arm/elf_machdep.c
==============================================================================
--- stable/7/sys/arm/arm/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/arm/arm/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -84,7 +84,7 @@ static Elf32_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -100,7 +100,7 @@ static Elf32_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/compat/ia32/ia32_sysvec.c
==============================================================================
--- stable/7/sys/compat/ia32/ia32_sysvec.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/compat/ia32/ia32_sysvec.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -148,7 +148,7 @@ static Elf32_Brandinfo ia32_brand_info =
 	.sysvec		= &ia32_freebsd_sysvec,
 	.interp_newpath	= "/libexec/ld-elf32.so.1",
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(ia32, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -164,7 +164,7 @@ static Elf32_Brandinfo ia32_brand_oinfo 
 	.sysvec		= &ia32_freebsd_sysvec,
 	.interp_newpath	= "/libexec/ld-elf32.so.1",
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oia32, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/i386/i386/elf_machdep.c
==============================================================================
--- stable/7/sys/i386/i386/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/i386/i386/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -84,7 +84,7 @@ static Elf32_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -100,7 +100,7 @@ static Elf32_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/i386/linux/linux_sysvec.c
==============================================================================
--- stable/7/sys/i386/linux/linux_sysvec.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/i386/linux/linux_sysvec.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -1036,7 +1036,7 @@ static Elf32_Brandinfo linux_brand = {
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 static Elf32_Brandinfo linux_glibc2brand = {
@@ -1048,7 +1048,7 @@ static Elf32_Brandinfo linux_glibc2brand
 	.sysvec		= &elf_linux_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &linux_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 Elf32_Brandinfo *linux_brandlist[] = {

Modified: stable/7/sys/ia64/ia64/elf_machdep.c
==============================================================================
--- stable/7/sys/ia64/ia64/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/ia64/ia64/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -92,7 +92,7 @@ static Elf64_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
     (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_info);
@@ -106,7 +106,7 @@ static Elf64_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,
     (sysinit_cfunc_t)elf64_insert_brand_entry, &freebsd_brand_oinfo);

Modified: stable/7/sys/kern/imgact_elf.c
==============================================================================
--- stable/7/sys/kern/imgact_elf.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/kern/imgact_elf.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -192,7 +192,7 @@ __elfN(get_brandinfo)(struct image_param
 	for (i = 0; i < MAX_BRANDS; i++) {
 		bi = elf_brand_list[i];
 		if (bi != NULL && hdr->e_machine == bi->machine &&
-		    bi->brand_note != NULL) {
+		    (bi->flags & BI_BRAND_NOTE) != 0) {
 			ret = __elfN(check_note)(imgp, bi->brand_note, osrel);
 			if (ret)
 				return (bi);

Modified: stable/7/sys/powerpc/powerpc/elf_machdep.c
==============================================================================
--- stable/7/sys/powerpc/powerpc/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/powerpc/powerpc/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -87,7 +87,7 @@ static Elf32_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(elf32, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -103,7 +103,7 @@ static Elf32_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf32_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf32_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oelf32, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/sparc64/sparc64/elf_machdep.c
==============================================================================
--- stable/7/sys/sparc64/sparc64/elf_machdep.c	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/sparc64/sparc64/elf_machdep.c	Fri Apr 17 16:42:57 2009	(r191210)
@@ -99,7 +99,7 @@ static Elf64_Brandinfo freebsd_brand_inf
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(elf64, SI_SUB_EXEC, SI_ORDER_ANY,
@@ -115,7 +115,7 @@ static Elf64_Brandinfo freebsd_brand_oin
 	.sysvec		= &elf64_freebsd_sysvec,
 	.interp_newpath	= NULL,
 	.brand_note	= &elf64_freebsd_brandnote,
-	.flags		= BI_CAN_EXEC_DYN
+	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_NOTE
 };
 
 SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY,

Modified: stable/7/sys/sys/imgact_elf.h
==============================================================================
--- stable/7/sys/sys/imgact_elf.h	Fri Apr 17 16:42:03 2009	(r191209)
+++ stable/7/sys/sys/imgact_elf.h	Fri Apr 17 16:42:57 2009	(r191210)
@@ -70,9 +70,10 @@ typedef struct {
 	const char *interp_path;
 	struct sysentvec *sysvec;
 	const char *interp_newpath;
-	Elf_Brandnote *brand_note;
 	int flags;
+	Elf_Brandnote *brand_note;
 #define	BI_CAN_EXEC_DYN	0x0001
+#define	BI_BRAND_NOTE	0x0002
 } __ElfN(Brandinfo);
 
 __ElfType(Auxargs);

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Apr 17 16:50:42 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 264101065692;
	Fri, 17 Apr 2009 16:50:42 +0000 (UTC) (envelope-from alc@cs.rice.edu)
Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31])
	by mx1.freebsd.org (Postfix) with ESMTP id F21008FC23;
	Fri, 17 Apr 2009 16:50:41 +0000 (UTC) (envelope-from alc@cs.rice.edu)
Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1])
	by mail.cs.rice.edu (Postfix) with ESMTP id AA7562C2C60;
	Fri, 17 Apr 2009 11:32:57 -0500 (CDT)
X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu
Received: from mail.cs.rice.edu ([127.0.0.1])
	by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new,
	port 10024)
	with LMTP id 1UF3Dswn17ve; Fri, 17 Apr 2009 11:32:50 -0500 (CDT)
Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net
	(adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.cs.rice.edu (Postfix) with ESMTP id 1BBDD2C2B32;
	Fri, 17 Apr 2009 11:32:48 -0500 (CDT)
Message-ID: <49E8AF2F.1090708@cs.rice.edu>
Date: Fri, 17 Apr 2009 11:32:47 -0500
From: Alan Cox 
User-Agent: Thunderbird 2.0.0.21 (X11/20090404)
MIME-Version: 1.0
To: John Baldwin 
References: <200904171535.n3HFZGoH026439@svn.freebsd.org>
	<200904171144.51791.jhb@freebsd.org>
In-Reply-To: <200904171144.51791.jhb@freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: Alan Cox , svn-src-stable@freebsd.org,
	svn-src-all@freebsd.org, src-committers@freebsd.org,
	svn-src-stable-7@freebsd.org
Subject: Re: svn commit: r191204 - in stable/7/sys: . contrib/pf
 dev/ath/ath_hal dev/cxgb vm
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 17 Apr 2009 16:50:42 -0000

John Baldwin wrote:
> On Friday 17 April 2009 11:35:16 am Alan Cox wrote:
>   
>> Author: alc
>> Date: Fri Apr 17 15:35:16 2009
>> New Revision: 191204
>> URL: http://svn.freebsd.org/changeset/base/191204
>>
>> Log:
>>   MFC r175055
>>     Defer setting either PG_CACHED or PG_FREE until after the free page
>>     queues lock is acquired.  Otherwise, the state of a reservation's
>>     pages' flags and its population count can be inconsistent.  That could
>>     result in a page being freed twice.
>>   
>>   (This change should have been included in the MFC of the superpages
>>   support.)
>>   
>>   Thanks to:	pho for an illuminating crash
>>     
>
> Thanks.
>
> Pointy hat to:	jhb
>
>   

I think that your bravery to even attempt the MFC absolves you of 
several pointy hats.  I was too chicken.  :-)

Alan


From owner-svn-src-stable-7@FreeBSD.ORG  Fri Apr 17 17:07:12 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C9E7C10656BD;
	Fri, 17 Apr 2009 17:07:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B6E918FC1E;
	Fri, 17 Apr 2009 17:07:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HH7Cbq029015;
	Fri, 17 Apr 2009 17:07:12 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HH7CrT029014;
	Fri, 17 Apr 2009 17:07:12 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <200904171707.n3HH7CrT029014@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 17 Apr 2009 17:07:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191214 - in stable/7/sys: . boot/i386/libi386
	contrib/pf dev/ath/ath_hal dev/cxgb
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 17 Apr 2009 17:07:13 -0000

Author: jhb
Date: Fri Apr 17 17:07:12 2009
New Revision: 191214
URL: http://svn.freebsd.org/changeset/base/191214

Log:
  MFC: Use a disk address instead of an int to hold the starting offset of an
  open partition.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/boot/i386/libi386/biosdisk.c
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/boot/i386/libi386/biosdisk.c
==============================================================================
--- stable/7/sys/boot/i386/libi386/biosdisk.c	Fri Apr 17 17:05:31 2009	(r191213)
+++ stable/7/sys/boot/i386/libi386/biosdisk.c	Fri Apr 17 17:07:12 2009	(r191214)
@@ -83,7 +83,7 @@ struct open_disk {
     int			od_cyl;			/* BIOS geometry */
     int			od_hds;
     int			od_sec;
-    int			od_boff;		/* block offset from beginning of BIOS disk */
+    daddr_t			od_boff;		/* block offset from beginning of BIOS disk */
     int			od_flags;
 #define BD_MODEINT13		0x0000
 #define BD_MODEEDD1		0x0001

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Apr 17 17:12:22 2009
Return-Path: 
Delivered-To: svn-src-stable-7@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 23AA91065674;
	Fri, 17 Apr 2009 17:12:22 +0000 (UTC)
	(envelope-from kensmith@cse.Buffalo.EDU)
Received: from phoebe.cse.buffalo.edu (phoebe.cse.buffalo.edu [128.205.32.89])
	by mx1.freebsd.org (Postfix) with ESMTP id D4F258FC23;
	Fri, 17 Apr 2009 17:12:21 +0000 (UTC)
	(envelope-from kensmith@cse.Buffalo.EDU)
Received: from [128.205.32.76] (bauer.cse.buffalo.edu [128.205.32.76])
	(authenticated bits=0)
	by phoebe.cse.buffalo.edu (8.14.1/8.13.7) with ESMTP id n3HGm0CA035383
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 17 Apr 2009 12:48:02 -0400 (EDT)
	(envelope-from kensmith@cse.buffalo.edu)
From: Ken Smith 
To: Alan Cox 
In-Reply-To: <49E8AF2F.1090708@cs.rice.edu>
References: <200904171535.n3HFZGoH026439@svn.freebsd.org>
	<200904171144.51791.jhb@freebsd.org>  <49E8AF2F.1090708@cs.rice.edu>
Content-Type: multipart/signed; micalg="pgp-sha1";
	protocol="application/pgp-signature";
	boundary="=-tO0dycz+sIu6+a82YqB6"
Organization: U. Buffalo CSE Department
Date: Fri, 17 Apr 2009 12:47:56 -0400
Message-Id: <1239986876.94812.7.camel@bauer.cse.buffalo.edu>
Mime-Version: 1.0
X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port 
X-DCC-Buffalo.EDU-Metrics: phoebe.cse.buffalo.edu 1336; Body=0 Fuz1=0 Fuz2=0
Cc: src-committers@FreeBSD.org, John Baldwin ,
	Alan Cox , svn-src-stable@FreeBSD.org,
	svn-src-all@FreeBSD.org, svn-src-stable-7@FreeBSD.org
Subject: Re: svn commit: r191204 - in stable/7/sys: . contrib/pf
 dev/ath/ath_hal dev/cxgb vm
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 17 Apr 2009 17:12:23 -0000


--=-tO0dycz+sIu6+a82YqB6
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Fri, 2009-04-17 at 11:32 -0500, Alan Cox wrote:
> John Baldwin wrote:
> >=20
> > Pointy hat to:	jhb
> >=20
>=20
> I think that your bravery to even attempt the MFC absolves you of=20
> several pointy hats.  I was too chicken.  :-)
>=20
> Alan
>=20

Yikes!  No!!!!!  His bravery *DEFINITELY* absolves him of one pointy
hat.  But only one!  [ We're too close to 7.2-REL for more...  ;-) ]

--=20
                                                Ken Smith
- From there to here, from here to      |       kensmith@cse.buffalo.edu
  there, funny things are everywhere.   |
                      - Theodore Geisel |


--=-tO0dycz+sIu6+a82YqB6
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEABECAAYFAknosrwACgkQ/G14VSmup/aUDACfdmcICV3i7QNMcXMozsL0yx5X
jp4An1REoveDxbWDjsCLVxJkus/yW0Kq
=m5he
-----END PGP SIGNATURE-----

--=-tO0dycz+sIu6+a82YqB6--


From owner-svn-src-stable-7@FreeBSD.ORG  Fri Apr 17 21:10:53 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9413F10656D0;
	Fri, 17 Apr 2009 21:10:53 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 813C68FC18;
	Fri, 17 Apr 2009 21:10:53 +0000 (UTC) (envelope-from kan@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HLArl4034616;
	Fri, 17 Apr 2009 21:10:53 GMT (envelope-from kan@svn.freebsd.org)
Received: (from kan@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HLArvL034615;
	Fri, 17 Apr 2009 21:10:53 GMT (envelope-from kan@svn.freebsd.org)
Message-Id: <200904172110.n3HLArvL034615@svn.freebsd.org>
From: Alexander Kabaev 
Date: Fri, 17 Apr 2009 21:10:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191223 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb kern
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 17 Apr 2009 21:10:55 -0000

Author: kan
Date: Fri Apr 17 21:10:53 2009
New Revision: 191223
URL: http://svn.freebsd.org/changeset/base/191223

Log:
  MFC r191218 and related backout r191220.
  
  More fallout from negative dotdot caching. Negative entries should
  be removed from and reinserted to proper ncneg list.
  
  Reported by:	pho
  Submitted by:	kib
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/kern/vfs_cache.c

Modified: stable/7/sys/kern/vfs_cache.c
==============================================================================
--- stable/7/sys/kern/vfs_cache.c	Fri Apr 17 19:07:44 2009	(r191222)
+++ stable/7/sys/kern/vfs_cache.c	Fri Apr 17 21:10:53 2009	(r191223)
@@ -535,18 +535,23 @@ cache_enter(dvp, vp, cnp)
 			 * to new parent vnode, otherwise continue with new
 			 * namecache entry allocation.
 			 */
-			if ((ncp = dvp->v_cache_dd) != NULL) {
-				if (ncp->nc_flag & NCF_ISDOTDOT) {
-					KASSERT(ncp->nc_dvp == dvp,
-					    ("wrong isdotdot parent"));
+			if ((ncp = dvp->v_cache_dd) != NULL &&
+			    ncp->nc_flag & NCF_ISDOTDOT) {
+				KASSERT(ncp->nc_dvp == dvp,
+				    ("wrong isdotdot parent"));
+				if (ncp->nc_vp != NULL)
 					TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst,
 					    ncp, nc_dst);
+				else
+					TAILQ_REMOVE(&ncneg, ncp, nc_dst);
+				if (vp != NULL)
 					TAILQ_INSERT_HEAD(&vp->v_cache_dst,
 					    ncp, nc_dst);
-					ncp->nc_vp = vp;
-					CACHE_UNLOCK();
-					return;
-				}
+				else
+					TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst);
+				ncp->nc_vp = vp;
+				CACHE_UNLOCK();
+				return;
 			}
 			dvp->v_cache_dd = NULL;
 			CACHE_UNLOCK();

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Apr 17 22:04:20 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 191531065672;
	Fri, 17 Apr 2009 22:04:20 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0239B8FC25;
	Fri, 17 Apr 2009 22:04:20 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HM4JKB035924;
	Fri, 17 Apr 2009 22:04:19 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HM4JW9035923;
	Fri, 17 Apr 2009 22:04:19 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200904172204.n3HM4JW9035923@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 17 Apr 2009 22:04:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191225 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb dev/fb
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 17 Apr 2009 22:04:23 -0000

Author: marius
Date: Fri Apr 17 22:04:19 2009
New Revision: 191225
URL: http://svn.freebsd.org/changeset/base/191225

Log:
  MFC: r191072
  
  Fix whitespace.
  
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/fb/machfb.c

Modified: stable/7/sys/dev/fb/machfb.c
==============================================================================
--- stable/7/sys/dev/fb/machfb.c	Fri Apr 17 21:18:17 2009	(r191224)
+++ stable/7/sys/dev/fb/machfb.c	Fri Apr 17 22:04:19 2009	(r191225)
@@ -53,12 +53,12 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
- 
+
 #include 
 __FBSDID("$FreeBSD$");
 
 /*
- * Driver for ATI Mach64 graphics chips. Some code is derived from the
+ * Driver for ATI Mach64 graphics chips.  Some code is derived from the
  * ATI Rage Pro and Derivatives Programmer's Guide.
  */
 
@@ -100,7 +100,7 @@ __FBSDID("$FreeBSD$");
 struct machfb_softc {
 	video_adapter_t		sc_va;		/* must be first */
 
-	phandle_t		sc_node;	
+	phandle_t		sc_node;
 	uint16_t		sc_chip_id;
 	uint8_t			sc_chip_rev;
 
@@ -572,7 +572,7 @@ machfb_init(int unit, video_adapter_t *a
 
 	vid_init_struct(adp, MACHFB_DRIVER_NAME, -1, unit);
 
- 	if (OF_getprop(sc->sc_node, "height", &sc->sc_height,
+	if (OF_getprop(sc->sc_node, "height", &sc->sc_height,
 	    sizeof(sc->sc_height)) == -1)
 		return (ENXIO);
 	if (OF_getprop(sc->sc_node, "width", &sc->sc_width,
@@ -630,12 +630,12 @@ machfb_init(int unit, video_adapter_t *a
 
 	machfb_init_engine(sc);
 #if 0
-	mach64_adjust_frame(0, 0);
+	machfb_adjust_frame(0, 0);
 #endif
 	machfb_set_mode(adp, 0);
 
 	/*
-	 * Install our 16-color color map. This is done only once and with
+	 * Install our 16-color color map.  This is done only once and with
 	 * an offset of 16 on sparc64 as there the OBP driver expects white
 	 * to be at index 0 and black at 255 (some versions also use 1 - 8
 	 * for color text support or the full palette for the boot banner
@@ -880,13 +880,13 @@ machfb_mmap(video_adapter_t *adp, vm_off
 
 	if (adp->va_mem_base != 0 && offset >= adp->va_mem_base &&
 	    offset < adp->va_mem_base + adp->va_mem_size) {
-	    	*paddr = sc->sc_vmemh + offset - adp->va_mem_base;
+		*paddr = sc->sc_vmemh + offset - adp->va_mem_base;
 		return (0);
 	}
 
 	if (offset >= adp->va_registers &&
 	    offset < adp->va_registers + adp->va_registers_size) {
-	    	*paddr = sc->sc_memh + offset - adp->va_registers;
+		*paddr = sc->sc_memh + offset - adp->va_registers;
 		return (0);
 	}
 
@@ -1083,7 +1083,7 @@ machfb_puts(video_adapter_t *adp, vm_off
 	for (i = 0; i < len; i++) {
 		/*
 		 * Accelerate continuous blanks by drawing a respective
-		 * rectangle instead. Drawing a rectangle of any size
+		 * rectangle instead.  Drawing a rectangle of any size
 		 * takes about the same number of operations as drawing
 		 * a single character.
 		 */
@@ -1091,7 +1091,7 @@ machfb_puts(video_adapter_t *adp, vm_off
 		a = (s[i] & 0xff00) >> 8;
 		if (c == 0x00 || c == 0x20 || c == 0xdb || c == 0xff) {
 			color2 = (a >> (c == 0xdb ? 0 : 4) & 0xf);
-	    		x2 = (((off + i) % adp->va_info.vi_width) *
+			x2 = (((off + i) % adp->va_info.vi_width) *
 			    adp->va_info.vi_cwidth) + sc->sc_xmargin;
 			y2 = (((off + i) / adp->va_info.vi_width) *
 			    adp->va_info.vi_cheight) + sc->sc_ymargin;
@@ -1135,7 +1135,7 @@ machfb_putm(video_adapter_t *adp, int x,
 
 	if ((!(sc->sc_flags & MACHFB_CUREN)) &&
 	    (error = machfb_cursor_install(sc)) < 0)
-	    	return (error);
+		return (error);
 	else {
 		/*
 		 * The hardware cursor always must be disabled when
@@ -1174,7 +1174,7 @@ machfb_pci_probe(device_t dev)
 			return (BUS_PROBE_DEFAULT);
 		}
 	}
-	
+
 	return (ENXIO);
 }
 
@@ -1192,8 +1192,8 @@ machfb_pci_attach(device_t dev)
 	node = ofw_bus_get_node(dev);
 	if ((sc = (struct machfb_softc *)vid_get_adapter(vid_find_adapter(
 	    MACHFB_DRIVER_NAME, 0))) != NULL && sc->sc_node == node) {
-	    	device_printf(dev, "console\n");
-	    	device_set_softc(dev, sc);
+		device_printf(dev, "console\n");
+		device_set_softc(dev, sc);
 	} else {
 		sc = device_get_softc(dev);
 		bzero(sc, sizeof(struct machfb_softc));
@@ -1203,7 +1203,7 @@ machfb_pci_attach(device_t dev)
 		sc->sc_chip_rev = pci_get_revid(dev);
 	}
 	adp = &sc->sc_va;
-		
+
 	/*
 	 * Regardless whether we are the console and already allocated
 	 * resources in machfb_configure() or not we have to allocate
@@ -1214,7 +1214,7 @@ machfb_pci_attach(device_t dev)
 	pci_write_config(dev, PCIR_COMMAND,
 	    pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_PORTEN |
 	    PCIM_CMD_MEMEN, 2);
-	
+
 	sc->sc_memrid = PCIR_BAR(0);
 	if ((sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
 	    &sc->sc_memrid, RF_ACTIVE)) == NULL) {
@@ -1228,18 +1228,18 @@ machfb_pci_attach(device_t dev)
 	sc->sc_regt = sc->sc_memt;
 	bus_space_subregion(sc->sc_regt, sc->sc_memh, MACH64_REG_OFF,
 	    MACH64_REG_SIZE, &sc->sc_regh);
-    	adp->va_buffer = (vm_offset_t)rman_get_virtual(sc->sc_memres);
+	adp->va_buffer = (vm_offset_t)rman_get_virtual(sc->sc_memres);
 	adp->va_buffer_size = rman_get_size(sc->sc_memres);
 
 	/*
 	 * Depending on the firmware version the VGA I/O and/or memory
-	 * resources of the Mach64 chips come up disabled. We generally
+	 * resources of the Mach64 chips come up disabled.  We generally
 	 * enable them above (pci(4) actually already did this unless
 	 * pci_enable_io_modes is not set) but this doesn't necessarily
-	 * mean that we get valid ones. Invalid resources seem to have
-	 * in common that they start at address 0. We don't allocate
+	 * mean that we get valid ones.  Invalid resources seem to have
+	 * in common that they start at address 0.  We don't allocate
 	 * them in this case in order to avoid warnings in apb(4) and
-	 * crashes when using these invalid resources. Xorg is aware
+	 * crashes when using these invalid resources.  Xorg is aware
 	 * of this and doesn't use the VGA resources in this case (but
 	 * demands them if they are valid).
 	 */
@@ -1288,9 +1288,9 @@ machfb_pci_attach(device_t dev)
 		/*
 		 * During device configuration we don't necessarily probe
 		 * the adapter which is the console first so we can't use
-		 * the device unit number for the video adapter unit. The
+		 * the device unit number for the video adapter unit.  The
 		 * worst case would be that we use the video adapter unit
-		 * 0 twice. As it doesn't really matter which unit number
+		 * 0 twice.  As it doesn't really matter which unit number
 		 * the corresponding video adapter has just use the next
 		 * unused one.
 		 */
@@ -1299,7 +1299,7 @@ machfb_pci_attach(device_t dev)
 				break;
 		if ((error = sw->init(i, adp, 0)) != 0) {
 			device_printf(dev, "cannot initialize adapter\n");
-		    	goto fail_vmemres;
+			goto fail_vmemres;
 		}
 	}
 
@@ -1333,7 +1333,7 @@ machfb_pci_attach(device_t dev)
 	/*
 	 * Allocate one page for the mouse pointer image at the end of
 	 * the little endian aperture, right before the memory mapped
-	 * registers that might also reside there. Must be done after
+	 * registers that might also reside there.  Must be done after
 	 * sc_memsize was set and possibly adjusted to account for the
 	 * memory mapped registers.
 	 */
@@ -1346,7 +1346,7 @@ machfb_pci_attach(device_t dev)
 	/*
 	 * Register a handler that performs some cosmetic surgery like
 	 * turning off the mouse pointer on halt in preparation for
-	 * handing the screen over to the OFW. Register another handler
+	 * handing the screen over to the OFW.  Register another handler
 	 * that turns off the CRTC when resetting, otherwise the OFW
 	 * boot command issued by cpu_reset() just doesn't work.
 	 */
@@ -1358,12 +1358,12 @@ machfb_pci_attach(device_t dev)
 	return (0);
 
  fail_vmemres:
- 	if (sc->sc_vmemres != NULL)
-	 	bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_vmemrid,
+	if (sc->sc_vmemres != NULL)
+		bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_vmemrid,
 		    sc->sc_vmemres);
  fail_viores:
- 	if (sc->sc_viores != NULL)
-	 	bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_viorid,
+	if (sc->sc_viores != NULL)
+		bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_viorid,
 		    sc->sc_viores);
  fail_memres:
 	bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, sc->sc_memres);
@@ -1556,7 +1556,7 @@ machfb_adjust_frame(struct machfb_softc 
 	offset = ((x + y * sc->sc_width) * (sc->sc_depth >> 3)) >> 3;
 
 	regw(sc, CRTC_OFF_PITCH, (regr(sc, CRTC_OFF_PITCH) & 0xfff00000) |
-	     offset);
+	    offset);
 }
 #endif
 

From owner-svn-src-stable-7@FreeBSD.ORG  Fri Apr 17 23:22:02 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 159A3106566C;
	Fri, 17 Apr 2009 23:22:02 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 019FF8FC13;
	Fri, 17 Apr 2009 23:22:02 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HNM1LU038342;
	Fri, 17 Apr 2009 23:22:01 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HNM1GJ038341;
	Fri, 17 Apr 2009 23:22:01 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <200904172322.n3HNM1GJ038341@svn.freebsd.org>
From: Marius Strobl 
Date: Fri, 17 Apr 2009 23:22:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191230 - in stable/7/sys: . contrib/pf dev/ath/ath_hal
	dev/cxgb dev/fb
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Fri, 17 Apr 2009 23:22:02 -0000

Author: marius
Date: Fri Apr 17 23:22:01 2009
New Revision: 191230
URL: http://svn.freebsd.org/changeset/base/191230

Log:
  MFC: r191076
  
  - Remove the second license as I'm also fine with the first one.
  - Remove redundant softc members for RIDs.
  - Change some softc members to be unsigned where more appropriate.
  - Add some missing const.
  - Remove support for mmap(2)'ing VGA I/O as it was broken [1] and
    not required by X.Org anyway.
  - Fix some confusion between bus, physical and virtual addresses
    which mostly consisted in using members of struct video_adapter
    inappropriately but wasn't fatal except for the regular framebuffer
    mmap(2)'ing.
  - Remove redundant bzero(9)'ing of the softc.
  - Don't map the framebuffer twice in case the firmware has already
    mapped it as besides wasting resources this isn't possible with
    all MMUs. This is a bit tricky as a) just because the firmware
    provides a property with a virtual address doesn't mean it's
    actually mapped (but typically is when the framebuffer is the
    console) and b) the firmware doesn't necessarily map it with
    the same byteorder as we do. This makes machfb(4) work on machines
    with cheetah-class MMUs (including X.Org).
  
  Reported by:	Michael Plass [1]
  Approved by:	re (kib)

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/fb/machfb.c

Modified: stable/7/sys/dev/fb/machfb.c
==============================================================================
--- stable/7/sys/dev/fb/machfb.c	Fri Apr 17 23:11:18 2009	(r191229)
+++ stable/7/sys/dev/fb/machfb.c	Fri Apr 17 23:22:01 2009	(r191230)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 2002 Bang Jun-Young
+ * Copyright (c) 2005 Marius Strobl 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -26,33 +27,6 @@
  *
  *	from: NetBSD: machfb.c,v 1.23 2005/03/07 21:45:24 martin Exp
  */
-/*-
- * Copyright (c) 2005 Marius Strobl 
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer,
- *    without modification, immediately at the beginning of the file.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
 
 #include 
 __FBSDID("$FreeBSD$");
@@ -66,18 +40,23 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 #include 
 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -104,58 +83,53 @@ struct machfb_softc {
 	uint16_t		sc_chip_id;
 	uint8_t			sc_chip_rev;
 
-	int			sc_memrid;
-	int			sc_viorid;
-	int			sc_vmemrid;
 	struct resource		*sc_memres;
-	struct resource		*sc_viores;
 	struct resource		*sc_vmemres;
 	bus_space_tag_t		sc_memt;
 	bus_space_tag_t		sc_regt;
-	bus_space_tag_t		sc_viot;
-	bus_space_tag_t		sc_vmemt;
 	bus_space_handle_t	sc_memh;
 	bus_space_handle_t	sc_regh;
-	bus_space_handle_t	sc_vioh;
-	bus_space_handle_t	sc_vmemh;
+	u_long			sc_mem;
+	u_long			sc_vmem;
 
-	int			sc_height;
-	int			sc_width;
-	int			sc_depth;
-	int			sc_xmargin;
-	int			sc_ymargin;
+	u_int			sc_height;
+	u_int			sc_width;
+	u_int			sc_depth;
+	u_int			sc_xmargin;
+	u_int			sc_ymargin;
 
 	size_t			sc_memsize;
-	int			sc_memtype;
-	int			sc_mem_freq;
-	int			sc_ramdac_freq;
-	int			sc_ref_freq;
-
-	int			sc_ref_div;
-	int			sc_mclk_post_div;
-	int			sc_mclk_fb_div;
+	u_int			sc_memtype;
+	u_int			sc_mem_freq;
+	u_int			sc_ramdac_freq;
+	u_int			sc_ref_freq;
+
+	u_int			sc_ref_div;
+	u_int			sc_mclk_post_div;
+	u_int			sc_mclk_fb_div;
 
 	const u_char		*sc_font;
-	int			sc_cbwidth;
+	u_int			sc_cbwidth;
 	vm_offset_t		sc_curoff;
 
 	int			sc_bg_cache;
 	int			sc_fg_cache;
-	int			sc_draw_cache;
+	u_int			sc_draw_cache;
 #define	MACHFB_DRAW_CHAR	(1 << 0)
 #define	MACHFB_DRAW_FILLRECT	(1 << 1)
 
-	int			sc_flags;
+	u_int			sc_flags;
 #define	MACHFB_CONSOLE		(1 << 0)
 #define	MACHFB_CUREN		(1 << 1)
 #define	MACHFB_DSP		(1 << 2)
+#define	MACHFB_SWAP		(1 << 3)
 };
 
 static const struct {
 	uint16_t	chip_id;
 	const char	*name;
 	uint32_t	ramdac_freq;
-} machfb_info[] = {
+} const machfb_info[] = {
 	{ ATI_MACH64_CT, "ATI Mach64 CT", 135000 },
 	{ ATI_RAGE_PRO_AGP, "ATI 3D Rage Pro (AGP)", 230000 },
 	{ ATI_RAGE_PRO_AGP1X, "ATI 3D Rage Pro (AGP 1x)", 230000 },
@@ -193,7 +167,7 @@ static const struct machfb_cmap {
 	uint8_t red;
 	uint8_t green;
 	uint8_t blue;
-} machfb_default_cmap[16] = {
+} const machfb_default_cmap[16] = {
 	{0x00, 0x00, 0x00},	/* black */
 	{0x00, 0x00, 0xff},	/* blue */
 	{0x00, 0xff, 0x00},	/* green */
@@ -214,7 +188,7 @@ static const struct machfb_cmap {
 
 #define	MACHFB_CMAP_OFF		16
 
-static const u_char machfb_mouse_pointer_bits[64][8] = {
+static const u_char const machfb_mouse_pointer_bits[64][8] = {
 	{ 0x00, 0x00, },	/* ............ */
 	{ 0x80, 0x00, },	/* *........... */
 	{ 0xc0, 0x00, },	/* **.......... */
@@ -243,12 +217,12 @@ static const u_char machfb_mouse_pointer
  * Lookup table to perform a bit-swap of the mouse pointer bits,
  * map set bits to CUR_CLR0 and unset bits to transparent.
  */
-static const u_char machfb_mouse_pointer_lut[] = {
+static const u_char const machfb_mouse_pointer_lut[] = {
 	0xaa, 0x2a, 0x8a, 0x0a, 0xa2, 0x22, 0x82, 0x02,
 	0xa8, 0x28, 0x88, 0x08, 0xa0, 0x20, 0x80, 0x00
 };
 
-static const char *machfb_memtype_names[] = {
+static const char *const machfb_memtype_names[] = {
 	"(N/A)", "DRAM", "EDO DRAM", "EDO DRAM", "SDRAM", "SGRAM", "WRAM",
 	"(unknown type)"
 };
@@ -351,8 +325,6 @@ static video_switch_t machfbvidsw = {
 	.clear			= machfb_clear,
 	.fill_rect		= machfb_fill_rect,
 	.bitblt			= machfb_bitblt,
-	NULL,
-	NULL,
 	.diag			= machfb_diag,
 	.save_cursor_palette	= machfb_save_cursor_palette,
 	.load_cursor_palette	= machfb_load_cursor_palette,
@@ -698,7 +670,7 @@ machfb_set_mode(video_adapter_t *adp, in
 
 	sc->sc_bg_cache = -1;
 	sc->sc_fg_cache = -1;
-	sc->sc_draw_cache = -1;
+	sc->sc_draw_cache = 0;
 
 	return (0);
 }
@@ -869,30 +841,28 @@ machfb_mmap(video_adapter_t *adp, vm_off
     int prot)
 {
 	struct machfb_softc *sc;
+	video_info_t *vi;
 
 	sc = (struct machfb_softc *)adp;
+	vi = &adp->va_info;
 
-	if (adp->va_io_base != 0 && offset >= adp->va_io_base &&
-	    offset < adp->va_io_base + adp->va_io_size) {
-		*paddr = sc->sc_vioh + offset - adp->va_io_size;
-		return (0);
-	}
-
-	if (adp->va_mem_base != 0 && offset >= adp->va_mem_base &&
-	    offset < adp->va_mem_base + adp->va_mem_size) {
-		*paddr = sc->sc_vmemh + offset - adp->va_mem_base;
+	/* BAR 2 - VGA memory */
+	if (sc->sc_vmem != 0 && offset >= sc->sc_vmem &&
+	    offset < sc->sc_vmem + vi->vi_registers_size) {
+		*paddr = vi->vi_registers + offset - sc->sc_vmem;
 		return (0);
 	}
 
-	if (offset >= adp->va_registers &&
-	    offset < adp->va_registers + adp->va_registers_size) {
-		*paddr = sc->sc_memh + offset - adp->va_registers;
+	/* BAR 0 - framebuffer */
+	if (offset >= sc->sc_mem &&
+	    offset < sc->sc_mem + vi->vi_buffer_size) {
+		*paddr = vi->vi_buffer + offset - sc->sc_mem;
 		return (0);
 	}
 
 	/* 'regular' framebuffer mmap()ing */
 	if (offset < adp->va_window_size) {
-		*paddr = adp->va_window + offset;
+		*paddr = vi->vi_window + offset;
 		return (0);
 	}
 
@@ -1184,10 +1154,11 @@ machfb_pci_attach(device_t dev)
 	struct machfb_softc *sc;
 	video_adapter_t *adp;
 	video_switch_t *sw;
+	video_info_t *vi;
 	phandle_t node;
-	uint32_t *p32, saved_value;
+	int error, i, rid;
+	uint32_t *p32, u32;
 	uint8_t *p;
-	int error, i;
 
 	node = ofw_bus_get_node(dev);
 	if ((sc = (struct machfb_softc *)vid_get_adapter(vid_find_adapter(
@@ -1196,18 +1167,19 @@ machfb_pci_attach(device_t dev)
 		device_set_softc(dev, sc);
 	} else {
 		sc = device_get_softc(dev);
-		bzero(sc, sizeof(struct machfb_softc));
 
 		sc->sc_node = node;
 		sc->sc_chip_id = pci_get_device(dev);
 		sc->sc_chip_rev = pci_get_revid(dev);
 	}
 	adp = &sc->sc_va;
+	vi = &adp->va_info;
 
 	/*
-	 * Regardless whether we are the console and already allocated
-	 * resources in machfb_configure() or not we have to allocate
-	 * them here (again) in order for rman_get_virtual() to work.
+	 * Allocate resources regardless of whether we are the console
+	 * and already obtained the bus tag and handle for the framebuffer
+	 * in machfb_configure() or not so the resources are marked as
+	 * taken in the respective RMAN.
 	 */
 
 	/* Enable memory and IO access. */
@@ -1215,21 +1187,44 @@ machfb_pci_attach(device_t dev)
 	    pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_PORTEN |
 	    PCIM_CMD_MEMEN, 2);
 
-	sc->sc_memrid = PCIR_BAR(0);
+	/*
+	 * NB: we need to take care that the framebuffer isn't mapped
+	 * in twice as besides wasting resources this isn't possible with
+	 * all MMUs.
+	 */
+	rid = PCIR_BAR(0);
 	if ((sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-	    &sc->sc_memrid, RF_ACTIVE)) == NULL) {
+	    &rid, 0)) == NULL) {
 		device_printf(dev, "cannot allocate memory resources\n");
 		return (ENXIO);
 	}
+	if (OF_getprop(sc->sc_node, "address", &u32, sizeof(u32)) > 0 &&
+		vtophys(u32) == rman_get_bushandle(sc->sc_memres))
+		adp->va_mem_base = u32;
+	else {
+		bus_release_resource(dev, SYS_RES_MEMORY,
+		    rman_get_rid(sc->sc_memres), sc->sc_memres);
+		rid = PCIR_BAR(0);
+		if ((sc->sc_memres = bus_alloc_resource_any(dev,
+		    SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) {
+			device_printf(dev,
+			    "cannot allocate memory resources\n");
+			return (ENXIO);
+		}
+		adp->va_mem_base =
+		    (vm_offset_t)rman_get_virtual(sc->sc_memres);
+	}
 	sc->sc_memt = rman_get_bustag(sc->sc_memres);
 	sc->sc_memh = rman_get_bushandle(sc->sc_memres);
-	adp->va_registers = rman_get_start(sc->sc_memres);
-	adp->va_registers_size = rman_get_size(sc->sc_memres);
 	sc->sc_regt = sc->sc_memt;
 	bus_space_subregion(sc->sc_regt, sc->sc_memh, MACH64_REG_OFF,
 	    MACH64_REG_SIZE, &sc->sc_regh);
-	adp->va_buffer = (vm_offset_t)rman_get_virtual(sc->sc_memres);
-	adp->va_buffer_size = rman_get_size(sc->sc_memres);
+	adp->va_mem_size = rman_get_size(sc->sc_memres);
+	adp->va_buffer = adp->va_mem_base;
+	adp->va_buffer_size = adp->va_mem_size;
+	sc->sc_mem = rman_get_start(sc->sc_memres);
+	vi->vi_buffer = sc->sc_memh;
+	vi->vi_buffer_size = adp->va_buffer_size;
 
 	/*
 	 * Depending on the firmware version the VGA I/O and/or memory
@@ -1239,46 +1234,27 @@ machfb_pci_attach(device_t dev)
 	 * mean that we get valid ones.  Invalid resources seem to have
 	 * in common that they start at address 0.  We don't allocate
 	 * them in this case in order to avoid warnings in apb(4) and
-	 * crashes when using these invalid resources.  Xorg is aware
+	 * crashes when using these invalid resources.  X.Org is aware
 	 * of this and doesn't use the VGA resources in this case (but
 	 * demands them if they are valid).
 	 */
-	sc->sc_viorid = PCIR_BAR(1);
-	if (bus_get_resource_start(dev, SYS_RES_IOPORT, sc->sc_viorid) != 0) {
-		if ((sc->sc_viores = bus_alloc_resource_any(dev,
-		    SYS_RES_IOPORT, &sc->sc_viorid, RF_ACTIVE)) == NULL) {
-			device_printf(dev,
-			    "cannot allocate VGA I/O resources\n");
-			error = ENXIO;
-			goto fail_memres;
-		}
-		sc->sc_viot = rman_get_bustag(sc->sc_viores);
-		sc->sc_vioh = rman_get_bushandle(sc->sc_viores);
-		adp->va_io_base = rman_get_start(sc->sc_viores);
-		adp->va_io_size = rman_get_size(sc->sc_viores);
-	}
-
-	sc->sc_vmemrid = PCIR_BAR(2);
-	if (bus_get_resource_start(dev, SYS_RES_MEMORY, sc->sc_vmemrid) != 0) {
+	rid = PCIR_BAR(2);
+	if (bus_get_resource_start(dev, SYS_RES_MEMORY, rid) != 0) {
 		if ((sc->sc_vmemres = bus_alloc_resource_any(dev,
-		    SYS_RES_MEMORY, &sc->sc_vmemrid, RF_ACTIVE)) == NULL) {
+		    SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) {
 			device_printf(dev,
 			    "cannot allocate VGA memory resources\n");
 			error = ENXIO;
-			goto fail_viores;
+			goto fail_memres;
 		}
-		sc->sc_vmemt = rman_get_bustag(sc->sc_vmemres);
-		sc->sc_vmemh = rman_get_bushandle(sc->sc_vmemres);
-		adp->va_mem_base = rman_get_start(sc->sc_vmemres);
-		adp->va_mem_size = rman_get_size(sc->sc_vmemres);
+		adp->va_registers =
+		    (vm_offset_t)rman_get_virtual(sc->sc_vmemres);
+		adp->va_registers_size = rman_get_size(sc->sc_vmemres);
+		sc->sc_vmem = rman_get_start(sc->sc_vmemres);
+		vi->vi_registers = rman_get_bushandle(sc->sc_vmemres);
+		vi->vi_registers_size = adp->va_registers_size;
 	}
 
-	device_printf(dev,
-	    "%d MB aperture at 0x%08x, %d KB registers at 0x%08x\n",
-	    (u_int)(adp->va_buffer_size / (1024 * 1024)),
-	    (u_int)adp->va_buffer, MACH64_REG_SIZE / 1024,
-	    (u_int)sc->sc_regh);
-
 	if (!(sc->sc_flags & MACHFB_CONSOLE)) {
 		if ((sw = vid_get_switch(MACHFB_DRIVER_NAME)) == NULL) {
 			device_printf(dev, "cannot get video switch\n");
@@ -1303,33 +1279,46 @@ machfb_pci_attach(device_t dev)
 		}
 	}
 
-	device_printf(dev,
-	    "%ld KB %s %d.%d MHz, maximum RAMDAC clock %d MHz, %sDSP\n",
-	    (u_long)sc->sc_memsize, machfb_memtype_names[sc->sc_memtype],
-	    sc->sc_mem_freq / 1000, sc->sc_mem_freq % 1000,
-	    sc->sc_ramdac_freq / 1000,
-	    (sc->sc_flags & MACHFB_DSP) ? "" : "no ");
-	device_printf(dev, "resolution %dx%d at %d bpp\n",
-	    sc->sc_width, sc->sc_height, sc->sc_depth);
-
 	/*
 	 * Test whether the aperture is byte swapped or not, set
-	 * va_window and va_window_size as appropriate.
+	 * va_window and va_window_size as appropriate.  Note that
+	 * the aperture could be mapped either big or little endian
+	 * on independently of the endianess of the host so this
+	 * has to be a runtime test.
 	 */
 	p32 = (uint32_t *)adp->va_buffer;
-	saved_value = *p32;
+	u32 = *p32;
 	p = (uint8_t *)adp->va_buffer;
 	*p32 = 0x12345678;
 	if (!(p[0] == 0x12 && p[1] == 0x34 && p[2] == 0x56 && p[3] == 0x78)) {
 		adp->va_window = adp->va_buffer + 0x800000;
 		adp->va_window_size = adp->va_buffer_size - 0x800000;
+		vi->vi_window = vi->vi_buffer + 0x800000;
+		vi->vi_window_size = vi->vi_buffer_size - 0x800000;
+		sc->sc_flags |= MACHFB_SWAP;
 	} else {
 		adp->va_window = adp->va_buffer;
 		adp->va_window_size = adp->va_buffer_size;
+		vi->vi_window = vi->vi_buffer;
+		vi->vi_window_size = vi->vi_buffer_size;
 	}
-	*p32 = saved_value;
+	*p32 = u32;
 	adp->va_window_gran = adp->va_window_size;
 
+	device_printf(dev,
+	    "%d MB aperture at %p %sswapped\n",
+	    (u_int)(adp->va_window_size / (1024 * 1024)),
+	    (void *)adp->va_window, (sc->sc_flags & MACHFB_SWAP) ?
+	    "" : "not ");
+	device_printf(dev,
+	    "%ld KB %s %d.%d MHz, maximum RAMDAC clock %d MHz, %sDSP\n",
+	    (u_long)sc->sc_memsize, machfb_memtype_names[sc->sc_memtype],
+	    sc->sc_mem_freq / 1000, sc->sc_mem_freq % 1000,
+	    sc->sc_ramdac_freq / 1000,
+	    (sc->sc_flags & MACHFB_DSP) ? "" : "no ");
+	device_printf(dev, "resolution %dx%d at %d bpp\n",
+	    sc->sc_width, sc->sc_height, sc->sc_depth);
+
 	/*
 	 * Allocate one page for the mouse pointer image at the end of
 	 * the little endian aperture, right before the memory mapped
@@ -1359,14 +1348,11 @@ machfb_pci_attach(device_t dev)
 
  fail_vmemres:
 	if (sc->sc_vmemres != NULL)
-		bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_vmemrid,
-		    sc->sc_vmemres);
- fail_viores:
-	if (sc->sc_viores != NULL)
-		bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_viorid,
-		    sc->sc_viores);
+		bus_release_resource(dev, SYS_RES_MEMORY,
+		    rman_get_rid(sc->sc_vmemres), sc->sc_vmemres);
  fail_memres:
-	bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_memrid, sc->sc_memres);
+	bus_release_resource(dev, SYS_RES_MEMORY,
+	    rman_get_rid(sc->sc_memres), sc->sc_memres);
 
 	return (error);
 }
@@ -1396,7 +1382,7 @@ machfb_cursor_enable(struct machfb_softc
 static int
 machfb_cursor_install(struct machfb_softc *sc)
 {
-	uint16_t *p;
+	uint16_t *p, v;
 	uint8_t fg;
 	int i, j;
 
@@ -1410,12 +1396,18 @@ machfb_cursor_install(struct machfb_soft
 	    machfb_default_cmap[fg].green << 16 |
 	    machfb_default_cmap[fg].blue << 8);
 	p = (uint16_t *)(sc->sc_va.va_buffer + sc->sc_curoff);
-	for (i = 0; i < 64; i++)
-		for (j = 0; j < 8; j++)
-			*(p++) = machfb_mouse_pointer_lut[
-			    machfb_mouse_pointer_bits[i][j] >> 4] |
+	for (i = 0; i < 64; i++) {
+		for (j = 0; j < 8; j++) {
+			v = machfb_mouse_pointer_lut[
+			    machfb_mouse_pointer_bits[i][j] >> 4] << 8 |
 			    machfb_mouse_pointer_lut[
-			    machfb_mouse_pointer_bits[i][j] & 0x0f] << 8;
+			    machfb_mouse_pointer_bits[i][j] & 0x0f];
+			if (sc->sc_flags & MACHFB_SWAP)
+				*(p++) = bswap16(v);
+			else
+				*(p++) = v;
+		}
+	}
 
 	return (0);
 }
@@ -1424,7 +1416,7 @@ static int
 machfb_get_memsize(struct machfb_softc *sc)
 {
 	int tmp, memsize;
-	int mem_tab[] = {
+	const int const mem_tab[] = {
 		512, 1024, 2048, 4096, 6144, 8192, 12288, 16384
 	};
 

From owner-svn-src-stable-7@FreeBSD.ORG  Sat Apr 18 11:50:12 2009
Return-Path: 
Delivered-To: svn-src-stable-7@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 308F5106581D;
	Sat, 18 Apr 2009 11:50:12 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EF4A08FC13;
	Sat, 18 Apr 2009 11:50:11 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3IBoBZL075248;
	Sat, 18 Apr 2009 11:50:11 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3IBoBeY075247;
	Sat, 18 Apr 2009 11:50:11 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <200904181150.n3IBoBeY075247@svn.freebsd.org>
From: Edwin Groothuis 
Date: Sat, 18 Apr 2009 11:50:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
X-SVN-Group: stable-7
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r191244 - stable/7/share/zoneinfo
X-BeenThere: svn-src-stable-7@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 7-stable src tree
	
List-Unsubscribe: , 
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
	
X-List-Received-Date: Sat, 18 Apr 2009 11:50:21 -0000

Author: edwin
Date: Sat Apr 18 11:50:11 2009
New Revision: 191244
URL: http://svn.freebsd.org/changeset/base/191244

Log:
  MFC of tzdata2009f
  
  Correct DST information for Pakistan for 2009.
  
  Approved by:	re (kip)

Modified:
  stable/7/share/zoneinfo/   (props changed)
  stable/7/share/zoneinfo/asia

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Sat Apr 18 07:39:11 2009	(r191243)
+++ stable/7/share/zoneinfo/asia	Sat Apr 18 11:50:11 2009	(r191244)
@@ -1,4 +1,4 @@
-# @(#)asia	8.29
+# @(#)asia	8.30
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -1589,11 +1589,46 @@ Zone	Asia/Muscat	3:54:20 -	LMT	1920
 # http://dailymailnews.com/200808/28/news/dmbrn03.html
 # 
 
+# From Alexander Krivenyshev (2009-04-08):
+# Based on previous media reports that "... proposed plan to
+# advance clocks by one hour from May 1 will cause disturbance
+# to the working schedules rather than bringing discipline in
+# official working."
+# 
+# http://www.thenews.com.pk/daily_detail.asp?id=171280
+# 
+#
+# recent news that instead of May 2009 - Pakistan plan to
+# introduce DST from April 15, 2009
+#
+# FYI: Associated Press Of Pakistan
+# April 08, 2009
+# Cabinet okays proposal to advance clocks by one hour from April 15
+# 
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=73043&Itemid=1
+# 
+#
+# or
+#
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan05.html
+# 
+#
+# ....
+# The Federal Cabinet on Wednesday approved the proposal to
+# advance clocks in the country by one hour from April 15 to
+# conserve energy"
+
+# From Arthur David Olson (2009-04-10):
+# Assume for now that Pakistan will end DST in 2009 as it did in 2008.
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
 Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
 Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
 Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
+Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Karachi	4:28:12 -	LMT	1907
 			5:30	-	IST	1942 Sep