svn commit: r219813 - head/sbin/hastd
Author: pjd Date: Mon Mar 21 08:31:35 2011 New Revision: 219813 URL: http://svn.freebsd.org/changeset/base/219813 Log: If there is any traffic on one of out descriptors, we were not checking for long running hooks. Fix it by not using select(2) timeout to decide if we want to check hooks or not. MFC after:1 week Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c == --- head/sbin/hastd/hastd.c Mon Mar 21 06:18:26 2011(r219812) +++ head/sbin/hastd/hastd.c Mon Mar 21 08:31:35 2011(r219813) @@ -46,6 +46,7 @@ __FBSDID($FreeBSD$); #include stdlib.h #include string.h #include sysexits.h +#include time.h #include unistd.h #include activemap.h @@ -877,9 +878,11 @@ main_loop(void) struct timeval seltimeout; struct timespec sigtimeout; int fd, maxfd, ret, signo; + time_t lastcheck, now; sigset_t mask; fd_set rfds; + lastcheck = time(NULL); seltimeout.tv_sec = REPORT_INTERVAL; seltimeout.tv_usec = 0; sigtimeout.tv_sec = 0; @@ -943,9 +946,18 @@ main_loop(void) PJDLOG_ASSERT(maxfd + 1 = (int)FD_SETSIZE); ret = select(maxfd + 1, rfds, NULL, NULL, seltimeout); - if (ret == 0) + now = time(NULL); + if (lastcheck + REPORT_INTERVAL = now) { hook_check(); - else if (ret == -1) { + lastcheck = now; + } + if (ret == 0) { + /* +* select(2) timed out, so there should be no +* descriptors to check. +*/ + continue; + } else if (ret == -1) { if (errno == EINTR) continue; KEEP_ERRNO((void)pidfile_remove(pfh)); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219814 - head/sbin/hastd
Author: pjd Date: Mon Mar 21 08:33:58 2011 New Revision: 219814 URL: http://svn.freebsd.org/changeset/base/219814 Log: When creating connection on behalf of primary worker, set pjdlog prefix to resource name and role, so that any logs related to that can be identified properly. MFC after:1 week Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c == --- head/sbin/hastd/hastd.c Mon Mar 21 08:31:35 2011(r219813) +++ head/sbin/hastd/hastd.c Mon Mar 21 08:33:58 2011(r219814) @@ -842,6 +842,8 @@ connection_migrate(struct hast_resource struct proto_conn *conn; int16_t val = 0; + pjdlog_prefix_set([%s] (%s) , res-hr_name, role2str(res-hr_role)); + if (proto_recv(res-hr_conn, val, sizeof(val)) 0) { pjdlog_errno(LOG_WARNING, Unable to receive connection command); @@ -869,6 +871,8 @@ out: } if (val == 0 proto_connection_send(res-hr_conn, conn) 0) pjdlog_errno(LOG_WARNING, Unable to send connection); + + pjdlog_prefix_set(%s, ); } static void ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219816 - head/sbin/hastd
Author: pjd Date: Mon Mar 21 08:37:50 2011 New Revision: 219816 URL: http://svn.freebsd.org/changeset/base/219816 Log: Use snprlcat() instead of two strlcat(3)s. MFC after:1 week Modified: head/sbin/hastd/hooks.c Modified: head/sbin/hastd/hooks.c == --- head/sbin/hastd/hooks.c Mon Mar 21 08:36:50 2011(r219815) +++ head/sbin/hastd/hooks.c Mon Mar 21 08:37:50 2011(r219816) @@ -52,6 +52,7 @@ __FBSDID($FreeBSD$); #include pjdlog.h #include hooks.h +#include subr.h #include synch.h /* Report processes that are running for too long not often than this value. */ @@ -184,8 +185,8 @@ hook_alloc(const char *path, char **args (void)strlcpy(hp-hp_comm, path, sizeof(hp-hp_comm)); /* We start at 2nd argument as we don't want to have exec name twice. */ for (ii = 1; args[ii] != NULL; ii++) { - (void)strlcat(hp-hp_comm, , sizeof(hp-hp_comm)); - (void)strlcat(hp-hp_comm, args[ii], sizeof(hp-hp_comm)); + (void)snprlcat(hp-hp_comm, sizeof(hp-hp_comm), %s, + args[ii]); } if (strlen(hp-hp_comm) = sizeof(hp-hp_comm) - 1) { pjdlog_error(Exec path too long, correct configuration file.); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219817 - head/sbin/hastd
Author: pjd Date: Mon Mar 21 08:38:24 2011 New Revision: 219817 URL: http://svn.freebsd.org/changeset/base/219817 Log: Log when we start hooks checking and when we execute a hook. MFC after:1 week Modified: head/sbin/hastd/hooks.c Modified: head/sbin/hastd/hooks.c == --- head/sbin/hastd/hooks.c Mon Mar 21 08:37:50 2011(r219816) +++ head/sbin/hastd/hooks.c Mon Mar 21 08:38:24 2011(r219817) @@ -288,6 +288,8 @@ hook_check(void) assert(hooks_initialized); + pjdlog_debug(1, Checking hooks.); + /* * Report about processes that are running for a long time. */ @@ -363,6 +365,8 @@ hook_execv(const char *path, va_list ap) if (hp == NULL) return; + pjdlog_debug(1, Executing hook: %s, hp-hp_comm); + pid = fork(); switch (pid) { case -1:/* Error. */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r219791 - head/sys/net
On Sun, Mar 20, 2011 at 08:35:00AM +, Dmitry Chagin wrote: D Author: dchagin D Date: Sun Mar 20 08:35:00 2011 D New Revision: 219791 D URL: http://svn.freebsd.org/changeset/base/219791 D D Log: D Remove dead code. This wasn't a code, but defines. Removing them saves nothing, but primitives deleted may be useful. D MFC after: 1 Week D D Modified: D head/sys/net/route.h D D Modified: head/sys/net/route.h D == D --- head/sys/net/route.h Sun Mar 20 08:27:06 2011(r219790) D +++ head/sys/net/route.h Sun Mar 20 08:35:00 2011(r219791) D @@ -325,7 +325,6 @@ struct rt_addrinfo { D #define RT_LOCK_INIT(_rt) \ D mtx_init((_rt)-rt_mtx, rtentry, NULL, MTX_DEF | MTX_DUPOK) D #define RT_LOCK(_rt)mtx_lock((_rt)-rt_mtx) D -#define RT_TRYLOCK(_rt) mtx_trylock((_rt)-rt_mtx) D #define RT_UNLOCK(_rt) mtx_unlock((_rt)-rt_mtx) D #define RT_LOCK_DESTROY(_rt)mtx_destroy((_rt)-rt_mtx) D #define RT_LOCK_ASSERT(_rt) mtx_assert((_rt)-rt_mtx, MA_OWNED) D @@ -360,22 +359,6 @@ struct rt_addrinfo { D RTFREE_LOCKED(_rt); \ D } while (0) D D -#define RT_TEMP_UNLOCK(_rt) do {\ D -RT_ADDREF(_rt); \ D -RT_UNLOCK(_rt); \ D -} while (0) D - D -#define RT_RELOCK(_rt) do { \ D -RT_LOCK(_rt); \ D -if ((_rt)-rt_refcnt = 1) {\ D -rtfree(_rt);\ D -_rt = 0; /* signal that it went away */\ D -} else {\ D -RT_REMREF(_rt); \ D -/* note that _rt is still valid */ \ D -} \ D -} while (0) D - D struct radix_node_head *rt_tables_get_rnh(int, int); D D struct ifmultiaddr; -- Totus tuus, Glebius. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219818 - head/sbin/hastd
Author: pjd Date: Mon Mar 21 08:54:59 2011 New Revision: 219818 URL: http://svn.freebsd.org/changeset/base/219818 Log: In hast.conf we define the other node's address in 'remote' variable. This way we know how to connect to secondary node when we are primary. The same variable is used by the secondary node - it only accepts connections from the address stored in 'remote' variable. In cluster configurations it is common that each node has its individual IP address and there is one addtional shared IP address which is assigned to primary node. It seems it is possible that if the shared IP address is from the same network as the individual IP address it might be choosen by the kernel as a source address for connection with the secondary node. Such connection will be rejected by secondary, as it doesn't come from primary node individual IP. Add 'source' variable that allows to specify source IP address we want to bind to before connecting to the secondary node. MFC after:1 week Modified: head/sbin/hastd/control.c head/sbin/hastd/hast.conf.5 head/sbin/hastd/hast.h head/sbin/hastd/hastd.c head/sbin/hastd/parse.y head/sbin/hastd/primary.c head/sbin/hastd/proto.c head/sbin/hastd/proto.h head/sbin/hastd/proto_impl.h head/sbin/hastd/proto_socketpair.c head/sbin/hastd/proto_tcp4.c head/sbin/hastd/proto_uds.c head/sbin/hastd/secondary.c head/sbin/hastd/token.l Modified: head/sbin/hastd/control.c == --- head/sbin/hastd/control.c Mon Mar 21 08:38:24 2011(r219817) +++ head/sbin/hastd/control.c Mon Mar 21 08:54:59 2011(r219818) @@ -234,6 +234,8 @@ control_status(struct hastd_config *cfg, nv_add_string(nvout, res-hr_provname, provname%u, no); nv_add_string(nvout, res-hr_localpath, localpath%u, no); nv_add_string(nvout, res-hr_remoteaddr, remoteaddr%u, no); + if (res-hr_sourceaddr[0] != '\0') + nv_add_string(nvout, res-hr_sourceaddr, sourceaddr%u, no); switch (res-hr_replication) { case HAST_REPLICATION_FULLSYNC: nv_add_string(nvout, fullsync, replication%u, no); Modified: head/sbin/hastd/hast.conf.5 == --- head/sbin/hastd/hast.conf.5 Mon Mar 21 08:38:24 2011(r219817) +++ head/sbin/hastd/hast.conf.5 Mon Mar 21 08:54:59 2011(r219818) @@ -28,7 +28,7 @@ .\ .\ $FreeBSD$ .\ -.Dd August 30, 2010 +.Dd March 20, 2011 .Dt HAST.CONF 5 .Os .Sh NAME @@ -93,6 +93,7 @@ resource name { local path # Required remote addr + source addr } on node { # Resource-node section @@ -101,6 +102,7 @@ resource name { local path # Required remote addr + source addr } } .Ed @@ -337,6 +339,14 @@ A special value of .Va none can be used when the remote address is not yet known (eg. the other node is not set up yet). +.It Ic source Aq addr +.Pp +Local address to bind to before connecting to the remote +.Nm hastd +daemon. +Format is the same as for the +.Ic listen +statement. .El .Sh FILES .Bl -tag -width .Pa /var/run/hastctl -compact @@ -367,10 +377,12 @@ resource shared { resource tank { on hasta { local /dev/mirror/tanka + source tcp4://10.0.0.1 remote tcp4://10.0.0.2 } on hastb { local /dev/mirror/tankb + source tcp4://10.0.0.2 remote tcp4://10.0.0.1 } } Modified: head/sbin/hastd/hast.h == --- head/sbin/hastd/hast.h Mon Mar 21 08:38:24 2011(r219817) +++ head/sbin/hastd/hast.h Mon Mar 21 08:54:59 2011(r219818) @@ -169,6 +169,8 @@ struct hast_resource { /* Address of the remote component. */ charhr_remoteaddr[HAST_ADDRSIZE]; + /* Local address to bind to for outgoing connections. */ + charhr_sourceaddr[HAST_ADDRSIZE]; /* Connection for incoming data. */ struct proto_conn *hr_remotein; /* Connection for outgoing data. */ Modified: head/sbin/hastd/hastd.c == --- head/sbin/hastd/hastd.c Mon Mar 21 08:38:24 2011(r219817) +++ head/sbin/hastd/hastd.c Mon Mar 21 08:54:59 2011(r219818) @@ -360,6 +360,8 @@ resource_needs_restart(const struct hast res0-hr_role == HAST_ROLE_SECONDARY) { if (strcmp(res0-hr_remoteaddr, res1-hr_remoteaddr) != 0) return (true); + if (strcmp(res0-hr_sourceaddr, res1-hr_sourceaddr) != 0) + return (true); if (res0-hr_replication != res1-hr_replication)
svn commit: r219819 - in head: sys/amd64/include sys/conf sys/dev/hptmv sys/i386/include sys/kern sys/net sys/netinet sys/netinet6 sys/sys sys/vm usr.sbin/config usr.sbin/ndp
Author: jeff Date: Mon Mar 21 09:40:01 2011 New Revision: 219819 URL: http://svn.freebsd.org/changeset/base/219819 Log: - Merge changes to the base system to support OFED. These include a wider arg2 for sysctl, updates to vlan code, IFT_INFINIBAND, and other miscellaneous small features. Modified: head/sys/amd64/include/endian.h head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/conf/options head/sys/dev/hptmv/hptproc.c head/sys/i386/include/endian.h head/sys/kern/kern_intr.c head/sys/kern/kern_jail.c head/sys/kern/kern_sx.c head/sys/kern/kern_sysctl.c head/sys/kern/subr_bus.c head/sys/net/if.c head/sys/net/if_arp.h head/sys/net/if_llatbl.h head/sys/net/if_types.h head/sys/net/if_var.h head/sys/net/if_vlan.c head/sys/net/if_vlan_var.h head/sys/netinet/if_ether.c head/sys/netinet6/in6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c head/sys/sys/bus.h head/sys/sys/file.h head/sys/sys/interrupt.h head/sys/sys/jail.h head/sys/sys/sx.h head/sys/sys/sysctl.h head/sys/vm/uma_core.c head/sys/vm/vm_map.c head/sys/vm/vm_map.h head/usr.sbin/config/config.h head/usr.sbin/config/mkmakefile.c head/usr.sbin/ndp/ndp.c Modified: head/sys/amd64/include/endian.h == --- head/sys/amd64/include/endian.h Mon Mar 21 08:54:59 2011 (r219818) +++ head/sys/amd64/include/endian.h Mon Mar 21 09:40:01 2011 (r219819) @@ -69,73 +69,59 @@ extern C { #if defined(__GNUCLIKE_ASM) defined(__GNUCLIKE_BUILTIN_CONSTANT_P) -#define __byte_swap_int_var(x) \ -__extension__ ({ register __uint32_t __X = (x); \ - __asm (bswap %0 : +r (__X)); \ - __X; }) +#define__bswap64_const(_x) \ + (((_x) 56) | \ + (((_x) 40) (0xffUL 8)) |\ + (((_x) 24) (0xffUL 16)) | \ + (((_x) 8) (0xffUL 24)) |\ + (((_x) 8) (0xffUL 32)) |\ + (((_x) 24) (0xffUL 40)) | \ + (((_x) 40) (0xffUL 48)) | \ + ((_x) 56)) + +#define__bswap32_const(_x) \ + (((_x) 24) | \ + (((_x) (0xff 16)) 8) | \ + (((_x) (0xff 8)) 8) | \ + ((_x) 24)) -#ifdef __OPTIMIZE__ - -#define__byte_swap_int_const(x) \ - x) 0xff00) 24) | \ -(((x) 0x00ff) 8) | \ -(((x) 0xff00) 8) | \ -(((x) 0x00ff) 24)) -#define__byte_swap_int(x) (__builtin_constant_p(x) ? \ - __byte_swap_int_const(x) : __byte_swap_int_var(x)) - -#else /* __OPTIMIZE__ */ - -#define__byte_swap_int(x) __byte_swap_int_var(x) - -#endif /* __OPTIMIZE__ */ - -#define __byte_swap_long_var(x) \ -__extension__ ({ register __uint64_t __X = (x); \ - __asm (bswap %0 : +r (__X)); \ - __X; }) - -#ifdef __OPTIMIZE__ - -#define__byte_swap_long_const(x) \ - (((x 56) | \ -((x 40) 0xff00) | \ -((x 24) 0xff) | \ -((x 8) 0xff00) | \ -((x 8) (0xfful 32)) | \ -((x 24) (0xfful 40)) | \ -((x 40) (0xfful 48)) | \ -((x 56 - -#define__byte_swap_long(x) (__builtin_constant_p(x) ? \ - __byte_swap_long_const(x) : __byte_swap_long_var(x)) - -#else /* __OPTIMIZE__ */ - -#define__byte_swap_long(x) __byte_swap_long_var(x) - -#endif /* __OPTIMIZE__ */ +#define __bswap16_const(_x)(__uint16_t)((_x) 8 | (_x) 8) static __inline __uint64_t -__bswap64(__uint64_t _x) +__bswap64_var(__uint64_t _x) { - return (__byte_swap_long(_x)); + __asm (bswap %0 : +r (_x)); + return (_x); } static __inline __uint32_t -__bswap32(__uint32_t _x) +__bswap32_var(__uint32_t _x) { - return (__byte_swap_int(_x)); + __asm (bswap %0 : +r (_x)); + return (_x); } static __inline __uint16_t -__bswap16(__uint16_t _x) +__bswap16_var(__uint16_t _x) { - return (_x 8 | _x 8); + + return (__bswap16_const(_x)); } +#define__bswap64(_x) \ + (__builtin_constant_p(_x) ? \ + __bswap64_const((__uint64_t)(_x)) : __bswap64_var(_x)) + +#define__bswap32(_x) \ + (__builtin_constant_p(_x) ? \ + __bswap32_const((__uint32_t)(_x)) : __bswap32_var(_x)) + +#define__bswap16(_x) \ + (__builtin_constant_p(_x) ? \ + __bswap16_const((__uint16_t)(_x)) : __bswap16_var(_x)) + #define__htonl(x) __bswap32(x) #define__htons(x) __bswap16(x) #define__ntohl(x) __bswap32(x) Modified: head/sys/conf/files == --- head/sys/conf/files Mon Mar 21 08:54:59 2011
Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
On Sun, 20 Mar 2011, Kirk McKusick wrote: Date: Sun, 20 Mar 2011 13:25:20 -0700 From: Doug Barton do...@freebsd.org To: Marius Strobl mar...@alchemy.franken.de CC: Kirk McKusick mckus...@mckusick.com, Nathan Whitehorn nwhiteh...@freebsd.org, svn-src-head@FreeBSD.org, Jeff Roberson j...@freebsd.org, Gavin Atkinson ga...@freebsd.org, svn-src-...@freebsd.org, src-committ...@freebsd.org, kved...@kvedulv.de Subject: Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit On 03/20/2011 09:22, Marius Strobl wrote: I fear it's still a bit premature for enable SU+J by default. Rather recently I was told about a SU+J filesystems lost after a panic that happend after snapshotting it (report CC'ed, maybe he can provide some more details) and I'm pretty sure I've seen the problem described in PR 149022 also after the potential fix mentioned in its feedback. +1 I tried enabling SU+J on my /var (after backing up of course) and after a panic random files were missing entirely. Not the last updates to those files, the whole file, and many of them had not been written to in days/weeks/months. With all due respect to the hard work that went into the code, I would be very uncomfortable with enabling it by default at this point. Doug With all due respect, how can we fix things that nobody reports? If you have a problem, let us know about it. And of course, we need something more specific than the above. I have not been following current but I read any emails sent directly to me without a mailing list in the cc. I also was not aware of this. I had not heard of any filesystem corruption problems at all. If there are any, I also am not comfortable with enabling it by default. I want to fix that first. I have blocked off next week to work on this. I already sent an email out to current@ requesting bug reports. Please if you have anything else let me know immediately so I can prioritize it and start investigating. Thanks, Jeff Kirk McKusick ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
On Mar 20, 2011, at 10:34 PM, Jeff Roberson wrote: On Sun, 20 Mar 2011, Kirk McKusick wrote: Date: Sun, 20 Mar 2011 13:25:20 -0700 From: Doug Barton do...@freebsd.org To: Marius Strobl mar...@alchemy.franken.de CC: Kirk McKusick mckus...@mckusick.com, Nathan Whitehorn nwhiteh...@freebsd.org, svn-src-head@FreeBSD.org, Jeff Roberson j...@freebsd.org, Gavin Atkinson ga...@freebsd.org, svn-src-...@freebsd.org, src-committ...@freebsd.org, kved...@kvedulv.de Subject: Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit On 03/20/2011 09:22, Marius Strobl wrote: I fear it's still a bit premature for enable SU+J by default. Rather recently I was told about a SU+J filesystems lost after a panic that happend after snapshotting it (report CC'ed, maybe he can provide some more details) and I'm pretty sure I've seen the problem described in PR 149022 also after the potential fix mentioned in its feedback. +1 I tried enabling SU+J on my /var (after backing up of course) and after a panic random files were missing entirely. Not the last updates to those files, the whole file, and many of them had not been written to in days/weeks/months. With all due respect to the hard work that went into the code, I would be very uncomfortable with enabling it by default at this point. Doug With all due respect, how can we fix things that nobody reports? If you have a problem, let us know about it. And of course, we need something more specific than the above. I have not been following current but I read any emails sent directly to me without a mailing list in the cc. I also was not aware of this. I had not heard of any filesystem corruption problems at all. If there are any, I also am not comfortable with enabling it by default. I want to fix that first. I have blocked off next week to work on this. I already sent an email out to current@ requesting bug reports. Please if you have anything else let me know immediately so I can prioritize it and start investigating. I haven't seen any data/metadata corruption issues with SUJ that weren't also present with SU (or just plain UFS). The vast majority of problems that I've witnessed have happened on systems with ATA/SATA disks, hinting (IMHO) that it's really the long-standing problem of running these disks with their write caches enabled. I don't think that I've encountered any appreciable problems on RAID controllers or SAS/SCSI disks with their write caches disabled. Maybe with CAMATA maturing and supporting NCQ, we can turn off the SATA write caches as the default policy. Scott ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
On Sun, 20 Mar 2011, Doug Barton wrote: On 03/20/2011 09:22, Marius Strobl wrote: I fear it's still a bit premature for enable SU+J by default. Rather recently I was told about a SU+J filesystems lost after a panic that happend after snapshotting it (report CC'ed, maybe he can provide some more details) and I'm pretty sure I've seen the problem described in PR 149022 also after the potential fix mentioned in its feedback. +1 I tried enabling SU+J on my /var (after backing up of course) and after a panic random files were missing entirely. Not the last updates to those files, the whole file, and many of them had not been written to in days/weeks/months. So you're saying the directory entry was missing? Can you tell me how big the directory was? Number of files? Approximate directory size when you consider file names? When you fsck'd were inodes recovered and linked into lost and found? What was the actual path? I'm trying to wrap my head around how this would be possible and where the error could be and whether it could be caused by SUJ. The number of interactions with disk writes are minimal. Corruption if it occurs would most likely be caused by a bad journal recovery. Thanks, Jeff With all due respect to the hard work that went into the code, I would be very uncomfortable with enabling it by default at this point. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219821 - head/sbin/hastctl
Author: pjd Date: Mon Mar 21 11:52:00 2011 New Revision: 219821 URL: http://svn.freebsd.org/changeset/base/219821 Log: Forgot to commit this as a part of r219818. MFC after:1 week Modified: head/sbin/hastctl/hastctl.c Modified: head/sbin/hastctl/hastctl.c == --- head/sbin/hastctl/hastctl.c Mon Mar 21 09:58:24 2011(r219820) +++ head/sbin/hastctl/hastctl.c Mon Mar 21 11:52:00 2011(r219821) @@ -330,6 +330,9 @@ control_status(struct nv *nv) (unsigned int)nv_get_uint32(nv, keepdirty%u, ii)); printf( remoteaddr: %s\n, nv_get_string(nv, remoteaddr%u, ii)); + str = nv_get_string(nv, sourceaddr%u, ii); + if (str != NULL) + printf( sourceaddr: %s\n, str); printf( replication: %s\n, nv_get_string(nv, replication%u, ii)); str = nv_get_string(nv, status%u, ii); @@ -466,7 +469,7 @@ main(int argc, char *argv[]) } /* Setup control connection... */ - if (proto_client(cfg-hc_controladdr, controlconn) 0) { + if (proto_client(NULL, cfg-hc_controladdr, controlconn) 0) { pjdlog_exit(EX_OSERR, Unable to setup control connection to %s, cfg-hc_controladdr); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219822 - head/sys/dev/ath/ath_rate/sample
Author: adrian Date: Mon Mar 21 12:51:13 2011 New Revision: 219822 URL: http://svn.freebsd.org/changeset/base/219822 Log: Fix static ucastrate for ath_rate_sample. * Pull out the static rix stuff into a different function * I know this may slightly drop performance, but check if a static rix is needed before each packet TX. * Whilst I'm at it, add a little extra debugging to the rate control stuff to make it easier to follow what's going on. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c == --- head/sys/dev/ath/ath_rate/sample/sample.c Mon Mar 21 11:52:00 2011 (r219821) +++ head/sys/dev/ath/ath_rate/sample/sample.c Mon Mar 21 12:51:13 2011 (r219822) @@ -250,6 +250,55 @@ pick_sample_rate(struct sample_softc *ss #undef MCS } +static int +ath_rate_get_static_rix(struct ath_softc *sc, const struct ieee80211_node *ni) +{ +#defineRATE(_ix) (ni-ni_rates.rs_rates[(_ix)] IEEE80211_RATE_VAL) +#defineDOT11RATE(_ix) (rt-info[(_ix)].dot11Rate IEEE80211_RATE_VAL) +#defineMCS(_ix)(ni-ni_htrates.rs_rates[_ix] | IEEE80211_RATE_MCS) + const struct ieee80211_txparam *tp = ni-ni_txparms; + int srate; + + /* Check MCS rates */ + for (srate = ni-ni_htrates.rs_nrates - 1; srate = 0; srate--) { + if (MCS(srate) == tp-ucastrate) + return sc-sc_rixmap[tp-ucastrate]; + } + + /* Check legacy rates */ + for (srate = ni-ni_rates.rs_nrates - 1; srate = 0; srate--) { + if (RATE(srate) == tp-ucastrate) + return sc-sc_rixmap[tp-ucastrate]; + } + return -1; +#undef RATE +#undef DOT11RATE +#undef MCS +} + +static void +ath_rate_update_static_rix(struct ath_softc *sc, struct ieee80211_node *ni) +{ + struct ath_node *an = ATH_NODE(ni); + const struct ieee80211_txparam *tp = ni-ni_txparms; + struct sample_node *sn = ATH_NODE_SAMPLE(an); + + if (tp != NULL tp-ucastrate != IEEE80211_FIXED_RATE_NONE) { + /* +* A fixed rate is to be used; ucastrate is the IEEE code +* for this rate (sans basic bit). Check this against the +* negotiated rate set for the node. Note the fixed rate +* may not be available for various reasons so we only +* setup the static rate index if the lookup is successful. +*/ + sn-static_rix = ath_rate_get_static_rix(sc, ni); + } else { + sn-static_rix = -1; + } +} + + + void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, int shortPreamble, size_t frameLen, @@ -267,6 +316,8 @@ ath_rate_findrate(struct ath_softc *sc, int rix, mrr, best_rix, change_rates; unsigned average_tx_time; + ath_rate_update_static_rix(sc, an-an_node); + if (sn-static_rix != -1) { rix = sn-static_rix; *try0 = ATH_TXMAXTRY; @@ -560,9 +611,10 @@ ath_rate_tx_complete(struct ath_softc *s * Only one rate was used; optimize work. */ IEEE80211_NOTE(an-an_node.ni_vap, IEEE80211_MSG_RATECTL, -an-an_node, %s: size %d %s rate/try %d %s/%d/%d, +an-an_node, %s: size %d (%d bytes) %s rate/try %d %s/%d/%d, __func__, bin_to_size(size_to_bin(frame_size)), +frame_size, ts-ts_status ? FAIL : OK, dot11rate(rt, final_rix), dot11rate_label(rt, final_rix), short_tries, long_tries); update_stats(sc, an, frame_size, @@ -587,9 +639,10 @@ ath_rate_tx_complete(struct ath_softc *s IEEE80211_NOTE(an-an_node.ni_vap, IEEE80211_MSG_RATECTL, an-an_node, -%s: size %d finaltsidx %d tries %d %s rate/try [%d %s/%d %d %s/%d %d %s/%d %d %s/%d], +%s: size %d (%d bytes) finaltsidx %d tries %d %s rate/try [%d %s/%d %d %s/%d %d %s/%d %d %s/%d], __func__, bin_to_size(size_to_bin(frame_size)), +frame_size, finalTSIdx, long_tries, ts-ts_status ? FAIL : OK, @@ -686,12 +739,10 @@ ath_rate_ctl_reset(struct ath_softc *sc, #defineRATE(_ix) (ni-ni_rates.rs_rates[(_ix)] IEEE80211_RATE_VAL) #defineDOT11RATE(_ix) (rt-info[(_ix)].dot11Rate IEEE80211_RATE_VAL) #defineMCS(_ix)(ni-ni_htrates.rs_rates[_ix] | IEEE80211_RATE_MCS) - struct ath_node *an = ATH_NODE(ni); - const struct ieee80211_txparam *tp = ni-ni_txparms; struct sample_node *sn = ATH_NODE_SAMPLE(an); const HAL_RATE_TABLE *rt = sc-sc_currates; - int x, y, srate, rix; + int x, y,
svn commit: r219823 - in head/tools/tools/nanobsd/rescue: . Files/root
Author: mr Date: Mon Mar 21 13:23:25 2011 New Revision: 219823 URL: http://svn.freebsd.org/changeset/base/219823 Log: Delete all GPT partitions at once. (Suggested by Andrey V. Elsukov bu7c...@yandex.ru) Fix amd64 merge script. Modified: head/tools/tools/nanobsd/rescue/Files/root/GPT4ZFS_Create.sh head/tools/tools/nanobsd/rescue/merge.sh Modified: head/tools/tools/nanobsd/rescue/Files/root/GPT4ZFS_Create.sh == --- head/tools/tools/nanobsd/rescue/Files/root/GPT4ZFS_Create.shMon Mar 21 12:51:13 2011(r219822) +++ head/tools/tools/nanobsd/rescue/Files/root/GPT4ZFS_Create.shMon Mar 21 13:23:25 2011(r219823) @@ -25,10 +25,7 @@ shift; while getopts :s:z: arg; do case #?) exerr ${usage};; esac; done; shift $(( ${OPTIND} - 1 )) -gpart delete -i 3 $dsk -gpart delete -i 2 $dsk -gpart delete -i 1 $dsk -gpart destroy $dsk +gpart destroy -F $dsk gpart create -s gpt $dsk # Boot Modified: head/tools/tools/nanobsd/rescue/merge.sh == --- head/tools/tools/nanobsd/rescue/merge.shMon Mar 21 12:51:13 2011 (r219822) +++ head/tools/tools/nanobsd/rescue/merge.shMon Mar 21 13:23:25 2011 (r219823) @@ -7,5 +7,12 @@ D2=/usr/obj/nanobsd.rescue_amd64 MD=`mdconfig -a -t vnode -f ${D1}/_.disk.full` dd if=${D2}/_.disk.image of=/dev/${MD}s2 bs=128k +tunefs -L rescues2a /dev/${MD}s2a +mount /dev/${MD}s2a ${D1}/_.mnt + +sed -i -e 's/rescues1/rescues2/' ${D1}/_.mnt/conf/base/etc/fstab +sed -i -e 's/rescues1/rescues2/' ${D1}/_.mnt/etc/fstab + +umount ${D1}/_.mnt mdconfig -d -u ${MD} ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219827 - head/sys/netgraph
Author: glebius Date: Mon Mar 21 14:18:40 2011 New Revision: 219827 URL: http://svn.freebsd.org/changeset/base/219827 Log: Improve locking of creating and dropping links in the graph, acquiring the topology mutex in the following functions, that manipulate pointers to peer nodes: - ng_bypass() - ng_path2noderef() when switching to the next node in sequence. Rewrite the function a bit. - ng_address_hook() - ng_address_path() This patch improves stability of large mpd5 installations. Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c == --- head/sys/netgraph/ng_base.c Mon Mar 21 14:11:37 2011(r219826) +++ head/sys/netgraph/ng_base.c Mon Mar 21 14:18:40 2011(r219827) @@ -1162,11 +1162,13 @@ ng_bypass(hook_p hook1, hook_p hook2) TRAP_ERROR(); return (EINVAL); } + mtx_lock(ng_topo_mtx); hook1-hk_peer-hk_peer = hook2-hk_peer; hook2-hk_peer-hk_peer = hook1-hk_peer; hook1-hk_peer = ng_deadhook; hook2-hk_peer = ng_deadhook; + mtx_unlock(ng_topo_mtx); NG_HOOK_UNREF(hook1); NG_HOOK_UNREF(hook2); @@ -1643,10 +1645,8 @@ ng_path2noderef(node_p here, const char node_p *destp, hook_p *lasthook) { charfullpath[NG_PATHSIZ]; - char *nodename, *path, pbuf[2]; + char *nodename, *path; node_p node, oldnode; - char *cp; - hook_p hook = NULL; /* Initialize */ if (destp == NULL) { @@ -1664,11 +1664,6 @@ ng_path2noderef(node_p here, const char TRAP_ERROR(); return EINVAL; } - if (path == NULL) { - pbuf[0] = '.'; /* Needs to be writable */ - pbuf[1] = '\0'; - path = pbuf; - } /* * For an absolute address, jump to the starting node. @@ -1690,41 +1685,41 @@ ng_path2noderef(node_p here, const char NG_NODE_REF(node); } + if (path == NULL) { + if (lasthook != NULL) + *lasthook = NULL; + *destp = node; + return (0); + } + /* * Now follow the sequence of hooks -* XXX -* We actually cannot guarantee that the sequence -* is not being demolished as we crawl along it -* without extra-ordinary locking etc. -* So this is a bit dodgy to say the least. -* We can probably hold up some things by holding -* the nodelist mutex for the time of this -* crawl if we wanted.. At least that way we wouldn't have to -* worry about the nodes disappearing, but the hooks would still -* be a problem. +* +* XXXGL: The path may demolish as we go the sequence, but if +* we hold the topology mutex at critical places, then, I hope, +* we would always have valid pointers in hand, although the +* path behind us may no longer exist. */ - for (cp = path; node != NULL *cp != '\0'; ) { + for (;;) { + hook_p hook; char *segment; /* * Break out the next path segment. Replace the dot we just -* found with a NUL; cp points to the next segment (or the +* found with a NUL; path points to the next segment (or the * NUL at the end). */ - for (segment = cp; *cp != '\0'; cp++) { - if (*cp == '.') { - *cp++ = '\0'; + for (segment = path; *path != '\0'; path++) { + if (*path == '.') { + *path++ = '\0'; break; } } - /* Empty segment */ - if (*segment == '\0') - continue; - /* We have a segment, so look for a hook by that name */ hook = ng_findhook(node, segment); + mtx_lock(ng_topo_mtx); /* Can't get there from here... */ if (hook == NULL || NG_HOOK_PEER(hook) == NULL @@ -1732,15 +1727,7 @@ ng_path2noderef(node_p here, const char || NG_HOOK_NOT_VALID(NG_HOOK_PEER(hook))) { TRAP_ERROR(); NG_NODE_UNREF(node); -#if 0 - printf(hooknotvalid %s %s %d %d %d %d , - path, - segment, - hook == NULL, - NG_HOOK_PEER(hook) == NULL, - NG_HOOK_NOT_VALID(hook), -
svn commit: r219828 - head/sys/netinet
Author: pluknet Date: Mon Mar 21 14:19:40 2011 New Revision: 219828 URL: http://svn.freebsd.org/changeset/base/219828 Log: Reference ifaddr object before unlocking as it can be freed from another context at the moment of later access. PR: kern/15 Submitted by: Andrew Boyer aboyer att averesystems.com Approved by: avg (mentor) MFC after:2 weeks Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c == --- head/sys/netinet/in.c Mon Mar 21 14:18:40 2011(r219827) +++ head/sys/netinet/in.c Mon Mar 21 14:19:40 2011(r219828) @@ -1174,8 +1174,8 @@ in_scrubprefix(struct in_ifaddr *target) * doesn't support such action. */ if ((ia-ia_flags IFA_ROUTE) == 0 -(ia-ia_ifp-if_type != IFT_CARP) - ) { +(ia-ia_ifp-if_type != IFT_CARP)) { + ifa_ref(ia-ia_ifa); IN_IFADDR_RUNLOCK(); rtinit((target-ia_ifa), (int)RTM_DELETE, rtinitflags(target)); @@ -1185,6 +1185,7 @@ in_scrubprefix(struct in_ifaddr *target) rtinitflags(ia) | RTF_UP); if (error == 0) ia-ia_flags |= IFA_ROUTE; + ifa_free(ia-ia_ifa); return (error); } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r219791 - head/sys/net
On Mon, Mar 21, 2011 at 11:38:20AM +0300, Gleb Smirnoff wrote: On Sun, Mar 20, 2011 at 08:35:00AM +, Dmitry Chagin wrote: D Author: dchagin D Date: Sun Mar 20 08:35:00 2011 D New Revision: 219791 D URL: http://svn.freebsd.org/changeset/base/219791 D D Log: D Remove dead code. This wasn't a code, but defines. Removing them saves nothing, but primitives deleted may be useful. Disagee here, trylock() is not a useful/common primitive, at least here. Others persisted from r183017 to r186119, most likely have been commited under the unknown drugs :) D MFC after: 1 Week D D Modified: D head/sys/net/route.h D D Modified: head/sys/net/route.h D == D --- head/sys/net/route.h Sun Mar 20 08:27:06 2011(r219790) D +++ head/sys/net/route.h Sun Mar 20 08:35:00 2011(r219791) D @@ -325,7 +325,6 @@ struct rt_addrinfo { D #define RT_LOCK_INIT(_rt) \ Dmtx_init((_rt)-rt_mtx, rtentry, NULL, MTX_DEF | MTX_DUPOK) D #define RT_LOCK(_rt)mtx_lock((_rt)-rt_mtx) D -#define RT_TRYLOCK(_rt) mtx_trylock((_rt)-rt_mtx) D #define RT_UNLOCK(_rt) mtx_unlock((_rt)-rt_mtx) D #define RT_LOCK_DESTROY(_rt)mtx_destroy((_rt)-rt_mtx) D #define RT_LOCK_ASSERT(_rt) mtx_assert((_rt)-rt_mtx, MA_OWNED) D @@ -360,22 +359,6 @@ struct rt_addrinfo { DRTFREE_LOCKED(_rt); \ D } while (0) D D -#define RT_TEMP_UNLOCK(_rt) do { \ D - RT_ADDREF(_rt); \ D - RT_UNLOCK(_rt); \ D -} while (0) D - D -#define RT_RELOCK(_rt) do { \ D - RT_LOCK(_rt); \ D - if ((_rt)-rt_refcnt = 1) {\ D - rtfree(_rt);\ D - _rt = 0; /* signal that it went away */\ D - } else {\ D - RT_REMREF(_rt); \ D - /* note that _rt is still valid */ \ D - } \ D -} while (0) D - D struct radix_node_head *rt_tables_get_rnh(int, int); D D struct ifmultiaddr; -- Totus tuus, Glebius. -- Have fun! chd pgpBgzphCNaSD.pgp Description: PGP signature
svn commit: r219830 - head/sbin/hastd
Author: pjd Date: Mon Mar 21 14:50:12 2011 New Revision: 219830 URL: http://svn.freebsd.org/changeset/base/219830 Log: Detect situation where resource internal identifier differs. This means that both nodes have separately managed resources that don't have the same data. MFC after:1 week Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c == --- head/sbin/hastd/secondary.c Mon Mar 21 14:29:35 2011(r219829) +++ head/sbin/hastd/secondary.c Mon Mar 21 14:50:12 2011(r219830) @@ -259,6 +259,19 @@ init_remote(struct hast_resource *res, s memset(map, 0xff, mapsize); } nv_add_uint8(nvout, HAST_SYNCSRC_PRIMARY, syncsrc); + } else if (res-hr_resuid != resuid) { + char errmsg[256]; + + (void)snprintf(errmsg, sizeof(errmsg), + Resource unique ID mismatch (primary=%ju, secondary=%ju)., + (uintmax_t)resuid, (uintmax_t)res-hr_resuid); + pjdlog_error(%s, errmsg); + nv_add_string(nvout, errmsg, errmsg); + if (hast_proto_send(res, res-hr_remotein, nvout, NULL, 0) 0) { + pjdlog_exit(EX_TEMPFAIL, Unable to send response to %s, + res-hr_remoteaddr); + } + exit(EX_CONFIG); } else if ( /* Is primary is out-of-date? */ (res-hr_secondary_localcnt res-hr_primary_remotecnt ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219831 - head/sbin/hastd
Author: pjd Date: Mon Mar 21 14:51:16 2011 New Revision: 219831 URL: http://svn.freebsd.org/changeset/base/219831 Log: Be pedantic and free nvout before exiting. MFC after:1 week Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c == --- head/sbin/hastd/secondary.c Mon Mar 21 14:50:12 2011(r219830) +++ head/sbin/hastd/secondary.c Mon Mar 21 14:51:16 2011(r219831) @@ -271,6 +271,7 @@ init_remote(struct hast_resource *res, s pjdlog_exit(EX_TEMPFAIL, Unable to send response to %s, res-hr_remoteaddr); } + nv_free(nvout); exit(EX_CONFIG); } else if ( /* Is primary is out-of-date? */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219832 - head/sbin/hastd
Author: pjd Date: Mon Mar 21 14:53:27 2011 New Revision: 219832 URL: http://svn.freebsd.org/changeset/base/219832 Log: Increase debug level of Checking hooks. message. MFC after:1 week Modified: head/sbin/hastd/hooks.c Modified: head/sbin/hastd/hooks.c == --- head/sbin/hastd/hooks.c Mon Mar 21 14:51:16 2011(r219831) +++ head/sbin/hastd/hooks.c Mon Mar 21 14:53:27 2011(r219832) @@ -288,7 +288,7 @@ hook_check(void) assert(hooks_initialized); - pjdlog_debug(1, Checking hooks.); + pjdlog_debug(2, Checking hooks.); /* * Report about processes that are running for a long time. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219833 - head/sbin/hastd
Author: pjd Date: Mon Mar 21 15:08:10 2011 New Revision: 219833 URL: http://svn.freebsd.org/changeset/base/219833 Log: Remove stale comment. Yes, it is valid to set role back to init. MFC after:1 week Modified: head/sbin/hastd/control.c Modified: head/sbin/hastd/control.c == --- head/sbin/hastd/control.c Mon Mar 21 14:53:27 2011(r219832) +++ head/sbin/hastd/control.c Mon Mar 21 15:08:10 2011(r219833) @@ -327,7 +327,7 @@ control_handle(struct hastd_config *cfg) if (cmd == HASTCTL_SET_ROLE) { role = nv_get_uint8(nvin, role); switch (role) { - case HAST_ROLE_INIT:/* Is that valid to set, hmm? */ + case HAST_ROLE_INIT: case HAST_ROLE_PRIMARY: case HAST_ROLE_SECONDARY: break; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219834 - head/sbin/ifconfig
Author: gjb (doc committer) Date: Mon Mar 21 15:17:02 2011 New Revision: 219834 URL: http://svn.freebsd.org/changeset/base/219834 Log: Bump date from previous commit. Modified: head/sbin/ifconfig/ifconfig.8 Modified: head/sbin/ifconfig/ifconfig.8 == --- head/sbin/ifconfig/ifconfig.8 Mon Mar 21 15:08:10 2011 (r219833) +++ head/sbin/ifconfig/ifconfig.8 Mon Mar 21 15:17:02 2011 (r219834) @@ -28,7 +28,7 @@ .\ From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\ $FreeBSD$ .\ -.Dd May 14, 2010 +.Dd March 20, 2011 .Dt IFCONFIG 8 .Os .Sh NAME ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219837 - head/sbin/hastd
Author: pjd Date: Mon Mar 21 15:29:20 2011 New Revision: 219837 URL: http://svn.freebsd.org/changeset/base/219837 Log: Before handling any events on descriptors check signals so we can update our info about worker processes if any of them was terminated in the meantime. This fixes the problem with 'hastctl status' running from a hook called on split-brain: 1. Secondary calls a hooks and terminates. 2. Hook asks for resource status via 'hastctl status'. 3. The main hastd handles the status request by sending it to the secondary worker who is already dead, but because signals weren't checked yet he doesn't know that and we get EPIPE. MFC after:1 week Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c == --- head/sbin/hastd/hastd.c Mon Mar 21 15:23:10 2011(r219836) +++ head/sbin/hastd/hastd.c Mon Mar 21 15:29:20 2011(r219837) @@ -884,19 +884,12 @@ out: } static void -main_loop(void) +check_signals(void) { - struct hast_resource *res; - struct timeval seltimeout; struct timespec sigtimeout; - int fd, maxfd, ret, signo; - time_t lastcheck, now; sigset_t mask; - fd_set rfds; + int signo; - lastcheck = time(NULL); - seltimeout.tv_sec = REPORT_INTERVAL; - seltimeout.tv_usec = 0; sigtimeout.tv_sec = 0; sigtimeout.tv_nsec = 0; @@ -906,29 +899,45 @@ main_loop(void) PJDLOG_VERIFY(sigaddset(mask, SIGTERM) == 0); PJDLOG_VERIFY(sigaddset(mask, SIGCHLD) == 0); + while ((signo = sigtimedwait(mask, NULL, sigtimeout)) != -1) { + switch (signo) { + case SIGINT: + case SIGTERM: + sigexit_received = true; + terminate_workers(); + proto_close(cfg-hc_controlconn); + exit(EX_OK); + break; + case SIGCHLD: + child_exit(); + break; + case SIGHUP: + hastd_reload(); + break; + default: + PJDLOG_ABORT(Unexpected signal (%d)., signo); + } + } +} + +static void +main_loop(void) +{ + struct hast_resource *res; + struct timeval seltimeout; + int fd, maxfd, ret; + time_t lastcheck, now; + fd_set rfds; + + lastcheck = time(NULL); + seltimeout.tv_sec = REPORT_INTERVAL; + seltimeout.tv_usec = 0; + pjdlog_info(Started successfully, running protocol version %d., HAST_PROTO_VERSION); for (;;) { - while ((signo = sigtimedwait(mask, NULL, sigtimeout)) != -1) { - switch (signo) { - case SIGINT: - case SIGTERM: - sigexit_received = true; - terminate_workers(); - proto_close(cfg-hc_controlconn); - exit(EX_OK); - break; - case SIGCHLD: - child_exit(); - break; - case SIGHUP: - hastd_reload(); - break; - default: - PJDLOG_ABORT(Unexpected signal (%d)., signo); - } - } + check_signals(); /* Setup descriptors for select(2). */ FD_ZERO(rfds); @@ -976,6 +985,12 @@ main_loop(void) pjdlog_exit(EX_OSERR, select() failed); } + /* +* Check for signals before we do anything to update our +* info about terminated workers in the meantime. +*/ + check_signals(); + if (FD_ISSET(proto_descriptor(cfg-hc_controlconn), rfds)) control_handle(cfg); if (FD_ISSET(proto_descriptor(cfg-hc_listenconn), rfds)) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219839 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Mon Mar 21 17:12:03 2011 New Revision: 219839 URL: http://svn.freebsd.org/changeset/base/219839 Log: This CLKDRV workaround should only be for AR5416 v2.0/2.1; the check was too strict and enabled it for all non AR5416-v2.2 chipsets - including later ones. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 21 15:51:22 2011(r219838) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 21 17:12:03 2011(r219839) @@ -277,7 +277,8 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s HAL_INI_INIT(AH5416(ah)-ah_ini_bank7, ar5416Bank7, 2); HAL_INI_INIT(AH5416(ah)-ah_ini_addac, ar5416Addac, 2); - if (!IS_5416V2_2(ah)) { /* Owl 2.1/2.0 */ + if (! AR_SREV_OWL_22_OR_LATER(ah)) {/* Owl 2.1/2.0 */ + ath_hal_printf(ah, [ath] Enabling CLKDRV workaround for AR5416 v2.2\n); struct ini { uint32_t*data; /* NB: !const */ int rows, cols; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219840 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Mon Mar 21 17:44:52 2011 New Revision: 219840 URL: http://svn.freebsd.org/changeset/base/219840 Log: Back that commit out - something's broken, and I need to figure out what/why. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 21 17:12:03 2011(r219839) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Mar 21 17:44:52 2011(r219840) @@ -277,7 +277,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s HAL_INI_INIT(AH5416(ah)-ah_ini_bank7, ar5416Bank7, 2); HAL_INI_INIT(AH5416(ah)-ah_ini_addac, ar5416Addac, 2); - if (! AR_SREV_OWL_22_OR_LATER(ah)) {/* Owl 2.1/2.0 */ + if (! IS_5416V2_2(ah)) {/* Owl 2.1/2.0 */ ath_hal_printf(ah, [ath] Enabling CLKDRV workaround for AR5416 v2.2\n); struct ini { uint32_t*data; /* NB: !const */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
Hi All, On Sun, Mar 20, 2011 at 05:22:12PM +0100, Marius Strobl wrote: I fear it's still a bit premature for enable SU+J by default. Rather recently I was told about a SU+J filesystems lost after a panic that happend after snapshotting it (report CC'ed, maybe he can provide some more details) and I'm pretty sure I've seen the problem described in PR 149022 also after the potential fix mentioned in its feedback. Sorry, no details available, as I didn't record the panic and problems back then. However this was not the first panic which I attribute (maybe wrongly) to SUJ and as an consequence now all my UFS filesystems have SUJ turned off again. If SUJ really is going to be the default I would expact quite some fallout from this after my experiences. Kind Regards -- Michael Moll ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219841 - in head/sys: conf ia64/ia64 ia64/include
Author: marcel Date: Mon Mar 21 18:20:53 2011 New Revision: 219841 URL: http://svn.freebsd.org/changeset/base/219841 Log: Fix switching to physical mode as part of calling into EFI runtime services or PAL procedures. The new implementation is based on specific functions that are known to be called in certain scenarios only. This in particular fixes the PAL call to obtain information about translation registers. In general, the new implementation does not bank on virtual addresses being direct-mapped and will work when the kernel uses PBVM. When new scenarios need to be supported, new functions are added if the existing functions cannot be changed to handle the new scenario. If a single generic implementation is possible, it will become clear in due time. While here, change bootinfo to a pointer type in anticipation of future development. Added: head/sys/ia64/ia64/physical.S (contents, props changed) Modified: head/sys/conf/files.ia64 head/sys/ia64/ia64/efi.c head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/pal.S head/sys/ia64/ia64/pmap.c head/sys/ia64/ia64/support.S head/sys/ia64/include/bootinfo.h head/sys/ia64/include/efi.h head/sys/ia64/include/pal.h head/sys/ia64/include/vmparam.h Modified: head/sys/conf/files.ia64 == --- head/sys/conf/files.ia64Mon Mar 21 17:44:52 2011(r219840) +++ head/sys/conf/files.ia64Mon Mar 21 18:20:53 2011(r219841) @@ -95,6 +95,7 @@ ia64/ia64/mem.c optionalmem ia64/ia64/mp_machdep.c optionalsmp ia64/ia64/nexus.c standard ia64/ia64/pal.Sstandard +ia64/ia64/physical.S standard ia64/ia64/pmap.c standard ia64/ia64/ptrace_machdep.c standard ia64/ia64/sal.cstandard Modified: head/sys/ia64/ia64/efi.c == --- head/sys/ia64/ia64/efi.cMon Mar 21 17:44:52 2011(r219840) +++ head/sys/ia64/ia64/efi.cMon Mar 21 18:20:53 2011(r219841) @@ -32,13 +32,11 @@ __FBSDID($FreeBSD$); #include sys/systm.h #include machine/bootinfo.h #include machine/efi.h +#include machine/md_var.h #include machine/sal.h #include vm/vm.h #include vm/pmap.h -extern uint64_t ia64_call_efi_physical(uint64_t, uint64_t, uint64_t, uint64_t, -uint64_t, uint64_t); - static struct efi_systbl *efi_systbl; static struct efi_cfgtbl *efi_cfgtbl; static struct efi_rt *efi_runtime; @@ -96,6 +94,7 @@ efi_boot_finish(void) int efi_boot_minimal(uint64_t systbl) { + ia64_efi_f setvirt; struct efi_md *md; efi_status status; @@ -121,18 +120,16 @@ efi_boot_minimal(uint64_t systbl) md = efi_md_first(); while (md != NULL) { if (md-md_attr EFI_MD_ATTR_RT) { - if (md-md_attr EFI_MD_ATTR_WB) - md-md_virt = - (void *)IA64_PHYS_TO_RR7(md-md_phys); - else if (md-md_attr EFI_MD_ATTR_UC) - md-md_virt = pmap_mapdev(md-md_phys, - md-md_pages * EFI_PAGE_SIZE); + md-md_virt = (md-md_attr EFI_MD_ATTR_WB) ? + (void *)IA64_PHYS_TO_RR7(md-md_phys) : + (void *)IA64_PHYS_TO_RR6(md-md_phys); } md = efi_md_next(md); } - status = ia64_call_efi_physical((uint64_t)efi_runtime-rt_setvirtual, - bootinfo.bi_memmap_size, bootinfo.bi_memdesc_size, - bootinfo.bi_memdesc_version, bootinfo.bi_memmap, 0); + setvirt = (void *)IA64_PHYS_TO_RR7((u_long)efi_runtime-rt_setvirtual); + status = ia64_efi_physical(setvirt, bootinfo-bi_memmap_size, + bootinfo-bi_memdesc_size, bootinfo-bi_memdesc_version, + bootinfo-bi_memmap); return ((status 0) ? EFAULT : 0); } @@ -165,9 +162,9 @@ struct efi_md * efi_md_first(void) { - if (bootinfo.bi_memmap == 0) + if (bootinfo-bi_memmap == 0) return (NULL); - return ((struct efi_md *)IA64_PHYS_TO_RR7(bootinfo.bi_memmap)); + return ((struct efi_md *)IA64_PHYS_TO_RR7(bootinfo-bi_memmap)); } struct efi_md * @@ -175,8 +172,8 @@ efi_md_next(struct efi_md *md) { uint64_t plim; - plim = IA64_PHYS_TO_RR7(bootinfo.bi_memmap + bootinfo.bi_memmap_size); - md = (struct efi_md *)((uintptr_t)md + bootinfo.bi_memdesc_size); + plim = IA64_PHYS_TO_RR7(bootinfo-bi_memmap + bootinfo-bi_memmap_size); + md = (struct efi_md *)((uintptr_t)md + bootinfo-bi_memdesc_size); return ((md = (struct efi_md *)plim) ? NULL : md); } Modified: head/sys/ia64/ia64/machdep.c == ---
Re: svn commit: r219676 - head/sys/x86/x86
On Sun, 20 Mar 2011, David Malone wrote: On Wed, Mar 16, 2011 at 04:34:10PM +1100, Bruce Evans wrote: Please revert. I use this for setting timecounters from userland. The sysctl is not a hack, but the primary user interface for managing the TSC frequency. The kern.timecounter.tc.TSC.frequency sysctl is secondary, and is readonly anyway, so it cannot be used to manage the TSC frequency or even the timecounter frequency. Some people have asked me if I can make kern.timecounter.tc.*.frequency writeable. I have it on my list of jobs to look at, but haven't had a chance yet. Are there any obvious problems with this? No new ones. Just the old ones of updating the frequency and all related variables without races. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
On Mon, 21 Mar 2011, Michael Moll wrote: Hi All, On Sun, Mar 20, 2011 at 05:22:12PM +0100, Marius Strobl wrote: I fear it's still a bit premature for enable SU+J by default. Rather recently I was told about a SU+J filesystems lost after a panic that happend after snapshotting it (report CC'ed, maybe he can provide some more details) and I'm pretty sure I've seen the problem described in PR 149022 also after the potential fix mentioned in its feedback. Sorry, no details available, as I didn't record the panic and problems back then. However this was not the first panic which I attribute (maybe wrongly) to SUJ and as an consequence now all my UFS filesystems have SUJ turned off again. If SUJ really is going to be the default I would expact quite some fallout from this after my experiences. How long ago was this? We fixed quite a number of bugs a few months ago. Thanks, Jeff Kind Regards -- Michael Moll ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219843 - head/sbin/hastd
Author: pjd Date: Mon Mar 21 21:14:07 2011 New Revision: 219843 URL: http://svn.freebsd.org/changeset/base/219843 Log: Fix typo. MFC after:1 week Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c == --- head/sbin/hastd/secondary.c Mon Mar 21 18:39:42 2011(r219842) +++ head/sbin/hastd/secondary.c Mon Mar 21 21:14:07 2011(r219843) @@ -277,7 +277,7 @@ init_remote(struct hast_resource *res, s /* Is primary is out-of-date? */ (res-hr_secondary_localcnt res-hr_primary_remotecnt res-hr_secondary_remotecnt == res-hr_primary_localcnt) || - /* Node are more or less in sync? */ + /* Nodes are more or less in sync? */ (res-hr_secondary_localcnt == res-hr_primary_remotecnt res-hr_secondary_remotecnt == res-hr_primary_localcnt) || /* Is secondary is out-of-date? */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219846 - in head/sys/ofed: drivers/infiniband/hw/mthca include/linux include/rdma
Author: kib Date: Mon Mar 21 21:16:40 2011 New Revision: 219846 URL: http://svn.freebsd.org/changeset/base/219846 Log: Allow the ofed modules to be compiled on i386. Reviewed by: jeff Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c head/sys/ofed/include/linux/gfp.h head/sys/ofed/include/linux/scatterlist.h head/sys/ofed/include/rdma/ib_addr.h Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c == --- head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c Mon Mar 21 21:16:25 2011(r219845) +++ head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c Mon Mar 21 21:16:40 2011(r219846) @@ -1228,8 +1228,8 @@ static int __devinit mthca_init_one(stru } if (id-driver_data = ARRAY_SIZE(mthca_hca_table)) { - printk(KERN_ERR PFX %s has invalid driver data %lx\n, - pci_name(pdev), id-driver_data); + printk(KERN_ERR PFX %s has invalid driver data %jx\n, + pci_name(pdev), (uintmax_t)id-driver_data); mutex_unlock(mthca_device_mutex); return -ENODEV; } Modified: head/sys/ofed/include/linux/gfp.h == --- head/sys/ofed/include/linux/gfp.h Mon Mar 21 21:16:25 2011 (r219845) +++ head/sys/ofed/include/linux/gfp.h Mon Mar 21 21:16:40 2011 (r219846) @@ -56,7 +56,8 @@ page_address(struct page *page) if (page-object != kmem_object page-object != kernel_object) return (NULL); - return (void *)(VM_MIN_KERNEL_ADDRESS + IDX_TO_OFF(page-pindex)); + return ((void *)(uintptr_t)(VM_MIN_KERNEL_ADDRESS + + IDX_TO_OFF(page-pindex))); } static inline unsigned long Modified: head/sys/ofed/include/linux/scatterlist.h == --- head/sys/ofed/include/linux/scatterlist.h Mon Mar 21 21:16:25 2011 (r219845) +++ head/sys/ofed/include/linux/scatterlist.h Mon Mar 21 21:16:40 2011 (r219846) @@ -36,7 +36,7 @@ struct scatterlist { struct page *page; struct scatterlist *sg; } sl_un; - unsigned long address; + dma_addr_t address; unsigned long offset; uint32_tlength; uint32_tflags; Modified: head/sys/ofed/include/rdma/ib_addr.h == --- head/sys/ofed/include/rdma/ib_addr.hMon Mar 21 21:16:25 2011 (r219845) +++ head/sys/ofed/include/rdma/ib_addr.hMon Mar 21 21:16:40 2011 (r219846) @@ -247,6 +247,7 @@ static inline int iboe_get_rate(struct n #else static inline int iboe_get_rate(struct net_device *dev) { +#ifdef __amd64__ if (dev-if_baudrate = IF_Gbps(40ULL)) return IB_RATE_40_GBPS; else if (dev-if_baudrate = IF_Gbps(30ULL)) @@ -256,6 +257,7 @@ static inline int iboe_get_rate(struct n else if (dev-if_baudrate = IF_Gbps(10ULL)) return IB_RATE_10_GBPS; else +#endif return IB_RATE_PORT_CURRENT; } #endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219845 - head/sys/dev/usb/controller
Author: hselasky Date: Mon Mar 21 21:16:25 2011 New Revision: 219845 URL: http://svn.freebsd.org/changeset/base/219845 Log: - Bugfix: Fix a EHCI hardware race, where the hardware computed data toggle value is updated after that we read it in the queue-head. This patch can fix problems with BULK timeouts. The issue was found on a Nvidia chipset. MFC after:14 days Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/ehci.c Modified: head/sys/dev/usb/controller/ehci.c == --- head/sys/dev/usb/controller/ehci.c Mon Mar 21 21:16:12 2011 (r219844) +++ head/sys/dev/usb/controller/ehci.c Mon Mar 21 21:16:25 2011 (r219845) @@ -1180,6 +1180,26 @@ _ehci_remove_qh(ehci_qh_t *sqh, ehci_qh_ return (last); } +static void +ehci_data_toggle_update(struct usb_xfer *xfer, uint16_t actlen, uint16_t xlen) +{ + uint8_t full = (actlen == xlen); + uint8_t dt; + + /* count number of full packets */ + dt = (actlen / xfer-max_packet_size) 1; + + /* cumpute remainder */ + actlen = actlen % xfer-max_packet_size; + + if (actlen 0) + dt ^= 1;/* short packet at the end */ + else if (!full) + dt ^= 1;/* zero length packet at the end */ + + xfer-endpoint-toggle_next ^= dt; +} + static usb_error_t ehci_non_isoc_done_sub(struct usb_xfer *xfer) { @@ -1213,7 +1233,10 @@ ehci_non_isoc_done_sub(struct usb_xfer * status |= EHCI_QTD_HALTED; } else if (xfer-aframes != xfer-nframes) { xfer-frlengths[xfer-aframes] += td-len - len; + /* manually update data toggle */ + ehci_data_toggle_update(xfer, td-len - len, td-len); } + /* Check for last transfer */ if (((void *)td) == xfer-td_transfer_last) { td = NULL; @@ -1295,9 +1318,6 @@ ehci_non_isoc_done(struct usb_xfer *xfer status = hc32toh(sc, qh-qh_qtd.qtd_status); - xfer-endpoint-toggle_next = - (status EHCI_QTD_TOGGLE_MASK) ? 1 : 0; - /* reset scanner */ xfer-td_transfer_cache = xfer-td_transfer_first; @@ -1876,6 +1896,8 @@ ehci_setup_standard_chain(struct usb_xfe if (xfer-flags_int.control_xfr) { if (xfer-flags_int.control_hdr) { + xfer-endpoint-toggle_next = 0; + temp.qtd_status = htohc32(temp.sc, EHCI_QTD_SET_CERR(3)); temp.qtd_status |= htohc32(temp.sc, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219847 - in head/sbin: hastctl hastd
Author: pjd Date: Mon Mar 21 21:31:50 2011 New Revision: 219847 URL: http://svn.freebsd.org/changeset/base/219847 Log: When dropping privileges prefer capsicum over chroot+setgid+setuid. We can use capsicum for secondary worker processes and hastctl. When working as primary we drop privileges using chroot+setgid+setuid still as we need to send ioctl(2)s to ggate device, for which capsicum doesn't allow (yet). X-MFC after: capsicum is merged to stable/8 Modified: head/sbin/hastctl/hastctl.c head/sbin/hastd/primary.c head/sbin/hastd/secondary.c head/sbin/hastd/subr.c head/sbin/hastd/subr.h Modified: head/sbin/hastctl/hastctl.c == --- head/sbin/hastctl/hastctl.c Mon Mar 21 21:16:40 2011(r219846) +++ head/sbin/hastctl/hastctl.c Mon Mar 21 21:31:50 2011(r219847) @@ -480,9 +480,8 @@ main(int argc, char *argv[]) cfg-hc_controladdr); } - if (drop_privs() != 0) + if (drop_privs(true) != 0) exit(EX_CONFIG); - pjdlog_debug(1, Privileges successfully dropped.); /* Send the command to the server... */ if (hast_proto_send(NULL, controlconn, nv, NULL, 0) 0) { Modified: head/sbin/hastd/primary.c == --- head/sbin/hastd/primary.c Mon Mar 21 21:16:40 2011(r219846) +++ head/sbin/hastd/primary.c Mon Mar 21 21:31:50 2011(r219847) @@ -874,7 +874,7 @@ hastd_primary(struct hast_resource *res) init_ggate(res); init_environment(res); - if (drop_privs() != 0) { + if (drop_privs(true) != 0) { cleanup(res); exit(EX_CONFIG); } Modified: head/sbin/hastd/secondary.c == --- head/sbin/hastd/secondary.c Mon Mar 21 21:16:40 2011(r219846) +++ head/sbin/hastd/secondary.c Mon Mar 21 21:31:50 2011(r219847) @@ -440,7 +440,7 @@ hastd_secondary(struct hast_resource *re init_local(res); init_environment(); - if (drop_privs() != 0) + if (drop_privs(true) != 0) exit(EX_CONFIG); pjdlog_info(Privileges successfully dropped.); Modified: head/sbin/hastd/subr.c == --- head/sbin/hastd/subr.c Mon Mar 21 21:16:40 2011(r219846) +++ head/sbin/hastd/subr.c Mon Mar 21 21:31:50 2011(r219847) @@ -30,6 +30,7 @@ #include sys/cdefs.h __FBSDID($FreeBSD$); +#include sys/capability.h #include sys/types.h #include sys/disk.h #include sys/ioctl.h @@ -39,6 +40,7 @@ __FBSDID($FreeBSD$); #include fcntl.h #include pwd.h #include stdarg.h +#include stdbool.h #include stdio.h #include string.h #include unistd.h @@ -144,13 +146,22 @@ role2str(int role) } int -drop_privs(void) +drop_privs(bool usecapsicum) { struct passwd *pw; uid_t ruid, euid, suid; gid_t rgid, egid, sgid; gid_t gidset[1]; + if (usecapsicum) { + if (cap_enter() == 0) { + pjdlog_debug(1, + Privileges successfully dropped using capsicum.); + return (0); + } + pjdlog_errno(LOG_WARNING, Unable to sandbox using capsicum); + } + /* * According to getpwnam(3) we have to clear errno before calling the * function to be able to distinguish between an error and missing @@ -208,5 +219,8 @@ drop_privs(void) PJDLOG_VERIFY(getgroups(1, gidset) == 1); PJDLOG_VERIFY(gidset[0] == pw-pw_gid); + pjdlog_debug(1, + Privileges successfully dropped using chroot+setgid+setuid.); + return (0); } Modified: head/sbin/hastd/subr.h == --- head/sbin/hastd/subr.h Mon Mar 21 21:16:40 2011(r219846) +++ head/sbin/hastd/subr.h Mon Mar 21 21:31:50 2011(r219847) @@ -50,6 +50,6 @@ int snprlcat(char *str, size_t size, con int provinfo(struct hast_resource *res, bool dowrite); const char *role2str(int role); -int drop_privs(void); +int drop_privs(bool usecapsicum); #endif /* !_SUBR_H_ */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219848 - head/sys/dev/usb/input
Author: hselasky Date: Mon Mar 21 21:34:12 2011 New Revision: 219848 URL: http://svn.freebsd.org/changeset/base/219848 Log: - Do not output the trailing newline to the HID report descriptor information, sysctl utility will show it for us. - Modify sysctl node description to make it more understanable. Found by: Alexander Best arun...@freebsd.org Submitted by: Eygene Ryabinkin r...@freebsd.org MFC after:14 days Approved by: thompsa (mentor) Modified: head/sys/dev/usb/input/ums.c Modified: head/sys/dev/usb/input/ums.c == --- head/sys/dev/usb/input/ums.cMon Mar 21 21:31:50 2011 (r219847) +++ head/sys/dev/usb/input/ums.cMon Mar 21 21:34:12 2011 (r219848) @@ -668,7 +668,7 @@ ums_attach(device_t dev) SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, parseinfo, CTLTYPE_STRING|CTLFLAG_RD, sc, 0, ums_sysctl_handler_parseinfo, - , Dump UMS report parsing information); + , Dump of parsed HID report descriptor); return (0); @@ -949,10 +949,10 @@ ums_sysctl_handler_parseinfo(SYSCTL_HAND struct ums_softc *sc = arg1; struct ums_info *info; struct sbuf *sb; - int i, j, err; + int i, j, err, had_output; sb = sbuf_new_auto(); - for (i = 0; i UMS_INFO_MAX; i++) { + for (i = 0, had_output = 0; i UMS_INFO_MAX; i++) { info = sc-sc_info[i]; /* Don't emit empty info */ @@ -962,6 +962,9 @@ ums_sysctl_handler_parseinfo(SYSCTL_HAND info-sc_buttons == 0) continue; + if (had_output) + sbuf_printf(sb, \n); + had_output = 1; sbuf_printf(sb, i%d:, i + 1); if (info-sc_flags UMS_FLAG_X_AXIS) sbuf_printf(sb, X:r%d, p%d, s%d;, @@ -995,7 +998,6 @@ ums_sysctl_handler_parseinfo(SYSCTL_HAND (int)info-sc_loc_btn[j].pos, (int)info-sc_loc_btn[j].size); } - sbuf_printf(sb, \n); } sbuf_finish(sb); err = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219849 - head/sys/modules
Author: jeff Date: Mon Mar 21 21:35:19 2011 New Revision: 219849 URL: http://svn.freebsd.org/changeset/base/219849 Log: - For now, disable ofed module build unless MK_OFED is set. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile == --- head/sys/modules/Makefile Mon Mar 21 21:34:12 2011(r219848) +++ head/sys/modules/Makefile Mon Mar 21 21:35:19 2011(r219849) @@ -185,9 +185,9 @@ SUBDIR= ${_3dfx} \ mfi \ mii \ mlx \ - mlx4 \ - mlx4ib \ - mlxen \ + ${_mlx4} \ + ${_mlx4ib} \ + ${_mlxen} \ ${_mly} \ mmc \ mmcsd \ @@ -198,7 +198,7 @@ SUBDIR= ${_3dfx} \ msdosfs_iconv \ ${_mse} \ msk \ - mthca \ + ${_mthca} \ mvs \ mwl \ mwlfw \ @@ -673,6 +673,13 @@ _zfs= zfs .endif .endif +.if ${MK_OFED} != no || defined(ALL_MODULES) +_mthca=mthca +_mlx4= mlx4 +_mlx4ib= mlx4ib +_mlxen=mlxen +.endif + .if defined(MODULES_OVERRIDE) !defined(ALL_MODULES) SUBDIR=${MODULES_OVERRIDE} .endif @@ -690,5 +697,6 @@ afterinstall: kldxref ${DESTDIR}${KMODDIR}; \ fi .endif +#endif .include bsd.subdir.mk ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
Hi, On Mon, Mar 21, 2011 at 11:02:10AM -1000, Jeff Roberson wrote: Sorry, no details available, as I didn't record the panic and problems back then. However this was not the first panic which I attribute (maybe wrongly) to SUJ and as an consequence now all my UFS filesystems have SUJ turned off again. If SUJ really is going to be the default I would expact quite some fallout from this after my experiences. How long ago was this? Almost exactly two months ago. 19./20.01.2011 Regards -- Michael Moll ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219850 - head/lib/libutil
Author: gjb (doc committer) Date: Mon Mar 21 23:59:20 2011 New Revision: 219850 URL: http://svn.freebsd.org/changeset/base/219850 Log: s/buffer/buf as is used in the code. Submitted by: arundel (via doc@) MFC after:3 days Modified: head/lib/libutil/humanize_number.3 Modified: head/lib/libutil/humanize_number.3 == --- head/lib/libutil/humanize_number.3 Mon Mar 21 21:35:19 2011 (r219849) +++ head/lib/libutil/humanize_number.3 Mon Mar 21 23:59:20 2011 (r219850) @@ -49,12 +49,12 @@ The function formats the signed 64-bit quantity given in .Fa number into -.Fa buffer . +.Fa buf . A space and then .Fa suffix is appended to the end. The buffer pointed to by -.Fa buffer +.Fa buf must be at least .Fa len bytes long. @@ -62,7 +62,7 @@ bytes long. If the formatted number (including .Fa suffix ) would be too long to fit into -.Fa buffer , +.Fa buf , then divide .Fa number by 1024 until it will. @@ -91,7 +91,7 @@ The argument must be at least 4 plus the length of .Fa suffix , in order to ensure a useful result is generated into -.Fa buffer . +.Fa buf . To use a specific prefix, specify this as .Fa scale (multiplier = 1024 ^ scale). @@ -132,7 +132,7 @@ with 1000 instead of 1024. The .Fn humanize_number function returns the number of characters stored in -.Fa buffer +.Fa buf (excluding the terminating .Dv NUL ) upon success, or \-1 upon failure. ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219851 - head/sys/dev/ath/ath_hal
Author: adrian Date: Tue Mar 22 00:11:04 2011 New Revision: 219851 URL: http://svn.freebsd.org/changeset/base/219851 Log: Remove the merlin delay workaround here, it isn't appropriate for the analog bank writes as Merlin never does them. Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c == --- head/sys/dev/ath/ath_hal/ah.c Mon Mar 21 23:59:20 2011 (r219850) +++ head/sys/dev/ath/ath_hal/ah.c Tue Mar 22 00:11:04 2011 (r219851) @@ -976,12 +976,6 @@ ath_hal_ini_bank_write(struct ath_hal *a for (r = 0; r ia-rows; r++) { OS_REG_WRITE(ah, HAL_INI_VAL(ia, r, 0), data[r]); - - /* Analog shift register delay seems needed for Merlin - PR kern/154220 */ - /* XXX verify whether any analog radio bank writes will hit up this */ - /* XXX since this is a merlin work-around; and merlin doesn't use radio banks */ - if (HAL_INI_VAL(ia, r, 0) = 0x7800 HAL_INI_VAL(ia, r, 0) 0x78a0) - OS_DELAY(100); DMA_YIELD(regWr); } return regWr; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219852 - in head/sys/dev/ath/ath_hal: ar9001 ar9002
Author: adrian Date: Tue Mar 22 00:12:26 2011 New Revision: 219852 URL: http://svn.freebsd.org/changeset/base/219852 Log: Even though it's very unlikely the misc mode register setting at -attach- would be a problem, make sure it isn't overwritten by whatever is in there at cold reset. This brings the ar5416 init path treatment of AR_MISC_MODE. Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c == --- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Tue Mar 22 00:11:04 2011(r219851) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Tue Mar 22 00:12:26 2011(r219852) @@ -247,7 +247,7 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s * placed into hardware. */ if (ahp-ah_miscMode != 0) - OS_REG_WRITE(ah, AR_MISC_MODE, ahp-ah_miscMode); + OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp-ah_miscMode); ar9160AniSetup(ah); /* Anti Noise Immunity */ Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c == --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Mar 22 00:11:04 2011(r219851) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Tue Mar 22 00:12:26 2011(r219852) @@ -333,7 +333,7 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s * placed into hardware. */ if (ahp-ah_miscMode != 0) - OS_REG_WRITE(ah, AR_MISC_MODE, ahp-ah_miscMode); + OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp-ah_miscMode); ar9280AniSetup(ah); /* Anti Noise Immunity */ Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c == --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Tue Mar 22 00:11:04 2011(r219851) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Tue Mar 22 00:12:26 2011(r219852) @@ -284,7 +284,7 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s * placed into hardware. */ if (ahp-ah_miscMode != 0) - OS_REG_WRITE(ah, AR_MISC_MODE, ahp-ah_miscMode); + OS_REG_WRITE(ah, AR_MISC_MODE, OS_REG_READ(ah, AR_MISC_MODE) | ahp-ah_miscMode); ar9285AniSetup(ah); /* Anti Noise Immunity */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219853 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Tue Mar 22 00:14:17 2011 New Revision: 219853 URL: http://svn.freebsd.org/changeset/base/219853 Log: Bring over a few queue changes from ath9k: * add pspoll/uapsd queue setup defaults; * enable the exponential backoff window rather than the random backoff window when doing TX contention management. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Tue Mar 22 00:12:26 2011(r219852) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Tue Mar 22 00:14:17 2011(r219853) @@ -779,6 +779,14 @@ ar5416SetupTxQueue(struct ath_hal *ah, H | HAL_TXQ_ARB_LOCKOUT_GLOBAL | HAL_TXQ_BACKOFF_DISABLE; break; + case HAL_TX_QUEUE_PSPOLL: + q = 1; /* lowest priority */ + defqflags |= HAL_TXQ_DBA_GATED + | HAL_TXQ_CBR_DIS_QEMPTY + | HAL_TXQ_CBR_DIS_BEMPTY + | HAL_TXQ_ARB_LOCKOUT_GLOBAL + | HAL_TXQ_BACKOFF_DISABLE; + break; case HAL_TX_QUEUE_UAPSD: q = pCap-halTotalQueues-3; /* nextest highest priority */ if (ahp-ah_txq[q].tqi_type != HAL_TX_QUEUE_INACTIVE) { @@ -919,6 +927,9 @@ ar5416ResetTxQueue(struct ath_hal *ah, u /* NB: always enable DCU to wait for next fragment from QCU */ dmisc = AR_D_MISC_FRAG_WAIT_EN; + /* Enable exponential backoff window */ + dmisc |= AR_D_MISC_BKOFF_PERSISTENCE; + /* * The chip reset default is to use a DCU backoff threshold of 0x2. * Restore this when programming the DCU MISC register. @@ -1021,6 +1032,12 @@ ar5416ResetTxQueue(struct ath_hal *ah, u dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, AR_D_MISC_ARB_LOCKOUT_CNTRL); break; + case HAL_TX_QUEUE_PSPOLL: + qmisc |= AR_Q_MISC_CBR_INCR_DIS1; + break; + case HAL_TX_QUEUE_UAPSD: + dmisc |= AR_D_MISC_POST_FR_BKOFF_DIS; + break; default:/* NB: silence compiler */ break; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219854 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Tue Mar 22 00:43:58 2011 New Revision: 219854 URL: http://svn.freebsd.org/changeset/base/219854 Log: Do a bit of spring cleaning in the board setup code, just to bring it in line with the rest of the register initialisation. I've verified that the 2/5ghz board values written to the chip match what was previously written. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Mar 22 00:14:17 2011(r219853) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Mar 22 00:43:58 2011(r219854) @@ -1317,16 +1317,12 @@ ar5416SetDefGainValues(struct ath_hal *a AR_PHY_GAIN_2GHZ_XATTEN2_DB, pModal-xatten2Db[i]); } else { - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, - (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) - ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) - | SM(pModal- bswMargin[i], - AR_PHY_GAIN_2GHZ_BSW_MARGIN)); - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, - (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) - ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) - | SM(pModal-bswAtten[i], - AR_PHY_GAIN_2GHZ_BSW_ATTEN)); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, + AR_PHY_GAIN_2GHZ_BSW_MARGIN, + pModal-bswMargin[i]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, + AR_PHY_GAIN_2GHZ_BSW_ATTEN, + pModal-bswAtten[i]); } } @@ -1338,16 +1334,12 @@ ar5416SetDefGainValues(struct ath_hal *a AR_PHY_RXGAIN + regChainOffset, AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal-rxTxMarginCh[i]); } else { - OS_REG_WRITE(ah, + OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset, - (OS_REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) - ~AR_PHY_RXGAIN_TXRX_ATTEN) - | SM(txRxAttenLocal, AR_PHY_RXGAIN_TXRX_ATTEN)); - OS_REG_WRITE(ah, + AR_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, - (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) - ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | - SM(pModal-rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); + AR_PHY_GAIN_2GHZ_RXTX_MARGIN, pModal-rxTxMarginCh[i]); } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219855 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Tue Mar 22 00:52:44 2011 New Revision: 219855 URL: http://svn.freebsd.org/changeset/base/219855 Log: Break out the RF mode setup into ar5416SetRfMode(), mirroring what ath9k does. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Mar 22 00:43:58 2011(r219854) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Mar 22 00:52:44 2011(r219855) @@ -598,6 +598,29 @@ ar5416InitUserSettings(struct ath_hal *a #endif } +static void +ar5416SetRfMode(struct ath_hal *ah, const struct ieee80211_channel *chan) +{ + uint32_t rfMode; + + if (chan == AH_NULL) + return; + + /* treat channel B as channel G , no B mode suport in owl */ + rfMode = IEEE80211_IS_CHAN_CCK(chan) ? + AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM; + + if (AR_SREV_MERLIN_20(ah) IS_5GHZ_FAST_CLOCK_EN(ah, chan)) { + /* phy mode bits for 5GHz channels require Fast Clock */ + rfMode |= AR_PHY_MODE_DYNAMIC + | AR_PHY_MODE_DYN_CCK_DISABLE; + } else if (!AR_SREV_MERLIN_10_OR_LATER(ah)) { + rfMode |= IEEE80211_IS_CHAN_5GHZ(chan) ? + AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ; + } + OS_REG_WRITE(ah, AR_PHY_MODE, rfMode); +} + /* * Places the hardware into reset and then pulls it out of reset */ @@ -629,22 +652,9 @@ ar5416ChipReset(struct ath_hal *ah, cons * with an active radio can result in corrupted shifts to the * radio device. */ - if (chan != AH_NULL) { - uint32_t rfMode; + if (chan != AH_NULL) + ar5416SetRfMode(ah, chan); - /* treat channel B as channel G , no B mode suport in owl */ - rfMode = IEEE80211_IS_CHAN_CCK(chan) ? - AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM; - if (AR_SREV_MERLIN_20(ah) IS_5GHZ_FAST_CLOCK_EN(ah, chan)) { - /* phy mode bits for 5GHz channels require Fast Clock */ - rfMode |= AR_PHY_MODE_DYNAMIC - | AR_PHY_MODE_DYN_CCK_DISABLE; - } else if (!AR_SREV_MERLIN_10_OR_LATER(ah)) { - rfMode |= IEEE80211_IS_CHAN_5GHZ(chan) ? - AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ; - } - OS_REG_WRITE(ah, AR_PHY_MODE, rfMode); - } return AH_TRUE; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r219856 - in head/release: . amd64 i386 ia64 powerpc sparc64
Author: nwhitehorn Date: Tue Mar 22 01:14:53 2011 New Revision: 219856 URL: http://svn.freebsd.org/changeset/base/219856 Log: Use labels to find release media instead of hard-coded device paths. This makes booting more reliable (and working at all on USB sticks). While here, move responsibility for setting up fstab into the various platform mk-*.sh scripts. Suggested by: many Modified: head/release/Makefile head/release/amd64/make-memstick.sh head/release/amd64/mkisoimages.sh head/release/i386/make-memstick.sh head/release/i386/mkisoimages.sh head/release/ia64/mkisoimages.sh head/release/powerpc/mkisoimages.sh head/release/sparc64/mkisoimages.sh Modified: head/release/Makefile == --- head/release/Makefile Tue Mar 22 00:52:44 2011(r219855) +++ head/release/Makefile Tue Mar 22 01:14:53 2011(r219856) @@ -127,9 +127,7 @@ system: packagesystem touch ${.OBJDIR}/${.TARGET} release.iso: system - echo kernel_options=\-C\ ${.OBJDIR}/release/boot/loader.conf sh ${.CURDIR}/${TARGET}/mkisoimages.sh -b FreeBSD_Install ${.OBJDIR}/release.iso ${.OBJDIR}/release - rm ${.OBJDIR}/release/boot/loader.conf memstick: system sh ${.CURDIR}/${TARGET}/make-memstick.sh ${.OBJDIR}/release ${.OBJDIR}/memstick Modified: head/release/amd64/make-memstick.sh == --- head/release/amd64/make-memstick.sh Tue Mar 22 00:52:44 2011 (r219855) +++ head/release/amd64/make-memstick.sh Tue Mar 22 01:14:53 2011 (r219856) @@ -32,12 +32,14 @@ if [ -e ${2} ]; then exit 1 fi +echo '/dev/gpt/FreeBSD_Install / ufs rw,noatime 1 1' ${1}/etc/fstab rm -f ${tempfile} -makefs ${tempfile} ${1} +makefs -B little ${tempfile} ${1} if [ $? -ne 0 ]; then echo makefs failed exit 1 fi +rm ${1}/etc/fstab # # Use $BLOCKSIZE for transfers to improve efficiency. When calculating @@ -46,7 +48,7 @@ fi # filesize=`stat -f %z ${tempfile}` -blocks=$(($filesize / ${BLOCKSIZE} + 2)) +blocks=$(($filesize / ${BLOCKSIZE} + 256)) dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} if [ $? -ne 0 ]; then echo creation of image file failed @@ -59,19 +61,12 @@ if [ $? -ne 0 ]; then exit 1 fi -fdisk -BIq /dev/${unit} -if [ $? -ne 0 ]; then - echo fdisk failed - exit 1 -fi - -bsdlabel -B -w /dev/${unit} -if [ $? -ne 0 ]; then - echo bsdlabel failed - exit 1 -fi +gpart create -s GPT ${unit} +gpart add -t freebsd-boot -s 64K ${unit} +gpart bootcode -b ${1}/boot/pmbr -p ${1}/boot/gptboot -i 1 ${unit} +gpart add -t freebsd-ufs -l FreeBSD_Install ${unit} -dd if=${tempfile} of=/dev/${unit}a bs=$BLOCKSIZE conv=sync +dd if=${tempfile} of=/dev/${unit}p2 bs=$BLOCKSIZE conv=sync if [ $? -ne 0 ]; then echo copying filesystem into image file failed exit 1 Modified: head/release/amd64/mkisoimages.sh == --- head/release/amd64/mkisoimages.sh Tue Mar 22 00:52:44 2011 (r219855) +++ head/release/amd64/mkisoimages.sh Tue Mar 22 01:14:53 2011 (r219856) @@ -54,4 +54,7 @@ fi LABEL=$1; shift NAME=$1; shift +echo /dev/iso9660/$LABEL / cd9660 ro 0 0 $1/etc/fstab mkisofs $bootable -r -J -V $LABEL -publisher $publisher -o $NAME $* +rm $1/etc/fstab + Modified: head/release/i386/make-memstick.sh == --- head/release/i386/make-memstick.sh Tue Mar 22 00:52:44 2011 (r219855) +++ head/release/i386/make-memstick.sh Tue Mar 22 01:14:53 2011 (r219856) @@ -32,12 +32,14 @@ if [ -e ${2} ]; then exit 1 fi +echo '/dev/gpt/FreeBSD_Install / ufs rw,noatime 1 1' ${1}/etc/fstab rm -f ${tempfile} -makefs ${tempfile} ${1} +makefs -B little ${tempfile} ${1} if [ $? -ne 0 ]; then echo makefs failed exit 1 fi +rm ${1}/etc/fstab # # Use $BLOCKSIZE for transfers to improve efficiency. When calculating @@ -46,7 +48,7 @@ fi # filesize=`stat -f %z ${tempfile}` -blocks=$(($filesize / ${BLOCKSIZE} + 2)) +blocks=$(($filesize / ${BLOCKSIZE} + 256)) dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} if [ $? -ne 0 ]; then echo creation of image file failed @@ -59,19 +61,12 @@ if [ $? -ne 0 ]; then exit 1 fi -fdisk -BIq /dev/${unit} -if [ $? -ne 0 ]; then - echo fdisk failed - exit 1 -fi - -bsdlabel -B -w /dev/${unit} -if [ $? -ne 0 ]; then - echo bsdlabel failed - exit 1 -fi +gpart create -s GPT ${unit} +gpart add -t freebsd-boot -s 64K ${unit} +gpart bootcode -b ${1}/boot/pmbr -p ${1}/boot/gptboot -i 1 ${unit} +gpart add -t freebsd-ufs -l FreeBSD_Install ${unit} -dd if=${tempfile} of=/dev/${unit}a bs=$BLOCKSIZE conv=sync +dd if=${tempfile} of=/dev/${unit}p2 bs=$BLOCKSIZE conv=sync if [ $? -ne 0 ]; then echo copying filesystem into image file failed exit 1 Modified:
svn commit: r219857 - head/share/man/man7
Author: nwhitehorn Date: Tue Mar 22 01:21:51 2011 New Revision: 219857 URL: http://svn.freebsd.org/changeset/base/219857 Log: Update release(7) and build(7) to reflect new release infrastructure for the new installer. Modified: head/share/man/man7/build.7 head/share/man/man7/release.7 Modified: head/share/man/man7/build.7 == --- head/share/man/man7/build.7 Tue Mar 22 01:14:53 2011(r219856) +++ head/share/man/man7/build.7 Tue Mar 22 01:21:51 2011(r219857) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd February 10, 2011 +.Dd March 18, 2011 .Dt BUILD 7 .Os .Sh NAME @@ -196,6 +196,13 @@ variable .Va DISTDIR . This target is used while building a release; see .Xr release 7 . +.It Cm packageworld +Archive the results of +.Cm distributeworld , +placing the results in +.Va DISTDIR . +This target is used while building a release; see +.Xr release 7 . .It Cm installworld Install everything built by a preceding .Cm buildworld @@ -248,7 +255,7 @@ Create a build toolchain for each archit Kernel specific build targets in .Pa /usr/src are: -.Bl -tag -width .Cm reinstallkernel +.Bl -tag -width .Cm distributekernel .It Cm buildkernel Rebuild the kernel and the kernel modules. .It Cm installkernel @@ -265,6 +272,18 @@ and .Va KODIR .Xr make 1 variables. +.It Cm distributekernel +Install the kernel to the directory +.Pa ${DISTDIR}/kernel/boot/kernel . +This target is used while building a release; see +.Xr release 7 . +.It Cm packagekernel +Archive the results of +.Cm distributekernel , +placing the results in +.Va DISTDIR . +This target is used while building a release; see +.Xr release 7 . .It Cm kernel Equivalent to .Cm buildkernel Modified: head/share/man/man7/release.7 == --- head/share/man/man7/release.7 Tue Mar 22 01:14:53 2011 (r219856) +++ head/share/man/man7/release.7 Tue Mar 22 01:21:51 2011 (r219857) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd August 17, 2009 +.Dd March 18, 2011 .Dt RELEASE 7 .Os .Sh NAME @@ -45,28 +45,109 @@ installation floppies, and an FTP instal This command is aptly named .Dq Li make release . .Pp +For some users, it may be desirable to provide an absolutely clean +build environment, with no local modifications to the source tree or to +.Xr make.conf 5 , +and with clean checkouts of specific versions of the doc, src, and ports +trees. For this purpose, a script +.Pq Pa src/release/generate-release.sh +is provided to automate these checkouts and then execute +.Dq Li make release +in a clean +.Xr chroot 8 . +.Pp Before attempting to build a release, the user is expected to be familiar with the contents of .Xr build 7 , and should have experience upgrading systems from source. +.Pp The release build process requires that .Pa /usr/obj be populated with the output of -a native -.Dq Li make buildworld -compiled from sources matching the currently running kernel. -This is necessary so that the object files for a complete system can -be installed into a clean +.Dq Li make buildworld . +This is necessary to provide the object files for the release or, when +using +.Pa generate-release.sh , +so that the object files for a complete system can be installed into a clean .Xr chroot 8 -environment. -The release procedure also requires that the +environment. In this second case, the built world must be capable of running +on the build system (i.e. it must be for the same architecture and be +compatible with the installed kernel). +The release procedure on some architectures may also require that the .Xr md 4 (memory disk) device driver be present in the kernel (either by being compiled in or available as a module). .Pp This document does not cover source code management, quality assurance, or other aspects of the release engineering process. -.Sh TARGETS +.Sh CLEAN RELEASE GENERATION +Official releases of FreeBSD are produced in a totally clean environment to +ensure consistency between the versions of the src, ports, and doc trees +and to avoid contamination from the host system (e.g. local patches, changes +to +.Xr make.conf 5 , +etc.). This is accomplished using the wrapper script +.Pa src/release/generate-release.sh . +.Pp +.Ic generate-release.sh +svn-branch scratch-dir +.Pp +.Ic generate-release.sh +calls +.Dq Li make installworld +to generate a +.Xr chroot 8 +environment in +.Ar scratch-dir . +It then checks out the src tree specified by +.Ar svn-branch +using +.Xr svn 1 +and (optionally) the ports and documentation trees using +.Xr csup 1 +or +.Xr cvs 1 . +Once the various source trees have been obtained, it executes +.Dq Li make release +within the +.Xr chroot 8 +environment and places the result in +.Pa $scratch-dir/R . +Note that because this uses a chroot, it cannot be used to cross-build +.Fx +release media. +.Pp +Environment variables: +.Bl -tag
svn commit: r219858 - head/share/examples/cvsup
Author: glebius Date: Tue Mar 22 04:31:35 2011 New Revision: 219858 URL: http://svn.freebsd.org/changeset/base/219858 Log: Give better URL to the list of available CVSup mirrors. Modified: head/share/examples/cvsup/cvs-supfile head/share/examples/cvsup/doc-supfile head/share/examples/cvsup/gnats-supfile head/share/examples/cvsup/ports-supfile head/share/examples/cvsup/stable-supfile head/share/examples/cvsup/standard-supfile head/share/examples/cvsup/www-supfile Modified: head/share/examples/cvsup/cvs-supfile == --- head/share/examples/cvsup/cvs-supfile Tue Mar 22 01:21:51 2011 (r219857) +++ head/share/examples/cvsup/cvs-supfile Tue Mar 22 04:31:35 2011 (r219858) @@ -24,7 +24,7 @@ # This specifies the server host which will supply the # file updates. You must change it to one of the CVSup # mirror sites listed in the FreeBSD Handbook at -# http://www.freebsd.org/doc/handbook/mirrors.html. +# http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS. # You can override this setting on the command line # with cvsup's -h host option. # @@ -46,7 +46,7 @@ # Defaults that apply to all the collections # # IMPORTANT: Change the next line to use one of the CVSup mirror sites -# listed at http://www.freebsd.org/doc/handbook/mirrors.html. +# listed at http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS. *default host=CHANGE_THIS.FreeBSD.org *default base=/var/db *default prefix=/home/ncvs Modified: head/share/examples/cvsup/doc-supfile == --- head/share/examples/cvsup/doc-supfile Tue Mar 22 01:21:51 2011 (r219857) +++ head/share/examples/cvsup/doc-supfile Tue Mar 22 04:31:35 2011 (r219858) @@ -24,7 +24,7 @@ # This specifies the server host which will supply the # file updates. You must change it to one of the CVSup # mirror sites listed in the FreeBSD Handbook at -# http://www.freebsd.org/doc/handbook/mirrors.html. +# http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS. # You can override this setting on the command line # with cvsup's -h host option. # @@ -45,7 +45,7 @@ # Defaults that apply to all the collections # # IMPORTANT: Change the next line to use one of the CVSup mirror sites -# listed at http://www.freebsd.org/doc/handbook/mirrors.html. +# listed at http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS. *default host=CHANGE_THIS.FreeBSD.org *default base=/var/db *default prefix=/usr Modified: head/share/examples/cvsup/gnats-supfile == --- head/share/examples/cvsup/gnats-supfile Tue Mar 22 01:21:51 2011 (r219857) +++ head/share/examples/cvsup/gnats-supfile Tue Mar 22 04:31:35 2011 (r219858) @@ -24,7 +24,7 @@ # This specifies the server host which will supply the # file updates. You must change it to one of the CVSup # mirror sites listed in the FreeBSD Handbook at -# http://www.freebsd.org/doc/handbook/mirrors.html. +# http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS. # You can override this setting on the command line # with cvsup's -h host option. # @@ -45,7 +45,7 @@ # Defaults that apply to all the collections # # IMPORTANT: Change the next line to use one of the CVSup mirror sites -# listed at http://www.freebsd.org/doc/handbook/mirrors.html. +# listed at http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS. *default host=CHANGE_THIS.FreeBSD.org *default base=/var/db *default prefix=/usr Modified: head/share/examples/cvsup/ports-supfile == --- head/share/examples/cvsup/ports-supfile Tue Mar 22 01:21:51 2011 (r219857) +++ head/share/examples/cvsup/ports-supfile Tue Mar 22 04:31:35 2011 (r219858) @@ -24,7 +24,7 @@ # This specifies the server host which will supply the # file updates. You must change it to one of the CVSup # mirror sites listed in the FreeBSD Handbook at -# http://www.freebsd.org/doc/handbook/mirrors.html. +# http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS. # You can override this setting on the command line # with cvsup's -h host option. # @@ -45,7 +45,7 @@ # Defaults that apply to all the collections # # IMPORTANT: Change the next line to use one of the CVSup mirror sites -# listed at http://www.freebsd.org/doc/handbook/mirrors.html. +# listed at
svn commit: r219859 - head/sys/ofed/drivers/net/mlx4
Author: jeff Date: Tue Mar 22 04:50:47 2011 New Revision: 219859 URL: http://svn.freebsd.org/changeset/base/219859 Log: - Don't use a separate set of rx queues for UDP, hash them into the same set as TCP. - Eliminate the fully linear non-scatter/gather rx path, there is no harm in using arrays of clusters for both TCP and UDP. - Implement support for enabling/disabling per-vlan priority pause and queues via sysctl. Modified: head/sys/ofed/drivers/net/mlx4/en_main.c head/sys/ofed/drivers/net/mlx4/en_netdev.c head/sys/ofed/drivers/net/mlx4/en_rx.c head/sys/ofed/drivers/net/mlx4/mlx4_en.h Modified: head/sys/ofed/drivers/net/mlx4/en_main.c == --- head/sys/ofed/drivers/net/mlx4/en_main.cTue Mar 22 04:31:35 2011 (r219858) +++ head/sys/ofed/drivers/net/mlx4/en_main.cTue Mar 22 04:50:47 2011 (r219859) @@ -236,9 +236,8 @@ static void *mlx4_en_add(struct mlx4_dev mlx4_info(mdev, Using %d tx rings for port:%d\n, mdev-profile.prof[i].tx_ring_num, i); mdev-profile.prof[i].rx_ring_num = rounddown_pow_of_two( - min_t(int, dev-caps.num_comp_vectors, MAX_RX_RINGS/2)) + - (mdev-profile.udp_rss ? rounddown_pow_of_two( - min_t(int, dev-caps.num_comp_vectors, MAX_RX_RINGS/2)) : 1); + min_t(int, dev-caps.num_comp_vectors, MAX_RX_RINGS)); + mlx4_info(mdev, Defaulting to %d rx rings for port:%d\n, mdev-profile.prof[i].rx_ring_num, i); } Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c == --- head/sys/ofed/drivers/net/mlx4/en_netdev.c Tue Mar 22 04:31:35 2011 (r219858) +++ head/sys/ofed/drivers/net/mlx4/en_netdev.c Tue Mar 22 04:50:47 2011 (r219859) @@ -277,10 +277,7 @@ static void mlx4_en_netpoll(struct net_d cq = priv-rx_cq[i]; spin_lock_irqsave(cq-lock, flags); napi_synchronize(cq-napi); - if (priv-rx_ring[i].use_frags) - mlx4_en_process_rx_cq(dev, cq, 0); - else - mlx4_en_process_rx_cq_mb(dev, cq, 0); + mlx4_en_process_rx_cq(dev, cq, 0); spin_unlock_irqrestore(cq-lock, flags); } } @@ -866,10 +863,6 @@ int mlx4_en_alloc_resources(struct mlx4_ prof-rx_ring_size, i, RX)) goto err; - if (i priv-rx_ring_num - priv-udp_rings - 1) - priv-rx_ring[i].use_frags = 0; - else - priv-rx_ring[i].use_frags = 1; if (mlx4_en_create_rx_ring(priv, priv-rx_ring[i], prof-rx_ring_size)) goto err; @@ -880,7 +873,7 @@ int mlx4_en_alloc_resources(struct mlx4_ /* Populate Tx priority mappings */ mlx4_en_set_prio_map(priv, priv-tx_prio_map, -prof-tx_ring_num - MLX4_EN_NUM_HASH_RINGS); +priv-tx_ring_num - MLX4_EN_NUM_HASH_RINGS); return 0; @@ -1193,6 +1186,83 @@ static int mlx4_en_set_tx_ring_size(SYSC return (error); } +static int mlx4_en_set_tx_ppp(SYSCTL_HANDLER_ARGS) +{ + struct mlx4_en_priv *priv; + int ppp; + int error; + + priv = arg1; + ppp = priv-prof-tx_ppp; + error = sysctl_handle_int(oidp, ppp, 0, req); + if (error || !req-newptr) + return (error); + if (ppp 0xff || ppp 0) + return (-EINVAL); + priv-prof-tx_ppp = ppp; + error = -mlx4_SET_PORT_general(priv-mdev-dev, priv-port, + priv-rx_mb_size + ETHER_CRC_LEN, + priv-prof-tx_pause, + priv-prof-tx_ppp, + priv-prof-rx_pause, + priv-prof-rx_ppp); + + return (error); +} + +static int mlx4_en_set_rx_ppp(SYSCTL_HANDLER_ARGS) +{ + struct mlx4_en_priv *priv; + struct mlx4_en_dev *mdev; + int tx_ring_num; + int ppp; + int error; + int port_up; + + port_up = 0; + priv = arg1; + mdev = priv-mdev; + ppp = priv-prof-rx_ppp; + error = sysctl_handle_int(oidp, ppp, 0, req); + if (error || !req-newptr) + return (error); + if (ppp 0xff || ppp 0) + return (-EINVAL); + /* See if we have to change the number of tx queues. */ + if (!ppp != !priv-prof-rx_ppp) { + tx_ring_num = MLX4_EN_NUM_HASH_RINGS + 1 + + (!!ppp) * MLX4_EN_NUM_PPP_RINGS; + mutex_lock(mdev-state_lock); + if
svn commit: r219860 - head/sys/dev/ath/ath_hal/ar5416
Author: adrian Date: Tue Mar 22 05:47:48 2011 New Revision: 219860 URL: http://svn.freebsd.org/changeset/base/219860 Log: Set the right CCA register. Obtained From:ath9k Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c == --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Mar 22 04:50:47 2011(r219859) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Mar 22 05:47:48 2011(r219860) @@ -1463,7 +1463,7 @@ ar5416SetBoardValues(struct ath_hal *ah, } else { OS_REG_RMW_FIELD(ah, AR_PHY_CCA, AR_PHY_CCA_THRESH62, pModal-thresh62); - OS_REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0, AR_PHY_EXT_CCA_THRESH62, + OS_REG_RMW_FIELD(ah, AR_PHY_EXT_CCA, AR_PHY_EXT_CCA_THRESH62, pModal-thresh62); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org