Re: svn commit: r247274 - in head: bin/test tools/regression/bin/test

2013-02-27 Thread Peter Jeremy
On 2013-Feb-26 01:02:27 +0100, Jilles Tjoelker jil...@stack.nl wrote:
   Enhance test(1) by adding provision to compare any combination of the
   access, birth, change and modify times of two files, instead of only
   being able to compare modify times.  The builtin test in sh(1) will
   automagically acquire the same expansion.

What do you need this for? If it is not needed very often, this test can
be done more portably (older FreeBSD and GNU) as
  [ -n $(find -L FILE1 -prune -newerXY FILE2 2/dev/null) ]

In my case I needed to compare the ctime on one set of files with the
mtime in another set.  I had a think about using find(1) and gave it
away as too ugly.  That expression needs serious thought to understand
and about ½ the tokens in the find(1) are to handle special cases -
which is a further indication that it isn't ideal.

I have generally been rather reluctant in adding things to sh(1) and
even more so if they are completely new. Someone proposed something
rather similar (except that it added a time string parser -- even more
code) in PR bin/57054 and I rejected it in 2009.

Time parsing is a large can of worms - getting it right is messy (that
patch includes 1KLOC of new code and still isn't locale aware).  And
the work-around of touching a dummy file to the wanted age isn't too
horrrible.  This is a much smaller patch and there's no equally clean
work-around.

 +a=/tmp/test$$.1
 +b=/tmp/test$$.2

Please use mktemp(1). Using $$ for temporary files is insecure on
multiuser systems.

In this case, I want filenames that don't exist.  I will look at using
mktemp(1) to create a temporary directory.

 +sleep 2# Ensure $b is newer than $a
 +touch $b

Please use touch -t instead of sleeping. I'm impatient while running
tests :)

In this case, I want all the timestamps on $b to be later than $a.  I
initially tried without the sleep but that failed with the builtin
test(1) because the FS timestamps weren't sufficiently granular to
report the difference.  I could create one of the files much earlier
during the test and then use a conditional test to only sleep if the
timestamps were indistinguishable (this probably needs to use the
above find(1) horror to avoid using test(1) to test itself).

I agree the other sleep(1)s should be able to be replaced with
touch(1) but I ran into problems with my initial efforts to do
everything using touch(1).  I will revisit it.

-- 
Peter Jeremy


pgpbZiacaTyV6.pgp
Description: PGP signature


svn commit: r247390 - head/sys/arm/ti

2013-02-27 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Feb 27 08:32:34 2013
New Revision: 247390
URL: http://svnweb.freebsd.org/changeset/base/247390

Log:
  - Initialize GPIO_OE register based on pinmux configuration
  
  Although AM335x TRM states that GPIO_OE register is not used and just
  reflects pads configuration in practice it does control pin behavior
  and shoiuld be set in addition to pinmux setup

Modified:
  head/sys/arm/ti/ti_gpio.c

Modified: head/sys/arm/ti/ti_gpio.c
==
--- head/sys/arm/ti/ti_gpio.c   Wed Feb 27 07:34:09 2013(r247389)
+++ head/sys/arm/ti/ti_gpio.c   Wed Feb 27 08:32:34 2013(r247390)
@@ -653,6 +653,9 @@ ti_gpio_attach(device_t dev)
struct ti_gpio_softc *sc = device_get_softc(dev);
unsigned int i;
int err = 0;
+   int pin;
+   uint32_t flags;
+   uint32_t reg_oe;
 
sc-sc_dev = dev;
 
@@ -720,6 +723,17 @@ ti_gpio_attach(device_t dev)
/* Disable interrupts for all pins */
ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE1, 
0x);
ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE2, 
0x);
+
+   /* Init OE registger based on pads configuration */
+   reg_oe = 0x;
+   for (pin = 0; pin  32; pin++) {
+   ti_scm_padconf_get_gpioflags(
+   PINS_PER_BANK*i + pin, flags);
+   if (flags  GPIO_PIN_OUTPUT)
+   reg_oe = ~(1U  pin);
+   }
+
+   ti_gpio_write_4(sc, i, TI_GPIO_OE, reg_oe);
}
}
 
___
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: r247391 - head/sys/arm/ti

2013-02-27 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Wed Feb 27 08:34:32 2013
New Revision: 247391
URL: http://svnweb.freebsd.org/changeset/base/247391

Log:
  Fix typo

Modified:
  head/sys/arm/ti/ti_gpio.c

Modified: head/sys/arm/ti/ti_gpio.c
==
--- head/sys/arm/ti/ti_gpio.c   Wed Feb 27 08:32:34 2013(r247390)
+++ head/sys/arm/ti/ti_gpio.c   Wed Feb 27 08:34:32 2013(r247391)
@@ -724,7 +724,7 @@ ti_gpio_attach(device_t dev)
ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE1, 
0x);
ti_gpio_write_4(sc, i, TI_GPIO_CLEARIRQENABLE2, 
0x);
 
-   /* Init OE registger based on pads configuration */
+   /* Init OE register based on pads configuration */
reg_oe = 0x;
for (pin = 0; pin  32; pin++) {
ti_scm_padconf_get_gpioflags(
___
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: r247394 - stable/9/usr.sbin/mountd

2013-02-27 Thread Sergey Kandaurov
Author: pluknet
Date: Wed Feb 27 08:55:26 2013
New Revision: 247394
URL: http://svnweb.freebsd.org/changeset/base/247394

Log:
  MFC r247034:
Check if the -sec option is given without an argument.
  
  PR:   bin/170413
  Submitted by: Andrey Simonenko si...@comsys.ntu-kpi.kiev.ua

Modified:
  stable/9/usr.sbin/mountd/mountd.c
Directory Properties:
  stable/9/usr.sbin/mountd/   (props changed)

Modified: stable/9/usr.sbin/mountd/mountd.c
==
--- stable/9/usr.sbin/mountd/mountd.c   Wed Feb 27 08:44:03 2013
(r247393)
+++ stable/9/usr.sbin/mountd/mountd.c   Wed Feb 27 08:55:26 2013
(r247394)
@@ -2238,7 +2238,7 @@ do_opt(char **cpp, char **endcpp, struct
ep-ex_indexfile = strdup(cpoptarg);
} else if (!strcmp(cpopt, quiet)) {
opt_flags |= OP_QUIET;
-   } else if (!strcmp(cpopt, sec)) {
+   } else if (cpoptarg  !strcmp(cpopt, sec)) {
if (parsesec(cpoptarg, ep))
return (1);
opt_flags |= OP_SEC;
___
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: r247395 - stable/8/usr.sbin/mountd

2013-02-27 Thread Sergey Kandaurov
Author: pluknet
Date: Wed Feb 27 08:56:57 2013
New Revision: 247395
URL: http://svnweb.freebsd.org/changeset/base/247395

Log:
  MFC r247034:
Check if the -sec option is given without an argument.
  
  PR:   bin/170413
  Submitted by: Andrey Simonenko si...@comsys.ntu-kpi.kiev.ua

Modified:
  stable/8/usr.sbin/mountd/mountd.c
Directory Properties:
  stable/8/usr.sbin/mountd/   (props changed)

Modified: stable/8/usr.sbin/mountd/mountd.c
==
--- stable/8/usr.sbin/mountd/mountd.c   Wed Feb 27 08:55:26 2013
(r247394)
+++ stable/8/usr.sbin/mountd/mountd.c   Wed Feb 27 08:56:57 2013
(r247395)
@@ -2229,7 +2229,7 @@ do_opt(char **cpp, char **endcpp, struct
ep-ex_indexfile = strdup(cpoptarg);
} else if (!strcmp(cpopt, quiet)) {
opt_flags |= OP_QUIET;
-   } else if (!strcmp(cpopt, sec)) {
+   } else if (cpoptarg  !strcmp(cpopt, sec)) {
if (parsesec(cpoptarg, ep))
return (1);
opt_flags |= OP_SEC;
___
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: r247396 - head/libexec/rtld-elf

2013-02-27 Thread Tijl Coosemans
Author: tijl
Date: Wed Feb 27 09:34:09 2013
New Revision: 247396
URL: http://svnweb.freebsd.org/changeset/base/247396

Log:
  Map libraries linked with -Ttext-segment=base_addr at base_addr.
  Normal libraries have base address 0 and are unaffected by this change.
  
  PR:   176216
  Submitted by: Damjan Jovanovic damjan@gmail.com
  Reviewed by:  kib
  MFC after:1 week

Modified:
  head/libexec/rtld-elf/map_object.c

Modified: head/libexec/rtld-elf/map_object.c
==
--- head/libexec/rtld-elf/map_object.c  Wed Feb 27 08:56:57 2013
(r247395)
+++ head/libexec/rtld-elf/map_object.c  Wed Feb 27 09:34:09 2013
(r247396)
@@ -175,7 +175,7 @@ map_object(int fd, const char *path, con
 base_vaddr = trunc_page(segs[0]-p_vaddr);
 base_vlimit = round_page(segs[nsegs]-p_vaddr + segs[nsegs]-p_memsz);
 mapsize = base_vlimit - base_vaddr;
-base_addr = hdr-e_type == ET_EXEC ? (caddr_t) base_vaddr : NULL;
+base_addr = (caddr_t) base_vaddr;
 
 mapbase = mmap(base_addr, mapsize, PROT_NONE, MAP_ANON | MAP_PRIVATE |
   MAP_NOCORE, -1, 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: r247398 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys

2013-02-27 Thread Martin Matuska
Author: mm
Date: Wed Feb 27 14:45:23 2013
New Revision: 247398
URL: http://svnweb.freebsd.org/changeset/base/247398

Log:
  MFV 247176, 247178, 247315:
  Import metaslab_sync() speedup from vendor (illumos).
  
  Illumos ZFS issues:
3552 condensing one space map burns 3 seconds of CPU in spa_sync() thread
3564 spa_sync() spends 5-10% of its time in metaslab_sync() (when not
 condensing)
3578 transferring the freed map to the defer map should be constant time
3579 ztest trips assertion in metaslab_weight()
  
  References:
https://www.illumos.org/issues/3552
https://www.illumos.org/issues/3564
https://www.illumos.org/issues/3578
https://www.illumos.org/issues/3579
  
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Feb 27 11:42:28 2013
(r247397)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Feb 27 14:45:23 2013
(r247398)
@@ -545,7 +545,7 @@ static void
 dump_metaslab_stats(metaslab_t *msp)
 {
char maxbuf[32];
-   space_map_t *sm = msp-ms_map;
+   space_map_t *sm = msp-ms_map;
avl_tree_t *t = sm-sm_pp_root;
int free_pct = sm-sm_space * 100 / sm-sm_size;
 
@@ -561,7 +561,7 @@ dump_metaslab(metaslab_t *msp)
 {
vdev_t *vd = msp-ms_group-mg_vd;
spa_t *spa = vd-vdev_spa;
-   space_map_t *sm = msp-ms_map;
+   space_map_t *sm = msp-ms_map;
space_map_obj_t *smo = msp-ms_smo;
char freebuf[32];
 
@@ -2160,11 +2160,11 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb)
for (int m = 0; m  vd-vdev_ms_count; m++) {
metaslab_t *msp = vd-vdev_ms[m];
mutex_enter(msp-ms_lock);
-   space_map_unload(msp-ms_map);
-   VERIFY(space_map_load(msp-ms_map,
+   space_map_unload(msp-ms_map);
+   VERIFY(space_map_load(msp-ms_map,
zdb_space_map_ops, SM_ALLOC, msp-ms_smo,
spa-spa_meta_objset) == 0);
-   msp-ms_map.sm_ppd = vd;
+   msp-ms_map-sm_ppd = vd;
mutex_exit(msp-ms_lock);
}
}
@@ -2187,7 +2187,7 @@ zdb_leak_fini(spa_t *spa)
for (int m = 0; m  vd-vdev_ms_count; m++) {
metaslab_t *msp = vd-vdev_ms[m];
mutex_enter(msp-ms_lock);
-   space_map_unload(msp-ms_map);
+   space_map_unload(msp-ms_map);
mutex_exit(msp-ms_lock);
}
}

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c  Wed Feb 
27 11:42:28 2013(r247397)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c  Wed Feb 
27 14:45:23 2013(r247398)
@@ -48,6 +48,14 @@ uint64_t metaslab_aliquot = 512ULL  10
 uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1;/* force gang blocks */
 
 /*
+ * The in-core space map representation is more compact than its on-disk form.
+ * The zfs_condense_pct determines how much more compact the in-core
+ * space_map representation must be before we compact it on-disk.
+ * Values should be greater than or equal to 100.
+ */
+int zfs_condense_pct = 200;
+
+/*
  * This value defines the number of allowed allocation failures per vdev.
  * If a device reaches this threshold in a given txg then we consider skipping
  * allocations on that device.
@@ -215,9 +223,9 @@ metaslab_compare(const void *x1, const v
/*
 * If the weights are identical, use the offset to force uniqueness.
 */
-   if (m1-ms_map.sm_start  m2-ms_map.sm_start)
+   if (m1-ms_map-sm_start  m2-ms_map-sm_start)
return (-1);
-   if (m1-ms_map.sm_start  m2-ms_map.sm_start)
+   if (m1-ms_map-sm_start  m2-ms_map-sm_start)
return (1);
 
ASSERT3P(m1, ==, m2);
@@ -732,14 +740,15 @@ metaslab_init(metaslab_group_t *mg, spac

Re: svn commit: r247359 - head/sbin/reboot

2013-02-27 Thread John Baldwin
On Tuesday, February 26, 2013 6:18:36 pm Nick Hibma wrote:
 Author: n_hibma
 Date: Tue Feb 26 23:18:35 2013
 New Revision: 247359
 URL: http://svnweb.freebsd.org/changeset/base/247359
 
 Log:
   Clarify that overriding the -h/-D flags through flags in device.hints
   only works for sio(4) but not for uart(4) which no longer has this flag.

You should probably just remove the flag entirely.  sio(4) doesn't build on 
8.x and later.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r247399 - head/sbin/tunefs

2013-02-27 Thread Peter Holm
Author: pho
Date: Wed Feb 27 18:12:04 2013
New Revision: 247399
URL: http://svnweb.freebsd.org/changeset/base/247399

Log:
  The .journal file needs to reside on the ROOTINO which must not extend
  beyond direct blocks. A typo caused this check to fail.

Modified:
  head/sbin/tunefs/tunefs.c

Modified: head/sbin/tunefs/tunefs.c
==
--- head/sbin/tunefs/tunefs.c   Wed Feb 27 14:45:23 2013(r247398)
+++ head/sbin/tunefs/tunefs.c   Wed Feb 27 18:12:04 2013(r247399)
@@ -671,7 +671,7 @@ journal_findfile(void)
return (ino);
}
} else {
-   if ((off_t)dp1-di_size = lblktosize(sblock, NDADDR)) {
+   if ((off_t)dp2-di_size = lblktosize(sblock, NDADDR)) {
warnx(ROOTINO extends beyond direct blocks.);
return (-1);
}
___
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: r247400 - in head/sys: amd64/amd64 i386/i386 i386/xen powerpc/aim powerpc/booke sparc64/sparc64 vm

2013-02-27 Thread Attilio Rao
Author: attilio
Date: Wed Feb 27 18:12:13 2013
New Revision: 247400
URL: http://svnweb.freebsd.org/changeset/base/247400

Log:
  Merge from vmobj-rwlock:
  VM_OBJECT_LOCKED() macro is only used to implement a custom version
  of lock assertions right now (which likely spread out thanks to
  copy and paste).
  Remove it and implement actual assertions.
  
  Sponsored by: EMC / Isilon storage division
  Reviewed by:  alc
  Tested by:pho

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c
  head/sys/i386/xen/pmap.c
  head/sys/powerpc/aim/mmu_oea.c
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/booke/pmap.c
  head/sys/sparc64/sparc64/pmap.c
  head/sys/vm/vm_object.h

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Wed Feb 27 18:12:04 2013(r247399)
+++ head/sys/amd64/amd64/pmap.c Wed Feb 27 18:12:13 2013(r247400)
@@ -3492,9 +3492,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
KASSERT((m-oflags  VPO_UNMANAGED) != 0 || va  kmi.clean_sva ||
va = kmi.clean_eva,
(pmap_enter: managed mapping within the clean submap));
-   KASSERT((m-oflags  (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
-   VM_OBJECT_LOCKED(m-object),
-   (pmap_enter: page %p is not busy, m));
+   if ((m-oflags  (VPO_UNMANAGED | VPO_BUSY)) == 0)
+   VM_OBJECT_LOCK_ASSERT(m-object, MA_OWNED);
pa = VM_PAGE_TO_PHYS(m);
newpte = (pt_entry_t)(pa | PG_A | PG_V);
if ((access  VM_PROT_WRITE) != 0)

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Wed Feb 27 18:12:04 2013(r247399)
+++ head/sys/i386/i386/pmap.c   Wed Feb 27 18:12:13 2013(r247400)
@@ -3456,9 +3456,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
KASSERT(va  UPT_MIN_ADDRESS || va = UPT_MAX_ADDRESS,
(pmap_enter: invalid to pmap_enter page table pages (va: 0x%x),
va));
-   KASSERT((m-oflags  (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
-   VM_OBJECT_LOCKED(m-object),
-   (pmap_enter: page %p is not busy, m));
+   if ((m-oflags  (VPO_UNMANAGED | VPO_BUSY)) == 0)
+   VM_OBJECT_LOCK_ASSERT(m-object, MA_OWNED);
 
mpte = NULL;
 

Modified: head/sys/i386/xen/pmap.c
==
--- head/sys/i386/xen/pmap.cWed Feb 27 18:12:04 2013(r247399)
+++ head/sys/i386/xen/pmap.cWed Feb 27 18:12:13 2013(r247400)
@@ -2666,9 +2666,8 @@ pmap_enter(pmap_t pmap, vm_offset_t va, 
KASSERT(va  UPT_MIN_ADDRESS || va = UPT_MAX_ADDRESS,
(pmap_enter: invalid to pmap_enter page table pages (va: 0x%x),
va));
-   KASSERT((m-oflags  (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
-   VM_OBJECT_LOCKED(m-object),
-   (pmap_enter: page %p is not busy, m));
+   if ((m-oflags  (VPO_UNMANAGED | VPO_BUSY)) == 0)
+   VM_OBJECT_LOCK_ASSERT(m-object, MA_OWNED);
 
mpte = NULL;
 

Modified: head/sys/powerpc/aim/mmu_oea.c
==
--- head/sys/powerpc/aim/mmu_oea.c  Wed Feb 27 18:12:04 2013
(r247399)
+++ head/sys/powerpc/aim/mmu_oea.c  Wed Feb 27 18:12:13 2013
(r247400)
@@ -1121,9 +1121,8 @@ moea_enter_locked(pmap_t pmap, vm_offset
if (pmap_bootstrapped)
rw_assert(pvh_global_lock, RA_WLOCKED);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
-   KASSERT((m-oflags  (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
-   VM_OBJECT_LOCKED(m-object),
-   (moea_enter_locked: page %p is not busy, m));
+   if ((m-oflags  (VPO_UNMANAGED | VPO_BUSY)) == 0)
+   VM_OBJECT_LOCK_ASSERT(m-object, MA_OWNED);
 
/* XXX change the pvo head for fake pages */
if ((m-oflags  VPO_UNMANAGED) != 0) {

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cWed Feb 27 18:12:04 2013
(r247399)
+++ head/sys/powerpc/aim/mmu_oea64.cWed Feb 27 18:12:13 2013
(r247400)
@@ -1183,9 +1183,8 @@ moea64_enter(mmu_t mmu, pmap_t pmap, vm_
pvo_flags = PVO_MANAGED;
}
 
-   KASSERT((m-oflags  (VPO_UNMANAGED | VPO_BUSY)) != 0 ||
-   VM_OBJECT_LOCKED(m-object),
-   (moea64_enter: page %p is not busy, m));
+   if ((m-oflags  (VPO_UNMANAGED | VPO_BUSY)) == 0)
+   VM_OBJECT_LOCK_ASSERT(m-object, MA_OWNED);
 
/* XXX change the pvo head for fake pages */
if ((m-oflags  VPO_UNMANAGED) != 0) {

Modified: head/sys/powerpc/booke/pmap.c
==
--- head/sys/powerpc/booke/pmap.c   Wed Feb 27 18:12:04 2013
(r247399)
+++ 

svn commit: r247405 - in head: sys/dev/watchdog sys/sys usr.sbin/watchdogd

2013-02-27 Thread Alfred Perlstein
Author: alfred
Date: Wed Feb 27 19:03:31 2013
New Revision: 247405
URL: http://svnweb.freebsd.org/changeset/base/247405

Log:
  watchdogd(8) and watchdog(4) enhancements.
  
  The following support was added to watchdog(4):
  - Support to query the outstanding timeout.
  - Support to set a software pre-timeout function watchdog with an 'action'
  - Support to set a software only watchdog with a configurable 'action'
  
  'action' can be a mask specifying a single operation or a combination of:
   log(9), printf(9), panic(9) and/or kdb_enter(9).
  
  Support the following in watchdogged:
  - Support to utilize the new additions to watchdog(4).
  - Support to warn if a watchdog script runs for too long.
  - Support for dry run where we do not actually arm the watchdog,
but only report on our timing.
  
  Sponsored by:   iXsystems, Inc.
  MFC after:  1 month

Modified:
  head/sys/dev/watchdog/watchdog.c
  head/sys/sys/watchdog.h
  head/usr.sbin/watchdogd/watchdogd.8
  head/usr.sbin/watchdogd/watchdogd.c

Modified: head/sys/dev/watchdog/watchdog.c
==
--- head/sys/dev/watchdog/watchdog.cWed Feb 27 18:47:01 2013
(r247404)
+++ head/sys/dev/watchdog/watchdog.cWed Feb 27 19:03:31 2013
(r247405)
@@ -1,5 +1,8 @@
 /*-
  * Copyright (c) 2004 Poul-Henning Kamp
+ * Copyright (c) 2013 iXsystems.com,
+ *   author: Alfred Perlstein alf...@freebsd.org
+ *
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,21 +32,40 @@
 __FBSDID($FreeBSD$);
 
 #include sys/param.h
+#include sys/types.h
 #include sys/systm.h
 #include sys/conf.h
 #include sys/uio.h
 #include sys/kernel.h
 #include sys/malloc.h
 #include sys/module.h
+#include sys/syslog.h
 #include sys/watchdog.h
 #include sys/bus.h
 #include machine/bus.h
 
+#include sys/syscallsubr.h /* kern_clock_gettime() */
+
+static int wd_set_pretimeout(int newtimeout, int disableiftoolong);
+static void wd_timeout_cb(void *arg);
+
+static struct callout wd_pretimeo_handle;
+static int wd_pretimeout;
+static int wd_pretimeout_act = WD_SOFT_LOG;
+
+static struct callout wd_softtimeo_handle;
+static int wd_softtimer;   /* true = use softtimer instead of hardware
+  watchdog */
+static int wd_softtimeout_act = WD_SOFT_LOG;   /* action for the software 
timeout */
+
 static struct cdev *wd_dev;
-static volatile u_int wd_last_u;
+static volatile u_int wd_last_u;/* last timeout value set by kern_do_pat */
 
-static int
-kern_do_pat(u_int utim)
+static int wd_lastpat_valid = 0;
+static time_t wd_lastpat = 0;  /* when the watchdog was last patted */
+
+int
+wdog_kern_pat(u_int utim)
 {
int error;
 
@@ -51,11 +73,20 @@ kern_do_pat(u_int utim)
return (EINVAL);
 
if ((utim  WD_LASTVAL) != 0) {
+   /*
+* if WD_LASTVAL is set, fill in the bits for timeout
+* from the saved value in wd_last_u.
+*/
MPASS((wd_last_u  ~WD_INTERVAL) == 0);
utim = ~WD_LASTVAL;
utim |= wd_last_u;
-   } else
+   } else {
+   /*
+* Otherwise save the new interval.
+* This can be zero (to disable the watchdog)
+*/
wd_last_u = (utim  WD_INTERVAL);
+   }
if ((utim  WD_INTERVAL) == WD_TO_NEVER) {
utim = 0;
 
@@ -65,18 +96,49 @@ kern_do_pat(u_int utim)
/* Assume no watchdog available; watchdog flags success */
error = EOPNOTSUPP;
}
-   EVENTHANDLER_INVOKE(watchdog_list, utim, error);
+   if (wd_softtimer) {
+   if (utim == 0) {
+   callout_stop(wd_softtimeo_handle);
+   } else {
+   (void) callout_reset(wd_softtimeo_handle,
+   hz*utim, wd_timeout_cb, soft);
+   }
+   error = 0;
+   } else {
+   EVENTHANDLER_INVOKE(watchdog_list, utim, error);
+   }
+   wd_set_pretimeout(wd_pretimeout, true);
+   /*
+* If we were able to arm/strobe the watchdog, then
+* update the last time it was strobed for WDIOC_GETTIMELEFT
+*/
+   if (!error) {
+   struct timespec ts;
+
+   error = kern_clock_gettime(curthread /* XXX */,
+   CLOCK_MONOTONIC_FAST, ts);
+   if (!error) {
+   wd_lastpat = ts.tv_sec;
+   wd_lastpat_valid = 1;
+   }
+   }
return (error);
 }
 
 static int
-wd_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data,
-int flags __unused, struct thread *td)
+wd_valid_act(int act)
+{
+
+   if ((act  ~(WD_SOFT_MASK)) != 0)
+   return false;
+   return true;
+}
+
+static int
+wd_ioctl_patpat(caddr_t data)
 {
u_int u;
 

svn commit: r247406 - in stable/9: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common...

2013-02-27 Thread Martin Matuska
Author: mm
Date: Wed Feb 27 19:20:50 2013
New Revision: 247406
URL: http://svnweb.freebsd.org/changeset/base/247406

Log:
  MFC r246631,246651,24,246675,246678,246688:
  Merge various ZFS bugfixes
  
  MFC r246631:
  Import vendor bugfixes
  
  Illumos ZFS issues:
3422 zpool create/syseventd race yield non-importable pool
3425 first write to a new zvol can fail with EFBIG
  
  MFC r246651:
  Import minor type change in refcount.h header from vendor (illumos).
  
  MFC r24:
  Import vendor ZFS bugfix fixing a problem in arc_read().
  
  Illumos ZFS issues:
3498 panic in arc_read(): !refcount_is_zero(pbuf-b_hdr-b_refcnt)
  
  MFC r246675:
  Add tunable to allow block allocation on degraded vdevs.
  
  Illumos ZFS issues:
3507 Tunable to allow block allocation even on degraded vdevs
  
  MFC r246678:
  Import vendor bugfixes regarding SA rounding, header size and layout.
  This was already partially fixed by avg.
  
  Illumos ZFS issues:
3512 rounding discrepancy in sa_find_sizes()
3513 mismatch between SA header size and layout
  
  MFC r246688 [1]:
  Merge zfs_ioctl.c code that should have been merged together with ZFS v28.
  Fixes several problems if working with read-only pools.
  
  Changed code originaly introduced in onnv-gate 13061:bda0decf867b
  Contains changes up to illumos-gate 13700:4bc0783f6064
  
  PR:   kern/175897 [1]
  Suggested by: avg [1]

Modified:
  stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
Directory Properties:
  stable/9/cddl/contrib/opensolaris/   (props changed)
  stable/9/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Feb 27 19:03:31 
2013(r247405)
+++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Feb 27 19:20:50 
2013(r247406)
@@ -983,7 +983,7 @@ visit_indirect(spa_t *spa, const dnode_p
arc_buf_t *buf;
uint64_t fill = 0;
 
-   err = arc_read_nolock(NULL, spa, bp, arc_getbuf_func, buf,
+   err = arc_read(NULL, spa, bp, arc_getbuf_func, buf,
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, flags, zb);
if (err)
return (err);
@@ -2001,9 +2001,8 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *
bp, NULL, NULL, ZIO_FLAG_CANFAIL)), ==, 0);
 }
 
-/* ARGSUSED */
 static int
-zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
+zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
 const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
 {
zdb_cb_t *zcb = arg;
@@ -2410,7 +2409,7 @@ typedef struct zdb_ddt_entry {
 /* ARGSUSED */
 static int
 zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
+const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
 {
avl_tree_t *t = arg;
avl_index_t where;

Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
==
--- 

svn commit: r247407 - in stable/8: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common...

2013-02-27 Thread Martin Matuska
Author: mm
Date: Wed Feb 27 19:22:27 2013
New Revision: 247407
URL: http://svnweb.freebsd.org/changeset/base/247407

Log:
  MFC r246631,246651,24,246675,246678,246688:
  Merge various ZFS bugfixes
  
  MFC r246631:
  Import vendor bugfixes
  
  Illumos ZFS issues:
3422 zpool create/syseventd race yield non-importable pool
3425 first write to a new zvol can fail with EFBIG
  
  MFC r246651:
  Import minor type change in refcount.h header from vendor (illumos).
  
  MFC r24:
  Import vendor ZFS bugfix fixing a problem in arc_read().
  
  Illumos ZFS issues:
3498 panic in arc_read(): !refcount_is_zero(pbuf-b_hdr-b_refcnt)
  
  MFC r246675:
  Add tunable to allow block allocation on degraded vdevs.
  
  Illumos ZFS issues:
3507 Tunable to allow block allocation even on degraded vdevs
  
  MFC r246678:
  Import vendor bugfixes regarding SA rounding, header size and layout.
  This was already partially fixed by avg.
  
  Illumos ZFS issues:
3512 rounding discrepancy in sa_find_sizes()
3513 mismatch between SA header size and layout
  
  MFC r246688 [1]:
  Merge zfs_ioctl.c code that should have been merged together with ZFS v28.
  Fixes several problems if working with read-only pools.
  
  Changed code originaly introduced in onnv-gate 13061:bda0decf867b
  Contains changes up to illumos-gate 13700:4bc0783f6064
  
  PR:   kern/175897 [1]
  Suggested by: avg [1]

Modified:
  stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)
  stable/8/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/cddl/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Feb 27 19:20:50 
2013(r247406)
+++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Wed Feb 27 19:22:27 
2013(r247407)
@@ -983,7 +983,7 @@ visit_indirect(spa_t *spa, const dnode_p
arc_buf_t *buf;
uint64_t fill = 0;
 
-   err = arc_read_nolock(NULL, spa, bp, arc_getbuf_func, buf,
+   err = arc_read(NULL, spa, bp, arc_getbuf_func, buf,
ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, flags, zb);
if (err)
return (err);
@@ -2001,9 +2001,8 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *
bp, NULL, NULL, ZIO_FLAG_CANFAIL)), ==, 0);
 }
 
-/* ARGSUSED */
 static int
-zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
+zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
 const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
 {
zdb_cb_t *zcb = arg;
@@ -2410,7 +2409,7 @@ typedef struct zdb_ddt_entry {
 /* ARGSUSED */
 static int
 zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-arc_buf_t *pbuf, const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
+const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg)
 {
avl_tree_t *t = arg;
avl_index_t where;

Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
==
--- 

svn commit: r247408 - stable/9/usr.sbin/pciconf

2013-02-27 Thread John Baldwin
Author: jhb
Date: Wed Feb 27 19:38:25 2013
New Revision: 247408
URL: http://svnweb.freebsd.org/changeset/base/247408

Log:
  MFC 240474:
  - Denote PCI-e endpoints that support FLR.
  - Make parsing of PCI-e extended capabilities assume that future version
numbers are backwards compatible.
  - Add new AER error descriptions.
  - Add descriptions for more PCI-e extended capabilities.

Modified:
  stable/9/usr.sbin/pciconf/cap.c
  stable/9/usr.sbin/pciconf/err.c
Directory Properties:
  stable/9/usr.sbin/pciconf/   (props changed)

Modified: stable/9/usr.sbin/pciconf/cap.c
==
--- stable/9/usr.sbin/pciconf/cap.c Wed Feb 27 19:22:27 2013
(r247407)
+++ stable/9/usr.sbin/pciconf/cap.c Wed Feb 27 19:38:25 2013
(r247408)
@@ -428,6 +428,8 @@ cap_express(int fd, struct pci_conf *p, 
printf( max data %d(%d),
MAX_PAYLOAD((flags  PCIEM_CTL_MAX_PAYLOAD)  5),
MAX_PAYLOAD(val  PCIEM_CAP_MAX_PAYLOAD));
+   if (val  PCIEM_CAP_FLR)
+   printf( FLR);
val = read_config(fd, p-pc_sel, ptr + PCIER_LINK_CAP, 4);
flags = read_config(fd, p-pc_sel, ptr+ PCIER_LINK_STA, 2);
printf( link x%d(x%d), (flags  PCIEM_LINK_STA_WIDTH)  4,
@@ -587,7 +589,7 @@ ecap_aer(int fd, struct pci_conf *p, uin
uint32_t sta, mask;
 
printf(AER %d, ver);
-   if (ver != 1)
+   if (ver  1)
return;
sta = read_config(fd, p-pc_sel, ptr + PCIR_AER_UC_STATUS, 4);
mask = read_config(fd, p-pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4);
@@ -603,7 +605,7 @@ ecap_vc(int fd, struct pci_conf *p, uint
uint32_t cap1;
 
printf(VC %d, ver);
-   if (ver != 1)
+   if (ver  1)
return;
cap1 = read_config(fd, p-pc_sel, ptr + PCIR_VC_CAP1, 4);
printf( max VC%d, cap1  PCIM_VC_CAP1_EXT_COUNT);
@@ -618,7 +620,7 @@ ecap_sernum(int fd, struct pci_conf *p, 
uint32_t high, low;
 
printf(Serial %d, ver);
-   if (ver != 1)
+   if (ver  1)
return;
low = read_config(fd, p-pc_sel, ptr + PCIR_SERIAL_LOW, 4);
high = read_config(fd, p-pc_sel, ptr + PCIR_SERIAL_HIGH, 4);
@@ -626,10 +628,58 @@ ecap_sernum(int fd, struct pci_conf *p, 
 }
 
 static void
+ecap_vendor(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
+{
+   uint32_t val;
+
+   printf(Vendor %d, ver);
+   if (ver  1)
+   return;
+   val = read_config(fd, p-pc_sel, ptr + 4, 4);
+   printf( ID %d, val  0x);
+}
+
+static void
+ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
+{
+   uint32_t val;
+
+   printf(PCIe Sec %d, ver);
+   if (ver  1)
+   return;
+   val = read_config(fd, p-pc_sel, ptr + 8, 4);
+   printf( lane errors %#x, val);
+}
+
+struct {
+   uint16_t id;
+   const char *name;
+} ecap_names[] = {
+   { PCIZ_PWRBDGT, Power Budgeting },
+   { PCIZ_RCLINK_DCL, Root Complex Link Declaration },
+   { PCIZ_RCLINK_CTL, Root Complex Internal Link Control },
+   { PCIZ_RCEC_ASSOC, Root Complex Event Collector ASsociation },
+   { PCIZ_MFVC, MFVC },
+   { PCIZ_RCRB, RCRB },
+   { PCIZ_ACS, ACS },
+   { PCIZ_ARI, ARI },
+   { PCIZ_ATS, ATS },
+   { PCIZ_SRIOV, SRIOV },
+   { PCIZ_MULTICAST, Multicast },
+   { PCIZ_RESIZE_BAR, Resizable BAR },
+   { PCIZ_DPA, DPA },
+   { PCIZ_TPH_REQ, TPH Requester },
+   { PCIZ_LTR, LTR },
+   { 0, NULL }
+};
+
+static void
 list_ecaps(int fd, struct pci_conf *p)
 {
+   const char *name;
uint32_t ecap;
uint16_t ptr;
+   int i;
 
ptr = PCIR_EXTCAP;
ecap = read_config(fd, p-pc_sel, ptr, 4);
@@ -647,8 +697,20 @@ list_ecaps(int fd, struct pci_conf *p)
case PCIZ_SERNUM:
ecap_sernum(fd, p, ptr, PCI_EXTCAP_VER(ecap));
break;
+   case PCIZ_VENDOR:
+   ecap_vendor(fd, p, ptr, PCI_EXTCAP_VER(ecap));
+   break;
+   case PCIZ_SEC_PCIE:
+   ecap_sec_pcie(fd, p, ptr, PCI_EXTCAP_VER(ecap));
+   break;
default:
-   printf(unknown %d, PCI_EXTCAP_VER(ecap));
+   name = unknown;
+   for (i = 0; ecap_names[i].name != NULL; i++)
+   if (ecap_names[i].id == PCI_EXTCAP_ID(ecap)) {
+   name = ecap_names[i].name;
+   break;
+   }
+   printf(%s %d, name, PCI_EXTCAP_VER(ecap));
break;
}
printf(\n);

Modified: stable/9/usr.sbin/pciconf/err.c
==
--- stable/9/usr.sbin/pciconf/err.c 

svn commit: r247409 - stable/8/usr.sbin/pciconf

2013-02-27 Thread John Baldwin
Author: jhb
Date: Wed Feb 27 19:38:33 2013
New Revision: 247409
URL: http://svnweb.freebsd.org/changeset/base/247409

Log:
  MFC 240474:
  - Denote PCI-e endpoints that support FLR.
  - Make parsing of PCI-e extended capabilities assume that future version
numbers are backwards compatible.
  - Add new AER error descriptions.
  - Add descriptions for more PCI-e extended capabilities.

Modified:
  stable/8/usr.sbin/pciconf/cap.c
  stable/8/usr.sbin/pciconf/err.c
Directory Properties:
  stable/8/usr.sbin/pciconf/   (props changed)

Modified: stable/8/usr.sbin/pciconf/cap.c
==
--- stable/8/usr.sbin/pciconf/cap.c Wed Feb 27 19:38:25 2013
(r247408)
+++ stable/8/usr.sbin/pciconf/cap.c Wed Feb 27 19:38:33 2013
(r247409)
@@ -428,6 +428,8 @@ cap_express(int fd, struct pci_conf *p, 
printf( max data %d(%d),
MAX_PAYLOAD((flags  PCIEM_CTL_MAX_PAYLOAD)  5),
MAX_PAYLOAD(val  PCIEM_CAP_MAX_PAYLOAD));
+   if (val  PCIEM_CAP_FLR)
+   printf( FLR);
val = read_config(fd, p-pc_sel, ptr + PCIER_LINK_CAP, 4);
flags = read_config(fd, p-pc_sel, ptr+ PCIER_LINK_STA, 2);
printf( link x%d(x%d), (flags  PCIEM_LINK_STA_WIDTH)  4,
@@ -587,7 +589,7 @@ ecap_aer(int fd, struct pci_conf *p, uin
uint32_t sta, mask;
 
printf(AER %d, ver);
-   if (ver != 1)
+   if (ver  1)
return;
sta = read_config(fd, p-pc_sel, ptr + PCIR_AER_UC_STATUS, 4);
mask = read_config(fd, p-pc_sel, ptr + PCIR_AER_UC_SEVERITY, 4);
@@ -603,7 +605,7 @@ ecap_vc(int fd, struct pci_conf *p, uint
uint32_t cap1;
 
printf(VC %d, ver);
-   if (ver != 1)
+   if (ver  1)
return;
cap1 = read_config(fd, p-pc_sel, ptr + PCIR_VC_CAP1, 4);
printf( max VC%d, cap1  PCIM_VC_CAP1_EXT_COUNT);
@@ -618,7 +620,7 @@ ecap_sernum(int fd, struct pci_conf *p, 
uint32_t high, low;
 
printf(Serial %d, ver);
-   if (ver != 1)
+   if (ver  1)
return;
low = read_config(fd, p-pc_sel, ptr + PCIR_SERIAL_LOW, 4);
high = read_config(fd, p-pc_sel, ptr + PCIR_SERIAL_HIGH, 4);
@@ -626,10 +628,58 @@ ecap_sernum(int fd, struct pci_conf *p, 
 }
 
 static void
+ecap_vendor(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
+{
+   uint32_t val;
+
+   printf(Vendor %d, ver);
+   if (ver  1)
+   return;
+   val = read_config(fd, p-pc_sel, ptr + 4, 4);
+   printf( ID %d, val  0x);
+}
+
+static void
+ecap_sec_pcie(int fd, struct pci_conf *p, uint16_t ptr, uint8_t ver)
+{
+   uint32_t val;
+
+   printf(PCIe Sec %d, ver);
+   if (ver  1)
+   return;
+   val = read_config(fd, p-pc_sel, ptr + 8, 4);
+   printf( lane errors %#x, val);
+}
+
+struct {
+   uint16_t id;
+   const char *name;
+} ecap_names[] = {
+   { PCIZ_PWRBDGT, Power Budgeting },
+   { PCIZ_RCLINK_DCL, Root Complex Link Declaration },
+   { PCIZ_RCLINK_CTL, Root Complex Internal Link Control },
+   { PCIZ_RCEC_ASSOC, Root Complex Event Collector ASsociation },
+   { PCIZ_MFVC, MFVC },
+   { PCIZ_RCRB, RCRB },
+   { PCIZ_ACS, ACS },
+   { PCIZ_ARI, ARI },
+   { PCIZ_ATS, ATS },
+   { PCIZ_SRIOV, SRIOV },
+   { PCIZ_MULTICAST, Multicast },
+   { PCIZ_RESIZE_BAR, Resizable BAR },
+   { PCIZ_DPA, DPA },
+   { PCIZ_TPH_REQ, TPH Requester },
+   { PCIZ_LTR, LTR },
+   { 0, NULL }
+};
+
+static void
 list_ecaps(int fd, struct pci_conf *p)
 {
+   const char *name;
uint32_t ecap;
uint16_t ptr;
+   int i;
 
ptr = PCIR_EXTCAP;
ecap = read_config(fd, p-pc_sel, ptr, 4);
@@ -647,8 +697,20 @@ list_ecaps(int fd, struct pci_conf *p)
case PCIZ_SERNUM:
ecap_sernum(fd, p, ptr, PCI_EXTCAP_VER(ecap));
break;
+   case PCIZ_VENDOR:
+   ecap_vendor(fd, p, ptr, PCI_EXTCAP_VER(ecap));
+   break;
+   case PCIZ_SEC_PCIE:
+   ecap_sec_pcie(fd, p, ptr, PCI_EXTCAP_VER(ecap));
+   break;
default:
-   printf(unknown %d, PCI_EXTCAP_VER(ecap));
+   name = unknown;
+   for (i = 0; ecap_names[i].name != NULL; i++)
+   if (ecap_names[i].id == PCI_EXTCAP_ID(ecap)) {
+   name = ecap_names[i].name;
+   break;
+   }
+   printf(%s %d, name, PCI_EXTCAP_VER(ecap));
break;
}
printf(\n);

Modified: stable/8/usr.sbin/pciconf/err.c
==
--- stable/8/usr.sbin/pciconf/err.c 

svn commit: r247411 - in head: include lib/libc/stdio tools/regression/lib/libc/stdio

2013-02-27 Thread John Baldwin
Author: jhb
Date: Wed Feb 27 19:50:46 2013
New Revision: 247411
URL: http://svnweb.freebsd.org/changeset/base/247411

Log:
  Add an implementation of open_memstream() and open_wmemstream().  These
  routines provide write-only stdio FILE objects that store their data in a
  dynamically allocated buffer.  They are a string builder interface somewhat
  akin to a completely dynamic sbuf.
  
  Reviewed by:  bde, jilles (earlier versions)
  MFC after:1 month

Added:
  head/lib/libc/stdio/open_memstream.3   (contents, props changed)
  head/lib/libc/stdio/open_memstream.c   (contents, props changed)
  head/lib/libc/stdio/open_wmemstream.c   (contents, props changed)
  head/tools/regression/lib/libc/stdio/test-open_memstream.c   (contents, props 
changed)
  head/tools/regression/lib/libc/stdio/test-open_memstream.t   (contents, props 
changed)
  head/tools/regression/lib/libc/stdio/test-open_wmemstream.c   (contents, 
props changed)
  head/tools/regression/lib/libc/stdio/test-open_wmemstream.t   (contents, 
props changed)
Modified:
  head/include/stdio.h
  head/include/wchar.h
  head/lib/libc/stdio/Makefile.inc
  head/lib/libc/stdio/Symbol.map
  head/tools/regression/lib/libc/stdio/Makefile

Modified: head/include/stdio.h
==
--- head/include/stdio.hWed Feb 27 19:49:14 2013(r247410)
+++ head/include/stdio.hWed Feb 27 19:50:46 2013(r247411)
@@ -346,6 +346,7 @@ char*tempnam(const char *, const char *
 FILE   *fmemopen(void * __restrict, size_t, const char * __restrict);
 ssize_t getdelim(char ** __restrict, size_t * __restrict, int,
FILE * __restrict);
+FILE   *open_memstream(char **, size_t *);
 int renameat(int, const char *, int, const char *);
 int vdprintf(int, const char * __restrict, __va_list);
 

Modified: head/include/wchar.h
==
--- head/include/wchar.hWed Feb 27 19:49:14 2013(r247410)
+++ head/include/wchar.hWed Feb 27 19:50:46 2013(r247411)
@@ -207,6 +207,7 @@ int wcwidth(wchar_t);
 #if __POSIX_VISIBLE = 200809 || __BSD_VISIBLE
 size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
size_t, mbstate_t * __restrict);
+FILE   *open_wmemstream(wchar_t **, size_t *);
 wchar_t*wcpcpy(wchar_t * __restrict, const wchar_t * __restrict);
 wchar_t*wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, 
size_t);
 wchar_t*wcsdup(const wchar_t *) __malloc_like;

Modified: head/lib/libc/stdio/Makefile.inc
==
--- head/lib/libc/stdio/Makefile.incWed Feb 27 19:49:14 2013
(r247410)
+++ head/lib/libc/stdio/Makefile.incWed Feb 27 19:50:46 2013
(r247411)
@@ -14,6 +14,7 @@ SRCS+=_flock_stub.c asprintf.c clrerr.c
ftell.c funopen.c fvwrite.c fwalk.c fwide.c fwprintf.c fwscanf.c \
fwrite.c getc.c getchar.c getdelim.c getline.c \
gets.c getw.c getwc.c getwchar.c makebuf.c mktemp.c \
+   open_memstream.c open_wmemstream.c \
perror.c printf.c printf-pos.c putc.c putchar.c \
puts.c putw.c putwc.c putwchar.c \
refill.c remove.c rewind.c rget.c scanf.c setbuf.c setbuffer.c \
@@ -36,7 +37,7 @@ MAN+= fclose.3 ferror.3 fflush.3 fgetln.
flockfile.3 \
fopen.3 fputs.3 \
fputws.3 fread.3 fseek.3 funopen.3 fwide.3 getc.3 \
-   getline.3 getwc.3 mktemp.3 \
+   getline.3 getwc.3 mktemp.3 open_memstream.3 \
printf.3 printf_l.3 putc.3 putwc.3 remove.3 scanf.3 scanf_l.3 setbuf.3 \
stdio.3 tmpnam.3 \
ungetc.3 ungetwc.3 wprintf.3 wscanf.3
@@ -60,6 +61,7 @@ MLINKS+=getc.3 fgetc.3 getc.3 getc_unloc
 MLINKS+=getline.3 getdelim.3
 MLINKS+=getwc.3 fgetwc.3 getwc.3 getwchar.3
 MLINKS+=mktemp.3 mkdtemp.3 mktemp.3 mkstemp.3 mktemp.3 mkstemps.3
+MLINKS+=open_memstream.3 open_wmemstream.3
 MLINKS+=printf.3 asprintf.3 printf.3 dprintf.3 printf.3 fprintf.3 \
printf.3 snprintf.3 printf.3 sprintf.3 \
printf.3 vasprintf.3 printf.3 vdprintf.3 \

Modified: head/lib/libc/stdio/Symbol.map
==
--- head/lib/libc/stdio/Symbol.map  Wed Feb 27 19:49:14 2013
(r247410)
+++ head/lib/libc/stdio/Symbol.map  Wed Feb 27 19:50:46 2013
(r247411)
@@ -156,6 +156,8 @@ FBSD_1.3 {
putwc_l;
putwchar_l;
fmemopen;
+   open_memstream;
+   open_wmemstream;
 };
 
 FBSDprivate_1.0 {

Added: head/lib/libc/stdio/open_memstream.3
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/stdio/open_memstream.3Wed Feb 27 19:50:46 2013
(r247411)
@@ -0,0 +1,154 @@
+.\ Copyright (c) 2013 Advanced Computing 

svn commit: r247412 - head/sys/netinet

2013-02-27 Thread Michael Tuexen
Author: tuexen
Date: Wed Feb 27 19:51:47 2013
New Revision: 247412
URL: http://svnweb.freebsd.org/changeset/base/247412

Log:
  Fix a potential race in returning setting errno when an
  association goes down.
  Reported by Mozilla in
  https://bugzilla.mozilla.org/show_bug.cgi?id=845513
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==
--- head/sys/netinet/sctputil.c Wed Feb 27 19:50:46 2013(r247411)
+++ head/sys/netinet/sctputil.c Wed Feb 27 19:51:47 2013(r247412)
@@ -2678,6 +2678,7 @@ set_error:
if (((stcb-sctp_ep-sctp_flags  SCTP_PCB_FLAGS_TCPTYPE) ||
(stcb-sctp_ep-sctp_flags  SCTP_PCB_FLAGS_IN_TCPPOOL)) 
((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) {
+   SOCK_LOCK(stcb-sctp_socket);
if (from_peer) {
if (SCTP_GET_STATE(stcb-asoc) == 
SCTP_STATE_COOKIE_WAIT) {
SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, 
SCTP_FROM_SCTPUTIL, ECONNREFUSED);
@@ -2709,7 +2710,7 @@ set_error:
if (((stcb-sctp_ep-sctp_flags  SCTP_PCB_FLAGS_TCPTYPE) ||
(stcb-sctp_ep-sctp_flags  SCTP_PCB_FLAGS_IN_TCPPOOL)) 
((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC))) {
-   socantrcvmore(stcb-sctp_socket);
+   socantrcvmore_locked(stcb-sctp_socket);
}
sorwakeup(stcb-sctp_socket);
sowwakeup(stcb-sctp_socket);
___
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: r247413 - head/sys/boot/common

2013-02-27 Thread Ian Lepore
Author: ian
Date: Wed Feb 27 19:59:41 2013
New Revision: 247413
URL: http://svnweb.freebsd.org/changeset/base/247413

Log:
  Fix a typo that prevented booting a kernel that had virtual addresses in
  the elf headers.

Modified:
  head/sys/boot/common/load_elf.c

Modified: head/sys/boot/common/load_elf.c
==
--- head/sys/boot/common/load_elf.c Wed Feb 27 19:51:47 2013
(r247412)
+++ head/sys/boot/common/load_elf.c Wed Feb 27 19:59:41 2013
(r247413)
@@ -304,7 +304,7 @@ __elfN(loadimage)(struct preloaded_file 
 * only adjust the entry point if it's a virtual address to begin with.
 */
off = -0xc000u;
-   if ((ehdr-e_entry  0xc000u) == 0xc00u)
+   if ((ehdr-e_entry  0xc000u) == 0xc000u)
ehdr-e_entry += off;
 #ifdef ELF_VERBOSE
printf(ehdr-e_entry 0x%08x, va-pa off %llx\n, ehdr-e_entry, off);
___
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: r247414 - head/tools/test/iconv/tablegen

2013-02-27 Thread John-Mark Gurney
Author: jmg
Date: Wed Feb 27 19:59:58 2013
New Revision: 247414
URL: http://svnweb.freebsd.org/changeset/base/247414

Log:
  fix this script so we don't expand the second $FreeBSD since svn thinks
  the $ in $1 ends the keyword, and expands it...

Modified:
  head/tools/test/iconv/tablegen/cmp.sh

Modified: head/tools/test/iconv/tablegen/cmp.sh
==
--- head/tools/test/iconv/tablegen/cmp.sh   Wed Feb 27 19:59:41 2013
(r247413)
+++ head/tools/test/iconv/tablegen/cmp.sh   Wed Feb 27 19:59:58 2013
(r247414)
@@ -1,4 +1,4 @@
 #!/bin/sh
 # $FreeBSD$
 
-diff -I\$FreeBSD$1 $2 | grep '^-' /dev/null  printf \tDIFFER: $1 $2\n  
exit 0 || exit 0
+diff -I\$\FreeBSD $1 $2 | grep '^-' /dev/null  printf \tDIFFER: $1 $2\n 
 exit 0 || exit 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: r247415 - head/lib/libc/stdio

2013-02-27 Thread Joel Dahl
Author: joel (doc committer)
Date: Wed Feb 27 20:09:25 2013
New Revision: 247415
URL: http://svnweb.freebsd.org/changeset/base/247415

Log:
  mdoc: add missing El.

Modified:
  head/lib/libc/stdio/open_memstream.3

Modified: head/lib/libc/stdio/open_memstream.3
==
--- head/lib/libc/stdio/open_memstream.3Wed Feb 27 19:59:58 2013
(r247414)
+++ head/lib/libc/stdio/open_memstream.3Wed Feb 27 20:09:25 2013
(r247415)
@@ -137,6 +137,7 @@ argument was
 .Dv NULL .
 .It Bq Er ENOMEM
 Memory for the stream or buffer could not be allocated.
+.El
 .Sh SEE ALSO
 .Xr fclose 3 ,
 .Xr fflush 3 ,
___
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: r247416 - head/usr.sbin/watchdogd

2013-02-27 Thread Joel Dahl
Author: joel (doc committer)
Date: Wed Feb 27 20:15:06 2013
New Revision: 247416
URL: http://svnweb.freebsd.org/changeset/base/247416

Log:
  mdoc: begin sentence on new line.

Modified:
  head/usr.sbin/watchdogd/watchdogd.8

Modified: head/usr.sbin/watchdogd/watchdogd.8
==
--- head/usr.sbin/watchdogd/watchdogd.8 Wed Feb 27 20:09:25 2013
(r247415)
+++ head/usr.sbin/watchdogd/watchdogd.8 Wed Feb 27 20:15:06 2013
(r247416)
@@ -132,23 +132,27 @@ This flag will cause watchdogd to compla
 execute the watchdog script exceeds the threshold of 'sleep' option.
 .Pp
 .It Fl -pretimeout Ar timeout
-Set a pretimeout watchdog.  At timeout seconds before the watchdog
-will fire attempt an action.  The action is set by the --pretimeout-action
-flag.  The default is just to log a message (WD_SOFT_LOG) via
+Set a pretimeout watchdog.
+At timeout seconds before the watchdog will fire attempt an action.
+The action is set by the --pretimeout-action flag.
+The default is just to log a message (WD_SOFT_LOG) via
 .Xr log 9 .
 .Pp
 .It Fl -pretimeout-action Ar action
-Set the timeout action for the pretimeout.  See the section 
+Set the timeout action for the pretimeout.
+See the section 
 .Sx Timeout Actions .
 .Pp
 .It Fl -softtimeout
 Instead of arming the various hardware watchdogs, only use a basic software
-watchdog.  The default action is just to
+watchdog.
+The default action is just to
 .Xr log 9
 a message (WD_SOFT_LOG).
 .Pp
 .It Fl -softtimeout-action Ar action
-Set the timeout action for the softtimeout.  See the section 
+Set the timeout action for the softtimeout.
+See the section 
 .Sx Timeout Actions .
 .Pp
 .El
___
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: r247417 - head/usr.sbin/watchdogd

2013-02-27 Thread Joel Dahl
Author: joel (doc committer)
Date: Wed Feb 27 20:16:30 2013
New Revision: 247417
URL: http://svnweb.freebsd.org/changeset/base/247417

Log:
  Remove EOL whitespace.

Modified:
  head/usr.sbin/watchdogd/watchdogd.8

Modified: head/usr.sbin/watchdogd/watchdogd.8
==
--- head/usr.sbin/watchdogd/watchdogd.8 Wed Feb 27 20:15:06 2013
(r247416)
+++ head/usr.sbin/watchdogd/watchdogd.8 Wed Feb 27 20:16:30 2013
(r247417)
@@ -100,7 +100,7 @@ that its script has run for too long.
 If unset
 .Ar script_timeout
 defaults to the value specified by the
-.Fl s Ar sleep 
+.Fl s Ar sleep
 option.
 .Pp
 Upon receiving the
@@ -140,7 +140,7 @@ The default is just to log a message (WD
 .Pp
 .It Fl -pretimeout-action Ar action
 Set the timeout action for the pretimeout.
-See the section 
+See the section
 .Sx Timeout Actions .
 .Pp
 .It Fl -softtimeout
@@ -152,7 +152,7 @@ a message (WD_SOFT_LOG).
 .Pp
 .It Fl -softtimeout-action Ar action
 Set the timeout action for the softtimeout.
-See the section 
+See the section
 .Sx Timeout Actions .
 .Pp
 .El
@@ -179,7 +179,7 @@ Log a message using
 when the timeout is reached.
 .Pp
 .It Ar printf
-call the kernel 
+call the kernel
 .Xr printf 9
 to display a message to the console and
 .Xr dmesg 8
___
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: r247420 - stable/9/sys/dev/amr

2013-02-27 Thread John Baldwin
Author: jhb
Date: Wed Feb 27 21:03:09 2013
New Revision: 247420
URL: http://svnweb.freebsd.org/changeset/base/247420

Log:
  MFC 240692,241228:
  Adjust the ioctl workaround from r234501:
  - Ensure the native ioctl path always allocates a 4kb buffer if a request
uses a buffer size of 0.
  - Rounding all small requests up to 32k swamped the controller causing
firmware hangs.  Instead, round requests smaller than 64k up to the next
power of 2 as a general rule.  To handle the one known special case of a
command that accepts a 12k buffer returning a 24k-ish reply, round
requests between 8k and 16k up to 32k rather than 16k.  The result is
that commands less than 8k should now be rounded up to a smaller size
(either 4k or 8k) rather than 32k.

Modified:
  stable/9/sys/dev/amr/amr.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/amr/amr.c
==
--- stable/9/sys/dev/amr/amr.c  Wed Feb 27 20:54:45 2013(r247419)
+++ stable/9/sys/dev/amr/amr.c  Wed Feb 27 21:03:09 2013(r247420)
@@ -546,13 +546,19 @@ shutdown_out:
  * The amr(4) firmware relies on this feature.  In fact, it assumes
  * the buffer is always a power of 2 up to a max of 64k.  There is
  * also at least one case where it assumes a buffer less than 16k is
- * greater than 16k.  Force a minimum buffer size of 32k and round
- * sizes between 32k and 64k up to 64k as a workaround.
+ * greater than 16k.  However, forcing all buffers to a size of 32k
+ * causes stalls in the firmware.  Force each command smaller than
+ * 64k up to the next power of two except that commands between 8k
+ * and 16k are rounded up to 32k instead of 16k.
  */
 static unsigned long
 amr_ioctl_buffer_length(unsigned long len)
 {
 
+if (len = 4 * 1024)
+   return (4 * 1024);
+if (len = 8 * 1024)
+   return (8 * 1024);
 if (len = 32 * 1024)
return (32 * 1024);
 if (len = 64 * 1024)
@@ -859,11 +865,8 @@ amr_ioctl(struct cdev *dev, u_long cmd, 
 
 /* handle inbound data buffer */
 real_length = amr_ioctl_buffer_length(au_length);
+dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO);
 if (au_length != 0  au_cmd[0] != 0x06) {
-   if ((dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO)) == NULL) {
-   error = ENOMEM;
-   goto out;
-   }
if ((error = copyin(au_buffer, dp, au_length)) != 0) {
free(dp, M_AMR);
return (error);
@@ -933,8 +936,7 @@ amr_ioctl(struct cdev *dev, u_long cmd, 
error = copyout(dp, au_buffer, au_length);
 }
 debug(2, copyout %ld bytes from %p - %p, au_length, dp, au_buffer);
-if (dp != NULL)
-   debug(2, %p status 0x%x, dp, ac-ac_status);
+debug(2, %p status 0x%x, dp, ac-ac_status);
 *au_statusp = ac-ac_status;
 
 out:
___
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: r247421 - stable/8/sys/dev/amr

2013-02-27 Thread John Baldwin
Author: jhb
Date: Wed Feb 27 21:03:19 2013
New Revision: 247421
URL: http://svnweb.freebsd.org/changeset/base/247421

Log:
  MFC 240692,241228:
  Adjust the ioctl workaround from r234501:
  - Ensure the native ioctl path always allocates a 4kb buffer if a request
uses a buffer size of 0.
  - Rounding all small requests up to 32k swamped the controller causing
firmware hangs.  Instead, round requests smaller than 64k up to the next
power of 2 as a general rule.  To handle the one known special case of a
command that accepts a 12k buffer returning a 24k-ish reply, round
requests between 8k and 16k up to 32k rather than 16k.  The result is
that commands less than 8k should now be rounded up to a smaller size
(either 4k or 8k) rather than 32k.

Modified:
  stable/8/sys/dev/amr/amr.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/amr/   (props changed)

Modified: stable/8/sys/dev/amr/amr.c
==
--- stable/8/sys/dev/amr/amr.c  Wed Feb 27 21:03:09 2013(r247420)
+++ stable/8/sys/dev/amr/amr.c  Wed Feb 27 21:03:19 2013(r247421)
@@ -546,13 +546,19 @@ shutdown_out:
  * The amr(4) firmware relies on this feature.  In fact, it assumes
  * the buffer is always a power of 2 up to a max of 64k.  There is
  * also at least one case where it assumes a buffer less than 16k is
- * greater than 16k.  Force a minimum buffer size of 32k and round
- * sizes between 32k and 64k up to 64k as a workaround.
+ * greater than 16k.  However, forcing all buffers to a size of 32k
+ * causes stalls in the firmware.  Force each command smaller than
+ * 64k up to the next power of two except that commands between 8k
+ * and 16k are rounded up to 32k instead of 16k.
  */
 static unsigned long
 amr_ioctl_buffer_length(unsigned long len)
 {
 
+if (len = 4 * 1024)
+   return (4 * 1024);
+if (len = 8 * 1024)
+   return (8 * 1024);
 if (len = 32 * 1024)
return (32 * 1024);
 if (len = 64 * 1024)
@@ -859,11 +865,8 @@ amr_ioctl(struct cdev *dev, u_long cmd, 
 
 /* handle inbound data buffer */
 real_length = amr_ioctl_buffer_length(au_length);
+dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO);
 if (au_length != 0  au_cmd[0] != 0x06) {
-   if ((dp = malloc(real_length, M_AMR, M_WAITOK|M_ZERO)) == NULL) {
-   error = ENOMEM;
-   goto out;
-   }
if ((error = copyin(au_buffer, dp, au_length)) != 0) {
free(dp, M_AMR);
return (error);
@@ -933,8 +936,7 @@ amr_ioctl(struct cdev *dev, u_long cmd, 
error = copyout(dp, au_buffer, au_length);
 }
 debug(2, copyout %ld bytes from %p - %p, au_length, dp, au_buffer);
-if (dp != NULL)
-   debug(2, %p status 0x%x, dp, ac-ac_status);
+debug(2, %p status 0x%x, dp, ac-ac_status);
 *au_statusp = ac-ac_status;
 
 out:
___
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: r247422 - head

2013-02-27 Thread Xin LI
Author: delphij
Date: Wed Feb 27 21:58:06 2013
New Revision: 247422
URL: http://svnweb.freebsd.org/changeset/base/247422

Log:
  Add a reminder that the user should update boot block if they are upgrading
  their existing system and use LZ4 compression for ZFS.
  
  Suggested by: mm
  MFC after:3 days

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Feb 27 21:03:19 2013(r247421)
+++ head/UPDATING   Wed Feb 27 21:58:06 2013(r247422)
@@ -26,6 +26,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
disable the most expensive debugging functionality run
ln -s 'abort:false,junk:false' /etc/malloc.conf.)
 
+20130208:
+   A new compression method (lz4) has been merged to -HEAD.  Please
+   refer to zpool-features(7) for more information.
+
+   Please refer to the ZFS notes section of this file for information
+   on upgrading boot ZFS pools.
+
 20130129:
A BSD-licensed patch(1) variant has been added and is installed
as bsdpatch, being the GNU version the default patch.
___
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: r247423 - stable/9/sys/kern

2013-02-27 Thread John Baldwin
Author: jhb
Date: Wed Feb 27 22:02:40 2013
New Revision: 247423
URL: http://svnweb.freebsd.org/changeset/base/247423

Log:
  MFC 240921:
  Add optional entropy harvesting for software interrupts in swi_sched()
  as controlled by kern.random.sys.harvest.swi.  SWI harvesting feeds into
  the interrupt FIFO and each event is estimated as providing a single bit of
  entropy.

Modified:
  stable/9/sys/kern/kern_intr.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_intr.c
==
--- stable/9/sys/kern/kern_intr.c   Wed Feb 27 21:58:06 2013
(r247422)
+++ stable/9/sys/kern/kern_intr.c   Wed Feb 27 22:02:40 2013
(r247423)
@@ -1144,11 +1144,21 @@ swi_sched(void *cookie, int flags)
 {
struct intr_handler *ih = (struct intr_handler *)cookie;
struct intr_event *ie = ih-ih_event;
+   struct intr_entropy entropy;
int error;
 
CTR3(KTR_INTR, swi_sched: %s %s need=%d, ie-ie_name, ih-ih_name,
ih-ih_need);
 
+   if (harvest.swi) {
+   CTR2(KTR_INTR, swi_sched: pid %d (%s) gathering entropy,
+   curproc-p_pid, curthread-td_name);
+   entropy.event = (uintptr_t)ih;
+   entropy.td = curthread;
+   random_harvest(entropy, sizeof(entropy), 1, 0,
+   RANDOM_INTERRUPT);
+   }
+
/*
 * Set ih_need for this handler so that if the ithread is already
 * running it will execute this handler on the next pass.  Otherwise,
___
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: r247424 - stable/9/sys/net

2013-02-27 Thread John Baldwin
Author: jhb
Date: Wed Feb 27 22:08:18 2013
New Revision: 247424
URL: http://svnweb.freebsd.org/changeset/base/247424

Log:
  MFC 241130:
  Rename the module for 'device enc' to if_enc to avoid conflicting with
  the CAM enc peripheral (part of ses(4)).  Previously the two modules
  used the same name, so only one was included in a linked kernel causing
  enc0 to not be created if you added IPSEC to GENERIC.  The new module
  name follows the pattern of other network interfaces (e.g. if_loop).

Modified:
  stable/9/sys/net/if_enc.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/net/if_enc.c
==
--- stable/9/sys/net/if_enc.c   Wed Feb 27 22:02:40 2013(r247423)
+++ stable/9/sys/net/if_enc.c   Wed Feb 27 22:08:18 2013(r247424)
@@ -179,12 +179,12 @@ enc_modevent(module_t mod, int type, voi
 }
 
 static moduledata_t enc_mod = {
-   enc,
+   if_enc,
enc_modevent,
0
 };
 
-DECLARE_MODULE(enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
+DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
 
 static int
 enc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
___
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: r247426 - head/sys/dev/mfi

2013-02-27 Thread Steven Hartland
Author: smh
Date: Wed Feb 27 23:17:45 2013
New Revision: 247426
URL: http://svnweb.freebsd.org/changeset/base/247426

Log:
  Adds hw.mfi.cmd_timeout loader / sysctl tuneable which controls the default
  timeout used in the mfi driver. This is useful for long running commands
  such as secure erase.
  
  Reviewed by:  John Baldwin
  Approved by:  pjd (mentor)

Modified:
  head/sys/dev/mfi/mfi.c

Modified: head/sys/dev/mfi/mfi.c
==
--- head/sys/dev/mfi/mfi.c  Wed Feb 27 23:02:47 2013(r247425)
+++ head/sys/dev/mfi/mfi.c  Wed Feb 27 23:17:45 2013(r247426)
@@ -157,6 +157,11 @@ SYSCTL_INT(_hw_mfi, OID_AUTO, polled_cmd
   mfi_polled_cmd_timeout, 0,
   Polled command timeout - used for firmware flash etc (in seconds));
 
+static int mfi_cmd_timeout = MFI_CMD_TIMEOUT;
+TUNABLE_INT(hw.mfi.cmd_timeout, mfi_cmd_timeout);
+SYSCTL_INT(_hw_mfi, OID_AUTO, cmd_timeout, CTLFLAG_RWTUN, mfi_cmd_timeout,
+  0, Command timeout (in seconds));
+
 /* Management interface */
 static d_open_tmfi_open;
 static d_close_t   mfi_close;
@@ -782,7 +787,7 @@ mfi_attach(struct mfi_softc *sc)
 
/* Start the timeout watchdog */
callout_init(sc-mfi_watchdog_callout, CALLOUT_MPSAFE);
-   callout_reset(sc-mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz,
+   callout_reset(sc-mfi_watchdog_callout, mfi_cmd_timeout * hz,
mfi_timeout, sc);
 
if (sc-mfi_flags  MFI_FLAGS_TBOLT) {
@@ -3714,7 +3719,7 @@ mfi_dump_all(void)
break;
device_printf(sc-mfi_dev, Dumping\n\n);
timedout = 0;
-   deadline = time_uptime - MFI_CMD_TIMEOUT;
+   deadline = time_uptime - mfi_cmd_timeout;
mtx_lock(sc-mfi_io_lock);
TAILQ_FOREACH(cm, sc-mfi_busy, cm_link) {
if (cm-cm_timestamp = deadline) {
@@ -3745,10 +3750,11 @@ mfi_timeout(void *data)
time_t deadline;
int timedout = 0;
 
-   deadline = time_uptime - MFI_CMD_TIMEOUT;
+   deadline = time_uptime - mfi_cmd_timeout;
if (sc-adpreset == 0) {
if (!mfi_tbolt_reset(sc)) {
-   callout_reset(sc-mfi_watchdog_callout, 
MFI_CMD_TIMEOUT * hz, mfi_timeout, sc);
+   callout_reset(sc-mfi_watchdog_callout,
+   mfi_cmd_timeout * hz, mfi_timeout, sc);
return;
}
}
@@ -3785,7 +3791,7 @@ mfi_timeout(void *data)
 
mtx_unlock(sc-mfi_io_lock);
 
-   callout_reset(sc-mfi_watchdog_callout, MFI_CMD_TIMEOUT * hz,
+   callout_reset(sc-mfi_watchdog_callout, mfi_cmd_timeout * hz,
mfi_timeout, sc);
 
if (0)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r247359 - head/sbin/reboot

2013-02-27 Thread Daniel O'Connor

On 28/02/2013, at 3:08, John Baldwin j...@freebsd.org wrote:
 URL: http://svnweb.freebsd.org/changeset/base/247359
 
 Log:
  Clarify that overriding the -h/-D flags through flags in device.hints
  only works for sio(4) but not for uart(4) which no longer has this flag.
 
 You should probably just remove the flag entirely.  sio(4) doesn't build on 
 8.x and later.


The handbook will need fixing too since it mentions sio(4) and -D/-h.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C






___
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: r247429 - in head/sys/arm: econa s3c2xx0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa

2013-02-27 Thread Attilio Rao
Author: attilio
Date: Thu Feb 28 00:18:56 2013
New Revision: 247429
URL: http://svnweb.freebsd.org/changeset/base/247429

Log:
  Complete r247297:
  Remove unused inclusions of vm/vm_pager.h and vm/vnode_pager.h.
  
  Sponsored by: EMC / Isilon storage division

Modified:
  head/sys/arm/econa/econa_machdep.c
  head/sys/arm/s3c2xx0/s3c24x0_machdep.c
  head/sys/arm/xscale/i80321/ep80219_machdep.c
  head/sys/arm/xscale/i80321/iq31244_machdep.c
  head/sys/arm/xscale/i8134x/crb_machdep.c
  head/sys/arm/xscale/ixp425/avila_machdep.c
  head/sys/arm/xscale/pxa/pxa_machdep.c

Modified: head/sys/arm/econa/econa_machdep.c
==
--- head/sys/arm/econa/econa_machdep.c  Thu Feb 28 00:14:59 2013
(r247428)
+++ head/sys/arm/econa/econa_machdep.c  Thu Feb 28 00:18:56 2013
(r247429)
@@ -67,9 +67,7 @@ __FBSDID($FreeBSD$);
 #include vm/pmap.h
 #include vm/vm_object.h
 #include vm/vm_page.h
-#include vm/vm_pager.h
 #include vm/vm_map.h
-#include vm/vnode_pager.h
 #include machine/pmap.h
 #include machine/vmparam.h
 #include machine/pcb.h

Modified: head/sys/arm/s3c2xx0/s3c24x0_machdep.c
==
--- head/sys/arm/s3c2xx0/s3c24x0_machdep.c  Thu Feb 28 00:14:59 2013
(r247428)
+++ head/sys/arm/s3c2xx0/s3c24x0_machdep.c  Thu Feb 28 00:18:56 2013
(r247429)
@@ -77,9 +77,7 @@ __FBSDID($FreeBSD$);
 #include vm/pmap.h
 #include vm/vm_object.h
 #include vm/vm_page.h
-#include vm/vm_pager.h
 #include vm/vm_map.h
-#include vm/vnode_pager.h
 #include machine/pmap.h
 #include machine/vmparam.h
 #include machine/pcb.h

Modified: head/sys/arm/xscale/i80321/ep80219_machdep.c
==
--- head/sys/arm/xscale/i80321/ep80219_machdep.cThu Feb 28 00:14:59 
2013(r247428)
+++ head/sys/arm/xscale/i80321/ep80219_machdep.cThu Feb 28 00:18:56 
2013(r247429)
@@ -77,9 +77,7 @@ __FBSDID($FreeBSD$);
 #include vm/pmap.h
 #include vm/vm_object.h
 #include vm/vm_page.h
-#include vm/vm_pager.h
 #include vm/vm_map.h
-#include vm/vnode_pager.h
 #include machine/pmap.h
 #include machine/vmparam.h
 #include machine/pcb.h

Modified: head/sys/arm/xscale/i80321/iq31244_machdep.c
==
--- head/sys/arm/xscale/i80321/iq31244_machdep.cThu Feb 28 00:14:59 
2013(r247428)
+++ head/sys/arm/xscale/i80321/iq31244_machdep.cThu Feb 28 00:18:56 
2013(r247429)
@@ -77,9 +77,7 @@ __FBSDID($FreeBSD$);
 #include vm/pmap.h
 #include vm/vm_object.h
 #include vm/vm_page.h
-#include vm/vm_pager.h
 #include vm/vm_map.h
-#include vm/vnode_pager.h
 #include machine/pmap.h
 #include machine/vmparam.h
 #include machine/pcb.h

Modified: head/sys/arm/xscale/i8134x/crb_machdep.c
==
--- head/sys/arm/xscale/i8134x/crb_machdep.cThu Feb 28 00:14:59 2013
(r247428)
+++ head/sys/arm/xscale/i8134x/crb_machdep.cThu Feb 28 00:18:56 2013
(r247429)
@@ -77,9 +77,7 @@ __FBSDID($FreeBSD$);
 #include vm/pmap.h
 #include vm/vm_object.h
 #include vm/vm_page.h
-#include vm/vm_pager.h
 #include vm/vm_map.h
-#include vm/vnode_pager.h
 #include machine/pmap.h
 #include machine/vmparam.h
 #include machine/pcb.h

Modified: head/sys/arm/xscale/ixp425/avila_machdep.c
==
--- head/sys/arm/xscale/ixp425/avila_machdep.c  Thu Feb 28 00:14:59 2013
(r247428)
+++ head/sys/arm/xscale/ixp425/avila_machdep.c  Thu Feb 28 00:18:56 2013
(r247429)
@@ -77,9 +77,7 @@ __FBSDID($FreeBSD$);
 #include vm/pmap.h
 #include vm/vm_object.h
 #include vm/vm_page.h
-#include vm/vm_pager.h
 #include vm/vm_map.h
-#include vm/vnode_pager.h
 #include machine/pmap.h
 #include machine/vmparam.h
 #include machine/pcb.h

Modified: head/sys/arm/xscale/pxa/pxa_machdep.c
==
--- head/sys/arm/xscale/pxa/pxa_machdep.c   Thu Feb 28 00:14:59 2013
(r247428)
+++ head/sys/arm/xscale/pxa/pxa_machdep.c   Thu Feb 28 00:18:56 2013
(r247429)
@@ -79,9 +79,7 @@ __FBSDID($FreeBSD$);
 #include vm/pmap.h
 #include vm/vm_object.h
 #include vm/vm_page.h
-#include vm/vm_pager.h
 #include vm/vm_map.h
-#include vm/vnode_pager.h
 #include machine/pmap.h
 #include machine/vmparam.h
 #include machine/pcb.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em modules/igb

2013-02-27 Thread Jack F Vogel
Author: jfv
Date: Thu Feb 28 00:22:04 2013
New Revision: 247430
URL: http://svnweb.freebsd.org/changeset/base/247430

Log:
  MFC of the E1000 drivers to STABLE/8, this includes the follow revisions
  plus a few tweaks:
   196969,196970,211516,214646,215781,215789,215808,215910,223350,
   223482,223831,228281,228393,229939,231796,232238,234665,235256,
   236406,238148,238151,238214,238765,238770,238953,238981,239105,
   239109,239304,240518,240693,240968,241037,241856,241885,243570,
   243857,245334,246128,246482,247064

Added:
  stable/8/sys/dev/e1000/e1000_i210.c
 - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c
  stable/8/sys/dev/e1000/e1000_i210.h
 - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h
Modified:
  stable/8/sys/conf/files
  stable/8/sys/dev/e1000/e1000_82541.c
  stable/8/sys/dev/e1000/e1000_82543.c
  stable/8/sys/dev/e1000/e1000_82571.c
  stable/8/sys/dev/e1000/e1000_82575.c
  stable/8/sys/dev/e1000/e1000_82575.h
  stable/8/sys/dev/e1000/e1000_api.c
  stable/8/sys/dev/e1000/e1000_api.h
  stable/8/sys/dev/e1000/e1000_defines.h
  stable/8/sys/dev/e1000/e1000_hw.h
  stable/8/sys/dev/e1000/e1000_ich8lan.c
  stable/8/sys/dev/e1000/e1000_ich8lan.h
  stable/8/sys/dev/e1000/e1000_mac.c
  stable/8/sys/dev/e1000/e1000_mac.h
  stable/8/sys/dev/e1000/e1000_manage.c
  stable/8/sys/dev/e1000/e1000_manage.h
  stable/8/sys/dev/e1000/e1000_nvm.c
  stable/8/sys/dev/e1000/e1000_nvm.h
  stable/8/sys/dev/e1000/e1000_osdep.h
  stable/8/sys/dev/e1000/e1000_phy.c
  stable/8/sys/dev/e1000/e1000_phy.h
  stable/8/sys/dev/e1000/e1000_regs.h
  stable/8/sys/dev/e1000/if_em.c   (contents, props changed)
  stable/8/sys/dev/e1000/if_igb.c   (contents, props changed)
  stable/8/sys/dev/e1000/if_igb.h
  stable/8/sys/dev/e1000/if_lem.c
  stable/8/sys/modules/em/Makefile
  stable/8/sys/modules/igb/Makefile
Directory Properties:
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/conf/files
==
--- stable/8/sys/conf/files Thu Feb 28 00:18:56 2013(r247429)
+++ stable/8/sys/conf/files Thu Feb 28 00:22:04 2013(r247430)
@@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c optional em | i
compile-with ${NORMAL_C} -I$S/dev/e1000
 dev/e1000/e1000_ich8lan.c  optional em | igb \
compile-with ${NORMAL_C} -I$S/dev/e1000
+dev/e1000/e1000_i210.c optional em | igb \
+   compile-with ${NORMAL_C} -I$S/dev/e1000
 dev/e1000/e1000_api.c  optional em | igb \
compile-with ${NORMAL_C} -I$S/dev/e1000
 dev/e1000/e1000_mac.c  optional em | igb \

Modified: stable/8/sys/dev/e1000/e1000_82541.c
==
--- stable/8/sys/dev/e1000/e1000_82541.cThu Feb 28 00:18:56 2013
(r247429)
+++ stable/8/sys/dev/e1000/e1000_82541.cThu Feb 28 00:22:04 2013
(r247430)
@@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st
 * of MAC speed/duplex configuration.  So we only need to
 * configure Collision Distance in the MAC.
 */
-   e1000_config_collision_dist_generic(hw);
+   mac-ops.config_collision_dist(hw);
 
/*
 * Configure Flow Control now that Auto-Neg has completed.

Modified: stable/8/sys/dev/e1000/e1000_82543.c
==
--- stable/8/sys/dev/e1000/e1000_82543.cThu Feb 28 00:18:56 2013
(r247429)
+++ stable/8/sys/dev/e1000/e1000_82543.cThu Feb 28 00:22:04 2013
(r247430)
@@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543
DEBUGOUT(Valid link established!!!\n);
/* Config the MAC and PHY after link is up */
if (hw-mac.type == e1000_82544) {
-   e1000_config_collision_dist_generic(hw);
+   hw-mac.ops.config_collision_dist(hw);
} else {
ret_val = e1000_config_mac_to_phy_82543(hw);
if (ret_val)
@@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543(
/* Take the link out of reset */
ctrl = ~E1000_CTRL_LRST;
 
-   e1000_config_collision_dist_generic(hw);
+   hw-mac.ops.config_collision_dist(hw);
 
ret_val = e1000_commit_fc_settings_generic(hw);
if (ret_val)
@@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8
 * settings.
 */
if (mac-type == e1000_82544)
-   e1000_config_collision_dist_generic(hw);
+   hw-mac.ops.config_collision_dist(hw);
else {
ret_val = e1000_config_mac_to_phy_82543(hw);
if (ret_val) {
@@ -1433,7 +1433,7 @@ static s32 e1000_config_mac_to_phy_82543
if (phy_data  M88E1000_PSSR_DPLX)
ctrl |= E1000_CTRL_FD;
 
-   e1000_config_collision_dist_generic(hw);
+   

svn commit: r247438 - head/sys/dev/pci

2013-02-27 Thread Neel Natu
Author: neel
Date: Thu Feb 28 01:00:32 2013
New Revision: 247438
URL: http://svnweb.freebsd.org/changeset/base/247438

Log:
  Remove the quirk to allow use of MSI when the guest is running inside bhyve.
  
  This became redundant after the hostbridge presented to the guest started
  advertising the PCI-E capability (r246846).
  
  Obtained from:NetApp

Modified:
  head/sys/dev/pci/pci.c

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Thu Feb 28 00:52:44 2013(r247437)
+++ head/sys/dev/pci/pci.c  Thu Feb 28 01:00:32 2013(r247438)
@@ -244,7 +244,6 @@ static const struct pci_quirk pci_quirks
 * but support MSI just fine.  QEMU uses the Intel 82440.
 */
{ 0x12378086, PCI_QUIRK_ENABLE_MSI_VM,  0,  0 },
-   { 0x12751275, PCI_QUIRK_ENABLE_MSI_VM,  0,  0 },/* bhyve */
 
/*
 * HPET MMIO base address may appear in Bar1 for AMD SB600 SMBus
___
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: r247441 - head/usr.bin/dc

2013-02-27 Thread Glen Barber
Author: gjb (doc,ports committer)
Date: Thu Feb 28 01:22:14 2013
New Revision: 247441
URL: http://svnweb.freebsd.org/changeset/base/247441

Log:
  Properly handle '-h' argument.
  
  PR:   176332
  Reviewed by:  scottl
  MFC after:3 days

Modified:
  head/usr.bin/dc/dc.c

Modified: head/usr.bin/dc/dc.c
==
--- head/usr.bin/dc/dc.cThu Feb 28 01:05:48 2013(r247440)
+++ head/usr.bin/dc/dc.cThu Feb 28 01:22:14 2013(r247441)
@@ -84,7 +84,7 @@ main(int argc, char *argv[])
bool extended_regs = false, preproc_done = false;
 
/* accept and ignore a single dash to be 4.4BSD dc(1) compatible */
-   while ((ch = getopt_long(argc, argv, e:f:Vx, long_options, NULL)) != 
-1) {
+   while ((ch = getopt_long(argc, argv, e:f:hVx, long_options, NULL)) != 
-1) {
switch (ch) {
case 'e':
if (!preproc_done)
___
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: r247442 - head/contrib/openbsm/bin/auditdistd

2013-02-27 Thread Pawel Jakub Dawidek
Author: pjd
Date: Thu Feb 28 01:24:24 2013
New Revision: 247442
URL: http://svnweb.freebsd.org/changeset/base/247442

Log:
  When we are waiting for new trail files we may have been disconnected and
  reconnected in the meantime. Check if reset is set before opening next trail
  file, as not doing so will result in sending OPEN message with the same
  file name twice and this is illegal - the second OPEN is send without first
  closing previous trail file.

Modified:
  head/contrib/openbsm/bin/auditdistd/sender.c

Modified: head/contrib/openbsm/bin/auditdistd/sender.c
==
--- head/contrib/openbsm/bin/auditdistd/sender.cThu Feb 28 01:22:14 
2013(r247441)
+++ head/contrib/openbsm/bin/auditdistd/sender.cThu Feb 28 01:24:24 
2013(r247442)
@@ -394,6 +394,7 @@ read_thread_wait(void)
 
mtx_lock(adist_remote_mtx);
if (adhost-adh_reset) {
+reset:
adhost-adh_reset = false;
if (trail_filefd(adist_trail) != -1)
trail_close(adist_trail);
@@ -408,6 +409,14 @@ read_thread_wait(void)
while (trail_filefd(adist_trail) == -1) {
newfile = true;
wait_for_dir();
+   /*
+* We may have been disconnected and reconnected in the
+* meantime, check if reset is set.
+*/
+   mtx_lock(adist_remote_mtx);
+   if (adhost-adh_reset)
+   goto reset;
+   mtx_unlock(adist_remote_mtx);
if (trail_filefd(adist_trail) == -1)
trail_next(adist_trail);
}
___
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: r247430 - in stable/8/sys: conf dev/e1000 modules/em modules/igb

2013-02-27 Thread Glen Barber
Jack,

This commit seems to break the build for at least powerpc and sparc64.

Glen

On Thu, Feb 28, 2013 at 12:22:04AM +, Jack F Vogel wrote:
 Author: jfv
 Date: Thu Feb 28 00:22:04 2013
 New Revision: 247430
 URL: http://svnweb.freebsd.org/changeset/base/247430
 
 Log:
   MFC of the E1000 drivers to STABLE/8, this includes the follow revisions
   plus a few tweaks:
196969,196970,211516,214646,215781,215789,215808,215910,223350,
223482,223831,228281,228393,229939,231796,232238,234665,235256,
236406,238148,238151,238214,238765,238770,238953,238981,239105,
239109,239304,240518,240693,240968,241037,241856,241885,243570,
243857,245334,246128,246482,247064
 
 Added:
   stable/8/sys/dev/e1000/e1000_i210.c
  - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c
   stable/8/sys/dev/e1000/e1000_i210.h
  - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h
 Modified:
   stable/8/sys/conf/files
   stable/8/sys/dev/e1000/e1000_82541.c
   stable/8/sys/dev/e1000/e1000_82543.c
   stable/8/sys/dev/e1000/e1000_82571.c
   stable/8/sys/dev/e1000/e1000_82575.c
   stable/8/sys/dev/e1000/e1000_82575.h
   stable/8/sys/dev/e1000/e1000_api.c
   stable/8/sys/dev/e1000/e1000_api.h
   stable/8/sys/dev/e1000/e1000_defines.h
   stable/8/sys/dev/e1000/e1000_hw.h
   stable/8/sys/dev/e1000/e1000_ich8lan.c
   stable/8/sys/dev/e1000/e1000_ich8lan.h
   stable/8/sys/dev/e1000/e1000_mac.c
   stable/8/sys/dev/e1000/e1000_mac.h
   stable/8/sys/dev/e1000/e1000_manage.c
   stable/8/sys/dev/e1000/e1000_manage.h
   stable/8/sys/dev/e1000/e1000_nvm.c
   stable/8/sys/dev/e1000/e1000_nvm.h
   stable/8/sys/dev/e1000/e1000_osdep.h
   stable/8/sys/dev/e1000/e1000_phy.c
   stable/8/sys/dev/e1000/e1000_phy.h
   stable/8/sys/dev/e1000/e1000_regs.h
   stable/8/sys/dev/e1000/if_em.c   (contents, props changed)
   stable/8/sys/dev/e1000/if_igb.c   (contents, props changed)
   stable/8/sys/dev/e1000/if_igb.h
   stable/8/sys/dev/e1000/if_lem.c
   stable/8/sys/modules/em/Makefile
   stable/8/sys/modules/igb/Makefile
 Directory Properties:
   stable/8/sys/dev/e1000/   (props changed)
 
 Modified: stable/8/sys/conf/files
 ==
 --- stable/8/sys/conf/files   Thu Feb 28 00:18:56 2013(r247429)
 +++ stable/8/sys/conf/files   Thu Feb 28 00:22:04 2013(r247430)
 @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c   optional em | i
   compile-with ${NORMAL_C} -I$S/dev/e1000
  dev/e1000/e1000_ich8lan.coptional em | igb \
   compile-with ${NORMAL_C} -I$S/dev/e1000
 +dev/e1000/e1000_i210.c   optional em | igb \
 + compile-with ${NORMAL_C} -I$S/dev/e1000
  dev/e1000/e1000_api.coptional em | igb \
   compile-with ${NORMAL_C} -I$S/dev/e1000
  dev/e1000/e1000_mac.coptional em | igb \
 
 Modified: stable/8/sys/dev/e1000/e1000_82541.c
 ==
 --- stable/8/sys/dev/e1000/e1000_82541.c  Thu Feb 28 00:18:56 2013
 (r247429)
 +++ stable/8/sys/dev/e1000/e1000_82541.c  Thu Feb 28 00:22:04 2013
 (r247430)
 @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st
* of MAC speed/duplex configuration.  So we only need to
* configure Collision Distance in the MAC.
*/
 - e1000_config_collision_dist_generic(hw);
 + mac-ops.config_collision_dist(hw);
  
   /*
* Configure Flow Control now that Auto-Neg has completed.
 
 Modified: stable/8/sys/dev/e1000/e1000_82543.c
 ==
 --- stable/8/sys/dev/e1000/e1000_82543.c  Thu Feb 28 00:18:56 2013
 (r247429)
 +++ stable/8/sys/dev/e1000/e1000_82543.c  Thu Feb 28 00:22:04 2013
 (r247430)
 @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543
   DEBUGOUT(Valid link established!!!\n);
   /* Config the MAC and PHY after link is up */
   if (hw-mac.type == e1000_82544) {
 - e1000_config_collision_dist_generic(hw);
 + hw-mac.ops.config_collision_dist(hw);
   } else {
   ret_val = e1000_config_mac_to_phy_82543(hw);
   if (ret_val)
 @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543(
   /* Take the link out of reset */
   ctrl = ~E1000_CTRL_LRST;
  
 - e1000_config_collision_dist_generic(hw);
 + hw-mac.ops.config_collision_dist(hw);
  
   ret_val = e1000_commit_fc_settings_generic(hw);
   if (ret_val)
 @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8
* settings.
*/
   if (mac-type == e1000_82544)
 - e1000_config_collision_dist_generic(hw);
 + hw-mac.ops.config_collision_dist(hw);
   else {
   ret_val = e1000_config_mac_to_phy_82543(hw);
   if (ret_val) {
 @@ -1433,7 

svn commit: r247443 - in head: share/man/man4 sys/dev/arcmsr

2013-02-27 Thread Xin LI
Author: delphij
Date: Thu Feb 28 04:16:47 2013
New Revision: 247443
URL: http://svnweb.freebsd.org/changeset/base/247443

Log:
  Refresh vendor driver version which adds ARC-1224 support.
  
  Many thanks to Areca for continuing to support FreeBSD.
  
  Submitted by: 黃清隆 ching2048 areca com tw
  MFC after:3 days

Modified:
  head/share/man/man4/arcmsr.4
  head/sys/dev/arcmsr/arcmsr.c
  head/sys/dev/arcmsr/arcmsr.h

Modified: head/share/man/man4/arcmsr.4
==
--- head/share/man/man4/arcmsr.4Thu Feb 28 01:24:24 2013
(r247442)
+++ head/share/man/man4/arcmsr.4Thu Feb 28 04:16:47 2013
(r247443)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd December 18, 2012
+.Dd February 27, 2013
 .Dt ARCMSR 4
 .Os
 .Sh NAME
@@ -108,6 +108,8 @@ ARC-1222
 .It
 ARC-1223
 .It
+ARC-1224
+.It
 ARC-1230
 .It
 ARC-1231

Modified: head/sys/dev/arcmsr/arcmsr.c
==
--- head/sys/dev/arcmsr/arcmsr.cThu Feb 28 01:24:24 2013
(r247442)
+++ head/sys/dev/arcmsr/arcmsr.cThu Feb 28 04:16:47 2013
(r247443)
@@ -1,16 +1,15 @@
 /*
-*
-**O.S   : FreeBSD
+
+**OS: FreeBSD
 **   FILE NAME  : arcmsr.c
 **BY: Erich Chen, Ching Huang
 **   Description: SCSI RAID Device Driver for 
-**ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x) SATA/SAS 
RAID HOST Adapter
-**ARCMSR RAID Host adapter
-**[RAID controller:INTEL 331(PCI-X) 341(PCI-EXPRESS) chip set]
-**
-
+**ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x)
+**SATA/SAS RAID HOST Adapter
+
+
 **
-** Copyright (C) 2002 - 2010, Areca Technology Corporation All rights reserved.
+** Copyright (C) 2002 - 2012, Areca Technology Corporation All rights reserved.
 **
 ** Redistribution and use in source and binary forms, with or without
 ** modification, are permitted provided that the following conditions
@@ -33,7 +32,7 @@
 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 **(INCLUDING NEGLIGENCE OR OTHERWISE)ARISING IN ANY WAY OUT OF THE USE OF
 ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-**
+
 ** History
 **
 **REV# DATE NAME DESCRIPTION
@@ -73,7 +72,7 @@
 ** 1.20.00.23   01/30/2012  Ching Huang  Fixed Request 
requeued and Retrying command
 ** 1.20.00.24   06/11/2012  Ching Huang  Fixed return sense 
data condition
 ** 1.20.00.25   08/17/2012  Ching Huang  Fixed hotplug device 
no function on type A adapter
-** 1.20.00.26   12/14/2012  Ching Huang  Added support ARC1214
+** 1.20.00.26   12/14/2012  Ching Huang  Added support 
ARC1214,1224
 
**
 */
 
@@ -145,7 +144,7 @@ __FBSDID($FreeBSD$);
 #define arcmsr_callout_init(a) callout_init(a);
 #endif
 
-#define ARCMSR_DRIVER_VERSION  Driver Version 1.20.00.26 2012-12-14
+#define ARCMSR_DRIVER_VERSION  Driver Version 1.20.00.26 2013-01-08
 #include dev/arcmsr/arcmsr.h
 /*
 **
@@ -168,7 +167,7 @@ static void arcmsr_stop_adapter_bgrb(str
 static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb);
 static void arcmsr_iop_init(struct AdapterControlBlock *acb);
 static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb);
-static voidarcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock *acb, 
struct QBUFFER *prbuffer);
+static u_int32_t arcmsr_Read_iop_rqbuffer_data(struct AdapterControlBlock 
*acb, struct QBUFFER *prbuffer);
 static void arcmsr_Write_data_2iop_wqbuffer(struct AdapterControlBlock *acb);
 static void arcmsr_abort_allcmd(struct AdapterControlBlock *acb);
 static void arcmsr_srb_complete(struct CommandControlBlock *srb, int 
stand_flag);
@@ -212,7 +211,11 @@ static device_method_t arcmsr_methods[]=
DEVMETHOD(device_suspend,   arcmsr_suspend),
DEVMETHOD(device_resume,arcmsr_resume),
 
+#if __FreeBSD_version = 803000
DEVMETHOD_END
+#else
+   { 0, 0 }
+#endif
 };

 static driver_t arcmsr_driver={
@@ -1381,13 

Re: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em modules/igb

2013-02-27 Thread Jack Vogel
Oh, that's odd, then HEAD should be broken too, do you have more detail?

Jack


On Wed, Feb 27, 2013 at 6:23 PM, Glen Barber g...@freebsd.org wrote:

 Jack,

 This commit seems to break the build for at least powerpc and sparc64.

 Glen

 On Thu, Feb 28, 2013 at 12:22:04AM +, Jack F Vogel wrote:
  Author: jfv
  Date: Thu Feb 28 00:22:04 2013
  New Revision: 247430
  URL: http://svnweb.freebsd.org/changeset/base/247430
 
  Log:
MFC of the E1000 drivers to STABLE/8, this includes the follow
 revisions
plus a few tweaks:
 196969,196970,211516,214646,215781,215789,215808,215910,223350,
 223482,223831,228281,228393,229939,231796,232238,234665,235256,
 236406,238148,238151,238214,238765,238770,238953,238981,239105,
 239109,239304,240518,240693,240968,241037,241856,241885,243570,
 243857,245334,246128,246482,247064
 
  Added:
stable/8/sys/dev/e1000/e1000_i210.c
   - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c
stable/8/sys/dev/e1000/e1000_i210.h
   - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h
  Modified:
stable/8/sys/conf/files
stable/8/sys/dev/e1000/e1000_82541.c
stable/8/sys/dev/e1000/e1000_82543.c
stable/8/sys/dev/e1000/e1000_82571.c
stable/8/sys/dev/e1000/e1000_82575.c
stable/8/sys/dev/e1000/e1000_82575.h
stable/8/sys/dev/e1000/e1000_api.c
stable/8/sys/dev/e1000/e1000_api.h
stable/8/sys/dev/e1000/e1000_defines.h
stable/8/sys/dev/e1000/e1000_hw.h
stable/8/sys/dev/e1000/e1000_ich8lan.c
stable/8/sys/dev/e1000/e1000_ich8lan.h
stable/8/sys/dev/e1000/e1000_mac.c
stable/8/sys/dev/e1000/e1000_mac.h
stable/8/sys/dev/e1000/e1000_manage.c
stable/8/sys/dev/e1000/e1000_manage.h
stable/8/sys/dev/e1000/e1000_nvm.c
stable/8/sys/dev/e1000/e1000_nvm.h
stable/8/sys/dev/e1000/e1000_osdep.h
stable/8/sys/dev/e1000/e1000_phy.c
stable/8/sys/dev/e1000/e1000_phy.h
stable/8/sys/dev/e1000/e1000_regs.h
stable/8/sys/dev/e1000/if_em.c   (contents, props changed)
stable/8/sys/dev/e1000/if_igb.c   (contents, props changed)
stable/8/sys/dev/e1000/if_igb.h
stable/8/sys/dev/e1000/if_lem.c
stable/8/sys/modules/em/Makefile
stable/8/sys/modules/igb/Makefile
  Directory Properties:
stable/8/sys/dev/e1000/   (props changed)
 
  Modified: stable/8/sys/conf/files
 
 ==
  --- stable/8/sys/conf/files   Thu Feb 28 00:18:56 2013(r247429)
  +++ stable/8/sys/conf/files   Thu Feb 28 00:22:04 2013(r247430)
  @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c   optional em | i
compile-with ${NORMAL_C} -I$S/dev/e1000
   dev/e1000/e1000_ich8lan.coptional em | igb \
compile-with ${NORMAL_C} -I$S/dev/e1000
  +dev/e1000/e1000_i210.c   optional em | igb \
  + compile-with ${NORMAL_C} -I$S/dev/e1000
   dev/e1000/e1000_api.coptional em | igb \
compile-with ${NORMAL_C} -I$S/dev/e1000
   dev/e1000/e1000_mac.coptional em | igb \
 
  Modified: stable/8/sys/dev/e1000/e1000_82541.c
 
 ==
  --- stable/8/sys/dev/e1000/e1000_82541.c  Thu Feb 28 00:18:56 2013
  (r247429)
  +++ stable/8/sys/dev/e1000/e1000_82541.c  Thu Feb 28 00:22:04 2013
  (r247430)
  @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st
 * of MAC speed/duplex configuration.  So we only need to
 * configure Collision Distance in the MAC.
 */
  - e1000_config_collision_dist_generic(hw);
  + mac-ops.config_collision_dist(hw);
 
/*
 * Configure Flow Control now that Auto-Neg has completed.
 
  Modified: stable/8/sys/dev/e1000/e1000_82543.c
 
 ==
  --- stable/8/sys/dev/e1000/e1000_82543.c  Thu Feb 28 00:18:56 2013
  (r247429)
  +++ stable/8/sys/dev/e1000/e1000_82543.c  Thu Feb 28 00:22:04 2013
  (r247430)
  @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543
DEBUGOUT(Valid link established!!!\n);
/* Config the MAC and PHY after link is up */
if (hw-mac.type == e1000_82544) {
  - e1000_config_collision_dist_generic(hw);
  + hw-mac.ops.config_collision_dist(hw);
} else {
ret_val = e1000_config_mac_to_phy_82543(hw);
if (ret_val)
  @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543(
/* Take the link out of reset */
ctrl = ~E1000_CTRL_LRST;
 
  - e1000_config_collision_dist_generic(hw);
  + hw-mac.ops.config_collision_dist(hw);
 
ret_val = e1000_commit_fc_settings_generic(hw);
if (ret_val)
  @@ -1259,7 +1259,7 @@ static s32 e1000_check_for_copper_link_8
 * settings.
 */
if (mac-type == 

Re: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em modules/igb

2013-02-27 Thread Jack Vogel
LOL, I would see the messages just as I sent this, never mind.

Jack


On Wed, Feb 27, 2013 at 9:39 PM, Jack Vogel jfvo...@gmail.com wrote:

 Oh, that's odd, then HEAD should be broken too, do you have more detail?

 Jack


 On Wed, Feb 27, 2013 at 6:23 PM, Glen Barber g...@freebsd.org wrote:

 Jack,

 This commit seems to break the build for at least powerpc and sparc64.

 Glen

 On Thu, Feb 28, 2013 at 12:22:04AM +, Jack F Vogel wrote:
  Author: jfv
  Date: Thu Feb 28 00:22:04 2013
  New Revision: 247430
  URL: http://svnweb.freebsd.org/changeset/base/247430
 
  Log:
MFC of the E1000 drivers to STABLE/8, this includes the follow
 revisions
plus a few tweaks:
 196969,196970,211516,214646,215781,215789,215808,215910,223350,
 223482,223831,228281,228393,229939,231796,232238,234665,235256,
 236406,238148,238151,238214,238765,238770,238953,238981,239105,
 239109,239304,240518,240693,240968,241037,241856,241885,243570,
 243857,245334,246128,246482,247064
 
  Added:
stable/8/sys/dev/e1000/e1000_i210.c
   - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c
stable/8/sys/dev/e1000/e1000_i210.h
   - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h
  Modified:
stable/8/sys/conf/files
stable/8/sys/dev/e1000/e1000_82541.c
stable/8/sys/dev/e1000/e1000_82543.c
stable/8/sys/dev/e1000/e1000_82571.c
stable/8/sys/dev/e1000/e1000_82575.c
stable/8/sys/dev/e1000/e1000_82575.h
stable/8/sys/dev/e1000/e1000_api.c
stable/8/sys/dev/e1000/e1000_api.h
stable/8/sys/dev/e1000/e1000_defines.h
stable/8/sys/dev/e1000/e1000_hw.h
stable/8/sys/dev/e1000/e1000_ich8lan.c
stable/8/sys/dev/e1000/e1000_ich8lan.h
stable/8/sys/dev/e1000/e1000_mac.c
stable/8/sys/dev/e1000/e1000_mac.h
stable/8/sys/dev/e1000/e1000_manage.c
stable/8/sys/dev/e1000/e1000_manage.h
stable/8/sys/dev/e1000/e1000_nvm.c
stable/8/sys/dev/e1000/e1000_nvm.h
stable/8/sys/dev/e1000/e1000_osdep.h
stable/8/sys/dev/e1000/e1000_phy.c
stable/8/sys/dev/e1000/e1000_phy.h
stable/8/sys/dev/e1000/e1000_regs.h
stable/8/sys/dev/e1000/if_em.c   (contents, props changed)
stable/8/sys/dev/e1000/if_igb.c   (contents, props changed)
stable/8/sys/dev/e1000/if_igb.h
stable/8/sys/dev/e1000/if_lem.c
stable/8/sys/modules/em/Makefile
stable/8/sys/modules/igb/Makefile
  Directory Properties:
stable/8/sys/dev/e1000/   (props changed)
 
  Modified: stable/8/sys/conf/files
 
 ==
  --- stable/8/sys/conf/files   Thu Feb 28 00:18:56 2013(r247429)
  +++ stable/8/sys/conf/files   Thu Feb 28 00:22:04 2013(r247430)
  @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c   optional em | i
compile-with ${NORMAL_C} -I$S/dev/e1000
   dev/e1000/e1000_ich8lan.coptional em | igb \
compile-with ${NORMAL_C} -I$S/dev/e1000
  +dev/e1000/e1000_i210.c   optional em | igb \
  + compile-with ${NORMAL_C} -I$S/dev/e1000
   dev/e1000/e1000_api.coptional em | igb \
compile-with ${NORMAL_C} -I$S/dev/e1000
   dev/e1000/e1000_mac.coptional em | igb \
 
  Modified: stable/8/sys/dev/e1000/e1000_82541.c
 
 ==
  --- stable/8/sys/dev/e1000/e1000_82541.c  Thu Feb 28 00:18:56 2013
(r247429)
  +++ stable/8/sys/dev/e1000/e1000_82541.c  Thu Feb 28 00:22:04 2013
(r247430)
  @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st
 * of MAC speed/duplex configuration.  So we only need to
 * configure Collision Distance in the MAC.
 */
  - e1000_config_collision_dist_generic(hw);
  + mac-ops.config_collision_dist(hw);
 
/*
 * Configure Flow Control now that Auto-Neg has completed.
 
  Modified: stable/8/sys/dev/e1000/e1000_82543.c
 
 ==
  --- stable/8/sys/dev/e1000/e1000_82543.c  Thu Feb 28 00:18:56 2013
(r247429)
  +++ stable/8/sys/dev/e1000/e1000_82543.c  Thu Feb 28 00:22:04 2013
(r247430)
  @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543
DEBUGOUT(Valid link established!!!\n);
/* Config the MAC and PHY after link is up */
if (hw-mac.type == e1000_82544) {
  - e1000_config_collision_dist_generic(hw);
  + hw-mac.ops.config_collision_dist(hw);
} else {
ret_val = e1000_config_mac_to_phy_82543(hw);
if (ret_val)
  @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543(
/* Take the link out of reset */
ctrl = ~E1000_CTRL_LRST;
 
  - e1000_config_collision_dist_generic(hw);
  + hw-mac.ops.config_collision_dist(hw);
 
ret_val = 

svn commit: r247448 - stable/8/contrib/bzip2

2013-02-27 Thread Xin LI
Author: delphij
Date: Thu Feb 28 05:47:50 2013
New Revision: 247448
URL: http://svnweb.freebsd.org/changeset/base/247448

Log:
  MFC r215041 (obrien):
  
  Upgrade to bzip2 version 1.0.6.

Modified:
  stable/8/contrib/bzip2/CHANGES
  stable/8/contrib/bzip2/LICENSE
  stable/8/contrib/bzip2/Makefile
  stable/8/contrib/bzip2/Makefile-libbz2_so
  stable/8/contrib/bzip2/README
  stable/8/contrib/bzip2/README.COMPILATION.PROBLEMS
  stable/8/contrib/bzip2/blocksort.c
  stable/8/contrib/bzip2/bzip2.1
  stable/8/contrib/bzip2/bzip2.c
  stable/8/contrib/bzip2/bzip2recover.c
  stable/8/contrib/bzip2/bzlib.c
  stable/8/contrib/bzip2/bzlib.h
  stable/8/contrib/bzip2/bzlib_private.h
  stable/8/contrib/bzip2/compress.c
  stable/8/contrib/bzip2/crctable.c
  stable/8/contrib/bzip2/decompress.c
  stable/8/contrib/bzip2/huffman.c
  stable/8/contrib/bzip2/randtable.c
  stable/8/contrib/bzip2/spewG.c
  stable/8/contrib/bzip2/unzcrash.c
Directory Properties:
  stable/8/contrib/bzip2/   (props changed)

Modified: stable/8/contrib/bzip2/CHANGES
==
--- stable/8/contrib/bzip2/CHANGES  Thu Feb 28 05:18:15 2013
(r247447)
+++ stable/8/contrib/bzip2/CHANGES  Thu Feb 28 05:47:50 2013
(r247448)
@@ -2,8 +2,8 @@
  This file is part of bzip2/libbzip2, a program and library for
  lossless, block-sorting data compression.
 
- bzip2/libbzip2 version 1.0.5 of 10 December 2007
- Copyright (C) 1996-2007 Julian Seward jsew...@bzip.org
+ bzip2/libbzip2 version 1.0.6 of 6 September 2010
+ Copyright (C) 1996-2010 Julian Seward jsew...@bzip.org
 
  Please read the WARNING, DISCLAIMER and PATENTS sections in the 
  README file.
@@ -317,3 +317,11 @@ Fixes some minor bugs since the last ver
 ~
 Security fix only.  Fixes CERT-FI 20469 as it applies to bzip2.
 
+
+1.0.6 (6 Sept 10)
+~
+
+* Security fix for CVE-2010-0405.  This was reported by Mikolaj
+  Izdebski.
+
+* Make the documentation build on Ubuntu 10.04

Modified: stable/8/contrib/bzip2/LICENSE
==
--- stable/8/contrib/bzip2/LICENSE  Thu Feb 28 05:18:15 2013
(r247447)
+++ stable/8/contrib/bzip2/LICENSE  Thu Feb 28 05:47:50 2013
(r247448)
@@ -2,7 +2,7 @@
 --
 
 This program, bzip2, the associated library libbzip2, and all
-documentation, are copyright (C) 1996-2007 Julian R Seward.  All
+documentation, are copyright (C) 1996-2010 Julian R Seward.  All
 rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -37,6 +37,6 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY 
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 Julian Seward, jsew...@bzip.org
-bzip2/libbzip2 version 1.0.5 of 10 December 2007
+bzip2/libbzip2 version 1.0.6 of 6 September 2010
 
 --

Modified: stable/8/contrib/bzip2/Makefile
==
--- stable/8/contrib/bzip2/Makefile Thu Feb 28 05:18:15 2013
(r247447)
+++ stable/8/contrib/bzip2/Makefile Thu Feb 28 05:47:50 2013
(r247448)
@@ -2,8 +2,8 @@
 # This file is part of bzip2/libbzip2, a program and library for
 # lossless, block-sorting data compression.
 #
-# bzip2/libbzip2 version 1.0.5 of 10 December 2007
-# Copyright (C) 1996-2007 Julian Seward jsew...@bzip.org
+# bzip2/libbzip2 version 1.0.6 of 6 September 2010
+# Copyright (C) 1996-2010 Julian Seward jsew...@bzip.org
 #
 # Please read the WARNING, DISCLAIMER and PATENTS sections in the 
 # README file.
@@ -137,7 +137,7 @@ bzip2recover.o: bzip2recover.c
 distclean: clean
rm -f manual.ps manual.html manual.pdf
 
-DISTNAME=bzip2-1.0.5
+DISTNAME=bzip2-1.0.6
 dist: check manual
rm -f $(DISTNAME)
ln -s -f . $(DISTNAME)

Modified: stable/8/contrib/bzip2/Makefile-libbz2_so
==
--- stable/8/contrib/bzip2/Makefile-libbz2_so   Thu Feb 28 05:18:15 2013
(r247447)
+++ stable/8/contrib/bzip2/Makefile-libbz2_so   Thu Feb 28 05:47:50 2013
(r247448)
@@ -1,6 +1,6 @@
 
 # This Makefile builds a shared version of the library, 
-# libbz2.so.1.0.4, with soname libbz2.so.1.0,
+# libbz2.so.1.0.6, with soname libbz2.so.1.0,
 # at least on x86-Linux (RedHat 7.2), 
 # with gcc-2.96 2731 (Red Hat Linux 7.1 2.96-98).  
 # Please see the README file for some important info 
@@ -10,8 +10,8 @@
 # This file is part of bzip2/libbzip2, a program and library for
 # lossless, block-sorting data compression.
 #
-# bzip2/libbzip2 version 1.0.5 of 10 December 2007
-# Copyright (C) 1996-2007 Julian Seward jsew...@bzip.org
+# bzip2/libbzip2 version 1.0.6 of 6 September 2010
+# Copyright (C) 1996-2010 Julian Seward jsew...@bzip.org
 #
 # Please read the 

Re: svn commit: r247430 - in stable/8/sys: conf dev/e1000 modules/em modules/igb

2013-02-27 Thread Jack Vogel
I am checking with Luigi to see if an MFC of his code is a viable solution,
if not I
will change my core code. Stay tuned...

Jack


On Wed, Feb 27, 2013 at 9:41 PM, Jack Vogel jfvo...@gmail.com wrote:

 LOL, I would see the messages just as I sent this, never mind.

 Jack


 On Wed, Feb 27, 2013 at 9:39 PM, Jack Vogel jfvo...@gmail.com wrote:

 Oh, that's odd, then HEAD should be broken too, do you have more detail?

 Jack


 On Wed, Feb 27, 2013 at 6:23 PM, Glen Barber g...@freebsd.org wrote:

 Jack,

 This commit seems to break the build for at least powerpc and sparc64.

 Glen

 On Thu, Feb 28, 2013 at 12:22:04AM +, Jack F Vogel wrote:
  Author: jfv
  Date: Thu Feb 28 00:22:04 2013
  New Revision: 247430
  URL: http://svnweb.freebsd.org/changeset/base/247430
 
  Log:
MFC of the E1000 drivers to STABLE/8, this includes the follow
 revisions
plus a few tweaks:
 196969,196970,211516,214646,215781,215789,215808,215910,223350,
 223482,223831,228281,228393,229939,231796,232238,234665,235256,
 236406,238148,238151,238214,238765,238770,238953,238981,239105,
 239109,239304,240518,240693,240968,241037,241856,241885,243570,
 243857,245334,246128,246482,247064
 
  Added:
stable/8/sys/dev/e1000/e1000_i210.c
   - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.c
stable/8/sys/dev/e1000/e1000_i210.h
   - copied, changed from r238148, head/sys/dev/e1000/e1000_i210.h
  Modified:
stable/8/sys/conf/files
stable/8/sys/dev/e1000/e1000_82541.c
stable/8/sys/dev/e1000/e1000_82543.c
stable/8/sys/dev/e1000/e1000_82571.c
stable/8/sys/dev/e1000/e1000_82575.c
stable/8/sys/dev/e1000/e1000_82575.h
stable/8/sys/dev/e1000/e1000_api.c
stable/8/sys/dev/e1000/e1000_api.h
stable/8/sys/dev/e1000/e1000_defines.h
stable/8/sys/dev/e1000/e1000_hw.h
stable/8/sys/dev/e1000/e1000_ich8lan.c
stable/8/sys/dev/e1000/e1000_ich8lan.h
stable/8/sys/dev/e1000/e1000_mac.c
stable/8/sys/dev/e1000/e1000_mac.h
stable/8/sys/dev/e1000/e1000_manage.c
stable/8/sys/dev/e1000/e1000_manage.h
stable/8/sys/dev/e1000/e1000_nvm.c
stable/8/sys/dev/e1000/e1000_nvm.h
stable/8/sys/dev/e1000/e1000_osdep.h
stable/8/sys/dev/e1000/e1000_phy.c
stable/8/sys/dev/e1000/e1000_phy.h
stable/8/sys/dev/e1000/e1000_regs.h
stable/8/sys/dev/e1000/if_em.c   (contents, props changed)
stable/8/sys/dev/e1000/if_igb.c   (contents, props changed)
stable/8/sys/dev/e1000/if_igb.h
stable/8/sys/dev/e1000/if_lem.c
stable/8/sys/modules/em/Makefile
stable/8/sys/modules/igb/Makefile
  Directory Properties:
stable/8/sys/dev/e1000/   (props changed)
 
  Modified: stable/8/sys/conf/files
 
 ==
  --- stable/8/sys/conf/files   Thu Feb 28 00:18:56 2013(r247429)
  +++ stable/8/sys/conf/files   Thu Feb 28 00:22:04 2013(r247430)
  @@ -920,6 +920,8 @@ dev/e1000/e1000_82575.c   optional em | i
compile-with ${NORMAL_C} -I$S/dev/e1000
   dev/e1000/e1000_ich8lan.coptional em | igb \
compile-with ${NORMAL_C} -I$S/dev/e1000
  +dev/e1000/e1000_i210.c   optional em | igb \
  + compile-with ${NORMAL_C} -I$S/dev/e1000
   dev/e1000/e1000_api.coptional em | igb \
compile-with ${NORMAL_C} -I$S/dev/e1000
   dev/e1000/e1000_mac.coptional em | igb \
 
  Modified: stable/8/sys/dev/e1000/e1000_82541.c
 
 ==
  --- stable/8/sys/dev/e1000/e1000_82541.c  Thu Feb 28 00:18:56 2013
(r247429)
  +++ stable/8/sys/dev/e1000/e1000_82541.c  Thu Feb 28 00:22:04 2013
(r247430)
  @@ -642,7 +642,7 @@ static s32 e1000_check_for_link_82541(st
 * of MAC speed/duplex configuration.  So we only need to
 * configure Collision Distance in the MAC.
 */
  - e1000_config_collision_dist_generic(hw);
  + mac-ops.config_collision_dist(hw);
 
/*
 * Configure Flow Control now that Auto-Neg has completed.
 
  Modified: stable/8/sys/dev/e1000/e1000_82543.c
 
 ==
  --- stable/8/sys/dev/e1000/e1000_82543.c  Thu Feb 28 00:18:56 2013
(r247429)
  +++ stable/8/sys/dev/e1000/e1000_82543.c  Thu Feb 28 00:22:04 2013
(r247430)
  @@ -1126,7 +1126,7 @@ static s32 e1000_setup_copper_link_82543
DEBUGOUT(Valid link established!!!\n);
/* Config the MAC and PHY after link is up */
if (hw-mac.type == e1000_82544) {
  - e1000_config_collision_dist_generic(hw);
  + hw-mac.ops.config_collision_dist(hw);
} else {
ret_val = e1000_config_mac_to_phy_82543(hw);
if (ret_val)
  @@ -1160,7 +1160,7 @@ static s32 e1000_setup_fiber_link_82543(
/* Take