svn commit: r245500 - head/sys/arm/allwinner

2013-01-16 Thread Ganbold Tsagaankhuu
Author: ganbold (doc committer)
Date: Wed Jan 16 08:04:55 2013
New Revision: 245500
URL: http://svnweb.freebsd.org/changeset/base/245500

Log:
  Fix style bugs
  Use defined constant instead of variable for reg_shift
  Change u_int32_t to uint32_t
  
  Approved by: gonzo
  Suggested by: bde, wkoszek

Modified:
  head/sys/arm/allwinner/console.c

Modified: head/sys/arm/allwinner/console.c
==
--- head/sys/arm/allwinner/console.cWed Jan 16 07:39:20 2013
(r245499)
+++ head/sys/arm/allwinner/console.cWed Jan 16 08:04:55 2013
(r245500)
@@ -40,43 +40,39 @@ __FBSDID("$FreeBSD$");
 #defineA10_UART_BASE   0xe1c28000  /* UART0 */
 #endif
 
-int reg_shift = 2;
+#defineREG_SHIFT   2
 
-#define UART_DLL0   /* Out: Divisor Latch Low */
-#define UART_DLM1   /* Out: Divisor Latch High */
-#define UART_FCR2   /* Out: FIFO Control Register */
-#define UART_LCR3   /* Out: Line Control Register */
-#define UART_MCR4   /* Out: Modem Control Register */
-#define UART_LSR5   /* In:  Line Status Register */
-#define UART_LSR_THRE   0x20/* Transmit-hold-register empty */
-#define UART_LSR_DR 0x01/* Receiver data ready */
-#define UART_MSR6   /* In:  Modem Status Register */
-#define UART_SCR7   /* I/O: Scratch Register */
+#defineUART_DLL0   /* Out: Divisor Latch Low */
+#defineUART_DLM1   /* Out: Divisor Latch High */
+#defineUART_FCR2   /* Out: FIFO Control Register */
+#defineUART_LCR3   /* Out: Line Control Register */
+#defineUART_MCR4   /* Out: Modem Control Register */
+#defineUART_LSR5   /* In:  Line Status Register */
+#defineUART_LSR_THRE   0x20/* Transmit-hold-register empty */
+#defineUART_LSR_DR 0x01/* Receiver data ready */
+#defineUART_MSR6   /* In:  Modem Status Register */
+#defineUART_SCR7   /* I/O: Scratch Register */
 
-
-/*
- * uart related funcs
- */
-static u_int32_t
-uart_getreg(u_int32_t *bas)
+static uint32_t
+uart_getreg(uint32_t *bas)
 {
-   return *((volatile u_int32_t *)(bas)) & 0xff;
+   return *((volatile uint32_t *)(bas)) & 0xff;
 }
 
 static void
-uart_setreg(u_int32_t *bas, u_int32_t val)
+uart_setreg(uint32_t *bas, uint32_t val)
 {
-   *((volatile u_int32_t *)(bas)) = (u_int32_t)val;
+   *((volatile uint32_t *)(bas)) = val;
 }
 
 static int
 ub_getc(void)
 {
-   while ((uart_getreg((u_int32_t *)(A10_UART_BASE + 
-   (UART_LSR << reg_shift))) & UART_LSR_DR) == 0);
+   while ((uart_getreg((uint32_t *)(A10_UART_BASE + 
+   (UART_LSR << REG_SHIFT))) & UART_LSR_DR) == 0);
__asm __volatile("nop");
 
-   return (uart_getreg((u_int32_t *)A10_UART_BASE) & 0xff);
+   return (uart_getreg((uint32_t *)A10_UART_BASE) & 0xff);
 }
 
 static void
@@ -85,11 +81,11 @@ ub_putc(unsigned char c)
if (c == '\n')
ub_putc('\r');
 
-   while ((uart_getreg((u_int32_t *)(A10_UART_BASE + 
-   (UART_LSR << reg_shift))) & UART_LSR_THRE) == 0)
+   while ((uart_getreg((uint32_t *)(A10_UART_BASE + 
+   (UART_LSR << REG_SHIFT))) & UART_LSR_THRE) == 0)
__asm __volatile("nop");
 
-   uart_setreg((u_int32_t *)A10_UART_BASE, c);
+   uart_setreg((uint32_t *)A10_UART_BASE, c);
 }
 
 static cn_probe_t  uart_cnprobe;
@@ -121,8 +117,8 @@ uart_cnprobe(struct consdev *cp)
 static void
 uart_cninit(struct consdev *cp)
 {
-   uart_setreg((u_int32_t *)(A10_UART_BASE + 
-   (UART_FCR << reg_shift)), 0x06);
+   uart_setreg((uint32_t *)(A10_UART_BASE + 
+   (UART_FCR << REG_SHIFT)), 0x06);
 }
 
 void
___
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: r245450 - in head/sys: arm/allwinner arm/conf boot/fdt/dts

2013-01-16 Thread Ganbold Tsagaankhuu
On Wed, Jan 16, 2013 at 2:43 PM, Bruce Evans  wrote:
> On Tue, 15 Jan 2013, Wojciech A. Koszek wrote:
>
>> On Tue, Jan 15, 2013 at 08:26:16AM +, Ganbold Tsagaankhuu wrote:
>>>
>>> ...
>>>
>>> Added: head/sys/arm/allwinner/console.c
>>>
>>> ==
>>> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
>>> +++ head/sys/arm/allwinner/console.cTue Jan 15 08:26:16 2013
>>> (r245450)
>>> @@ -0,0 +1,146 @@
>>
>> [..]
>>>
>>> +#ifndefA10_UART_BASE
>>> +#defineA10_UART_BASE   0xe1c28000  /* UART0 */
>>> +#endif
>>> +
>>> +int reg_shift = 2;
>>
>>
>> Could you make it static and move it below defines?
>>
>>> +#define UART_DLL0   /* Out: Divisor Latch Low */
>>> +#define UART_DLM1   /* Out: Divisor Latch High */
>>> +#define UART_FCR2   /* Out: FIFO Control Register */
>>> +#define UART_LCR3   /* Out: Line Control Register */
>>> +#define UART_MCR4   /* Out: Modem Control Register */
>>> +#define UART_LSR5   /* In:  Line Status Register */
>>> +#define UART_LSR_THRE   0x20/* Transmit-hold-register empty */
>>> +#define UART_LSR_DR 0x01/* Receiver data ready */
>>> +#define UART_MSR6   /* In:  Modem Status Register */
>>> +#define UART_SCR7   /* I/O: Scratch Register */
>
>
> These are ordinary 16450 values which are defined in .
>
> This is misformatted with a space instead of a tab after #define.
>
> Since it's a 16450, uart(4) can probably handle the entire console driver,
> with fewer bugs (some locking is required in a general console driver).
> Of course, it's easier to write a primitive console driver by hacking on
> the raw registers than to interface with uart.
>
>
>>> +
>>> +
>>> +/*
>>> + * uart related funcs
>>> + */
>
>
> Style bugs (extra and missing blank lines, and comment punctuation).
>
>
>>> +static u_int32_t
>>> +uart_getreg(u_int32_t *bas)
>>> +{
>>> +   return *((volatile u_int32_t *)(bas)) & 0xff;
>>> +}
>
>
> It's better to put the reg_shift complications at the lowest level.
>
> reg_shift could probably be const or #defined so that all the calculations
> with it can be done at runtime.
>
>
>>> +
>>> +static void
>>> +uart_setreg(u_int32_t *bas, u_int32_t val)
>>> +{
>>> +   *((volatile u_int32_t *)(bas)) = (u_int32_t)val;
>>> +}
>
>
> Bogus cast.  val already has type u_int32_t.  u_int32_t should be spelled
> uint32_t in new code.
>
>
>>> +
>>> +static int
>>> +ub_getc(void)
>>> +{
>>> +   while ((uart_getreg((u_int32_t *)(A10_UART_BASE +
>>> +   (UART_LSR << reg_shift))) & UART_LSR_DR) == 0);
>>> +   __asm __volatile("nop");
>>> +
>>> +   return (uart_getreg((u_int32_t *)A10_UART_BASE) & 0xff);
>>> +}
>>> +
>>> +static void
>>> +ub_putc(unsigned char c)
>>> +{
>>> +   if (c == '\n')
>>> +   ub_putc('\r');
>
>
> The normal console driver does this in upper layers.  Is this driver
> only for a very specialized console driver for use at boot time?
> I'm not sure if uart(4) works then.

Current ns16550 driver doesn't work yet at boot time for A10.

Ganbold

>
>
>>> +
>>> +   while ((uart_getreg((u_int32_t *)(A10_UART_BASE +
>>> +   (UART_LSR << reg_shift))) & UART_LSR_THRE) == 0)
>>> +   __asm __volatile("nop");
>>> +
>>> +   uart_setreg((u_int32_t *)A10_UART_BASE, c);
>>> +}
>>
>>
>> Why aren't bus_* methods used here for accessing memory?
>
>
> They don't support reg_shift, but should work otherwise.  You do the
> shifting somewhere and then use bus-space at the level of uart_getreg()
> above.
>
> Bruce
___
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: r245494 - head/bin/pwait

2013-01-16 Thread Eitan Adler
On 16 January 2013 01:49, Xin LI  wrote:
> This doesn't seem right -- you should never release memory before exit,
> especially for memory allocated in main(), unless this "main" is intended
> for different purpose like a monolithic shell that wants to avoid exec().
> Note that pwait(1) have multiple exit points I don't think it's practical.

...

There have been multiple conversations about this: on hackers, on the
commit lists, and on the clang analyzer lists.

I don't care much how the final code looks: with either free or return
but please make sure that scan-build finds no warnings.

-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
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: r245494 - head/bin/pwait

2013-01-16 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 01/16/13 09:47, Eitan Adler wrote:
> On 16 January 2013 01:49, Xin LI  wrote:
>> This doesn't seem right -- you should never release memory before
>> exit, especially for memory allocated in main(), unless this
>> "main" is intended for different purpose like a monolithic shell
>> that wants to avoid exec(). Note that pwait(1) have multiple exit
>> points I don't think it's practical.
> 
> ...
> 
> There have been multiple conversations about this: on hackers, on
> the commit lists, and on the clang analyzer lists.
> 
> I don't care much how the final code looks: with either free or
> return but please make sure that scan-build finds no warnings.

Yes I did.  Using exit(3) tells clang that this is the final exit and
thus eliminates the warning.

It sounds like a bug (or arguably a feature) that clang does not
recognize return in main()s...

Cheers,
- -- 
Xin LI https://www.delphij.net/
FreeBSD - The Power to Serve!   Live free or die
-BEGIN PGP SIGNATURE-

iQEcBAEBCgAGBQJQ9u1oAAoJEG80Jeu8UPuzNF8IAIuLlVRawKYSgvW0Qqf01Pt3
l6UvBc/6U0LBVTgRUVNVDqlvjyP93pcnMpDGiGqGf/1TbizWhahIayB7NxPQoiqE
8iFRYxhMXJL+pMgckgB3twGOrXkSCCaWhudmNlx9pPXac2dqCFF4PXugVAV1xVVx
JfdkCHhSMH+MVhzxkPN4XtZTvH288UiaeWRsCLEzVwylYOvMqslW0WhJYRCpn6ee
XXeBBN8D/aYOPehHZ7/UhzatxIUOQMaW509rituOZ6IKF5PAHhPQsXwIRiG85mIb
tbppR2Pwm0wg/mOFcr44P/zhdeiR4+JW1Tk65mmleoLsq8aufzT/OjJnVcD6860=
=nsUL
-END PGP SIGNATURE-
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r245506 - head/bin/pwait

2013-01-16 Thread Xin LI
Author: delphij
Date: Wed Jan 16 18:15:25 2013
New Revision: 245506
URL: http://svnweb.freebsd.org/changeset/base/245506

Log:
  Use a different way to silence clang analyzer as done in r245494 by
  explicitly telling the compiler that we are on the exit route.
  
  X-MFC:together with r245494

Modified:
  head/bin/pwait/pwait.c

Modified: head/bin/pwait/pwait.c
==
--- head/bin/pwait/pwait.c  Wed Jan 16 09:07:49 2013(r245505)
+++ head/bin/pwait/pwait.c  Wed Jan 16 18:15:25 2013(r245506)
@@ -141,6 +141,5 @@ main(int argc, char *argv[])
nleft -= n;
}
 
-   free(e);
-   return 0;
+   exit(EX_OK);
 }
___
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: r245494 - head/bin/pwait

2013-01-16 Thread Garrett Cooper
On Jan 16, 2013, at 10:11 AM, Xin Li  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA512
> 
> On 01/16/13 09:47, Eitan Adler wrote:
>> On 16 January 2013 01:49, Xin LI  wrote:
>>> This doesn't seem right -- you should never release memory before
>>> exit, especially for memory allocated in main(), unless this
>>> "main" is intended for different purpose like a monolithic shell
>>> that wants to avoid exec(). Note that pwait(1) have multiple exit
>>> points I don't think it's practical.
>> 
>> ...
>> 
>> There have been multiple conversations about this: on hackers, on
>> the commit lists, and on the clang analyzer lists.
>> 
>> I don't care much how the final code looks: with either free or
>> return but please make sure that scan-build finds no warnings.
> 
> Yes I did.  Using exit(3) tells clang that this is the final exit and
> thus eliminates the warning.
> 
> It sounds like a bug (or arguably a feature) that clang does not
> recognize return in main()s...

I would consider it a bug, but it's better to use exit(3) anyhow as it 
prevents bugs from occurring in other OSes (like windows when you use atexit 
and posix-compliant signal handlers).
Thanks,
-Garrett
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r245494 - head/bin/pwait

2013-01-16 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 01/16/13 10:17, Garrett Cooper wrote:
> On Jan 16, 2013, at 10:11 AM, Xin Li  wrote:
> 
>> -BEGIN PGP SIGNED MESSAGE- Hash: SHA512
>> 
>> On 01/16/13 09:47, Eitan Adler wrote:
>>> On 16 January 2013 01:49, Xin LI  wrote:
 This doesn't seem right -- you should never release memory
 before exit, especially for memory allocated in main(),
 unless this "main" is intended for different purpose like a
 monolithic shell that wants to avoid exec(). Note that
 pwait(1) have multiple exit points I don't think it's
 practical.
>>> 
>>> ...
>>> 
>>> There have been multiple conversations about this: on hackers,
>>> on the commit lists, and on the clang analyzer lists.
>>> 
>>> I don't care much how the final code looks: with either free
>>> or return but please make sure that scan-build finds no
>>> warnings.
>> 
>> Yes I did.  Using exit(3) tells clang that this is the final exit
>> and thus eliminates the warning.
>> 
>> It sounds like a bug (or arguably a feature) that clang does not 
>> recognize return in main()s...
> 
> I would consider it a bug, but it's better to use exit(3) anyhow as
> it prevents bugs from occurring in other OSes (like windows when
> you use atexit and posix-compliant signal handlers).

Well, calling exit(3) actually do less on C++ (dtor's are not called
in this case, if any local object is declared on stack, which is done
when the code say 'return') but the difference is less on C.

In style(9) there is no explicit mention of using exit(3) but the
example do use exit() instead of return() for main().

By the way speaking for exit(3) preventing bugs on other OSes, do you
have reference to these issue?  It sounds weird as I would see these
as serious leakage which are normally fixed very quickly and we
shouldn't be the first people who seeing them...

Cheers,
- -- 
Xin LI https://www.delphij.net/
FreeBSD - The Power to Serve!   Live free or die
-BEGIN PGP SIGNATURE-

iQEcBAEBCgAGBQJQ9vRQAAoJEG80Jeu8UPuz5KEH/RP2XYZvg2kB7vraWe08uIcs
gcwYH4GVbxKbLWWjdSpBHLXVoPqOy7/n3UcKKt27vPzxo+VAiWZJUXPk9PZo0ePb
WYqLEzjtfsYWbbIzdHzaB0pUQZ/QuzyFWICj7mkgJQwdTcejlsLAjZ4kqxfuj0wB
kPPZ0zKPDT2CR7v/DgHkMMHshuuEw7xm1gij4y6ggVP/Hi4laJVmhJq1+h99Jrtu
CrzUDRerXGwPg0qWP9xDylrHGOwAERgUWNgO6gJ1BP+LkAnltCcojFQZd3gs2epb
HSS3ejrrR2IRM5jmBFW1L+SyKZHhDOvFtNHAoeAnAOp6Ay4R9U3hy+sVRtO6Oe8=
=6JOJ
-END PGP SIGNATURE-
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r245494 - head/bin/pwait

2013-01-16 Thread John Baldwin
On Wednesday, January 16, 2013 1:49:40 am Xin LI wrote:
> This doesn't seem right -- you should never release memory before exit,
> especially for memory allocated in main(), unless this "main" is intended
> for different purpose like a monolithic shell that wants to avoid exec().
>  Note that pwait(1) have multiple exit points I don't think it's practical.
> 
> Would you mind if I commit this changeset instead?  I have the return ->
> exit change in my queue long ago but only noticed it today...

I think the free shouldn't be there as well, but I think requiring an exit() 
instead of return to "fix" it is bogus as well.  The static analyzer is just
broken in this case.  main() is special and returns from it should be
treated like exit() and not cause false warnings about memory leaks.

-- 
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: r245507 - head/share/misc

2013-01-16 Thread Carl Delsey
Author: carl
Date: Wed Jan 16 19:05:49 2013
New Revision: 245507
URL: http://svnweb.freebsd.org/changeset/base/245507

Log:
  Add myself and my mentor relationship.
  
  Approved by:  jimharris (mentor)

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Wed Jan 16 18:15:25 2013
(r245506)
+++ head/share/misc/committers-src.dot  Wed Jan 16 19:05:49 2013
(r245507)
@@ -117,6 +117,7 @@ bruno [label="Bruno Ducrot\nbruno@FreeBS
 bryanv [label="Bryan Venteicher\nbry...@freebsd.org\n2012/11/03"]
 bschmidt [label="Bernhard Schmidt\nbschm...@freebsd.org\n2010/02/06"]
 bz [label="Bjoern A. Zeeb\n...@freebsd.org\n2004/07/27"]
+carl [label="Carl Delsey\nc...@freebsd.org\n2013/01/14"]
 cognet [label="Olivier Houchard\ncog...@freebsd.org\n2002/10/09"]
 cokane [label="Coleman Kane\ncok...@freebsd.org\n2000/06/19"]
 cperciva [label="Colin Percival\ncperc...@freebsd.org\n2004/01/20"]
@@ -454,6 +455,8 @@ jhb -> peterj
 jhb -> pfg
 jhb -> rnoland
 
+jimharris -> carl
+
 jkh -> grog
 jkh -> imp
 jkh -> jlemon
___
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: r245494 - head/bin/pwait

2013-01-16 Thread Eitan Adler
On 16 January 2013 13:11, Xin Li  wrote:

> Yes I did.  Using exit(3) tells clang that this is the final exit and
> thus eliminates the warning.
>
> It sounds like a bug (or arguably a feature) that clang does not
> recognize return in main()s...

It is not a bug: see
http://clang-developers.42468.n3.nabble.com/Static-analyzer-possible-memory-leak-false-positive-td4026706.html

-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
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: r245494 - head/bin/pwait

2013-01-16 Thread Garrett Cooper
On Wed, Jan 16, 2013 at 10:41 AM, Xin Li  wrote:

...

> Well, calling exit(3) actually do less on C++ (dtor's are not called
> in this case, if any local object is declared on stack, which is done
> when the code say 'return') but the difference is less on C.

Good to know -- thanks!

> In style(9) there is no explicit mention of using exit(3) but the
> example do use exit() instead of return() for main().

There's a fair amount of subtlety in style(9) ;)...

> By the way speaking for exit(3) preventing bugs on other OSes, do you
> have reference to these issue?  It sounds weird as I would see these
> as serious leakage which are normally fixed very quickly and we
> shouldn't be the first people who seeing them...

It wasn't really leakage, and it was only Windows (AFAICT) which is
its own special case. MSVC++ has copious warnings about using POSIX
APIs anyhow, so I figure it's a bad idea to depend on POSIX on Windows
:(...

There's a program that we have at $work that does dd equivalent logic
for writing/verifying files and what was happening is that whenever
the atexit handler was entered (basically whenever the terminating
condition was met) it would segfault on Windows. It might have been a
bug in terms of it entering the atexit(3) handler recursively (which
didn't occur on other OSes, e.g. FreeBSD, Linux, and OSX), but I
didn't take the time to track down the exact culprit (my goal was to
only stop the bleeding ;)..).

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


Re: svn commit: r245494 - head/bin/pwait

2013-01-16 Thread Xin Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 01/16/13 08:11, John Baldwin wrote:
> On Wednesday, January 16, 2013 1:49:40 am Xin LI wrote:
>> This doesn't seem right -- you should never release memory before
>> exit, especially for memory allocated in main(), unless this
>> "main" is intended for different purpose like a monolithic shell
>> that wants to avoid exec(). Note that pwait(1) have multiple exit
>> points I don't think it's practical.
>> 
>> Would you mind if I commit this changeset instead?  I have the
>> return -> exit change in my queue long ago but only noticed it
>> today...
> 
> I think the free shouldn't be there as well, but I think requiring
> an exit() instead of return to "fix" it is bogus as well.  The
> static analyzer is just broken in this case.  main() is special and
> returns from it should be treated like exit() and not cause false
> warnings about memory leaks.

Well, being a horrible idea itself to redefine main() to something
else and expect the module to do no harm to its caller, I think Eitan
still have a valid point that it could be a bad idea to ban this in
wholesale within compiler, as the C standard don't ban using return's
in main().

In style(9) the examples do use exit() for main() by the way.

Cheers,
- -- 
Xin LI https://www.delphij.net/
FreeBSD - The Power to Serve!   Live free or die
-BEGIN PGP SIGNATURE-

iQEcBAEBCgAGBQJQ9x1eAAoJEG80Jeu8UPuzIGsH/ia5cFVA2Uo6w1tEvbbAVMUi
+A580EYdQNdCFYVVGCIr6ZoCuZYsYqJdU0wT+xKjpE5qwaCfWVkESWbUGFVKUmFt
F1bFZfVu1TgntopYFj5goRyUVvsEutUgh/D8khZSKn9Mnu6ijbeq2CKJi0SyhySw
FcmGzp2YNk1B5BW8N8c4oRpLGvwtXPO4QBf5VAEoPU4ItY8bTukH2u09jOKaoh+7
J5eMU8KqWmxcuj6v5/8mb5iUN0oMprbdhVrpb0UpvIfM+TMQ3ISEbyJ5KeHW6dkV
5FLiu3arMe1p3k2yLrGYLB19lZfwtz3gM8QyorqAGK64uNY5oqwsA3UlIo01w48=
=V4kG
-END PGP SIGNATURE-
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r245508 - in head/sys: fs/nfs fs/nfsclient nfsclient

2013-01-16 Thread John Baldwin
Author: jhb
Date: Wed Jan 16 21:52:31 2013
New Revision: 245508
URL: http://svnweb.freebsd.org/changeset/base/245508

Log:
  Use the VA_UTIMES_NULL flag to detect when NULL was passed to utimes()
  instead of comparing the desired time against the current time as a
  heuristic.
  
  Reviewed by:  rmacklem
  MFC after:1 week

Modified:
  head/sys/fs/nfs/nfs_commonsubs.c
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/nfsclient/nfs_subs.c

Modified: head/sys/fs/nfs/nfs_commonsubs.c
==
--- head/sys/fs/nfs/nfs_commonsubs.cWed Jan 16 19:05:49 2013
(r245507)
+++ head/sys/fs/nfs/nfs_commonsubs.cWed Jan 16 21:52:31 2013
(r245508)
@@ -1998,7 +1998,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd
struct statfs fs;
struct nfsfsinfo fsinf;
struct timespec temptime;
-   struct timeval curtime;
NFSACL_T *aclp, *naclp = NULL;
 #ifdef QUOTA
struct dqblk dqb;
@@ -2412,8 +2411,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd
retnum += NFSX_V4TIME;
break;
case NFSATTRBIT_TIMEACCESSSET:
-   NFSGETTIME(&curtime);
-   if (vap->va_atime.tv_sec != curtime.tv_sec) {
+   if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME);
*tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT);
txdr_nfsv4time(&vap->va_atime, tl);
@@ -2442,8 +2440,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd
retnum += NFSX_V4TIME;
break;
case NFSATTRBIT_TIMEMODIFYSET:
-   NFSGETTIME(&curtime);
-   if (vap->va_mtime.tv_sec != curtime.tv_sec) {
+   if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
NFSM_BUILD(tl, u_int32_t *, NFSX_V4SETTIME);
*tl++ = txdr_unsigned(NFSV4SATTRTIME_TOCLIENT);
txdr_nfsv4time(&vap->va_mtime, tl);

Modified: head/sys/fs/nfsclient/nfs_clport.c
==
--- head/sys/fs/nfsclient/nfs_clport.c  Wed Jan 16 19:05:49 2013
(r245507)
+++ head/sys/fs/nfsclient/nfs_clport.c  Wed Jan 16 21:52:31 2013
(r245508)
@@ -789,7 +789,7 @@ nfscl_fillsattr(struct nfsrv_descript *n
*tl = newnfs_false;
}
if (vap->va_atime.tv_sec != VNOVAL) {
-   if (vap->va_atime.tv_sec != curtime.tv_sec) {
+   if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&vap->va_atime, tl);
@@ -802,7 +802,7 @@ nfscl_fillsattr(struct nfsrv_descript *n
*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
if (vap->va_mtime.tv_sec != VNOVAL) {
-   if (vap->va_mtime.tv_sec != curtime.tv_sec) {
+   if ((vap->va_vaflags & VA_UTIMES_NULL) == 0) {
NFSM_BUILD(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&vap->va_mtime, tl);

Modified: head/sys/nfsclient/nfs_subs.c
==
--- head/sys/nfsclient/nfs_subs.c   Wed Jan 16 19:05:49 2013
(r245507)
+++ head/sys/nfsclient/nfs_subs.c   Wed Jan 16 21:52:31 2013
(r245508)
@@ -1110,7 +1110,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in
*tl = nfs_false;
}
if (va->va_atime.tv_sec != VNOVAL) {
-   if (va->va_atime.tv_sec != time_second) {
+   if ((va->va_vaflags & VA_UTIMES_NULL) == 0) {
tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&va->va_atime, tl);
@@ -1123,7 +1123,7 @@ nfsm_v3attrbuild_xx(struct vattr *va, in
*tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
}
if (va->va_mtime.tv_sec != VNOVAL) {
-   if (va->va_mtime.tv_sec != time_second) {
+   if ((va->va_vaflags & VA_UTIMES_NULL) == 0) {
tl = nfsm_build_xx(3 * NFSX_UNSIGNED, mb, bpos);
*tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
txdr_nfsv3time(&va->va_mtime, tl);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/lis

Re: svn commit: r244401 - in head: contrib/libc-vis include lib/libc/gen

2013-01-16 Thread Dimitry Andric

On 2013-01-11 00:41, Brooks Davis wrote:

On Sun, Dec 23, 2012 at 01:54:08AM +0100, Dimitry Andric wrote:

On 2012-12-18 17:37, Brooks Davis wrote:

Author: brooks
Date: Tue Dec 18 16:37:24 2012
New Revision: 244401
URL: http://svnweb.freebsd.org/changeset/base/244401

Log:
Replace our implementation of the vis(3) and unvis(3) APIs with
NetBSD's.  This output size limited versions of vis and unvis functions
as well as a set of vis variants that allow arbitrary characters to be
specified for encoding.


This seems to break bootstrapping in some scenarios, in "stage 4.2:
building libraries"; for example, with a test run with gcc on
ref10-amd64.f.o I got this:

gcc  -O2 -pipe  -I/scratch2/tmp/dim/head/lib/libc/include 
-I/scratch2/tmp/dim/head/lib/libc/../../include 
-I/scratch2/tmp/dim/head/lib/libc/amd64 -DNLS  -D__DBINTERFACE_PRIVATE 
-I/scratch2/tmp/dim/head/lib/libc/../../contrib/gdtoa -DINET6 
-I/scratch2/tmp/dim/obj/scratch2/tmp/dim/head/lib/libc 
-I/scratch2/tmp/dim/head/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE 
-I/scratch2/tmp/dim/head/lib/libc/../../contrib/jemalloc/include 
-I/scratch2/tmp/dim/head/lib/libc/../../contrib/tzcode/stdtime 
-I/scratch2/tmp/dim/head/lib/libc/stdtime 
-I/scratch2/tmp/dim/head/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN 
-I/scratch2/tmp/dim/head/lib/libc/rpc -DYP -DNS_CACHING -D_FREEFALL_CONFIG 
-DSYMBOL_VERSIONING -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall 
-Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -c 
/scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/vis.c -o vis.o
/scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c: In function 
'unvis':
/scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error: 
'VIS_NOESCAPE' undeclared (first use in this function)
/scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error: 
(Each undeclared identifier is reported only once
/scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error: for 
each function it appears in.)
/scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:241: error: 
'VIS_HTTP1808' undeclared (first use in this function)
/scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:245: error: 
'VIS_HTTP1866' undeclared (first use in this function)
/scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:249: error: 
'VIS_MIMESTYLE' undeclared (first use in this function)

There should most likely be an explicit -I option to point the compiler
at the correct vis.h header during the early stages, otherwise it will
pick up /usr/include/vis.h, which does not have several of these new
VIS_XXX defines.


Sorry for not following up on this sooner.  I've not seen this at all
and most of my builds are done on an 9.0-STABLE box so vis.h isn't
updated.  Adding

CFLAGS+=-I${CURDIR}/../../contrib/libc-vis

to lib/libc/gen/Makefile.inc seems like it should fix this, but I'm
surprised not to have bumped into this or broken tinderbox.  Is there
anything odd about your buildworld command?


Not really, the environment was just this:

1) Building on ref10-amd64.f.o
2) CC=gcc, CXX=g++, CPP=gcpp

Did you manage to reproduce the failure?
___
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: r245510 - vendor-sys/illumos/dist/uts/common/fs/zfs

2013-01-16 Thread Xin LI
Author: delphij
Date: Wed Jan 16 22:50:40 2013
New Revision: 245510
URL: http://svnweb.freebsd.org/changeset/base/245510

Log:
  Update and vendor-sys/illumos/dist to illumos-gate
  13910:f3454e0a097c
  (illumos zfs issue #3447: improve the comment in txg.c)

Modified:
  vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c

Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c
==
--- vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Wed Jan 16 22:06:00 
2013(r245509)
+++ vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Wed Jan 16 22:50:40 
2013(r245510)
@@ -21,7 +21,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Portions Copyright 2011 Martin Matuska
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
  */
 
 #include 
@@ -33,7 +33,76 @@
 #include 
 
 /*
- * Pool-wide transaction groups.
+ * ZFS Transaction Groups
+ * --
+ *
+ * ZFS transaction groups are, as the name implies, groups of transactions
+ * that act on persistent state. ZFS asserts consistency at the granularity of
+ * these transaction groups. Each successive transaction group (txg) is
+ * assigned a 64-bit consecutive identifier. There are three active
+ * transaction group states: open, quiescing, or syncing. At any given time,
+ * there may be an active txg associated with each state; each active txg may
+ * either be processing, or blocked waiting to enter the next state. There may
+ * be up to three active txgs, and there is always a txg in the open state
+ * (though it may be blocked waiting to enter the quiescing state). In broad
+ * strokes, transactions — operations that change in-memory structures — are
+ * accepted into the txg in the open state, and are completed while the txg is
+ * in the open or quiescing states. The accumulated changes are written to
+ * disk in the syncing state.
+ *
+ * Open
+ *
+ * When a new txg becomes active, it first enters the open state. New
+ * transactions — updates to in-memory structures — are assigned to the
+ * currently open txg. There is always a txg in the open state so that ZFS can
+ * accept new changes (though the txg may refuse new changes if it has hit
+ * some limit). ZFS advances the open txg to the next state for a variety of
+ * reasons such as it hitting a time or size threshold, or the execution of an
+ * administrative action that must be completed in the syncing state.
+ *
+ * Quiescing
+ *
+ * After a txg exits the open state, it enters the quiescing state. The
+ * quiescing state is intended to provide a buffer between accepting new
+ * transactions in the open state and writing them out to stable storage in
+ * the syncing state. While quiescing, transactions can continue their
+ * operation without delaying either of the other states. Typically, a txg is
+ * in the quiescing state very briefly since the operations are bounded by
+ * software latencies rather than, say, slower I/O latencies. After all
+ * transactions complete, the txg is ready to enter the next state.
+ *
+ * Syncing
+ *
+ * In the syncing state, the in-memory state built up during the open and (to
+ * a lesser degree) the quiescing states is written to stable storage. The
+ * process of writing out modified data can, in turn modify more data. For
+ * example when we write new blocks, we need to allocate space for them; those
+ * allocations modify metadata (space maps)... which themselves must be
+ * written to stable storage. During the sync state, ZFS iterates, writing out
+ * data until it converges and all in-memory changes have been written out.
+ * The first such pass is the largest as it encompasses all the modified user
+ * data (as opposed to filesystem metadata). Subsequent passes typically have
+ * far less data to write as they consist exclusively of filesystem metadata.
+ *
+ * To ensure convergence, after a certain number of passes ZFS begins
+ * overwriting locations on stable storage that had been allocated earlier in
+ * the syncing state (and subsequently freed). ZFS usually allocates new
+ * blocks to optimize for large, continuous, writes. For the syncing state to
+ * converge however it must complete a pass where no new blocks are allocated
+ * since each allocation requires a modification of persistent metadata.
+ * Further, to hasten convergence, after a prescribed number of passes, ZFS
+ * also defers frees, and stops compressing.
+ *
+ * In addition to writing out user data, we must also execute synctasks during
+ * the syncing context. A synctask is the mechanism by which some
+ * administrative activities work such as creating and destroying snapshots or
+ * datasets. Note that when a synctask is initiated it enters the open txg,
+ * and ZFS then pushes that txg as quickly as possible to completion of the
+ * syncing state in order to reduce the latency of the ad

Re: svn commit: r245458 - head/lib/libc/sys

2013-01-16 Thread Eitan Adler
On 15 January 2013 09:09, Andrey Zonov  wrote:
> -.Va errno
> -is set to indicate an error.

ISTR that this is not shown in the -std text.  Can this be retained?


-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
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: r245511 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2013-01-16 Thread Xin LI
Author: delphij
Date: Wed Jan 16 22:59:50 2013
New Revision: 245511
URL: http://svnweb.freebsd.org/changeset/base/245511

Log:
  MFV r245510:
  
  improve the comment in txg.c
  
  Obtained from:Illumos (13910:f3454e0a097c)
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c   Wed Jan 16 
22:50:40 2013(r245510)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c   Wed Jan 16 
22:59:50 2013(r245511)
@@ -21,7 +21,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Portions Copyright 2011 Martin Matuska 
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
  */
 
 #include 
@@ -33,7 +33,76 @@
 #include 
 
 /*
- * Pool-wide transaction groups.
+ * ZFS Transaction Groups
+ * --
+ *
+ * ZFS transaction groups are, as the name implies, groups of transactions
+ * that act on persistent state. ZFS asserts consistency at the granularity of
+ * these transaction groups. Each successive transaction group (txg) is
+ * assigned a 64-bit consecutive identifier. There are three active
+ * transaction group states: open, quiescing, or syncing. At any given time,
+ * there may be an active txg associated with each state; each active txg may
+ * either be processing, or blocked waiting to enter the next state. There may
+ * be up to three active txgs, and there is always a txg in the open state
+ * (though it may be blocked waiting to enter the quiescing state). In broad
+ * strokes, transactions — operations that change in-memory structures — are
+ * accepted into the txg in the open state, and are completed while the txg is
+ * in the open or quiescing states. The accumulated changes are written to
+ * disk in the syncing state.
+ *
+ * Open
+ *
+ * When a new txg becomes active, it first enters the open state. New
+ * transactions — updates to in-memory structures — are assigned to the
+ * currently open txg. There is always a txg in the open state so that ZFS can
+ * accept new changes (though the txg may refuse new changes if it has hit
+ * some limit). ZFS advances the open txg to the next state for a variety of
+ * reasons such as it hitting a time or size threshold, or the execution of an
+ * administrative action that must be completed in the syncing state.
+ *
+ * Quiescing
+ *
+ * After a txg exits the open state, it enters the quiescing state. The
+ * quiescing state is intended to provide a buffer between accepting new
+ * transactions in the open state and writing them out to stable storage in
+ * the syncing state. While quiescing, transactions can continue their
+ * operation without delaying either of the other states. Typically, a txg is
+ * in the quiescing state very briefly since the operations are bounded by
+ * software latencies rather than, say, slower I/O latencies. After all
+ * transactions complete, the txg is ready to enter the next state.
+ *
+ * Syncing
+ *
+ * In the syncing state, the in-memory state built up during the open and (to
+ * a lesser degree) the quiescing states is written to stable storage. The
+ * process of writing out modified data can, in turn modify more data. For
+ * example when we write new blocks, we need to allocate space for them; those
+ * allocations modify metadata (space maps)... which themselves must be
+ * written to stable storage. During the sync state, ZFS iterates, writing out
+ * data until it converges and all in-memory changes have been written out.
+ * The first such pass is the largest as it encompasses all the modified user
+ * data (as opposed to filesystem metadata). Subsequent passes typically have
+ * far less data to write as they consist exclusively of filesystem metadata.
+ *
+ * To ensure convergence, after a certain number of passes ZFS begins
+ * overwriting locations on stable storage that had been allocated earlier in
+ * the syncing state (and subsequently freed). ZFS usually allocates new
+ * blocks to optimize for large, continuous, writes. For the syncing state to
+ * converge however it must complete a pass where no new blocks are allocated
+ * since each allocation requires a modification of persistent metadata.
+ * Further, to hasten convergence, after a prescribed number of passes, ZFS
+ * also defers frees, and stops compressing.
+ *
+ * In addition to writing out user data, we must also execute synctasks during
+ * the syncing context. A synctask is the mechanism by which some
+ * administrative activities work such as creating and destroying snapshots or
+ * datasets. Note that when a synctask is initiated it enters the open txg,
+ * and ZFS then pushes 

svn commit: r245512 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/di...

2013-01-16 Thread Xin LI
Author: delphij
Date: Wed Jan 16 23:11:13 2013
New Revision: 245512
URL: http://svnweb.freebsd.org/changeset/base/245512

Log:
  Update vendor/illumos/dist and vendor-sys/illumos/dist
  to illumos-gate 13921:9d721847e469
  (illumos zfs issue #3035 LZ4 compression support in ZFS and GRUB)

Modified:
  vendor/illumos/dist/man/man1m/zfs.1m
  vendor/illumos/dist/man/man5/zpool-features.5

Changes in other areas also in this revision:
Added:
  vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4
  vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip
  vendor-sys/illumos/dist/uts/common/fs/zfs/lz4.c   (contents, props changed)
Modified:
  vendor-sys/illumos/dist/common/zfs/zfeature_common.c
  vendor-sys/illumos/dist/common/zfs/zfeature_common.h
  vendor-sys/illumos/dist/common/zfs/zfs_prop.c
  vendor-sys/illumos/dist/uts/common/Makefile.files
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_compress.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/zio_compress.c

Modified: vendor/illumos/dist/man/man1m/zfs.1m
==
--- vendor/illumos/dist/man/man1m/zfs.1mWed Jan 16 22:59:50 2013
(r245511)
+++ vendor/illumos/dist/man/man1m/zfs.1mWed Jan 16 23:11:13 2013
(r245512)
@@ -25,6 +25,7 @@
 .\" Copyright (c) 2012 by Delphix. All rights reserved.
 .\" Copyright (c) 2012, Joyent, Inc. All rights reserved.
 .\" Copyright 2012 Nexenta Systems, Inc. All Rights Reserved.
+.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
 .\"
 .TH ZFS 1M "Sep 16, 2012"
 .SH NAME
@@ -912,7 +913,7 @@ Changing this property affects only newl
 .ne 2
 .na
 \fB\fBcompression\fR=\fBon\fR | \fBoff\fR | \fBlzjb\fR | \fBgzip\fR |
-\fBgzip-\fR\fIN\fR | \fBzle\fR\fR
+\fBgzip-\fR\fIN\fR | \fBzle\fR\fR | \fBlz4\fR
 .ad
 .sp .6
 .RS 4n
@@ -926,6 +927,14 @@ value \fBgzip-\fR\fIN\fR where \fIN\fR i
 (which is also the default for \fBgzip\fR(1)). The \fBzle\fR compression
 algorithm compresses runs of zeros.
 .sp
+The \fBlz4\fR compression algorithm is a high-performance replacement
+for the \fBlzjb\fR algorithm. It features significantly faster
+compression and decompression, as well as a moderately higher
+compression ratio than \fBlzjb\fR, but can only be used on pools with
+the \fBlz4_compress\fR feature set to \fIenabled\fR. See
+\fBzpool-features\fR(5) for details on ZFS feature flags and the
+\fBlz4_compress\fR feature.
+.sp
 This property can also be referred to by its shortened column name
 \fBcompress\fR. Changing this property affects only newly-written data.
 .RE

Modified: vendor/illumos/dist/man/man5/zpool-features.5
==
--- vendor/illumos/dist/man/man5/zpool-features.5   Wed Jan 16 22:59:50 
2013(r245511)
+++ vendor/illumos/dist/man/man5/zpool-features.5   Wed Jan 16 23:11:13 
2013(r245512)
@@ -1,5 +1,6 @@
 '\" te
 .\" Copyright (c) 2012 by Delphix. All rights reserved.
+.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
 .\" The contents of this file are subject to the terms of the Common 
Development
 .\" and Distribution License (the "License").  You may not use this file except
 .\" in compliance with the License. You can obtain a copy of the license at
@@ -197,5 +198,38 @@ This feature is \fBactive\fR while there
 or snapshots which were created after enabling this feature.
 .RE
 
+.sp
+.ne 2
+.na
+\fB\fBlz4_compress\fR\fR
+.ad
+.RS 4n
+.TS
+l l .
+GUID   org.illumos:lz4_compress
+READ\-ONLY COMPATIBLE  no
+DEPENDENCIES   none
+.TE
+
+\fBlz4\fR is a high-performance real-time compression algorithm that
+features significantly faster compression and decompression as well as a
+higher compression ratio than the older \fBlzjb\fR compression.
+Typically, \fBlz4\fR compression is approximately 50% faster on
+compressible data and 200% faster on incompressible data than
+\fBlzjb\fR. It is also approximately 80% faster on decompression, while
+giving approximately 10% better compression ratio.
+
+When the \fBlz4_compress\fR feature is set to \fBenabled\fR, the
+administrator can turn on \fBlz4\fR compression on any dataset on the
+pool using the \fBzfs\fR(1M) command. Please note that doing so will
+immediately activate the \fBlz4_compress\fR feature on the underlying
+pool (even before any data is written). Since this feature is not
+read-only compatible, this operation will render the pool unimportable
+on systems without support for the \fBlz4_compress\fR feature. At the
+moment, this operation cannot be reversed. Booting off of
+\fBlz4\fR-compressed root pools is supported.
+
+.RE
+
 .SH "SEE ALSO"
 \fBzpool\fR(1M)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "

svn commit: r245512 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/di...

2013-01-16 Thread Xin LI
Author: delphij
Date: Wed Jan 16 23:11:13 2013
New Revision: 245512
URL: http://svnweb.freebsd.org/changeset/base/245512

Log:
  Update vendor/illumos/dist and vendor-sys/illumos/dist
  to illumos-gate 13921:9d721847e469
  (illumos zfs issue #3035 LZ4 compression support in ZFS and GRUB)

Added:
  vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4
  vendor-sys/illumos/dist/uts/common/fs/zfs/THIRDPARTYLICENSE.lz4.descrip
  vendor-sys/illumos/dist/uts/common/fs/zfs/lz4.c   (contents, props changed)
Modified:
  vendor-sys/illumos/dist/common/zfs/zfeature_common.c
  vendor-sys/illumos/dist/common/zfs/zfeature_common.h
  vendor-sys/illumos/dist/common/zfs/zfs_prop.c
  vendor-sys/illumos/dist/uts/common/Makefile.files
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_compress.h
  vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c
  vendor-sys/illumos/dist/uts/common/fs/zfs/zio_compress.c

Changes in other areas also in this revision:
Modified:
  vendor/illumos/dist/man/man1m/zfs.1m
  vendor/illumos/dist/man/man5/zpool-features.5

Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c
==
--- vendor-sys/illumos/dist/common/zfs/zfeature_common.cWed Jan 16 
22:59:50 2013(r245511)
+++ vendor-sys/illumos/dist/common/zfs/zfeature_common.cWed Jan 16 
23:11:13 2013(r245512)
@@ -21,6 +21,7 @@
 
 /*
  * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
  */
 
 #ifdef _KERNEL
@@ -156,4 +157,7 @@ zpool_feature_init(void)
zfeature_register(SPA_FEATURE_EMPTY_BPOBJ,
"com.delphix:empty_bpobj", "empty_bpobj",
"Snapshots use less space.", B_TRUE, B_FALSE, NULL);
+   zfeature_register(SPA_FEATURE_LZ4_COMPRESS,
+   "org.illumos:lz4_compress", "lz4_compress",
+   "LZ4 compression algorithm support.", B_FALSE, B_FALSE, NULL);
 }

Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.h
==
--- vendor-sys/illumos/dist/common/zfs/zfeature_common.hWed Jan 16 
22:59:50 2013(r245511)
+++ vendor-sys/illumos/dist/common/zfs/zfeature_common.hWed Jan 16 
23:11:13 2013(r245512)
@@ -21,6 +21,7 @@
 
 /*
  * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
  */
 
 #ifndef _ZFEATURE_COMMON_H
@@ -52,6 +53,7 @@ typedef int (zfeature_func_t)(zfeature_i
 enum spa_feature {
SPA_FEATURE_ASYNC_DESTROY,
SPA_FEATURE_EMPTY_BPOBJ,
+   SPA_FEATURE_LZ4_COMPRESS,
SPA_FEATURES
 } spa_feature_t;
 

Modified: vendor-sys/illumos/dist/common/zfs/zfs_prop.c
==
--- vendor-sys/illumos/dist/common/zfs/zfs_prop.c   Wed Jan 16 22:59:50 
2013(r245511)
+++ vendor-sys/illumos/dist/common/zfs/zfs_prop.c   Wed Jan 16 23:11:13 
2013(r245512)
@@ -21,6 +21,7 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2011 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
  */
 
 /* Portions Copyright 2010 Robert Milkowski */
@@ -96,6 +97,7 @@ zfs_prop_init(void)
{ "gzip-8", ZIO_COMPRESS_GZIP_8 },
{ "gzip-9", ZIO_COMPRESS_GZIP_9 },
{ "zle",ZIO_COMPRESS_ZLE },
+   { "lz4",ZIO_COMPRESS_LZ4 },
{ NULL }
};
 
@@ -211,8 +213,8 @@ zfs_prop_init(void)
zprop_register_index(ZFS_PROP_COMPRESSION, "compression",
ZIO_COMPRESS_DEFAULT, PROP_INHERIT,
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
-   "on | off | lzjb | gzip | gzip-[1-9] | zle", "COMPRESS",
-   compress_table);
+   "on | off | lzjb | gzip | gzip-[1-9] | zle | lz4",
+   "COMPRESS", compress_table);
zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN,
PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
"hidden | visible", "SNAPDIR", snapdir_table);

Modified: vendor-sys/illumos/dist/uts/common/Makefile.files
==
--- vendor-sys/illumos/dist/uts/common/Makefile.files   Wed Jan 16 22:59:50 
2013(r245511)
+++ vendor-sys/illumos/dist/uts/common/Makefile.files   Wed Jan 16 23:11:13 
2013(r245512)
@@ -23,6 +23,7 @@
 # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved.
 # Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
 #
 
 #
@@ -1353,6 +1354,7 @@ ZFS_COMMON_OBJS +=\
dsl_scan.o  \
 

svn commit: r245513 - in head: . etc/mtree

2013-01-16 Thread Brooks Davis
Author: brooks
Date: Wed Jan 16 23:16:41 2013
New Revision: 245513
URL: http://svnweb.freebsd.org/changeset/base/245513

Log:
  According to the notes in ObsoleteFiles.inc we last installed section
  1aout manpages in 2002.  Stop making the directories and links to them.

Modified:
  head/ObsoleteFiles.inc
  head/etc/mtree/BSD.usr.dist

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Jan 16 23:11:13 2013(r245512)
+++ head/ObsoleteFiles.inc  Wed Jan 16 23:16:41 2013(r245513)
@@ -38,6 +38,13 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20130116: removed long unused directories for .1aout section manpages
+OLD_FILES+=usr/share/man/en.ISO8859-1/man1aout
+OLD_FILES+=usr/share/man/en.UTF-8/man1aout
+OLD_DIRS+=usr/share/man/man1aout
+OLD_DIRS+=usr/share/man/cat1aout
+OLD_DIRS+=usr/share/man/en.ISO8859-1/cat1aout
+OLD_DIRS+=usr/share/man/en.UTF-8/cat1aout
 # 20121230: libdisk removed
 OLD_FILES+=usr/share/man/man3/libdisk.3.gz usr/include/libdisk.h
 OLD_FILES+=usr/lib/libdisk.a usr/lib32/libdisk.a

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Wed Jan 16 23:11:13 2013(r245512)
+++ head/etc/mtree/BSD.usr.dist Wed Jan 16 23:16:41 2013(r245513)
@@ -756,8 +756,6 @@
 /set uname=man
 cat1
 ..
-cat1aout
-..
 cat2
 ..
 cat3
@@ -795,8 +793,6 @@
 en.ISO8859-1uname=root
 cat1
 ..
-cat1aout
-..
 cat2
 ..
 cat3
@@ -835,8 +831,6 @@
 en.UTF-8uname=root
 cat1
 ..
-cat1aout
-..
 cat2
 ..
 cat3
@@ -913,8 +907,6 @@
 ..
 man1
 ..
-man1aout
-..
 man2
 ..
 man3
___
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: r245514 - head/usr.bin/man

2013-01-16 Thread Brooks Davis
Author: brooks
Date: Wed Jan 16 23:20:24 2013
New Revision: 245514
URL: http://svnweb.freebsd.org/changeset/base/245514

Log:
  Remove default support for 1aout section manpages.  There haven't been
  any since at least July 2002.

Modified:
  head/usr.bin/man/man.1
  head/usr.bin/man/man.sh

Modified: head/usr.bin/man/man.1
==
--- head/usr.bin/man/man.1  Wed Jan 16 23:16:41 2013(r245513)
+++ head/usr.bin/man/man.1  Wed Jan 16 23:20:24 2013(r245514)
@@ -84,7 +84,7 @@ environment variable.
 .It Fl S Ar mansect
 Restricts manual sections searched to the specified colon delimited list.
 Defaults to
-.Dq Li 1:1aout:8:2:3:n:4:5:6:7:9:l .
+.Dq Li 1:8:2:3:n:4:5:6:7:9:l .
 Overrides the
 .Ev MANSECT
 environment variable.

Modified: head/usr.bin/man/man.sh
==
--- head/usr.bin/man/man.sh Wed Jan 16 23:16:41 2013(r245513)
+++ head/usr.bin/man/man.sh Wed Jan 16 23:20:24 2013(r245514)
@@ -945,7 +945,7 @@ STTY=/bin/stty
 SYSCTL=/sbin/sysctl
 
 debug=0
-man_default_sections='1:1aout:8:2:3:n:4:5:6:7:9:l'
+man_default_sections='1:8:2:3:n:4:5:6:7:9:l'
 man_default_path='/usr/share/man:/usr/share/openssl/man:/usr/local/man'
 cattool='/usr/bin/zcat -f'
 
___
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: r245515 - head/share/mk

2013-01-16 Thread Brooks Davis
Author: brooks
Date: Wed Jan 16 23:21:04 2013
New Revision: 245515
URL: http://svnweb.freebsd.org/changeset/base/245515

Log:
  Remove support for installing 1aout section manpages.

Modified:
  head/share/mk/bsd.man.mk
  head/share/mk/bsd.prog.mk

Modified: head/share/mk/bsd.man.mk
==
--- head/share/mk/bsd.man.mkWed Jan 16 23:20:24 2013(r245514)
+++ head/share/mk/bsd.man.mkWed Jan 16 23:21:04 2013(r245515)
@@ -62,7 +62,7 @@ MROFF_CMD?=   groff -Tascii -mtty-char -ma
 MCOMPRESS_CMD?=${COMPRESS_CMD}
 MCOMPRESS_EXT?=${COMPRESS_EXT}
 
-SECTIONS=  1 1aout 2 3 4 5 6 7 8 9
+SECTIONS=  1 2 3 4 5 6 7 8 9
 .SUFFIXES: ${SECTIONS:S/^/./g}
 
 # Backwards compatibility.

Modified: head/share/mk/bsd.prog.mk
==
--- head/share/mk/bsd.prog.mk   Wed Jan 16 23:20:24 2013(r245514)
+++ head/share/mk/bsd.prog.mk   Wed Jan 16 23:21:04 2013(r245515)
@@ -95,8 +95,7 @@ ${PROG}: ${OBJS}
 .if${MK_MAN} != "no" && !defined(MAN) && \
!defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \
!defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \
-   !defined(MAN7) && !defined(MAN8) && !defined(MAN9) && \
-   !defined(MAN1aout)
+   !defined(MAN7) && !defined(MAN8) && !defined(MAN9)
 MAN=   ${PROG}.1
 MAN1=  ${MAN}
 .endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r244401 - in head: contrib/libc-vis include lib/libc/gen

2013-01-16 Thread Brooks Davis
On Wed, Jan 16, 2013 at 11:44:22PM +0100, Dimitry Andric wrote:
> On 2013-01-11 00:41, Brooks Davis wrote:
> > On Sun, Dec 23, 2012 at 01:54:08AM +0100, Dimitry Andric wrote:
> >> On 2012-12-18 17:37, Brooks Davis wrote:
> >>> Author: brooks
> >>> Date: Tue Dec 18 16:37:24 2012
> >>> New Revision: 244401
> >>> URL: http://svnweb.freebsd.org/changeset/base/244401
> >>>
> >>> Log:
> >>> Replace our implementation of the vis(3) and unvis(3) APIs with
> >>> NetBSD's.  This output size limited versions of vis and unvis 
> >>> functions
> >>> as well as a set of vis variants that allow arbitrary characters to be
> >>> specified for encoding.
> >>
> >> This seems to break bootstrapping in some scenarios, in "stage 4.2:
> >> building libraries"; for example, with a test run with gcc on
> >> ref10-amd64.f.o I got this:
> >>
> >> gcc  -O2 -pipe  -I/scratch2/tmp/dim/head/lib/libc/include 
> >> -I/scratch2/tmp/dim/head/lib/libc/../../include 
> >> -I/scratch2/tmp/dim/head/lib/libc/amd64 -DNLS  -D__DBINTERFACE_PRIVATE 
> >> -I/scratch2/tmp/dim/head/lib/libc/../../contrib/gdtoa -DINET6 
> >> -I/scratch2/tmp/dim/obj/scratch2/tmp/dim/head/lib/libc 
> >> -I/scratch2/tmp/dim/head/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE 
> >> -I/scratch2/tmp/dim/head/lib/libc/../../contrib/jemalloc/include 
> >> -I/scratch2/tmp/dim/head/lib/libc/../../contrib/tzcode/stdtime 
> >> -I/scratch2/tmp/dim/head/lib/libc/stdtime 
> >> -I/scratch2/tmp/dim/head/lib/libc/locale -DBROKEN_DES -DPORTMAP 
> >> -DDES_BUILTIN -I/scratch2/tmp/dim/head/lib/libc/rpc -DYP -DNS_CACHING 
> >> -D_FREEFALL_CONFIG -DSYMBOL_VERSIONING -std=gnu99 -fstack-protector 
> >> -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized 
> >> -Wno-pointer-sign -c 
> >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/vis.c -o vis.o
> >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c: In 
> >> function 'unvis':
> >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error: 
> >> 'VIS_NOESCAPE' undeclared (first use in this function)
> >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error: 
> >> (Each undeclared identifier is reported only once
> >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error: 
> >> for each function it appears in.)
> >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:241: error: 
> >> 'VIS_HTTP1808' undeclared (first use in this function)
> >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:245: error: 
> >> 'VIS_HTTP1866' undeclared (first use in this function)
> >> /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:249: error: 
> >> 'VIS_MIMESTYLE' undeclared (first use in this function)
> >>
> >> There should most likely be an explicit -I option to point the compiler
> >> at the correct vis.h header during the early stages, otherwise it will
> >> pick up /usr/include/vis.h, which does not have several of these new
> >> VIS_XXX defines.
> >
> > Sorry for not following up on this sooner.  I've not seen this at all
> > and most of my builds are done on an 9.0-STABLE box so vis.h isn't
> > updated.  Adding
> >
> > CFLAGS+=-I${CURDIR}/../../contrib/libc-vis
> >
> > to lib/libc/gen/Makefile.inc seems like it should fix this, but I'm
> > surprised not to have bumped into this or broken tinderbox.  Is there
> > anything odd about your buildworld command?
> 
> Not really, the environment was just this:
> 
> 1) Building on ref10-amd64.f.o
> 2) CC=gcc, CXX=g++, CPP=gcpp
> 
> Did you manage to reproduce the failure?

I never did with a buildworld.  I could if I tried to build by hand
after touching unvis.c so I added an entry to CFLAGS.  I think it's more
correct.

-- Brooks


pgpJTTHxV2ADK.pgp
Description: PGP signature


svn commit: r245517 - head/sys/dev/cxgbe

2013-01-16 Thread Navdeep Parhar
Author: np
Date: Wed Jan 16 23:48:55 2013
New Revision: 245517
URL: http://svnweb.freebsd.org/changeset/base/245517

Log:
  cxgbe: Fix the for_each_foo macros -- the last argument should not share
  its name with any member of struct sge.
  
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/adapter.h

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hWed Jan 16 23:41:20 2013
(r245516)
+++ head/sys/dev/cxgbe/adapter.hWed Jan 16 23:48:55 2013
(r245517)
@@ -647,18 +647,18 @@ struct adapter {
 #define TXQ_LOCK_ASSERT_OWNED(txq) EQ_LOCK_ASSERT_OWNED(&(txq)->eq)
 #define TXQ_LOCK_ASSERT_NOTOWNED(txq)  EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq)
 
-#define for_each_txq(pi, iter, txq) \
-   txq = &pi->adapter->sge.txq[pi->first_txq]; \
-   for (iter = 0; iter < pi->ntxq; ++iter, ++txq)
-#define for_each_rxq(pi, iter, rxq) \
-   rxq = &pi->adapter->sge.rxq[pi->first_rxq]; \
-   for (iter = 0; iter < pi->nrxq; ++iter, ++rxq)
-#define for_each_ofld_txq(pi, iter, ofld_txq) \
-   ofld_txq = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \
-   for (iter = 0; iter < pi->nofldtxq; ++iter, ++ofld_txq)
-#define for_each_ofld_rxq(pi, iter, ofld_rxq) \
-   ofld_rxq = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \
-   for (iter = 0; iter < pi->nofldrxq; ++iter, ++ofld_rxq)
+#define for_each_txq(pi, iter, q) \
+   q = &pi->adapter->sge.txq[pi->first_txq]; \
+   for (iter = 0; iter < pi->ntxq; ++iter, ++q)
+#define for_each_rxq(pi, iter, q) \
+   q = &pi->adapter->sge.rxq[pi->first_rxq]; \
+   for (iter = 0; iter < pi->nrxq; ++iter, ++q)
+#define for_each_ofld_txq(pi, iter, q) \
+   q = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \
+   for (iter = 0; iter < pi->nofldtxq; ++iter, ++q)
+#define for_each_ofld_rxq(pi, iter, q) \
+   q = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \
+   for (iter = 0; iter < pi->nofldrxq; ++iter, ++q)
 
 /* One for errors, one for firmware events */
 #define T4_EXTRA_INTR 2
___
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: r245518 - head/sys/dev/cxgbe

2013-01-16 Thread Navdeep Parhar
Author: np
Date: Wed Jan 16 23:49:55 2013
New Revision: 245518
URL: http://svnweb.freebsd.org/changeset/base/245518

Log:
  cxgbe:  Do a more thorough job in the CLEAR_STATS ioctl.
  
  MFC after:3 days

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

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cWed Jan 16 23:48:55 2013
(r245517)
+++ head/sys/dev/cxgbe/t4_main.cWed Jan 16 23:49:55 2013
(r245518)
@@ -5492,12 +5492,56 @@ t4_ioctl(struct cdev *dev, unsigned long
rc = read_i2c(sc, (struct t4_i2c_data *)data);
break;
case CHELSIO_T4_CLEAR_STATS: {
+   int i;
u_int port_id = *(uint32_t *)data;
+   struct port_info *pi;
 
if (port_id >= sc->params.nports)
return (EINVAL);
 
+   /* MAC stats */
t4_clr_port_stats(sc, port_id);
+
+   pi = sc->port[port_id];
+   if (pi->flags & PORT_INIT_DONE) {
+   struct sge_rxq *rxq;
+   struct sge_txq *txq;
+   struct sge_wrq *wrq;
+
+   for_each_rxq(pi, i, rxq) {
+#if defined(INET) || defined(INET6)
+   rxq->lro.lro_queued = 0;
+   rxq->lro.lro_flushed = 0;
+#endif
+   rxq->rxcsum = 0;
+   rxq->vlan_extraction = 0;
+   }
+
+   for_each_txq(pi, i, txq) {
+   txq->txcsum = 0;
+   txq->tso_wrs = 0;
+   txq->vlan_insertion = 0;
+   txq->imm_wrs = 0;
+   txq->sgl_wrs = 0;
+   txq->txpkt_wrs = 0;
+   txq->txpkts_wrs = 0;
+   txq->txpkts_pkts = 0;
+   txq->no_dmamap = 0;
+   txq->no_desc = 0;
+   }
+
+#ifdef TCP_OFFLOAD
+   /* nothing to clear for each ofld_rxq */
+
+   for_each_ofld_txq(pi, i, wrq) {
+   wrq->tx_wrs = 0;
+   wrq->no_desc = 0;
+   }
+#endif
+   wrq = &sc->sge.ctrlq[pi->port_id];
+   wrq->tx_wrs = 0;
+   wrq->no_desc = 0;
+   }
break;
}
default:
___
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: r245519 - head/sys/geom/raid

2013-01-16 Thread Alexander Motin
Author: mav
Date: Thu Jan 17 00:09:50 2013
New Revision: 245519
URL: http://svnweb.freebsd.org/changeset/base/245519

Log:
  Recalculate volume size only for real CONCATs.  For SINGLE trust volume
  size given by metadata, as it should be correct and in some cases can be
  smaller then subdisk size.

Modified:
  head/sys/geom/raid/tr_concat.c

Modified: head/sys/geom/raid/tr_concat.c
==
--- head/sys/geom/raid/tr_concat.c  Wed Jan 16 23:49:55 2013
(r245518)
+++ head/sys/geom/raid/tr_concat.c  Thu Jan 17 00:09:50 2013
(r245519)
@@ -124,7 +124,8 @@ g_raid_tr_update_state_concat(struct g_r
 * Some metadata modules may not know CONCAT volume
 * mediasize until all disks connected. Recalculate.
 */
-   if (G_RAID_VOLUME_S_ALIVE(s) &&
+   if (vol->v_raid_level == G_RAID_VOLUME_RL_CONCAT &&
+   G_RAID_VOLUME_S_ALIVE(s) &&
!G_RAID_VOLUME_S_ALIVE(vol->v_state)) {
size = 0;
for (i = 0; i < vol->v_disks_count; i++) {
___
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: r245520 - head/tools/tools/cxgbetool

2013-01-16 Thread Navdeep Parhar
Author: np
Date: Thu Jan 17 00:21:45 2013
New Revision: 245520
URL: http://svnweb.freebsd.org/changeset/base/245520

Log:
  Allow "ivlan" (inner VLAN) to be used as an alias for "vlan" when
  specifying match criteria.  "vlan" continues to be valid here, and it
  continues to be valid when deleting, rewriting, inserting, or stacking
  an 802.1q tag to a matching packet.
  
  MFC after:3 days

Modified:
  head/tools/tools/cxgbetool/cxgbetool.c

Modified: head/tools/tools/cxgbetool/cxgbetool.c
==
--- head/tools/tools/cxgbetool/cxgbetool.c  Thu Jan 17 00:09:50 2013
(r245519)
+++ head/tools/tools/cxgbetool/cxgbetool.c  Thu Jan 17 00:21:45 2013
(r245520)
@@ -955,7 +955,7 @@ set_filter(uint32_t idx, int argc, const
t.fs.mask.vnic = mask;
t.fs.val.vnic_vld = 1;
t.fs.mask.vnic_vld = 1;
-   } else if (!parse_val_mask("vlan", args, &val, &mask)) {
+   } else if (!parse_val_mask("ivlan", args, &val, &mask)) {
t.fs.val.vlan = val;
t.fs.mask.vlan = mask;
t.fs.val.vlan_vld = 1;
@@ -1047,10 +1047,17 @@ set_filter(uint32_t idx, int argc, const
t.fs.newvlan = VLAN_REWRITE;
} else if (argv[start_arg + 1][0] == '+') {
t.fs.newvlan = VLAN_INSERT;
+   } else if (isdigit(argv[start_arg + 1][0]) &&
+   !parse_val_mask("vlan", args, &val, &mask)) {
+   t.fs.val.vlan = val;
+   t.fs.mask.vlan = mask;
+   t.fs.val.vlan_vld = 1;
+   t.fs.mask.vlan_vld = 1;
} else {
warnx("unknown vlan parameter \"%s\"; must"
-" be one of \"none\", \"=\" or"
-" \"+\"", argv[start_arg + 1]);
+" be one of \"none\", \"=\", "
+" \"+\", or \"\"",
+argv[start_arg + 1]);
return (EINVAL);
}
if (t.fs.newvlan == VLAN_REWRITE ||
___
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: r245521 - stable/9/share/man/man4

2013-01-16 Thread Xin LI
Author: delphij
Date: Thu Jan 17 00:42:30 2013
New Revision: 245521
URL: http://svnweb.freebsd.org/changeset/base/245521

Log:
  MFC r245006:
  
  Sync with driver.

Modified:
  stable/9/share/man/man4/mps.4

Modified: stable/9/share/man/man4/mps.4
==
--- stable/9/share/man/man4/mps.4   Thu Jan 17 00:21:45 2013
(r245520)
+++ stable/9/share/man/man4/mps.4   Thu Jan 17 00:42:30 2013
(r245521)
@@ -34,7 +34,7 @@
 .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $
 .\" $FreeBSD$
 .\"
-.Dd June 30, 2012
+.Dd January 3, 2013
 .Dt MPS 4
 .Os
 .Sh NAME
@@ -62,7 +62,7 @@ controllers and WarpDrive solid state st
 .Sh HARDWARE
 The
 .Nm
-driver supports the following controllers:
+driver supports the following hardware:
 .Pp
 .Bl -bullet -compact
 .It
@@ -80,6 +80,19 @@ LSI Logic SAS2116 (16 Port
 .It
 LSI Logic SAS2208 (8 Port
 .Tn SAS )
+.It
+LSI Logic SAS2308 (8 Port
+.Tn SAS )
+.It
+LSI Logic SSS6200 Solid State Storage
+.It
+Intel Integrated RAID Module RMS25JB040
+.It
+Intel Integrated RAID Module RMS25JB080
+.It
+Intel Integrated RAID Module RMS25KB040
+.It
+Intel Integrated RAID Module RMS25KB080
 .El
 .Sh CONFIGURATION
 To disable MSI interrupts for all
___
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: r245522 - in head: sbin/geom/class/raid sys/geom/raid

2013-01-16 Thread Alexander Motin
Author: mav
Date: Thu Jan 17 00:50:25 2013
New Revision: 245522
URL: http://svnweb.freebsd.org/changeset/base/245522

Log:
  For Promise/AMD metadata add support for disks with capacity above 2TiB
  and for volumes with sector size above 512 bytes.

Modified:
  head/sbin/geom/class/raid/graid.8
  head/sys/geom/raid/md_promise.c

Modified: head/sbin/geom/class/raid/graid.8
==
--- head/sbin/geom/class/raid/graid.8   Thu Jan 17 00:42:30 2013
(r245521)
+++ head/sbin/geom/class/raid/graid.8   Thu Jan 17 00:50:25 2013
(r245522)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 13, 2012
+.Dd January 16, 2013
 .Dt GRAID 8
 .Os
 .Sh NAME
@@ -274,7 +274,6 @@ complete it there.
 Do not run GEOM RAID class on migrating volumes under pain of possible data
 corruption!
 .Sh 2TiB BARRIERS
-Promise metadata format does not support disks above 2TiB.
 NVIDIA metadata format does not support volumes above 2TiB.
 .Sh SYSCTL VARIABLES
 The following

Modified: head/sys/geom/raid/md_promise.c
==
--- head/sys/geom/raid/md_promise.c Thu Jan 17 00:42:30 2013
(r245521)
+++ head/sys/geom/raid/md_promise.c Thu Jan 17 00:50:25 2013
(r245522)
@@ -84,7 +84,7 @@ struct promise_raid_conf {
struct promise_raid_diskdisk;   /* This subdisk info. */
uint32_tdisk_offset;/* Subdisk offset. */
uint32_tdisk_sectors;   /* Subdisk size */
-   uint32_trebuild_lba;/* Rebuild position. */
+   uint32_tdisk_rebuild;   /* Rebuild position. */
uint16_tgeneration; /* Generation number. */
uint8_t status; /* Volume status. */
 #define PROMISE_S_VALID0x01
@@ -123,7 +123,17 @@ struct promise_raid_conf {
uint32_tmagic_4;
uint32_tmagic_5;
uint32_ttotal_sectors_high;
-   uint32_tfiller3[324];
+   uint8_t magic_6;
+   uint8_t sector_size;
+   uint16_tmagic_7;
+   uint32_tmagic_8[32];
+   uint16_tmagic_9;
+   uint32_tdisk_offset_high;
+   uint32_tdisk_sectors_high;
+   uint32_tdisk_rebuild_high;
+   uint16_tmagic_10;
+   uint32_tmagic_11[3];
+   uint32_tfiller3[284];
uint32_tchecksum;
 } __packed;
 
@@ -191,7 +201,7 @@ g_raid_md_promise_print(struct promise_r
meta->disk.device, meta->disk.id);
printf("disk_offset %u\n", meta->disk_offset);
printf("disk_sectors%u\n", meta->disk_sectors);
-   printf("rebuild_lba %u\n", meta->rebuild_lba);
+   printf("disk_rebuild%u\n", meta->disk_rebuild);
printf("generation  %u\n", meta->generation);
printf("status  0x%02x\n", meta->status);
printf("type%u\n", meta->type);
@@ -217,6 +227,10 @@ g_raid_md_promise_print(struct promise_r
printf("magic_4 0x%08x\n", meta->magic_4);
printf("magic_5 0x%08x\n", meta->magic_5);
printf("total_sectors_high  0x%08x\n", meta->total_sectors_high);
+   printf("sector_size %u\n", meta->sector_size);
+   printf("disk_offset_high0x%08x\n", meta->disk_offset_high);
+   printf("disk_sectors_high   0x%08x\n", meta->disk_sectors_high);
+   printf("disk_rebuild_high   0x%08x\n", meta->disk_rebuild_high);
printf("=\n");
 }
 
@@ -244,9 +258,9 @@ promise_meta_find_disk(struct promise_ra
 
 static int
 promise_meta_unused_range(struct promise_raid_conf **metaarr, int nsd,
-uint32_t sectors, uint32_t *off, uint32_t *size)
+off_t sectors, off_t *off, off_t *size)
 {
-   uint32_t coff, csize;
+   off_t coff, csize, tmp;
int i, j;
 
sectors -= 131072;
@@ -257,10 +271,10 @@ promise_meta_unused_range(struct promise
i = 0;
while (1) {
for (j = 0; j < nsd; j++) {
-   if (metaarr[j]->disk_offset >= coff) {
-   csize = MIN(csize,
-   metaarr[j]->disk_offset - coff);
-   }
+   tmp = ((off_t)metaarr[j]->disk_offset_high << 32) +
+   metaarr[j]->disk_offset;
+   if (tmp >= coff)
+   csize = MIN(csize, tmp - coff);
}
if (csize > *size) {
*off = coff;
@@ -268,7 +282,10 @@ promise_meta_unused_range(struct promise
}
if (i >= nsd)
break;
-   coff = metaarr[i]->disk_offset + metaarr[i]->disk_sectors;
+  

svn commit: r245525 - head/etc/rc.d

2013-01-16 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Jan 17 01:27:39 2013
New Revision: 245525
URL: http://svnweb.freebsd.org/changeset/base/245525

Log:
  Add a conditional sleep 1 in case we add any IPv6 addresses to interfaces.
  Do this per jail started, not per address.  This will allow DAD to complete
  and services to properly start.   Before we have seen problems with services
  trying to start before the IPv6 address was available to use and thus
  erroring and failing to start.
  
  MFC after:3 days

Modified:
  head/etc/rc.d/jail

Modified: head/etc/rc.d/jail
==
--- head/etc/rc.d/jail  Thu Jan 17 01:19:14 2013(r245524)
+++ head/etc/rc.d/jail  Thu Jan 17 01:27:39 2013(r245525)
@@ -509,7 +509,7 @@ jail_handle_ips_option()
esac
case "${_type}" in
inet)   ;;
-   inet6)  ;;
+   inet6)  ipv6_address_count=$((ipv6_address_count + 1)) ;;
*)  warn "Could not determine address family.  Not going" \
"to ${_action} address '${_addr}' for ${_jail}."
continue
@@ -546,6 +546,7 @@ jail_ips()
esac
 
# Handle addresses.
+   ipv6_address_count=0
jail_handle_ips_option ${_action} "${_ip}"
# Handle jail_xxx_ip_multi
alias=0
@@ -558,6 +559,12 @@ jail_ips()
;;
esac
done
+   case ${ipv6_address_count} in
+   0)  ;;
+   *)  # Sleep 1 second to let DAD complete before starting services.
+   sleep 1
+   ;;
+   esac
 }
 
 jail_prestart()
___
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: r245526 - svnadmin/conf

2013-01-16 Thread Gabor Pali
Author: pgj (ports committer)
Date: Thu Jan 17 01:28:55 2013
New Revision: 245526
URL: http://svnweb.freebsd.org/changeset/base/245526

Log:
  Take wilko's commit bit into safekeeping per his request.  Wilko, thank you
  for all the hard work on FreeBSD in the past!
  
  Approved by:  core (implicit)

Modified:
  svnadmin/conf/access

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessThu Jan 17 01:27:39 2013(r245525)
+++ svnadmin/conf/accessThu Jan 17 01:28:55 2013(r245526)
@@ -263,7 +263,6 @@ vanhu
 versus
 weongyo
 wes
-wilko  wkbco...@xs4all.nl
 will
 wkoszek
 wollman
___
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: r245525 - head/etc/rc.d

2013-01-16 Thread Bjoern A. Zeeb

On Thu, 17 Jan 2013, Bjoern A. Zeeb wrote:


Author: bz
Date: Thu Jan 17 01:27:39 2013
New Revision: 245525
URL: http://svnweb.freebsd.org/changeset/base/245525

Log:
 Add a conditional sleep 1 in case we add any IPv6 addresses to interfaces.
 Do this per jail started, not per address.  This will allow DAD to complete
 and services to properly start.   Before we have seen problems with services
 trying to start before the IPv6 address was available to use and thus
 erroring and failing to start.

 MFC after: 3 days


Reviewed by:simon
Reported by:clusterad
Seen before by: myself (but never fixed it properly)

Samples of services seen starting up really fast and failing included
openldap's slapd and I think even apache.




Modified:
 head/etc/rc.d/jail

Modified: head/etc/rc.d/jail
==
--- head/etc/rc.d/jail  Thu Jan 17 01:19:14 2013(r245524)
+++ head/etc/rc.d/jail  Thu Jan 17 01:27:39 2013(r245525)
@@ -509,7 +509,7 @@ jail_handle_ips_option()
esac
case "${_type}" in
inet)   ;;
-   inet6)  ;;
+   inet6)  ipv6_address_count=$((ipv6_address_count + 1)) ;;
*)  warn "Could not determine address family.  Not going" \
"to ${_action} address '${_addr}' for ${_jail}."
continue
@@ -546,6 +546,7 @@ jail_ips()
esac

# Handle addresses.
+   ipv6_address_count=0
jail_handle_ips_option ${_action} "${_ip}"
# Handle jail_xxx_ip_multi
alias=0
@@ -558,6 +559,12 @@ jail_ips()
;;
esac
done
+   case ${ipv6_address_count} in
+   0)  ;;
+   *)  # Sleep 1 second to let DAD complete before starting services.
+   sleep 1
+   ;;
+   esac
}

jail_prestart()



--
Bjoern A. Zeeb You have to have visions!
 Stop bit received. Insert coin for new address family.
___
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: r245527 - in head: secure/lib/libssh secure/usr.bin/ssh secure/usr.sbin/sshd share/mk tools/build/options

2013-01-16 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Jan 17 01:51:04 2013
New Revision: 245527
URL: http://svnweb.freebsd.org/changeset/base/245527

Log:
  Add a src.conf(5) option to allow users to compile in the "NONE cipher",
  which, only after authentication, disables crypto, and only for sessions
  without a terminal.
  
  Submitted by: Jeremy Chadwick (freebsd jdc.parodius.com)
  PR:   bin/163095
  MFC after:10 days

Added:
  head/tools/build/options/WITH_OPENSSH_NONE_CIPHER   (contents, props changed)
Modified:
  head/secure/lib/libssh/Makefile
  head/secure/usr.bin/ssh/Makefile
  head/secure/usr.sbin/sshd/Makefile
  head/share/mk/bsd.own.mk

Modified: head/secure/lib/libssh/Makefile
==
--- head/secure/lib/libssh/Makefile Thu Jan 17 01:28:55 2013
(r245526)
+++ head/secure/lib/libssh/Makefile Thu Jan 17 01:51:04 2013
(r245527)
@@ -38,6 +38,10 @@ DPADD+=  ${LIBGSSAPI} ${LIBKRB5} ${LIBHX5
 LDADD+=-lgssapi -lkrb5 -lhx509 -lasn1 -lcom_err -lmd -lroken
 .endif
 
+.if ${MK_OPENSSH_NONE_CIPHER} != "no"
+CFLAGS+= -DNONE_CIPHER_ENABLED
+.endif
+
 NO_LINT=
 
 DPADD+=${LIBCRYPTO} ${LIBCRYPT}

Modified: head/secure/usr.bin/ssh/Makefile
==
--- head/secure/usr.bin/ssh/MakefileThu Jan 17 01:28:55 2013
(r245526)
+++ head/secure/usr.bin/ssh/MakefileThu Jan 17 01:51:04 2013
(r245527)
@@ -25,6 +25,10 @@ DPADD+=   ${LIBGSSAPI}
 LDADD+= -lgssapi
 .endif
 
+.if ${MK_OPENSSH_NONE_CIPHER} != "no"
+CFLAGS+= -DNONE_CIPHER_ENABLED
+.endif
+
 DPADD+=${LIBCRYPT} ${LIBCRYPTO}
 LDADD+=-lcrypt -lcrypto
 

Modified: head/secure/usr.sbin/sshd/Makefile
==
--- head/secure/usr.sbin/sshd/Makefile  Thu Jan 17 01:28:55 2013
(r245526)
+++ head/secure/usr.sbin/sshd/Makefile  Thu Jan 17 01:51:04 2013
(r245527)
@@ -40,6 +40,10 @@ DPADD+=   ${LIBGSSAPI_KRB5} ${LIBGSSAPI} 
 LDADD+= -lgssapi_krb5 -lgssapi -lkrb5 -lasn1
 .endif
 
+.if ${MK_OPENSSH_NONE_CIPHER} != "no"
+CFLAGS+= -DNONE_CIPHER_ENABLED
+.endif
+
 DPADD+=${LIBCRYPTO} ${LIBCRYPT}
 LDADD+=-lcrypto -lcrypt
 

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkThu Jan 17 01:28:55 2013(r245526)
+++ head/share/mk/bsd.own.mkThu Jan 17 01:51:04 2013(r245527)
@@ -360,6 +360,7 @@ __DEFAULT_NO_OPTIONS = \
 NMTREE \
 NAND \
 OFED \
+OPENSSH_NONE_CIPHER \
 SHARED_TOOLCHAIN
 
 #

Added: head/tools/build/options/WITH_OPENSSH_NONE_CIPHER
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_OPENSSH_NONE_CIPHER   Thu Jan 17 01:51:04 
2013(r245527)
@@ -0,0 +1,9 @@
+.\" $FreeBSD$
+Set to include the "None" cipher support in OpenSSH and its libraries.
+Additional adjustments may need to be done to system configuration
+files, such as
+.Xr sshd_config 5 ,
+to enable this cipher.
+Please see
+.Pa /usr/src/crypto/openssh/README.hpn
+for full details.
___
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: r245494 - head/bin/pwait

2013-01-16 Thread Bruce Evans

On Wed, 16 Jan 2013, Eitan Adler wrote:


On 16 January 2013 13:11, Xin Li  wrote:


Yes I did.  Using exit(3) tells clang that this is the final exit and
thus eliminates the warning.

It sounds like a bug (or arguably a feature) that clang does not
recognize return in main()s...


It is not a bug: see


Of course it is a bug.


http://clang-developers.42468.n3.nabble.com/Static-analyzer-possible-memory-leak-false-positive-td4026706.html


Not much signal there.

C99 requires main() to be handled specially in hosted environments.
(In freestanding environments(), neither main() nor malloc() is special.
Now the compiler could warn about main(), but it cannot know what
malloc() does so it cannot warn about not freeing memory on return
from main().)  It requires that, if the return type of main() is
compatible with int (and thus not void), then a return from the
_initial_ call to main() is equivalent to calling exit() with an arg
equal to the return value (and that if main() doesn't explicitly return
or exit, but falls through to the closing brace, then this is equivalent
to 'return (0);'.

It seems to be permitted to call malloc() recursively (otherwise C99
w.  The warning is useful if main() is called recursively.  But few
programs call main() recursively.  pwait(1) obviously doesn't.  The
the bug is quality of implementation one.  The static analyzer is too
stupid to see that main() isn't called recursively.

Bruce
___
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: r245525 - head/etc/rc.d

2013-01-16 Thread Hiroki Sato
"Bjoern A. Zeeb"  wrote
  in <201301170127.r0h1re6y038...@svn.freebsd.org>:

bz> Author: bz
bz> Date: Thu Jan 17 01:27:39 2013
bz> New Revision: 245525
bz> URL: http://svnweb.freebsd.org/changeset/base/245525
bz>
bz> Log:
bz>   Add a conditional sleep 1 in case we add any IPv6 addresses to interfaces.
bz>   Do this per jail started, not per address.  This will allow DAD to 
complete
bz>   and services to properly start.   Before we have seen problems with 
services
bz>   trying to start before the IPv6 address was available to use and thus
bz>   erroring and failing to start.
bz>
bz>   MFC after:3 days

 This may be too pedantic, but I think this delay should use
 DupAddrDetectTransmits (net.inet6.ip6.dad_count).  The default value
 of RETRANS_TIMER and MAX_RTR_SOLICITATION_DELAY in RFC 4861 is 1 sec,
 so the theoretical delay value is (DupAddrDetectTransmits *
 RETRANS_TIMER + MAX_RTR_SOLICITATION_DELAY).  The rc.d/netif script
 uses this value (typically 2 seconds) for DAD.

 I understand a simple 1 second delay works in practice, though.

-- Hiroki


pgpsdeOhI8S0o.pgp
Description: PGP signature


Re: svn commit: r245506 - head/bin/pwait

2013-01-16 Thread Bruce Evans

On Wed, 16 Jan 2013, Xin LI wrote:


Log:
 Use a different way to silence clang analyzer as done in r245494 by
 explicitly telling the compiler that we are on the exit route.

 X-MFC: together with r245494

Modified:
 head/bin/pwait/pwait.c

Modified: head/bin/pwait/pwait.c
==
--- head/bin/pwait/pwait.c  Wed Jan 16 09:07:49 2013(r245505)
+++ head/bin/pwait/pwait.c  Wed Jan 16 18:15:25 2013(r245506)
@@ -141,6 +141,5 @@ main(int argc, char *argv[])
nleft -= n;
}

-   free(e);
-   return 0;
+   exit(EX_OK);
}


This uses the sysexits mistake.  style(9) was fixed to not give an example
of this mistake.  Before this, sysexits was used a whole once in pwait(1)
(for EX_USAGE) in usage().  EX_USAGE happens to be 64.  As usual when the
mistake is used, this is useless for humans (the usage message gives more
info) and unusable for programs, especially since it is undocmented
(pwait(1)'s man page just says ">0 if an error occurs".  It doesn't even
use '.Std' for this, but hard-codes it.

The related utilities for kill(1) and pkill(1) and their man pages are
better.  kill(1) doesn't use the mistake, and its man page uses '.Std'.
pkill(1) doesn't use the mistake; it uses small integers for exit
statuses, and its man page seems to document these correctly (it cannot
use .Std since the exit status isn't standard).

Bruce
___
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: r245530 - stable/9/usr.bin/procstat

2013-01-16 Thread Mateusz Guzik
Author: mjg
Date: Thu Jan 17 02:42:08 2013
New Revision: 245530
URL: http://svnweb.freebsd.org/changeset/base/245530

Log:
  MFC r245345:
  procstat: only one mode flag can be specified, but required check for 'i'
  and 'j' modes was missing. Fix that.

Modified:
  stable/9/usr.bin/procstat/procstat.c
Directory Properties:
  stable/9/usr.bin/procstat/   (props changed)

Modified: stable/9/usr.bin/procstat/procstat.c
==
--- stable/9/usr.bin/procstat/procstat.cThu Jan 17 02:30:32 2013
(r245529)
+++ stable/9/usr.bin/procstat/procstat.cThu Jan 17 02:42:08 2013
(r245530)
@@ -216,8 +216,8 @@ main(int argc, char *argv[])
argv += optind;
 
/* We require that either 0 or 1 mode flags be set. */
-   tmp = bflag + cflag + eflag + fflag + (kflag ? 1 : 0) + lflag + sflag +
-   tflag + vflag + xflag;
+   tmp = bflag + cflag + eflag + fflag + iflag + jflag + (kflag ? 1 : 0) +
+   lflag + sflag + tflag + vflag + xflag;
if (!(tmp == 0 || tmp == 1))
usage();
 
___
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: r245533 - head/sys/geom/raid

2013-01-16 Thread Alexander Motin
Author: mav
Date: Thu Jan 17 03:27:08 2013
New Revision: 245533
URL: http://svnweb.freebsd.org/changeset/base/245533

Log:
   - Fix rebuild position broken at r245522.
   - Identify one more metadata field.

Modified:
  head/sys/geom/raid/md_promise.c

Modified: head/sys/geom/raid/md_promise.c
==
--- head/sys/geom/raid/md_promise.c Thu Jan 17 03:25:31 2013
(r245532)
+++ head/sys/geom/raid/md_promise.c Thu Jan 17 03:27:08 2013
(r245533)
@@ -126,7 +126,8 @@ struct promise_raid_conf {
uint8_t magic_6;
uint8_t sector_size;
uint16_tmagic_7;
-   uint32_tmagic_8[32];
+   uint32_tmagic_8[31];
+   uint32_tbackup_time;
uint16_tmagic_9;
uint32_tdisk_offset_high;
uint32_tdisk_sectors_high;
@@ -228,6 +229,7 @@ g_raid_md_promise_print(struct promise_r
printf("magic_5 0x%08x\n", meta->magic_5);
printf("total_sectors_high  0x%08x\n", meta->total_sectors_high);
printf("sector_size %u\n", meta->sector_size);
+   printf("backup_time %d\n", meta->backup_time);
printf("disk_offset_high0x%08x\n", meta->disk_offset_high);
printf("disk_sectors_high   0x%08x\n", meta->disk_sectors_high);
printf("disk_rebuild_high   0x%08x\n", meta->disk_rebuild_high);
@@ -398,6 +400,7 @@ next:
meta->disk_rebuild_high = 0;
if (meta->total_sectors_high == 0x15161718) {
meta->total_sectors_high = 0;
+   meta->backup_time = 0;
if (meta->rebuild_lba64 == 0x2122232425262728)
meta->rebuild_lba64 = UINT64_MAX;
}
@@ -793,7 +796,7 @@ nofit:
sd->sd_rebuild_pos = 0;
else {
sd->sd_rebuild_pos =
-   (((off_t)pd->pd_meta[sdn]->disk_rebuild << 32) +
+   (((off_t)pd->pd_meta[sdn]->disk_rebuild_high << 32) 
+
 pd->pd_meta[sdn]->disk_rebuild) * 512;
}
} else if (!(meta->disks[md_disk_pos].flags & PROMISE_F_ONLINE)) {
___
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: r245506 - head/bin/pwait

2013-01-16 Thread Eitan Adler
On 16 January 2013 21:25, Bruce Evans  wrote:
> This uses the sysexits mistake.  style(9) was fixed to not give an example
> of this mistake.  Before this, sysexits was used a whole once in pwait(1)
> (for EX_USAGE) in usage().  EX_USAGE happens to be 64.  As usual when the
> mistake is used, this is useless for humans (the usage message gives more
> info) and unusable for programs, especially since it is undocmented
> (pwait(1)'s man page just says ">0 if an error occurs".  It doesn't even
> use '.Std' for this, but hard-codes it.

IMHO using sysexits gives more signal than using a binary 0 or 1.  It
is a mistake to have changed style(9) to avoid using sysexits.
Instead the man page should detail the specific error that occurs
directly, or by reference to sysexit.

-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
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: r245535 - head/bin/cp

2013-01-16 Thread Eitan Adler
Author: eadler
Date: Thu Jan 17 04:20:31 2013
New Revision: 245535
URL: http://svnweb.freebsd.org/changeset/base/245535

Log:
  Remove useless variable 'Pflag':
  -P is an alternative to -H and -L, and it is implemented using the Hflag and 
Lflag variables.
  
  Approved by:  cperciva
  MFC after:3 days

Modified:
  head/bin/cp/cp.c

Modified: head/bin/cp/cp.c
==
--- head/bin/cp/cp.cThu Jan 17 03:27:53 2013(r245534)
+++ head/bin/cp/cp.cThu Jan 17 04:20:31 2013(r245535)
@@ -98,30 +98,28 @@ main(int argc, char *argv[])
 {
struct stat to_stat, tmp_stat;
enum op type;
-   int Hflag, Lflag, Pflag, ch, fts_options, r, have_trailing_slash;
+   int Hflag, Lflag, ch, fts_options, r, have_trailing_slash;
char *target;
 
fts_options = FTS_NOCHDIR | FTS_PHYSICAL;
-   Hflag = Lflag = Pflag = 0;
+   Hflag = Lflag = 0;
while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
-   Lflag = Pflag = 0;
+   Lflag = 0;
break;
case 'L':
Lflag = 1;
-   Hflag = Pflag = 0;
+   Hflag = 0;
break;
case 'P':
-   Pflag = 1;
Hflag = Lflag = 0;
break;
case 'R':
Rflag = 1;
break;
case 'a':
-   Pflag = 1;
pflag = 1;
Rflag = 1;
Hflag = Lflag = 0;
@@ -146,7 +144,7 @@ main(int argc, char *argv[])
break;
case 'r':
rflag = Lflag = 1;
-   Hflag = Pflag = 0;
+   Hflag = 0;
break;
case 'v':
vflag = 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: r245536 - head/tools/tools/notescheck

2013-01-16 Thread Eitan Adler
Author: eadler
Date: Thu Jan 17 04:20:53 2013
New Revision: 245536
URL: http://svnweb.freebsd.org/changeset/base/245536

Log:
  Convert to Python 3
  
  Approved by:  cperciva

Modified:
  head/tools/tools/notescheck/notescheck.py

Modified: head/tools/tools/notescheck/notescheck.py
==
--- head/tools/tools/notescheck/notescheck.py   Thu Jan 17 04:20:31 2013
(r245535)
+++ head/tools/tools/notescheck/notescheck.py   Thu Jan 17 04:20:53 2013
(r245536)
@@ -12,9 +12,9 @@ import os.path
 import sys
 
 def usage():
-print >>sys.stderr, "notescheck "
-print >>sys.stderr
-print >>sys.stderr, "Where 'path' is a path to a kernel source tree."
+print("notescheck ", file=sys.stderr)
+print(file=sys.stderr)
+print("Where 'path' is a path to a kernel source tree.", file=sys.stderr)
 
 # These files are used to determine if a path is a valid kernel source tree.
 requiredfiles = ['conf/files', 'conf/options', 'conf/NOTES']
@@ -62,9 +62,9 @@ class Option:
 self.type = type
 self.type_location = location
 elif self.type != type:
-print "WARN: Attempt to change type of %s from %s to %s%s" % \
-(self.name, self.type, type, location)
-print "  Previous type set%s" % (self.type_location)
+print("WARN: Attempt to change type of %s from %s to %s%s" % \
+(self.name, self.type, type, location))
+print("  Previous type set%s" % (self.type_location))
 
 def add_define(self, platform):
 self.defines.add(platform)
@@ -93,8 +93,8 @@ class Option:
 if global_platform in self.defines:
 # If the device is defined globally ans is never tested, whine.
 if len(self.tests) == 0:
-print 'WARN: %s is defined globally but never tested' % \
-(self.title())
+print('WARN: %s is defined globally but never tested' % \
+(self.title()))
 return
 
 # If the device is defined globally and is tested on
@@ -106,25 +106,25 @@ class Option:
 
 # If a device is defined globally but is only tested on a
 # single MD platform, then whine about this.
-print 'WARN: %s is defined globally but only tested in %s NOTES' % 
\
-(self.title(), format_set(self.tests))
+print('WARN: %s is defined globally but only tested in %s NOTES' % 
\
+(self.title(), format_set(self.tests)))
 return
 
 # If an option or device is never tested, whine.
 if len(self.tests) == 0:
-print 'WARN: %s is defined in %s but never tested' % \
-(self.title(), format_set(self.defines))
+print('WARN: %s is defined in %s but never tested' % \
+(self.title(), format_set(self.defines)))
 return
 
 # The set of MD platforms where this option is defined, but not tested.
 notest = self.defines - self.tests
 if len(notest) != 0:
-print 'WARN: %s is not tested in %s NOTES' % \
-(self.title(), format_set(notest))
+print('WARN: %s is not tested in %s NOTES' % \
+(self.title(), format_set(notest)))
 return
 
-print 'ERROR: bad state for %s: defined in %s, tested in %s' % \
-(self.title(), format_set(self.defines), format_set(self.tests))
+print('ERROR: bad state for %s: defined in %s, tested in %s' % \
+(self.title(), format_set(self.defines), format_set(self.tests)))
 
 # This class maintains a dictionary of options keyed by name.
 class Options:
@@ -143,7 +143,7 @@ class Options:
 
 # Warn about inconsistencies
 def warn(self):
-keys = self.options.keys()
+keys = list(self.options.keys())
 keys.sort()
 for key in keys:
 option = self.options[key]
@@ -158,11 +158,11 @@ def find_platforms(tree):
 platforms = []
 for file in glob.glob(tree + '*/conf/NOTES'):
 if not file.startswith(tree):
-print >>sys.stderr, "Bad MD NOTES file %s" %(file)
+print("Bad MD NOTES file %s" %(file), file=sys.stderr)
 sys.exit(1)
 platforms.append(file[len(tree):].split('/')[0])
 if global_platform in platforms:
-print >>sys.stderr, "Found MD NOTES file for global platform"
+print("Found MD NOTES file for global platform", file=sys.stderr)
 sys.exit(1)
 return platforms
 
@@ -224,7 +224,7 @@ def tokenize(line):
 # will contain 'number of quotes' + 1 entries, so it should have
 # an odd number of entries.
 if len(groups) % 2 == 0:
-print >>sys.stderr, "Failed to tokenize: %s%s" (line, location)
+print("Failed to tokenize: %s%s" (line, location), file=sys.stderr)
 return []
 

svn commit: r245539 - in head: contrib/gcc/config/arm gnu/lib/csu gnu/lib/libgcc gnu/lib/libgcov gnu/lib/libstdc++ gnu/usr.bin/cc gnu/usr.bin/cc/c++filt gnu/usr.bin/cc/cc1 gnu/usr.bin/cc/cc1plus gn...

2013-01-16 Thread Andrew Turner
Author: andrew
Date: Thu Jan 17 05:56:28 2013
New Revision: 245539
URL: http://svnweb.freebsd.org/changeset/base/245539

Log:
  Add compiler support for the ARM EABI.
  
  ARM EABI support is disabled by default and can be enabled by setting
  WITH_ARM_EABI when building, however only the kernel-toolchain target will
  work with this flag until the rest of the support is added.

Added:
  head/tools/build/options/WITH_ARM_EABI   (contents, props changed)
Modified:
  head/contrib/gcc/config/arm/freebsd.h
  head/gnu/lib/csu/Makefile
  head/gnu/lib/libgcc/Makefile
  head/gnu/lib/libgcov/Makefile
  head/gnu/lib/libstdc++/Makefile
  head/gnu/usr.bin/cc/Makefile.inc
  head/gnu/usr.bin/cc/c++filt/Makefile
  head/gnu/usr.bin/cc/cc1/Makefile
  head/gnu/usr.bin/cc/cc1plus/Makefile
  head/gnu/usr.bin/cc/cc_int/Makefile
  head/gnu/usr.bin/cc/cc_tools/Makefile
  head/gnu/usr.bin/cc/doc/Makefile
  head/gnu/usr.bin/cc/gcov/Makefile
  head/gnu/usr.bin/cc/include/Makefile
  head/gnu/usr.bin/cc/libcpp/Makefile
  head/gnu/usr.bin/cc/libdecnumber/Makefile
  head/gnu/usr.bin/cc/libiberty/Makefile
  head/share/mk/bsd.own.mk

Modified: head/contrib/gcc/config/arm/freebsd.h
==
--- head/contrib/gcc/config/arm/freebsd.h   Thu Jan 17 05:55:53 2013
(r245538)
+++ head/contrib/gcc/config/arm/freebsd.h   Thu Jan 17 05:56:28 2013
(r245539)
@@ -29,8 +29,13 @@
   { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
 
 #undef SUBTARGET_EXTRA_ASM_SPEC
+#ifdef TARGET_ARM_EABI
+#define SUBTARGET_EXTRA_ASM_SPEC   \
+  "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4} %{fpic|fpie:-k} 
%{fPIC|fPIE:-k}"
+#else
 #define SUBTARGET_EXTRA_ASM_SPEC   \
   "-matpcs %{fpic|fpie:-k} %{fPIC|fPIE:-k}"
+#endif
 
 /* Default to full FPA if -mhard-float is specified. */
 #undef SUBTARGET_ASM_FLOAT_SPEC
@@ -61,8 +66,25 @@
 #define TARGET_ENDIAN_DEFAULT 0
 #endif
 
+#ifdef TARGET_ARM_EABI
+/* We default to a soft-float ABI so that binaries can run on all
+   target hardware.  */
+#undef TARGET_DEFAULT_FLOAT_ABI
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
+
+#undef ARM_DEFAULT_ABI
+#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX
+
+#undef  TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()   \
+  do   \
+{  \
+  FBSD_TARGET_OS_CPP_BUILTINS();   \
+  TARGET_BPABI_CPP_BUILTINS(); \
+}  \
+  while (false)
+#else
 /* Default it to use ATPCS with soft-VFP.  */
-#undef TARGET_DEFAULT
 #define TARGET_DEFAULT \
   (MASK_APCS_FRAME \
| TARGET_ENDIAN_DEFAULT)
@@ -70,6 +92,10 @@
 #undef ARM_DEFAULT_ABI
 #define ARM_DEFAULT_ABI ARM_ABI_ATPCS
 
+#undef FPUTYPE_DEFAULT
+#define FPUTYPE_DEFAULT FPUTYPE_VFP
+#endif
+
 /* Define the actual types of some ANSI-mandated types.
Needs to agree with .  GCC defaults come from c-decl.c,
c-common.c, and config//.h.  */
@@ -134,5 +160,3 @@ do  
\
   }\
 while (0)
 
-#undef FPUTYPE_DEFAULT
-#define FPUTYPE_DEFAULT FPUTYPE_VFP

Modified: head/gnu/lib/csu/Makefile
==
--- head/gnu/lib/csu/Makefile   Thu Jan 17 05:55:53 2013(r245538)
+++ head/gnu/lib/csu/Makefile   Thu Jan 17 05:56:28 2013(r245539)
@@ -24,6 +24,10 @@ CFLAGS+= -I${GCCLIB}/include -I${GCCDIR}
 CRTS_CFLAGS=   -DCRTSTUFFS_O -DSHARED ${PICFLAG}
 MKDEP= -DCRT_BEGIN
 
+.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+CFLAGS+=   -DTARGET_ARM_EABI
+.endif
+
 .if ${MACHINE_CPUARCH} == "ia64"
 BEGINSRC=  crtbegin.asm
 ENDSRC=crtend.asm

Modified: head/gnu/lib/libgcc/Makefile
==
--- head/gnu/lib/libgcc/MakefileThu Jan 17 05:55:53 2013
(r245538)
+++ head/gnu/lib/libgcc/MakefileThu Jan 17 05:56:28 2013
(r245539)
@@ -15,6 +15,10 @@ MK_SSP=  no
 
 .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt"
 
+.if ${TARGET_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
+CFLAGS+=   -DTARGET_ARM_EABI
+.endif
+
 .if ${TARGET_CPUARCH} == "mips"
 LIB=   gcc
 .endif
@@ -55,10 +59,13 @@ LIB2FUNCS+= _fixuns${mode}si
 .endfor
 
 # Likewise double-word routines.
+.if ${TARGET_CPUARCH} != "arm" || ${MK_ARM_EABI} == "no"
+# These are implemented in an ARM specific file but will not be filtered out
 .for mode in sf df xf tf
 LIB2FUNCS+= _fix${mode}di _fixuns${mode}di
 LIB2FUNCS+= _floatdi${mode} _floatundi${mode}
 .endfor
+.endif
 
 LIB2ADD = $(LIB2FUNCS_EXTRA)
 LIB2ADD_ST = $(LIB2FUNCS_STATIC_EXTRA)
@@ -115,15 +122,14 @@ CFLAGS+=  -fheinous-gnu-extensions
 
 LIB1ASMSRC =   lib1funcs.asm
 LIB1ASMFUNCS =  _dvmd_