svn commit: r226828 - head/contrib/tzcode/stdtime
Author: trociny Date: Thu Oct 27 08:44:07 2011 New Revision: 226828 URL: http://svn.freebsd.org/changeset/base/226828 Log: Fix a memory leak in tzload(). Reported by: valgrind Reviewed by: kib MFC after:3 days Modified: head/contrib/tzcode/stdtime/localtime.c Modified: head/contrib/tzcode/stdtime/localtime.c == --- head/contrib/tzcode/stdtime/localtime.c Thu Oct 27 07:20:30 2011 (r226827) +++ head/contrib/tzcode/stdtime/localtime.c Thu Oct 27 08:44:07 2011 (r226828) @@ -450,6 +450,7 @@ register const int doextend; _close(fid); return -1; } + free(fullname); } u = malloc(sizeof(*u)); if (u == NULL) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226829 - head/sys/netgraph
Author: glebius Date: Thu Oct 27 09:43:25 2011 New Revision: 226829 URL: http://svn.freebsd.org/changeset/base/226829 Log: - If KDB NETGRAPH_DEBUG are on, print traces on discovered failed invariants. - Reduce tautology in NETGRAPH_DEBUG output. Modified: head/sys/netgraph/netgraph.h head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/netgraph.h == --- head/sys/netgraph/netgraph.hThu Oct 27 08:44:07 2011 (r226828) +++ head/sys/netgraph/netgraph.hThu Oct 27 09:43:25 2011 (r226829) @@ -57,6 +57,7 @@ #ifdef HAVE_KERNEL_OPTION_HEADERS #include opt_netgraph.h +#include opt_kdb.h #endif /* debugging options */ @@ -190,7 +191,7 @@ static __inline void _chkhook(hook_p hook, char *file, int line) { if (hook-hk_magic != HK_MAGIC) { - printf(Accessing freed hook ); + printf(Accessing freed ); dumphook(hook, file, line); } hook-lastline = line; @@ -458,7 +459,7 @@ static __inline void _chknode(node_p node, char *file, int line) { if (node-nd_magic != ND_MAGIC) { - printf(Accessing freed node ); + printf(Accessing freed ); dumpnode(node, file, line); } node-lastline = line; Modified: head/sys/netgraph/ng_base.c == --- head/sys/netgraph/ng_base.c Thu Oct 27 08:44:07 2011(r226828) +++ head/sys/netgraph/ng_base.c Thu Oct 27 09:43:25 2011(r226829) @@ -3167,6 +3167,9 @@ dumphook (hook_p hook, char *file, int l hook-lastfile, hook-lastline); if (line) { printf( problem discovered at file %s, line %d\n, file, line); +#ifdef KDB + kdb_backtrace(); +#endif } } @@ -3181,6 +3184,9 @@ dumpnode(node_p node, char *file, int li node-lastfile, node-lastline); if (line) { printf( problem discovered at file %s, line %d\n, file, line); +#ifdef KDB + kdb_backtrace(); +#endif } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226830 - head/sys/net
Author: glebius Date: Thu Oct 27 09:45:12 2011 New Revision: 226830 URL: http://svn.freebsd.org/changeset/base/226830 Log: Add macro IF_DEQUEUE_ALL(ifq, m), that takes the entire mbuf chain off the queue. It can be utilized in queue processing to avoid multiple locking/unlocking. Modified: head/sys/net/if_var.h Modified: head/sys/net/if_var.h == --- head/sys/net/if_var.h Thu Oct 27 09:43:25 2011(r226829) +++ head/sys/net/if_var.h Thu Oct 27 09:45:12 2011(r226830) @@ -321,6 +321,18 @@ void if_maddr_runlock(struct ifnet *ifp) IF_UNLOCK(ifq); \ } while (0) +#define_IF_DEQUEUE_ALL(ifq, m) do {\ + (m) = (ifq)-ifq_head; \ + (ifq)-ifq_head = (ifq)-ifq_tail = NULL; \ + (ifq)-ifq_len = 0; \ +} while (0) + +#defineIF_DEQUEUE_ALL(ifq, m) do { \ + IF_LOCK(ifq); \ + _IF_DEQUEUE_ALL(ifq, m);\ + IF_UNLOCK(ifq); \ +} while (0) + #define_IF_POLL(ifq, m)((m) = (ifq)-ifq_head) #defineIF_POLL(ifq, m) _IF_POLL(ifq, m) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226831 - head/sys/contrib/pf/net
Author: glebius Date: Thu Oct 27 09:47:00 2011 New Revision: 226831 URL: http://svn.freebsd.org/changeset/base/226831 Log: Utilize new IF_DEQUEUE_ALL(ifq, m) macro in pfsyncintr() to reduce contention on ifqueue lock. Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c == --- head/sys/contrib/pf/net/if_pfsync.c Thu Oct 27 09:45:12 2011 (r226830) +++ head/sys/contrib/pf/net/if_pfsync.c Thu Oct 27 09:47:00 2011 (r226831) @@ -3290,16 +3290,17 @@ void pfsyncintr(void *arg) { struct pfsync_softc *sc = arg; - struct mbuf *m; + struct mbuf *m, *n; CURVNET_SET(sc-sc_ifp-if_vnet); pfsync_ints++; - for (;;) { - IF_DEQUEUE(sc-sc_ifp-if_snd, m); - if (m == 0) - break; + IF_DEQUEUE_ALL(sc-sc_ifp-if_snd, m); + for (; m != NULL; m = n) { + + n = m-m_nextpkt; + m-m_nextpkt = NULL; if (ip_output(m, NULL, NULL, IP_RAWOUTPUT, sc-sc_imo, NULL) == 0) V_pfsyncstats.pfsyncs_opackets++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226832 - in head/sys/arm: at91 econa xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa
Author: kevlo Date: Thu Oct 27 10:21:40 2011 New Revision: 226832 URL: http://svn.freebsd.org/changeset/base/226832 Log: Check the return value of BUS_SETUP_INTR() Reviewed by: imp Modified: head/sys/arm/at91/at91.c head/sys/arm/econa/econa.c head/sys/arm/xscale/i80321/iq80321.c head/sys/arm/xscale/i8134x/i81342.c head/sys/arm/xscale/ixp425/ixp425.c head/sys/arm/xscale/pxa/pxa_obio.c Modified: head/sys/arm/at91/at91.c == --- head/sys/arm/at91/at91.cThu Oct 27 09:47:00 2011(r226831) +++ head/sys/arm/at91/at91.cThu Oct 27 10:21:40 2011(r226832) @@ -367,11 +367,15 @@ at91_setup_intr(device_t dev, device_t c driver_intr_t *intr, void *arg, void **cookiep) { struct at91_softc *sc = device_get_softc(dev); + int error; if (rman_get_start(ires) == sc-sc_irq_system filt == NULL) panic(All system interrupt ISRs must be FILTER); - BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, - intr, arg, cookiep); + error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, + filt, intr, arg, cookiep); + if (error) + return (error); + bus_space_write_4(sc-sc_st, sc-sc_aic_sh, IC_IECR, 1 rman_get_start(ires)); return (0); Modified: head/sys/arm/econa/econa.c == --- head/sys/arm/econa/econa.c Thu Oct 27 09:47:00 2011(r226831) +++ head/sys/arm/econa/econa.c Thu Oct 27 10:21:40 2011(r226832) @@ -592,12 +592,15 @@ econa_setup_intr(device_t dev, device_t struct resource *ires, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { + int error; if (rman_get_start(ires) == ECONA_IRQ_SYSTEM filt == NULL) panic(All system interrupt ISRs must be FILTER); - BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, - intr, arg, cookiep); + error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, + filt, intr, arg, cookiep); + if (error) + return (error); arm_unmask_irq(rman_get_start(ires)); Modified: head/sys/arm/xscale/i80321/iq80321.c == --- head/sys/arm/xscale/i80321/iq80321.cThu Oct 27 09:47:00 2011 (r226831) +++ head/sys/arm/xscale/i80321/iq80321.cThu Oct 27 10:21:40 2011 (r226832) @@ -354,8 +354,12 @@ iq80321_setup_intr(device_t dev, device_ struct resource *ires, int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { - BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, - arg, cookiep); + int error; + + error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, + filt, intr, arg, cookiep); + if (error) + return (error); intr_enabled |= 1 rman_get_start(ires); i80321_set_intrmask(); Modified: head/sys/arm/xscale/i8134x/i81342.c == --- head/sys/arm/xscale/i8134x/i81342.c Thu Oct 27 09:47:00 2011 (r226831) +++ head/sys/arm/xscale/i8134x/i81342.c Thu Oct 27 10:21:40 2011 (r226832) @@ -429,10 +429,12 @@ i81342_setup_intr(device_t dev, device_t int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { - + int error; - BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, filt, intr, - arg, cookiep); + error = BUS_SETUP_INTR(device_get_parent(dev), child, ires, flags, + filt, intr, arg, cookiep); + if (error) + return (error); arm_unmask_irq(rman_get_start(ires)); return (0); } Modified: head/sys/arm/xscale/ixp425/ixp425.c == --- head/sys/arm/xscale/ixp425/ixp425.c Thu Oct 27 09:47:00 2011 (r226831) +++ head/sys/arm/xscale/ixp425/ixp425.c Thu Oct 27 10:21:40 2011 (r226832) @@ -639,9 +639,12 @@ ixp425_setup_intr(device_t dev, device_t driver_intr_t *intr, void *arg, void **cookiep) { uint32_t mask, mask2; + int error; - BUS_SETUP_INTR(device_get_parent(dev), child, res, flags, filt, intr, -arg, cookiep); + error = BUS_SETUP_INTR(device_get_parent(dev), child, res, flags, + filt, intr, arg, cookiep); + if (error) + return (error); get_masks(res, mask, mask2); update_masks(intr_enabled | mask, intr_enabled2 | mask2); Modified: head/sys/arm/xscale/pxa/pxa_obio.c == ---
svn commit: r226833 - in head/sys: boot/forth kern
Author: pluknet Date: Thu Oct 27 10:25:11 2011 New Revision: 226833 URL: http://svn.freebsd.org/changeset/base/226833 Log: Remove the long reprecated ``/stand/sysinstall'' from the init_path. It can be put back using the INIT_PATH config option or init_path loader variable, if still needed (which I doubt). MFC after:1 week Modified: head/sys/boot/forth/loader.conf head/sys/kern/init_main.c Modified: head/sys/boot/forth/loader.conf == --- head/sys/boot/forth/loader.conf Thu Oct 27 10:21:40 2011 (r226832) +++ head/sys/boot/forth/loader.conf Thu Oct 27 10:25:11 2011 (r226833) @@ -81,7 +81,7 @@ module_path=/boot/modules # Set the mo #boot_serial=# -h: Use serial console #boot_single=# -s: Start system in single-user mode #boot_verbose= # -v: Causes extra debugging information to be printed -#init_path=/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sysinstall +#init_path=/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init # Sets the list of init candidates #init_shell=/bin/sh # The shell binary used by init(8). #init_script=# Initial script to run by init(8) before chrooting. Modified: head/sys/kern/init_main.c == --- head/sys/kern/init_main.c Thu Oct 27 10:21:40 2011(r226832) +++ head/sys/kern/init_main.c Thu Oct 27 10:25:11 2011(r226833) @@ -641,7 +641,7 @@ static char init_path[MAXPATHLEN] = #ifdef INIT_PATH __XSTRING(INIT_PATH); #else -/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sysinstall; +/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init; #endif SYSCTL_STRING(_kern, OID_AUTO, init_path, CTLFLAG_RD, init_path, 0, Path used to search the init process); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r226713 - head/sys/netinet
On Oct 25, 2011, at 7:06 AM, Qing Li wrote: Author: qingli Date: Tue Oct 25 04:06:29 2011 New Revision: 226713 URL: http://svn.freebsd.org/changeset/base/226713 Log: Exclude host routes when checking for prefix coverage on multiple interfaces. A host route has a NULL mask so check for that condition. I have also been told by developers who customize the packet output path with direct manipulation of the route entry (or the outgoing interface to be specific). This patch checks for the route mask explicitly to make sure custom code will not panic. PR: kern/161805 MFC after: 3 days Modified: head/sys/netinet/in.c Without this patch my stable/8 routers were crashing just after a few minutes. A few hours after the commit I applied it manually and the machines are up since then, thanks! Regards, Nikolay ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226834 - stable/9/usr.bin/csup
Author: kib Date: Thu Oct 27 12:26:16 2011 New Revision: 226834 URL: http://svn.freebsd.org/changeset/base/226834 Log: MFC r225979: Update the comment. MFC r225980: Handle the situation where fixups_close() has been called but more fixups are still available on the queue. Approved by: re (kensmith) Modified: stable/9/usr.bin/csup/fixups.c stable/9/usr.bin/csup/updater.c Directory Properties: stable/9/usr.bin/csup/ (props changed) Modified: stable/9/usr.bin/csup/fixups.c == --- stable/9/usr.bin/csup/fixups.c Thu Oct 27 10:25:11 2011 (r226833) +++ stable/9/usr.bin/csup/fixups.c Thu Oct 27 12:26:16 2011 (r226834) @@ -141,7 +141,7 @@ fixups_get(struct fixups *f) fixups_lock(f); while (f-size == 0 !f-closed) pthread_cond_wait(f-cond, f-lock); - if (f-closed) { + if (f-closed f-size == 0) { fixups_unlock(f); return (NULL); } Modified: stable/9/usr.bin/csup/updater.c == --- stable/9/usr.bin/csup/updater.c Thu Oct 27 10:25:11 2011 (r226833) +++ stable/9/usr.bin/csup/updater.c Thu Oct 27 12:26:16 2011 (r226834) @@ -238,7 +238,7 @@ updater(void *arg) /* * Make sure to close the fixups even in case of an error, -* so that the lister thread doesn't block indefinitely. +* so that the detailer thread doesn't block indefinitely. */ fixups_close(up-config-fixups); if (!error) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r225950 - in head: sbin/camcontrol share/examples/scsi_target share/misc sys/cam sys/cam/scsi sys/dev/ciss sys/dev/firewire sys/dev/iir sys/dev/iscsi/initiator sys/dev/isp sys/dev/mly
On Mon, Oct 03, 2011 at 08:32:56PM +, Kenneth D. Merry wrote: Author: ken Date: Mon Oct 3 20:32:55 2011 New Revision: 225950 URL: http://svn.freebsd.org/changeset/base/225950 Before this commit, scsi_extract_sense() was static inline. Since now it is made not-inlined, the consumers of it that previously not depended on cam.ko need an explicit MODULE_DEPEND() for cam. E.g., on HEAD and stable/9, mfi is no longer loadable as module, showing errors link_elf_obj: symbol scsi_extract_sense undefined linker_load_file: Unsupported file type on load attempt. pgpBpJkbjxZM8.pgp Description: PGP signature
svn commit: r226835 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf
Author: kensmith Date: Thu Oct 27 13:07:49 2011 New Revision: 226835 URL: http://svn.freebsd.org/changeset/base/226835 Log: Adjust the debugger options slightly. This should help me do the right thing when changing the debugging options as part of head becoming a new stable branch. It may also help people who for one reason or another want to run head but don't want it slowed down by the debugging support. Reviewed by: kib Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC == --- head/sys/amd64/conf/GENERIC Thu Oct 27 12:26:16 2011(r226834) +++ head/sys/amd64/conf/GENERIC Thu Oct 27 13:07:49 2011(r226835) @@ -65,8 +65,11 @@ options MAC # TrustedBSD MAC Framewor #options KDTRACE_HOOKS # Kernel DTrace hooks optionsINCLUDE_CONFIG_FILE # Include this file in kernel -# Debugging for use in -current +# Debugging support. Always need this: optionsKDB # Enable kernel debugger support. +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use this instead: optionsDDB # Support DDB. optionsGDB # Support remote GDB. optionsDEADLKRES # Enable the deadlock resolver Modified: head/sys/i386/conf/GENERIC == --- head/sys/i386/conf/GENERIC Thu Oct 27 12:26:16 2011(r226834) +++ head/sys/i386/conf/GENERIC Thu Oct 27 13:07:49 2011(r226835) @@ -65,8 +65,11 @@ options MAC # TrustedBSD MAC Framewor #options KDTRACE_HOOKS # Kernel DTrace hooks optionsINCLUDE_CONFIG_FILE # Include this file in kernel -# Debugging for use in -current +# Debugging support. Always need this: optionsKDB # Enable kernel debugger support. +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use this instead: optionsDDB # Support DDB. optionsGDB # Support remote GDB. optionsDEADLKRES # Enable the deadlock resolver Modified: head/sys/ia64/conf/GENERIC == --- head/sys/ia64/conf/GENERIC Thu Oct 27 12:26:16 2011(r226834) +++ head/sys/ia64/conf/GENERIC Thu Oct 27 13:07:49 2011(r226835) @@ -60,8 +60,11 @@ options UFS_DIRHASH # Hash-based direct optionsUFS_GJOURNAL# Enable gjournal-based UFS journaling options_KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B RT extensions -# Debugging for use in -current -optionsKDB # Enable kernel debugger support +# Debugging support. Always need this: +optionsKDB # Enable kernel debugger support. +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use this instead: optionsDDB # Support DDB optionsGDB # Support remote GDB optionsDEADLKRES # Enable the deadlock resolver Modified: head/sys/pc98/conf/GENERIC == --- head/sys/pc98/conf/GENERIC Thu Oct 27 12:26:16 2011(r226834) +++ head/sys/pc98/conf/GENERIC Thu Oct 27 13:07:49 2011(r226835) @@ -66,8 +66,11 @@ options AUDIT # Security event auditi optionsMAC # TrustedBSD MAC Framework optionsINCLUDE_CONFIG_FILE # Include this file in kernel -# Debugging for use in -current +# Debugging support. Always need this: optionsKDB # Enable kernel debugger support. +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use this instead: optionsDDB # Support DDB. optionsGDB # Support remote GDB. optionsDEADLKRES # Enable the deadlock resolver Modified: head/sys/powerpc/conf/GENERIC == --- head/sys/powerpc/conf/GENERIC Thu Oct 27 12:26:16 2011 (r226834) +++ head/sys/powerpc/conf/GENERIC Thu Oct 27 13:07:49 2011 (r226835) @@ -67,8 +67,11 @@ options AUDIT # Security event
Re: svn commit: r226835 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf
On Thu, 2011-10-27 at 13:07 +, Ken Smith wrote: Author: kensmith Date: Thu Oct 27 13:07:49 2011 New Revision: 226835 URL: http://svn.freebsd.org/changeset/base/226835 Log: Adjust the debugger options slightly. This should help me do the right thing when changing the debugging options as part of head becoming a new stable branch. It may also help people who for one reason or another want to run head but don't want it slowed down by the debugging support. Reviewed by:kib Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC In response to one of my commits done to the ia64 GENERIC I received some feedback giving a long list of issues (style, formatting, seemingly gratuitous differences, annoyances, etc.) with the whole set of GENERIC config files. If anyone knows a reason I should NOT act on the list to bring all the GENERIC's into style compliance and whatnot let me know. If nobody screams I'll do what I can to fix them up in head some time after 9.0 is finished. Thanks... -- Ken Smith - From there to here, from here to | kensm...@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | signature.asc Description: This is a digitally signed message part
svn commit: r226836 - head/lib/libc/gen
Author: pluknet Date: Thu Oct 27 13:17:42 2011 New Revision: 226836 URL: http://svn.freebsd.org/changeset/base/226836 Log: Fix the manual section number for a cross-reference to open(2) and sort it. Reviewed by: ed MFC after:3 days Modified: head/lib/libc/gen/getutxent.3 Modified: head/lib/libc/gen/getutxent.3 == --- head/lib/libc/gen/getutxent.3 Thu Oct 27 13:07:49 2011 (r226835) +++ head/lib/libc/gen/getutxent.3 Thu Oct 27 13:17:42 2011 (r226836) @@ -386,10 +386,10 @@ Otherwise, -1 is returned and the global is set to indicate the error. .Sh ERRORS In addition to the error conditions described in +.Xr open 2 , .Xr fdopen 3 , .Xr fopen 3 , .Xr fseek 3 , -.Xr open 3 , the .Fn pututxline function can generate the following errors: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226837 - head/sys/crypto/aesni
Author: pjd Date: Thu Oct 27 14:07:57 2011 New Revision: 226837 URL: http://svn.freebsd.org/changeset/base/226837 Log: Improve AES-NI performance for AES-XTS: - Operate on uint64_t types when doing XORing, etc. instead of uint8_t. - Don't bzero() temporary block for every AES block. Do it once for entire data block. - AES-NI is available only on little endian architectures. Simplify code that takes block number from IV. Benchmarks: Memory-backed md(4) device, software AES-XTS, 4kB sector: # dd if=/dev/md0.eli bs=1m 59.61MB/s Memory-backed md(4) device, old AES-NI AES-XTS, 4kB sector: # dd if=/dev/md0.eli bs=1m 97.29MB/s Memory-backed md(4) device, new AES-NI AES-XTS, 4kB sector: # dd if=/dev/md0.eli bs=1m 221.26MB/s 127% performance improvement between old and new code. Harddisk, raw speed: # dd if=/dev/ada0 bs=1m 137.63MB/s Harddisk, software AES-XTS, 4kB sector: # dd if=/dev/ada0.eli bs=1m 47.83MB/s (34% of raw disk speed) Harddisk, old AES-NI AES-XTS, 4kB sector: # dd if=/dev/ada0.eli bs=1m 68.33MB/s (49% of raw disk speed) Harddisk, new AES-NI AES-XTS, 4kB sector: # dd if=/dev/ada0.eli bs=1m 108.35MB/s (78% of raw disk speed) 58% performance improvement between old and new code. As a side-note, GELI with AES-NI using AES-CBC can achive native disk speed. MFC after:3 days Modified: head/sys/crypto/aesni/aesni_wrap.c Modified: head/sys/crypto/aesni/aesni_wrap.c == --- head/sys/crypto/aesni/aesni_wrap.c Thu Oct 27 13:17:42 2011 (r226836) +++ head/sys/crypto/aesni/aesni_wrap.c Thu Oct 27 14:07:57 2011 (r226837) @@ -87,33 +87,33 @@ aesni_decrypt_ecb(int rounds, const void #defineAES_XTS_ALPHA 0x87/* GF(2^128) generator polynomial */ static void -aesni_crypt_xts_block(int rounds, const void *key_schedule, uint8_t *tweak, -const uint8_t *from, uint8_t *to, int do_encrypt) +aesni_crypt_xts_block(int rounds, const void *key_schedule, uint64_t *tweak, +const uint64_t *from, uint64_t *to, uint64_t *block, int do_encrypt) { - uint8_t block[AES_XTS_BLOCKSIZE]; - u_int i, carry_in, carry_out; + int carry; - for (i = 0; i AES_XTS_BLOCKSIZE; i++) - block[i] = from[i] ^ tweak[i]; + block[0] = from[0] ^ tweak[0]; + block[1] = from[1] ^ tweak[1]; if (do_encrypt) - aesni_enc(rounds - 1, key_schedule, block, to, NULL); + aesni_enc(rounds - 1, key_schedule, (uint8_t *)block, (uint8_t *)to, NULL); else - aesni_dec(rounds - 1, key_schedule, block, to, NULL); + aesni_dec(rounds - 1, key_schedule, (uint8_t *)block, (uint8_t *)to, NULL); - for (i = 0; i AES_XTS_BLOCKSIZE; i++) - to[i] ^= tweak[i]; + to[0] ^= tweak[0]; + to[1] ^= tweak[1]; /* Exponentiate tweak. */ - carry_in = 0; - for (i = 0; i AES_XTS_BLOCKSIZE; i++) { - carry_out = tweak[i] 0x80; - tweak[i] = (tweak[i] 1) | (carry_in ? 1 : 0); - carry_in = carry_out; - } - if (carry_in) - tweak[0] ^= AES_XTS_ALPHA; - bzero(block, sizeof(block)); + carry = ((tweak[0] 0x8000ULL) 0); + tweak[0] = 1; + if (tweak[1] 0x8000ULL) { + uint8_t *twk = (uint8_t *)tweak; + + twk[0] ^= AES_XTS_ALPHA; + } + tweak[1] = 1; + if (carry) + tweak[1] |= 1; } static void @@ -121,32 +121,33 @@ aesni_crypt_xts(int rounds, const void * const void *tweak_schedule, size_t len, const uint8_t *from, uint8_t *to, const uint8_t iv[AES_BLOCK_LEN], int do_encrypt) { + uint64_t block[AES_XTS_BLOCKSIZE / 8]; uint8_t tweak[AES_XTS_BLOCKSIZE]; - uint64_t blocknum; size_t i; /* * Prepare tweak as E_k2(IV). IV is specified as LE representation * of a 64-bit block number which we allow to be passed in directly. */ - bcopy(iv, blocknum, AES_XTS_IVSIZE); - for (i = 0; i AES_XTS_IVSIZE; i++) { - tweak[i] = blocknum 0xff; - blocknum = 8; - } +#if BYTE_ORDER == LITTLE_ENDIAN + bcopy(iv, tweak, AES_XTS_IVSIZE); /* Last 64 bits of IV are always zero. */ bzero(tweak + AES_XTS_IVSIZE, AES_XTS_IVSIZE); +#else +#error Only LITTLE_ENDIAN architectures are supported. +#endif aesni_enc(rounds - 1, tweak_schedule, tweak, tweak, NULL); len /= AES_XTS_BLOCKSIZE; for (i = 0; i len; i++) { - aesni_crypt_xts_block(rounds, data_schedule, tweak, from, to, - do_encrypt); + aesni_crypt_xts_block(rounds,
svn commit: r226838 - stable/8/contrib/csup
Author: kib Date: Thu Oct 27 14:11:19 2011 New Revision: 226838 URL: http://svn.freebsd.org/changeset/base/226838 Log: MFC r225979: Update the comment. MFC r225980: Handle the situation where fixups_close() has been called but more fixups are still available on the queue. Modified: stable/8/contrib/csup/fixups.c stable/8/contrib/csup/updater.c Directory Properties: stable/8/contrib/csup/ (props changed) Modified: stable/8/contrib/csup/fixups.c == --- stable/8/contrib/csup/fixups.c Thu Oct 27 14:07:57 2011 (r226837) +++ stable/8/contrib/csup/fixups.c Thu Oct 27 14:11:19 2011 (r226838) @@ -141,7 +141,7 @@ fixups_get(struct fixups *f) fixups_lock(f); while (f-size == 0 !f-closed) pthread_cond_wait(f-cond, f-lock); - if (f-closed) { + if (f-closed f-size == 0) { fixups_unlock(f); return (NULL); } Modified: stable/8/contrib/csup/updater.c == --- stable/8/contrib/csup/updater.c Thu Oct 27 14:07:57 2011 (r226837) +++ stable/8/contrib/csup/updater.c Thu Oct 27 14:11:19 2011 (r226838) @@ -238,7 +238,7 @@ updater(void *arg) /* * Make sure to close the fixups even in case of an error, -* so that the lister thread doesn't block indefinitely. +* so that the detailer thread doesn't block indefinitely. */ fixups_close(up-config-fixups); if (!error) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226839 - head/sys/crypto/aesni
Author: pjd Date: Thu Oct 27 14:15:26 2011 New Revision: 226839 URL: http://svn.freebsd.org/changeset/base/226839 Log: Update Copyright. MFC after:3 days Modified: head/sys/crypto/aesni/aesni_wrap.c Modified: head/sys/crypto/aesni/aesni_wrap.c == --- head/sys/crypto/aesni/aesni_wrap.c Thu Oct 27 14:11:19 2011 (r226838) +++ head/sys/crypto/aesni/aesni_wrap.c Thu Oct 27 14:15:26 2011 (r226839) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2010 Konstantin Belousov k...@freebsd.org - * Copyright (c) 2010 Pawel Jakub Dawidek p...@freebsd.org + * Copyright (c) 2010-2011 Pawel Jakub Dawidek pa...@dawidek.net * All rights reserved. * * Redistribution and use in source and binary forms, with or without ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226840 - head/sys/geom/eli
Author: pjd Date: Thu Oct 27 16:12:25 2011 New Revision: 226840 URL: http://svn.freebsd.org/changeset/base/226840 Log: Before this change when GELI detected hardware crypto acceleration it will start only one worker thread. For software crypto it will start by default N worker threads where N is the number of available CPUs. This is not optimal if hardware crypto is AES-NI, which uses CPU for AES calculations. Change that to always start one worker thread for every available CPU. Number of worker threads per GELI provider can be easly reduced with kern.geom.eli.threads sysctl/tunable and even for software crypto it should be reduced when using more providers. While here, when number of threads exceeds number of CPUs avilable don't reduce this number, assume the user knows what he is doing. Reported by: Yuri Karaban d...@dev97.com MFC after:3 days Modified: head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h Modified: head/sys/geom/eli/g_eli.c == --- head/sys/geom/eli/g_eli.c Thu Oct 27 14:15:26 2011(r226839) +++ head/sys/geom/eli/g_eli.c Thu Oct 27 16:12:25 2011(r226840) @@ -443,16 +443,15 @@ g_eli_worker(void *arg) sc = wr-w_softc; #ifdef SMP /* Before sched_bind() to a CPU, wait for all CPUs to go on-line. */ - if (mp_ncpus 1 sc-sc_crypto == G_ELI_CRYPTO_SW - g_eli_threads == 0) { + if (sc-sc_cpubind) { while (!smp_started) tsleep(wr, 0, geli:smp, hz / 4); } #endif thread_lock(curthread); sched_prio(curthread, PUSER); - if (sc-sc_crypto == G_ELI_CRYPTO_SW g_eli_threads == 0) - sched_bind(curthread, wr-w_number); + if (sc-sc_cpubind) + sched_bind(curthread, wr-w_number % mp_ncpus); thread_unlock(curthread); G_ELI_DEBUG(1, Thread %s started., curthread-td_proc-p_comm); @@ -813,11 +812,7 @@ g_eli_create(struct gctl_req *req, struc threads = g_eli_threads; if (threads == 0) threads = mp_ncpus; - else if (threads mp_ncpus) { - /* There is really no need for too many worker threads. */ - threads = mp_ncpus; - G_ELI_DEBUG(0, Reducing number of threads to %u., threads); - } + sc-sc_cpubind = (mp_ncpus 1 threads == mp_ncpus); for (i = 0; i threads; i++) { if (g_eli_cpu_is_disabled(i)) { G_ELI_DEBUG(1, %s: CPU %u disabled, skipping., @@ -857,9 +852,6 @@ g_eli_create(struct gctl_req *req, struc goto failed; } LIST_INSERT_HEAD(sc-sc_workers, wr, w_next); - /* If we have hardware support, one thread is enough. */ - if (sc-sc_crypto == G_ELI_CRYPTO_HW) - break; } /* Modified: head/sys/geom/eli/g_eli.h == --- head/sys/geom/eli/g_eli.h Thu Oct 27 14:15:26 2011(r226839) +++ head/sys/geom/eli/g_eli.h Thu Oct 27 16:12:25 2011(r226840) @@ -192,6 +192,7 @@ struct g_eli_softc { size_t sc_sectorsize; u_intsc_bytes_per_sector; u_intsc_data_per_sector; + boolean_tsc_cpubind; /* Only for software cryptography. */ struct bio_queue_head sc_queue; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226841 - head/usr.bin/getent
Author: ed Date: Thu Oct 27 16:20:29 2011 New Revision: 226841 URL: http://svn.freebsd.org/changeset/base/226841 Log: Print INIT_PROCESS and LOGIN_PROCESS entries as well. Even though our implementation of utmpx never emits these types of records, they are part of POSIX. Do print them when they show up in the database files. While there, also print the type number of unsupported records. Modified: head/usr.bin/getent/getent.c Modified: head/usr.bin/getent/getent.c == --- head/usr.bin/getent/getent.cThu Oct 27 16:12:25 2011 (r226840) +++ head/usr.bin/getent/getent.cThu Oct 27 16:20:29 2011 (r226841) @@ -600,13 +600,24 @@ utmpxprint(const struct utmpx *ut) printf(\ pid=\%d\ user=\%s\ line=\%s\ host=\%s\\n, ut-ut_pid, ut-ut_user, ut-ut_line, ut-ut_host); break; + case INIT_PROCESS: + printf(init process: id=\); + UTMPXPRINTID; + printf(\ pid=\%d\\n, ut-ut_pid); + break; + case LOGIN_PROCESS: + printf(login process: id=\); + UTMPXPRINTID; + printf(\ pid=\%d\ user=\%s\ line=\%s\ host=\%s\\n, + ut-ut_pid, ut-ut_user, ut-ut_line, ut-ut_host); + break; case DEAD_PROCESS: printf(dead process: id=\); UTMPXPRINTID; printf(\ pid=\%d\\n, ut-ut_pid); break; default: - printf(unknown record type\n); + printf(unknown record type %hu\n, ut-ut_type); break; } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226842 - head/sbin/hastd
Author: pjd Date: Thu Oct 27 16:22:17 2011 New Revision: 226842 URL: http://svn.freebsd.org/changeset/base/226842 Log: Correct comments. MFC after:3 days Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c == --- head/sbin/hastd/secondary.c Thu Oct 27 16:20:29 2011(r226841) +++ head/sbin/hastd/secondary.c Thu Oct 27 16:22:17 2011(r226842) @@ -280,13 +280,13 @@ init_remote(struct hast_resource *res, s nv_free(nvout); exit(EX_CONFIG); } else if ( - /* Is primary is out-of-date? */ + /* Is primary out-of-date? */ (res-hr_secondary_localcnt res-hr_primary_remotecnt res-hr_secondary_remotecnt == res-hr_primary_localcnt) || - /* Nodes are more or less in sync? */ + /* Are the nodes 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? */ + /* Is secondary out-of-date? */ (res-hr_secondary_localcnt == res-hr_primary_remotecnt res-hr_secondary_remotecnt res-hr_primary_localcnt)) { /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226843 - in head/sys: amd64/amd64 dev/xen/balloon i386/i386 i386/xen kern vm
Author: alc Date: Thu Oct 27 16:39:17 2011 New Revision: 226843 URL: http://svn.freebsd.org/changeset/base/226843 Log: Eliminate vestiges of page coloring in VM_ALLOC_NOOBJ calls to vm_page_alloc(). While I'm here, for the sake of consistency, always specify the allocation class, such as VM_ALLOC_NORMAL, as the first of the flags. Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/uma_machdep.c head/sys/dev/xen/balloon/balloon.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c head/sys/kern/vfs_bio.c head/sys/vm/vm_kern.c Modified: head/sys/amd64/amd64/pmap.c == --- head/sys/amd64/amd64/pmap.c Thu Oct 27 16:22:17 2011(r226842) +++ head/sys/amd64/amd64/pmap.c Thu Oct 27 16:39:17 2011(r226843) @@ -1635,7 +1635,6 @@ int pmap_pinit(pmap_t pmap) { vm_page_t pml4pg; - static vm_pindex_t color; int i; PMAP_LOCK_INIT(pmap); @@ -1643,8 +1642,8 @@ pmap_pinit(pmap_t pmap) /* * allocate the page directory page */ - while ((pml4pg = vm_page_alloc(NULL, color++, VM_ALLOC_NOOBJ | - VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) + while ((pml4pg = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | + VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) VM_WAIT; pmap-pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pml4pg)); @@ -2188,7 +2187,6 @@ get_pv_entry(pmap_t pmap, int try) { static const struct timeval printinterval = { 60, 0 }; static struct timeval lastprint; - static vm_pindex_t colour; struct vpgqueues *pq; int bit, field; pv_entry_t pv; @@ -2228,7 +2226,7 @@ retry: } } /* No free items, allocate another chunk */ - m = vm_page_alloc(NULL, colour, (pq == vm_page_queues[PQ_ACTIVE] ? + m = vm_page_alloc(NULL, 0, (pq == vm_page_queues[PQ_ACTIVE] ? VM_ALLOC_SYSTEM : VM_ALLOC_NORMAL) | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); if (m == NULL) { @@ -2255,7 +2253,6 @@ retry: } PV_STAT(pc_chunk_count++); PV_STAT(pc_chunk_allocs++); - colour++; dump_add_page(m-phys_addr); pc = (void *)PHYS_TO_DMAP(m-phys_addr); pc-pc_pmap = pmap; Modified: head/sys/amd64/amd64/uma_machdep.c == --- head/sys/amd64/amd64/uma_machdep.c Thu Oct 27 16:22:17 2011 (r226842) +++ head/sys/amd64/amd64/uma_machdep.c Thu Oct 27 16:39:17 2011 (r226843) @@ -42,7 +42,6 @@ __FBSDID($FreeBSD$); void * uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) { - static vm_pindex_t colour; vm_page_t m; vm_paddr_t pa; void *va; @@ -50,13 +49,13 @@ uma_small_alloc(uma_zone_t zone, int byt *flags = UMA_SLAB_PRIV; if ((wait (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) - pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; + pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; else - pflags = VM_ALLOC_SYSTEM | VM_ALLOC_WIRED; + pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED; if (wait M_ZERO) pflags |= VM_ALLOC_ZERO; for (;;) { - m = vm_page_alloc(NULL, colour++, pflags | VM_ALLOC_NOOBJ); + m = vm_page_alloc(NULL, 0, pflags); if (m == NULL) { if (wait M_NOWAIT) return (NULL); Modified: head/sys/dev/xen/balloon/balloon.c == --- head/sys/dev/xen/balloon/balloon.c Thu Oct 27 16:22:17 2011 (r226842) +++ head/sys/dev/xen/balloon/balloon.c Thu Oct 27 16:39:17 2011 (r226843) @@ -298,8 +298,7 @@ decrease_reservation(unsigned long nr_pa nr_pages = ARRAY_SIZE(frame_list); for (i = 0; i nr_pages; i++) { - int color = 0; - if ((page = vm_page_alloc(NULL, color++, + if ((page = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO)) == NULL) { nr_pages = i; Modified: head/sys/i386/i386/pmap.c == --- head/sys/i386/i386/pmap.c Thu Oct 27 16:22:17 2011(r226842) +++ head/sys/i386/i386/pmap.c Thu Oct 27 16:39:17 2011(r226843) @@ -1720,7 +1720,6 @@ pmap_pinit(pmap_t pmap) { vm_page_t m, ptdpg[NPGPTD]; vm_paddr_t pa; - static int color; int i; PMAP_LOCK_INIT(pmap); @@ -1754,9 +1753,8 @@ pmap_pinit(pmap_t pmap) * allocate the page directory page(s) */ for (i = 0; i
svn commit: r226844 - stable/8/sys/dev/dc
Author: yongari Date: Thu Oct 27 16:47:09 2011 New Revision: 226844 URL: http://svn.freebsd.org/changeset/base/226844 Log: MFC r226695-226696: r226695: Fix a regression introduced in r218832. For TX status check, driver should use a TX list DMA tag. r226696: Add missing bus_dmamap_sync() in setup frame transmit. Modified: stable/8/sys/dev/dc/if_dc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/dc/if_dc.c == --- stable/8/sys/dev/dc/if_dc.c Thu Oct 27 16:39:17 2011(r226843) +++ stable/8/sys/dev/dc/if_dc.c Thu Oct 27 16:47:09 2011(r226844) @@ -1136,6 +1136,8 @@ dc_setfilt_21143(struct dc_softc *sc) sp[41] = DC_SP_MAC(eaddr[2]); sframe-dc_status = htole32(DC_TXSTAT_OWN); + bus_dmamap_sync(sc-dc_tx_ltag, sc-dc_tx_lmap, BUS_DMASYNC_PREREAD | + BUS_DMASYNC_PREWRITE); bus_dmamap_sync(sc-dc_stag, sc-dc_smap, BUS_DMASYNC_PREWRITE); CSR_WRITE_4(sc, DC_TXSTART, 0x); @@ -1342,6 +1344,8 @@ dc_setfilt_xircom(struct dc_softc *sc) DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON); DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ON); sframe-dc_status = htole32(DC_TXSTAT_OWN); + bus_dmamap_sync(sc-dc_tx_ltag, sc-dc_tx_lmap, BUS_DMASYNC_PREREAD | + BUS_DMASYNC_PREWRITE); bus_dmamap_sync(sc-dc_stag, sc-dc_smap, BUS_DMASYNC_PREWRITE); CSR_WRITE_4(sc, DC_TXSTART, 0x); @@ -2970,7 +2974,7 @@ dc_txeof(struct dc_softc *sc) * Go through our tx list and free mbufs for those * frames that have been transmitted. */ - bus_dmamap_sync(sc-dc_rx_ltag, sc-dc_tx_lmap, BUS_DMASYNC_POSTREAD | + bus_dmamap_sync(sc-dc_tx_ltag, sc-dc_tx_lmap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); setup = 0; for (idx = sc-dc_cdata.dc_tx_cons; idx != sc-dc_cdata.dc_tx_prod; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226845 - stable/7/sys/dev/dc
Author: yongari Date: Thu Oct 27 16:48:19 2011 New Revision: 226845 URL: http://svn.freebsd.org/changeset/base/226845 Log: MFC r226695-226696: r226695: Fix a regression introduced in r218832. For TX status check, driver should use a TX list DMA tag. r226696: Add missing bus_dmamap_sync() in setup frame transmit. Modified: stable/7/sys/dev/dc/if_dc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/dc/if_dc.c == --- stable/7/sys/dev/dc/if_dc.c Thu Oct 27 16:47:09 2011(r226844) +++ stable/7/sys/dev/dc/if_dc.c Thu Oct 27 16:48:19 2011(r226845) @@ -1137,6 +1137,8 @@ dc_setfilt_21143(struct dc_softc *sc) sp[41] = DC_SP_MAC(eaddr[2]); sframe-dc_status = htole32(DC_TXSTAT_OWN); + bus_dmamap_sync(sc-dc_tx_ltag, sc-dc_tx_lmap, BUS_DMASYNC_PREREAD | + BUS_DMASYNC_PREWRITE); bus_dmamap_sync(sc-dc_stag, sc-dc_smap, BUS_DMASYNC_PREWRITE); CSR_WRITE_4(sc, DC_TXSTART, 0x); @@ -1343,6 +1345,8 @@ dc_setfilt_xircom(struct dc_softc *sc) DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_TX_ON); DC_SETBIT(sc, DC_NETCFG, DC_NETCFG_RX_ON); sframe-dc_status = htole32(DC_TXSTAT_OWN); + bus_dmamap_sync(sc-dc_tx_ltag, sc-dc_tx_lmap, BUS_DMASYNC_PREREAD | + BUS_DMASYNC_PREWRITE); bus_dmamap_sync(sc-dc_stag, sc-dc_smap, BUS_DMASYNC_PREWRITE); CSR_WRITE_4(sc, DC_TXSTART, 0x); @@ -2971,7 +2975,7 @@ dc_txeof(struct dc_softc *sc) * Go through our tx list and free mbufs for those * frames that have been transmitted. */ - bus_dmamap_sync(sc-dc_rx_ltag, sc-dc_tx_lmap, BUS_DMASYNC_POSTREAD | + bus_dmamap_sync(sc-dc_tx_ltag, sc-dc_tx_lmap, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); setup = 0; for (idx = sc-dc_cdata.dc_tx_cons; idx != sc-dc_cdata.dc_tx_prod; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226846 - head/lib/libc/gen
Author: ed Date: Thu Oct 27 17:05:18 2011 New Revision: 226846 URL: http://svn.freebsd.org/changeset/base/226846 Log: Make our utmpx more like System V. When booting the system, truncate the utx.active file, but do write the BOOT_TIME record into it afterwards. This allows one to obtain the boot time of the system as follows: struct utmpx u1 = { .ut_type = BOOT_TIME }, *u2; setutxent(); u2 = getutxid(u1); Now, the boot time is stored in u2-ut_tv, just like on Linux and other systems. We don't open the utx.active file with O_EXLOCK. It's rather unlikely that other applications use this database at the same time and I want to prevent the possibility of deadlocks in init(8). Discussed with: pluknet Modified: head/lib/libc/gen/getutxent.3 head/lib/libc/gen/pututxline.c Modified: head/lib/libc/gen/getutxent.3 == --- head/lib/libc/gen/getutxent.3 Thu Oct 27 16:48:19 2011 (r226845) +++ head/lib/libc/gen/getutxent.3 Thu Oct 27 17:05:18 2011 (r226846) @@ -301,7 +301,6 @@ The value of determines which databases are modified. .Pp Entries of type -.Dv BOOT_TIME , .Dv SHUTDOWN_TIME , .Dv OLD_TIME and @@ -335,7 +334,7 @@ In addition, entries of type .Dv BOOT_TIME and .Dv SHUTDOWN_TIME -will cause all entries in +will cause all existing entries in .Pa /var/run/utx.active to be discarded. .Pp Modified: head/lib/libc/gen/pututxline.c == --- head/lib/libc/gen/pututxline.c Thu Oct 27 16:48:19 2011 (r226845) +++ head/lib/libc/gen/pututxline.c Thu Oct 27 17:05:18 2011 (r226846) @@ -86,6 +86,9 @@ utx_active_add(const struct futx *fu) return (-1); while (fread(fe, sizeof(fe), 1, fp) == 1) { switch (fe.fu_type) { + case BOOT_TIME: + /* Leave these intact. */ + break; case USER_PROCESS: case INIT_PROCESS: case LOGIN_PROCESS: @@ -171,6 +174,19 @@ utx_active_remove(struct futx *fu) } static void +utx_active_init(const struct futx *fu) +{ + int fd; + + /* Initialize utx.active with a single BOOT_TIME record. */ + fd = _open(_PATH_UTX_ACTIVE, O_CREAT|O_RDWR|O_TRUNC, 0644); + if (fd 0) + return; + _write(fd, fu, sizeof(*fu)); + _close(fd); +} + +static void utx_active_purge(void) { @@ -277,9 +293,11 @@ pututxline(const struct utmpx *utmpx) switch (fu.fu_type) { case BOOT_TIME: + utx_active_init(fu); + utx_lastlogin_upgrade(); + break; case SHUTDOWN_TIME: utx_active_purge(); - utx_lastlogin_upgrade(); break; case OLD_TIME: case NEW_TIME: ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226847 - head/lib/libc/gen
Author: ed Date: Thu Oct 27 17:21:41 2011 New Revision: 226847 URL: http://svn.freebsd.org/changeset/base/226847 Log: Don't forget to kick the man page date. Modified: head/lib/libc/gen/getutxent.3 Modified: head/lib/libc/gen/getutxent.3 == --- head/lib/libc/gen/getutxent.3 Thu Oct 27 17:05:18 2011 (r226846) +++ head/lib/libc/gen/getutxent.3 Thu Oct 27 17:21:41 2011 (r226847) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd February 19, 2011 +.Dd October 27, 2011 .Dt GETUTXENT 3 .Os .Sh NAME ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226848 - head/sys/vm
Author: alc Date: Thu Oct 27 17:29:19 2011 New Revision: 226848 URL: http://svn.freebsd.org/changeset/base/226848 Log: Tidy up the comment at the head of vm_page_alloc, and mention that the returned page has the flag VPO_BUSY set. Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c == --- head/sys/vm/vm_page.c Thu Oct 27 17:21:41 2011(r226847) +++ head/sys/vm/vm_page.c Thu Oct 27 17:29:19 2011(r226848) @@ -1286,8 +1286,9 @@ vm_page_cache_transfer(vm_object_t orig_ /* * vm_page_alloc: * - * Allocate and return a memory cell associated - * with this VM object/offset pair. + * Allocate and return a page that is associated with the specified + * object and offset pair. By default, this page has the flag VPO_BUSY + * set. * * The caller must always specify an allocation class. * @@ -1297,13 +1298,14 @@ vm_page_cache_transfer(vm_object_t orig_ * VM_ALLOC_INTERRUPT interrupt time request * * optional allocation flags: - * VM_ALLOC_ZERO prefer a zeroed page - * VM_ALLOC_WIRED wire the allocated page - * VM_ALLOC_NOOBJ page is not associated with a vm object - * VM_ALLOC_NOBUSY do not set the page busy * VM_ALLOC_IFCACHED return page only if it is cached * VM_ALLOC_IFNOTCACHEDreturn NULL, do not reactivate if the page * is cached + * VM_ALLOC_NOBUSY do not set the flag VPO_BUSY on the page + * VM_ALLOC_NOOBJ page is not associated with an object and + * should not have the flag VPO_BUSY set + * VM_ALLOC_WIRED wire the allocated page + * VM_ALLOC_ZERO prefer a zeroed page * * This routine may not sleep. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226849 - head/sys/kern
Author: jhb Date: Thu Oct 27 17:43:36 2011 New Revision: 226849 URL: http://svn.freebsd.org/changeset/base/226849 Log: Whitespace fix. Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c == --- head/sys/kern/vfs_subr.cThu Oct 27 17:29:19 2011(r226848) +++ head/sys/kern/vfs_subr.cThu Oct 27 17:43:36 2011(r226849) @@ -1255,7 +1255,7 @@ vinvalbuf(struct vnode *vp, int flags, i * */ static int -flushbuflist( struct bufv *bufv, int flags, struct bufobj *bo, int slpflag, +flushbuflist(struct bufv *bufv, int flags, struct bufobj *bo, int slpflag, int slptimeo) { struct buf *bp, *nbp; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226850 - head/sys/sys
Author: jhb Date: Thu Oct 27 17:44:51 2011 New Revision: 226850 URL: http://svn.freebsd.org/changeset/base/226850 Log: Sort function prototypes. Modified: head/sys/sys/fcntl.h Modified: head/sys/sys/fcntl.h == --- head/sys/sys/fcntl.hThu Oct 27 17:43:36 2011(r226849) +++ head/sys/sys/fcntl.hThu Oct 27 17:44:51 2011(r226850) @@ -286,15 +286,15 @@ __BEGIN_DECLS intopen(const char *, int, ...); intcreat(const char *, mode_t); intfcntl(int, int, ...); +#if __BSD_VISIBLE +intflock(int, int); +#endif #if __BSD_VISIBLE || __POSIX_VISIBLE = 200809 intopenat(int, const char *, int, ...); #endif #if __BSD_VISIBLE || __POSIX_VISIBLE = 200112 intposix_fallocate(int, off_t, off_t); #endif -#if __BSD_VISIBLE -intflock(int, int); -#endif __END_DECLS #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226851 - head/sbin/hastd
Author: pjd Date: Thu Oct 27 18:45:01 2011 New Revision: 226851 URL: http://svn.freebsd.org/changeset/base/226851 Log: Delay resuid generation until first connection to secondary, not until first write. This way on first connection we will synchronize only the extents that were modified during the lifetime of primary node, not entire GEOM provider. MFC after:3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c == --- head/sbin/hastd/primary.c Thu Oct 27 17:44:51 2011(r226850) +++ head/sbin/hastd/primary.c Thu Oct 27 18:45:01 2011(r226851) @@ -1159,13 +1159,10 @@ ggate_recv_thread(void *arg) break; case BIO_WRITE: res-hr_stat_write++; - if (res-hr_resuid == 0) { - /* -* This is first write, initialize localcnt and -* resuid. -*/ + if (res-hr_resuid == 0 + res-hr_primary_localcnt == 0) { + /* This is first write. */ res-hr_primary_localcnt = 1; - (void)init_resuid(res); } for (;;) { mtx_lock(range_lock); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226852 - head/sbin/hastd
Author: pjd Date: Thu Oct 27 18:49:16 2011 New Revision: 226852 URL: http://svn.freebsd.org/changeset/base/226852 Log: Monor cleanups. MFC after:3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c == --- head/sbin/hastd/primary.c Thu Oct 27 18:45:01 2011(r226851) +++ head/sbin/hastd/primary.c Thu Oct 27 18:49:16 2011(r226852) @@ -1453,9 +1453,6 @@ remote_send_thread(void *arg) /* Move failed request immediately to the done queue. */ goto done_queue; } - pjdlog_debug(2, - remote_send: (%p) Moving request to the recv queue., - hio); /* * Protect connection from disappearing. */ @@ -1470,6 +1467,9 @@ remote_send_thread(void *arg) * in different order we can get reply before we move request * to recv queue. */ + pjdlog_debug(2, + remote_send: (%p) Moving request to the recv queue., + hio); mtx_lock(hio_recv_list_lock[ncomp]); wakeup = TAILQ_EMPTY(hio_recv_list[ncomp]); TAILQ_INSERT_TAIL(hio_recv_list[ncomp], hio, hio_next[ncomp]); @@ -1489,7 +1489,8 @@ remote_send_thread(void *arg) * it immediately to the done queue. */ mtx_lock(hio_recv_list_lock[ncomp]); - TAILQ_REMOVE(hio_recv_list[ncomp], hio, hio_next[ncomp]); + TAILQ_REMOVE(hio_recv_list[ncomp], hio, + hio_next[ncomp]); mtx_unlock(hio_recv_list_lock[ncomp]); goto done_queue; } @@ -1599,16 +1600,16 @@ remote_recv_thread(void *arg) nv_free(nv); continue; } + ggio = hio-hio_ggio; error = nv_get_int16(nv, error); if (error != 0) { /* Request failed on remote side. */ hio-hio_errors[ncomp] = error; - reqlog(LOG_WARNING, 0, hio-hio_ggio, + reqlog(LOG_WARNING, 0, ggio, Remote request failed (%s): , strerror(error)); nv_free(nv); goto done_queue; } - ggio = hio-hio_ggio; switch (ggio-gctl_cmd) { case BIO_READ: rw_rlock(hio_remote_lock[ncomp]); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226853 - stable/9/usr.bin/grep
Author: gabor Date: Thu Oct 27 19:18:54 2011 New Revision: 226853 URL: http://svn.freebsd.org/changeset/base/226853 Log: MFC r226664: - Install BSD grep properly, based on the value of WITH_BSD_GREP Approved by: re (kib) Modified: stable/9/usr.bin/grep/Makefile Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/Makefile == --- stable/9/usr.bin/grep/Makefile Thu Oct 27 18:49:16 2011 (r226852) +++ stable/9/usr.bin/grep/Makefile Thu Oct 27 19:18:54 2011 (r226853) @@ -53,12 +53,14 @@ DPADD= ${LIBZ} ${LIBLZMA} LDADD+=-lbz2 DPADD+=${LIBBZ2} +.if ${MK_BSD_GREP} == yes LINKS+= ${BINDIR}/grep ${BINDIR}/bzgrep \ ${BINDIR}/grep ${BINDIR}/bzegrep \ ${BINDIR}/grep ${BINDIR}/bzfgrep MLINKS+= grep.1 bzgrep.1 \ grep.1 bzegrep.1 \ grep.1 bzfgrep.1 +.endif .else CFLAGS+= -DWITHOUT_BZIP2 .endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226854 - head/sbin/hastd
Author: pjd Date: Thu Oct 27 20:01:23 2011 New Revision: 226854 URL: http://svn.freebsd.org/changeset/base/226854 Log: - Eliminate the need for hio_nv. - Introduce hio_clear() function for clearing hio before returning it onto free queue. MFC after:3 days Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c == --- head/sbin/hastd/secondary.c Thu Oct 27 19:18:54 2011(r226853) +++ head/sbin/hastd/secondary.c Thu Oct 27 20:01:23 2011(r226854) @@ -67,7 +67,6 @@ __FBSDID($FreeBSD$); struct hio { uint64_t hio_seq; int hio_error; - struct nv *hio_nv; void*hio_data; uint8_t hio_cmd; uint64_t hio_offset; @@ -126,6 +125,17 @@ static void *send_thread(void *arg); TAILQ_REMOVE(hio_##name##_list, (hio), hio_next); \ mtx_unlock(hio_##name##_list_lock);\ } while (0) + +static void +hio_clear(struct hio *hio) +{ + + hio-hio_seq = 0; + hio-hio_error = 0; + hio-hio_cmd = HIO_UNDEF; + hio-hio_offset = 0; + hio-hio_length = 0; +} static void init_environment(void) @@ -156,13 +166,13 @@ init_environment(void) Unable to allocate memory (%zu bytes) for hio request., sizeof(*hio)); } - hio-hio_error = 0; hio-hio_data = malloc(MAXPHYS); if (hio-hio_data == NULL) { pjdlog_exitx(EX_TEMPFAIL, Unable to allocate memory (%zu bytes) for gctl_data., (size_t)MAXPHYS); } + hio_clear(hio); TAILQ_INSERT_HEAD(hio_free_list, hio, hio_next); } } @@ -268,6 +278,7 @@ init_remote(struct hast_resource *res, s } else if (res-hr_resuid != resuid) { char errmsg[256]; + free(map); (void)snprintf(errmsg, sizeof(errmsg), Resource unique ID mismatch (primary=%ju, secondary=%ju)., (uintmax_t)resuid, (uintmax_t)res-hr_resuid); @@ -315,11 +326,17 @@ init_remote(struct hast_resource *res, s /* * Not good, we have split-brain condition. */ + free(map); pjdlog_error(Split-brain detected, exiting.); nv_add_string(nvout, Split-brain condition!, errmsg); - free(map); - map = NULL; - mapsize = 0; + 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); + } + nv_free(nvout); + /* Exit on split-brain. */ + event_send(res, EVENT_SPLITBRAIN); + exit(EX_CONFIG); } else /* if (res-hr_secondary_localcnt res-hr_primary_remotecnt || res-hr_primary_localcnt res-hr_secondary_remotecnt) */ { /* @@ -358,12 +375,6 @@ init_remote(struct hast_resource *res, s if (proto_recv(res-hr_remotein, NULL, 0) == -1) pjdlog_errno(LOG_WARNING, Unable to set connection direction); #endif - if (res-hr_secondary_localcnt res-hr_primary_remotecnt -res-hr_primary_localcnt res-hr_secondary_remotecnt) { - /* Exit on split-brain. */ - event_send(res, EVENT_SPLITBRAIN); - exit(EX_CONFIG); - } } void @@ -508,15 +519,23 @@ reqlog(int loglevel, int debuglevel, int } static int -requnpack(struct hast_resource *res, struct hio *hio) +requnpack(struct hast_resource *res, struct hio *hio, struct nv *nv) { - hio-hio_cmd = nv_get_uint8(hio-hio_nv, cmd); + hio-hio_cmd = nv_get_uint8(nv, cmd); if (hio-hio_cmd == 0) { pjdlog_error(Header contains no 'cmd' field.); hio-hio_error = EINVAL; goto end; } + if (hio-hio_cmd != HIO_KEEPALIVE) { + hio-hio_seq = nv_get_uint64(nv, seq); + if (hio-hio_seq == 0) { + pjdlog_error(Header contains no 'seq' field.); + hio-hio_error = EINVAL; + goto end; + } + } switch (hio-hio_cmd) { case HIO_FLUSH: case HIO_KEEPALIVE: @@ -524,14 +543,14 @@ requnpack(struct hast_resource *res, str case HIO_READ: case HIO_WRITE: case HIO_DELETE: - hio-hio_offset = nv_get_uint64(hio-hio_nv, offset); - if (nv_error(hio-hio_nv) != 0) { + hio-hio_offset = nv_get_uint64(nv, offset); + if (nv_error(nv) != 0) {
svn commit: r226855 - head/sbin/hastd
Author: pjd Date: Thu Oct 27 20:10:21 2011 New Revision: 226855 URL: http://svn.freebsd.org/changeset/base/226855 Log: Improve comment so it doesn't suggest race is possible, but that we handle the race. MFC after:3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c == --- head/sbin/hastd/primary.c Thu Oct 27 20:01:23 2011(r226854) +++ head/sbin/hastd/primary.c Thu Oct 27 20:10:21 2011(r226855) @@ -1021,7 +1021,7 @@ remote_close(struct hast_resource *res, rw_wlock(hio_remote_lock[ncomp]); /* -* A race is possible between dropping rlock and acquiring wlock - +* Check for a race between dropping rlock and acquiring wlock - * another thread can close connection in-between. */ if (!ISCONNECTED(res, ncomp)) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226856 - head/sbin/hastd
Author: pjd Date: Thu Oct 27 20:13:39 2011 New Revision: 226856 URL: http://svn.freebsd.org/changeset/base/226856 Log: Reduce indentation. MFC after:3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c == --- head/sbin/hastd/primary.c Thu Oct 27 20:10:21 2011(r226855) +++ head/sbin/hastd/primary.c Thu Oct 27 20:13:39 2011(r226856) @@ -1319,18 +1319,18 @@ local_send_thread(void *arg) } break; } - if (refcount_release(hio-hio_countdown)) { - if (ISSYNCREQ(hio)) { - mtx_lock(sync_lock); - SYNCREQDONE(hio); - mtx_unlock(sync_lock); - cv_signal(sync_cond); - } else { - pjdlog_debug(2, - local_send: (%p) Moving request to the done queue., - hio); - QUEUE_INSERT2(hio, done); - } + if (!refcount_release(hio-hio_countdown)) + continue; + if (ISSYNCREQ(hio)) { + mtx_lock(sync_lock); + SYNCREQDONE(hio); + mtx_unlock(sync_lock); + cv_signal(sync_cond); + } else { + pjdlog_debug(2, + local_send: (%p) Moving request to the done queue., + hio); + QUEUE_INSERT2(hio, done); } } /* NOTREACHED */ @@ -1640,18 +1640,18 @@ remote_recv_thread(void *arg) hio-hio_errors[ncomp] = 0; nv_free(nv); done_queue: - if (refcount_release(hio-hio_countdown)) { - if (ISSYNCREQ(hio)) { - mtx_lock(sync_lock); - SYNCREQDONE(hio); - mtx_unlock(sync_lock); - cv_signal(sync_cond); - } else { - pjdlog_debug(2, - remote_recv: (%p) Moving request to the done queue., - hio); - QUEUE_INSERT2(hio, done); - } + if (!refcount_release(hio-hio_countdown)) + continue; + if (ISSYNCREQ(hio)) { + mtx_lock(sync_lock); + SYNCREQDONE(hio); + mtx_unlock(sync_lock); + cv_signal(sync_cond); + } else { + pjdlog_debug(2, + remote_recv: (%p) Moving request to the done queue., + hio); + QUEUE_INSERT2(hio, done); } } /* NOTREACHED */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226857 - head/sbin/hastd
Author: pjd Date: Thu Oct 27 20:15:37 2011 New Revision: 226857 URL: http://svn.freebsd.org/changeset/base/226857 Log: Minor cleanups. MFC after:3 days Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c == --- head/sbin/hastd/primary.c Thu Oct 27 20:13:39 2011(r226856) +++ head/sbin/hastd/primary.c Thu Oct 27 20:15:37 2011(r226857) @@ -1556,6 +1556,7 @@ remote_recv_thread(void *arg) hio_recv_list_lock[ncomp]); } mtx_unlock(hio_recv_list_lock[ncomp]); + rw_rlock(hio_remote_lock[ncomp]); if (!ISCONNECTED(res, ncomp)) { rw_unlock(hio_remote_lock[ncomp]); @@ -1963,7 +1964,7 @@ sync_thread(void *arg __unused) } mtx_unlock(metadata_lock); - pjdlog_debug(2, sync: (%p) Moving request to the send queues., + pjdlog_debug(2, sync: (%p) Moving request to the send queue., hio); refcount_init(hio-hio_countdown, 1); QUEUE_INSERT1(hio, send, ncomp); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226858 - stable/9/usr.sbin/boot0cfg
Author: ae Date: Thu Oct 27 20:23:03 2011 New Revision: 226858 URL: http://svn.freebsd.org/changeset/base/226858 Log: MFC r226714: Fix argument name. This fixes EINVAL when boot0cfg uses GEOM_PART' control interface. Approved by: re (kib) Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.c Directory Properties: stable/9/usr.sbin/boot0cfg/ (props changed) Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.c == --- stable/9/usr.sbin/boot0cfg/boot0cfg.c Thu Oct 27 20:15:37 2011 (r226857) +++ stable/9/usr.sbin/boot0cfg/boot0cfg.c Thu Oct 27 20:23:03 2011 (r226858) @@ -378,7 +378,7 @@ write_mbr(const char *fname, int flags, } grq = gctl_get_handle(); gctl_ro_param(grq, class, -1, PART); -gctl_ro_param(grq, geom, -1, pname); +gctl_ro_param(grq, arg0, -1, pname); gctl_ro_param(grq, verb, -1, bootcode); gctl_ro_param(grq, bootcode, mbr_size, mbr); gctl_ro_param(grq, flags, -1, C); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226859 - head/sbin/hastd
Author: pjd Date: Thu Oct 27 20:32:57 2011 New Revision: 226859 URL: http://svn.freebsd.org/changeset/base/226859 Log: Implement 'async' mode for HAST. MFC after:3 days Modified: head/sbin/hastd/hast.conf.5 head/sbin/hastd/parse.y head/sbin/hastd/primary.c Modified: head/sbin/hastd/hast.conf.5 == --- head/sbin/hastd/hast.conf.5 Thu Oct 27 20:23:03 2011(r226858) +++ head/sbin/hastd/hast.conf.5 Thu Oct 27 20:32:57 2011(r226859) @@ -28,7 +28,7 @@ .\ .\ $FreeBSD$ .\ -.Dd May 20, 2011 +.Dd October 27, 2011 .Dt HAST.CONF 5 .Os .Sh NAME @@ -224,9 +224,6 @@ completes. This is the fastest and the most dangerous replication mode. This mode should be used when replicating to a distant node where latency is too high for other modes. -The -.Ic async -replication mode is currently not implemented. .El .It Ic checksum Aq algorithm .Pp Modified: head/sbin/hastd/parse.y == --- head/sbin/hastd/parse.y Thu Oct 27 20:23:03 2011(r226858) +++ head/sbin/hastd/parse.y Thu Oct 27 20:32:57 2011(r226859) @@ -301,11 +301,9 @@ yy_config_parse(const char *config, bool */ curres-hr_replication = depth0_replication; } - if (curres-hr_replication == HAST_REPLICATION_MEMSYNC || - curres-hr_replication == HAST_REPLICATION_ASYNC) { + if (curres-hr_replication == HAST_REPLICATION_MEMSYNC) { pjdlog_warning(Replication mode \%s\ is not implemented, falling back to \%s\., - curres-hr_replication == HAST_REPLICATION_MEMSYNC ? - memsync : async, fullsync); + memsync, fullsync); curres-hr_replication = HAST_REPLICATION_FULLSYNC; } if (curres-hr_checksum == -1) { Modified: head/sbin/hastd/primary.c == --- head/sbin/hastd/primary.c Thu Oct 27 20:23:03 2011(r226858) +++ head/sbin/hastd/primary.c Thu Oct 27 20:32:57 2011(r226859) @@ -89,6 +89,15 @@ struct hio { * Structure used to communicate with GEOM Gate class. */ struct g_gate_ctl_io hio_ggio; + /* +* Request was already confirmed to GEOM Gate. +*/ + bool hio_done; + /* +* Remember replication from the time the request was initiated, +* so we won't get confused when replication changes on reload. +*/ + int hio_replication; TAILQ_ENTRY(hio)*hio_next; }; #definehio_free_next hio_next[0] @@ -1056,6 +1065,42 @@ remote_close(struct hast_resource *res, } /* + * Acknowledge write completion to the kernel, but don't update activemap yet. + */ +static void +write_complete(struct hast_resource *res, struct hio *hio) +{ + struct g_gate_ctl_io *ggio; + unsigned int ncomp; + + PJDLOG_ASSERT(!hio-hio_done); + + ggio = hio-hio_ggio; + PJDLOG_ASSERT(ggio-gctl_cmd == BIO_WRITE); + + /* +* Bump local count if this is first write after +* connection failure with remote node. +*/ + ncomp = 1; + rw_rlock(hio_remote_lock[ncomp]); + if (!ISCONNECTED(res, ncomp)) { + mtx_lock(metadata_lock); + if (res-hr_primary_localcnt == res-hr_secondary_remotecnt) { + res-hr_primary_localcnt++; + pjdlog_debug(1, Increasing localcnt to %ju., + (uintmax_t)res-hr_primary_localcnt); + (void)metadata_write(res); + } + mtx_unlock(metadata_lock); + } + rw_unlock(hio_remote_lock[ncomp]); + if (ioctl(res-hr_ggatefd, G_GATE_CMD_DONE, ggio) 0) + primary_exit(EX_OSERR, G_GATE_CMD_DONE failed); + hio-hio_done = true; +} + +/* * Thread receives ggate I/O requests from the kernel and passes them to * appropriate threads: * WRITE - always goes to both local_send and remote_send threads @@ -1075,8 +1120,6 @@ ggate_recv_thread(void *arg) unsigned int ii, ncomp, ncomps; int error; - ncomps = HAST_NCOMPONENTS; - for (;;) { pjdlog_debug(2, ggate_recv: Taking free request.); QUEUE_TAKE2(hio, free); @@ -1085,6 +1128,8 @@ ggate_recv_thread(void *arg) ggio-gctl_unit = res-hr_ggateunit; ggio-gctl_length = MAXPHYS; ggio-gctl_error = 0; + hio-hio_done = false; + hio-hio_replication = res-hr_replication; pjdlog_debug(2, ggate_recv: (%p) Waiting for request from the kernel.,
svn commit: r226860 - head/etc
Author: gavin Date: Thu Oct 27 20:35:21 2011 New Revision: 226860 URL: http://svn.freebsd.org/changeset/base/226860 Log: Update the example rules in devfs.conf to reflect the changes since ATA_CAM. While here, add another example rule, as many applications these days expect to find /dev/dvd instead. MFC after:3 days Modified: head/etc/devfs.conf Modified: head/etc/devfs.conf == --- head/etc/devfs.conf Thu Oct 27 20:32:57 2011(r226859) +++ head/etc/devfs.conf Thu Oct 27 20:35:21 2011(r226860) @@ -35,7 +35,8 @@ #link ttyv0 vga # Commonly used by many ports -#link acd0cdrom +#link cd0 cdrom +#link cd0 dvd # Allow a user in the wheel group to query the smb0 device #perm smb00660 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r226775 - in head: etc sbin/devd
Hi, I like this. Do you have plans the commit it on stable/9? Ronald. On Wed, 26 Oct 2011 04:11:28 +0200, Hiroki Sato h...@freebsd.org wrote: Author: hrs Date: Wed Oct 26 02:11:28 2011 New Revision: 226775 URL: http://svn.freebsd.org/changeset/base/226775 Log: - Add support for a ! character in regex matching in devd(8). It inverts the logic (true/false) of the matching. - Add !usbus[0-9]+ to IFNET ATTACH notification handler in the default devd.conf to prevent rc.d/netif from running when usbus[0-9]+ is attached. Reviewed by: imp Modified: head/etc/devd.conf head/sbin/devd/devd.cc head/sbin/devd/devd.conf.5 head/sbin/devd/devd.hh Modified: head/etc/devd.conf == --- head/etc/devd.conf Wed Oct 26 01:58:36 2011(r226774) +++ head/etc/devd.conf Wed Oct 26 02:11:28 2011(r226775) @@ -38,6 +38,7 @@ options { # notify 0 { match systemIFNET; + match subsystem !usbus[0-9]+; match type ATTACH; action /etc/pccard_ether $subsystem start; }; Modified: head/sbin/devd/devd.cc == --- head/sbin/devd/devd.cc Wed Oct 26 01:58:36 2011(r226774) +++ head/sbin/devd/devd.cc Wed Oct 26 02:11:28 2011(r226775) @@ -251,7 +251,14 @@ match::match(config c, const char *var, : _var(var) { _re = ^; - _re.append(c.expand_string(string(re))); + if (!c.expand_string(string(re)).empty() + c.expand_string(string(re)).at(0) == '!') { + _re.append(c.expand_string(string(re)).substr(1)); + _inv = 1; + } else { + _re.append(c.expand_string(string(re))); + _inv = 0; + } _re.append($); regcomp(_regex, _re.c_str(), REG_EXTENDED | REG_NOSUB | REG_ICASE); } @@ -268,10 +275,13 @@ match::do_match(config c) bool retval; if (Dflag) - fprintf(stderr, Testing %s=%s against %s\n, _var.c_str(), - value.c_str(), _re.c_str()); + fprintf(stderr, Testing %s=%s against %s, invert=%d\n, + _var.c_str(), value.c_str(), _re.c_str(), _inv); retval = (regexec(_regex, value.c_str(), 0, NULL, 0) == 0); + if (_inv == 1) + retval = (retval == 0) ? 1 : 0; + return retval; } Modified: head/sbin/devd/devd.conf.5 == --- head/sbin/devd/devd.conf.5 Wed Oct 26 01:58:36 2011(r226774) +++ head/sbin/devd/devd.conf.5 Wed Oct 26 02:11:28 2011(r226775) @@ -41,7 +41,7 @@ .\ ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\ SOFTWARE. .\ -.Dd March 8, 2009 +.Dd October 25, 2011 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -121,6 +121,10 @@ Creates a regular expression and assigns .Ar regexp-name . The variable is available throughout the rest of the configuration file. +If the string begins with +.Ql \! , +it matches if the regular expression formed by the rest of the string +does not match. All regular expressions have an implicit .Ql ^$ around them. Modified: head/sbin/devd/devd.hh == --- head/sbin/devd/devd.hh Wed Oct 26 01:58:36 2011(r226774) +++ head/sbin/devd/devd.hh Wed Oct 26 02:11:28 2011(r226775) @@ -92,6 +92,7 @@ public: private: std::string _var; std::string _re; + bool _inv; regex_t _regex; }; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226861 - head/sbin/hastd
Author: pjd Date: Thu Oct 27 20:36:35 2011 New Revision: 226861 URL: http://svn.freebsd.org/changeset/base/226861 Log: Remove redundant space. MFC after:3 days Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c == --- head/sbin/hastd/secondary.c Thu Oct 27 20:35:21 2011(r226860) +++ head/sbin/hastd/secondary.c Thu Oct 27 20:36:35 2011(r226861) @@ -125,7 +125,7 @@ static void *send_thread(void *arg); TAILQ_REMOVE(hio_##name##_list, (hio), hio_next); \ mtx_unlock(hio_##name##_list_lock);\ } while (0) - + static void hio_clear(struct hio *hio) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r226835 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf
On 10/27/2011 06:07, Ken Smith wrote: Adjust the debugger options slightly. This should help me do the right thing when changing the debugging options as part of head becoming a new stable branch. It may also help people who for one reason or another want to run head but don't want it slowed down by the debugging support. This is great stuff, and I think it will be very helpful to our users. Thanks for taking this on. 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-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226862 - head/etc
Author: gavin Date: Thu Oct 27 20:39:20 2011 New Revision: 226862 URL: http://svn.freebsd.org/changeset/base/226862 Log: Remove example for linking /dev/vga to /dev/ttyv0, this hasn't been required since X version 4.3.0. PR: conf/161847 Submitted by: eadler MFC after:2 weeks Modified: head/etc/devfs.conf Modified: head/etc/devfs.conf == --- head/etc/devfs.conf Thu Oct 27 20:36:35 2011(r226861) +++ head/etc/devfs.conf Thu Oct 27 20:39:20 2011(r226862) @@ -31,9 +31,6 @@ # # Examples: -# Historically X depended on this, but version 4.3.0 doesn't seem to anymore -#link ttyv0 vga - # Commonly used by many ports #link cd0 cdrom #link cd0 dvd ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226863 - head/sys/conf
Author: dougb Date: Thu Oct 27 20:44:28 2011 New Revision: 226863 URL: http://svn.freebsd.org/changeset/base/226863 Log: Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR} (since it no longer exists). Instead, run svnversion if we can find the binary and test that the output looks like a version string. Reviewed by: discussion on -current@ Tested by:rodrigc for non-svn case (thanks!) Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh == --- head/sys/conf/newvers.shThu Oct 27 20:39:20 2011(r226862) +++ head/sys/conf/newvers.shThu Oct 27 20:44:28 2011(r226863) @@ -88,7 +88,7 @@ v=`cat version` u=${USER:-root} d=`pwd` i=`${MAKE:-make} -V KERN_IDENT` for dir in /bin /usr/bin /usr/local/bin; do - if [ -d ${SYSDIR}/.svn -a -x ${dir}/svnversion ] ; then + if [ -x ${dir}/svnversion ] ; then svnversion=${dir}/svnversion break fi @@ -99,8 +99,12 @@ for dir in /bin /usr/bin /usr/local/bin; done if [ -n $svnversion ] ; then -echo $svnversion - svn= r`cd ${SYSDIR} $svnversion` + echo $svnversion + svn=`cd ${SYSDIR} $svnversion` + case $svn in + [0-9]*) svn= r${svn} ;; + *) unset svn ;; + esac fi if [ -n $git_cmd ] ; then ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226864 - head/sys/dev/bge
Author: yongari Date: Thu Oct 27 20:54:53 2011 New Revision: 226864 URL: http://svn.freebsd.org/changeset/base/226864 Log: Rename BGE_FW_DRV_ALIVE/BGE_FW_PAUSE to BGE_FW_CMD_DRV_ALIVE/BGE_FW_CMD_PAUSE. Also add more firmware commands(not used yet). No functional changes. Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c == --- head/sys/dev/bge/if_bge.c Thu Oct 27 20:44:28 2011(r226863) +++ head/sys/dev/bge/if_bge.c Thu Oct 27 20:54:53 2011(r226864) @@ -1368,7 +1368,7 @@ bge_stop_fw(struct bge_softc *sc) int i; if (sc-bge_asf_mode) { - bge_writemem_ind(sc, BGE_SRAM_FW_CMD_MB, BGE_FW_PAUSE); + bge_writemem_ind(sc, BGE_SRAM_FW_CMD_MB, BGE_FW_CMD_PAUSE); CSR_WRITE_4(sc, BGE_RX_CPU_EVENT, CSR_READ_4(sc, BGE_RX_CPU_EVENT) | (1 14)); @@ -4107,7 +4107,7 @@ bge_asf_driver_up(struct bge_softc *sc) else { sc-bge_asf_count = 2; bge_writemem_ind(sc, BGE_SRAM_FW_CMD_MB, - BGE_FW_DRV_ALIVE); + BGE_FW_CMD_DRV_ALIVE); bge_writemem_ind(sc, BGE_SRAM_FW_CMD_LEN_MB, 4); bge_writemem_ind(sc, BGE_SRAM_FW_CMD_DATA_MB, 3); CSR_WRITE_4(sc, BGE_RX_CPU_EVENT, Modified: head/sys/dev/bge/if_bgereg.h == --- head/sys/dev/bge/if_bgereg.hThu Oct 27 20:44:28 2011 (r226863) +++ head/sys/dev/bge/if_bgereg.hThu Oct 27 20:54:53 2011 (r226864) @@ -91,8 +91,14 @@ /* Firmware interface */ #defineBGE_SRAM_DATA_SIG_MAGIC 0x4B657654 /* 'KevT' */ -#defineBGE_FW_DRV_ALIVE0x0001 -#defineBGE_FW_PAUSE0x0002 + +#defineBGE_FW_CMD_DRV_ALIVE0x0001 +#defineBGE_FW_CMD_PAUSE0x0002 +#defineBGE_FW_CMD_IPV4_ADDR_CHANGE 0x0003 +#defineBGE_FW_CMD_IPV6_ADDR_CHANGE 0x0004 +#defineBGE_FW_CMD_LINK_UPDATE 0x000C +#defineBGE_FW_CMD_DRV_ALIVE2 0x000D +#defineBGE_FW_CMD_DRV_ALIVE3 0x000E #defineBGE_FW_DRV_STATE_START 0x0001 #defineBGE_FW_DRV_STATE_START_DONE 0x8001 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r226860 - head/etc
On Thu Oct 27 11, Gavin Atkinson wrote: Author: gavin Date: Thu Oct 27 20:35:21 2011 New Revision: 226860 URL: http://svn.freebsd.org/changeset/base/226860 Log: Update the example rules in devfs.conf to reflect the changes since ATA_CAM. While here, add another example rule, as many applications these days expect to find /dev/dvd instead. http://lists.freebsd.org/pipermail/freebsd-current/2011-October/028406.html ;) MFC after: 3 days Modified: head/etc/devfs.conf Modified: head/etc/devfs.conf == --- head/etc/devfs.conf Thu Oct 27 20:32:57 2011(r226859) +++ head/etc/devfs.conf Thu Oct 27 20:35:21 2011(r226860) @@ -35,7 +35,8 @@ #linkttyv0 vga # Commonly used by many ports -#linkacd0cdrom +#linkcd0 cdrom +#linkcd0 dvd # Allow a user in the wheel group to query the smb0 device #permsmb00660 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r226860 - head/etc
On Thu, Oct 27, 2011 at 1:56 PM, Alexander Best arun...@freebsd.org wrote: On Thu Oct 27 11, Gavin Atkinson wrote: Author: gavin Date: Thu Oct 27 20:35:21 2011 New Revision: 226860 URL: http://svn.freebsd.org/changeset/base/226860 Log: Update the example rules in devfs.conf to reflect the changes since ATA_CAM. While here, add another example rule, as many applications these days expect to find /dev/dvd instead. http://lists.freebsd.org/pipermail/freebsd-current/2011-October/028406.html Great minds think alike :D. -Garrett ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226865 - in head/etc: defaults periodic/daily
Author: delphij Date: Thu Oct 27 21:25:41 2011 New Revision: 226865 URL: http://svn.freebsd.org/changeset/base/226865 Log: Increase default scrub threshold from 30 days to 5 weeks. Using whole weeks makes it easier to predicate when the scrub would happen. MFC after:1 week Modified: head/etc/defaults/periodic.conf head/etc/periodic/daily/800.scrub-zfs Modified: head/etc/defaults/periodic.conf == --- head/etc/defaults/periodic.conf Thu Oct 27 20:54:53 2011 (r226864) +++ head/etc/defaults/periodic.conf Thu Oct 27 21:25:41 2011 (r226865) @@ -150,8 +150,8 @@ daily_submit_queuerun=YES # Also su # 800.scrub-zfs daily_scrub_zfs_enable=NO daily_scrub_zfs_pools= # empty string selects all pools -daily_scrub_zfs_default_threshold=30 # days between scrubs -#daily_scrub_zfs_${poolname}_threshold=30# pool specific threshold +daily_scrub_zfs_default_threshold=35 # days between scrubs +#daily_scrub_zfs_${poolname}_threshold=35# pool specific threshold # 999.local daily_local=/etc/daily.local # Local scripts Modified: head/etc/periodic/daily/800.scrub-zfs == --- head/etc/periodic/daily/800.scrub-zfs Thu Oct 27 20:54:53 2011 (r226864) +++ head/etc/periodic/daily/800.scrub-zfs Thu Oct 27 21:25:41 2011 (r226865) @@ -15,7 +15,7 @@ then source_periodic_confs fi -: ${daily_scrub_zfs_default_threshold=30} +: ${daily_scrub_zfs_default_threshold=35} case $daily_scrub_zfs_enable in [Yy][Ee][Ss]) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226866 - head/sys/dev/bge
Author: yongari Date: Thu Oct 27 21:27:37 2011 New Revision: 226866 URL: http://svn.freebsd.org/changeset/base/226866 Log: Rename hard-coded value 1 14 with BGE_RX_CPU_DRV_EVENT. This bit(SW event 7 in publicly available data sheet) is used to make RX CPU handle a firmware command and the bit is automatically cleared after RX CPU completed the command. Generally firmware command takes the following steps. 1. Write BGE_SRAM_FW_CMD_MB with a command. 2. Write BGE_SRAM_FW_CMD_LEN_MB with the length of the command in bytes. 3. Write BGE_SRAM_FW_CMD_DATA_MB with actual command data. 4. Generate BGE_RX_CPU_EVENT and let firmware handle the command. 5. Wait for the ACK of the firmware command. No functional changes. Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c == --- head/sys/dev/bge/if_bge.c Thu Oct 27 21:25:41 2011(r226865) +++ head/sys/dev/bge/if_bge.c Thu Oct 27 21:27:37 2011(r226866) @@ -1370,10 +1370,11 @@ bge_stop_fw(struct bge_softc *sc) if (sc-bge_asf_mode) { bge_writemem_ind(sc, BGE_SRAM_FW_CMD_MB, BGE_FW_CMD_PAUSE); CSR_WRITE_4(sc, BGE_RX_CPU_EVENT, - CSR_READ_4(sc, BGE_RX_CPU_EVENT) | (1 14)); + CSR_READ_4(sc, BGE_RX_CPU_EVENT) | BGE_RX_CPU_DRV_EVENT); for (i = 0; i 100; i++ ) { - if (!(CSR_READ_4(sc, BGE_RX_CPU_EVENT) (1 14))) + if (!(CSR_READ_4(sc, BGE_RX_CPU_EVENT) + BGE_RX_CPU_DRV_EVENT)) break; DELAY(10); } @@ -4111,7 +4112,8 @@ bge_asf_driver_up(struct bge_softc *sc) bge_writemem_ind(sc, BGE_SRAM_FW_CMD_LEN_MB, 4); bge_writemem_ind(sc, BGE_SRAM_FW_CMD_DATA_MB, 3); CSR_WRITE_4(sc, BGE_RX_CPU_EVENT, - CSR_READ_4(sc, BGE_RX_CPU_EVENT) | (1 14)); + CSR_READ_4(sc, BGE_RX_CPU_EVENT) | + BGE_RX_CPU_DRV_EVENT); } } } Modified: head/sys/dev/bge/if_bgereg.h == --- head/sys/dev/bge/if_bgereg.hThu Oct 27 21:25:41 2011 (r226865) +++ head/sys/dev/bge/if_bgereg.hThu Oct 27 21:27:37 2011 (r226866) @@ -1901,6 +1901,8 @@ #defineBGE_EE_DELAY0x6848 #defineBGE_FASTBOOT_PC 0x6894 +#defineBGE_RX_CPU_DRV_EVENT0x4000 + /* * NVRAM Control registers */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r226436 - in head: . gnu/usr.bin/binutils/objcopy gnu/usr.bin/binutils/strip lib/libc/gen lib/libelf lib/libipsec lib/libpmc lib/msun/man libexec/rtld-elf/amd64 libexec/rtld-elf/i386 s
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 10/16/11 07:30, Eitan Adler wrote: [...] head/secure/lib/libcrypto/man/engine.3 head/secure/usr.bin/openssl/man/ca.1 head/secure/usr.bin/openssl/man/dgst.1 [...] These files are automatically generated from crypto/openssl/doc, would you please also submit it to upstream so we don't have to patch them again in the future? head/sys/ofed/drivers/infiniband/ulp/sdp/Kconfig This is from Linux InfiniBand driver and does not have anything to do with FreeBSD so we should probably just remove it. Thanks for the work by the way! Cheers, - -- Xin LI delp...@delphij.nethttps://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJOqdHaAAoJEATO+BI/yjfBTh0H/REaYYWhCKS9ayZPBLIhUcWS RW55d38d5UAFZgrcIRVLacz8uryfFyX4KF9jUz1+U82wguocqatfoMR/nyaPczz/ 5K20Gih+IpuYsqsOPK2NyTjNp5UP1Najjh7PP+ORVHEIF9ZA9omf0XTKlkiVq0Mz GqlJyp5VpavG+jmBA1SfZnayfX/DxATAzqSgxG/FObrDuhi65hh7Yu1WVkeMwU13 hnIvYXBs+l3KVoxzzz/MeYoFow2HfbbDa1QFyLCdiG51I+5yHkmLbDblRO/1b4MK fM/v4h93U6Z/H+Nb9Pm5Df1wgOJeMWIiM7t5jj/MZppOPeSSyANRZgdJv2MwplA= =nCDy -END PGP SIGNATURE- ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226867 - head/sys/dev/bge
Author: yongari Date: Thu Oct 27 22:10:52 2011 New Revision: 226867 URL: http://svn.freebsd.org/changeset/base/226867 Log: Define BGE_FW_HB_TIMEOUT_SEC and remove one more magic value. bge(4) sends BGE_FW_CMD_DRV_ALIVE command to firmware every 2 seconds. BGE_FW_CMD_DRV_ALIVE command requires 4 bytes data. This data contains timeout value in seconds until the next BGE_FW_CMD_DRV_ALIVE command. Broadcom recommends driver set the value 3 times longer than the interval that it sends BGE_FW_CMD_DRV_ALIVE. Currently bge(4) uses 3 seconds so probably we have to increase it in future and use different ALIVE command(e.g. BGE_FW_CMD_DRV_ALIVE3). No functional changes. Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c == --- head/sys/dev/bge/if_bge.c Thu Oct 27 21:27:37 2011(r226866) +++ head/sys/dev/bge/if_bge.c Thu Oct 27 22:10:52 2011(r226867) @@ -4110,7 +4110,8 @@ bge_asf_driver_up(struct bge_softc *sc) bge_writemem_ind(sc, BGE_SRAM_FW_CMD_MB, BGE_FW_CMD_DRV_ALIVE); bge_writemem_ind(sc, BGE_SRAM_FW_CMD_LEN_MB, 4); - bge_writemem_ind(sc, BGE_SRAM_FW_CMD_DATA_MB, 3); + bge_writemem_ind(sc, BGE_SRAM_FW_CMD_DATA_MB, + BGE_FW_HB_TIMEOUT_SEC); CSR_WRITE_4(sc, BGE_RX_CPU_EVENT, CSR_READ_4(sc, BGE_RX_CPU_EVENT) | BGE_RX_CPU_DRV_EVENT); Modified: head/sys/dev/bge/if_bgereg.h == --- head/sys/dev/bge/if_bgereg.hThu Oct 27 21:27:37 2011 (r226866) +++ head/sys/dev/bge/if_bgereg.hThu Oct 27 22:10:52 2011 (r226867) @@ -100,6 +100,8 @@ #defineBGE_FW_CMD_DRV_ALIVE2 0x000D #defineBGE_FW_CMD_DRV_ALIVE3 0x000E +#defineBGE_FW_HB_TIMEOUT_SEC 3 + #defineBGE_FW_DRV_STATE_START 0x0001 #defineBGE_FW_DRV_STATE_START_DONE 0x8001 #defineBGE_FW_DRV_STATE_UNLOAD 0x0002 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226868 - head/sys/netinet
Author: tuexen Date: Thu Oct 27 22:37:59 2011 New Revision: 226868 URL: http://svn.freebsd.org/changeset/base/226868 Log: Send out control chunks which have no specific destination. MFC after: 3 days. Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c == --- head/sys/netinet/sctp_output.c Thu Oct 27 22:10:52 2011 (r226867) +++ head/sys/netinet/sctp_output.c Thu Oct 27 22:37:59 2011 (r226868) @@ -8003,12 +8003,20 @@ again_one_more_time: if (chk-rec.chunk_id.id != SCTP_ASCONF) { continue; } - if (chk-whoTo != net) { - /* -* No, not sent to the network we are -* looking at -*/ - break; + if (chk-whoTo == NULL) { + if (asoc-alternate == NULL) { + if (asoc-primary_destination != net) { + break; + } + } else { + if (asoc-alternate != net) { + break; + } + } + } else { + if (chk-whoTo != net) { + break; + } } if (chk-data == NULL) { break; @@ -8092,6 +8100,10 @@ again_one_more_time: */ no_data_chunks = 1; chk-sent = SCTP_DATAGRAM_SENT; + if (chk-whoTo == NULL) { + chk-whoTo = net; + atomic_add_int(net-ref_count, 1); + } chk-snd_count++; if (mtu == 0) { /* @@ -8198,12 +8210,20 @@ again_one_more_time: goto skip_net_check; } } - if (chk-whoTo != net) { - /* -* No, not sent to the network we are -* looking at -*/ - continue; + if (chk-whoTo == NULL) { + if (asoc-alternate == NULL) { + if (asoc-primary_destination != net) { + continue; + } + } else { + if (asoc-alternate != net) { + continue; + } + } + } else { + if (chk-whoTo != net) { + continue; + } } skip_net_check: if (chk-data == NULL) { @@ -8332,6 +8352,10 @@ again_one_more_time: SCTP_STAT_INCR(sctps_sendecne); } chk-sent = SCTP_DATAGRAM_SENT; + if (chk-whoTo == NULL) { + chk-whoTo = net; + atomic_add_int(net-ref_count, 1); + } chk-snd_count++; } if (mtu == 0) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226869 - head/sys/netinet
Author: tuexen Date: Thu Oct 27 22:38:48 2011 New Revision: 226869 URL: http://svn.freebsd.org/changeset/base/226869 Log: When add a new remote address using sctp_add_remote_addr(), return the correct net if requested. MFC after: 3 days. Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c == --- head/sys/netinet/sctp_pcb.c Thu Oct 27 22:37:59 2011(r226868) +++ head/sys/netinet/sctp_pcb.c Thu Oct 27 22:38:48 2011(r226869) @@ -4138,6 +4138,9 @@ sctp_add_remote_addr(struct sctp_tcb *st #ifdef INVARIANTS net-flowidset = 1; #endif + if (netp) { + *netp = net; + } netfirst = TAILQ_FIRST(stcb-asoc.nets); if (net-ro.ro_rt == NULL) { /* Since we have no route put it at the back */ @@ -4209,9 +4212,6 @@ sctp_add_remote_addr(struct sctp_tcb *st TAILQ_INSERT_HEAD(stcb-asoc.nets, stcb-asoc.primary_destination, sctp_next); } - if (netp) { - *netp = net; - } return (0); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226870 - head/sys/dev/mii
Author: yongari Date: Fri Oct 28 00:40:19 2011 New Revision: 226870 URL: http://svn.freebsd.org/changeset/base/226870 Log: Recognize BCM5720C PHY. Modified: head/sys/dev/mii/brgphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/brgphy.c == --- head/sys/dev/mii/brgphy.c Thu Oct 27 22:38:48 2011(r226869) +++ head/sys/dev/mii/brgphy.c Fri Oct 28 00:40:19 2011(r226870) @@ -141,6 +141,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(BROADCOM2, BCM5784), MII_PHY_DESC(BROADCOM3, BCM5717C), MII_PHY_DESC(BROADCOM3, BCM5719C), + MII_PHY_DESC(BROADCOM3, BCM5720C), MII_PHY_DESC(BROADCOM3, BCM57765), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5906), MII_PHY_END Modified: head/sys/dev/mii/miidevs == --- head/sys/dev/mii/miidevsThu Oct 27 22:38:48 2011(r226869) +++ head/sys/dev/mii/miidevsFri Oct 28 00:40:19 2011(r226870) @@ -179,6 +179,7 @@ model BROADCOM2 BCM5709S0x003f BCM5709S model BROADCOM3 BCM5717C 0x0020 BCM5717C 1000BASE-T media interface model BROADCOM3 BCM5719C 0x0022 BCM5719C 1000BASE-T media interface model BROADCOM3 BCM57765 0x0024 BCM57765 1000BASE-T media interface +model BROADCOM3 BCM5720C 0x0036 BCM5720C 1000BASE-T media interface model xxBROADCOM_ALT1 BCM5906 0x0004 BCM5906 10/100baseTX media interface /* Cicada Semiconductor PHYs (now owned by Vitesse?) */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226871 - head/sys/dev/bge
Author: yongari Date: Fri Oct 28 01:04:40 2011 New Revision: 226871 URL: http://svn.freebsd.org/changeset/base/226871 Log: Add initial BCM5720 support. Many thanks to Broadcom for continuing support of FreeBSD. Submitted by: Geans Pin at Broadcom (initial version) H/W donated by: Broadcom Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c == --- head/sys/dev/bge/if_bge.c Fri Oct 28 00:40:19 2011(r226870) +++ head/sys/dev/bge/if_bge.c Fri Oct 28 01:04:40 2011(r226871) @@ -301,6 +301,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5717_A0,BCM5717 A0 }, { BGE_CHIPID_BCM5717_B0,BCM5717 B0 }, { BGE_CHIPID_BCM5719_A0,BCM5719 A0 }, + { BGE_CHIPID_BCM5720_A0,BCM5720 A0 }, { BGE_CHIPID_BCM5755_A0,BCM5755 A0 }, { BGE_CHIPID_BCM5755_A1,BCM5755 A1 }, { BGE_CHIPID_BCM5755_A2,BCM5755 A2 }, @@ -349,6 +350,7 @@ static const struct bge_revision const b { BGE_ASICREV_BCM57780, unknown BCM57780 }, { BGE_ASICREV_BCM5717, unknown BCM5717 }, { BGE_ASICREV_BCM5719, unknown BCM5719 }, + { BGE_ASICREV_BCM5720, unknown BCM5720 }, { 0, NULL } }; @@ -437,6 +439,7 @@ static int bge_init_tx_ring(struct bge_s static int bge_chipinit(struct bge_softc *); static int bge_blockinit(struct bge_softc *); +static uint32_t bge_dma_swap_options(struct bge_softc *); static int bge_has_eaddr(struct bge_softc *); static uint32_t bge_readmem_ind(struct bge_softc *, int); @@ -1381,13 +1384,31 @@ bge_stop_fw(struct bge_softc *sc) } } +static uint32_t +bge_dma_swap_options(struct bge_softc *sc) +{ + uint32_t dma_options; + + dma_options = BGE_MODECTL_WORDSWAP_NONFRAME | + BGE_MODECTL_BYTESWAP_DATA | BGE_MODECTL_WORDSWAP_DATA; +#if BYTE_ORDER == BIG_ENDIAN + dma_options |= BGE_MODECTL_BYTESWAP_NONFRAME; +#endif + if ((sc)-bge_asicrev == BGE_ASICREV_BCM5720) + dma_options |= BGE_MODECTL_BYTESWAP_B2HRX_DATA | + BGE_MODECTL_WORDSWAP_B2HRX_DATA | BGE_MODECTL_B2HRX_ENABLE | + BGE_MODECTL_HTX2B_ENABLE; + + return (dma_options); +} + /* * Do endian, PCI and DMA initialization. */ static int bge_chipinit(struct bge_softc *sc) { - uint32_t dma_rw_ctl, misc_ctl; + uint32_t dma_rw_ctl, misc_ctl, mode_ctl; uint16_t val; int i; @@ -1505,9 +1526,8 @@ bge_chipinit(struct bge_softc *sc) /* * Set up general mode register. */ - CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS | - BGE_MODECTL_MAC_ATTN_INTR | BGE_MODECTL_HOST_SEND_BDS | - BGE_MODECTL_TX_NO_PHDR_CSUM); + mode_ctl = bge_dma_swap_options(sc) | BGE_MODECTL_MAC_ATTN_INTR | + BGE_MODECTL_HOST_SEND_BDS | BGE_MODECTL_TX_NO_PHDR_CSUM; /* * BCM5701 B5 have a bug causing data corruption when using @@ -1517,13 +1537,15 @@ bge_chipinit(struct bge_softc *sc) */ if (sc-bge_asicrev == BGE_ASICREV_BCM5701 sc-bge_chipid == BGE_CHIPID_BCM5701_B5) - BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_FORCE_PCI32); + mode_ctl |= BGE_MODECTL_FORCE_PCI32; /* * Tell the firmware the driver is running */ if (sc-bge_asf_mode ASF_STACKUP) - BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_STACKUP); + mode_ctl |= BGE_MODECTL_STACKUP; + + CSR_WRITE_4(sc, BGE_MODE_CTL, mode_ctl); /* * Disable memory write invalidate. Apparently it is not supported @@ -1583,8 +1605,7 @@ bge_blockinit(struct bge_softc *sc) } /* Configure mbuf pool watermarks */ - if (sc-bge_asicrev == BGE_ASICREV_BCM5717 || - sc-bge_asicrev == BGE_ASICREV_BCM57765) { + if (BGE_IS_5717_PLUS(sc)) { CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_READDMA_LOWAT, 0x0); if (sc-bge_ifp-if_mtu ETHERMTU) { CSR_WRITE_4(sc, BGE_BMAN_MBUFPOOL_MACRX_LOWAT, 0x7e); @@ -1719,7 +1740,8 @@ bge_blockinit(struct bge_softc *sc) BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0); } if (sc-bge_asicrev == BGE_ASICREV_BCM5717 || - sc-bge_asicrev == BGE_ASICREV_BCM5719) + sc-bge_asicrev == BGE_ASICREV_BCM5719 || + sc-bge_asicrev == BGE_ASICREV_BCM5720) rcb-bge_nicaddr = BGE_STD_RX_RINGS_5717; else rcb-bge_nicaddr = BGE_STD_RX_RINGS; @@ -1752,7 +1774,8 @@ bge_blockinit(struct bge_softc *sc) rcb-bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD | BGE_RCB_FLAG_RING_DISABLED); if (sc-bge_asicrev == BGE_ASICREV_BCM5717 || -
svn commit: r226872 - head/sys/dev/bge
Author: yongari Date: Fri Oct 28 01:10:59 2011 New Revision: 226872 URL: http://svn.freebsd.org/changeset/base/226872 Log: Disable updating InputDiscards counter for BCM5717, BCM5718, BCM5719 A0 and BCM5720 A0 and add comment why driver does not try to read it. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c == --- head/sys/dev/bge/if_bge.c Fri Oct 28 01:04:40 2011(r226871) +++ head/sys/dev/bge/if_bge.c Fri Oct 28 01:10:59 2011(r226872) @@ -4291,8 +4291,30 @@ bge_stats_update_regs(struct bge_softc * CSR_READ_4(sc, BGE_RXLP_LOCSTAT_DMA_HPWRQ_FULL); stats-NoMoreRxBDs += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_OUT_OF_BDS); - stats-InputDiscards += - CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS); + /* +* XXX +* Unlike other controllers, BGE_RXLP_LOCSTAT_IFIN_DROPS +* counter of BCM5717, BCM5718, BCM5719 A0 and BCM5720 A0 +* includes number of unwanted multicast frames. This comes +* from silicon bug and known workaround to get rough(not +* exact) counter is to enable interrupt on MBUF low water +* attention. This can be accomplished by setting +* BGE_HCCMODE_ATTN bit of BGE_HCC_MODE, +* BGE_BMANMODE_LOMBUF_ATTN bit of BGE_BMAN_MODE and +* BGE_MODECTL_FLOWCTL_ATTN_INTR bit of BGE_MODE_CTL. +* However that change would generate more interrupts and +* there are still possibilities of losing multiple frames +* during BGE_MODECTL_FLOWCTL_ATTN_INTR interrupt handling. +* Given that the workaround still would not get correct +* counter I don't think it's worth to implement it. So +* ignore reading the counter on controllers that have the +* silicon bug. +*/ + if (sc-bge_asicrev != BGE_ASICREV_BCM5717 + sc-bge_chipid != BGE_CHIPID_BCM5719_A0 + sc-bge_chipid != BGE_CHIPID_BCM5720_A0) + stats-InputDiscards += + CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS); stats-InputErrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_ERRORS); stats-RecvThresholdHit += ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r226835 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf
On Oct 27, 2011, at 6:14 AM, Ken Smith wrote: In response to one of my commits done to the ia64 GENERIC I received some feedback giving a long list of issues (style, formatting, seemingly gratuitous differences, annoyances, etc.) with the whole set of GENERIC config files. If anyone knows a reason I should NOT act on the list to bring all the GENERIC's into style compliance and whatnot let me know. If nobody screams I'll do what I can to fix them up in head some time after 9.0 is finished. If you're doing this in response to a private email, I very much object if this is done without a review. I would really hate to see a lot of churn on the stable branch after RC1 for no reason. FYI, -- Marcel Moolenaar mar...@xcllnt.net ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r226835 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/27/11 10:09 PM, Marcel Moolenaar wrote: On Oct 27, 2011, at 6:14 AM, Ken Smith wrote: In response to one of my commits done to the ia64 GENERIC I received some feedback giving a long list of issues (style, formatting, seemingly gratuitous differences, annoyances, etc.) with the whole set of GENERIC config files. If anyone knows a reason I should NOT act on the list to bring all the GENERIC's into style compliance and whatnot let me know. If nobody screams I'll do what I can to fix them up in head some time after 9.0 is finished. If you're doing this in response to a private email, I very much object if this is done without a review. I would really hate to see a lot of churn on the stable branch after RC1 for no reason. FYI, It is in response to private email. I would not do the commit without getting review from at least the primary architecture maintainers and, assuming it winds up being acceptable to the reviewers, I have no intention of MFCing it. - -- Ken Smith - - From there to here, from here to | kensm...@buffalo.edu there, funny things are everywhere. | - Theodor Geisel | -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk6qFOYACgkQ/G14VSmup/bqcgCgmf6hcDujuGu/6ux75pIkkjly gd0AnjzQt++xzFf5WsIKqKhhKIeKod5e =hcFB -END PGP SIGNATURE- ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226877 - stable/8/sys/netinet
Author: qingli Date: Fri Oct 28 03:58:33 2011 New Revision: 226877 URL: http://svn.freebsd.org/changeset/base/226877 Log: MFC 226713 Exclude host routes when checking for prefix coverage on multiple interfaces. A host route has a NULL mask so check for that condition. I have also been told by developers who customize the packet output path with direct manipulation of the route entry (or the outgoing interface to be specific). This patch checks for the route mask explicitly to make sure custom code will not panic. PR: kern/161805 Modified: stable/8/sys/netinet/in.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/in.c == --- stable/8/sys/netinet/in.c Fri Oct 28 03:42:41 2011(r226876) +++ stable/8/sys/netinet/in.c Fri Oct 28 03:58:33 2011(r226877) @@ -1449,12 +1449,21 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ * on one interface and the corresponding outgoing packet leaves * another interface. */ - if (rt-rt_ifp != ifp) { + if (!(rt-rt_flags RTF_HOST) rt-rt_ifp != ifp) { const char *sa, *mask, *addr, *lim; int len; - sa = (const char *)rt_key(rt); mask = (const char *)rt_mask(rt); + /* +* Just being extra cautious to avoid some custom +* code getting into trouble. +*/ + if (mask == NULL) { + RTFREE_LOCKED(rt); + return (EINVAL); + } + + sa = (const char *)rt_key(rt); addr = (const char *)l3addr; len = ((const struct sockaddr_in *)l3addr)-sin_len; lim = addr + len; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r226878 - stable/8/sys/netinet6
Author: qingli Date: Fri Oct 28 04:04:21 2011 New Revision: 226878 URL: http://svn.freebsd.org/changeset/base/226878 Log: MFC 226451 The IPv6 code was influx at the time of r196865 due to the L2/L3 separation rewrite changes. r196865 was committed to fix a scope violation problem in the following test scenario: box-1# ifconfig em0 inet6 2001:db8:1:: prefixlen 64 anycast box-1# ifconfig em1 inet6 2001:db8:2::1 prefixlen 64 box-2# ifconfig re0 inet6 2001:db8:1::6 prefixlen 64 em0 and re0 are on the same link. box-2# ping6 2001:db8:1:: PING6(56=40+8+8 bytes) 2001:db8:1::6 -- 2001:db8:1:: the ICMPv6 response should have a source address of em1, which is 2001:db8:2::1, not the link-local address of em0. That code is no longer necessary and breaks the IPv6-Ready logo testing, so revert it now. Reviewed by: hrs Modified: stable/8/sys/netinet6/icmp6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet6/icmp6.c == --- stable/8/sys/netinet6/icmp6.c Fri Oct 28 03:58:33 2011 (r226877) +++ stable/8/sys/netinet6/icmp6.c Fri Oct 28 04:04:21 2011 (r226878) @@ -2161,10 +2161,6 @@ icmp6_reflect(struct mbuf *m, size_t off } } - if ((srcp != NULL) - (in6_addrscope(srcp) != in6_addrscope(ip6-ip6_src))) - srcp = NULL; - if (srcp == NULL) { int e; struct sockaddr_in6 sin6; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org