Re: svn commit: r254585 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-08-28 Thread Andriy Gapon
on 28/08/2013 04:02 Xin Li said the following:
 I'm not sure that this is right.  Now we have:
 
 tdzp = VTOZ(tdvp);
 ZFS_VERIFY_ZP(tdzp);
 zfsvfs = tdzp-z_zfsvfs;
 ZFS_ENTER(zfsvfs);// tdzp's z_zfsvfs entered
 zilog = zfsvfs-z_log;
 sdzp = VTOZ(sdvp);
 ZFS_VERIFY_ZP(sdzp);  // (*)
 
 Note that in the (*) step, when sdzp is invalid and sdzp have
 different z_zfsvfs than tdzp (for instance when the node is in the
 snapshot directory; the code later would test this), we could end up
 with ZFS_EXIT()'ing the wrong z_zfsvfs.

The v_vfsp / v_mount check should be prior to any of this and should ensure that
all the vnodes have the same z_zfsvfs.

-- 
Andriy Gapon
___
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: r254982 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-08-28 Thread Andriy Gapon
on 28/08/2013 03:39 Xin LI said the following:
 @@ -6250,8 +6250,11 @@ zfs_freebsd_rename(ap)
   ASSERT(ap-a_fcnp-cn_flags  (SAVENAME|SAVESTART));
   ASSERT(ap-a_tcnp-cn_flags  (SAVENAME|SAVESTART));
  
 - error = zfs_rename(fdvp, ap-a_fcnp-cn_nameptr, tdvp,
 - ap-a_tcnp-cn_nameptr, ap-a_fcnp-cn_cred, NULL, 0);
 + if (fdvp-v_mount == tdvp-v_mount)
 + error = zfs_rename(fdvp, ap-a_fcnp-cn_nameptr, tdvp,
 + ap-a_tcnp-cn_nameptr, ap-a_fcnp-cn_cred, NULL, 0);
 + else
 + error = EXDEV;
  
   if (tdvp == tvp)
   VN_RELE(tdvp);

So, I am still not sure if that is important or not, but this change still 
misses
(tvp  (fvp-v_mount != tvp-v_mount))
check as found in ufs_rename.

-- 
Andriy Gapon
___
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: r254985 - head/sys/modules/ip6_mroute_mod

2013-08-28 Thread Ulrich Spoerlein
Author: uqs
Date: Wed Aug 28 07:48:44 2013
New Revision: 254985
URL: http://svnweb.freebsd.org/changeset/base/254985

Log:
  Fix 'make depend'

Modified:
  head/sys/modules/ip6_mroute_mod/Makefile

Modified: head/sys/modules/ip6_mroute_mod/Makefile
==
--- head/sys/modules/ip6_mroute_mod/MakefileWed Aug 28 05:12:29 2013
(r254984)
+++ head/sys/modules/ip6_mroute_mod/MakefileWed Aug 28 07:48:44 2013
(r254985)
@@ -7,7 +7,7 @@
 KMOD=  ip6_mroute
 
 SRCS=  ip6_mroute.c
-SRCS+= opt_inet6.h opt_mrouting.h
+SRCS+= opt_inet6.h opt_kdtrace.h opt_mrouting.h
 
 .if !defined(KERNBUILDDIR)
 opt_inet6.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: r254986 - head/sys/ufs/ufs

2013-08-28 Thread Ivan Voras
Author: ivoras
Date: Wed Aug 28 10:06:20 2013
New Revision: 254986
URL: http://svnweb.freebsd.org/changeset/base/254986

Log:
  Take a very small step toward the Century of the Anchovy by increasing the
  time dirhash entries stay in memory before being considered for eviction to
  1 minute.

Modified:
  head/sys/ufs/ufs/ufs_dirhash.c

Modified: head/sys/ufs/ufs/ufs_dirhash.c
==
--- head/sys/ufs/ufs/ufs_dirhash.c  Wed Aug 28 07:48:44 2013
(r254985)
+++ head/sys/ufs/ufs/ufs_dirhash.c  Wed Aug 28 10:06:20 2013
(r254986)
@@ -85,7 +85,7 @@ SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_d
 static int ufs_dirhashlowmemcount = 0;
 SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_lowmemcount, CTLFLAG_RD, 
 ufs_dirhashlowmemcount, 0, number of times low memory hook called);
-static int ufs_dirhashreclaimage = 5;
+static int ufs_dirhashreclaimage = 60;
 SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_reclaimage, CTLFLAG_RW, 
 ufs_dirhashreclaimage, 0, 
 max time in seconds of hash inactivity before deletion in low VM events);
___
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: r254585 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-08-28 Thread Davide Italiano
On Wed, Aug 28, 2013 at 3:02 AM, Xin Li delp...@delphij.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA512
[snip]

 On 08/27/13 01:59, Davide Italiano wrote:
 I've written a patch that attempts to fix the second problem.
 http://people.freebsd.org/~davide/review/zfsrename_recycle.diff The
 culprit is that we're dereferencing sdvp without the vnode lock
 held, so data-stability is not guaranteed. tdvp, instead, is locked
 at the entry point of VOP_RENAME() (at least according to
 vop_rename_pre()) so it can be safely used. As pointed out by
 Andriy ZFS has some different mechanisms wrt other file systems
 that allow the vnode to not be recycled when it's referenced
 (ZFS_ENTER), so once we get zfsvfs_t * from tdzp we can call
 ZFS_ENTER and dereference sdvp in a safe manner.

 I'm not sure that this is right.  Now we have:

 tdzp = VTOZ(tdvp);
 ZFS_VERIFY_ZP(tdzp);
 zfsvfs = tdzp-z_zfsvfs;
 ZFS_ENTER(zfsvfs);  // tdzp's z_zfsvfs entered
 zilog = zfsvfs-z_log;
 sdzp = VTOZ(sdvp);
 ZFS_VERIFY_ZP(sdzp);// (*)

Well, if your concern is that the running thread can exit from a
different context than the one it entered, maybe partly inlining
ZFS_VERIFY_ZP() might workaround the problem.

if (sdzp-z_sa_hdl == NULL) {
ZFS_EXIT(zfsvfs); /* this is the right context */
return (EIO);
}

Does this make sense for you? If not, can you propose an alternative?
I'll be away for a couple of days but I will be happy to discuss this
further when I'll come back.


 Note that in the (*) step, when sdzp is invalid and sdzp have
 different z_zfsvfs than tdzp (for instance when the node is in the
 snapshot directory; the code later would test this), we could end up
 with ZFS_EXIT()'ing the wrong z_zfsvfs.

 Cheers,
 - --
 Xin LI delp...@delphij.nethttps://www.delphij.net/
 FreeBSD - The Power to Serve!   Live free or die
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2.0.21 (FreeBSD)

 iQEcBAEBCgAGBQJSHUxBAAoJEG80Jeu8UPuzkzEIAKXlfGuTodrPcPkDkxBhhaOj
 QoxoT06jFwMTplysICuCpslQNyyG2Jxq654u9nMh6q5dww370eTtm2FJ0n2QTxk4
 JeWLpZVUu7VHWNXYVJQqrmATaMFHO4wVf5AYpSHn+1iCWo0kQn1MPxPw/oSUt0yw
 1628jhWTs8n+rxQaYrYN6ewXYeylMwC50ZB0kE/gQpQZ+cKAGmrM/8tur24SQBEo
 WwrHakrv1DGJ8rv3Q53FB2iUZ+zEAZs6MJ28w32lV3vOI20jfQbEK+RR7i7HvxdV
 c/7M96wCd0X4iEqZb87VVfJFSRdQsXy/35scXhhh/BSviT7rervS8XxPGhfpXOs=
 =MzwT
 -END PGP SIGNATURE-

Thanks,

-- 
Davide

There are no solved problems; there are only problems that are more
or less solved -- Henri Poincare
___
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: r254986 - head/sys/ufs/ufs

2013-08-28 Thread Davide Italiano
On Wed, Aug 28, 2013 at 12:06 PM, Ivan Voras ivo...@freebsd.org wrote:
 Author: ivoras
 Date: Wed Aug 28 10:06:20 2013
 New Revision: 254986
 URL: http://svnweb.freebsd.org/changeset/base/254986

 Log:
   Take a very small step toward the Century of the Anchovy by increasing the
   time dirhash entries stay in memory before being considered for eviction to
   1 minute.

 Modified:
   head/sys/ufs/ufs/ufs_dirhash.c

 Modified: head/sys/ufs/ufs/ufs_dirhash.c
 ==
 --- head/sys/ufs/ufs/ufs_dirhash.c  Wed Aug 28 07:48:44 2013
 (r254985)
 +++ head/sys/ufs/ufs/ufs_dirhash.c  Wed Aug 28 10:06:20 2013
 (r254986)
 @@ -85,7 +85,7 @@ SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_d
  static int ufs_dirhashlowmemcount = 0;
  SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_lowmemcount, CTLFLAG_RD,
  ufs_dirhashlowmemcount, 0, number of times low memory hook called);
 -static int ufs_dirhashreclaimage = 5;
 +static int ufs_dirhashreclaimage = 60;
  SYSCTL_INT(_vfs_ufs, OID_AUTO, dirhash_reclaimage, CTLFLAG_RW,
  ufs_dirhashreclaimage, 0,
  max time in seconds of hash inactivity before deletion in low VM 
 events);

Hi,
do you have any evidence that this change impacts positively (or
negatively) performances for some workloads? If yes, can you share?
Also, why did you choose the '60' value (rather than something else)?
I don't see any 'Reviewed by:' line in your commit message neither I
remember a public discussion on -current or -arch or -fs about this.
OTOH I think such changes deserve a wider discussion.

Thanks,

-- 
Davide

There are no solved problems; there are only problems that are more
or less solved -- Henri Poincare
___
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: r254986 - head/sys/ufs/ufs

2013-08-28 Thread Ivan Voras
On 28 August 2013 12:25, Davide Italiano dav...@freebsd.org wrote:

 do you have any evidence that this change impacts positively (or
 negatively) performances for some workloads? If yes, can you share?

Yes, observation of my own servers. Without this, dirhash is basically
useless since in certain situations everything gets evicted after 5
seconds and it never grows to its full potential.

 Also, why did you choose the '60' value (rather than something else)?

Personal experience.

 I don't see any 'Reviewed by:' line in your commit message neither I
 remember a public discussion on -current or -arch or -fs about this.
 OTOH I think such changes deserve a wider discussion.

See discussion in @stable.
___
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: r254986 - head/sys/ufs/ufs

2013-08-28 Thread Davide Italiano
On Wed, Aug 28, 2013 at 12:31 PM, Ivan Voras ivo...@freebsd.org wrote:
 On 28 August 2013 12:25, Davide Italiano dav...@freebsd.org wrote:

 do you have any evidence that this change impacts positively (or
 negatively) performances for some workloads? If yes, can you share?

 Yes, observation of my own servers. Without this, dirhash is basically
 useless since in certain situations everything gets evicted after 5
 seconds and it never grows to its full potential.


Oh, well. Your servers doesn't necessary reflect FreeBSD general user
so you can just maintain this change local.
I've always thought FreeBSD policy was that of leaving reasonable
defaults for the general case and giving people possibility to tune
them according to their needs. Also 'in certain situations' makes
relatively little sense to me unless you provide a testcase that
mimics such situations or explain to people how to reproduce it.

 Also, why did you choose the '60' value (rather than something else)?

 Personal experience.


Do you realize that this is a driven by commit change, right? And
there's no technical motivatiion about this or experimental data that
confirms you've chossen the right value?


 I don't see any 'Reviewed by:' line in your commit message neither I
 remember a public discussion on -current or -arch or -fs about this.
 OTOH I think such changes deserve a wider discussion.

 See discussion in @stable.

I see from the archives that you didn't get any feedback by anyone
working in the VM layer or by some UFS maintainer.
I don't even comment about discussing -CURRENT changes in stable@.

Thanks,

-- 
Davide

There are no solved problems; there are only problems that are more
or less solved -- Henri Poincare
___
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: r254986 - head/sys/ufs/ufs

2013-08-28 Thread Ivan Voras
On 28 August 2013 12:44, Davide Italiano dav...@freebsd.org wrote:

 Do you realize that this is a driven by commit change, right? And
 there's no technical motivatiion about this or experimental data that
 confirms you've chossen the right value?

 I see from the archives that you didn't get any feedback by anyone
 working in the VM layer or by some UFS maintainer.
 I don't even comment about discussing -CURRENT changes in stable@.

You have a point that this was a judgment call, but note that the last
change to dirhash tuning (maxmem) was also done by me. Since this is
-CURRENT, I will leave this commit in unless it proves detrimental in
the usual testing which goes on.

If you still feel strongly about this, contact me in private and we'll
investigate its effects in more detail.
___
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: r254986 - head/sys/ufs/ufs

2013-08-28 Thread Davide Italiano
On Wed, Aug 28, 2013 at 12:53 PM, Ivan Voras ivo...@freebsd.org wrote:
 On 28 August 2013 12:44, Davide Italiano dav...@freebsd.org wrote:

 Do you realize that this is a driven by commit change, right? And
 there's no technical motivatiion about this or experimental data that
 confirms you've chossen the right value?

 I see from the archives that you didn't get any feedback by anyone
 working in the VM layer or by some UFS maintainer.
 I don't even comment about discussing -CURRENT changes in stable@.

 You have a point that this was a judgment call, but note that the last
 change to dirhash tuning (maxmem) was also done by me. Since this is
 -CURRENT, I will leave this commit in unless it proves detrimental in
 the usual testing which goes on.


If 10.0 would be one or two years away, I would be OK with that. But
we're already in code slush and in 10 days -CURRENT will become
-STABLE'ish so I'm worried this change won't have the right exposure.
I would be more happy to see it postponed, maybe after proper
discussion and testing. I'm not against the change as-it-is, my point
is that the project reached a point of maturity where 'judgment calls'
doesn't work very well. It's more a matter of how things are done
rather than what things are done.

 If you still feel strongly about this, contact me in private and we'll
 investigate its effects in more detail.

I prefer to see a public discussion about this. Maybe you should come
up with some evidence that your change is helpful, even after this
commit.

-- 
Davide

There are no solved problems; there are only problems that are more
or less solved -- Henri Poincare
___
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: r254986 - head/sys/ufs/ufs

2013-08-28 Thread Ivan Voras
On 28 August 2013 13:14, Davide Italiano dav...@freebsd.org wrote:

 I prefer to see a public discussion about this.

Ok, Ok, I'll go start a retrograde disucussion on @filesystems :)

 Maybe you should come
 up with some evidence that your change is helpful, even after this
 commit.

I'll try and dig something up.
___
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: r254987 - head/sys/dev/ahci

2013-08-28 Thread Gavin Atkinson
Author: gavin
Date: Wed Aug 28 14:29:33 2013
New Revision: 254987
URL: http://svnweb.freebsd.org/changeset/base/254987

Log:
  Support the PCI-Express SSD in the new MacBook Air (model A1465)
  
  Submitted by: Johannes Lundberg johannes brilliantservice.co.jp
  MFC after:3 days

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

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cWed Aug 28 10:06:20 2013(r254986)
+++ head/sys/dev/ahci/ahci.cWed Aug 28 14:29:33 2013(r254987)
@@ -229,6 +229,7 @@ static struct {
{0x91301b4b, 0x00, Marvell 88SE9130,  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
{0x91721b4b, 0x00, Marvell 88SE9172,  AHCI_Q_NOBSYRES},
{0x91821b4b, 0x00, Marvell 88SE9182,  AHCI_Q_NOBSYRES},
+   {0x91831b4b, 0x00, Marvell 88SS9183,  AHCI_Q_NOBSYRES},
{0x91a01b4b, 0x00, Marvell 88SE91Ax,  AHCI_Q_NOBSYRES},
{0x92151b4b, 0x00, Marvell 88SE9215,  AHCI_Q_NOBSYRES},
{0x92201b4b, 0x00, Marvell 88SE9220,  AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG},
___
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: r254988 - head/sys/dev/gpio

2013-08-28 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Aug 28 14:39:24 2013
New Revision: 254988
URL: http://svnweb.freebsd.org/changeset/base/254988

Log:
  Properly free gpiobus ivars when gpiobus_parse_pins() fails and also on
  gpiobus detachment.
  
  Suggested by: imp
  Approved by:  adrian (mentor)

Modified:
  head/sys/dev/gpio/gpiobus.c

Modified: head/sys/dev/gpio/gpiobus.c
==
--- head/sys/dev/gpio/gpiobus.c Wed Aug 28 14:29:33 2013(r254987)
+++ head/sys/dev/gpio/gpiobus.c Wed Aug 28 14:39:24 2013(r254988)
@@ -151,6 +151,7 @@ gpiobus_parse_pins(struct gpiobus_softc 
if (i = sc-sc_npins) {
device_printf(child, 
invalid pin %d, max: %d\n, i, sc-sc_npins - 1);
+   free(devi-pins, M_DEVBUF);
return (EINVAL);
}
 
@@ -161,6 +162,7 @@ gpiobus_parse_pins(struct gpiobus_softc 
if (sc-sc_pins_mapped[i]) {
device_printf(child, 
warning: pin %d is already mapped\n, i);
+   free(devi-pins, M_DEVBUF);
return (EINVAL);
}
sc-sc_pins_mapped[i] = 1;
@@ -218,9 +220,12 @@ gpiobus_attach(device_t dev)
 static int
 gpiobus_detach(device_t dev)
 {
-   struct gpiobus_softc *sc = GPIOBUS_SOFTC(dev);
-   int err;
+   struct gpiobus_softc *sc;
+   struct gpiobus_ivar *devi;
+   device_t *devlist;
+   int i, err, ndevs;
 
+   sc = GPIOBUS_SOFTC(dev);
KASSERT(mtx_initialized(sc-sc_mtx),
(gpiobus mutex not initialized));
GPIOBUS_LOCK_DESTROY(sc);
@@ -228,8 +233,17 @@ gpiobus_detach(device_t dev)
if ((err = bus_generic_detach(dev)) != 0)
return (err);
 
-   /* detach and delete all children */
-   device_delete_children(dev);
+   if ((err = device_get_children(dev, devlist, ndevs)) != 0)
+   return (err);
+   for (i = 0; i  ndevs; i++) {
+   device_delete_child(dev, devlist[i]);
+   devi = GPIOBUS_IVAR(devlist[i]);
+   if (devi-pins) {
+   free(devi-pins, M_DEVBUF);
+   devi-pins = NULL;
+   }
+   }
+   free(devlist, M_TEMP);
 
if (sc-sc_pins_mapped) {
free(sc-sc_pins_mapped, M_DEVBUF);
___
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: r254989 - head/sys/mips/conf

2013-08-28 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Aug 28 14:43:04 2013
New Revision: 254989
URL: http://svnweb.freebsd.org/changeset/base/254989

Log:
  Add the default hints to make the GPIO pins, rf led and reset switch work
  out of the box on RouterStation.
  
  PR:   177832
  Submitted by: Petko Bordjukov (bordju...@gmail.com)
  Approved by:  adrian (mentor)

Modified:
  head/sys/mips/conf/ROUTERSTATION.hints

Modified: head/sys/mips/conf/ROUTERSTATION.hints
==
--- head/sys/mips/conf/ROUTERSTATION.hints  Wed Aug 28 14:39:24 2013
(r254988)
+++ head/sys/mips/conf/ROUTERSTATION.hints  Wed Aug 28 14:43:04 2013
(r254989)
@@ -23,6 +23,24 @@ hint.arge.1.mdio=mdioproxy1  # .. off of 
 hint.ukswitch.0.at=mdio0
 hint.ukswitch.0.phymask=0x3
 
+# Don't flip on anything that isn't already enabled.
+# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're
+# not used here.
+hint.gpio.0.function_set=0x
+hint.gpio.0.function_clear=0x
+
+# These are the GPIO LEDs and buttons which can be software controlled.
+hint.gpio.0.pinmask=0x00ff
+
+# GPIO 0: Pin 1
+# GPIO 1: Pin 2
+# GPIO 2: RF LED
+# GPIO 3: Pin 3
+# GPIO 4: Pin 4
+# GPIO 5: Pin 5
+# GPIO 6: Pin 6
+# GPIO 7: Pin 7
+
 # RF led
 hint.gpioled.0.at=gpiobus0
 hint.gpioled.0.name=rf
___
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: r254990 - head/sys/mips/atheros

2013-08-28 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Aug 28 14:46:15 2013
New Revision: 254990
URL: http://svnweb.freebsd.org/changeset/base/254990

Log:
  Make ar71xx_spi attach the next free unit of spibus and not only spibus0.
  
  Approved by:  adrian (mentor)

Modified:
  head/sys/mips/atheros/ar71xx_spi.c

Modified: head/sys/mips/atheros/ar71xx_spi.c
==
--- head/sys/mips/atheros/ar71xx_spi.c  Wed Aug 28 14:43:04 2013
(r254989)
+++ head/sys/mips/atheros/ar71xx_spi.c  Wed Aug 28 14:46:15 2013
(r254990)
@@ -108,7 +108,7 @@ ar71xx_spi_attach(device_t dev)
SPI_WRITE(sc, AR71XX_SPI_CTRL, 0x43);
SPI_WRITE(sc, AR71XX_SPI_IO_CTRL, SPI_IO_CTRL_CSMASK);
 
-   device_add_child(dev, spibus, 0);
+   device_add_child(dev, spibus, -1);
return (bus_generic_attach(dev));
 }
 
___
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: r254991 - head/sys/dev/flash

2013-08-28 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Aug 28 14:49:36 2013
New Revision: 254991
URL: http://svnweb.freebsd.org/changeset/base/254991

Log:
  Fix a few typos for s25fl types.
  
  Approved by:  adrian (mentor)

Modified:
  head/sys/dev/flash/mx25l.c

Modified: head/sys/dev/flash/mx25l.c
==
--- head/sys/dev/flash/mx25l.c  Wed Aug 28 14:46:15 2013(r254990)
+++ head/sys/dev/flash/mx25l.c  Wed Aug 28 14:49:36 2013(r254991)
@@ -104,9 +104,9 @@ struct mx25l_flash_ident flash_devices[]
{ mx25ll32,   0xc2, 0x2016, 64 * 1024, 64, FL_NONE },
{ mx25ll64,   0xc2, 0x2017, 64 * 1024, 128, FL_NONE },
{ mx25ll128,  0xc2, 0x2018, 64 * 1024, 256, FL_ERASE_4K | 
FL_ERASE_32K },
+   { s25fl032,   0x01, 0x0215, 64 * 1024, 64, FL_NONE },
+   { s25fl064,   0x01, 0x0216, 64 * 1024, 128, FL_NONE },
{ s25fl128,   0x01, 0x2018, 64 * 1024, 256, FL_NONE },
-   { s25s1032,   0x01, 0x0215, 64 * 1024, 64, FL_NONE },
-   { s25sl064a,  0x01, 0x0216, 64 * 1024, 128, FL_NONE },
{ SST25VF032B, 0xbf, 0x254a, 64 * 1024, 64, FL_ERASE_4K | 
FL_ERASE_32K },
 
/* Winbond -- w25x blocks are 64K, sectors are 4KiB */
___
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: r254992 - head/etc/rc.d

2013-08-28 Thread Gavin Atkinson
Author: gavin
Date: Wed Aug 28 15:12:15 2013
New Revision: 254992
URL: http://svnweb.freebsd.org/changeset/base/254992

Log:
  After writing a kernel core dump into /var/crash, call sync(8).
  
  If we panic again shortly after boot (say, within 30 seconds), any core
  dump we wrote out may be lost on reboot.  In this situation, we really
  want to keep that core file, as it may be the only way to have the issue
  resolved.  Call sync(8) after writing out the core file and running
  crashinfo(8), in the hope that these will not be lost if we panic
  again.  sync(8) is only called in the case where there is a core dump
  to be written out, so won't be called during normal boots.
  
  Discovered by:Trying to debug an IPSEC panic
  MFC after:1 week

Modified:
  head/etc/rc.d/savecore

Modified: head/etc/rc.d/savecore
==
--- head/etc/rc.d/savecore  Wed Aug 28 14:49:36 2013(r254991)
+++ head/etc/rc.d/savecore  Wed Aug 28 15:12:15 2013(r254992)
@@ -70,6 +70,7 @@ savecore_start()
if checkyesno crashinfo_enable; then
${crashinfo_program} -d ${dumpdir}
fi
+   sync
else
check_startmsgs  echo 'No core dumps found.'
fi
___
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: r254992 - head/etc/rc.d

2013-08-28 Thread Konstantin Belousov
On Wed, Aug 28, 2013 at 03:12:16PM +, Gavin Atkinson wrote:
 Author: gavin
 Date: Wed Aug 28 15:12:15 2013
 New Revision: 254992
 URL: http://svnweb.freebsd.org/changeset/base/254992
 
 Log:
   After writing a kernel core dump into /var/crash, call sync(8).
   
   If we panic again shortly after boot (say, within 30 seconds), any core
   dump we wrote out may be lost on reboot.  In this situation, we really
   want to keep that core file, as it may be the only way to have the issue
   resolved.  Call sync(8) after writing out the core file and running
   crashinfo(8), in the hope that these will not be lost if we panic
   again.  sync(8) is only called in the case where there is a core dump
   to be written out, so won't be called during normal boots.
   
   Discovered by:  Trying to debug an IPSEC panic
   MFC after:  1 week
 
 Modified:
   head/etc/rc.d/savecore
 
 Modified: head/etc/rc.d/savecore
 ==
 --- head/etc/rc.d/savecoreWed Aug 28 14:49:36 2013(r254991)
 +++ head/etc/rc.d/savecoreWed Aug 28 15:12:15 2013(r254992)
 @@ -70,6 +70,7 @@ savecore_start()
   if checkyesno crashinfo_enable; then
   ${crashinfo_program} -d ${dumpdir}
   fi
 + sync
   else
   check_startmsgs  echo 'No core dumps found.'
   fi
The crashinfo(8) runs are usually quite long, and the program does not
add a new information comparing to the data already present in the
crash dump itself.  For your goal, it is more useful to sync before
crashinfo(8) invocation.


pgp5mJFDqG8t5.pgp
Description: PGP signature


Re: svn commit: r254992 - head/etc/rc.d

2013-08-28 Thread John-Mark Gurney
Gavin Atkinson wrote this message on Wed, Aug 28, 2013 at 15:12 +:
 Author: gavin
 Date: Wed Aug 28 15:12:15 2013
 New Revision: 254992
 URL: http://svnweb.freebsd.org/changeset/base/254992
 
 Log:
   After writing a kernel core dump into /var/crash, call sync(8).
   
   If we panic again shortly after boot (say, within 30 seconds), any core
   dump we wrote out may be lost on reboot.  In this situation, we really
   want to keep that core file, as it may be the only way to have the issue
   resolved.  Call sync(8) after writing out the core file and running
   crashinfo(8), in the hope that these will not be lost if we panic
   again.  sync(8) is only called in the case where there is a core dump
   to be written out, so won't be called during normal boots.

Why don't you call fsync on the relevant file(s) (or all the files in the
crash dir)?  sync just starts the process while fsync will block till
all the blocks are on disk...

-- 
  John-Mark Gurney  Voice: +1 415 225 5579

 All that I will do, has been done, All that I have, has not.
___
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: r254994 - head/lib/msun/src

2013-08-28 Thread Steve Kargl
Author: kargl
Date: Wed Aug 28 16:59:55 2013
New Revision: 254994
URL: http://svnweb.freebsd.org/changeset/base/254994

Log:
  * Whitespace.

Modified:
  head/lib/msun/src/s_erf.c

Modified: head/lib/msun/src/s_erf.c
==
--- head/lib/msun/src/s_erf.c   Wed Aug 28 15:12:51 2013(r254993)
+++ head/lib/msun/src/s_erf.c   Wed Aug 28 16:59:55 2013(r254994)
@@ -201,7 +201,7 @@ erf(double x)
if(ix  0x3feb) {   /* |x|0.84375 */
if(ix  0x3e30) {   /* |x|2**-28 */
if (ix  0x0080)
-   return (8*x+efx8*x)/8;  /* avoid spurious underflow */
+   return (8*x+efx8*x)/8;  /* avoid spurious underflow */
return x + efx*x;
}
z = x*x;
___
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: r254995 - head/sys/ufs/ffs

2013-08-28 Thread Kirk McKusick
Author: mckusick
Date: Wed Aug 28 17:38:05 2013
New Revision: 254995
URL: http://svnweb.freebsd.org/changeset/base/254995

Log:
  A performance problem was reported in PR kern/181226:
  
  I have 25TB Dell PERC 6 RAID5 array. When it becomes almost
  full (10-20GB free), processes which write data to it start
  eating 100% CPU and write speed drops below 1MB/sec (normally
  to gives 400MB/sec). The revision at which it first became
  apparent was http://svnweb.freebsd.org/changeset/base/249782.
  
  The offending change reserved an area in each cylinder group to
  store metadata. The new algorithm attempts to save this area for
  metadata and allows its use for non-metadata only after all the
  data areas have been exhausted. The size of the reserved area
  defaults to half of minfree, so the filesystem reports full before
  the data area can completely fill. However, in this report, the
  filesystem has had minfree reduced to 1% thus forcing the metadata
  area to be used for data. As the filesystem approached full, it
  had only metadata areas left to allocate. The result was that
  every block allocation had to scan summary data for 30,000 cylinder
  groups before falling back to searching up to 30,000 metadata areas.
  
  The fix is to give up on saving the metadata areas once the free
  space reserve drops below 2%. The effect of this change is to use
  the old algorithm of just accepting the first available block that
  we find. Since most filesystems use the default 5% minfree, this
  will have no effect on their operation. For those that want to push
  to the limit, they will get their crappy block placements quickly.
  
  Submitted by:  Dmitry Sivachenko
  Fix Tested by: Dmitry Sivachenko
  PR:kern/181226
  MFC after: 2 weeks

Modified:
  head/sys/ufs/ffs/ffs_alloc.c

Modified: head/sys/ufs/ffs/ffs_alloc.c
==
--- head/sys/ufs/ffs/ffs_alloc.cWed Aug 28 16:59:55 2013
(r254994)
+++ head/sys/ufs/ffs/ffs_alloc.cWed Aug 28 17:38:05 2013
(r254995)
@@ -516,7 +516,13 @@ ffs_reallocblks_ufs1(ap)
ip = VTOI(vp);
fs = ip-i_fs;
ump = ip-i_ump;
-   if (fs-fs_contigsumsize = 0)
+   /*
+* If we are not tracking block clusters or if we have less than 2%
+* free blocks left, then do not attempt to cluster. Running with
+* less than 5% free block reserve is not recommended and those that
+* choose to do so do not expect to have good file layout.
+*/
+   if (fs-fs_contigsumsize = 0 || freespace(fs, 2)  0)
return (ENOSPC);
buflist = ap-a_buflist;
len = buflist-bs_nchildren;
@@ -737,7 +743,13 @@ ffs_reallocblks_ufs2(ap)
ip = VTOI(vp);
fs = ip-i_fs;
ump = ip-i_ump;
-   if (fs-fs_contigsumsize = 0)
+   /*
+* If we are not tracking block clusters or if we have less than 2%
+* free blocks left, then do not attempt to cluster. Running with
+* less than 5% free block reserve is not recommended and those that
+* choose to do so do not expect to have good file layout.
+*/
+   if (fs-fs_contigsumsize = 0 || freespace(fs, 2)  0)
return (ENOSPC);
buflist = ap-a_buflist;
len = buflist-bs_nchildren;
___
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: r254996 - head/sys/ufs/ffs

2013-08-28 Thread Kirk McKusick
Author: mckusick
Date: Wed Aug 28 17:46:32 2013
New Revision: 254996
URL: http://svnweb.freebsd.org/changeset/base/254996

Log:
  In looking at block layouts as part of fixing filesystem block
  allocations under low free-space conditions (-r254995), determine
  that old block-preference search order used before -r249782 worked
  a bit better. This change reverts to that block-preference search order.
  
  MFC after:2 weeks

Modified:
  head/sys/ufs/ffs/ffs_alloc.c

Modified: head/sys/ufs/ffs/ffs_alloc.c
==
--- head/sys/ufs/ffs/ffs_alloc.cWed Aug 28 17:38:05 2013
(r254995)
+++ head/sys/ufs/ffs/ffs_alloc.cWed Aug 28 17:46:32 2013
(r254996)
@@ -1186,7 +1186,7 @@ ffs_dirpref(pip)
if (fs-fs_contigdirs[cg]  maxcontigdirs)
return ((ino_t)(fs-fs_ipg * cg));
}
-   for (cg = prefcg - 1; cg = 0; cg--)
+   for (cg = 0; cg  prefcg; cg++)
if (fs-fs_cs(fs, cg).cs_ndir  maxndir 
fs-fs_cs(fs, cg).cs_nifree = minifree 
fs-fs_cs(fs, cg).cs_nbfree = minbfree) {
@@ -1199,7 +1199,7 @@ ffs_dirpref(pip)
for (cg = prefcg; cg  fs-fs_ncg; cg++)
if (fs-fs_cs(fs, cg).cs_nifree = avgifree)
return ((ino_t)(fs-fs_ipg * cg));
-   for (cg = prefcg - 1; cg = 0; cg--)
+   for (cg = 0; cg  prefcg; cg++)
if (fs-fs_cs(fs, cg).cs_nifree = avgifree)
break;
return ((ino_t)(fs-fs_ipg * cg));
___
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: r254997 - head/sys/dev/fb

2013-08-28 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug 28 17:58:30 2013
New Revision: 254997
URL: http://svnweb.freebsd.org/changeset/base/254997

Log:
  Avoid unnecessary signedness conversion.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==
--- head/sys/dev/fb/vesa.c  Wed Aug 28 17:46:32 2013(r254996)
+++ head/sys/dev/fb/vesa.c  Wed Aug 28 17:58:30 2013(r254997)
@@ -83,7 +83,7 @@ static struct mtx vesa_lock;
 static int vesa_state;
 static void *vesa_state_buf;
 static uint32_t vesa_state_buf_offs;
-static ssize_t vesa_state_buf_size;
+static size_t vesa_state_buf_size;
 
 static u_char *vesa_palette;
 static uint32_t vesa_palette_offs;
@@ -207,7 +207,7 @@ static int vesa_bios_load_palette2(int s
 #define STATE_SIZE 0
 #define STATE_SAVE 1
 #define STATE_LOAD 2
-static ssize_t vesa_bios_state_buf_size(int);
+static size_t vesa_bios_state_buf_size(int);
 static int vesa_bios_save_restore(int code, void *p);
 #ifdef MODE_TABLE_BROKEN
 static int vesa_bios_get_line_length(void);
@@ -505,7 +505,7 @@ vesa_bios_load_palette2(int start, int c
return (regs.R_AX != 0x004f);
 }
 
-static ssize_t
+static size_t
 vesa_bios_state_buf_size(int state)
 {
x86regs_t regs;
___
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: r254998 - head/sys/dev/fb

2013-08-28 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug 28 18:13:37 2013
New Revision: 254998
URL: http://svnweb.freebsd.org/changeset/base/254998

Log:
  Make sure to free stale buffer before allocating new one for safety.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==
--- head/sys/dev/fb/vesa.c  Wed Aug 28 17:58:30 2013(r254997)
+++ head/sys/dev/fb/vesa.c  Wed Aug 28 18:13:37 2013(r254998)
@@ -1475,6 +1475,10 @@ vesa_save_state(video_adapter_t *adp, vo
if (vesa_state_buf_size  0  size  bsize)
return (EINVAL);
 
+   if (vesa_vmem_buf != NULL) {
+   free(vesa_vmem_buf, M_DEVBUF);
+   vesa_vmem_buf = NULL;
+   }
if (VESA_MODE(adp-va_mode)  adp-va_buffer != 0) {
buf = adp-va_buffer;
bsize = adp-va_buffer_size;
@@ -1486,8 +1490,7 @@ vesa_save_state(video_adapter_t *adp, vo
vesa_vmem_buf = malloc(bsize, M_DEVBUF, M_NOWAIT);
if (vesa_vmem_buf != NULL)
bcopy((void *)buf, vesa_vmem_buf, bsize);
-   } else
-   vesa_vmem_buf = NULL;
+   }
if (vesa_state_buf_size == 0)
return ((*prevvidsw-save_state)(adp, p, size));
((adp_state_t *)p)-sig = V_STATE_SIG;
@@ -1524,6 +1527,7 @@ vesa_load_state(video_adapter_t *adp, vo
bcopy(vesa_vmem_buf, (void *)buf, bsize);
}
free(vesa_vmem_buf, M_DEVBUF);
+   vesa_vmem_buf = NULL;
}
if (((adp_state_t *)p)-sig != V_STATE_SIG)
return ((*prevvidsw-load_state)(adp, p));
___
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: r254999 - head/sys/dev/fb

2013-08-28 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug 28 19:06:22 2013
New Revision: 254999
URL: http://svnweb.freebsd.org/changeset/base/254999

Log:
  Do not save/restore video memory if we are not using linear frame buffer.
  Note this partially revert r233896.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==
--- head/sys/dev/fb/vesa.c  Wed Aug 28 18:13:37 2013(r254998)
+++ head/sys/dev/fb/vesa.c  Wed Aug 28 19:06:22 2013(r254999)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 1998 Kazutaka YOKOTA and Michael Smith
- * Copyright (c) 2009-2012 Jung-uk Kim j...@freebsd.org
+ * Copyright (c) 2009-2013 Jung-uk Kim j...@freebsd.org
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -1463,7 +1463,7 @@ vesa_set_border(video_adapter_t *adp, in
 static int
 vesa_save_state(video_adapter_t *adp, void *p, size_t size)
 {
-   vm_offset_t buf;
+   void *buf;
size_t bsize;
 
if (adp != vesa_adp || (size == 0  vesa_state_buf_size == 0))
@@ -1479,17 +1479,14 @@ vesa_save_state(video_adapter_t *adp, vo
free(vesa_vmem_buf, M_DEVBUF);
vesa_vmem_buf = NULL;
}
-   if (VESA_MODE(adp-va_mode)  adp-va_buffer != 0) {
-   buf = adp-va_buffer;
-   bsize = adp-va_buffer_size;
-   } else {
-   buf = adp-va_window;
-   bsize = adp-va_window_size;
-   }
-   if (buf != 0) {
-   vesa_vmem_buf = malloc(bsize, M_DEVBUF, M_NOWAIT);
-   if (vesa_vmem_buf != NULL)
-   bcopy((void *)buf, vesa_vmem_buf, bsize);
+   if (VESA_MODE(adp-va_mode)) {
+   buf = (void *)adp-va_buffer;
+   if (buf != NULL) {
+   bsize = adp-va_buffer_size;
+   vesa_vmem_buf = malloc(bsize, M_DEVBUF, M_NOWAIT);
+   if (vesa_vmem_buf != NULL)
+   bcopy(buf, vesa_vmem_buf, bsize);
+   }
}
if (vesa_state_buf_size == 0)
return ((*prevvidsw-save_state)(adp, p, size));
@@ -1500,7 +1497,7 @@ vesa_save_state(video_adapter_t *adp, vo
 static int
 vesa_load_state(video_adapter_t *adp, void *p)
 {
-   vm_offset_t buf;
+   void *buf;
size_t bsize;
int error, mode;
 
@@ -1515,16 +1512,12 @@ vesa_load_state(video_adapter_t *adp, vo
error = vesa_set_mode(adp, mode);
 
if (vesa_vmem_buf != NULL) {
-   if (error == 0) {
-   if (VESA_MODE(mode)  adp-va_buffer != 0) {
-   buf = adp-va_buffer;
+   if (error == 0  VESA_MODE(mode)) {
+   buf = (void *)adp-va_buffer;
+   if (buf != NULL) {
bsize = adp-va_buffer_size;
-   } else {
-   buf = adp-va_window;
-   bsize = adp-va_window_size;
+   bcopy(vesa_vmem_buf, buf, bsize);
}
-   if (buf != 0)
-   bcopy(vesa_vmem_buf, (void *)buf, bsize);
}
free(vesa_vmem_buf, M_DEVBUF);
vesa_vmem_buf = NULL;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r255000 - stable/9/sys/cam/scsi

2013-08-28 Thread Kenneth D. Merry
Author: ken
Date: Wed Aug 28 19:22:09 2013
New Revision: 255000
URL: http://svnweb.freebsd.org/changeset/base/255000

Log:
  MFC 254416:
  

r254416 | ken | 2013-08-16 10:14:32 -0600 (Fri, 16 Aug 2013) | 24 lines
  
Add unmapped I/O and larger I/O support to the sa(4) driver.
  
We now pay attention to the maxio field in the XPT_PATH_INQ CCB,
and if it is set, propagate it up to physio via the si_iosize_max
field in the cdev structure.
  
We also now pay attention to the PIM_UNMAPPED capability bit in the
XPT_PATH_INQ CCB, and set the new SI_UNMAPPED cdev flag when the
underlying SIM supports unmapped I/O.
  
scsi_sa.c:  Add unmapped I/O support and propagate the SIM's
maximum I/O size up.
  
Adjust scsi_tape_read_write() in the same way that
scsi_read_write() was changed to support unmapped
I/O.  We overload the readop parameter with bits
that tell us whether it's an unmapped I/O, and we
need to set the CAM_DATA_BIO CCB flag.  This change
should be backwards compatible in source and
binary forms.
  
Sponsored by:   Spectra Logic

Modified:
  stable/9/sys/cam/scsi/scsi_sa.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/cam/scsi/scsi_sa.c
==
--- stable/9/sys/cam/scsi/scsi_sa.c Wed Aug 28 19:06:22 2013
(r254999)
+++ stable/9/sys/cam/scsi/scsi_sa.c Wed Aug 28 19:22:09 2013
(r255000)
@@ -212,6 +212,7 @@ struct sa_softc {
sa_statestate;
sa_flagsflags;
sa_quirks   quirks;
+   u_int   si_flags;
struct  bio_queue_head bio_queue;
int queue_count;
struct  devstat *device_stats;
@@ -221,6 +222,7 @@ struct sa_softc {
int blk_shift;
u_int32_t   max_blk;
u_int32_t   min_blk;
+   u_int32_t   maxio;
u_int32_t   comp_algorithm;
u_int32_t   saved_comp_algorithm;
u_int32_t   media_blksize;
@@ -447,7 +449,7 @@ static struct cdevsw sa_cdevsw = {
.d_ioctl =  saioctl,
.d_strategy =   sastrategy,
.d_name =   sa,
-   .d_flags =  D_TAPE | D_NEEDGIANT,
+   .d_flags =  D_TAPE,
 };
 
 static int
@@ -1506,10 +1508,29 @@ saregister(struct cam_periph *periph, vo
DEVSTAT_BS_UNAVAILABLE, SID_TYPE(cgd-inq_data) |
XPORT_DEVSTAT_TYPE(cpi.transport), DEVSTAT_PRIORITY_TAPE);
 
+   /*
+* If maxio isn't set, we fall back to DFLTPHYS.  If it is set, we
+* take it whether or not it's larger than MAXPHYS.  physio will
+* break it down into pieces small enough to fit in a buffer.
+*/
+   if (cpi.maxio == 0)
+   softc-maxio = DFLTPHYS;
+   else
+   softc-maxio = cpi.maxio;
+
+   /*
+* If the SIM supports unmapped I/O, let physio know that we can
+* handle unmapped buffers.
+*/
+   if (cpi.hba_misc  PIM_UNMAPPED)
+   softc-si_flags = SI_UNMAPPED;
+
softc-devs.ctl_dev = make_dev(sa_cdevsw, SAMINOR(SA_CTLDEV,
0, SA_ATYPE_R), UID_ROOT, GID_OPERATOR,
0660, %s%d.ctl, periph-periph_name, periph-unit_number);
softc-devs.ctl_dev-si_drv1 = periph;
+   softc-devs.ctl_dev-si_iosize_max = softc-maxio;
+   softc-devs.ctl_dev-si_flags |= softc-si_flags;
 
for (i = 0; i  SA_NUM_MODES; i++) {
 
@@ -1518,18 +1539,24 @@ saregister(struct cam_periph *periph, vo
UID_ROOT, GID_OPERATOR, 0660, %s%d.%d,
periph-periph_name, periph-unit_number, i);
softc-devs.mode_devs[i].r_dev-si_drv1 = periph;
+   softc-devs.mode_devs[i].r_dev-si_iosize_max = softc-maxio;
+   softc-devs.mode_devs[i].r_dev-si_flags |= softc-si_flags;
 
softc-devs.mode_devs[i].nr_dev = make_dev(sa_cdevsw,
SAMINOR(SA_NOT_CTLDEV, i, SA_ATYPE_NR),
UID_ROOT, GID_OPERATOR, 0660, n%s%d.%d,
periph-periph_name, periph-unit_number, i);
softc-devs.mode_devs[i].nr_dev-si_drv1 = periph;
+   softc-devs.mode_devs[i].nr_dev-si_iosize_max = softc-maxio;
+   softc-devs.mode_devs[i].nr_dev-si_flags |= softc-si_flags;
 
softc-devs.mode_devs[i].er_dev = make_dev(sa_cdevsw,
SAMINOR(SA_NOT_CTLDEV, i, SA_ATYPE_ER),
UID_ROOT, GID_OPERATOR, 0660, e%s%d.%d,
periph-periph_name, periph-unit_number, i);
softc-devs.mode_devs[i].er_dev-si_drv1 = periph;
+   softc-devs.mode_devs[i].er_dev-si_iosize_max = softc-maxio;
+   

svn commit: r255001 - head/share/man/man4

2013-08-28 Thread Robert Watson
Author: rwatson
Date: Wed Aug 28 19:49:32 2013
New Revision: 255001
URL: http://svnweb.freebsd.org/changeset/base/255001

Log:
  Add a simple procdesc(4) man page describing options PROCDESC and the
  high-level facility, supplementing pdfork(2) and friends.  Update capsicum.4
  to xref.
  
  Suggested by: sbruno
  MFC after:3 days

Added:
  head/share/man/man4/procdesc.4   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/share/man/man4/capsicum.4

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileWed Aug 28 19:22:09 2013
(r255000)
+++ head/share/man/man4/MakefileWed Aug 28 19:49:32 2013
(r255001)
@@ -367,6 +367,7 @@ MAN=aac.4 \
ppbus.4 \
ppc.4 \
ppi.4 \
+   procdesc.4 \
psm.4 \
pst.4 \
pt.4 \

Modified: head/share/man/man4/capsicum.4
==
--- head/share/man/man4/capsicum.4  Wed Aug 28 19:22:09 2013
(r255000)
+++ head/share/man/man4/capsicum.4  Wed Aug 28 19:49:32 2013
(r255001)
@@ -1,5 +1,5 @@
 .\
-.\ Copyright (c) 2011 Robert N. M. Watson
+.\ Copyright (c) 2011, 2013 Robert N. M. Watson
 .\ Copyright (c) 2011 Jonathan Anderson
 .\ All rights reserved.
 .\
@@ -26,7 +26,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd September 20, 2011
+.Dd August 21, 2013
 .Dt CAPSICUM 4
 .Os
 .Sh NAME
@@ -78,10 +78,13 @@ objects using capabilities rather than g
 .Bl -tag -width indent
 .It process descriptors
 File descriptors representing processes, allowing parent processes to manage
-child processes without requiring access to the PID namespace.
+child processes without requiring access to the PID namespace; described in
+greater detail in
+.Xr procdesc 4 .
 .It anonymous shared memory
 An extension to the POSIX shared memory API to support anonymous swap objects
-associated with file descriptors.
+associated with file descriptors; described in greater detail in
+.Xr shm_open 2 .
 .El
 .Sh SEE ALSO
 .Xr cap_enter 2 ,
@@ -96,7 +99,8 @@ associated with file descriptors.
 .Xr pdwait4 2 ,
 .Xr read 2 ,
 .Xr shm_open 2 ,
-.Xr write 2
+.Xr write 2 ,
+.Xr procdesc 4 ,
 .Sh HISTORY
 .Nm
 first appeared in

Added: head/share/man/man4/procdesc.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/procdesc.4  Wed Aug 28 19:49:32 2013
(r255001)
@@ -0,0 +1,93 @@
+.\
+.\ Copyright (c) 2013 Robert N. M. Watson
+.\ All rights reserved.
+.\
+.\ This software was developed by SRI International and the University of
+.\ Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
+.\ (CTSRD), as part of the DARPA CRASH research programme.
+.\
+.\ Redistribution and use in source and binary forms, with or without
+.\ modification, are permitted provided that the following conditions
+.\ are met:
+.\ 1. Redistributions of source code must retain the above copyright
+.\notice, this list of conditions and the following disclaimer.
+.\ 2. Redistributions in binary form must reproduce the above copyright
+.\notice, this list of conditions and the following disclaimer in the
+.\documentation and/or other materials provided with the distribution.
+.\
+.\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\ SUCH DAMAGE.
+.\
+.\ $FreeBSD$
+.\
+.Dd August 21, 2013
+.Dt PROCDESC 4
+.Os
+.Sh NAME
+.Nm procdesc
+.Nd process descriptor facility
+.Sh SYNOPSIS
+.Cd options PROCDESC
+.Sh DESCRIPTION
+.Nm
+is a file-descriptor-oriented interface to process signalling and control,
+which supplements historic
+.Ux
+.Xr fork 2 ,
+.Xr kill 2 ,
+and
+.Xr wait4 2
+primitives with
+new system calls such as
+.Xr pdfork 2 ,
+.Xr pdkill 2 ,
+and
+.Xr pdwait4 2 .
+.Nm
+is designed for use with
+.Xr capsicum 4 ,
+replacing process identifiers with capability-oriented references.
+However, it can also be used independently of
+.Xr capsicum 4 ,
+displacing PIDs, which may otherwise suffer from race conditions.
+Given a process descriptor, it is possible to query its conventional PID using
+.Xr pdgetpid 2 .
+.Sh SEE 

svn commit: r255002 - head/lib/libc/sys

2013-08-28 Thread Robert Watson
Author: rwatson
Date: Wed Aug 28 20:00:25 2013
New Revision: 255002
URL: http://svnweb.freebsd.org/changeset/base/255002

Log:
  Xref capsicum(4) and procdesc(4) from pdfork(2).
  
  Suggested by: sbruno
  MFC after:3 days

Modified:
  head/lib/libc/sys/pdfork.2

Modified: head/lib/libc/sys/pdfork.2
==
--- head/lib/libc/sys/pdfork.2  Wed Aug 28 19:49:32 2013(r255001)
+++ head/lib/libc/sys/pdfork.2  Wed Aug 28 20:00:25 2013(r255002)
@@ -1,10 +1,14 @@
 .\
-.\ Copyright (c) 2009-2010, 2012 Robert N. M. Watson
+.\ Copyright (c) 2009-2010, 2012-2013 Robert N. M. Watson
 .\ All rights reserved.
 .\
 .\ This software was developed at the University of Cambridge Computer
 .\ Laboratory with support from a grant from Google, Inc.
 .\
+.\ This software was developed by SRI International and the University of
+.\ Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
+.\ (CTSRD), as part of the DARPA CRASH research programme.
+.\
 .\ Redistribution and use in source and binary forms, with or without
 .\ modification, are permitted provided that the following conditions
 .\ are met:
@@ -28,7 +32,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd February 25, 2012
+.Dd August 28, 2013
 .Dt PDFORK 2
 .Os
 .Sh NAME
@@ -71,7 +75,9 @@ Instead of the default terminate-on-clos
 live until it is explicitly killed with
 .Xr kill 2 .
 .Pp
-This option is not permitted in Capsicum capability mode (see
+This option is not permitted in
+.Xr capsicum 4
+capability mode (see
 .Xr cap_enter 2 ) .
 .El
 .Pp
@@ -119,6 +125,12 @@ is set; if the process is still alive an
 the last reference to the process descriptor, the process will be terminated
 with the signal
 .Dv SIGKILL .
+.Pp
+.Nm
+and associated functions depend on
+.Cd options PROCDESC
+described in
+.Xr procdesc 4 .
 .Sh RETURN VALUES
 .Fn pdfork
 returns a PID, 0 or -1, as
@@ -156,7 +168,9 @@ for
 .Xr fstat 2 ,
 .Xr kill 2 ,
 .Xr poll 2 ,
-.Xr wait4 2
+.Xr wait4 2 ,
+.Xr capsicum 4 ,
+.Xr procdesc 4
 .Sh HISTORY
 The
 .Fn pdfork ,
___
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: r255003 - head/sys/dev/qlxgbe

2013-08-28 Thread David C Somayajulu
Author: davidcs
Date: Wed Aug 28 20:07:00 2013
New Revision: 255003
URL: http://svnweb.freebsd.org/changeset/base/255003

Log:
  ql_minidump() should be performed only by port 0.
  
  Submitted by: David C Somayajulu

Modified:
  head/sys/dev/qlxgbe/ql_os.c

Modified: head/sys/dev/qlxgbe/ql_os.c
==
--- head/sys/dev/qlxgbe/ql_os.c Wed Aug 28 20:00:25 2013(r255002)
+++ head/sys/dev/qlxgbe/ql_os.c Wed Aug 28 20:07:00 2013(r255003)
@@ -1642,8 +1642,6 @@ qla_error_recovery(void *context, int pe
 
 QLA_UNLOCK(ha, __func__);
 
-   ql_minidump(ha);
-   
if ((ha-pci_func  0x1) == 0) {
 
if (!ha-msg_from_peer) {
@@ -1656,6 +1654,8 @@ qla_error_recovery(void *context, int pe
 
ha-msg_from_peer = 0;
 
+   ql_minidump(ha);
+
(void) ql_init_hw(ha);
qla_free_xmt_bufs(ha);
qla_free_rcv_bufs(ha);
___
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: r255004 - head/sys/dev/fb

2013-08-28 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug 28 20:10:56 2013
New Revision: 255004
URL: http://svnweb.freebsd.org/changeset/base/255004

Log:
  Reduce diff against stable/9 slightly.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==
--- head/sys/dev/fb/vesa.c  Wed Aug 28 20:07:00 2013(r255003)
+++ head/sys/dev/fb/vesa.c  Wed Aug 28 20:10:56 2013(r255004)
@@ -1506,6 +1506,7 @@ vesa_load_state(video_adapter_t *adp, vo
 
/* Try BIOS POST to restore a sane state. */
(void)vesa_bios_post();
+   bsize = adp-va_buffer_size;
mode = adp-va_mode;
error = vesa_set_mode(adp, adp-va_initial_mode);
if (mode != adp-va_initial_mode)
@@ -1514,10 +1515,8 @@ vesa_load_state(video_adapter_t *adp, vo
if (vesa_vmem_buf != NULL) {
if (error == 0  VESA_MODE(mode)) {
buf = (void *)adp-va_buffer;
-   if (buf != NULL) {
-   bsize = adp-va_buffer_size;
+   if (buf != NULL)
bcopy(vesa_vmem_buf, buf, bsize);
-   }
}
free(vesa_vmem_buf, M_DEVBUF);
vesa_vmem_buf = NULL;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r255005 - in head/sys/dev/cxgbe: . tom

2013-08-28 Thread Navdeep Parhar
Author: np
Date: Wed Aug 28 20:45:45 2013
New Revision: 255005
URL: http://svnweb.freebsd.org/changeset/base/255005

Log:
  Add hooks in base cxgbe(4) for the iWARP upper-layer driver.  Update a
  couple of assertions in the TOE driver as well.

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/offload.h
  head/sys/dev/cxgbe/osdep.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c
  head/sys/dev/cxgbe/tom/t4_cpl_io.c

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hWed Aug 28 20:10:56 2013
(r255004)
+++ head/sys/dev/cxgbe/adapter.hWed Aug 28 20:45:45 2013
(r255005)
@@ -567,6 +567,7 @@ struct adapter {
 #ifdef TCP_OFFLOAD
void *tom_softc;/* (struct tom_data *) */
struct tom_tunables tt;
+   void *iwarp_softc;  /* (struct c4iw_dev *) */
 #endif
struct l2t_data *l2t;   /* L2 table */
struct tid_info tids;

Modified: head/sys/dev/cxgbe/offload.h
==
--- head/sys/dev/cxgbe/offload.hWed Aug 28 20:10:56 2013
(r255004)
+++ head/sys/dev/cxgbe/offload.hWed Aug 28 20:45:45 2013
(r255005)
@@ -123,6 +123,7 @@ struct t4_virt_res {
 #ifdef TCP_OFFLOAD
 enum {
ULD_TOM = 1,
+   ULD_IWARP = 2,
 };
 
 struct adapter;

Modified: head/sys/dev/cxgbe/osdep.h
==
--- head/sys/dev/cxgbe/osdep.h  Wed Aug 28 20:10:56 2013(r255004)
+++ head/sys/dev/cxgbe/osdep.h  Wed Aug 28 20:45:45 2013(r255005)
@@ -45,6 +45,7 @@
 #define CH_ALERT(adap, fmt, ...) log(LOG_ALERT, fmt, ##__VA_ARGS__)
 #define CH_WARN_RATELIMIT(adap, fmt, ...) log(LOG_WARNING, fmt, ##__VA_ARGS__)
 
+#ifndef LINUX_TYPES_DEFINED
 typedef int8_t  s8;
 typedef int16_t s16;
 typedef int32_t s32;
@@ -156,5 +157,6 @@ strstrip(char *s)
 
return (r);
 }
+#endif /* LINUX_TYPES_DEFINED */
 
 #endif

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cWed Aug 28 20:10:56 2013
(r255004)
+++ head/sys/dev/cxgbe/t4_main.cWed Aug 28 20:45:45 2013
(r255005)
@@ -600,7 +600,6 @@ t4_attach(device_t dev)
t4_register_cpl_handler(sc, CPL_TRACE_PKT_T5, t5_trace_pkt);
t4_init_sge_cpl_handlers(sc);
 
-
/* Prepare the adapter for operation */
rc = -t4_prep_adapter(sc);
if (rc != 0) {

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Wed Aug 28 20:10:56 2013(r255004)
+++ head/sys/dev/cxgbe/t4_sge.c Wed Aug 28 20:45:45 2013(r255005)
@@ -1069,6 +1069,17 @@ service_iq(struct sge_iq *iq, int budget
(%s: budget %u, rsp_type %u, __func__,
budget, rsp_type));
 
+   /*
+* There are 1K interrupt-capable queues (qids 0
+* through 1023).  A response type indicating a
+* forwarded interrupt with a qid = 1K is an
+* iWARP async notification.
+*/
+   if (lq = 1024) {
+sc-an_handler(iq, ctrl);
+break;
+}
+
q = sc-sge.iqmap[lq - sc-sge.iq_start];
if (atomic_cmpset_int(q-state, IQS_IDLE,
IQS_BUSY)) {
@@ -1083,7 +1094,12 @@ service_iq(struct sge_iq *iq, int budget
break;
 
default:
-   sc-an_handler(iq, ctrl);
+   KASSERT(0,
+   (%s: illegal response type %d on iq %p,
+   __func__, rsp_type, iq));
+   log(LOG_ERR,
+   %s: illegal response type %d on iq %p,
+   device_get_nameunit(sc-dev), rsp_type, iq);
break;
}
 

Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c  Wed Aug 28 20:10:56 2013
(r255004)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c  Wed Aug 28 20:45:45 2013
(r255005)
@@ -548,9 +548,10 @@ t4_push_frames(struct adapter *sc, struc
KASSERT(toep-flags  TPF_FLOWC_WR_SENT,
(%s: flowc_wr not sent for tid %u., __func__, toep-tid));
 
-   if 

Re: svn commit: r254627 - in head: bin/chflags bin/ls lib/libc/gen lib/libc/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/msdosfs sys/fs/smbfs sys/sys sys/ufs/ufs

2013-08-28 Thread Bryan Drewery

On 2013-08-21 18:04, Kenneth D. Merry wrote:

Author: ken
Date: Wed Aug 21 23:04:48 2013
New Revision: 254627
URL: http://svnweb.freebsd.org/changeset/base/254627

Log:
  Expand the use of stat(2) flags to allow storing some Windows/DOS
  and CIFS file attributes as BSD stat(2) flags.

  This work is intended to be compatible with ZFS, the Solaris CIFS
  server's interaction with ZFS, somewhat compatible with MacOS X,
  and of course compatible with Windows.

  The Windows attributes that are implemented were chosen based on
  the attributes that ZFS already supports.

  The summary of the flags is as follows:

[...]


  UF_ARCHIVE:   Command line name: uarch, uarchive
ZFS_NAME: XAT_ARCHIVE, ZFS_ARCHIVE
Windows name: FILE_ATTRIBUTE_ARCHIVE

The UF_ARCHIVED flag means that the file has changed and
needs to be archived.  The meaning is same as
the Windows FILE_ATTRIBUTE_ARCHIVE attribute, and
the ZFS XAT_ARCHIVE and ZFS_ARCHIVE attribute.

msdosfs and ZFS have special handling for this flag.
i.e. they will set it when the file changes.


Is it intended that this flag is automatically added to all new and 
existing ZFS files?


# touch test
# ls -alo test
-rw-r--r--- 1 root wheel  uarch  0 Aug 28 15:46 test

This breaks 'cp -p' to tmpfs as tmpfs does not allow this flag.

# mkdir /tmp/tmpfs
# mount -t tmpfs tmpfs /tmp/tmpfs
# cp -f test /tmp/tmpfs
cp: test: Operation not supported


[...]

Modified: head/sys/ufs/ufs/ufs_vnops.c
==
--- head/sys/ufs/ufs/ufs_vnops.cWed Aug 21 22:57:29 2013
(r254626)
+++ head/sys/ufs/ufs/ufs_vnops.cWed Aug 21 23:04:48 2013
(r254627)
@@ -528,9 +528,11 @@ ufs_setattr(ap)
return (EINVAL);
}
if (vap-va_flags != VNOVAL) {
-   if ((vap-va_flags  ~(UF_NODUMP | UF_IMMUTABLE | UF_APPEND |
-   UF_OPAQUE | UF_NOUNLINK | SF_ARCHIVED | SF_IMMUTABLE |
-   SF_APPEND | SF_NOUNLINK | SF_SNAPSHOT)) != 0)
+   if ((vap-va_flags  ~(SF_APPEND | SF_ARCHIVED | SF_IMMUTABLE |
+   SF_NOUNLINK | SF_SNAPSHOT | UF_APPEND | UF_ARCHIVE |
+   UF_HIDDEN | UF_IMMUTABLE | UF_NODUMP | UF_NOUNLINK |
+   UF_OFFLINE | UF_OPAQUE | UF_READONLY | UF_REPARSE |
+   UF_SPARSE | UF_SYSTEM)) != 0)
return (EOPNOTSUPP);
if (vp-v_mount-mnt_flag  MNT_RDONLY)
return (EROFS);


Seems a similar change is needed in tmpfs_subr.c:tmpfs_chflags() 
(antoine pointed this 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: r255006 - in head/sys/dev/cxgbe: . tom

2013-08-28 Thread Navdeep Parhar
Author: np
Date: Wed Aug 28 20:59:22 2013
New Revision: 255006
URL: http://svnweb.freebsd.org/changeset/base/255006

Log:
  Change t4_list_lock and t4_uld_list_lock from mutexes to sx'es.
  
  - tom_uninit had to be reworked not to hold the adapter lock (a mutex)
around t4_deactivate_uld, which acquires the uld_list_lock.
  - the ifc_match for the interface cloner that creates the tracer ifnet
had to be reworked as the kernel calls ifc_match with the global
if_cloners_mtx held.

Modified:
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_tracer.c
  head/sys/dev/cxgbe/tom/t4_tom.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cWed Aug 28 20:45:45 2013
(r255005)
+++ head/sys/dev/cxgbe/t4_main.cWed Aug 28 20:59:22 2013
(r255006)
@@ -160,10 +160,10 @@ MALLOC_DEFINE(M_CXGBE, cxgbe, Chelsio
  * Correct lock order when you need to acquire multiple locks is t4_list_lock,
  * then ADAPTER_LOCK, then t4_uld_list_lock.
  */
-static struct mtx t4_list_lock;
+static struct sx t4_list_lock;
 static SLIST_HEAD(, adapter) t4_list;
 #ifdef TCP_OFFLOAD
-static struct mtx t4_uld_list_lock;
+static struct sx t4_uld_list_lock;
 static SLIST_HEAD(, uld_info) t4_uld_list;
 #endif
 
@@ -568,9 +568,9 @@ t4_attach(device_t dev)
snprintf(sc-lockname, sizeof(sc-lockname), %s,
device_get_nameunit(dev));
mtx_init(sc-sc_lock, sc-lockname, 0, MTX_DEF);
-   mtx_lock(t4_list_lock);
+   sx_xlock(t4_list_lock);
SLIST_INSERT_HEAD(t4_list, sc, link);
-   mtx_unlock(t4_list_lock);
+   sx_xunlock(t4_list_lock);
 
mtx_init(sc-sfl_lock, starving freelists, 0, MTX_DEF);
TAILQ_INIT(sc-sfl);
@@ -917,9 +917,9 @@ t4_detach(device_t dev)
free(sc-tids.ftid_tab, M_CXGBE);
t4_destroy_dma_tag(sc);
if (mtx_initialized(sc-sc_lock)) {
-   mtx_lock(t4_list_lock);
+   sx_xlock(t4_list_lock);
SLIST_REMOVE(t4_list, sc, adapter, link);
-   mtx_unlock(t4_list_lock);
+   sx_xunlock(t4_list_lock);
mtx_destroy(sc-sc_lock);
}
 
@@ -7341,7 +7341,7 @@ t4_iterate(void (*func)(struct adapter *
 {
struct adapter *sc;
 
-   mtx_lock(t4_list_lock);
+   sx_slock(t4_list_lock);
SLIST_FOREACH(sc, t4_list, link) {
/*
 * func should not make any assumptions about what state sc is
@@ -7349,7 +7349,7 @@ t4_iterate(void (*func)(struct adapter *
 */
func(sc, arg);
}
-   mtx_unlock(t4_list_lock);
+   sx_sunlock(t4_list_lock);
 }
 
 static int
@@ -7577,7 +7577,7 @@ t4_register_uld(struct uld_info *ui)
int rc = 0;
struct uld_info *u;
 
-   mtx_lock(t4_uld_list_lock);
+   sx_xlock(t4_uld_list_lock);
SLIST_FOREACH(u, t4_uld_list, link) {
if (u-uld_id == ui-uld_id) {
rc = EEXIST;
@@ -7588,7 +7588,7 @@ t4_register_uld(struct uld_info *ui)
SLIST_INSERT_HEAD(t4_uld_list, ui, link);
ui-refcount = 0;
 done:
-   mtx_unlock(t4_uld_list_lock);
+   sx_xunlock(t4_uld_list_lock);
return (rc);
 }
 
@@ -7598,7 +7598,7 @@ t4_unregister_uld(struct uld_info *ui)
int rc = EINVAL;
struct uld_info *u;
 
-   mtx_lock(t4_uld_list_lock);
+   sx_xlock(t4_uld_list_lock);
 
SLIST_FOREACH(u, t4_uld_list, link) {
if (u == ui) {
@@ -7613,7 +7613,7 @@ t4_unregister_uld(struct uld_info *ui)
}
}
 done:
-   mtx_unlock(t4_uld_list_lock);
+   sx_xunlock(t4_uld_list_lock);
return (rc);
 }
 
@@ -7625,7 +7625,7 @@ t4_activate_uld(struct adapter *sc, int 
 
ASSERT_SYNCHRONIZED_OP(sc);
 
-   mtx_lock(t4_uld_list_lock);
+   sx_slock(t4_uld_list_lock);
 
SLIST_FOREACH(ui, t4_uld_list, link) {
if (ui-uld_id == id) {
@@ -7636,7 +7636,7 @@ t4_activate_uld(struct adapter *sc, int 
}
}
 done:
-   mtx_unlock(t4_uld_list_lock);
+   sx_sunlock(t4_uld_list_lock);
 
return (rc);
 }
@@ -7649,7 +7649,7 @@ t4_deactivate_uld(struct adapter *sc, in
 
ASSERT_SYNCHRONIZED_OP(sc);
 
-   mtx_lock(t4_uld_list_lock);
+   sx_slock(t4_uld_list_lock);
 
SLIST_FOREACH(ui, t4_uld_list, link) {
if (ui-uld_id == id) {
@@ -7660,7 +7660,7 @@ t4_deactivate_uld(struct adapter *sc, in
}
}
 done:
-   mtx_unlock(t4_uld_list_lock);
+   sx_sunlock(t4_uld_list_lock);
 
return (rc);
 }
@@ -7741,10 +7741,10 @@ mod_event(module_t mod, int cmd, void *a
if (atomic_fetchadd_int(loaded, 1))
break;
t4_sge_modload();
-   mtx_init(t4_list_lock, T4 adapters, 0, MTX_DEF);
+   sx_init(t4_list_lock, T4/T5 adapters);

svn commit: r255007 - head/lib/libutil

2013-08-28 Thread Jilles Tjoelker
Author: jilles
Date: Wed Aug 28 21:10:37 2013
New Revision: 255007
URL: http://svnweb.freebsd.org/changeset/base/255007

Log:
  libutil: Use O_CLOEXEC for internal file descriptors from open().

Modified:
  head/lib/libutil/login_auth.c
  head/lib/libutil/login_cap.c
  head/lib/libutil/pidfile.c
  head/lib/libutil/quotafile.c
  head/lib/libutil/uucplock.c

Modified: head/lib/libutil/login_auth.c
==
--- head/lib/libutil/login_auth.c   Wed Aug 28 20:59:22 2013
(r255006)
+++ head/lib/libutil/login_auth.c   Wed Aug 28 21:10:37 2013
(r255007)
@@ -98,7 +98,7 @@ auth_cat(const char *file)
   int fd, count;
   char buf[BUFSIZ];
 
-  if ((fd = open(file, O_RDONLY))  0)
+  if ((fd = open(file, O_RDONLY | O_CLOEXEC))  0)
 return 0;
   while ((count = read(fd, buf, sizeof(buf)))  0)
 (void)write(fileno(stdout), buf, count);

Modified: head/lib/libutil/login_cap.c
==
--- head/lib/libutil/login_cap.cWed Aug 28 20:59:22 2013
(r255006)
+++ head/lib/libutil/login_cap.cWed Aug 28 21:10:37 2013
(r255007)
@@ -239,7 +239,7 @@ login_getclassbyname(char const *name, c
break;  /* Don't retry default on 'me' */
if (i == 0)
r = -1;
-   else if ((r = open(login_dbarray[0], O_RDONLY)) = 0)
+   else if ((r = open(login_dbarray[0], O_RDONLY | O_CLOEXEC)) = 0)
close(r);
/*
 * If there's at least one login class database,

Modified: head/lib/libutil/pidfile.c
==
--- head/lib/libutil/pidfile.c  Wed Aug 28 20:59:22 2013(r255006)
+++ head/lib/libutil/pidfile.c  Wed Aug 28 21:10:37 2013(r255007)
@@ -73,7 +73,7 @@ pidfile_read(const char *path, pid_t *pi
char buf[16], *endptr;
int error, fd, i;
 
-   fd = open(path, O_RDONLY);
+   fd = open(path, O_RDONLY | O_CLOEXEC);
if (fd == -1)
return (errno);
 

Modified: head/lib/libutil/quotafile.c
==
--- head/lib/libutil/quotafile.cWed Aug 28 20:59:22 2013
(r255006)
+++ head/lib/libutil/quotafile.cWed Aug 28 21:10:37 2013
(r255007)
@@ -137,7 +137,7 @@ quota_open(struct fstab *fs, int quotaty
goto error;
}
qf-accmode = openflags  O_ACCMODE;
-   if ((qf-fd = open(qf-qfname, qf-accmode))  0 
+   if ((qf-fd = open(qf-qfname, qf-accmode|O_CLOEXEC))  0 
(openflags  O_CREAT) != O_CREAT)
goto error;
/* File open worked, so process it */
@@ -168,7 +168,8 @@ quota_open(struct fstab *fs, int quotaty
/* not reached */
}
/* open failed, but O_CREAT was specified, so create a new file */
-   if ((qf-fd = open(qf-qfname, O_RDWR|O_CREAT|O_TRUNC, 0))  0)
+   if ((qf-fd = open(qf-qfname, O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC, 0)) 
+   0)
goto error;
qf-wordsize = 64;
memset(dqh, 0, sizeof(dqh));
@@ -534,7 +535,8 @@ quota_convert(struct quotafile *qf, int 
free(newqf);
return (-1);
}
-   if ((newqf-fd = open(qf-qfname, O_RDWR|O_CREAT|O_TRUNC, 0))  0) {
+   if ((newqf-fd = open(qf-qfname, O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC,
+   0))  0) {
serrno = errno;
goto error;
}

Modified: head/lib/libutil/uucplock.c
==
--- head/lib/libutil/uucplock.c Wed Aug 28 20:59:22 2013(r255006)
+++ head/lib/libutil/uucplock.c Wed Aug 28 21:10:37 2013(r255007)
@@ -76,7 +76,8 @@ uu_lock(const char *tty_name)
pid);
(void)snprintf(lckname, sizeof(lckname), _PATH_UUCPLOCK LOCKFMT,
tty_name);
-   if ((tmpfd = creat(lcktmpname, 0664))  0)
+   if ((tmpfd = open(lcktmpname, O_CREAT | O_TRUNC | O_WRONLY | O_CLOEXEC,
+   0664))  0)
GORET(0, UU_LOCK_CREAT_ERR);
 
for (i = 0; i  MAXTRIES; i++) {
@@ -88,7 +89,7 @@ uu_lock(const char *tty_name)
 * check to see if the process holding the lock
 * still exists
 */
-   if ((fd = open(lckname, O_RDONLY))  0)
+   if ((fd = open(lckname, O_RDONLY | O_CLOEXEC))  0)
GORET(1, UU_LOCK_OPEN_ERR);
 
if ((pid_old = get_pid (fd, err)) == -1)
@@ -132,7 +133,7 @@ uu_lock_txfr(const char *tty_name, pid_t
 
snprintf(lckname, sizeof(lckname), _PATH_UUCPLOCK LOCKFMT, tty_name);
 
-   if ((fd = open(lckname, O_RDWR))  0)
+   if ((fd = open(lckname, O_RDWR | O_CLOEXEC)) 

Re: svn commit: r254627 - in head: bin/chflags bin/ls lib/libc/gen lib/libc/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/msdosfs sys/fs/smbfs sys/sys sys/ufs/ufs

2013-08-28 Thread Kenneth D. Merry
On Wed, Aug 28, 2013 at 15:54:18 -0500, Bryan Drewery wrote:
 On 2013-08-21 18:04, Kenneth D. Merry wrote:
 Author: ken
 Date: Wed Aug 21 23:04:48 2013
 New Revision: 254627
 URL: http://svnweb.freebsd.org/changeset/base/254627
 
 Log:
   Expand the use of stat(2) flags to allow storing some Windows/DOS
   and CIFS file attributes as BSD stat(2) flags.
 
   This work is intended to be compatible with ZFS, the Solaris CIFS
   server's interaction with ZFS, somewhat compatible with MacOS X,
   and of course compatible with Windows.
 
   The Windows attributes that are implemented were chosen based on
   the attributes that ZFS already supports.
 
   The summary of the flags is as follows:
 [...]
 
   UF_ARCHIVE:Command line name: uarch, uarchive
  ZFS_NAME: XAT_ARCHIVE, ZFS_ARCHIVE
  Windows name: FILE_ATTRIBUTE_ARCHIVE
 
  The UF_ARCHIVED flag means that the file has changed and
  needs to be archived.  The meaning is same as
  the Windows FILE_ATTRIBUTE_ARCHIVE attribute, and
  the ZFS XAT_ARCHIVE and ZFS_ARCHIVE attribute.
 
  msdosfs and ZFS have special handling for this flag.
  i.e. they will set it when the file changes.
 
 Is it intended that this flag is automatically added to all new and 
 existing ZFS files?

Yes, that is intentional.  ZFS already has the flag internally, this just
exposes it to FreeBSD.  With ZFS at least, it is set any time a file
changes.  If an application clears it on files it has archived, it will
know when the file has changed and it needs to archive the file again.
This is the inverse (more or less) of the SF_ARCHIVED flag.

With UFS, the flag is just passed through and stored.

One application for this is to support CIFS servers that need to store
DOS/CIFS/Windows attributes on a FreeBSD server.

 # touch test
 # ls -alo test
 -rw-r--r--- 1 root wheel  uarch  0 Aug 28 15:46 test
 
 This breaks 'cp -p' to tmpfs as tmpfs does not allow this flag.
 
 # mkdir /tmp/tmpfs
 # mount -t tmpfs tmpfs /tmp/tmpfs
 # cp -f test /tmp/tmpfs
 cp: test: Operation not supported

Right.  For some filesystems, like UFS and probably tmpfs, the right answer
may be to just pass through most all of the file flags, and reject specific
flags that it doesn't support.

For some filesystems, like smbfs, the right answer seems to be to just
ignore flags that are set that aren't supported.

Other filesystems, like msdosfs, support a small number of flags and reject
any that aren't supported.

In other words, this isn't a new problem, and it would have cropped up if
you tried to copy a file with the SF_IMMUTABLE flag set from UFS to msdosfs
with cp -p.

 [...]
 Modified: head/sys/ufs/ufs/ufs_vnops.c
 ==
 --- head/sys/ufs/ufs/ufs_vnops.c Wed Aug 21 22:57:29 2013 (r254626)
 +++ head/sys/ufs/ufs/ufs_vnops.c Wed Aug 21 23:04:48 2013 (r254627)
 @@ -528,9 +528,11 @@ ufs_setattr(ap)
  return (EINVAL);
  }
  if (vap-va_flags != VNOVAL) {
 -if ((vap-va_flags  ~(UF_NODUMP | UF_IMMUTABLE | UF_APPEND |
 -UF_OPAQUE | UF_NOUNLINK | SF_ARCHIVED | SF_IMMUTABLE |
 -SF_APPEND | SF_NOUNLINK | SF_SNAPSHOT)) != 0)
 +if ((vap-va_flags  ~(SF_APPEND | SF_ARCHIVED | 
 SF_IMMUTABLE |
 +SF_NOUNLINK | SF_SNAPSHOT | UF_APPEND | UF_ARCHIVE |
 +UF_HIDDEN | UF_IMMUTABLE | UF_NODUMP | UF_NOUNLINK |
 +UF_OFFLINE | UF_OPAQUE | UF_READONLY | UF_REPARSE |
 +UF_SPARSE | UF_SYSTEM)) != 0)
  return (EOPNOTSUPP);
  if (vp-v_mount-mnt_flag  MNT_RDONLY)
  return (EROFS);
 
 Seems a similar change is needed in tmpfs_subr.c:tmpfs_chflags() 
 (antoine pointed this out)

Sure, I can fix tmpfs.

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


svn commit: r255008 - head/sys/fs/tmpfs

2013-08-28 Thread Kenneth D. Merry
Author: ken
Date: Wed Aug 28 22:12:56 2013
New Revision: 255008
URL: http://svnweb.freebsd.org/changeset/base/255008

Log:
  Support storing 7 additional file flags in tmpfs:
  
  UF_SYSTEM, UF_SPARSE, UF_OFFLINE, UF_REPARSE, UF_ARCHIVE, UF_READONLY,
  and UF_HIDDEN.
  
  Sort the file flags tmpfs supports alphabetically.  tmpfs now
  supports the same flags as UFS, with the exception of SF_SNAPSHOT.
  
  Reported by:  bdrewery, antoine
  Sponsored by: Spectra Logic

Modified:
  head/sys/fs/tmpfs/tmpfs_subr.c

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==
--- head/sys/fs/tmpfs/tmpfs_subr.c  Wed Aug 28 21:10:37 2013
(r255007)
+++ head/sys/fs/tmpfs/tmpfs_subr.c  Wed Aug 28 22:12:56 2013
(r255008)
@@ -1433,9 +1433,10 @@ tmpfs_chflags(struct vnode *vp, u_long f
 
node = VP_TO_TMPFS_NODE(vp);
 
-   if ((flags  ~(UF_NODUMP | UF_IMMUTABLE | UF_APPEND | UF_OPAQUE |
-   UF_NOUNLINK | SF_ARCHIVED | SF_IMMUTABLE | SF_APPEND |
-   SF_NOUNLINK)) != 0)
+   if ((flags  ~(SF_APPEND | SF_ARCHIVED | SF_IMMUTABLE | SF_NOUNLINK |
+   UF_APPEND | UF_ARCHIVE | UF_HIDDEN | UF_IMMUTABLE | UF_NODUMP |
+   UF_NOUNLINK | UF_OFFLINE | UF_OPAQUE | UF_READONLY | UF_REPARSE |
+   UF_SPARSE | UF_SYSTEM)) != 0)
return (EOPNOTSUPP);
 
/* Disallow this operation if the file system is mounted read-only. */
___
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: r255008 - head/sys/fs/tmpfs

2013-08-28 Thread Bryan Drewery

On 2013-08-28 17:12, Kenneth D. Merry wrote:

Author: ken
Date: Wed Aug 28 22:12:56 2013
New Revision: 255008
URL: http://svnweb.freebsd.org/changeset/base/255008

Log:
  Support storing 7 additional file flags in tmpfs:

  UF_SYSTEM, UF_SPARSE, UF_OFFLINE, UF_REPARSE, UF_ARCHIVE, 
UF_READONLY,

  and UF_HIDDEN.

  Sort the file flags tmpfs supports alphabetically.  tmpfs now
  supports the same flags as UFS, with the exception of SF_SNAPSHOT.

  Reported by:  bdrewery, antoine
  Sponsored by: Spectra Logic

Modified:
  head/sys/fs/tmpfs/tmpfs_subr.c




Thanks!
___
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: r255009 - head/sys/dev/drm2

2013-08-28 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug 28 22:57:49 2013
New Revision: 255009
URL: http://svnweb.freebsd.org/changeset/base/255009

Log:
  Fix a compiler warning.  With this fix, a negative time can be converted to
  a struct timeval and back to the original nanoseconds correctly.

Modified:
  head/sys/dev/drm2/drm_irq.c

Modified: head/sys/dev/drm2/drm_irq.c
==
--- head/sys/dev/drm2/drm_irq.c Wed Aug 28 22:12:56 2013(r255008)
+++ head/sys/dev/drm2/drm_irq.c Wed Aug 28 22:57:49 2013(r255009)
@@ -210,7 +210,7 @@ struct timeval
 ns_to_timeval(const int64_t nsec)
 {
 struct timeval tv;
-   uint32_t rem;
+   long rem;
 
if (nsec == 0) {
tv.tv_sec = 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: r255010 - head/sys/netinet

2013-08-28 Thread Navdeep Parhar
Author: np
Date: Wed Aug 28 23:00:34 2013
New Revision: 255010
URL: http://svnweb.freebsd.org/changeset/base/255010

Log:
  Merge r254336 from user/np/cxl_tuning.
  
  Add a last-modified timestamp to each LRO entry and provide an interface
  to flush all inactive entries.  Drivers decide when to flush and what
  the inactivity threshold should be.
  
  Network drivers that process an rx queue to completion can enter a
  livelock type situation when the rate at which packets are received
  reaches equilibrium with the rate at which the rx thread is processing
  them.  When this happens the final LRO flush (normally when the rx
  routine is done) does not occur.  Pure ACKs and segments with total
  payload  64K can get stuck in an LRO entry.  Symptoms are that TCP
  tx-mostly connections' performance falls off a cliff during heavy,
  unrelated rx on the interface.
  
  Flushing only inactive LRO entries works better than any of these
  alternates that I tried:
  - don't LRO pure ACKs
  - flush _all_ LRO entries periodically (every 'x' microseconds or every
'y' descriptors)
  - stop rx processing in the driver periodically and schedule remaining
work for later.
  
  Reviewed by:  andre

Modified:
  head/sys/netinet/tcp_lro.c
  head/sys/netinet/tcp_lro.h
Directory Properties:
  head/sys/   (props changed)

Modified: head/sys/netinet/tcp_lro.c
==
--- head/sys/netinet/tcp_lro.c  Wed Aug 28 22:57:49 2013(r255009)
+++ head/sys/netinet/tcp_lro.c  Wed Aug 28 23:00:34 2013(r255010)
@@ -194,6 +194,25 @@ tcp_lro_rx_csum_fixup(struct lro_entry *
 #endif
 
 void
+tcp_lro_flush_inactive(struct lro_ctrl *lc, const struct timeval *timeout)
+{
+   struct lro_entry *le, *le_tmp;
+   struct timeval tv;
+
+   if (SLIST_EMPTY(lc-lro_active))
+   return;
+
+   getmicrotime(tv);
+   timevalsub(tv, timeout);
+   SLIST_FOREACH_SAFE(le, lc-lro_active, next, le_tmp) {
+   if (timevalcmp(tv, le-mtime, =)) {
+   SLIST_REMOVE(lc-lro_active, le, lro_entry, next);
+   tcp_lro_flush(lc, le);
+   }
+   }
+}
+
+void
 tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le)
 {
 
@@ -543,7 +562,8 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
if (le-p_len  (65535 - lc-ifp-if_mtu)) {
SLIST_REMOVE(lc-lro_active, le, lro_entry, next);
tcp_lro_flush(lc, le);
-   }
+   } else
+   getmicrotime(le-mtime);
 
return (0);
}
@@ -556,6 +576,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m
le = SLIST_FIRST(lc-lro_free);
SLIST_REMOVE_HEAD(lc-lro_free, next);
SLIST_INSERT_HEAD(lc-lro_active, le, next);
+   getmicrotime(le-mtime);
 
/* Start filling in details. */
switch (eh_type) {

Modified: head/sys/netinet/tcp_lro.h
==
--- head/sys/netinet/tcp_lro.h  Wed Aug 28 22:57:49 2013(r255009)
+++ head/sys/netinet/tcp_lro.h  Wed Aug 28 23:00:34 2013(r255010)
@@ -30,6 +30,8 @@
 #ifndef _TCP_LRO_H_
 #define _TCP_LRO_H_
 
+#include sys/time.h
+
 struct lro_entry
 {
SLIST_ENTRY(lro_entry)  next;
@@ -59,6 +61,7 @@ struct lro_entry
uint32_ttsecr;
uint16_twindow;
uint16_ttimestamp;  /* flag, not a TCP hdr field. */
+   struct timeval  mtime;
 };
 SLIST_HEAD(lro_head, lro_entry);
 
@@ -83,6 +86,7 @@ struct lro_ctrl {
 
 int tcp_lro_init(struct lro_ctrl *);
 void tcp_lro_free(struct lro_ctrl *);
+void tcp_lro_flush_inactive(struct lro_ctrl *, const struct timeval *);
 void tcp_lro_flush(struct lro_ctrl *, struct lro_entry *);
 int tcp_lro_rx(struct lro_ctrl *, struct mbuf *, uint32_t);
 
___
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: r255011 - head/sys/dev/cxgbe

2013-08-28 Thread Navdeep Parhar
Author: np
Date: Wed Aug 28 23:15:05 2013
New Revision: 255011
URL: http://svnweb.freebsd.org/changeset/base/255011

Log:
  Whitespace nit.

Modified:
  head/sys/dev/cxgbe/t4_tracer.c

Modified: head/sys/dev/cxgbe/t4_tracer.c
==
--- head/sys/dev/cxgbe/t4_tracer.c  Wed Aug 28 23:00:34 2013
(r255010)
+++ head/sys/dev/cxgbe/t4_tracer.c  Wed Aug 28 23:15:05 2013
(r255011)
@@ -465,7 +465,7 @@ tracer_ioctl(struct ifnet *ifp, unsigned
switch (cmd) {
case SIOCSIFMTU:
case SIOCSIFFLAGS:
-   case SIOCADDMULTI:  
+   case SIOCADDMULTI:
case SIOCDELMULTI:
case SIOCSIFCAP:
break;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r255012 - head/sys/dev/drm2

2013-08-28 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug 28 23:43:28 2013
New Revision: 255012
URL: http://svnweb.freebsd.org/changeset/base/255012

Log:
  Fix a compiler warning and add couple of VM map types.

Modified:
  head/sys/dev/drm2/drm_sysctl.c

Modified: head/sys/dev/drm2/drm_sysctl.c
==
--- head/sys/dev/drm2/drm_sysctl.c  Wed Aug 28 23:15:05 2013
(r255011)
+++ head/sys/dev/drm2/drm_sysctl.c  Wed Aug 28 23:43:28 2013
(r255012)
@@ -177,7 +177,15 @@ static int drm_vm_info DRM_SYSCTL_HANDLE
 {
struct drm_device *dev = arg1;
drm_local_map_t *map, *tempmaps;
-   const char   *types[] = { FB, REG, SHM, AGP, SG };
+   const char *types[] = {
+   [_DRM_FRAME_BUFFER] = FB,
+   [_DRM_REGISTERS] = REG,
+   [_DRM_SHM] = SHM,
+   [_DRM_AGP] = AGP,
+   [_DRM_SCATTER_GATHER] = SG,
+   [_DRM_CONSISTENT] = CONS,
+   [_DRM_GEM] = GEM
+   };
const char *type, *yesno;
int i, mapcount;
char buf[128];
@@ -211,10 +219,20 @@ static int drm_vm_info DRM_SYSCTL_HANDLE
for (i = 0; i  mapcount; i++) {
map = tempmaps[i];
 
-   if (map-type  0 || map-type  4)
+   switch(map-type) {
+   default:
type = ??;
-   else
+   break;
+   case _DRM_FRAME_BUFFER:
+   case _DRM_REGISTERS:
+   case _DRM_SHM:
+   case _DRM_AGP:
+   case _DRM_SCATTER_GATHER:
+   case _DRM_CONSISTENT:
+   case _DRM_GEM:
type = types[map-type];
+   break;
+   }
 
if (!map-mtrr)
yesno = no;
___
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: r255013 - head/sys/dev/drm2/i915

2013-08-28 Thread Jung-uk Kim
Author: jkim
Date: Wed Aug 28 23:59:38 2013
New Revision: 255013
URL: http://svnweb.freebsd.org/changeset/base/255013

Log:
  Correct atomic operations in i915.

Modified:
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/dev/drm2/i915/i915_gem_execbuffer.c
  head/sys/dev/drm2/i915/intel_display.c

Modified: head/sys/dev/drm2/i915/i915_gem.c
==
--- head/sys/dev/drm2/i915/i915_gem.c   Wed Aug 28 23:43:28 2013
(r255012)
+++ head/sys/dev/drm2/i915/i915_gem.c   Wed Aug 28 23:59:38 2013
(r255013)
@@ -141,7 +141,7 @@ i915_gem_wait_for_error(struct drm_devic
}
mtx_unlock(dev_priv-error_completion_lock);
 
-   if (atomic_read(dev_priv-mm.wedged)) {
+   if (atomic_load_acq_int(dev_priv-mm.wedged)) {
mtx_lock(dev_priv-error_completion_lock);
dev_priv-error_completion++;
mtx_unlock(dev_priv-error_completion_lock);
@@ -743,7 +743,7 @@ i915_gem_ring_throttle(struct drm_device
int ret;
 
dev_priv = dev-dev_private;
-   if (atomic_read(dev_priv-mm.wedged))
+   if (atomic_load_acq_int(dev_priv-mm.wedged))
return (-EIO);
 
file_priv = file-driver_priv;
@@ -768,15 +768,15 @@ i915_gem_ring_throttle(struct drm_device
if (ring-irq_get(ring)) {
while (ret == 0 
!(i915_seqno_passed(ring-get_seqno(ring), seqno) ||
-   atomic_read(dev_priv-mm.wedged)))
+   atomic_load_acq_int(dev_priv-mm.wedged)))
ret = -msleep(ring, ring-irq_lock, PCATCH,
915thr, 0);
ring-irq_put(ring);
-   if (ret == 0  atomic_read(dev_priv-mm.wedged))
+   if (ret == 0  
atomic_load_acq_int(dev_priv-mm.wedged))
ret = -EIO;
} else if (_intel_wait_for(dev,
i915_seqno_passed(ring-get_seqno(ring), seqno) ||
-   atomic_read(dev_priv-mm.wedged), 3000, 0, 915rtr)) {
+   atomic_load_acq_int(dev_priv-mm.wedged), 3000, 0, 
915rtr)) {
ret = -EBUSY;
}
}

Modified: head/sys/dev/drm2/i915/i915_gem_execbuffer.c
==
--- head/sys/dev/drm2/i915/i915_gem_execbuffer.cWed Aug 28 23:43:28 
2013(r255012)
+++ head/sys/dev/drm2/i915/i915_gem_execbuffer.cWed Aug 28 23:59:38 
2013(r255013)
@@ -192,7 +192,7 @@ i915_gem_object_set_to_gpu_domain(struct
i915_gem_clflush_object(obj);
 
if (obj-base.pending_write_domain)
-   cd-flips |= atomic_read(obj-pending_flip);
+   cd-flips |= atomic_load_acq_int(obj-pending_flip);
 
/* The actual obj-write_domain will be updated with
 * pending_write_domain after we emit the accumulated flush for all

Modified: head/sys/dev/drm2/i915/intel_display.c
==
--- head/sys/dev/drm2/i915/intel_display.c  Wed Aug 28 23:43:28 2013
(r255012)
+++ head/sys/dev/drm2/i915/intel_display.c  Wed Aug 28 23:59:38 2013
(r255013)
@@ -2261,8 +2261,8 @@ intel_finish_fb(struct drm_framebuffer *
int ret;
 
mtx_lock(dev-event_lock);
-   while (!atomic_read(dev_priv-mm.wedged) 
-   atomic_read(obj-pending_flip) != 0) {
+   while (!atomic_load_acq_int(dev_priv-mm.wedged) 
+   atomic_load_acq_int(obj-pending_flip) != 0) {
msleep(obj-pending_flip, dev-event_lock,
0, 915flp, 0);
}
@@ -2948,7 +2948,7 @@ static void intel_crtc_wait_for_pending_
dev = crtc-dev;
dev_priv = dev-dev_private;
mtx_lock(dev-event_lock);
-   while (atomic_read(obj-pending_flip) != 0)
+   while (atomic_load_acq_int(obj-pending_flip) != 0)
msleep(obj-pending_flip, dev-event_lock, 0, 915wfl, 0);
mtx_unlock(dev-event_lock);
 }
@@ -7333,7 +7333,7 @@ static void do_intel_finish_page_flip(st
obj = work-old_fb_obj;
 
atomic_clear_int(obj-pending_flip, 1  intel_crtc-plane);
-   if (atomic_read(obj-pending_flip) == 0)
+   if (atomic_load_acq_int(obj-pending_flip) == 0)
wakeup(obj-pending_flip);
mtx_unlock(dev-event_lock);
 
@@ -7640,7 +7640,7 @@ static int intel_crtc_page_flip(struct d
return 0;
 
 cleanup_pending:
-   atomic_sub(1  intel_crtc-plane, work-old_fb_obj-pending_flip);
+   atomic_clear_int(work-old_fb_obj-pending_flip, 1  
intel_crtc-plane);
drm_gem_object_unreference(work-old_fb_obj-base);
drm_gem_object_unreference(obj-base);
DRM_UNLOCK(dev);
___
svn-src-all@freebsd.org mailing list

svn commit: r255014 - in head: gnu/usr.bin/patch share/mk tools/build/options usr.bin/patch

2013-08-28 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Aug 29 00:38:24 2013
New Revision: 255014
URL: http://svnweb.freebsd.org/changeset/base/255014

Log:
  Drop build option switch for the older GNU patch.
  
  As promised, drop the option to make the older GNU patch
  the default.
  
  GNU patch is still being built but something drastic may
  happen to it to it before Release.

Deleted:
  head/tools/build/options/WITH_GNU_PATCH
Modified:
  head/gnu/usr.bin/patch/Makefile
  head/share/mk/bsd.own.mk
  head/usr.bin/patch/Makefile

Modified: head/gnu/usr.bin/patch/Makefile
==
--- head/gnu/usr.bin/patch/Makefile Wed Aug 28 23:59:38 2013
(r255013)
+++ head/gnu/usr.bin/patch/Makefile Thu Aug 29 00:38:24 2013
(r255014)
@@ -1,16 +1,10 @@
 # $FreeBSD$
 
-.include bsd.own.mk
-
-.if ${MK_GNU_PATCH} == yes
-PROG=  patch
-.else
 PROG=  gnupatch
 CLEANFILES+= gnupatch.1
 
 gnupatch.1: patch.1
cp ${.ALLSRC} ${.TARGET}
-.endif
 
 SRCS=   backupfile.c inp.c patch.c pch.c util.c version.c
 CFLAGS+=-DHAVE_CONFIG_H

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkWed Aug 28 23:59:38 2013(r255013)
+++ head/share/mk/bsd.own.mkThu Aug 29 00:38:24 2013(r255014)
@@ -373,7 +373,6 @@ __DEFAULT_NO_OPTIONS = \
 CLANG_EXTRAS \
 CTF \
 DEBUG_FILES \
-GNU_PATCH \
 GPL_DTC \
 HESIOD \
 LIBICONV_COMPAT \

Modified: head/usr.bin/patch/Makefile
==
--- head/usr.bin/patch/Makefile Wed Aug 28 23:59:38 2013(r255013)
+++ head/usr.bin/patch/Makefile Thu Aug 29 00:38:24 2013(r255014)
@@ -1,17 +1,7 @@
 #  $OpenBSD: Makefile,v 1.4 2005/05/16 15:22:46 espie Exp $
 # $FreeBSD$
 
-.include bsd.own.mk
-
-.if ${MK_GNU_PATCH} == yes
-PROG=  bsdpatch
-CLEANFILES+= bsdpatch.1
-
-bsdpatch.1: patch.1
-   cp ${.ALLSRC} ${.TARGET}
-.else
 PROG=  patch
-.endif
 
 SRCS=  backupfile.c inp.c mkpath.c patch.c pch.c util.c
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org