Re: svn commit: r242276 - head/sys/mips/cavium

2012-10-28 Thread Bruce Evans

On Mon, 29 Oct 2012, Juli Mallett wrote:


Log:
 Wrap some long lines and display board serial numbers at boot.


Any chance of using FreeBSD style instead of gnu style for the wrapping?


Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Mon Oct 29 01:51:24 2012
(r242275)
+++ head/sys/mips/cavium/octeon_machdep.c   Mon Oct 29 02:10:20 2012
(r242276)
@@ -512,14 +512,19 @@ octeon_process_app_desc_ver_6(void)
octeon_bootinfo->board_rev_major,
octeon_bootinfo->board_rev_minor,
octeon_bootinfo->eclock_hz);


This old wrapping uses gnu style (indent -lp).

The struct member names in it are verbose, but not verbose enough to have
normal style with a struct-dependent prefix.


-   memcpy(cvmx_sysinfo_get()->mac_addr_base, 
octeon_bootinfo->mac_addr_base, 6);
+   memcpy(cvmx_sysinfo_get()->mac_addr_base,
+  octeon_bootinfo->mac_addr_base, 6);


This new wrapping is in gnu style.  FreeBSD style is indent -ci4.


cvmx_sysinfo_get()->mac_addr_count = octeon_bootinfo->mac_addr_count;
cvmx_sysinfo_get()->compact_flash_common_base_addr =
octeon_bootinfo->compact_flash_common_base_addr;
cvmx_sysinfo_get()->compact_flash_attribute_base_addr =
octeon_bootinfo->compact_flash_attribute_base_addr;


The last 2 wrappings aren't in either gnu style or FreeBSD style.  FreeBSD
style is indent -ci4 again.  Gnu style is to put the operator on the new
line, and IIRC, line up the operator with the variable, resulting in no
indentation for the operator.  This has the FreeBSD style for the operator,
but a contination indent of 8.


cvmx_sysinfo_get()->core_mask = octeon_bootinfo->core_mask;
-   cvmx_sysinfo_get()->led_display_base_addr = 
octeon_bootinfo->led_display_base_addr;
+   cvmx_sysinfo_get()->led_display_base_addr =
+   octeon_bootinfo->led_display_base_addr;


This matches the above for neither gnu not FreeBSD style.


+   memcpy(cvmx_sysinfo_get()->board_serial_number,
+  octeon_bootinfo->board_serial_number,
+  sizeof cvmx_sysinfo_get()->board_serial_number);


This matches the above for the gnu style of the indentation.

It also doesn't follow FreeBSD style for the explicit "sizeof is not
followed by a space" or the implicit "sizeof is followed by a left
parentheses (without a space)".  The former implies the latter, because
the identifiers would coalesce without the space.  My normal style would
omit the parentheses for `sizeof object' and everywhere else possible,
but here they are needed for another reason for people who like
excessive parentheses: the pointer is returned by a function so it
has parentheses in it, so it is not as clear as usual what the object
is.

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: r242301 - head/etc/rc.d

2012-10-28 Thread Hiroki Sato
Author: hrs
Date: Mon Oct 29 06:31:51 2012
New Revision: 242301
URL: http://svn.freebsd.org/changeset/base/242301

Log:
  Load ipdivert.ko when natd_enable=YES.
  
  PR:   conf/167566

Modified:
  head/etc/rc.d/ipfw

Modified: head/etc/rc.d/ipfw
==
--- head/etc/rc.d/ipfw  Mon Oct 29 06:15:04 2012(r242300)
+++ head/etc/rc.d/ipfw  Mon Oct 29 06:31:51 2012(r242301)
@@ -25,11 +25,11 @@ ipfw_prestart()
if checkyesno dummynet_enable; then
required_modules="$required_modules dummynet"
fi
-
+   if checkyesno natd_enable; then
+   required_modules="$required_modules ipdivert"
+   fi
if checkyesno firewall_nat_enable; then
-   if ! checkyesno natd_enable; then
-   required_modules="$required_modules ipfw_nat"
-   fi
+   required_modules="$required_modules ipfw_nat"
fi
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242300 - head/sys/vm

2012-10-28 Thread Alan Cox
Author: alc
Date: Mon Oct 29 06:15:04 2012
New Revision: 242300
URL: http://svn.freebsd.org/changeset/base/242300

Log:
  Replace the page hold queue, PQ_HOLD, by a new page flag, PG_UNHOLDFREE,
  because the queue itself serves no purpose.  When a held page is freed,
  inserting the page into the hold queue has the side effect of setting the
  page's "queue" field to PQ_HOLD.  Later, when the page is unheld, it will
  be freed because the "queue" field is PQ_HOLD.  In other words, PQ_HOLD is
  used as a flag, not a queue.  So, this change replaces it with a flag.
  
  To accomodate the new page flag, make the page's "flags" field wider and
  "oflags" field narrower.
  
  Reviewed by:  kib

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Mon Oct 29 04:51:51 2012(r242299)
+++ head/sys/vm/vm_page.c   Mon Oct 29 06:15:04 2012(r242300)
@@ -308,7 +308,6 @@ vm_page_startup(vm_offset_t vaddr)
TAILQ_INIT(&vm_page_queues[i].pl);
vm_page_queues[PQ_INACTIVE].cnt = &cnt.v_inactive_count;
vm_page_queues[PQ_ACTIVE].cnt = &cnt.v_active_count;
-   vm_page_queues[PQ_HOLD].cnt = &cnt.v_active_count;
 
/*
 * Allocate memory for use when boot strapping the kernel memory
@@ -540,7 +539,7 @@ vm_page_unhold(vm_page_t mem)
vm_page_lock_assert(mem, MA_OWNED);
--mem->hold_count;
KASSERT(mem->hold_count >= 0, ("vm_page_unhold: hold count < 0!!!"));
-   if (mem->hold_count == 0 && mem->queue == PQ_HOLD)
+   if (mem->hold_count == 0 && (mem->flags & PG_UNHOLDFREE) != 0)
vm_page_free_toq(mem);
 }
 
@@ -2042,9 +2041,9 @@ vm_page_free_toq(vm_page_t m)
panic("vm_page_free: freeing wired page %p", m);
if (m->hold_count != 0) {
m->flags &= ~PG_ZERO;
-   vm_page_lock_queues();
-   vm_page_enqueue(PQ_HOLD, m);
-   vm_page_unlock_queues();
+   KASSERT((m->flags & PG_UNHOLDFREE) == 0,
+   ("vm_page_free: freeing PG_UNHOLDFREE page %p", m));
+   m->flags |= PG_UNHOLDFREE;
} else {
/*
 * Restore the default memory attribute to the page.

Modified: head/sys/vm/vm_page.h
==
--- head/sys/vm/vm_page.h   Mon Oct 29 04:51:51 2012(r242299)
+++ head/sys/vm/vm_page.h   Mon Oct 29 06:15:04 2012(r242300)
@@ -145,8 +145,8 @@ struct vm_page {
u_short cow;/* page cow mapping count (P) */
u_int wire_count;   /* wired down maps refs (P) */
uint8_t aflags; /* access is atomic */
-   uint8_t flags;  /* see below, often immutable after 
alloc */
-   u_short oflags; /* page flags (O) */
+   uint8_t oflags; /* page VPO_* flags (O) */
+   uint16_t flags; /* page PG_* flags (P) */
u_char  act_count;  /* page usage count (O) */
u_char  busy;   /* page busy count (O) */
/* NOTE that these must support one bit per DEV_BSIZE in a page!!! */
@@ -169,17 +169,16 @@ struct vm_page {
  *  mappings, and such pages are also not on any PQ queue.
  *
  */
-#defineVPO_BUSY0x0001  /* page is in transit */
-#defineVPO_WANTED  0x0002  /* someone is waiting for page */
-#defineVPO_UNMANAGED   0x0004  /* No PV management for page */
-#defineVPO_SWAPINPROG  0x0200  /* swap I/O in progress on page */
-#defineVPO_NOSYNC  0x0400  /* do not collect for syncer */
+#defineVPO_BUSY0x01/* page is in transit */
+#defineVPO_WANTED  0x02/* someone is waiting for page 
*/
+#defineVPO_UNMANAGED   0x04/* no PV management for page */
+#defineVPO_SWAPINPROG  0x08/* swap I/O in progress on page 
*/
+#defineVPO_NOSYNC  0x10/* do not collect for syncer */
 
 #definePQ_NONE 255
 #definePQ_INACTIVE 0
 #definePQ_ACTIVE   1
-#definePQ_HOLD 2
-#definePQ_COUNT3
+#definePQ_COUNT2
 
 struct vpgqueues {
struct pglist pl;
@@ -263,14 +262,15 @@ extern struct vpglocks pa_lock[];
  * Page flags.  If changed at any other time than page allocation or
  * freeing, the modification must be protected by the vm_page lock.
  */
-#definePG_CACHED   0x01/* page is cached */
-#definePG_FREE 0x02/* page is free */
-#definePG_FICTITIOUS   0x04/* physical page doesn't exist 
*/
-#definePG_ZERO 0x08/* page is zeroed */
-#definePG_MAR

Re: svn commit: r242161 - in head/sys: net netinet netpfil/pf

2012-10-28 Thread YongHyeon PYUN
On Mon, Oct 29, 2012 at 09:21:00AM +0400, Gleb Smirnoff wrote:
> On Mon, Oct 29, 2012 at 01:41:04PM -0700, YongHyeon PYUN wrote:
> Y> On Sun, Oct 28, 2012 at 02:01:37AM +0400, Gleb Smirnoff wrote:
> Y> > On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote:
> Y> > A> On 26.10.2012 23:06, Gleb Smirnoff wrote:
> Y> > A> > Author: glebius
> Y> > A> > Date: Fri Oct 26 21:06:33 2012
> Y> > A> > New Revision: 242161
> Y> > A> > URL: http://svn.freebsd.org/changeset/base/242161
> Y> > A> >
> Y> > A> > Log:
> Y> > A> >o Remove last argument to ip_fragment(), and obtain all needed 
> information
> Y> > A> >  on checksums directly from mbuf flags. This simplifies code.
> Y> > A> >o Clear CSUM_IP from the mbuf in ip_fragment() if we did 
> checksums in
> Y> 
> Y> I'm not sure whether ti(4)'s checksum offloading for IP fragmented
> Y> packets(CSUM_IP_FRAGS) still works after this change.  ti(4)
> Y> requires CSUM_IP should be set for IP fragmented packets. Not sure
> Y> whether it's a bug or not. I have a ti(4) controller but I don't
> Y> remember where I can find it and don't have a link
> Y> parter(1000baseSX) to test it. :-(
> 
> ti(4) declares both CSUM_IP and CSUM_IP_FRAGS, so ip_fragment() won't do

Because it supports both CSUM_IP and CSUM_IP_FRAGS. Probably ti(4)
is the only controller that supports TCP/UDP checksum offloading
for an IP fragmented packet.

> software checksums, and thus won't clear these flags.
> 
> Potentially a driver that announces one flag in if_hwassist but relies on
> couple of flags to be set on mbuf is not correct. If a driver can't do single
> checksum  processing independently from others, then it should set or clear
> appropriate flags in if_hwassist as a group.

Hmm, then what would be best way to achieve CSUM_IP_FRAGS in
driver? I don't have clear idea how to utilize the hardware
feature. The stack should tell that the mbuf needs TCP/UDP checksum
offloading for IP fragmented packet(i.e. CSUM_IP_FRAGS is not set by
upper stack).

> 
> Y> > A> >  hardware. Some driver may not announce CSUM_IP in theur 
> if_hwassist,
>
> 
> Oh, that was a typo! Software was meant.
> 
> -- 
> Totus tuus, Glebius.
___
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: r242161 - in head/sys: net netinet netpfil/pf

2012-10-28 Thread Gleb Smirnoff
On Mon, Oct 29, 2012 at 01:41:04PM -0700, YongHyeon PYUN wrote:
Y> On Sun, Oct 28, 2012 at 02:01:37AM +0400, Gleb Smirnoff wrote:
Y> > On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote:
Y> > A> On 26.10.2012 23:06, Gleb Smirnoff wrote:
Y> > A> > Author: glebius
Y> > A> > Date: Fri Oct 26 21:06:33 2012
Y> > A> > New Revision: 242161
Y> > A> > URL: http://svn.freebsd.org/changeset/base/242161
Y> > A> >
Y> > A> > Log:
Y> > A> >o Remove last argument to ip_fragment(), and obtain all needed 
information
Y> > A> >  on checksums directly from mbuf flags. This simplifies code.
Y> > A> >o Clear CSUM_IP from the mbuf in ip_fragment() if we did checksums 
in
Y> 
Y> I'm not sure whether ti(4)'s checksum offloading for IP fragmented
Y> packets(CSUM_IP_FRAGS) still works after this change.  ti(4)
Y> requires CSUM_IP should be set for IP fragmented packets. Not sure
Y> whether it's a bug or not. I have a ti(4) controller but I don't
Y> remember where I can find it and don't have a link
Y> parter(1000baseSX) to test it. :-(

ti(4) declares both CSUM_IP and CSUM_IP_FRAGS, so ip_fragment() won't do
software checksums, and thus won't clear these flags.

Potentially a driver that announces one flag in if_hwassist but relies on
couple of flags to be set on mbuf is not correct. If a driver can't do single
checksum  processing independently from others, then it should set or clear
appropriate flags in if_hwassist as a group.

Y> > A> >  hardware. Some driver may not announce CSUM_IP in theur 
if_hwassist,
   

Oh, that was a typo! Software was meant.

-- 
Totus tuus, Glebius.
___
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: r242274 - head/sys/sys

2012-10-28 Thread Gleb Smirnoff
On Mon, Oct 29, 2012 at 01:35:17AM +, Attilio Rao wrote:
A> Author: attilio
A> Date: Mon Oct 29 01:35:17 2012
A> New Revision: 242274
A> URL: http://svn.freebsd.org/changeset/base/242274
A> 
A> Log:
A>   Compiler have a precise knowledge of the content of sched_pin() and
A>   sched_unpin() as they are functions static and inline.  This way it
A>   can do two dangerous things:
A>   - Reorder instructions around both of them, taking out from the safe
A> path operations that are supposed to be (ie. per-cpu accesses)
A>   - Cache the value of td_pinned in CPU registers not making visible
A> in kernel context to the scheduler once it is scanning the runqueue,
A> as td_pinned is not marked volatile.
A>   
A>   In order to avoid both possible bugs explicitly, protect the safe path
A>   with compiler memory barriers. This will prevent reordering and caching
A>   by the compiler about td_pinned operations.
A>   
A>   Generally this could lead to suboptimal code traversing the pinnings
A>   but this is not the case as can be easilly verified:
A>   
http://lists.freebsd.org/pipermail/svn-src-projects/2012-October/005797.html

Now __compiler_membar() can be removed from kern_rmlock.c:360

-- 
Totus tuus, Glebius.
___
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: r242299 - in stable/7/lib/libc: compat-43 sys

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:51:51 2012
New Revision: 242299
URL: http://svn.freebsd.org/changeset/base/242299

Log:
  MFC r241855:
Update the kill(2) and killpg(2) man pages to the modern permission
checks. Also indicate killpg(2) is POSIX compliant.
  
  Approved by:  cperciva (implicit)

Modified:
  stable/7/lib/libc/compat-43/killpg.2
  stable/7/lib/libc/sys/kill.2
Directory Properties:
  stable/7/lib/libc/   (props changed)

Modified: stable/7/lib/libc/compat-43/killpg.2
==
--- stable/7/lib/libc/compat-43/killpg.2Mon Oct 29 04:51:51 2012
(r242298)
+++ stable/7/lib/libc/compat-43/killpg.2Mon Oct 29 04:51:51 2012
(r242299)
@@ -58,11 +58,9 @@ is 0,
 .Fn killpg
 sends the signal to the sending process's process group.
 .Pp
-The sending process and members of the process group must
-have the same effective user ID, or
-the sender must be the super-user.
-As a single special case the continue signal SIGCONT may be sent
-to any process with the same session ID as the caller.
+The sending process must be able to
+.Fn kill
+at least one process in the receiving process group.
 .Sh RETURN VALUES
 .Rv -std killpg
 .Sh ERRORS
@@ -83,9 +81,8 @@ No process can be found in the process g
 The process group was given as 0
 but the sending process does not have a process group.
 .It Bq Er EPERM
-The sending process is not the super-user and one or more
-of the target processes has an effective user ID different from that
-of the sending process.
+.Fn kill
+returns EPERM for all processes in the process group.
 .El
 .Sh SEE ALSO
 .Xr getpgrp 2 ,

Modified: stable/7/lib/libc/sys/kill.2
==
--- stable/7/lib/libc/sys/kill.2Mon Oct 29 04:51:51 2012
(r242298)
+++ stable/7/lib/libc/sys/kill.2Mon Oct 29 04:51:51 2012
(r242299)
@@ -64,11 +64,19 @@ This can be used to check the validity o
 For a process to have permission to send a signal to a process designated
 by
 .Fa pid ,
-the real or effective user ID of the receiving process must match
-that of the sending process or the user must have appropriate privileges
-(such as given by a set-user-ID program or the user is the super-user).
+the user must be the super-user, or
+the real or saved user ID of the receiving process must match
+the real or effective user ID of the sending process.
 A single exception is the signal SIGCONT, which may always be sent
-to any process with the same session ID as the caller.
+to any process with the same session ID as the sender.
+In addition, if the
+.Va security.bsd.conservative_signals
+.Xr sysctl
+is set to 1, the user is not a super-user, and
+the receiver is set-uid, then
+only job control and terminal control signals may
+be sent (in particular, only SIGKILL, SIGINT, SIGTERM, SIGALRM,
+SIGSTOP, SIGTTIN, SIGTTOU, SIGTSTP, SIGHUP, SIGUSR1, SIGUSR2).
 .Bl -tag -width Ds
 .It \&If Fa pid No \&is greater than zero :
 The
@@ -127,10 +135,9 @@ No process can be found corresponding to
 The process id was given as 0
 but the sending process does not have a process group.
 .It Bq Er EPERM
-The sending process is not the super-user and its effective
-user id does not match the effective user-id of the receiving process.
-When signaling a process group, this error is returned if any members
-of the group could not be signaled.
+The sending process does not have permission to send
+.Va sig
+to the receiving process.
 .El
 .Sh SEE ALSO
 .Xr getpgrp 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: r242298 - in stable/9/lib/libc: compat-43 sys

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:51:51 2012
New Revision: 242298
URL: http://svn.freebsd.org/changeset/base/242298

Log:
  MFC r241855:
Update the kill(2) and killpg(2) man pages to the modern permission
checks. Also indicate killpg(2) is POSIX compliant.
  
  Approved by:  cperciva (implicit)

Modified:
  stable/9/lib/libc/compat-43/killpg.2
  stable/9/lib/libc/sys/kill.2
Directory Properties:
  stable/9/lib/libc/   (props changed)
  stable/9/lib/libc/sys/   (props changed)

Modified: stable/9/lib/libc/compat-43/killpg.2
==
--- stable/9/lib/libc/compat-43/killpg.2Mon Oct 29 04:51:50 2012
(r242297)
+++ stable/9/lib/libc/compat-43/killpg.2Mon Oct 29 04:51:51 2012
(r242298)
@@ -58,11 +58,9 @@ is 0,
 .Fn killpg
 sends the signal to the sending process's process group.
 .Pp
-The sending process and members of the process group must
-have the same effective user ID, or
-the sender must be the super-user.
-As a single special case the continue signal SIGCONT may be sent
-to any process with the same session ID as the caller.
+The sending process must be able to
+.Fn kill
+at least one process in the receiving process group.
 .Sh RETURN VALUES
 .Rv -std killpg
 .Sh ERRORS
@@ -80,9 +78,8 @@ is not a valid signal number.
 No process can be found in the process group specified by
 .Fa pgrp .
 .It Bq Er EPERM
-The sending process is not the super-user and one or more
-of the target processes has an effective user ID different from that
-of the sending process.
+.Fn kill
+returns EPERM for all processes in the process group.
 .El
 .Sh SEE ALSO
 .Xr getpgrp 2 ,

Modified: stable/9/lib/libc/sys/kill.2
==
--- stable/9/lib/libc/sys/kill.2Mon Oct 29 04:51:50 2012
(r242297)
+++ stable/9/lib/libc/sys/kill.2Mon Oct 29 04:51:51 2012
(r242298)
@@ -64,11 +64,19 @@ This can be used to check the validity o
 For a process to have permission to send a signal to a process designated
 by
 .Fa pid ,
-the real or effective user ID of the receiving process must match
-that of the sending process or the user must have appropriate privileges
-(such as given by a set-user-ID program or the user is the super-user).
+the user must be the super-user, or
+the real or saved user ID of the receiving process must match
+the real or effective user ID of the sending process.
 A single exception is the signal SIGCONT, which may always be sent
-to any process with the same session ID as the caller.
+to any process with the same session ID as the sender.
+In addition, if the
+.Va security.bsd.conservative_signals
+.Xr sysctl
+is set to 1, the user is not a super-user, and
+the receiver is set-uid, then
+only job control and terminal control signals may
+be sent (in particular, only SIGKILL, SIGINT, SIGTERM, SIGALRM,
+SIGSTOP, SIGTTIN, SIGTTOU, SIGTSTP, SIGHUP, SIGUSR1, SIGUSR2).
 .Bl -tag -width Ds
 .It \&If Fa pid No \&is greater than zero :
 The
@@ -124,10 +132,9 @@ is not a valid signal number.
 No process or process group can be found corresponding to that specified by
 .Fa pid .
 .It Bq Er EPERM
-The sending process is not the super-user and its effective
-user id does not match the effective user-id of the receiving process.
-When signaling a process group, this error is returned if any members
-of the group could not be signaled.
+The sending process does not have permission to send
+.Va sig
+to the receiving process.
 .El
 .Sh SEE ALSO
 .Xr getpgrp 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: r242297 - in stable/8/lib/libc: compat-43 sys

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:51:50 2012
New Revision: 242297
URL: http://svn.freebsd.org/changeset/base/242297

Log:
  MFC r241855:
Update the kill(2) and killpg(2) man pages to the modern permission
checks. Also indicate killpg(2) is POSIX compliant.
  
  Approved by:  cperciva (implicit)

Modified:
  stable/8/lib/libc/compat-43/killpg.2
  stable/8/lib/libc/sys/kill.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/sys/   (props changed)

Modified: stable/8/lib/libc/compat-43/killpg.2
==
--- stable/8/lib/libc/compat-43/killpg.2Mon Oct 29 04:21:17 2012
(r242296)
+++ stable/8/lib/libc/compat-43/killpg.2Mon Oct 29 04:51:50 2012
(r242297)
@@ -58,11 +58,9 @@ is 0,
 .Fn killpg
 sends the signal to the sending process's process group.
 .Pp
-The sending process and members of the process group must
-have the same effective user ID, or
-the sender must be the super-user.
-As a single special case the continue signal SIGCONT may be sent
-to any process with the same session ID as the caller.
+The sending process must be able to
+.Fn kill
+at least one process in the receiving process group.
 .Sh RETURN VALUES
 .Rv -std killpg
 .Sh ERRORS
@@ -83,9 +81,8 @@ No process can be found in the process g
 The process group was given as 0
 but the sending process does not have a process group.
 .It Bq Er EPERM
-The sending process is not the super-user and one or more
-of the target processes has an effective user ID different from that
-of the sending process.
+.Fn kill
+returns EPERM for all processes in the process group.
 .El
 .Sh SEE ALSO
 .Xr getpgrp 2 ,

Modified: stable/8/lib/libc/sys/kill.2
==
--- stable/8/lib/libc/sys/kill.2Mon Oct 29 04:21:17 2012
(r242296)
+++ stable/8/lib/libc/sys/kill.2Mon Oct 29 04:51:50 2012
(r242297)
@@ -64,11 +64,19 @@ This can be used to check the validity o
 For a process to have permission to send a signal to a process designated
 by
 .Fa pid ,
-the real or effective user ID of the receiving process must match
-that of the sending process or the user must have appropriate privileges
-(such as given by a set-user-ID program or the user is the super-user).
+the user must be the super-user, or
+the real or saved user ID of the receiving process must match
+the real or effective user ID of the sending process.
 A single exception is the signal SIGCONT, which may always be sent
-to any process with the same session ID as the caller.
+to any process with the same session ID as the sender.
+In addition, if the
+.Va security.bsd.conservative_signals
+.Xr sysctl
+is set to 1, the user is not a super-user, and
+the receiver is set-uid, then
+only job control and terminal control signals may
+be sent (in particular, only SIGKILL, SIGINT, SIGTERM, SIGALRM,
+SIGSTOP, SIGTTIN, SIGTTOU, SIGTSTP, SIGHUP, SIGUSR1, SIGUSR2).
 .Bl -tag -width Ds
 .It \&If Fa pid No \&is greater than zero :
 The
@@ -127,10 +135,9 @@ No process can be found corresponding to
 The process id was given as 0
 but the sending process does not have a process group.
 .It Bq Er EPERM
-The sending process is not the super-user and its effective
-user id does not match the effective user-id of the receiving process.
-When signaling a process group, this error is returned if any members
-of the group could not be signaled.
+The sending process does not have permission to send
+.Va sig
+to the receiving process.
 .El
 .Sh SEE ALSO
 .Xr getpgrp 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"


Re: svn commit: r242283 - stable/9/sys/kern

2012-10-28 Thread Eitan Adler
On 29 October 2012 00:46, Eitan Adler  wrote:
> On 29 October 2012 00:32, Konstantin Belousov  wrote:
>> On Mon, Oct 29, 2012 at 03:52:19AM +, Eitan Adler wrote:
>>> Author: eadler
>>> Date: Mon Oct 29 03:52:18 2012
>>> New Revision: 242283
>>> URL: http://svn.freebsd.org/changeset/base/242283
>>>
>>> Log:
>>>   MFC r241855,r241859:
>>>   Update the kill(2) and killpg(2) man pages to the modern permission
>>>   checks. Also indicate killpg(2) is POSIX compliant.
>>>
>>>   Correct the killpg(2) return values:
>>>
>>>   Return EPERM if processes were found but they
>>>   were unable to be signaled.
>>>
>>>   Return the first error from p_cansignal if no signal was successful.
>>>
>>>   Discussed with: jilles
>>>   Approved by:cperciva (implicit)
>>>
>>> Modified:
>>>   stable/9/sys/kern/kern_sig.c
>>> Directory Properties:
>>>   stable/9/sys/   (props changed)
>
>> According to svn mail, r241855 was not merged.
>
> Okay, this is weird. I am certain my original merge command included
> both revisions. Looking at the email it is clear that the
> documentation was not MFCed.
>
> If I attempt to MFC again now I see no changes.
>
> %svn merge -c241855 svn+ssh://svn.freebsd.org/base//head/sys stable9/sys
> %svn status stable9
> %svn diff stable9
> %
>
> What did I do wrong?

Ah! I see.

I forgot that the manual pages are not in the same directory and that
I need to merge to lib/libc as well. I shall fix now.

-- 
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: r242283 - stable/9/sys/kern

2012-10-28 Thread Eitan Adler
On 29 October 2012 00:32, Konstantin Belousov  wrote:
> On Mon, Oct 29, 2012 at 03:52:19AM +, Eitan Adler wrote:
>> Author: eadler
>> Date: Mon Oct 29 03:52:18 2012
>> New Revision: 242283
>> URL: http://svn.freebsd.org/changeset/base/242283
>>
>> Log:
>>   MFC r241855,r241859:
>>   Update the kill(2) and killpg(2) man pages to the modern permission
>>   checks. Also indicate killpg(2) is POSIX compliant.
>>
>>   Correct the killpg(2) return values:
>>
>>   Return EPERM if processes were found but they
>>   were unable to be signaled.
>>
>>   Return the first error from p_cansignal if no signal was successful.
>>
>>   Discussed with: jilles
>>   Approved by:cperciva (implicit)
>>
>> Modified:
>>   stable/9/sys/kern/kern_sig.c
>> Directory Properties:
>>   stable/9/sys/   (props changed)

> According to svn mail, r241855 was not merged.

Okay, this is weird. I am certain my original merge command included
both revisions. Looking at the email it is clear that the
documentation was not MFCed.

If I attempt to MFC again now I see no changes.

%svn merge -c241855 svn+ssh://svn.freebsd.org/base//head/sys stable9/sys
%svn status stable9
%svn diff stable9
%

What did I do wrong?


-- 
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: r242161 - in head/sys: net netinet netpfil/pf

2012-10-28 Thread YongHyeon PYUN
On Sun, Oct 28, 2012 at 02:01:37AM +0400, Gleb Smirnoff wrote:
> On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote:
> A> On 26.10.2012 23:06, Gleb Smirnoff wrote:
> A> > Author: glebius
> A> > Date: Fri Oct 26 21:06:33 2012
> A> > New Revision: 242161
> A> > URL: http://svn.freebsd.org/changeset/base/242161
> A> >
> A> > Log:
> A> >o Remove last argument to ip_fragment(), and obtain all needed 
> information
> A> >  on checksums directly from mbuf flags. This simplifies code.
> A> >o Clear CSUM_IP from the mbuf in ip_fragment() if we did checksums in

I'm not sure whether ti(4)'s checksum offloading for IP fragmented
packets(CSUM_IP_FRAGS) still works after this change.  ti(4)
requires CSUM_IP should be set for IP fragmented packets. Not sure
whether it's a bug or not. I have a ti(4) controller but I don't
remember where I can find it and don't have a link
parter(1000baseSX) to test it. :-(

> A> >  hardware. Some driver may not announce CSUM_IP in theur if_hwassist,
> A> >  although try to do checksums if CSUM_IP set on mbuf. Example is 
> em(4).

em(4) had TX IP checksum offloading support but it was removed
without justification. There could be some reason on that decision
but I don't see any compelling reason.

> A> 
> A> I'm not getting your description here?  Why work around a bug in a driver
> A> in ip_fragment() when we can fix the bug in the driver?
> 
> Well, that was actually bug in the stack and a very special driver that
> demonstrates it. I may even agree that driver is incorrect, but the stack was
> incorrect, too.
> 
> -- 
> Totus tuus, Glebius.
___
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: r242283 - stable/9/sys/kern

2012-10-28 Thread Konstantin Belousov
On Mon, Oct 29, 2012 at 03:52:19AM +, Eitan Adler wrote:
> Author: eadler
> Date: Mon Oct 29 03:52:18 2012
> New Revision: 242283
> URL: http://svn.freebsd.org/changeset/base/242283
> 
> Log:
>   MFC r241855,r241859:
>   Update the kill(2) and killpg(2) man pages to the modern permission
>   checks. Also indicate killpg(2) is POSIX compliant.
>   
>   Correct the killpg(2) return values:
>   
>   Return EPERM if processes were found but they
>   were unable to be signaled.
>   
>   Return the first error from p_cansignal if no signal was successful.
>   
>   Discussed with: jilles
>   Approved by:cperciva (implicit)
> 
> Modified:
>   stable/9/sys/kern/kern_sig.c
> Directory Properties:
>   stable/9/sys/   (props changed)
According to svn mail, r241855 was not merged.

> 
> Modified: stable/9/sys/kern/kern_sig.c
> ==
> --- stable/9/sys/kern/kern_sig.c  Mon Oct 29 03:52:18 2012
> (r242282)
> +++ stable/9/sys/kern/kern_sig.c  Mon Oct 29 03:52:18 2012
> (r242283)
> @@ -1599,8 +1599,10 @@ killpg1(struct thread *td, int sig, int 
>  {
>   struct proc *p;
>   struct pgrp *pgrp;
> - int nfound = 0;
> + int err;
> + int ret;
>  
> + ret = ESRCH;
>   if (all) {
>   /*
>* broadcast
> @@ -1613,11 +1615,14 @@ killpg1(struct thread *td, int sig, int 
>   PROC_UNLOCK(p);
>   continue;
>   }
> - if (p_cansignal(td, p, sig) == 0) {
> - nfound++;
> + err = p_cansignal(td, p, sig);
> + if (err == 0) {
>   if (sig)
>   pksignal(p, sig, ksi);
> + ret = err;
>   }
> + else if (ret == ESRCH)
> + ret = err;
>   PROC_UNLOCK(p);
>   }
>   sx_sunlock(&allproc_lock);
> @@ -1644,16 +1649,19 @@ killpg1(struct thread *td, int sig, int 
>   PROC_UNLOCK(p);
>   continue;
>   }
> - if (p_cansignal(td, p, sig) == 0) {
> - nfound++;
> + err = p_cansignal(td, p, sig);
> + if (err == 0) {
>   if (sig)
>   pksignal(p, sig, ksi);
> + ret = err;
>   }
> + else if (ret == ESRCH)
> + ret = err;
>   PROC_UNLOCK(p);
>   }
>   PGRP_UNLOCK(pgrp);
>   }
> - return (nfound ? 0 : ESRCH);
> + return (ret);
>  }
>  
>  #ifndef _SYS_SYSPROTO_H_


pgpfRCVH2nMc2.pgp
Description: PGP signature


svn commit: r242296 - stable/7/usr.bin/uuencode

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:21:17 2012
New Revision: 242296
URL: http://svn.freebsd.org/changeset/base/242296

Log:
  MFC r242136:
Prefer an example users born after myself might use.
  
  Approved by:  cperciva (implicit)

Modified:
  stable/7/usr.bin/uuencode/uuencode.1
Directory Properties:
  stable/7/usr.bin/uuencode/   (props changed)

Modified: stable/7/usr.bin/uuencode/uuencode.1
==
--- stable/7/usr.bin/uuencode/uuencode.1Mon Oct 29 04:21:16 2012
(r242295)
+++ stable/7/usr.bin/uuencode/uuencode.1Mon Oct 29 04:21:17 2012
(r242296)
@@ -187,7 +187,7 @@ tree.
 .Pp
 .Bd -literal -offset indent -compact
 tar cf \- src_tree \&| compress \&|
-uuencode src_tree.tar.Z \&| mail sys1!sys2!user
+uuencode src_tree.tar.Z \&| mail u...@example.com
 .Ed
 .Pp
 The following example unpacks all uuencoded
___
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: r242295 - stable/8/usr.bin/uuencode

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:21:16 2012
New Revision: 242295
URL: http://svn.freebsd.org/changeset/base/242295

Log:
  MFC r242136:
Prefer an example users born after myself might use.
  
  Approved by:  cperciva (implicit)

Modified:
  stable/8/usr.bin/uuencode/uuencode.1
Directory Properties:
  stable/8/usr.bin/uuencode/   (props changed)

Modified: stable/8/usr.bin/uuencode/uuencode.1
==
--- stable/8/usr.bin/uuencode/uuencode.1Mon Oct 29 04:21:16 2012
(r242294)
+++ stable/8/usr.bin/uuencode/uuencode.1Mon Oct 29 04:21:16 2012
(r242295)
@@ -187,7 +187,7 @@ tree.
 .Pp
 .Bd -literal -offset indent -compact
 tar cf \- src_tree \&| compress \&|
-uuencode src_tree.tar.Z \&| mail sys1!sys2!user
+uuencode src_tree.tar.Z \&| mail u...@example.com
 .Ed
 .Pp
 The following example unpacks all uuencoded
___
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: r242294 - stable/9/usr.bin/uuencode

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:21:16 2012
New Revision: 242294
URL: http://svn.freebsd.org/changeset/base/242294

Log:
  MFC r242136:
Prefer an example users born after myself might use.
  
  Approved by:  cperciva (implicit)

Modified:
  stable/9/usr.bin/uuencode/uuencode.1
Directory Properties:
  stable/9/usr.bin/uuencode/   (props changed)

Modified: stable/9/usr.bin/uuencode/uuencode.1
==
--- stable/9/usr.bin/uuencode/uuencode.1Mon Oct 29 04:18:34 2012
(r242293)
+++ stable/9/usr.bin/uuencode/uuencode.1Mon Oct 29 04:21:16 2012
(r242294)
@@ -183,7 +183,7 @@ tree.
 .Pp
 .Bd -literal -offset indent -compact
 tar cf \- src_tree \&| compress \&|
-uuencode src_tree.tar.Z \&| mail sys1!sys2!user
+uuencode src_tree.tar.Z \&| mail u...@example.com
 .Ed
 .Pp
 The following example unpacks all uuencoded
___
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: r242293 - stable/9/lib/libfetch

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:18:34 2012
New Revision: 242293
URL: http://svn.freebsd.org/changeset/base/242293

Log:
  MFC r241841:
Implement HTTP 305 redirect handling.
  
  PR:   172452
  Approved by:  cperciva (implicit)

Modified:
  stable/9/lib/libfetch/http.c
Directory Properties:
  stable/9/lib/libfetch/   (props changed)

Modified: stable/9/lib/libfetch/http.c
==
--- stable/9/lib/libfetch/http.cMon Oct 29 04:18:34 2012
(r242292)
+++ stable/9/lib/libfetch/http.cMon Oct 29 04:18:34 2012
(r242293)
@@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$");
 #define HTTP_MOVED_TEMP302
 #define HTTP_SEE_OTHER 303
 #define HTTP_NOT_MODIFIED  304
+#define HTTP_USE_PROXY 305
 #define HTTP_TEMP_REDIRECT 307
 #define HTTP_PERM_REDIRECT 308
 #define HTTP_NEED_AUTH 401
@@ -105,6 +106,7 @@ __FBSDID("$FreeBSD$");
 #define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \
|| (xyz) == HTTP_MOVED_TEMP \
|| (xyz) == HTTP_TEMP_REDIRECT \
+   || (xyz) == HTTP_USE_PROXY \
|| (xyz) == HTTP_SEE_OTHER)
 
 #define HTTP_ERROR(xyz) ((xyz) > 400 && (xyz) < 599)
@@ -1689,6 +1691,7 @@ http_request(struct url *URL, const char
case HTTP_MOVED_PERM:
case HTTP_MOVED_TEMP:
case HTTP_SEE_OTHER:
+   case HTTP_USE_PROXY:
/*
 * Not so fine, but we still have to read the
 * headers to get the new location.
@@ -1770,7 +1773,8 @@ http_request(struct url *URL, const char
 */
if (noredirect &&
conn->err != HTTP_MOVED_PERM &&
-   conn->err != HTTP_PERM_REDIRECT) {
+   conn->err != HTTP_PERM_REDIRECT &&
+   conn->err != HTTP_USE_PROXY) {
n = 1;
break;
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242292 - stable/7/lib/libfetch

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:18:34 2012
New Revision: 242292
URL: http://svn.freebsd.org/changeset/base/242292

Log:
  MFC r241841:
Implement HTTP 305 redirect handling.
  
  PR:   172452
  Approved by:  cperciva (implicit)

Modified:
  stable/7/lib/libfetch/http.c
Directory Properties:
  stable/7/lib/libfetch/   (props changed)

Modified: stable/7/lib/libfetch/http.c
==
--- stable/7/lib/libfetch/http.cMon Oct 29 04:18:33 2012
(r242291)
+++ stable/7/lib/libfetch/http.cMon Oct 29 04:18:34 2012
(r242292)
@@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$");
 #define HTTP_MOVED_TEMP302
 #define HTTP_SEE_OTHER 303
 #define HTTP_NOT_MODIFIED  304
+#define HTTP_USE_PROXY 305
 #define HTTP_TEMP_REDIRECT 307
 #define HTTP_PERM_REDIRECT 308
 #define HTTP_NEED_AUTH 401
@@ -105,6 +106,7 @@ __FBSDID("$FreeBSD$");
 #define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \
|| (xyz) == HTTP_MOVED_TEMP \
|| (xyz) == HTTP_TEMP_REDIRECT \
+   || (xyz) == HTTP_USE_PROXY \
|| (xyz) == HTTP_SEE_OTHER)
 
 #define HTTP_ERROR(xyz) ((xyz) > 400 && (xyz) < 599)
@@ -1682,6 +1684,7 @@ http_request(struct url *URL, const char
case HTTP_MOVED_PERM:
case HTTP_MOVED_TEMP:
case HTTP_SEE_OTHER:
+   case HTTP_USE_PROXY:
/*
 * Not so fine, but we still have to read the
 * headers to get the new location.
@@ -1763,7 +1766,8 @@ http_request(struct url *URL, const char
 */
if (noredirect &&
conn->err != HTTP_MOVED_PERM &&
-   conn->err != HTTP_PERM_REDIRECT) {
+   conn->err != HTTP_PERM_REDIRECT &&
+   conn->err != HTTP_USE_PROXY) {
n = 1;
break;
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242291 - stable/8/lib/libfetch

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:18:33 2012
New Revision: 242291
URL: http://svn.freebsd.org/changeset/base/242291

Log:
  MFC r241841:
Implement HTTP 305 redirect handling.
  
  PR:   172452
  Approved by:  cperciva (implicit)

Modified:
  stable/8/lib/libfetch/http.c
Directory Properties:
  stable/8/lib/libfetch/   (props changed)

Modified: stable/8/lib/libfetch/http.c
==
--- stable/8/lib/libfetch/http.cMon Oct 29 04:16:52 2012
(r242290)
+++ stable/8/lib/libfetch/http.cMon Oct 29 04:18:33 2012
(r242291)
@@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$");
 #define HTTP_MOVED_TEMP302
 #define HTTP_SEE_OTHER 303
 #define HTTP_NOT_MODIFIED  304
+#define HTTP_USE_PROXY 305
 #define HTTP_TEMP_REDIRECT 307
 #define HTTP_PERM_REDIRECT 308
 #define HTTP_NEED_AUTH 401
@@ -105,6 +106,7 @@ __FBSDID("$FreeBSD$");
 #define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \
|| (xyz) == HTTP_MOVED_TEMP \
|| (xyz) == HTTP_TEMP_REDIRECT \
+   || (xyz) == HTTP_USE_PROXY \
|| (xyz) == HTTP_SEE_OTHER)
 
 #define HTTP_ERROR(xyz) ((xyz) > 400 && (xyz) < 599)
@@ -1689,6 +1691,7 @@ http_request(struct url *URL, const char
case HTTP_MOVED_PERM:
case HTTP_MOVED_TEMP:
case HTTP_SEE_OTHER:
+   case HTTP_USE_PROXY:
/*
 * Not so fine, but we still have to read the
 * headers to get the new location.
@@ -1770,7 +1773,8 @@ http_request(struct url *URL, const char
 */
if (noredirect &&
conn->err != HTTP_MOVED_PERM &&
-   conn->err != HTTP_PERM_REDIRECT) {
+   conn->err != HTTP_PERM_REDIRECT &&
+   conn->err != HTTP_USE_PROXY) {
n = 1;
break;
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242290 - stable/7/lib/libfetch

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:16:52 2012
New Revision: 242290
URL: http://svn.freebsd.org/changeset/base/242290

Log:
  MFC r241840:
Don't deny non-temporary redirects if the -A option is set (per
the man page) [0]
  
While here add support for draft-reschke-http-status-308-07
  
  PR:   172451 [0]
  Approved by:  cperciva (implicit)

Modified:
  stable/7/lib/libfetch/http.c
  stable/7/lib/libfetch/http.errors
Directory Properties:
  stable/7/lib/libfetch/   (props changed)

Modified: stable/7/lib/libfetch/http.c
==
--- stable/7/lib/libfetch/http.cMon Oct 29 04:16:52 2012
(r242289)
+++ stable/7/lib/libfetch/http.cMon Oct 29 04:16:52 2012
(r242290)
@@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$");
 #define HTTP_SEE_OTHER 303
 #define HTTP_NOT_MODIFIED  304
 #define HTTP_TEMP_REDIRECT 307
+#define HTTP_PERM_REDIRECT 308
 #define HTTP_NEED_AUTH 401
 #define HTTP_NEED_PROXY_AUTH   407
 #define HTTP_BAD_RANGE 416
@@ -1509,8 +1510,7 @@ http_request(struct url *URL, const char
/* try the provided URL first */
url = URL;
 
-   /* if the A flag is set, we only get one try */
-   n = noredirect ? 1 : MAX_REDIRECT;
+   n = MAX_REDIRECT;
i = 0;
 
e = HTTP_PROTOCOL_ERROR;
@@ -1757,6 +1757,16 @@ http_request(struct url *URL, const char
case hdr_location:
if (!HTTP_REDIRECT(conn->err))
break;
+   /*
+* if the A flag is set, we don't follow
+* temporary redirects.
+*/
+   if (noredirect &&
+   conn->err != HTTP_MOVED_PERM &&
+   conn->err != HTTP_PERM_REDIRECT) {
+   n = 1;
+   break;
+}
if (new)
free(new);
if (verbose)

Modified: stable/7/lib/libfetch/http.errors
==
--- stable/7/lib/libfetch/http.errors   Mon Oct 29 04:16:52 2012
(r242289)
+++ stable/7/lib/libfetch/http.errors   Mon Oct 29 04:16:52 2012
(r242290)
@@ -18,6 +18,7 @@
 304 OK Not Modified
 305 INFO   Use Proxy
 307 MOVED  Temporary Redirect
+308 MOVED  Permanent Redirect
 400 PROTO  Bad Request
 401 AUTH   Unauthorized
 402 AUTH   Payment Required
___
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: r242289 - stable/9/lib/libfetch

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:16:52 2012
New Revision: 242289
URL: http://svn.freebsd.org/changeset/base/242289

Log:
  MFC r241840:
Don't deny non-temporary redirects if the -A option is set (per
the man page) [0]
  
While here add support for draft-reschke-http-status-308-07
  
  PR:   172451 [0]
  Approved by:  cperciva (implicit)

Modified:
  stable/9/lib/libfetch/http.c
  stable/9/lib/libfetch/http.errors
Directory Properties:
  stable/9/lib/libfetch/   (props changed)

Modified: stable/9/lib/libfetch/http.c
==
--- stable/9/lib/libfetch/http.cMon Oct 29 04:16:52 2012
(r242288)
+++ stable/9/lib/libfetch/http.cMon Oct 29 04:16:52 2012
(r242289)
@@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$");
 #define HTTP_SEE_OTHER 303
 #define HTTP_NOT_MODIFIED  304
 #define HTTP_TEMP_REDIRECT 307
+#define HTTP_PERM_REDIRECT 308
 #define HTTP_NEED_AUTH 401
 #define HTTP_NEED_PROXY_AUTH   407
 #define HTTP_BAD_RANGE 416
@@ -1516,8 +1517,7 @@ http_request(struct url *URL, const char
/* try the provided URL first */
url = URL;
 
-   /* if the A flag is set, we only get one try */
-   n = noredirect ? 1 : MAX_REDIRECT;
+   n = MAX_REDIRECT;
i = 0;
 
e = HTTP_PROTOCOL_ERROR;
@@ -1764,6 +1764,16 @@ http_request(struct url *URL, const char
case hdr_location:
if (!HTTP_REDIRECT(conn->err))
break;
+   /*
+* if the A flag is set, we don't follow
+* temporary redirects.
+*/
+   if (noredirect &&
+   conn->err != HTTP_MOVED_PERM &&
+   conn->err != HTTP_PERM_REDIRECT) {
+   n = 1;
+   break;
+}
if (new)
free(new);
if (verbose)

Modified: stable/9/lib/libfetch/http.errors
==
--- stable/9/lib/libfetch/http.errors   Mon Oct 29 04:16:52 2012
(r242288)
+++ stable/9/lib/libfetch/http.errors   Mon Oct 29 04:16:52 2012
(r242289)
@@ -18,6 +18,7 @@
 304 OK Not Modified
 305 INFO   Use Proxy
 307 MOVED  Temporary Redirect
+308 MOVED  Permanent Redirect
 400 PROTO  Bad Request
 401 AUTH   Unauthorized
 402 AUTH   Payment Required
___
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: r242288 - stable/8/lib/libfetch

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:16:52 2012
New Revision: 242288
URL: http://svn.freebsd.org/changeset/base/242288

Log:
  MFC r241840:
Don't deny non-temporary redirects if the -A option is set (per
the man page) [0]
  
While here add support for draft-reschke-http-status-308-07
  
  PR:   172451 [0]
  Approved by:  cperciva (implicit)

Modified:
  stable/8/lib/libfetch/http.c
  stable/8/lib/libfetch/http.errors
Directory Properties:
  stable/8/lib/libfetch/   (props changed)

Modified: stable/8/lib/libfetch/http.c
==
--- stable/8/lib/libfetch/http.cMon Oct 29 04:09:21 2012
(r242287)
+++ stable/8/lib/libfetch/http.cMon Oct 29 04:16:52 2012
(r242288)
@@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$");
 #define HTTP_SEE_OTHER 303
 #define HTTP_NOT_MODIFIED  304
 #define HTTP_TEMP_REDIRECT 307
+#define HTTP_PERM_REDIRECT 308
 #define HTTP_NEED_AUTH 401
 #define HTTP_NEED_PROXY_AUTH   407
 #define HTTP_BAD_RANGE 416
@@ -1516,8 +1517,7 @@ http_request(struct url *URL, const char
/* try the provided URL first */
url = URL;
 
-   /* if the A flag is set, we only get one try */
-   n = noredirect ? 1 : MAX_REDIRECT;
+   n = MAX_REDIRECT;
i = 0;
 
e = HTTP_PROTOCOL_ERROR;
@@ -1764,6 +1764,16 @@ http_request(struct url *URL, const char
case hdr_location:
if (!HTTP_REDIRECT(conn->err))
break;
+   /*
+* if the A flag is set, we don't follow
+* temporary redirects.
+*/
+   if (noredirect &&
+   conn->err != HTTP_MOVED_PERM &&
+   conn->err != HTTP_PERM_REDIRECT) {
+   n = 1;
+   break;
+}
if (new)
free(new);
if (verbose)

Modified: stable/8/lib/libfetch/http.errors
==
--- stable/8/lib/libfetch/http.errors   Mon Oct 29 04:09:21 2012
(r242287)
+++ stable/8/lib/libfetch/http.errors   Mon Oct 29 04:16:52 2012
(r242288)
@@ -18,6 +18,7 @@
 304 OK Not Modified
 305 INFO   Use Proxy
 307 MOVED  Temporary Redirect
+308 MOVED  Permanent Redirect
 400 PROTO  Bad Request
 401 AUTH   Unauthorized
 402 AUTH   Payment Required
___
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: r242287 - stable/7/sys/dev/mpt

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:09:21 2012
New Revision: 242287
URL: http://svn.freebsd.org/changeset/base/242287

Log:
  MFC r241858:
Remove unused code since the 5.x days
  
  Approved by:  cperciva (implicit)

Modified:
  stable/7/sys/dev/mpt/mpt_pci.c
Directory Properties:
  stable/7/sys/   (props changed)

Modified: stable/7/sys/dev/mpt/mpt_pci.c
==
--- stable/7/sys/dev/mpt/mpt_pci.c  Mon Oct 29 04:09:20 2012
(r242286)
+++ stable/7/sys/dev/mpt/mpt_pci.c  Mon Oct 29 04:09:21 2012
(r242287)
@@ -261,68 +261,6 @@ mpt_pci_probe(device_t dev)
return (rval);
 }
 
-#if__FreeBSD_version < 50  
-static void
-mpt_set_options(struct mpt_softc *mpt)
-{
-   int bitmap;
-
-   bitmap = 0;
-   if (getenv_int("mpt_disable", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->disabled = 1;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug1", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG1;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug2", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG2;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug3", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG3;
-   }
-   }
-
-   mpt->cfg_role = MPT_ROLE_DEFAULT;
-   bitmap = 0;
-   if (getenv_int("mpt_nil_role", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->cfg_role = 0;
-   }
-   mpt->do_cfg_role = 1;
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_tgt_role", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->cfg_role |= MPT_ROLE_TARGET;
-   }
-   mpt->do_cfg_role = 1;
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_ini_role", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->cfg_role |= MPT_ROLE_INITIATOR;
-   }
-   mpt->do_cfg_role = 1;
-   }
-   mpt->msi_enable = 0;
-}
-#else
 static void
 mpt_set_options(struct mpt_softc *mpt)
 {
@@ -354,7 +292,6 @@ mpt_set_options(struct mpt_softc *mpt)
mpt->msi_enable = tval;
}
 }
-#endif
 
 static void
 mpt_link_peer(struct mpt_softc *mpt)
___
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: r242286 - stable/9/sys/dev/mpt

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:09:20 2012
New Revision: 242286
URL: http://svn.freebsd.org/changeset/base/242286

Log:
  MFC r241858:
Remove unused code since the 5.x days
  
  Approved by:  cperciva (implicit)

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

Modified: stable/9/sys/dev/mpt/mpt_pci.c
==
--- stable/9/sys/dev/mpt/mpt_pci.c  Mon Oct 29 04:09:20 2012
(r242285)
+++ stable/9/sys/dev/mpt/mpt_pci.c  Mon Oct 29 04:09:20 2012
(r242286)
@@ -261,68 +261,6 @@ mpt_pci_probe(device_t dev)
return (rval);
 }
 
-#if__FreeBSD_version < 50  
-static void
-mpt_set_options(struct mpt_softc *mpt)
-{
-   int bitmap;
-
-   bitmap = 0;
-   if (getenv_int("mpt_disable", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->disabled = 1;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug1", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG1;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug2", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG2;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug3", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG3;
-   }
-   }
-
-   mpt->cfg_role = MPT_ROLE_DEFAULT;
-   bitmap = 0;
-   if (getenv_int("mpt_nil_role", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->cfg_role = 0;
-   }
-   mpt->do_cfg_role = 1;
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_tgt_role", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->cfg_role |= MPT_ROLE_TARGET;
-   }
-   mpt->do_cfg_role = 1;
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_ini_role", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->cfg_role |= MPT_ROLE_INITIATOR;
-   }
-   mpt->do_cfg_role = 1;
-   }
-   mpt->msi_enable = 0;
-}
-#else
 static void
 mpt_set_options(struct mpt_softc *mpt)
 {
@@ -354,7 +292,6 @@ mpt_set_options(struct mpt_softc *mpt)
mpt->msi_enable = tval;
}
 }
-#endif
 
 static void
 mpt_link_peer(struct mpt_softc *mpt)
___
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: r242285 - stable/8/sys/dev/mpt

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 04:09:20 2012
New Revision: 242285
URL: http://svn.freebsd.org/changeset/base/242285

Log:
  MFC r241858:
Remove unused code since the 5.x days
  
  Approved by:  cperciva (implicit)

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

Modified: stable/8/sys/dev/mpt/mpt_pci.c
==
--- stable/8/sys/dev/mpt/mpt_pci.c  Mon Oct 29 03:52:19 2012
(r242284)
+++ stable/8/sys/dev/mpt/mpt_pci.c  Mon Oct 29 04:09:20 2012
(r242285)
@@ -261,68 +261,6 @@ mpt_pci_probe(device_t dev)
return (rval);
 }
 
-#if__FreeBSD_version < 50  
-static void
-mpt_set_options(struct mpt_softc *mpt)
-{
-   int bitmap;
-
-   bitmap = 0;
-   if (getenv_int("mpt_disable", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->disabled = 1;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug1", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG1;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug2", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG2;
-   }
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_debug3", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->verbose = MPT_PRT_DEBUG3;
-   }
-   }
-
-   mpt->cfg_role = MPT_ROLE_DEFAULT;
-   bitmap = 0;
-   if (getenv_int("mpt_nil_role", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->cfg_role = 0;
-   }
-   mpt->do_cfg_role = 1;
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_tgt_role", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->cfg_role |= MPT_ROLE_TARGET;
-   }
-   mpt->do_cfg_role = 1;
-   }
-   bitmap = 0;
-   if (getenv_int("mpt_ini_role", &bitmap)) {
-   if (bitmap & (1 << mpt->unit)) {
-   mpt->cfg_role |= MPT_ROLE_INITIATOR;
-   }
-   mpt->do_cfg_role = 1;
-   }
-   mpt->msi_enable = 0;
-}
-#else
 static void
 mpt_set_options(struct mpt_softc *mpt)
 {
@@ -354,7 +292,6 @@ mpt_set_options(struct mpt_softc *mpt)
mpt->msi_enable = tval;
}
 }
-#endif
 
 static void
 mpt_link_peer(struct mpt_softc *mpt)
___
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: r242284 - stable/7/sys/kern

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 03:52:19 2012
New Revision: 242284
URL: http://svn.freebsd.org/changeset/base/242284

Log:
  MFC r241855,r241859:
Update the kill(2) and killpg(2) man pages to the modern permission
checks. Also indicate killpg(2) is POSIX compliant.
  
Correct the killpg(2) return values:
  
Return EPERM if processes were found but they
were unable to be signaled.
  
Return the first error from p_cansignal if no signal was successful.
  
  Discussed with:   jilles
  Approved by:  cperciva (implicit)

Modified:
  stable/7/sys/kern/kern_sig.c
Directory Properties:
  stable/7/sys/   (props changed)

Modified: stable/7/sys/kern/kern_sig.c
==
--- stable/7/sys/kern/kern_sig.cMon Oct 29 03:52:18 2012
(r242283)
+++ stable/7/sys/kern/kern_sig.cMon Oct 29 03:52:19 2012
(r242284)
@@ -1620,8 +1620,10 @@ killpg1(td, sig, pgid, all)
 {
register struct proc *p;
struct pgrp *pgrp;
-   int nfound = 0;
+   int err;
+   int ret;
 
+   ret = ESRCH;
if (all) {
/*
 * broadcast
@@ -1634,11 +1636,14 @@ killpg1(td, sig, pgid, all)
PROC_UNLOCK(p);
continue;
}
-   if (p_cansignal(td, p, sig) == 0) {
-   nfound++;
+   err = p_cansignal(td, p, sig);
+   if (err == 0) {
if (sig)
psignal(p, sig);
+   ret = err;
}
+   else if (ret == ESRCH)
+   ret = err;
PROC_UNLOCK(p);
}
sx_sunlock(&allproc_lock);
@@ -1665,16 +1670,19 @@ killpg1(td, sig, pgid, all)
PROC_UNLOCK(p);
continue;
}
-   if (p_cansignal(td, p, sig) == 0) {
-   nfound++;
+   err = p_cansignal(td, p, sig);
+   if (err == 0) {
if (sig)
psignal(p, sig);
+   ret = err;
}
+   else if (ret == ESRCH)
+   ret = err;
PROC_UNLOCK(p);
}
PGRP_UNLOCK(pgrp);
}
-   return (nfound ? 0 : ESRCH);
+   return (ret);
 }
 
 #ifndef _SYS_SYSPROTO_H_
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242283 - stable/9/sys/kern

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 03:52:18 2012
New Revision: 242283
URL: http://svn.freebsd.org/changeset/base/242283

Log:
  MFC r241855,r241859:
Update the kill(2) and killpg(2) man pages to the modern permission
checks. Also indicate killpg(2) is POSIX compliant.
  
Correct the killpg(2) return values:
  
Return EPERM if processes were found but they
were unable to be signaled.
  
Return the first error from p_cansignal if no signal was successful.
  
  Discussed with:   jilles
  Approved by:  cperciva (implicit)

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

Modified: stable/9/sys/kern/kern_sig.c
==
--- stable/9/sys/kern/kern_sig.cMon Oct 29 03:52:18 2012
(r242282)
+++ stable/9/sys/kern/kern_sig.cMon Oct 29 03:52:18 2012
(r242283)
@@ -1599,8 +1599,10 @@ killpg1(struct thread *td, int sig, int 
 {
struct proc *p;
struct pgrp *pgrp;
-   int nfound = 0;
+   int err;
+   int ret;
 
+   ret = ESRCH;
if (all) {
/*
 * broadcast
@@ -1613,11 +1615,14 @@ killpg1(struct thread *td, int sig, int 
PROC_UNLOCK(p);
continue;
}
-   if (p_cansignal(td, p, sig) == 0) {
-   nfound++;
+   err = p_cansignal(td, p, sig);
+   if (err == 0) {
if (sig)
pksignal(p, sig, ksi);
+   ret = err;
}
+   else if (ret == ESRCH)
+   ret = err;
PROC_UNLOCK(p);
}
sx_sunlock(&allproc_lock);
@@ -1644,16 +1649,19 @@ killpg1(struct thread *td, int sig, int 
PROC_UNLOCK(p);
continue;
}
-   if (p_cansignal(td, p, sig) == 0) {
-   nfound++;
+   err = p_cansignal(td, p, sig);
+   if (err == 0) {
if (sig)
pksignal(p, sig, ksi);
+   ret = err;
}
+   else if (ret == ESRCH)
+   ret = err;
PROC_UNLOCK(p);
}
PGRP_UNLOCK(pgrp);
}
-   return (nfound ? 0 : ESRCH);
+   return (ret);
 }
 
 #ifndef _SYS_SYSPROTO_H_
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242282 - stable/8/sys/kern

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 03:52:18 2012
New Revision: 242282
URL: http://svn.freebsd.org/changeset/base/242282

Log:
  MFC r241855,r241859:
Update the kill(2) and killpg(2) man pages to the modern permission
checks. Also indicate killpg(2) is POSIX compliant.
  
Correct the killpg(2) return values:
  
Return EPERM if processes were found but they
were unable to be signaled.
  
Return the first error from p_cansignal if no signal was successful.
  
  Discussed with:   jilles
  Approved by:  cperciva (implicit)

Modified:
  stable/8/sys/kern/kern_sig.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/kern/   (props changed)

Modified: stable/8/sys/kern/kern_sig.c
==
--- stable/8/sys/kern/kern_sig.cMon Oct 29 03:48:25 2012
(r242281)
+++ stable/8/sys/kern/kern_sig.cMon Oct 29 03:52:18 2012
(r242282)
@@ -1623,8 +1623,10 @@ killpg1(struct thread *td, int sig, int 
 {
struct proc *p;
struct pgrp *pgrp;
-   int nfound = 0;
+   int err;
+   int ret;
 
+   ret = ESRCH;
if (all) {
/*
 * broadcast
@@ -1637,11 +1639,14 @@ killpg1(struct thread *td, int sig, int 
PROC_UNLOCK(p);
continue;
}
-   if (p_cansignal(td, p, sig) == 0) {
-   nfound++;
+   err = p_cansignal(td, p, sig);
+   if (err == 0) {
if (sig)
pksignal(p, sig, ksi);
+   ret = err;
}
+   else if (ret == ESRCH)
+   ret = err;
PROC_UNLOCK(p);
}
sx_sunlock(&allproc_lock);
@@ -1668,16 +1673,19 @@ killpg1(struct thread *td, int sig, int 
PROC_UNLOCK(p);
continue;
}
-   if (p_cansignal(td, p, sig) == 0) {
-   nfound++;
+   err = p_cansignal(td, p, sig);
+   if (err == 0) {
if (sig)
pksignal(p, sig, ksi);
+   ret = err;
}
+   else if (ret == ESRCH)
+   ret = err;
PROC_UNLOCK(p);
}
PGRP_UNLOCK(pgrp);
}
-   return (nfound ? 0 : ESRCH);
+   return (ret);
 }
 
 #ifndef _SYS_SYSPROTO_H_
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242281 - stable/9/sys/dev/usb/input

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 03:48:25 2012
New Revision: 242281
URL: http://svn.freebsd.org/changeset/base/242281

Log:
  MFC r241843:
Make uhid attach to devices that look like keyboards
or mice if the quirk which prevents higher level
drivers from attaching is set.
  
  PR:   usb/172458
  Approved by:  cperciva (implicit)

Modified:
  stable/9/sys/dev/usb/input/uhid.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/input/uhid.c
==
--- stable/9/sys/dev/usb/input/uhid.c   Mon Oct 29 03:48:24 2012
(r242280)
+++ stable/9/sys/dev/usb/input/uhid.c   Mon Oct 29 03:48:25 2012
(r242281)
@@ -691,10 +691,11 @@ uhid_probe(device_t dev)
 */
if ((uaa->info.bInterfaceClass == UICLASS_HID) &&
(uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) &&
-   ((uaa->info.bInterfaceProtocol == UIPROTO_BOOT_KEYBOARD) ||
-(uaa->info.bInterfaceProtocol == UIPROTO_MOUSE))) {
+   (((uaa->info.bInterfaceProtocol == UIPROTO_BOOT_KEYBOARD) &&
+ !usb_test_quirk(uaa, UQ_KBD_IGNORE)) ||
+((uaa->info.bInterfaceProtocol == UIPROTO_MOUSE) &&
+ !usb_test_quirk(uaa, UQ_UMS_IGNORE
return (ENXIO);
-   }
 
return (BUS_PROBE_GENERIC);
 }
___
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: r242280 - stable/8/sys/dev/usb/input

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 03:48:24 2012
New Revision: 242280
URL: http://svn.freebsd.org/changeset/base/242280

Log:
  MFC r241843:
Make uhid attach to devices that look like keyboards
or mice if the quirk which prevents higher level
drivers from attaching is set.
  
  PR:   usb/172458
  Approved by:  cperciva (implicit)

Modified:
  stable/8/sys/dev/usb/input/uhid.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/usb/   (props changed)

Modified: stable/8/sys/dev/usb/input/uhid.c
==
--- stable/8/sys/dev/usb/input/uhid.c   Mon Oct 29 03:45:38 2012
(r242279)
+++ stable/8/sys/dev/usb/input/uhid.c   Mon Oct 29 03:48:24 2012
(r242280)
@@ -691,10 +691,11 @@ uhid_probe(device_t dev)
 */
if ((uaa->info.bInterfaceClass == UICLASS_HID) &&
(uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) &&
-   ((uaa->info.bInterfaceProtocol == UIPROTO_BOOT_KEYBOARD) ||
-(uaa->info.bInterfaceProtocol == UIPROTO_MOUSE))) {
+   (((uaa->info.bInterfaceProtocol == UIPROTO_BOOT_KEYBOARD) &&
+ !usb_test_quirk(uaa, UQ_KBD_IGNORE)) ||
+((uaa->info.bInterfaceProtocol == UIPROTO_MOUSE) &&
+ !usb_test_quirk(uaa, UQ_UMS_IGNORE
return (ENXIO);
-   }
 
return (BUS_PROBE_GENERIC);
 }
___
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: r242279 - in stable/8/sys/dev/usb: . net

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 03:45:38 2012
New Revision: 242279
URL: http://svn.freebsd.org/changeset/base/242279

Log:
  MFC r241793:
Add support for iPhone 5 tethering.
  
  PR:   usb/172172
  Approved by:  cperciva (implicit)

Modified:
  stable/8/sys/dev/usb/net/if_ipheth.c
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/usb/   (props changed)

Modified: stable/8/sys/dev/usb/net/if_ipheth.c
==
--- stable/8/sys/dev/usb/net/if_ipheth.cMon Oct 29 03:45:37 2012
(r242278)
+++ stable/8/sys/dev/usb/net/if_ipheth.cMon Oct 29 03:45:38 2012
(r242279)
@@ -161,6 +161,9 @@ static const STRUCT_USB_HOST_ID ipheth_d
{IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_4,
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
IPHETH_USBINTF_PROTO)},
+   {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_5,
+   IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
+   IPHETH_USBINTF_PROTO)},
 };
 
 static int

Modified: stable/8/sys/dev/usb/usbdevs
==
--- stable/8/sys/dev/usb/usbdevsMon Oct 29 03:45:37 2012
(r242278)
+++ stable/8/sys/dev/usb/usbdevsMon Oct 29 03:45:38 2012
(r242279)
@@ -1034,6 +1034,7 @@ product APPLE IPOD_TOUCH  0x1291  iPod Tou
 product APPLE IPHONE_3G0x1292  iPhone 3G
 product APPLE IPHONE_3GS   0x1294  iPhone 3GS
 product APPLE IPHONE_4 0x1297  iPhone 4
+product APPLE IPHONE_5 0x12a8  iPhone 5
 product APPLE IPAD 0x129a  iPad
 product APPLE ETHERNET 0x1402  Ethernet A1277
 
___
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: r242278 - in stable/9/sys/dev/usb: . net

2012-10-28 Thread Eitan Adler
Author: eadler
Date: Mon Oct 29 03:45:37 2012
New Revision: 242278
URL: http://svn.freebsd.org/changeset/base/242278

Log:
  MFC r241793:
Add support for iPhone 5 tethering.
  
  PR:   usb/172172
  Approved by:  cperciva (implicit)

Modified:
  stable/9/sys/dev/usb/net/if_ipheth.c
  stable/9/sys/dev/usb/usbdevs
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/usb/net/if_ipheth.c
==
--- stable/9/sys/dev/usb/net/if_ipheth.cMon Oct 29 03:31:22 2012
(r242277)
+++ stable/9/sys/dev/usb/net/if_ipheth.cMon Oct 29 03:45:37 2012
(r242278)
@@ -161,6 +161,9 @@ static const STRUCT_USB_HOST_ID ipheth_d
{IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_4,
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
IPHETH_USBINTF_PROTO)},
+   {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_5,
+   IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
+   IPHETH_USBINTF_PROTO)},
 };
 
 static int

Modified: stable/9/sys/dev/usb/usbdevs
==
--- stable/9/sys/dev/usb/usbdevsMon Oct 29 03:31:22 2012
(r242277)
+++ stable/9/sys/dev/usb/usbdevsMon Oct 29 03:45:37 2012
(r242278)
@@ -1078,6 +1078,7 @@ product APPLE IPOD_TOUCH  0x1291  iPod Tou
 product APPLE IPHONE_3G0x1292  iPhone 3G
 product APPLE IPHONE_3GS   0x1294  iPhone 3GS
 product APPLE IPHONE_4 0x1297  iPhone 4
+product APPLE IPHONE_5 0x12a8  iPhone 5
 product APPLE IPAD 0x129a  iPad
 product APPLE ETHERNET 0x1402  Ethernet A1277
 
___
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: r242277 - head/usr.sbin/kldxref

2012-10-28 Thread Tim Kientzle
Author: kientzle
Date: Mon Oct 29 03:31:22 2012
New Revision: 242277
URL: http://svn.freebsd.org/changeset/base/242277

Log:
  Clarify a warning message.

Modified:
  head/usr.sbin/kldxref/ef.c

Modified: head/usr.sbin/kldxref/ef.c
==
--- head/usr.sbin/kldxref/ef.c  Mon Oct 29 02:10:20 2012(r242276)
+++ head/usr.sbin/kldxref/ef.c  Mon Oct 29 03:31:22 2012(r242277)
@@ -600,7 +600,8 @@ ef_open(const char *filename, struct elf
printf("\n");
ef->ef_nsegs = nsegs;
if (phdyn == NULL) {
-   warnx("file isn't dynamically-linked");
+   warnx("Skipping %s: not dynamically-linked",
+   filename);
break;
}
if (ef_read_entry(ef, phdyn->p_offset,
___
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: r242276 - head/sys/mips/cavium

2012-10-28 Thread Juli Mallett
Author: jmallett
Date: Mon Oct 29 02:10:20 2012
New Revision: 242276
URL: http://svn.freebsd.org/changeset/base/242276

Log:
  Wrap some long lines and display board serial numbers at boot.

Modified:
  head/sys/mips/cavium/octeon_machdep.c

Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Mon Oct 29 01:51:24 2012
(r242275)
+++ head/sys/mips/cavium/octeon_machdep.c   Mon Oct 29 02:10:20 2012
(r242276)
@@ -512,14 +512,19 @@ octeon_process_app_desc_ver_6(void)
octeon_bootinfo->board_rev_major,
octeon_bootinfo->board_rev_minor,
octeon_bootinfo->eclock_hz);
-   memcpy(cvmx_sysinfo_get()->mac_addr_base, 
octeon_bootinfo->mac_addr_base, 6);
+   memcpy(cvmx_sysinfo_get()->mac_addr_base,
+  octeon_bootinfo->mac_addr_base, 6);
cvmx_sysinfo_get()->mac_addr_count = octeon_bootinfo->mac_addr_count;
cvmx_sysinfo_get()->compact_flash_common_base_addr = 
octeon_bootinfo->compact_flash_common_base_addr;
cvmx_sysinfo_get()->compact_flash_attribute_base_addr = 
octeon_bootinfo->compact_flash_attribute_base_addr;
cvmx_sysinfo_get()->core_mask = octeon_bootinfo->core_mask;
-   cvmx_sysinfo_get()->led_display_base_addr = 
octeon_bootinfo->led_display_base_addr;
+   cvmx_sysinfo_get()->led_display_base_addr =
+   octeon_bootinfo->led_display_base_addr;
+   memcpy(cvmx_sysinfo_get()->board_serial_number,
+  octeon_bootinfo->board_serial_number,
+  sizeof cvmx_sysinfo_get()->board_serial_number);
 }
 
 static void
@@ -588,5 +593,6 @@ octeon_boot_params_init(register_t ptr)
 #endif
strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id()));
printf("Model: %s\n", cpu_model);
+   printf("Serial number: %s\n", cvmx_sysinfo_get()->board_serial_number);
 }
 /* impEND: This stuff should move back into the Cavium SDK */
___
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: r242274 - head/sys/sys

2012-10-28 Thread Attilio Rao
Author: attilio
Date: Mon Oct 29 01:35:17 2012
New Revision: 242274
URL: http://svn.freebsd.org/changeset/base/242274

Log:
  Compiler have a precise knowledge of the content of sched_pin() and
  sched_unpin() as they are functions static and inline.  This way it
  can do two dangerous things:
  - Reorder instructions around both of them, taking out from the safe
path operations that are supposed to be (ie. per-cpu accesses)
  - Cache the value of td_pinned in CPU registers not making visible
in kernel context to the scheduler once it is scanning the runqueue,
as td_pinned is not marked volatile.
  
  In order to avoid both possible bugs explicitly, protect the safe path
  with compiler memory barriers. This will prevent reordering and caching
  by the compiler about td_pinned operations.
  
  Generally this could lead to suboptimal code traversing the pinnings
  but this is not the case as can be easilly verified:
  http://lists.freebsd.org/pipermail/svn-src-projects/2012-October/005797.html
  
  Discussed with:   jeff, jhb
  MFC after:2 weeks

Modified:
  head/sys/sys/sched.h

Modified: head/sys/sys/sched.h
==
--- head/sys/sys/sched.hMon Oct 29 00:51:53 2012(r242273)
+++ head/sys/sys/sched.hMon Oct 29 01:35:17 2012(r242274)
@@ -151,11 +151,13 @@ static __inline void
 sched_pin(void)
 {
curthread->td_pinned++;
+   __compiler_membar();
 }
 
 static __inline void
 sched_unpin(void)
 {
+   __compiler_membar();
curthread->td_pinned--;
 }
 
___
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: r242273 - in head/sys: contrib/octeon-sdk mips/cavium

2012-10-28 Thread Juli Mallett
Author: jmallett
Date: Mon Oct 29 00:51:53 2012
New Revision: 242273
URL: http://svn.freebsd.org/changeset/base/242273

Log:
  Use Simple Executive LED display routines, which correctly use the LED base
  address passed from the bootloader, rather than using a hard-coded value.
  
  Make FreeBSD announce itself on the LED display similar to other kernels.
  
  Remove uses of the previous LED routines, which were under-used and only used
  in drivers for what seem like debugging purposes, despite those drivers being
  widely-tested.
  
  Remove several inlines for accessing memory that duplicate other functions
  which are now used instead, as they are now entirely unused.

Modified:
  head/sys/contrib/octeon-sdk/cvmx-ebt3000.c
  head/sys/mips/cavium/files.octeon1
  head/sys/mips/cavium/octeon_ebt3000_cf.c
  head/sys/mips/cavium/octeon_machdep.c
  head/sys/mips/cavium/octeon_pcmap_regs.h
  head/sys/mips/cavium/uart_dev_oct16550.c

Modified: head/sys/contrib/octeon-sdk/cvmx-ebt3000.c
==
--- head/sys/contrib/octeon-sdk/cvmx-ebt3000.c  Mon Oct 29 00:17:12 2012
(r242272)
+++ head/sys/contrib/octeon-sdk/cvmx-ebt3000.c  Mon Oct 29 00:51:53 2012
(r242273)
@@ -52,15 +52,18 @@
  *
  */
 
+#if !defined(__FreeBSD__) || !defined(_KERNEL)
 #include "cvmx-config.h"
+#endif
 #include "cvmx.h"
+#include "cvmx-ebt3000.h"
 #include "cvmx-sysinfo.h"
 
 
 void ebt3000_char_write(int char_position, char val)
 {
 /* Note: phys_to_ptr won't work here, as we are most likely going to 
access the boot bus. */
-void *led_base = CASTPTR(void, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, 
cvmx_sysinfo_get()->led_display_base_addr));
+char *led_base = CASTPTR(char , CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, 
cvmx_sysinfo_get()->led_display_base_addr));
 if (!led_base)
 return;
 if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && 
cvmx_sysinfo_get()->board_rev_major == 1)
@@ -82,10 +85,10 @@ void ebt3000_char_write(int char_positio
 void ebt3000_str_write(const char *str)
 {
 /* Note: phys_to_ptr won't work here, as we are most likely going to 
access the boot bus. */
-void *led_base;
+char *led_base;
 if (!cvmx_sysinfo_get()->led_display_base_addr)
 return;
-led_base = CASTPTR(void, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, 
cvmx_sysinfo_get()->led_display_base_addr));
+led_base = CASTPTR(char, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, 
cvmx_sysinfo_get()->led_display_base_addr));
 if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && 
cvmx_sysinfo_get()->board_rev_major == 1)
 {
 char *ptr = (char *)(led_base + 4);

Modified: head/sys/mips/cavium/files.octeon1
==
--- head/sys/mips/cavium/files.octeon1  Mon Oct 29 00:17:12 2012
(r242272)
+++ head/sys/mips/cavium/files.octeon1  Mon Oct 29 00:51:53 2012
(r242273)
@@ -58,6 +58,7 @@ mips/cavium/octeon_gpio.c optional gpi
 contrib/octeon-sdk/cvmx-cmd-queue.cstandard
 contrib/octeon-sdk/cvmx-bootmem.c  standard
 contrib/octeon-sdk/cvmx-clock.cstandard
+contrib/octeon-sdk/cvmx-ebt3000.c  standard
 contrib/octeon-sdk/cvmx-fpa.c  standard
 contrib/octeon-sdk/cvmx-helper.c   standard
 contrib/octeon-sdk/cvmx-helper-board.c standard

Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c
==
--- head/sys/mips/cavium/octeon_ebt3000_cf.cMon Oct 29 00:17:12 2012
(r242272)
+++ head/sys/mips/cavium/octeon_ebt3000_cf.cMon Oct 29 00:51:53 2012
(r242273)
@@ -326,15 +326,10 @@ static int cf_cmd_read (uint32_t nr_sect
uint8_t  *ptr_8;
int error;
 
-//#define OCTEON_VISUAL_CF_0 1
-#ifdef OCTEON_VISUAL_CF_0
-octeon_led_write_char(0, 'R');
-#endif
ptr_8  = (uint8_t*)buf;
ptr_16 = (uint16_t*)buf;
lba = start_sector; 
 
-
while (nr_sectors--) {
error = cf_send_cmd(lba, CMD_READ_SECTOR);
if (error != 0) {
@@ -366,9 +361,6 @@ static int cf_cmd_read (uint32_t nr_sect
 
lba++;
}
-#ifdef OCTEON_VISUAL_CF_0
-octeon_led_write_char(0, ' ');
-#endif
return (0);
 }
 
@@ -387,10 +379,6 @@ static int cf_cmd_write (uint32_t nr_sec
uint8_t  *ptr_8;
int error;

-//#define OCTEON_VISUAL_CF_1 1
-#ifdef OCTEON_VISUAL_CF_1
-octeon_led_write_char(1, 'W');
-#endif
lba = start_sector;
ptr_8  = (uint8_t*)buf;
ptr_16 = (uint16_t*)buf;
@@ -425,9 +413,6 @@ static int cf_cmd_write (uint32_t nr_sec
 
lba++;
}
-#ifdef OCTEON_VISUAL_CF_1
-octeon_led_write_char(1, ' ');
-#endif
return (0);
 }
 
@@ -543,13 +528,6 @@ static int cf_wait_busy (void)
 {

svn commit: r242272 - head/sys/dev/mii

2012-10-28 Thread Juli Mallett
Author: jmallett
Date: Mon Oct 29 00:17:12 2012
New Revision: 242272
URL: http://svn.freebsd.org/changeset/base/242272

Log:
  Recognize the Marvell 88E1145 Quad Gigabit PHY.

Modified:
  head/sys/dev/mii/e1000phy.c

Modified: head/sys/dev/mii/e1000phy.c
==
--- head/sys/dev/mii/e1000phy.c Sun Oct 28 21:13:12 2012(r242271)
+++ head/sys/dev/mii/e1000phy.c Mon Oct 29 00:17:12 2012(r242272)
@@ -108,6 +108,7 @@ static const struct mii_phydesc e1000phy
MII_PHY_DESC(xxMARVELL, E1116R),
MII_PHY_DESC(xxMARVELL, E1116R_29),
MII_PHY_DESC(xxMARVELL, E1118),
+   MII_PHY_DESC(xxMARVELL, E1145),
MII_PHY_DESC(xxMARVELL, E1149R),
MII_PHY_DESC(xxMARVELL, E3016),
MII_PHY_DESC(xxMARVELL, PHYG65G),
___
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: r242266 - head/sys/netinet

2012-10-28 Thread Rui Paulo
On 28 Oct 2012, at 15:25, Andre Oppermann  wrote:

> That's always the case.  Reality is that the majority of links these
> days is very fast compared to twenty years ago.  We can afford to be
> a bit more aggressive here.  Otherwise taking your point to the extreme
> would mean that IW can only ever be 1 MSS.

Not really. My point was that raising the initial window to overcome 
deficiencies somewhere else is the wrong approach.

Regards,
--
Rui Paulo

___
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: r242266 - head/sys/netinet

2012-10-28 Thread Andre Oppermann

On 28.10.2012 22:44, Rui Paulo wrote:

On 28 Oct 2012, at 14:33, Andre Oppermann  wrote:

IW10 has been heavily discussed on IETF TCPM.  A lot of research on
the impact has been done and the overall result has been a significant
improvement with very little downside.  Linux has adopted it for quite
some time already as default setting.


I have followed the discussions at tcpm, but I did not find any conclusive 
evidence of the benefit of IW10. I'm sure it can help in multiple situations 
but, as always, there are tradeoffs. Section 6 of draft-ietf-tcpm-initcwnd 
never convinced me.


Then please raise your points on TCPM.


The bufferbloat issue is certainly real and should not be neglected.
However the solution to bufferbloat is not to send less packets into
the network.  In fact that doesn't even make a difference simply because
other packets with take their place.


Right, my point is that sending more packets in an already congested link will 
negatively affect the throughput / latency of the network. I'm not saying that 
it won't help you download a YouTube video faster, but the overall fairness of 
TCP will be reduced.


That's always the case.  Reality is that the majority of links these
days is very fast compared to twenty years ago.  We can afford to be
a bit more aggressive here.  Otherwise taking your point to the extreme
would mean that IW can only ever be 1 MSS.

Then there is the unfairness of low RTT to high RTT transfers.  But that's
inherent in any end to end feedback system.


  Buffer bloat can only be fixed
in the devices that actually do the buffering.  A much discussed and
apparently good approach seems to be the Codel algorithm for active
buffer management.


Are you working on CoDel? :-)


I'm looking into how the whole interface stuff including ALTQ can be
improved in an SMP world.

--
Andre

___
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: r242261 - head/sys/netinet

2012-10-28 Thread Andre Oppermann

On 28.10.2012 23:01, Rui Paulo wrote:

On Oct 28, 2012, at 14:56, Andre Oppermann  wrote:


On 28.10.2012 22:34, Rui Paulo wrote:

On 28 Oct 2012, at 12:02, Andre Oppermann  wrote:


Author: andre
Date: Sun Oct 28 19:02:07 2012
New Revision: 242261
URL: http://svn.freebsd.org/changeset/base/242261

Log:
  For retransmits of SYN|ACK from the syncache use the slightly more
  aggressive special tcp_syn_backoff[] retransmit schedule instead of
  the normal tcp_backoff[] schedule for established connections.



How did you came up with the values for tcp_syn_backoff? I obviously
understand the aggressiveness, but did you measure any significant
improvement in connection establishment time and if so, on what type of links?


I didn't come up with the values.  tcp_syn_backoff[] was introduced
almost 12 years ago by jlemon.  For syncache it got lost somewhere
along the line.


Oh, I see. I read it backwards.



There has been recent talk by some large FreeBSD web server operators
of reducing SYN|ACK retransmit timeouts.  This change fixes a part of
the problem.  The recent RFC on reducing the RTO will fix the other
part.


Which RFC? I'm only aware of draft-hurtig-tcpm-rtorestart.


RFC6298.

--
Andre

___
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: r242261 - head/sys/netinet

2012-10-28 Thread Rui Paulo
On Oct 28, 2012, at 14:56, Andre Oppermann  wrote:

> On 28.10.2012 22:34, Rui Paulo wrote:
>> On 28 Oct 2012, at 12:02, Andre Oppermann  wrote:
>> 
>>> Author: andre
>>> Date: Sun Oct 28 19:02:07 2012
>>> New Revision: 242261
>>> URL: http://svn.freebsd.org/changeset/base/242261
>>> 
>>> Log:
>>>  For retransmits of SYN|ACK from the syncache use the slightly more
>>>  aggressive special tcp_syn_backoff[] retransmit schedule instead of
>>>  the normal tcp_backoff[] schedule for established connections.
>> 
>> 
>> How did you came up with the values for tcp_syn_backoff? I obviously
> > understand the aggressiveness, but did you measure any significant
> > improvement in connection establishment time and if so, on what type of 
> > links?
> 
> I didn't come up with the values.  tcp_syn_backoff[] was introduced
> almost 12 years ago by jlemon.  For syncache it got lost somewhere
> along the line.

Oh, I see. I read it backwards. 

> 
> There has been recent talk by some large FreeBSD web server operators
> of reducing SYN|ACK retransmit timeouts.  This change fixes a part of
> the problem.  The recent RFC on reducing the RTO will fix the other
> part.

Which RFC? I'm only aware of draft-hurtig-tcpm-rtorestart. 
___
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: r242261 - head/sys/netinet

2012-10-28 Thread Andre Oppermann

On 28.10.2012 22:34, Rui Paulo wrote:

On 28 Oct 2012, at 12:02, Andre Oppermann  wrote:


Author: andre
Date: Sun Oct 28 19:02:07 2012
New Revision: 242261
URL: http://svn.freebsd.org/changeset/base/242261

Log:
  For retransmits of SYN|ACK from the syncache use the slightly more
  aggressive special tcp_syn_backoff[] retransmit schedule instead of
  the normal tcp_backoff[] schedule for established connections.



How did you came up with the values for tcp_syn_backoff? I obviously

> understand the aggressiveness, but did you measure any significant
> improvement in connection establishment time and if so, on what type of links?

I didn't come up with the values.  tcp_syn_backoff[] was introduced
almost 12 years ago by jlemon.  For syncache it got lost somewhere
along the line.

There has been recent talk by some large FreeBSD web server operators
of reducing SYN|ACK retransmit timeouts.  This change fixes a part of
the problem.  The recent RFC on reducing the RTO will fix the other
part.

--
Andre

___
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: r242263 - head/sys/netinet

2012-10-28 Thread Andre Oppermann

On 28.10.2012 22:26, Rui Paulo wrote:

On 28 Oct 2012, at 12:20, Andre Oppermann  wrote:


Author: andre
Date: Sun Oct 28 19:20:23 2012
New Revision: 242263
URL: http://svn.freebsd.org/changeset/base/242263

Log:
  Add SACK_PERMIT to the list of TCP options that are switched off after
  retransmitting a SYN three times.

  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_timer.c

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cSun Oct 28 19:16:22 2012
(r242262)
+++ head/sys/netinet/tcp_timer.cSun Oct 28 19:20:23 2012
(r242263)
@@ -585,7 +585,7 @@ tcp_timer_rexmt(void * xtp)
 * unknown-to-them TCP options.
 */
if ((tp->t_state == TCPS_SYN_SENT) && (tp->t_rxtshift == 3))
-   tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP);
+   tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP|TF_SACK_PERMIT);
/*
 * If we backed off this far, our srtt estimate is probably bogus.
 * Clobber it so we'll take the next rtt measurement as our srtt;


Do you have any data regarding this commit or you're just trying to make sure

> the SACK option follows the same behaviour of the WSCALE/TSTMP options?

The latter.  For the purpose of turning off the options after three tries
it is contradictory to leave SACK on.

There is discussion of scrapping this whole option disabling altogether.
Until then better have the 'correct' behavior.

--
Andre

___
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: r242266 - head/sys/netinet

2012-10-28 Thread Rui Paulo
On 28 Oct 2012, at 14:33, Andre Oppermann  wrote:
> IW10 has been heavily discussed on IETF TCPM.  A lot of research on
> the impact has been done and the overall result has been a significant
> improvement with very little downside.  Linux has adopted it for quite
> some time already as default setting.

I have followed the discussions at tcpm, but I did not find any conclusive 
evidence of the benefit of IW10. I'm sure it can help in multiple situations 
but, as always, there are tradeoffs. Section 6 of draft-ietf-tcpm-initcwnd 
never convinced me.

> The bufferbloat issue is certainly real and should not be neglected.
> However the solution to bufferbloat is not to send less packets into
> the network.  In fact that doesn't even make a difference simply because
> other packets with take their place.

Right, my point is that sending more packets in an already congested link will 
negatively affect the throughput / latency of the network. I'm not saying that 
it won't help you download a YouTube video faster, but the overall fairness of 
TCP will be reduced.

>  Buffer bloat can only be fixed
> in the devices that actually do the buffering.  A much discussed and
> apparently good approach seems to be the Codel algorithm for active
> buffer management.


Are you working on CoDel? :-)

Regards,
--
Rui Paulo

___
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: r242261 - head/sys/netinet

2012-10-28 Thread Rui Paulo
On 28 Oct 2012, at 12:02, Andre Oppermann  wrote:

> Author: andre
> Date: Sun Oct 28 19:02:07 2012
> New Revision: 242261
> URL: http://svn.freebsd.org/changeset/base/242261
> 
> Log:
>  For retransmits of SYN|ACK from the syncache use the slightly more
>  aggressive special tcp_syn_backoff[] retransmit schedule instead of
>  the normal tcp_backoff[] schedule for established connections.


How did you came up with the values for tcp_syn_backoff? I obviously understand 
the aggressiveness, but did you measure any significant improvement in 
connection establishment time and if so, on what type of links?

Regards,
--
Rui Paulo

___
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: r242266 - head/sys/netinet

2012-10-28 Thread Andre Oppermann

On 28.10.2012 22:03, Rui Paulo wrote:

On 28 Oct 2012, at 12:47, Andre Oppermann  wrote:


Author: andre
Date: Sun Oct 28 19:47:46 2012
New Revision: 242266
URL: http://svn.freebsd.org/changeset/base/242266

Log:
  Increase the initial CWND to 10 segments as defined in IETF TCPM
  draft-ietf-tcpm-initcwnd-05. It explains why the increased initial
  window improves the overall performance of many web services without
  risking congestion collapse.

  As long as it remains a draft it is placed under a sysctl marking it
  as experimental:
   net.inet.tcp.experimental.initcwnd10 = 1
  When it becomes an official RFC soon the sysctl will be changed to
  the RFC number and moved to net.inet.tcp.

  This implementation differs from the RFC draft in that it is a bit
  more conservative in the case of packet loss on SYN or SYN|ACK because
  we haven't reduced the default RTO to 1 second yet.  Also the restart
  window isn't yet increased as allowed.  Both will be adjusted with
  upcoming changes.

  Is is enabled by default.  In Linux it is enabled since kernel 3.0.



Didn't you also forget to point out the problems associated with it?

http://tools.ietf.org/html/draft-gettys-iw10-considered-harmful-00


IW10 has been heavily discussed on IETF TCPM.  A lot of research on
the impact has been done and the overall result has been a significant
improvement with very little downside.  Linux has adopted it for quite
some time already as default setting.

The bufferbloat issue is certainly real and should not be neglected.
However the solution to bufferbloat is not to send less packets into
the network.  In fact that doesn't even make a difference simply because
other packets with take their place.  Buffer bloat can only be fixed
in the devices that actually do the buffering.  A much discussed and
apparently good approach seems to be the Codel algorithm for active
buffer management.

--
Andre

___
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: r242263 - head/sys/netinet

2012-10-28 Thread Rui Paulo
On 28 Oct 2012, at 12:20, Andre Oppermann  wrote:

> Author: andre
> Date: Sun Oct 28 19:20:23 2012
> New Revision: 242263
> URL: http://svn.freebsd.org/changeset/base/242263
> 
> Log:
>  Add SACK_PERMIT to the list of TCP options that are switched off after
>  retransmitting a SYN three times.
> 
>  MFC after:   2 weeks
> 
> Modified:
>  head/sys/netinet/tcp_timer.c
> 
> Modified: head/sys/netinet/tcp_timer.c
> ==
> --- head/sys/netinet/tcp_timer.c  Sun Oct 28 19:16:22 2012
> (r242262)
> +++ head/sys/netinet/tcp_timer.c  Sun Oct 28 19:20:23 2012
> (r242263)
> @@ -585,7 +585,7 @@ tcp_timer_rexmt(void * xtp)
>* unknown-to-them TCP options.
>*/
>   if ((tp->t_state == TCPS_SYN_SENT) && (tp->t_rxtshift == 3))
> - tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP);
> + tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP|TF_SACK_PERMIT);
>   /*
>* If we backed off this far, our srtt estimate is probably bogus.
>* Clobber it so we'll take the next rtt measurement as our srtt;

Do you have any data regarding this commit or you're just trying to make sure 
the SACK option follows the same behaviour of the WSCALE/TSTMP options?

Regards,
--
Rui Paulo

___
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: r242271 - head/sys/dev/ath

2012-10-28 Thread Adrian Chadd
Author: adrian
Date: Sun Oct 28 21:13:12 2012
New Revision: 242271
URL: http://svn.freebsd.org/changeset/base/242271

Log:
  Begin fleshing out some software queue awareness for TIM handling with
  the power save queue.
  
  * introduce some new ATH_NODE lock protected fields, tracking the
net80211 psq and TIM state;
  * when doing buffer transitions - ie, when sending and completing
buffers - check the state of the SWQ and update the TIM appropriately.
  * when clearing the TIM bit, if the SWQ is not empty then delay clearing
it.
  
  This is racy, but it's no less racy than the current net80211 power
  save queue management code.  Specifically, with multiple TX threads,
  it's quite plausible that parallel state updates will race and the
  TIM will be left in an inconsistent state.  I'll address that in
  a follow-up commit.

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_misc.h
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_ath_tx.h
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Sun Oct 28 21:01:32 2012(r242270)
+++ head/sys/dev/ath/if_ath.c   Sun Oct 28 21:13:12 2012(r242271)
@@ -201,6 +201,7 @@ static void ath_announce(struct ath_soft
 
 static voidath_dfs_tasklet(void *, int);
 static voidath_node_powersave(struct ieee80211_node *, int);
+static int ath_node_set_tim(struct ieee80211_node *, int);
 
 #ifdef IEEE80211_SUPPORT_TDMA
 #include 
@@ -1152,6 +1153,9 @@ ath_vap_create(struct ieee80211com *ic, 
avp->av_node_ps = vap->iv_node_ps;
vap->iv_node_ps = ath_node_powersave;
 
+   avp->av_set_tim = vap->iv_set_tim;
+   vap->iv_set_tim = ath_node_set_tim;
+
/* Set default parameters */
 
/*
@@ -2558,6 +2562,12 @@ ath_start(struct ifnet *ifp)
ieee80211_free_node(ni);
continue;
}
+
+   /*
+* Check here if the node is in power save state.
+*/
+   ath_tx_update_tim(sc, ni, 1);
+
if (next != NULL) {
/*
 * Beware of state changing between frags.
@@ -3536,6 +3546,24 @@ ath_tx_default_comp(struct ath_softc *sc
SEQNO(bf->bf_state.bfs_seqno));
 
/*
+* Check if the node software queue is empty; if so
+* then clear the TIM.
+*
+* This needs to be done before the buffer is freed as
+* otherwise the node reference will have been released
+* and the node may not actually exist any longer.
+*
+* XXX I don't like this belonging here, but it's cleaner
+* to do it here right now then all the other places
+* where ath_tx_default_comp() is called.
+*
+* XXX TODO: during drain, ensure that the callback is
+* being called so we get a chance to update the TIM.
+*/
+   if (bf->bf_node)
+   ath_tx_update_tim(sc, bf->bf_node, 0);
+
+   /*
 * Do any tx complete callback.  Note this must
 * be done before releasing the node reference.
 * This will free the mbuf, release the net80211
@@ -3559,6 +3587,7 @@ ath_tx_update_ratectrl(struct ath_softc 
return;
 
an = ATH_NODE(ni);
+   ATH_NODE_UNLOCK_ASSERT(an);
 
if ((ts->ts_status & HAL_TXERR_FILT) == 0) {
ATH_NODE_LOCK(an);
@@ -3754,6 +3783,8 @@ ath_tx_processq(struct ath_softc *sc, st
 * Update statistics and call completion
 */
ath_tx_process_buf_completion(sc, txq, ts, bf);
+
+   /* XXX at this point, bf and ni may be totally invalid */
}
 #ifdef IEEE80211_SUPPORT_SUPERG
/*
@@ -5397,6 +5428,219 @@ ath_node_powersave(struct ieee80211_node
avp->av_node_ps(ni, enable);
 }
 
+/*
+ * Notification from net80211 that the powersave queue state has
+ * changed.
+ *
+ * Since the software queue also may have some frames:
+ *
+ * + if the node software queue has frames and the TID state
+ *   is 0, we set the TIM;
+ * + if the node and the stack are both empty, we clear the TIM bit.
+ * + If the stack tries to set the bit, always set it.
+ * + If the stack tries to clear the bit, only clear it if the
+ *   software queue in question is also cleared.
+ *
+ * TODO: this is called during node teardown; so let's ensure this
+ * is all correctly handled and that the TIM bit is cleared.
+ * It may be that the node flush is called _AFTER_ the net80211
+ * stack clears the TIM.
+ *
+ * Here is the racy part.  Since it's possible >1 concurrent,
+ * overlapping TXes will appear complete with a TX completion in
+ * another thread, it's possible that the concurrent TIM calls will
+ * clash.  We can't hold the node lock here because setting the
+ * TIM grabs the net80211 com

Re: svn commit: r242161 - in head/sys: net netinet netpfil/pf

2012-10-28 Thread Andre Oppermann

On 28.10.2012 00:01, Gleb Smirnoff wrote:

On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote:
A> On 26.10.2012 23:06, Gleb Smirnoff wrote:
A> > Author: glebius
A> > Date: Fri Oct 26 21:06:33 2012
A> > New Revision: 242161
A> > URL: http://svn.freebsd.org/changeset/base/242161
A> >
A> > Log:
A> >o Remove last argument to ip_fragment(), and obtain all needed 
information
A> >  on checksums directly from mbuf flags. This simplifies code.
A> >o Clear CSUM_IP from the mbuf in ip_fragment() if we did checksums in
A> >  hardware. Some driver may not announce CSUM_IP in theur if_hwassist,
A> >  although try to do checksums if CSUM_IP set on mbuf. Example is em(4).
A>
A> I'm not getting your description here?  Why work around a bug in a driver
A> in ip_fragment() when we can fix the bug in the driver?

Well, that was actually bug in the stack and a very special driver that
demonstrates it. I may even agree that driver is incorrect, but the stack was
incorrect, too.


Ah, OK.  Do you intend to fix the driver as well?

--
Andre

___
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: r242254 - head/sys/netinet

2012-10-28 Thread Andre Oppermann

On 28.10.2012 21:07, Gleb Smirnoff wrote:

On Sun, Oct 28, 2012 at 06:07:34PM +, Andre Oppermann wrote:
A> @@ -296,8 +297,8 @@ syncache_destroy(void)
A>   mtx_destroy(&sch->sch_mtx);
A>   }
A>
A> - KASSERT(V_tcp_syncache.cache_count == 0, ("%s: cache_count %d not 0",
A> - __func__, V_tcp_syncache.cache_count));
A> + KASSERT(uma_zone_get_cur(V_tcp_syncache.zone) == 0,
A> + ("%s: cache_count not 0", __func__));
A>
A>   /* Free the allocated global resources. */
A>   uma_zdestroy(V_tcp_syncache.zone);

btw, keg_dtor() which is called in uma_zdestroy() printfs a warning
(even on non-invariant kernel) if keg had items in it. So leak won't
be unnoticed.


Thanks, didn't know that.  I leave the KASSERT() in if you don't
mind to make it a bit more forceful than a printf that gets overlooked
too easily.

--
Andre

___
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: r242266 - head/sys/netinet

2012-10-28 Thread Rui Paulo
On 28 Oct 2012, at 12:47, Andre Oppermann  wrote:

> Author: andre
> Date: Sun Oct 28 19:47:46 2012
> New Revision: 242266
> URL: http://svn.freebsd.org/changeset/base/242266
> 
> Log:
>  Increase the initial CWND to 10 segments as defined in IETF TCPM
>  draft-ietf-tcpm-initcwnd-05. It explains why the increased initial
>  window improves the overall performance of many web services without
>  risking congestion collapse.
> 
>  As long as it remains a draft it is placed under a sysctl marking it
>  as experimental:
>   net.inet.tcp.experimental.initcwnd10 = 1
>  When it becomes an official RFC soon the sysctl will be changed to
>  the RFC number and moved to net.inet.tcp.
> 
>  This implementation differs from the RFC draft in that it is a bit
>  more conservative in the case of packet loss on SYN or SYN|ACK because
>  we haven't reduced the default RTO to 1 second yet.  Also the restart
>  window isn't yet increased as allowed.  Both will be adjusted with
>  upcoming changes.
> 
>  Is is enabled by default.  In Linux it is enabled since kernel 3.0.


Didn't you also forget to point out the problems associated with it?

http://tools.ietf.org/html/draft-gettys-iw10-considered-harmful-00

Regards,
--
Rui Paulo

___
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: r242270 - head/share/man/man9

2012-10-28 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Oct 28 21:01:32 2012
New Revision: 242270
URL: http://svn.freebsd.org/changeset/base/242270

Log:
  Make it clear that NULL can only be returned when M_NOWAIT was used.

Modified:
  head/share/man/man9/zone.9

Modified: head/share/man/man9/zone.9
==
--- head/share/man/man9/zone.9  Sun Oct 28 20:14:21 2012(r242269)
+++ head/share/man/man9/zone.9  Sun Oct 28 21:01:32 2012(r242270)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 25, 2012
+.Dd October 28, 2012
 .Dt ZONE 9
 .Os
 .Sh NAME
@@ -145,7 +145,7 @@ or
 .Dv NULL
 in the rare case where all items in the zone are in use and the
 allocator is unable to grow the zone
-or when
+and
 .Dv M_NOWAIT
 is specified.
 .Pp
@@ -218,8 +218,10 @@ The
 .Fn uma_zalloc
 function returns a pointer to an item, or
 .Dv NULL
-if the zone ran out of unused items and the allocator was unable to
-enlarge it.
+if the zone ran out of unused items
+and
+.Dv M_NOWAIT
+was specified.
 .Sh SEE ALSO
 .Xr malloc 9
 .Sh HISTORY
___
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: r242254 - head/sys/netinet

2012-10-28 Thread Gleb Smirnoff
On Sun, Oct 28, 2012 at 06:07:34PM +, Andre Oppermann wrote:
A> @@ -296,8 +297,8 @@ syncache_destroy(void)
A>  mtx_destroy(&sch->sch_mtx);
A>  }
A>  
A> -KASSERT(V_tcp_syncache.cache_count == 0, ("%s: cache_count %d not 0",
A> -__func__, V_tcp_syncache.cache_count));
A> +KASSERT(uma_zone_get_cur(V_tcp_syncache.zone) == 0,
A> +("%s: cache_count not 0", __func__));
A>  
A>  /* Free the allocated global resources. */
A>  uma_zdestroy(V_tcp_syncache.zone);

btw, keg_dtor() which is called in uma_zdestroy() printfs a warning
(even on non-invariant kernel) if keg had items in it. So leak won't
be unnoticed.


-- 
Totus tuus, Glebius.
___
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: r242268 - head/sys/vm

2012-10-28 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Oct 28 20:03:57 2012
New Revision: 242268
URL: http://svn.freebsd.org/changeset/base/242268

Log:
  Remove useless check; vm_pindex_t is unsigned on all architectures.
  
  CID:  3701
  Found with:   Coverity Prevent

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cSun Oct 28 19:58:20 2012(r242267)
+++ head/sys/vm/vm_pageout.cSun Oct 28 20:03:57 2012(r242268)
@@ -1895,7 +1895,7 @@ again:
continue;
 
size = vmspace_resident_count(vm);
-   if (limit >= 0 && size >= limit) {
+   if (size >= limit) {
vm_pageout_map_deactivate_pages(
&vm->vm_map, limit);
}
___
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: r242267 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 19:58:20 2012
New Revision: 242267
URL: http://svn.freebsd.org/changeset/base/242267

Log:
  If the user has closed the socket then drop a persisting connection
  after a much reduced timeout.
  
  Typically web servers close their sockets quickly under the assumption
  that the TCP connections goes away as well.  That is not entirely true
  however.  If the peer closed the window we're going to wait for a long
  time with lots of data in the send buffer.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_timer.c

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cSun Oct 28 19:47:46 2012
(r242266)
+++ head/sys/netinet/tcp_timer.cSun Oct 28 19:58:20 2012
(r242267)
@@ -447,6 +447,16 @@ tcp_timer_persist(void *xtp)
tp = tcp_drop(tp, ETIMEDOUT);
goto out;
}
+   /*
+* If the user has closed the socket then drop a persisting
+* connection after a much reduced timeout.
+*/
+   if (tp->t_state > TCPS_CLOSE_WAIT &&
+   (ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) {
+   TCPSTAT_INC(tcps_persistdrop);
+   tp = tcp_drop(tp, ETIMEDOUT);
+   goto out;
+   }
tcp_setpersist(tp);
tp->t_flags |= TF_FORCEDATA;
(void) tcp_output(tp);
___
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: r242266 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 19:47:46 2012
New Revision: 242266
URL: http://svn.freebsd.org/changeset/base/242266

Log:
  Increase the initial CWND to 10 segments as defined in IETF TCPM
  draft-ietf-tcpm-initcwnd-05. It explains why the increased initial
  window improves the overall performance of many web services without
  risking congestion collapse.
  
  As long as it remains a draft it is placed under a sysctl marking it
  as experimental:
   net.inet.tcp.experimental.initcwnd10 = 1
  When it becomes an official RFC soon the sysctl will be changed to
  the RFC number and moved to net.inet.tcp.
  
  This implementation differs from the RFC draft in that it is a bit
  more conservative in the case of packet loss on SYN or SYN|ACK because
  we haven't reduced the default RTO to 1 second yet.  Also the restart
  window isn't yet increased as allowed.  Both will be adjusted with
  upcoming changes.
  
  Is is enabled by default.  In Linux it is enabled since kernel 3.0.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cSun Oct 28 19:38:42 2012
(r242265)
+++ head/sys/netinet/tcp_input.cSun Oct 28 19:47:46 2012
(r242266)
@@ -159,6 +159,14 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO,
 &VNET_NAME(tcp_do_rfc3390), 0,
 "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)");
 
+SYSCTL_NODE(_net_inet_tcp, OID_AUTO, experimental, CTLFLAG_RW, 0,
+"Experimental TCP extensions");
+
+VNET_DEFINE(int, tcp_do_initcwnd10) = 1;
+SYSCTL_VNET_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_RW,
+&VNET_NAME(tcp_do_initcwnd10), 0,
+"Enable draft-ietf-tcpm-initcwnd-05 (Increasing initial CWND to 10)");
+
 VNET_DEFINE(int, tcp_do_rfc3465) = 1;
 SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW,
 &VNET_NAME(tcp_do_rfc3465), 0,
@@ -347,6 +355,7 @@ cc_conn_init(struct tcpcb *tp)
 *
 * RFC5681 Section 3.1 specifies the default conservative values.
 * RFC3390 specifies slightly more aggressive values.
+* Draft-ietf-tcpm-initcwnd-05 increases it to ten segments.
 *
 * If a SYN or SYN/ACK was lost and retransmitted, we have to
 * reduce the initial CWND to one segment as congestion is likely
@@ -354,6 +363,9 @@ cc_conn_init(struct tcpcb *tp)
 */
if (tp->snd_cwnd == 1)
tp->snd_cwnd = tp->t_maxseg;/* SYN(-ACK) lost */
+   else if (V_tcp_do_initcwnd10)
+   tp->snd_cwnd = min(10 * tp->t_maxseg,
+   max(2 * tp->t_maxseg, 14600));
else if (V_tcp_do_rfc3390)
tp->snd_cwnd = min(4 * tp->t_maxseg,
max(2 * tp->t_maxseg, 4380));

Modified: head/sys/netinet/tcp_var.h
==
--- head/sys/netinet/tcp_var.h  Sun Oct 28 19:38:42 2012(r242265)
+++ head/sys/netinet/tcp_var.h  Sun Oct 28 19:47:46 2012(r242266)
@@ -611,6 +611,7 @@ VNET_DECLARE(int, tcp_mssdflt); /* XXX *
 VNET_DECLARE(int, tcp_minmss);
 VNET_DECLARE(int, tcp_delack_enabled);
 VNET_DECLARE(int, tcp_do_rfc3390);
+VNET_DECLARE(int, tcp_do_initcwnd10);
 VNET_DECLARE(int, tcp_sendspace);
 VNET_DECLARE(int, tcp_recvspace);
 VNET_DECLARE(int, path_mtu_discovery);
@@ -623,6 +624,7 @@ VNET_DECLARE(int, tcp_abc_l_var);
 #defineV_tcp_minmssVNET(tcp_minmss)
 #defineV_tcp_delack_enabledVNET(tcp_delack_enabled)
 #defineV_tcp_do_rfc3390VNET(tcp_do_rfc3390)
+#defineV_tcp_do_initcwnd10 VNET(tcp_do_initcwnd10)
 #defineV_tcp_sendspace VNET(tcp_sendspace)
 #defineV_tcp_recvspace VNET(tcp_recvspace)
 #defineV_path_mtu_discoveryVNET(path_mtu_discovery)
___
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: r242265 - head/sbin/tunefs

2012-10-28 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Oct 28 19:38:42 2012
New Revision: 242265
URL: http://svn.freebsd.org/changeset/base/242265

Log:
  Declare functions as static and move global variables to the top;
  no functional changes.

Modified:
  head/sbin/tunefs/tunefs.c

Modified: head/sbin/tunefs/tunefs.c
==
--- head/sbin/tunefs/tunefs.c   Sun Oct 28 19:22:18 2012(r242264)
+++ head/sbin/tunefs/tunefs.c   Sun Oct 28 19:38:42 2012(r242265)
@@ -70,14 +70,16 @@ __FBSDID("$FreeBSD$");
 /* the optimization warning string template */
 #defineOPTWARN "should optimize for %s with minfree %s %d%%"
 
+static int blocks;
+static char clrbuf[MAXBSIZE];
 static struct uufsd disk;
 #definesblock disk.d_fs
 
-void usage(void);
-void printfs(void);
-int journal_alloc(int64_t size);
-void journal_clear(void);
-void sbdirty(void);
+static void usage(void);
+static void printfs(void);
+static int journal_alloc(int64_t size);
+static void journal_clear(void);
+static void sbdirty(void);
 
 int
 main(int argc, char *argv[])
@@ -545,16 +547,13 @@ err:
err(12, "%s", special);
 }
 
-void
+static void
 sbdirty(void)
 {
disk.d_fs.fs_flags |= FS_UNCLEAN | FS_NEEDSFSCK;
disk.d_fs.fs_clean = 0;
 }
 
-static int blocks;
-static char clrbuf[MAXBSIZE];
-
 static ufs2_daddr_t
 journal_balloc(void)
 {
@@ -880,7 +879,7 @@ indir_fill(ufs2_daddr_t blk, int level, 
 /*
  * Clear the flag bits so the journal can be removed.
  */
-void
+static void
 journal_clear(void)
 {
struct ufs1_dinode *dp1;
@@ -911,7 +910,7 @@ journal_clear(void)
}
 }
 
-int
+static int
 journal_alloc(int64_t size)
 {
struct ufs1_dinode *dp1;
@@ -1060,7 +1059,7 @@ out:
return (-1);
 }
 
-void
+static void
 usage(void)
 {
fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n",
@@ -1073,7 +1072,7 @@ usage(void)
exit(2);
 }
 
-void
+static void
 printfs(void)
 {
warnx("POSIX.1e ACLs: (-a)%s",
___
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: r242264 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 19:22:18 2012
New Revision: 242264
URL: http://svn.freebsd.org/changeset/base/242264

Log:
  Update comment to reflect the change made in r242263.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_timer.c

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cSun Oct 28 19:20:23 2012
(r242263)
+++ head/sys/netinet/tcp_timer.cSun Oct 28 19:22:18 2012
(r242264)
@@ -578,7 +578,7 @@ tcp_timer_rexmt(void * xtp)
TCPT_RANGESET(tp->t_rxtcur, rexmt,
  tp->t_rttmin, TCPTV_REXMTMAX);
/*
-* Disable rfc1323 if we haven't got any response to
+* Disable RFC1323 and SACK if we haven't got any response to
 * our third SYN to work-around some broken terminal servers
 * (most of which have hopefully been retired) that have bad VJ
 * header compression code which trashes TCP segments containing
___
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: r242263 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 19:20:23 2012
New Revision: 242263
URL: http://svn.freebsd.org/changeset/base/242263

Log:
  Add SACK_PERMIT to the list of TCP options that are switched off after
  retransmitting a SYN three times.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_timer.c

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cSun Oct 28 19:16:22 2012
(r242262)
+++ head/sys/netinet/tcp_timer.cSun Oct 28 19:20:23 2012
(r242263)
@@ -585,7 +585,7 @@ tcp_timer_rexmt(void * xtp)
 * unknown-to-them TCP options.
 */
if ((tp->t_state == TCPS_SYN_SENT) && (tp->t_rxtshift == 3))
-   tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP);
+   tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP|TF_SACK_PERMIT);
/*
 * If we backed off this far, our srtt estimate is probably bogus.
 * Clobber it so we'll take the next rtt measurement as our srtt;
___
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: r242262 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 19:16:22 2012
New Revision: 242262
URL: http://svn.freebsd.org/changeset/base/242262

Log:
  Simplify and enhance the window change/update acceptance logic,
  especially in the presence of bi-directional data transfers.
  
  snd_wl1 tracks the right edge, including data in the reassembly
  queue, of valid incoming data.  This makes it like rcv_nxt plus
  reassembly.  It never goes backwards to prevent older, possibly
  reordered segments from updating the window.
  
  snd_wl2 tracks the left edge of sent data.  This makes it a duplicate
  of snd_una.  However joining them right now is difficult due to
  separate update dependencies in different places in the code flow.
  
  snd_wnd tracks the current advertized send window by the peer.  In
  tcp_output() the effective window is calculated by subtracting the
  already in-flight data, snd_nxt less snd_una, from it.
  
  ACK's become the main clock of window updates and will always update
  the window when the left edge of what we sent is advanced.  The ACK
  clock is the primary signaling mechanism in ongoing data transfers.
  This works reliably even in the presence of reordering, reassembly
  and retransmitted segments.  The ACK clock is most important because
  it determines how much data we are allowed to inject into the network.
  
  Zero window updates get us out of persistence mode are crucial.  Here
  a segment that neither moves ACK nor SEQ but enlarges WND is accepted.
  
  When the ACK clock is not active (that is we're not or no longer
  sending any data) any segment that moves the extended right SEQ edge,
  including out-of-order segments, updates the window.  This gives us
  updates especially during ping-pong transfers where the peer isn't
  done consuming the already acknowledged data from the receive buffer
  while responding with data.
  
  The SSH protocol is a prime candidate to benefit from the improved
  bi-directional window update logic as it has its own windowing
  mechanism on top of TCP and is frequently sending back protocol ACK's.
  
  Tcpdump provided by:  darrenr
  Tested by:darrenr
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cSun Oct 28 19:02:07 2012
(r242261)
+++ head/sys/netinet/tcp_input.cSun Oct 28 19:16:22 2012
(r242262)
@@ -1714,7 +1714,7 @@ tcp_do_segment(struct mbuf *m, struct tc
 * Pull snd_wl1 up to prevent seq wrap relative to
 * th_seq.
 */
-   tp->snd_wl1 = th->th_seq;
+   tp->snd_wl1 = th->th_seq + tlen;
/*
 * Pull rcv_up up to prevent seq wrap relative to
 * rcv_nxt.
@@ -2327,7 +2327,6 @@ tcp_do_segment(struct mbuf *m, struct tc
if (tlen == 0 && (thflags & TH_FIN) == 0)
(void) tcp_reass(tp, (struct tcphdr *)0, 0,
(struct mbuf *)0);
-   tp->snd_wl1 = th->th_seq - 1;
/* FALLTHROUGH */
 
/*
@@ -2638,12 +2637,10 @@ process_ACK:
 
SOCKBUF_LOCK(&so->so_snd);
if (acked > so->so_snd.sb_cc) {
-   tp->snd_wnd -= so->so_snd.sb_cc;
sbdrop_locked(&so->so_snd, (int)so->so_snd.sb_cc);
ourfinisacked = 1;
} else {
sbdrop_locked(&so->so_snd, acked);
-   tp->snd_wnd -= acked;
ourfinisacked = 0;
}
/* NB: sowwakeup_locked() does an implicit unlock. */
@@ -2733,24 +2730,56 @@ step6:
INP_WLOCK_ASSERT(tp->t_inpcb);
 
/*
-* Update window information.
-* Don't look at window if no ACK: TAC's send garbage on first SYN.
+* Window update acceptance logic.  We have to be careful not
+* to accept window updates from old segments in the presence
+* of reordering or duplication.
+*
+* A window update is valid when:
+*  - the segment ACK's new data.
+*  - the segment carries new data and its ACK is current.
+*  - the segment matches the current SEQ and ACK but increases
+*the window.  This is the escape from persist mode, if there
+*data to be sent.
+*
+* XXXAO: The presence of new SACK information would allow to
+* accept window updates during retransmits.  We don't have an
+* easy way to test for that the moment.
+*
+* NB: The other side isn't allowed to shrink the window when
+* not sending or acking new data.  This behavior is strongly
+* discouraged by RFC793, section 3.7, page 42 anyways.
+*
+* XXXAO: tiwin >= minm

svn commit: r242261 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 19:02:07 2012
New Revision: 242261
URL: http://svn.freebsd.org/changeset/base/242261

Log:
  For retransmits of SYN|ACK from the syncache use the slightly more
  aggressive special tcp_syn_backoff[] retransmit schedule instead of
  the normal tcp_backoff[] schedule for established connections.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_syncache.c
  head/sys/netinet/tcp_timer.h

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Sun Oct 28 18:56:57 2012
(r242260)
+++ head/sys/netinet/tcp_syncache.c Sun Oct 28 19:02:07 2012
(r242261)
@@ -391,7 +391,7 @@ static void
 syncache_timeout(struct syncache *sc, struct syncache_head *sch, int docallout)
 {
sc->sc_rxttime = ticks +
-   TCPTV_RTOBASE * (tcp_backoff[sc->sc_rxmits]);
+   TCPTV_RTOBASE * (tcp_syn_backoff[sc->sc_rxmits]);
sc->sc_rxmits++;
if (TSTMP_LT(sc->sc_rxttime, sch->sch_nextc)) {
sch->sch_nextc = sc->sc_rxttime;

Modified: head/sys/netinet/tcp_timer.h
==
--- head/sys/netinet/tcp_timer.hSun Oct 28 18:56:57 2012
(r242260)
+++ head/sys/netinet/tcp_timer.hSun Oct 28 19:02:07 2012
(r242261)
@@ -170,6 +170,7 @@ extern int tcp_rexmit_slop;
 extern int tcp_msl;
 extern int tcp_ttl;/* time to live for TCP segs */
 extern int tcp_backoff[];
+extern int tcp_syn_backoff[];
 
 extern int tcp_finwait2_timeout;
 extern int tcp_fast_finwait2_recycle;
___
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: r242260 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 18:56:57 2012
New Revision: 242260
URL: http://svn.freebsd.org/changeset/base/242260

Log:
  When retransmitting SYN in TCPS_SYN_SENT state use TCPTV_RTOBASE,
  the default retransmit timeout, as base to calculate the backoff
  time until next try instead of the TCP_REXMTVAL() macro which only
  works correctly when we already have measured an actual RTT+RTTVAR.
  
  Before it would cause the first retransmit at RTOBASE, the next
  four at the same time (!) about 200ms later, and then another one
  again RTOBASE later.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_timer.c

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cSun Oct 28 18:53:28 2012
(r242259)
+++ head/sys/netinet/tcp_timer.cSun Oct 28 18:56:57 2012
(r242260)
@@ -572,7 +572,7 @@ tcp_timer_rexmt(void * xtp)
tp->t_flags &= ~TF_PREVVALID;
TCPSTAT_INC(tcps_rexmttimeo);
if (tp->t_state == TCPS_SYN_SENT)
-   rexmt = TCP_REXMTVAL(tp) * tcp_syn_backoff[tp->t_rxtshift];
+   rexmt = TCPTV_RTOBASE * tcp_syn_backoff[tp->t_rxtshift];
else
rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift];
TCPT_RANGESET(tp->t_rxtcur, rexmt,
___
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: r242259 - in head/sys: sys ufs/ffs

2012-10-28 Thread Edward Tomasz Napierala
Author: trasz
Date: Sun Oct 28 18:53:28 2012
New Revision: 242259
URL: http://svn.freebsd.org/changeset/base/242259

Log:
  Fix two problems that caused instant panic when the device mounted
  with softupdates went away.  Note that this does not fix the problem
  entirely; I'm committing it now to make it easier for someone to pick
  up the work.
  
  Reviewed by:  mckusick

Modified:
  head/sys/sys/buf.h
  head/sys/ufs/ffs/ffs_softdep.c

Modified: head/sys/sys/buf.h
==
--- head/sys/sys/buf.h  Sun Oct 28 18:46:06 2012(r242258)
+++ head/sys/sys/buf.h  Sun Oct 28 18:53:28 2012(r242259)
@@ -427,7 +427,6 @@ buf_deallocate(struct buf *bp)
 {
if (bioops.io_deallocate)
(*bioops.io_deallocate)(bp);
-   BUF_LOCKFREE(bp);
 }
 
 static __inline int

Modified: head/sys/ufs/ffs/ffs_softdep.c
==
--- head/sys/ufs/ffs/ffs_softdep.c  Sun Oct 28 18:46:06 2012
(r242258)
+++ head/sys/ufs/ffs/ffs_softdep.c  Sun Oct 28 18:53:28 2012
(r242259)
@@ -13342,8 +13342,13 @@ softdep_deallocate_dependencies(bp)
 
if ((bp->b_ioflags & BIO_ERROR) == 0)
panic("softdep_deallocate_dependencies: dangling deps");
-   softdep_error(bp->b_vp->v_mount->mnt_stat.f_mntonname, bp->b_error);
-   panic("softdep_deallocate_dependencies: unrecovered I/O error");
+   if (bp->b_vp != NULL && bp->b_vp->v_mount != NULL)
+   softdep_error(bp->b_vp->v_mount->mnt_stat.f_mntonname, 
bp->b_error);
+   else
+   printf("softdep_deallocate_dependencies: "
+   "got error %d while accessing filesystem\n", bp->b_error);
+   if (bp->b_error != ENXIO)
+   panic("softdep_deallocate_dependencies: unrecovered I/O error");
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242258 - head/sys/dev/ath

2012-10-28 Thread Adrian Chadd
Author: adrian
Date: Sun Oct 28 18:46:06 2012
New Revision: 242258
URL: http://svn.freebsd.org/changeset/base/242258

Log:
  Add a temporary (for values of "temporary") work around for hotplug
  support with ath(4) and VIMAGE.
  
  Right now the VIMAGE code doesn't supply a default vnet context during:
  
  * hotplug attach;
  * any device detach.
  
  It special cases kldload/boot time probing (by setting the context to
  vnet0) but that doesn't occur when probing devices during a bus rescan -
  eg, adding a cardbus card.
  
  These will eventually go away when the VIMAGE support extends to providing
  default contexts to hotplug attach/detach.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Sun Oct 28 18:45:04 2012(r242257)
+++ head/sys/dev/ath/if_ath.c   Sun Oct 28 18:46:06 2012(r242258)
@@ -281,6 +281,7 @@ ath_attach(u_int16_t devid, struct ath_s
 
DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid);
 
+   CURVNET_SET(vnet0);
ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211);
if (ifp == NULL) {
device_printf(sc->sc_dev, "can not if_alloc()\n");
@@ -292,6 +293,7 @@ ath_attach(u_int16_t devid, struct ath_s
/* set these up early for if_printf use */
if_initname(ifp, device_get_name(sc->sc_dev),
device_get_unit(sc->sc_dev));
+   CURVNET_RESTORE();
 
ah = ath_hal_attach(devid, sc, sc->sc_st, sc->sc_sh,
sc->sc_eepromdata, &status);
@@ -887,8 +889,11 @@ bad2:
 bad:
if (ah)
ath_hal_detach(ah);
-   if (ifp != NULL)
+   if (ifp != NULL) {
+   CURVNET_SET(ifp->if_vnet);
if_free(ifp);
+   CURVNET_RESTORE();
+   }
sc->sc_invalid = 1;
return error;
 }
@@ -930,7 +935,10 @@ ath_detach(struct ath_softc *sc)
ath_rxdma_teardown(sc);
ath_tx_cleanup(sc);
ath_hal_detach(sc->sc_ah);  /* NB: sets chip in full sleep */
+
+   CURVNET_SET(ifp->if_vnet);
if_free(ifp);
+   CURVNET_RESTORE();
 
return 0;
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242257 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 18:45:04 2012
New Revision: 242257
URL: http://svn.freebsd.org/changeset/base/242257

Log:
  Remove bogus 'else' in #ifdef that prevented the rttvar from being reset
  tcp_timer_rexmt() on retransmit for IPv6 sessions.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_timer.c

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cSun Oct 28 18:38:51 2012
(r242256)
+++ head/sys/netinet/tcp_timer.cSun Oct 28 18:45:04 2012
(r242257)
@@ -596,7 +596,6 @@ tcp_timer_rexmt(void * xtp)
 #ifdef INET6
if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0)
in6_losing(tp->t_inpcb);
-   else
 #endif
tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT);
tp->t_srtt = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242256 - head/sys/kern

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 18:38:51 2012
New Revision: 242256
URL: http://svn.freebsd.org/changeset/base/242256

Log:
  Improve m_cat() by being able to also merge contents from M_EXT
  mbuf's by doing proper testing with M_WRITABLE().
  
  In m_collapse() replace an incomplete manual check for M_RDONLY
  with the M_WRITABLE() macro that also tests for shared buffers
  and other cases that make a particular mbuf immutable.
  
  MFC after:2 weeks

Modified:
  head/sys/kern/uipc_mbuf.c

Modified: head/sys/kern/uipc_mbuf.c
==
--- head/sys/kern/uipc_mbuf.c   Sun Oct 28 18:33:52 2012(r242255)
+++ head/sys/kern/uipc_mbuf.c   Sun Oct 28 18:38:51 2012(r242256)
@@ -911,8 +911,8 @@ m_cat(struct mbuf *m, struct mbuf *n)
while (m->m_next)
m = m->m_next;
while (n) {
-   if (m->m_flags & M_EXT ||
-   m->m_data + m->m_len + n->m_len >= &m->m_dat[MLEN]) {
+   if (!M_WRITABLE(m) ||
+   M_TRAILINGSPACE(m) < n->m_len) {
/* just join the two chains */
m->m_next = n;
return;
@@ -1584,7 +1584,7 @@ again:
n = m->m_next;
if (n == NULL)
break;
-   if ((m->m_flags & M_RDONLY) == 0 &&
+   if (M_WRITABLE(m) &&
n->m_len < M_TRAILINGSPACE(m)) {
bcopy(mtod(n, void *), mtod(m, char *) + m->m_len,
n->m_len);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242255 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 18:33:52 2012
New Revision: 242255
URL: http://svn.freebsd.org/changeset/base/242255

Log:
  Allow arbitrary MSS sizes and don't mind about the cluster size anymore.
  We've got more cluster sizes for quite some time now and the orginally
  imposed limits and the previously codified thoughts on efficiency gains
  are no longer true.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cSun Oct 28 18:07:34 2012
(r242254)
+++ head/sys/netinet/tcp_input.cSun Oct 28 18:33:52 2012
(r242255)
@@ -3322,10 +3322,8 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt
 /*
  * Determine a reasonable value for maxseg size.
  * If the route is known, check route for mtu.
- * If none, use an mss that can be handled on the outgoing
- * interface without forcing IP to fragment; if bigger than
- * an mbuf cluster (MCLBYTES), round down to nearest multiple of MCLBYTES
- * to utilize large mbufs.  If no route is found, route has no mtu,
+ * If none, use an mss that can be handled on the outgoing interface
+ * without forcing IP to fragment.  If no route is found, route has no mtu,
  * or the destination isn't local, use a default, hopefully conservative
  * size (usually 512 or the default IP max size, but no more than the mtu
  * of the interface), as we can't discover anything about intervening
@@ -3506,13 +3504,6 @@ tcp_mss_update(struct tcpcb *tp, int off
 (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP))
mss -= TCPOLEN_TSTAMP_APPA;
 
-#if(MCLBYTES & (MCLBYTES - 1)) == 0
-   if (mss > MCLBYTES)
-   mss &= ~(MCLBYTES-1);
-#else
-   if (mss > MCLBYTES)
-   mss = mss / MCLBYTES * MCLBYTES;
-#endif
tp->t_maxseg = mss;
 }
 
___
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: r242254 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 18:07:34 2012
New Revision: 242254
URL: http://svn.freebsd.org/changeset/base/242254

Log:
  Change the syncache count reporting the current number of entries
  from an unprotected u_int that reports garbage on SMP to a function
  based sysctl obtaining the current value from UMA.
  
  Also read back the actual cache_limit after page size rounding by UMA.
  
  PR:   kern/165879
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_syncache.c
  head/sys/netinet/tcp_syncache.h

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Sun Oct 28 17:59:46 2012
(r242253)
+++ head/sys/netinet/tcp_syncache.c Sun Oct 28 18:07:34 2012
(r242254)
@@ -123,6 +123,7 @@ struct syncache *syncache_lookup(struct 
 static int  syncache_respond(struct syncache *);
 static struct   socket *syncache_socket(struct syncache *, struct socket *,
struct mbuf *m);
+static int  syncache_sysctl_count(SYSCTL_HANDLER_ARGS);
 static void syncache_timeout(struct syncache *sc, struct syncache_head 
*sch,
int docallout);
 static void syncache_timer(void *);
@@ -158,8 +159,8 @@ SYSCTL_VNET_UINT(_net_inet_tcp_syncache,
 &VNET_NAME(tcp_syncache.cache_limit), 0,
 "Overall entry limit for syncache");
 
-SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, count, CTLFLAG_RD,
-&VNET_NAME(tcp_syncache.cache_count), 0,
+SYSCTL_VNET_PROC(_net_inet_tcp_syncache, OID_AUTO, count, 
(CTLTYPE_UINT|CTLFLAG_RD),
+NULL, 0, &syncache_sysctl_count, "IU",
 "Current number of entries in syncache");
 
 SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, hashsize, CTLFLAG_RDTUN,
@@ -225,7 +226,6 @@ syncache_init(void)
 {
int i;
 
-   V_tcp_syncache.cache_count = 0;
V_tcp_syncache.hashsize = TCP_SYNCACHE_HASHSIZE;
V_tcp_syncache.bucket_limit = TCP_SYNCACHE_BUCKETLIMIT;
V_tcp_syncache.rexmt_limit = SYNCACHE_MAXREXMTS;
@@ -269,6 +269,7 @@ syncache_init(void)
V_tcp_syncache.zone = uma_zcreate("syncache", sizeof(struct syncache),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
uma_zone_set_max(V_tcp_syncache.zone, V_tcp_syncache.cache_limit);
+   V_tcp_syncache.cache_limit = uma_zone_get_max(V_tcp_syncache.zone);
 }
 
 #ifdef VIMAGE
@@ -296,8 +297,8 @@ syncache_destroy(void)
mtx_destroy(&sch->sch_mtx);
}
 
-   KASSERT(V_tcp_syncache.cache_count == 0, ("%s: cache_count %d not 0",
-   __func__, V_tcp_syncache.cache_count));
+   KASSERT(uma_zone_get_cur(V_tcp_syncache.zone) == 0,
+   ("%s: cache_count not 0", __func__));
 
/* Free the allocated global resources. */
uma_zdestroy(V_tcp_syncache.zone);
@@ -305,6 +306,15 @@ syncache_destroy(void)
 }
 #endif
 
+static int
+syncache_sysctl_count(SYSCTL_HANDLER_ARGS)
+{
+   int count;
+
+   count = uma_zone_get_cur(V_tcp_syncache.zone);
+   return (sysctl_handle_int(oidp, &count, sizeof(count), req));
+}
+
 /*
  * Inserts a syncache entry into the specified bucket row.
  * Locks and unlocks the syncache_head autonomously.
@@ -347,7 +357,6 @@ syncache_insert(struct syncache *sc, str
 
SCH_UNLOCK(sch);
 
-   V_tcp_syncache.cache_count++;
TCPSTAT_INC(tcps_sc_added);
 }
 
@@ -373,7 +382,6 @@ syncache_drop(struct syncache *sc, struc
 #endif
 
syncache_free(sc);
-   V_tcp_syncache.cache_count--;
 }
 
 /*
@@ -958,7 +966,6 @@ syncache_expand(struct in_conninfo *inc,
tod->tod_syncache_removed(tod, sc->sc_todctx);
}
 #endif
-   V_tcp_syncache.cache_count--;
SCH_UNLOCK(sch);
}
 

Modified: head/sys/netinet/tcp_syncache.h
==
--- head/sys/netinet/tcp_syncache.h Sun Oct 28 17:59:46 2012
(r242253)
+++ head/sys/netinet/tcp_syncache.h Sun Oct 28 18:07:34 2012
(r242254)
@@ -112,7 +112,6 @@ struct tcp_syncache {
u_int   hashsize;
u_int   hashmask;
u_int   bucket_limit;
-   u_int   cache_count;/* XXX: unprotected */
u_int   cache_limit;
u_int   rexmt_limit;
u_int   hash_secret;
___
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: r242253 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 17:59:46 2012
New Revision: 242253
URL: http://svn.freebsd.org/changeset/base/242253

Log:
  Simplify implementation of net.inet.tcp.reass.maxsegments and
  net.inet.tcp.reass.cursegments.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_reass.c

Modified: head/sys/netinet/tcp_reass.c
==
--- head/sys/netinet/tcp_reass.cSun Oct 28 17:40:35 2012
(r242252)
+++ head/sys/netinet/tcp_reass.cSun Oct 28 17:59:46 2012
(r242253)
@@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif /* TCPDEBUG */
 
-static int tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS);
 static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS);
 
 static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0,
@@ -82,16 +81,12 @@ static SYSCTL_NODE(_net_inet_tcp, OID_AU
 
 static VNET_DEFINE(int, tcp_reass_maxseg) = 0;
 #defineV_tcp_reass_maxseg  VNET(tcp_reass_maxseg)
-SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments,
-CTLTYPE_INT | CTLFLAG_RDTUN,
-&VNET_NAME(tcp_reass_maxseg), 0, &tcp_reass_sysctl_maxseg, "I",
+SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN,
+&VNET_NAME(tcp_reass_maxseg), 0,
 "Global maximum number of TCP Segments in Reassembly Queue");
 
-static VNET_DEFINE(int, tcp_reass_qsize) = 0;
-#defineV_tcp_reass_qsize   VNET(tcp_reass_qsize)
 SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments,
-CTLTYPE_INT | CTLFLAG_RD,
-&VNET_NAME(tcp_reass_qsize), 0, &tcp_reass_sysctl_qsize, "I",
+(CTLTYPE_INT | CTLFLAG_RD), NULL, 0, &tcp_reass_sysctl_qsize, "I",
 "Global number of TCP Segments currently in Reassembly Queue");
 
 static VNET_DEFINE(int, tcp_reass_overflows) = 0;
@@ -109,8 +104,10 @@ static void
 tcp_reass_zone_change(void *tag)
 {
 
+   /* Set the zone limit and read back the effective value. */
V_tcp_reass_maxseg = nmbclusters / 16;
uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg);
+   V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone);
 }
 
 void
@@ -122,7 +119,9 @@ tcp_reass_init(void)
&V_tcp_reass_maxseg);
V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
+   /* Set the zone limit and read back the effective value. */
uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg);
+   V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone);
EVENTHANDLER_REGISTER(nmbclusters_change,
tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY);
 }
@@ -156,17 +155,12 @@ tcp_reass_flush(struct tcpcb *tp)
 }
 
 static int
-tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS)
-{
-   V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone);
-   return (sysctl_handle_int(oidp, arg1, arg2, req));
-}
-
-static int
 tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS)
 {
-   V_tcp_reass_qsize = uma_zone_get_cur(V_tcp_reass_zone);
-   return (sysctl_handle_int(oidp, arg1, arg2, req));
+   int qsize;
+
+   qsize = uma_zone_get_cur(V_tcp_reass_zone);
+   return (sysctl_handle_int(oidp, &qsize, sizeof(qsize), req));
 }
 
 int
___
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: r242252 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 17:40:35 2012
New Revision: 242252
URL: http://svn.freebsd.org/changeset/base/242252

Log:
  Prevent a flurry of forced window updates when an application is
  doing small reads on a (partially) filled receive socket buffer.
  
  Normally one would a send a window update every time the available
  space in the socket buffer increases by two times MSS.  This leads
  to a flurry of window updates that do not provide any meaningful
  new information to the sender.  There still is available space in
  the window and the sender can continue sending data.  All window
  updates then get carried by the regular ACKs.  Only when the socket
  buffer was (almost) full and the window closed accordingly a window
  updates delivery new information and allows the sender to start
  sending more data again.
  
  Send window updates only every two MSS when the socket buffer
  has less than 1/8 space available, or the available space in the
  socket buffer increased by 1/4 its full capacity, or the socket
  buffer is very small.  The next regular data ACK will carry and
  report the exact window size again.
  
  Reported by:  sbruno
  Tested by:darrenr
  Tested by:Darren Baginski
  PR:   kern/116335
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Sun Oct 28 17:30:28 2012
(r242251)
+++ head/sys/netinet/tcp_output.c   Sun Oct 28 17:40:35 2012
(r242252)
@@ -545,23 +545,39 @@ after_sack_rexmit:
}
 
/*
-* Compare available window to amount of window
-* known to peer (as advertised window less
-* next expected input).  If the difference is at least two
-* max size segments, or at least 50% of the maximum possible
-* window, then want to send a window update to peer.
-* Skip this if the connection is in T/TCP half-open state.
+* Sending of standalone window updates.
+*
+* Window updates important when we close our window due to a full
+* socket buffer and are opening it again after the application
+* reads data from it.  Once the window has opened again and the
+* remote end starts to send again the ACK clock takes over and
+* provides the most current window information.
+*
+* We must avoid to the silly window syndrome whereas every read
+* from the receive buffer, no matter how small, causes a window
+* update to be sent.  We also should avoid sending a flurry of
+* window updates when the socket buffer had queued a lot of data
+* and the application is doing small reads.
+*
+* Prevent a flurry of pointless window updates by only sending
+* an update when we can increase the advertized window by more
+* than 1/4th of the socket buffer capacity.  When the buffer is
+* getting full or is very small be more aggressive and send an
+* update whenever we can increase by two mss sized segments.
+* In all other situations the ACK's to new incoming data will
+* carry further window increases.
 *
 * Don't send an independent window update if a delayed
 * ACK is pending (it will get piggy-backed on it) or the
 * remote side already has done a half-close and won't send
-* more data.
+* more data.  Skip this if the connection is in T/TCP
+* half-open state.
 */
if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) &&
!(tp->t_flags & TF_DELACK) &&
!TCPS_HAVERCVDFIN(tp->t_state)) {
/*
-* "adv" is the amount we can increase the window,
+* "adv" is the amount we could increase the window,
 * taking into account that we are limited by
 * TCP_MAXWIN << tp->rcv_scale.
 */
@@ -581,9 +597,11 @@ after_sack_rexmit:
 */
if (oldwin >> tp->rcv_scale == (adv + oldwin) >> tp->rcv_scale)
goto dontupdate;
-   if (adv >= (long) (2 * tp->t_maxseg))
-   goto send;
-   if (2 * adv >= (long) so->so_rcv.sb_hiwat)
+
+   if (adv >= (long)(2 * tp->t_maxseg) &&
+   (adv >= (long)(so->so_rcv.sb_hiwat / 4) ||
+recwin <= (long)(so->so_rcv.sb_hiwat / 8) ||
+so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg))
goto send;
}
 dontupdate:
___
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: r242251 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 17:30:28 2012
New Revision: 242251
URL: http://svn.freebsd.org/changeset/base/242251

Log:
  When SYN or SYN/ACK had to be retransmitted RFC5681 requires us to
  reduce the initial CWND to one segment.  This reduction got lost
  some time ago due to a change in initialization ordering.
  
  Additionally in tcp_timer_rexmt() avoid entering fast recovery when
  we're still in TCPS_SYN_SENT state.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Sun Oct 28 17:25:08 2012
(r242250)
+++ head/sys/netinet/tcp_output.c   Sun Oct 28 17:30:28 2012
(r242251)
@@ -551,10 +551,14 @@ after_sack_rexmit:
 * max size segments, or at least 50% of the maximum possible
 * window, then want to send a window update to peer.
 * Skip this if the connection is in T/TCP half-open state.
-* Don't send pure window updates when the peer has closed
-* the connection and won't ever send more data.
+*
+* Don't send an independent window update if a delayed
+* ACK is pending (it will get piggy-backed on it) or the
+* remote side already has done a half-close and won't send
+* more data.
 */
if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) &&
+   !(tp->t_flags & TF_DELACK) &&
!TCPS_HAVERCVDFIN(tp->t_state)) {
/*
 * "adv" is the amount we can increase the window,
___
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: r242250 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 17:25:08 2012
New Revision: 242250
URL: http://svn.freebsd.org/changeset/base/242250

Log:
  When SYN or SYN/ACK had to be retransmitted RFC5681 requires us to
  reduce the initial CWND to one segment.  This reduction got lost
  some time ago due to a change in initialization ordering.
  
  Additionally in tcp_timer_rexmt() avoid entering fast recovery when
  we're still in TCPS_SYN_SENT state.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_syncache.c
  head/sys/netinet/tcp_timer.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cSun Oct 28 17:16:09 2012
(r242249)
+++ head/sys/netinet/tcp_input.cSun Oct 28 17:25:08 2012
(r242250)
@@ -345,10 +345,16 @@ cc_conn_init(struct tcpcb *tp)
/*
 * Set the initial slow-start flight size.
 *
-* RFC3390 says only do this if SYN or SYN/ACK didn't got lost.
-* XXX: We currently check only in syncache_socket for that.
-*/
-   if (V_tcp_do_rfc3390)
+* RFC5681 Section 3.1 specifies the default conservative values.
+* RFC3390 specifies slightly more aggressive values.
+*
+* If a SYN or SYN/ACK was lost and retransmitted, we have to
+* reduce the initial CWND to one segment as congestion is likely
+* requiring us to be cautious.
+*/
+   if (tp->snd_cwnd == 1)
+   tp->snd_cwnd = tp->t_maxseg;/* SYN(-ACK) lost */
+   else if (V_tcp_do_rfc3390)
tp->snd_cwnd = min(4 * tp->t_maxseg,
max(2 * tp->t_maxseg, 4380));
else {

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Sun Oct 28 17:16:09 2012
(r242249)
+++ head/sys/netinet/tcp_syncache.c Sun Oct 28 17:25:08 2012
(r242250)
@@ -852,11 +852,12 @@ syncache_socket(struct syncache *sc, str
tcp_mss(tp, sc->sc_peer_mss);
 
/*
-* If the SYN,ACK was retransmitted, reset cwnd to 1 segment.
+* If the SYN,ACK was retransmitted, indicate that CWND to be
+* limited to one segment in cc_conn_init().
 * NB: sc_rxmits counts all SYN,ACK transmits, not just retransmits.
 */
if (sc->sc_rxmits > 1)
-   tp->snd_cwnd = tp->t_maxseg;
+   tp->snd_cwnd = 1;
 
 #ifdef TCP_OFFLOAD
/*

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cSun Oct 28 17:16:09 2012
(r242249)
+++ head/sys/netinet/tcp_timer.cSun Oct 28 17:25:08 2012
(r242250)
@@ -539,7 +539,13 @@ tcp_timer_rexmt(void * xtp)
}
INP_INFO_RUNLOCK(&V_tcbinfo);
headlocked = 0;
-   if (tp->t_rxtshift == 1) {
+   if (tp->t_state == TCPS_SYN_SENT) {
+   /*
+* If the SYN was retransmitted, indicate CWND to be
+* limited to 1 segment in cc_conn_init().
+*/
+   tp->snd_cwnd = 1;
+   } else if (tp->t_rxtshift == 1) {
/*
 * first retransmit; record ssthresh and cwnd so they can
 * be recovered if this turns out to be a "bad" retransmit.
___
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: r242249 - head/sys/netinet

2012-10-28 Thread Andre Oppermann
Author: andre
Date: Sun Oct 28 17:16:09 2012
New Revision: 242249
URL: http://svn.freebsd.org/changeset/base/242249

Log:
  Adjust the initial default CWND upon connection establishment to the
  new and increased values specified by RFC5681 Section 3.1.
  
  The even larger initial CWND per RFC3390, if enabled, is not affected.
  
  MFC after:2 weeks

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cSun Oct 28 17:06:50 2012
(r242248)
+++ head/sys/netinet/tcp_input.cSun Oct 28 17:16:09 2012
(r242249)
@@ -351,8 +351,15 @@ cc_conn_init(struct tcpcb *tp)
if (V_tcp_do_rfc3390)
tp->snd_cwnd = min(4 * tp->t_maxseg,
max(2 * tp->t_maxseg, 4380));
-   else
-   tp->snd_cwnd = tp->t_maxseg;
+   else {
+   /* Per RFC5681 Section 3.1 */
+   if (tp->t_maxseg > 2190)
+   tp->snd_cwnd = 2 * tp->t_maxseg;
+   else if (tp->t_maxseg > 1095)
+   tp->snd_cwnd = 3 * tp->t_maxseg;
+   else
+   tp->snd_cwnd = 4 * tp->t_maxseg;
+   }
 
if (CC_ALGO(tp)->conn_init != NULL)
CC_ALGO(tp)->conn_init(tp->ccv);
___
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: r242247 - releng/9.1/sys/conf

2012-10-28 Thread Ken Smith
Author: kensmith
Date: Sun Oct 28 16:21:46 2012
New Revision: 242247
URL: http://svn.freebsd.org/changeset/base/242247

Log:
  Ready for 9.1-RC3...
  
  Approved by:  re (implicit)

Modified:
  releng/9.1/sys/conf/newvers.sh

Modified: releng/9.1/sys/conf/newvers.sh
==
--- releng/9.1/sys/conf/newvers.sh  Sun Oct 28 16:14:19 2012
(r242246)
+++ releng/9.1/sys/conf/newvers.sh  Sun Oct 28 16:21:46 2012
(r242247)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="9.1"
-BRANCH="RC2"
+BRANCH="RC3"
 if [ "X${BRANCH_OVERRIDE}" != "X" ]; then
BRANCH=${BRANCH_OVERRIDE}
 fi
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242246 - stable/8/sys/kern

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 16:14:19 2012
New Revision: 242246
URL: http://svn.freebsd.org/changeset/base/242246

Log:
  MFC r241281: ktrace/kern_exec: check p_tracecred instead of p_cred

Modified:
  stable/8/sys/kern/kern_exec.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/kern/   (props changed)

Modified: stable/8/sys/kern/kern_exec.c
==
--- stable/8/sys/kern/kern_exec.c   Sun Oct 28 16:14:07 2012
(r242245)
+++ stable/8/sys/kern/kern_exec.c   Sun Oct 28 16:14:19 2012
(r242246)
@@ -655,7 +655,8 @@ interpret:
setsugid(p);
 
 #ifdef KTRACE
-   if (priv_check_cred(oldcred, PRIV_DEBUG_DIFFCRED, 0))
+   if (p->p_tracecred != NULL &&
+   priv_check_cred(p->p_tracecred, PRIV_DEBUG_DIFFCRED, 0))
ktrprocexec(p, &tracecred, &tracevp);
 #endif
/*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242245 - stable/9/sys/kern

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 16:14:07 2012
New Revision: 242245
URL: http://svn.freebsd.org/changeset/base/242245

Log:
  MFC r241281: ktrace/kern_exec: check p_tracecred instead of p_cred

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

Modified: stable/9/sys/kern/kern_exec.c
==
--- stable/9/sys/kern/kern_exec.c   Sun Oct 28 16:12:12 2012
(r242244)
+++ stable/9/sys/kern/kern_exec.c   Sun Oct 28 16:14:07 2012
(r242245)
@@ -694,7 +694,8 @@ interpret:
setsugid(p);
 
 #ifdef KTRACE
-   if (priv_check_cred(oldcred, PRIV_DEBUG_DIFFCRED, 0))
+   if (p->p_tracecred != NULL &&
+   priv_check_cred(p->p_tracecred, PRIV_DEBUG_DIFFCRED, 0))
ktrprocexec(p, &tracecred, &tracevp);
 #endif
/*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242244 - stable/8/sys/boot/i386/zfsboot

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 16:12:12 2012
New Revision: 242244
URL: http://svn.freebsd.org/changeset/base/242244

Log:
  MFC r241294: zfsboot: simplify probe_drive() a little bit

Modified:
  stable/8/sys/boot/i386/zfsboot/zfsboot.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/boot/   (props changed)

Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c
==
--- stable/8/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 16:11:58 2012
(r242243)
+++ stable/8/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 16:12:12 2012
(r242244)
@@ -345,7 +345,7 @@ copy_dsk(struct dsk *dsk)
 }
 
 static void
-probe_drive(struct dsk *dsk, spa_t **spap)
+probe_drive(struct dsk *dsk)
 {
 #ifdef GPT
 struct gpt_hdr hdr;
@@ -359,9 +359,10 @@ probe_drive(struct dsk *dsk, spa_t **spa
 
 /*
  * If we find a vdev on the whole disk, stop here. Otherwise dig
- * out the MBR and probe each slice in turn for a vdev.
+ * out the partition table and probe each slice/partition
+ * in turn for a vdev.
  */
-if (vdev_probe(vdev_read, dsk, spap) == 0)
+if (vdev_probe(vdev_read, dsk, NULL) == 0)
return;
 
 sec = dmadat->secbuf;
@@ -399,13 +400,7 @@ probe_drive(struct dsk *dsk, spa_t **spa
if (memcmp(&ent->ent_type, &freebsd_zfs_uuid,
 sizeof(uuid_t)) == 0) {
dsk->start = ent->ent_lba_start;
-   if (vdev_probe(vdev_read, dsk, spap) == 0) {
-   /*
-* We record the first pool we find (we will try
-* to boot from that one).
-*/
-   spap = NULL;
-
+   if (vdev_probe(vdev_read, dsk, NULL) == 0) {
/*
 * This slice had a vdev. We need a new dsk
 * structure now since the vdev now owns this one.
@@ -428,13 +423,7 @@ trymbr:
if (!dp[i].dp_typ)
continue;
dsk->start = dp[i].dp_start;
-   if (vdev_probe(vdev_read, dsk, spap) == 0) {
-   /*
-* We record the first pool we find (we will try to boot
-* from that one.
-*/
-   spap = 0;
-
+   if (vdev_probe(vdev_read, dsk, NULL) == 0) {
/*
 * This slice had a vdev. We need a new dsk structure now
 * since the vdev now owns this one.
@@ -493,7 +482,7 @@ main(void)
  * Probe the boot drive first - we will try to boot from whatever
  * pool we find on that drive.
  */
-probe_drive(dsk, &spa);
+probe_drive(dsk);
 
 /*
  * Probe the rest of the drives that the bios knows about. This
@@ -515,20 +504,17 @@ main(void)
dsk->part = 0;
dsk->start = 0;
dsk->init = 0;
-   probe_drive(dsk, NULL);
+   probe_drive(dsk);
 }
 
 /*
- * If we didn't find a pool on the boot drive, default to the
- * first pool we found, if any.
+ * The first discovered pool, if any, is the pool.
  */
+spa = spa_get_primary();
 if (!spa) {
-   spa = spa_get_primary();
-   if (!spa) {
-   printf("%s: No ZFS pools located, can't boot\n", BOOTPROG);
-   for (;;)
-   ;
-   }
+   printf("%s: No ZFS pools located, can't boot\n", BOOTPROG);
+   for (;;)
+   ;
 }
 
 primary_spa = spa;
___
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: r242243 - stable/9/sys/boot/i386/zfsboot

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 16:11:58 2012
New Revision: 242243
URL: http://svn.freebsd.org/changeset/base/242243

Log:
  MFC r241294: zfsboot: simplify probe_drive() a little bit

Modified:
  stable/9/sys/boot/i386/zfsboot/zfsboot.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/i386/zfsboot/zfsboot.c
==
--- stable/9/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 16:10:18 2012
(r242242)
+++ stable/9/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 16:11:58 2012
(r242243)
@@ -345,7 +345,7 @@ copy_dsk(struct dsk *dsk)
 }
 
 static void
-probe_drive(struct dsk *dsk, spa_t **spap)
+probe_drive(struct dsk *dsk)
 {
 #ifdef GPT
 struct gpt_hdr hdr;
@@ -359,9 +359,10 @@ probe_drive(struct dsk *dsk, spa_t **spa
 
 /*
  * If we find a vdev on the whole disk, stop here. Otherwise dig
- * out the MBR and probe each slice in turn for a vdev.
+ * out the partition table and probe each slice/partition
+ * in turn for a vdev.
  */
-if (vdev_probe(vdev_read, dsk, spap) == 0)
+if (vdev_probe(vdev_read, dsk, NULL) == 0)
return;
 
 sec = dmadat->secbuf;
@@ -399,13 +400,7 @@ probe_drive(struct dsk *dsk, spa_t **spa
if (memcmp(&ent->ent_type, &freebsd_zfs_uuid,
 sizeof(uuid_t)) == 0) {
dsk->start = ent->ent_lba_start;
-   if (vdev_probe(vdev_read, dsk, spap) == 0) {
-   /*
-* We record the first pool we find (we will try
-* to boot from that one).
-*/
-   spap = NULL;
-
+   if (vdev_probe(vdev_read, dsk, NULL) == 0) {
/*
 * This slice had a vdev. We need a new dsk
 * structure now since the vdev now owns this one.
@@ -428,13 +423,7 @@ trymbr:
if (!dp[i].dp_typ)
continue;
dsk->start = dp[i].dp_start;
-   if (vdev_probe(vdev_read, dsk, spap) == 0) {
-   /*
-* We record the first pool we find (we will try to boot
-* from that one.
-*/
-   spap = 0;
-
+   if (vdev_probe(vdev_read, dsk, NULL) == 0) {
/*
 * This slice had a vdev. We need a new dsk structure now
 * since the vdev now owns this one.
@@ -493,7 +482,7 @@ main(void)
  * Probe the boot drive first - we will try to boot from whatever
  * pool we find on that drive.
  */
-probe_drive(dsk, &spa);
+probe_drive(dsk);
 
 /*
  * Probe the rest of the drives that the bios knows about. This
@@ -520,20 +509,17 @@ main(void)
dsk->part = 0;
dsk->start = 0;
dsk->init = 0;
-   probe_drive(dsk, NULL);
+   probe_drive(dsk);
 }
 
 /*
- * If we didn't find a pool on the boot drive, default to the
- * first pool we found, if any.
+ * The first discovered pool, if any, is the pool.
  */
+spa = spa_get_primary();
 if (!spa) {
-   spa = spa_get_primary();
-   if (!spa) {
-   printf("%s: No ZFS pools located, can't boot\n", BOOTPROG);
-   for (;;)
-   ;
-   }
+   printf("%s: No ZFS pools located, can't boot\n", BOOTPROG);
+   for (;;)
+   ;
 }
 
 primary_spa = spa;
___
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: r242242 - in stable/8/sys/boot: i386/loader i386/zfsboot zfs

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 16:10:18 2012
New Revision: 242242
URL: http://svn.freebsd.org/changeset/base/242242

Log:
  MFC r241293: zfs boot: export boot/primary pool and vdev guid all the
  way to kenv

Modified:
  stable/8/sys/boot/i386/loader/main.c
  stable/8/sys/boot/i386/zfsboot/zfsboot.c
  stable/8/sys/boot/zfs/libzfs.h
  stable/8/sys/boot/zfs/zfsimpl.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/boot/   (props changed)

Modified: stable/8/sys/boot/i386/loader/main.c
==
--- stable/8/sys/boot/i386/loader/main.cSun Oct 28 16:10:03 2012
(r242241)
+++ stable/8/sys/boot/i386/loader/main.cSun Oct 28 16:10:18 2012
(r242242)
@@ -209,6 +209,7 @@ extract_currdev(void)
 {
 struct i386_devdescnew_currdev;
 #ifdef LOADER_ZFS_SUPPORT
+char   buf[20];
 struct zfs_boot_args   *zargs;
 #endif
 intbiosdev = -1;
@@ -239,10 +240,17 @@ extract_currdev(void)
if ((kargs->bootflags & KARGS_FLAGS_EXTARG) != 0)
zargs = (struct zfs_boot_args *)(kargs + 1);
 
-   if (zargs != NULL && zargs->size >= sizeof(*zargs)) {
+   if (zargs != NULL &&
+   zargs->size >= offsetof(struct zfs_boot_args, primary_pool)) {
/* sufficient data is provided */
new_currdev.d_kind.zfs.pool_guid = zargs->pool;
new_currdev.d_kind.zfs.root_guid = zargs->root;
+   if (zargs->size >= sizeof(*zargs) && zargs->primary_vdev != 0) {
+   sprintf(buf, "%llu", zargs->primary_pool);
+   setenv("vfs.zfs.boot.primary_pool", buf, 1);
+   sprintf(buf, "%llu", zargs->primary_vdev);
+   setenv("vfs.zfs.boot.primary_vdev", buf, 1);
+   }
} else {
/* old style zfsboot block */
new_currdev.d_kind.zfs.pool_guid = kargs->zfspool;

Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c
==
--- stable/8/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 16:10:03 2012
(r242241)
+++ stable/8/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 16:10:18 2012
(r242242)
@@ -176,6 +176,8 @@ zfs_read(spa_t *spa, const dnode_phys_t 
  * Current ZFS pool
  */
 static spa_t *spa;
+static spa_t *primary_spa;
+static vdev_t *primary_vdev;
 
 /*
  * A wrapper for dskread that doesn't have to worry about whether the
@@ -521,7 +523,7 @@ main(void)
  * first pool we found, if any.
  */
 if (!spa) {
-   spa = STAILQ_FIRST(&zfs_pools);
+   spa = spa_get_primary();
if (!spa) {
printf("%s: No ZFS pools located, can't boot\n", BOOTPROG);
for (;;)
@@ -529,6 +531,9 @@ main(void)
}
 }
 
+primary_spa = spa;
+primary_vdev = spa_get_primary_vdev(spa);
+
 if (zfs_spa_init(spa) != 0 || zfs_mount(spa, 0, &zfsmount) != 0) {
printf("%s: failed to mount default pool %s\n",
BOOTPROG, spa->spa_name);
@@ -697,6 +702,11 @@ load(void)
 zfsargs.size = sizeof(zfsargs);
 zfsargs.pool = zfsmount.spa->spa_guid;
 zfsargs.root = zfsmount.rootobj;
+zfsargs.primary_pool = primary_spa->spa_guid;
+if (primary_vdev != NULL)
+   zfsargs.primary_vdev = primary_vdev->v_guid;
+else
+   printf("failed to detect primary vdev\n");
 __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),
   bootdev,
   KARGS_FLAGS_ZFS | KARGS_FLAGS_EXTARG,

Modified: stable/8/sys/boot/zfs/libzfs.h
==
--- stable/8/sys/boot/zfs/libzfs.h  Sun Oct 28 16:10:03 2012
(r242241)
+++ stable/8/sys/boot/zfs/libzfs.h  Sun Oct 28 16:10:18 2012
(r242242)
@@ -53,6 +53,8 @@ struct zfs_boot_args
 uint32_t   reserved;
 uint64_t   pool;
 uint64_t   root;
+uint64_t   primary_pool;
+uint64_t   primary_vdev;
 };
 
 intzfs_parsedev(struct zfs_devdesc *dev, const char *devspec,

Modified: stable/8/sys/boot/zfs/zfsimpl.c
==
--- stable/8/sys/boot/zfs/zfsimpl.c Sun Oct 28 16:10:03 2012
(r242241)
+++ stable/8/sys/boot/zfs/zfsimpl.c Sun Oct 28 16:10:18 2012
(r242242)
@@ -648,6 +648,34 @@ spa_find_by_name(const char *name)
return (0);
 }
 
+#ifdef BOOT2
+static spa_t *
+spa_get_primary(void)
+{
+
+   return (STAILQ_FIRST(&zfs_pools));
+}
+
+static vdev_t *
+spa_get_primary_vdev(const spa_t *spa)
+{
+   vdev_t *vdev;
+   vdev_t *kid;
+
+   if (spa == NULL)
+   spa = spa_get_primary();
+   if (spa == NULL)
+   return (NULL);
+   vdev = STAILQ_FIRST(&spa->spa_vdevs);
+   if (vdev == NULL)
+   return (NULL);
+   for (kid = STAILQ_FIRST(&vdev->v_

svn commit: r242241 - in stable/9/sys/boot: i386/loader i386/zfsboot zfs

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 16:10:03 2012
New Revision: 242241
URL: http://svn.freebsd.org/changeset/base/242241

Log:
  MFC r241293: zfs boot: export boot/primary pool and vdev guid all the
  way to kenv

Modified:
  stable/9/sys/boot/i386/loader/main.c
  stable/9/sys/boot/i386/zfsboot/zfsboot.c
  stable/9/sys/boot/zfs/libzfs.h
  stable/9/sys/boot/zfs/zfsimpl.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/i386/loader/main.c
==
--- stable/9/sys/boot/i386/loader/main.cSun Oct 28 16:06:55 2012
(r242240)
+++ stable/9/sys/boot/i386/loader/main.cSun Oct 28 16:10:03 2012
(r242241)
@@ -209,6 +209,7 @@ extract_currdev(void)
 {
 struct i386_devdescnew_currdev;
 #ifdef LOADER_ZFS_SUPPORT
+char   buf[20];
 struct zfs_boot_args   *zargs;
 #endif
 intbiosdev = -1;
@@ -239,10 +240,17 @@ extract_currdev(void)
if ((kargs->bootflags & KARGS_FLAGS_EXTARG) != 0)
zargs = (struct zfs_boot_args *)(kargs + 1);
 
-   if (zargs != NULL && zargs->size >= sizeof(*zargs)) {
+   if (zargs != NULL &&
+   zargs->size >= offsetof(struct zfs_boot_args, primary_pool)) {
/* sufficient data is provided */
new_currdev.d_kind.zfs.pool_guid = zargs->pool;
new_currdev.d_kind.zfs.root_guid = zargs->root;
+   if (zargs->size >= sizeof(*zargs) && zargs->primary_vdev != 0) {
+   sprintf(buf, "%llu", zargs->primary_pool);
+   setenv("vfs.zfs.boot.primary_pool", buf, 1);
+   sprintf(buf, "%llu", zargs->primary_vdev);
+   setenv("vfs.zfs.boot.primary_vdev", buf, 1);
+   }
} else {
/* old style zfsboot block */
new_currdev.d_kind.zfs.pool_guid = kargs->zfspool;

Modified: stable/9/sys/boot/i386/zfsboot/zfsboot.c
==
--- stable/9/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 16:06:55 2012
(r242240)
+++ stable/9/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 16:10:03 2012
(r242241)
@@ -176,6 +176,8 @@ zfs_read(spa_t *spa, const dnode_phys_t 
  * Current ZFS pool
  */
 static spa_t *spa;
+static spa_t *primary_spa;
+static vdev_t *primary_vdev;
 
 /*
  * A wrapper for dskread that doesn't have to worry about whether the
@@ -526,7 +528,7 @@ main(void)
  * first pool we found, if any.
  */
 if (!spa) {
-   spa = STAILQ_FIRST(&zfs_pools);
+   spa = spa_get_primary();
if (!spa) {
printf("%s: No ZFS pools located, can't boot\n", BOOTPROG);
for (;;)
@@ -534,6 +536,9 @@ main(void)
}
 }
 
+primary_spa = spa;
+primary_vdev = spa_get_primary_vdev(spa);
+
 if (zfs_spa_init(spa) != 0 || zfs_mount(spa, 0, &zfsmount) != 0) {
printf("%s: failed to mount default pool %s\n",
BOOTPROG, spa->spa_name);
@@ -702,6 +707,11 @@ load(void)
 zfsargs.size = sizeof(zfsargs);
 zfsargs.pool = zfsmount.spa->spa_guid;
 zfsargs.root = zfsmount.rootobj;
+zfsargs.primary_pool = primary_spa->spa_guid;
+if (primary_vdev != NULL)
+   zfsargs.primary_vdev = primary_vdev->v_guid;
+else
+   printf("failed to detect primary vdev\n");
 __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK),
   bootdev,
   KARGS_FLAGS_ZFS | KARGS_FLAGS_EXTARG,

Modified: stable/9/sys/boot/zfs/libzfs.h
==
--- stable/9/sys/boot/zfs/libzfs.h  Sun Oct 28 16:06:55 2012
(r242240)
+++ stable/9/sys/boot/zfs/libzfs.h  Sun Oct 28 16:10:03 2012
(r242241)
@@ -53,6 +53,8 @@ struct zfs_boot_args
 uint32_t   reserved;
 uint64_t   pool;
 uint64_t   root;
+uint64_t   primary_pool;
+uint64_t   primary_vdev;
 };
 
 intzfs_parsedev(struct zfs_devdesc *dev, const char *devspec,

Modified: stable/9/sys/boot/zfs/zfsimpl.c
==
--- stable/9/sys/boot/zfs/zfsimpl.c Sun Oct 28 16:06:55 2012
(r242240)
+++ stable/9/sys/boot/zfs/zfsimpl.c Sun Oct 28 16:10:03 2012
(r242241)
@@ -648,6 +648,34 @@ spa_find_by_name(const char *name)
return (0);
 }
 
+#ifdef BOOT2
+static spa_t *
+spa_get_primary(void)
+{
+
+   return (STAILQ_FIRST(&zfs_pools));
+}
+
+static vdev_t *
+spa_get_primary_vdev(const spa_t *spa)
+{
+   vdev_t *vdev;
+   vdev_t *kid;
+
+   if (spa == NULL)
+   spa = spa_get_primary();
+   if (spa == NULL)
+   return (NULL);
+   vdev = STAILQ_FIRST(&spa->spa_vdevs);
+   if (vdev == NULL)
+   return (NULL);
+   for (kid = STAILQ_FIRST(&vdev->v_

svn commit: r242240 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 16:06:55 2012
New Revision: 242240
URL: http://svn.freebsd.org/changeset/base/242240

Log:
  MFC r241628: zfs: make use of getnewvnode_reserve in zfs_mknode and zfs_zget

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Oct 
28 15:59:30 2012(r242239)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sun Oct 
28 16:06:55 2012(r242240)
@@ -855,6 +855,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d
}
}
 
+   getnewvnode_reserve(1);
ZFS_OBJ_HOLD_ENTER(zfsvfs, obj);
VERIFY(0 == sa_buf_hold(zfsvfs->z_os, obj, NULL, &db));
 
@@ -1041,6 +1042,7 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d
KASSERT(err == 0, ("insmntque() failed: error %d", err));
}
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj);
+   getnewvnode_drop_reserve();
 }
 
 /*
@@ -1151,12 +1153,14 @@ zfs_zget(zfsvfs_t *zfsvfs, uint64_t obj_
 
*zpp = NULL;
 
+   getnewvnode_reserve(1);
 again:
ZFS_OBJ_HOLD_ENTER(zfsvfs, obj_num);
 
err = sa_buf_hold(zfsvfs->z_os, obj_num, NULL, &db);
if (err) {
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
+   getnewvnode_drop_reserve();
return (err);
}
 
@@ -1167,6 +1171,7 @@ again:
doi.doi_bonus_size < sizeof (znode_phys_t {
sa_buf_rele(db, NULL);
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
+   getnewvnode_drop_reserve();
return (EINVAL);
}
 
@@ -1230,6 +1235,7 @@ again:
sa_buf_rele(db, NULL);
mutex_exit(&zp->z_lock);
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
+   getnewvnode_drop_reserve();
return (err);
}
 
@@ -1265,6 +1271,7 @@ again:
}
}
ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num);
+   getnewvnode_drop_reserve();
return (err);
 }
 
___
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: r242239 - stable/8/sbin/devd

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:59:30 2012
New Revision: 242239
URL: http://svn.freebsd.org/changeset/base/242239

Log:
  MFC r241772: document acpi_cpu devd notification about _CST change

Modified:
  stable/8/sbin/devd/devd.conf.5
Directory Properties:
  stable/8/sbin/devd/   (props changed)

Modified: stable/8/sbin/devd/devd.conf.5
==
--- stable/8/sbin/devd/devd.conf.5  Sun Oct 28 15:59:17 2012
(r242238)
+++ stable/8/sbin/devd/devd.conf.5  Sun Oct 28 15:59:30 2012
(r242239)
@@ -320,6 +320,8 @@ Button state ($notify=0x00 is power, 0x0
 Battery events.
 .It Li Lid
 Lid state ($notify=0x00 is closed, 0x01 is open).
+.It Li PROCESSOR
+Processor state/configuration ($notify=0x81 is a change in available Cx 
states).
 .It Li Thermal
 Thermal zone events.
 .El
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242238 - stable/9/sbin/devd

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:59:17 2012
New Revision: 242238
URL: http://svn.freebsd.org/changeset/base/242238

Log:
  MFC r241772: document acpi_cpu devd notification about _CST change

Modified:
  stable/9/sbin/devd/devd.conf.5
Directory Properties:
  stable/9/sbin/devd/   (props changed)

Modified: stable/9/sbin/devd/devd.conf.5
==
--- stable/9/sbin/devd/devd.conf.5  Sun Oct 28 15:56:53 2012
(r242237)
+++ stable/9/sbin/devd/devd.conf.5  Sun Oct 28 15:59:17 2012
(r242238)
@@ -319,6 +319,8 @@ Button state ($notify=0x00 is power, 0x0
 Battery events.
 .It Li Lid
 Lid state ($notify=0x00 is closed, 0x01 is open).
+.It Li PROCESSOR
+Processor state/configuration ($notify=0x81 is a change in available Cx 
states).
 .It Li Thermal
 Thermal zone events.
 .El
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242237 - stable/8/sys/dev/acpi_support

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:56:53 2012
New Revision: 242237
URL: http://svn.freebsd.org/changeset/base/242237

Log:
  MFC r241537: acpi_wmi: move wmi_info_list into sc

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

Modified: stable/8/sys/dev/acpi_support/acpi_wmi.c
==
--- stable/8/sys/dev/acpi_support/acpi_wmi.cSun Oct 28 15:56:36 2012
(r242236)
+++ stable/8/sys/dev/acpi_support/acpi_wmi.cSun Oct 28 15:56:53 2012
(r242237)
@@ -74,6 +74,7 @@ struct acpi_wmi_softc {
struct sbuf wmistat_sbuf;   /* sbuf for /dev/wmistat output */
pid_t   wmistat_open_pid; /* pid operating on /dev/wmistat */
int wmistat_bufptr; /* /dev/wmistat ptr to buffer position 
*/
+   TAILQ_HEAD(wmi_info_list_head, wmi_info) wmi_info_list;
 };
 
 /*
@@ -105,8 +106,6 @@ struct wmi_info {
void*event_handler_user_data; /* ev handler cookie  
*/
 };
 
-TAILQ_HEAD(wmi_info_list_head, wmi_info)
-wmi_info_list = TAILQ_HEAD_INITIALIZER(wmi_info_list);
 
 ACPI_SERIAL_DECL(acpi_wmi, "ACPI-WMI Mapping");
 
@@ -144,13 +143,13 @@ static ACPI_STATUSacpi_wmi_ec_handler(U
UINT64 *value, void *context,
void *region_context);
 /* helpers */
-static ACPI_STATUS acpi_wmi_read_wdg_blocks(ACPI_HANDLE h);
+static ACPI_STATUS acpi_wmi_read_wdg_blocks(struct acpi_wmi_softc *sc, 
ACPI_HANDLE h);
 static ACPI_STATUS acpi_wmi_toggle_we_event_generation(device_t dev,
struct wmi_info *winfo,
enum event_generation_state state);
 static int acpi_wmi_guid_string_to_guid(const UINT8 *guid_string,
UINT8 *guid);
-static struct wmi_info* acpi_wmi_lookup_wmi_info_by_guid_string(
+static struct wmi_info* acpi_wmi_lookup_wmi_info_by_guid_string(struct 
acpi_wmi_softc *sc,
const char *guid_string);
 
 static d_open_t acpi_wmi_wmistat_open;
@@ -238,7 +237,7 @@ acpi_wmi_attach(device_t dev)
ACPI_SERIAL_BEGIN(acpi_wmi);
sc->wmi_dev = dev;
sc->wmi_handle = acpi_get_handle(dev);
-   TAILQ_INIT(&wmi_info_list);
+   TAILQ_INIT(&sc->wmi_info_list);
/* XXX Only works with one EC, but nearly all systems only have one. */
if ((sc->ec_dev = devclass_get_device(devclass_find("acpi_ec"), 0))
== NULL)
@@ -254,7 +253,7 @@ acpi_wmi_attach(device_t dev)
AcpiFormatException(status));
AcpiRemoveNotifyHandler(sc->wmi_handle, ACPI_DEVICE_NOTIFY,
acpi_wmi_notify_handler);
-   } else if (ACPI_FAILURE((status = acpi_wmi_read_wdg_blocks(
+   } else if (ACPI_FAILURE((status = acpi_wmi_read_wdg_blocks(sc,
sc->wmi_handle {
device_printf(sc->wmi_dev, "couldn't parse _WDG - %s\n",
AcpiFormatException(status));
@@ -305,11 +304,11 @@ acpi_wmi_detach(device_t dev)
acpi_wmi_notify_handler);
AcpiRemoveAddressSpaceHandler(sc->wmi_handle,
ACPI_ADR_SPACE_EC, acpi_wmi_ec_handler);
-   TAILQ_FOREACH_SAFE(winfo, &wmi_info_list, wmi_list, tmp) {
+   TAILQ_FOREACH_SAFE(winfo, &sc->wmi_info_list, wmi_list, tmp) {
if (winfo->event_handler)
acpi_wmi_toggle_we_event_generation(dev,
winfo, EVENT_GENERATION_OFF);
-   TAILQ_REMOVE(&wmi_info_list, winfo, wmi_list);
+   TAILQ_REMOVE(&sc->wmi_info_list, winfo, wmi_list);
free(winfo, M_ACPIWMI);
}
if (sc->wmistat_bufptr != -1) {
@@ -334,12 +333,14 @@ acpi_wmi_detach(device_t dev)
 static int
 acpi_wmi_provides_guid_string_method(device_t dev, const char *guid_string)
 {
+   struct acpi_wmi_softc *sc;
struct wmi_info *winfo;
int ret;
 
+   sc = device_get_softc(dev);
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
ACPI_SERIAL_BEGIN(acpi_wmi);
-   winfo = acpi_wmi_lookup_wmi_info_by_guid_string(guid_string);
+   winfo = acpi_wmi_lookup_wmi_info_by_guid_string(sc, guid_string);
ret = (winfo == NULL)?0:winfo->ginfo.max_instance+1;
ACPI_SERIAL_END(acpi_wmi);
 
@@ -365,7 +366,7 @@ acpi_wmi_evaluate_call_method(device_t d
 
sc = device_get_softc(dev);
ACPI_SERIAL_BEGIN(acpi_wmi);
-   if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(guid_string))
+   if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(sc, guid_string))
== NULL)
status = AE_NOT_FOUND;
else if (!(winfo->ginfo.flags 

svn commit: r242236 - stable/9/sys/dev/acpi_support

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:56:36 2012
New Revision: 242236
URL: http://svn.freebsd.org/changeset/base/242236

Log:
  MFC r241537: acpi_wmi: move wmi_info_list into sc

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

Modified: stable/9/sys/dev/acpi_support/acpi_wmi.c
==
--- stable/9/sys/dev/acpi_support/acpi_wmi.cSun Oct 28 15:54:15 2012
(r242235)
+++ stable/9/sys/dev/acpi_support/acpi_wmi.cSun Oct 28 15:56:36 2012
(r242236)
@@ -74,6 +74,7 @@ struct acpi_wmi_softc {
struct sbuf wmistat_sbuf;   /* sbuf for /dev/wmistat output */
pid_t   wmistat_open_pid; /* pid operating on /dev/wmistat */
int wmistat_bufptr; /* /dev/wmistat ptr to buffer position 
*/
+   TAILQ_HEAD(wmi_info_list_head, wmi_info) wmi_info_list;
 };
 
 /*
@@ -105,8 +106,6 @@ struct wmi_info {
void*event_handler_user_data; /* ev handler cookie  
*/
 };
 
-TAILQ_HEAD(wmi_info_list_head, wmi_info)
-wmi_info_list = TAILQ_HEAD_INITIALIZER(wmi_info_list);
 
 ACPI_SERIAL_DECL(acpi_wmi, "ACPI-WMI Mapping");
 
@@ -144,13 +143,13 @@ static ACPI_STATUSacpi_wmi_ec_handler(U
UINT64 *value, void *context,
void *region_context);
 /* helpers */
-static ACPI_STATUS acpi_wmi_read_wdg_blocks(ACPI_HANDLE h);
+static ACPI_STATUS acpi_wmi_read_wdg_blocks(struct acpi_wmi_softc *sc, 
ACPI_HANDLE h);
 static ACPI_STATUS acpi_wmi_toggle_we_event_generation(device_t dev,
struct wmi_info *winfo,
enum event_generation_state state);
 static int acpi_wmi_guid_string_to_guid(const UINT8 *guid_string,
UINT8 *guid);
-static struct wmi_info* acpi_wmi_lookup_wmi_info_by_guid_string(
+static struct wmi_info* acpi_wmi_lookup_wmi_info_by_guid_string(struct 
acpi_wmi_softc *sc,
const char *guid_string);
 
 static d_open_t acpi_wmi_wmistat_open;
@@ -238,7 +237,7 @@ acpi_wmi_attach(device_t dev)
ACPI_SERIAL_BEGIN(acpi_wmi);
sc->wmi_dev = dev;
sc->wmi_handle = acpi_get_handle(dev);
-   TAILQ_INIT(&wmi_info_list);
+   TAILQ_INIT(&sc->wmi_info_list);
/* XXX Only works with one EC, but nearly all systems only have one. */
if ((sc->ec_dev = devclass_get_device(devclass_find("acpi_ec"), 0))
== NULL)
@@ -254,7 +253,7 @@ acpi_wmi_attach(device_t dev)
AcpiFormatException(status));
AcpiRemoveNotifyHandler(sc->wmi_handle, ACPI_DEVICE_NOTIFY,
acpi_wmi_notify_handler);
-   } else if (ACPI_FAILURE((status = acpi_wmi_read_wdg_blocks(
+   } else if (ACPI_FAILURE((status = acpi_wmi_read_wdg_blocks(sc,
sc->wmi_handle {
device_printf(sc->wmi_dev, "couldn't parse _WDG - %s\n",
AcpiFormatException(status));
@@ -305,11 +304,11 @@ acpi_wmi_detach(device_t dev)
acpi_wmi_notify_handler);
AcpiRemoveAddressSpaceHandler(sc->wmi_handle,
ACPI_ADR_SPACE_EC, acpi_wmi_ec_handler);
-   TAILQ_FOREACH_SAFE(winfo, &wmi_info_list, wmi_list, tmp) {
+   TAILQ_FOREACH_SAFE(winfo, &sc->wmi_info_list, wmi_list, tmp) {
if (winfo->event_handler)
acpi_wmi_toggle_we_event_generation(dev,
winfo, EVENT_GENERATION_OFF);
-   TAILQ_REMOVE(&wmi_info_list, winfo, wmi_list);
+   TAILQ_REMOVE(&sc->wmi_info_list, winfo, wmi_list);
free(winfo, M_ACPIWMI);
}
if (sc->wmistat_bufptr != -1) {
@@ -334,12 +333,14 @@ acpi_wmi_detach(device_t dev)
 static int
 acpi_wmi_provides_guid_string_method(device_t dev, const char *guid_string)
 {
+   struct acpi_wmi_softc *sc;
struct wmi_info *winfo;
int ret;
 
+   sc = device_get_softc(dev);
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
ACPI_SERIAL_BEGIN(acpi_wmi);
-   winfo = acpi_wmi_lookup_wmi_info_by_guid_string(guid_string);
+   winfo = acpi_wmi_lookup_wmi_info_by_guid_string(sc, guid_string);
ret = (winfo == NULL)?0:winfo->ginfo.max_instance+1;
ACPI_SERIAL_END(acpi_wmi);
 
@@ -365,7 +366,7 @@ acpi_wmi_evaluate_call_method(device_t d
 
sc = device_get_softc(dev);
ACPI_SERIAL_BEGIN(acpi_wmi);
-   if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(guid_string))
+   if ((winfo = acpi_wmi_lookup_wmi_info_by_guid_string(sc, guid_string))
== NULL)
status = AE_NOT_FOUND;
else if (!(winfo->ginfo.flags & ACPI_WMI_REGFLAG_METHOD))
@@ -407,6 +408,7 @@ sta

svn commit: r242235 - stable/8/sys/boot/zfs

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:54:15 2012
New Revision: 242235
URL: http://svn.freebsd.org/changeset/base/242235

Log:
  MFC r241292: zfs loader: treat plain pool name as a name of its root
  dataset

Modified:
  stable/8/sys/boot/zfs/zfs.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/boot/   (props changed)

Modified: stable/8/sys/boot/zfs/zfs.c
==
--- stable/8/sys/boot/zfs/zfs.c Sun Oct 28 15:54:01 2012(r242234)
+++ stable/8/sys/boot/zfs/zfs.c Sun Oct 28 15:54:15 2012(r242235)
@@ -533,12 +533,9 @@ zfs_parsedev(struct zfs_devdesc *dev, co
if (!spa)
return (ENXIO);
dev->pool_guid = spa->spa_guid;
-   if (rootname[0] != '\0') {
-   rv = zfs_lookup_dataset(spa, rootname, &dev->root_guid);
-   if (rv != 0)
-   return (rv);
-   } else
-   dev->root_guid = 0;
+   rv = zfs_lookup_dataset(spa, rootname, &dev->root_guid);
+   if (rv != 0)
+   return (rv);
if (path != NULL)
*path = (*end == '\0') ? end : end + 1;
dev->d_dev = &zfs_dev;
@@ -558,9 +555,10 @@ zfs_fmtdev(void *vdev)
if (dev->d_type != DEVT_ZFS)
return (buf);
 
-   if (dev->pool_guid == 0)
+   if (dev->pool_guid == 0) {
spa = STAILQ_FIRST(&zfs_pools);
-   else
+   dev->pool_guid = spa->spa_guid;
+   } else
spa = spa_find_by_guid(dev->pool_guid);
if (spa == NULL) {
printf("ZFS: can't find pool by guid\n");
@@ -598,19 +596,17 @@ zfs_list(const char *name)
if (dsname != NULL) {
len = dsname - name;
dsname++;
-   }
+   } else
+   dsname = "";
memcpy(poolname, name, len);
poolname[len] = '\0';
 
spa = spa_find_by_name(poolname);
if (!spa)
return (ENXIO);
-   if (dsname != NULL)
-   rv = zfs_lookup_dataset(spa, dsname, &objid);
-   else
-   rv = zfs_get_root(spa, &objid);
+   rv = zfs_lookup_dataset(spa, dsname, &objid);
if (rv != 0)
return (rv);
rv = zfs_list_dataset(spa, objid);
-   return (0);
+   return (rv);
 }
___
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: r242234 - stable/9/sys/boot/zfs

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:54:01 2012
New Revision: 242234
URL: http://svn.freebsd.org/changeset/base/242234

Log:
  MFC r241292: zfs loader: treat plain pool name as a name of its root
  dataset

Modified:
  stable/9/sys/boot/zfs/zfs.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/zfs/zfs.c
==
--- stable/9/sys/boot/zfs/zfs.c Sun Oct 28 15:51:15 2012(r242233)
+++ stable/9/sys/boot/zfs/zfs.c Sun Oct 28 15:54:01 2012(r242234)
@@ -533,12 +533,9 @@ zfs_parsedev(struct zfs_devdesc *dev, co
if (!spa)
return (ENXIO);
dev->pool_guid = spa->spa_guid;
-   if (rootname[0] != '\0') {
-   rv = zfs_lookup_dataset(spa, rootname, &dev->root_guid);
-   if (rv != 0)
-   return (rv);
-   } else
-   dev->root_guid = 0;
+   rv = zfs_lookup_dataset(spa, rootname, &dev->root_guid);
+   if (rv != 0)
+   return (rv);
if (path != NULL)
*path = (*end == '\0') ? end : end + 1;
dev->d_dev = &zfs_dev;
@@ -558,9 +555,10 @@ zfs_fmtdev(void *vdev)
if (dev->d_type != DEVT_ZFS)
return (buf);
 
-   if (dev->pool_guid == 0)
+   if (dev->pool_guid == 0) {
spa = STAILQ_FIRST(&zfs_pools);
-   else
+   dev->pool_guid = spa->spa_guid;
+   } else
spa = spa_find_by_guid(dev->pool_guid);
if (spa == NULL) {
printf("ZFS: can't find pool by guid\n");
@@ -598,19 +596,17 @@ zfs_list(const char *name)
if (dsname != NULL) {
len = dsname - name;
dsname++;
-   }
+   } else
+   dsname = "";
memcpy(poolname, name, len);
poolname[len] = '\0';
 
spa = spa_find_by_name(poolname);
if (!spa)
return (ENXIO);
-   if (dsname != NULL)
-   rv = zfs_lookup_dataset(spa, dsname, &objid);
-   else
-   rv = zfs_get_root(spa, &objid);
+   rv = zfs_lookup_dataset(spa, dsname, &objid);
if (rv != 0)
return (rv);
rv = zfs_list_dataset(spa, objid);
-   return (0);
+   return (rv);
 }
___
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: r242233 - stable/8/sys/boot/i386/loader

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:51:15 2012
New Revision: 242233
URL: http://svn.freebsd.org/changeset/base/242233

Log:
  MFC r241284: zfs boot: add lszfs command to i386 loader

Modified:
  stable/8/sys/boot/i386/loader/main.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/boot/   (props changed)

Modified: stable/8/sys/boot/i386/loader/main.c
==
--- stable/8/sys/boot/i386/loader/main.cSun Oct 28 15:51:00 2012
(r242232)
+++ stable/8/sys/boot/i386/loader/main.cSun Oct 28 15:51:15 2012
(r242233)
@@ -322,6 +322,29 @@ command_heap(int argc, char *argv[])
 return(CMD_OK);
 }
 
+#ifdef LOADER_ZFS_SUPPORT
+COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset",
+command_lszfs);
+
+static int
+command_lszfs(int argc, char *argv[])
+{
+int err;
+
+if (argc != 2) {
+   command_errmsg = "wrong number of arguments";
+   return (CMD_ERROR);
+}
+
+err = zfs_list(argv[1]);
+if (err != 0) {
+   command_errmsg = strerror(err);
+   return (CMD_ERROR);
+}
+return (CMD_OK);
+}
+#endif
+
 /* ISA bus access functions for PnP. */
 static int
 isa_inb(int port)
___
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: r242232 - stable/9/sys/boot/i386/loader

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:51:00 2012
New Revision: 242232
URL: http://svn.freebsd.org/changeset/base/242232

Log:
  MFC r241284: zfs boot: add lszfs command to i386 loader

Modified:
  stable/9/sys/boot/i386/loader/main.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/i386/loader/main.c
==
--- stable/9/sys/boot/i386/loader/main.cSun Oct 28 15:48:15 2012
(r242231)
+++ stable/9/sys/boot/i386/loader/main.cSun Oct 28 15:51:00 2012
(r242232)
@@ -322,6 +322,29 @@ command_heap(int argc, char *argv[])
 return(CMD_OK);
 }
 
+#ifdef LOADER_ZFS_SUPPORT
+COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset",
+command_lszfs);
+
+static int
+command_lszfs(int argc, char *argv[])
+{
+int err;
+
+if (argc != 2) {
+   command_errmsg = "wrong number of arguments";
+   return (CMD_ERROR);
+}
+
+err = zfs_list(argv[1]);
+if (err != 0) {
+   command_errmsg = strerror(err);
+   return (CMD_ERROR);
+}
+return (CMD_OK);
+}
+#endif
+
 /* ISA bus access functions for PnP. */
 static int
 isa_inb(int port)
___
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: r242231 - stable/8/sys/boot/zfs

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:48:15 2012
New Revision: 242231
URL: http://svn.freebsd.org/changeset/base/242231

Log:
  MFC r241289: boot/zfs: call zfs_spa_init for all found pools

Modified:
  stable/8/sys/boot/zfs/zfs.c
  stable/8/sys/boot/zfs/zfsimpl.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/boot/   (props changed)

Modified: stable/8/sys/boot/zfs/zfs.c
==
--- stable/8/sys/boot/zfs/zfs.c Sun Oct 28 15:47:56 2012(r242230)
+++ stable/8/sys/boot/zfs/zfs.c Sun Oct 28 15:48:15 2012(r242231)
@@ -369,10 +369,28 @@ vdev_read(vdev_t *vdev, void *priv, off_
 static int
 zfs_dev_init(void)
 {
+   spa_t *spa;
+   spa_t *next;
+   spa_t *prev;
+
zfs_init();
if (archsw.arch_zfs_probe == NULL)
return (ENXIO);
archsw.arch_zfs_probe();
+
+   prev = NULL;
+   spa = STAILQ_FIRST(&zfs_pools);
+   while (spa != NULL) {
+   next = STAILQ_NEXT(spa, spa_link);
+   if (zfs_spa_init(spa)) {
+   if (prev == NULL)
+   STAILQ_REMOVE_HEAD(&zfs_pools, spa_link);
+   else
+   STAILQ_REMOVE_AFTER(&zfs_pools, prev, spa_link);
+   } else
+   prev = spa;
+   spa = next;
+   }
return (0);
 }
 
@@ -435,9 +453,6 @@ zfs_dev_open(struct open_file *f, ...)
spa = spa_find_by_guid(dev->pool_guid);
if (!spa)
return (ENXIO);
-   rv = zfs_spa_init(spa);
-   if (rv != 0)
-   return (rv);
mount = malloc(sizeof(*mount));
rv = zfs_mount(spa, dev->root_guid, mount);
if (rv != 0) {
@@ -517,9 +532,6 @@ zfs_parsedev(struct zfs_devdesc *dev, co
spa = spa_find_by_name(poolname);
if (!spa)
return (ENXIO);
-   rv = zfs_spa_init(spa);
-   if (rv != 0)
-   return (rv);
dev->pool_guid = spa->spa_guid;
if (rootname[0] != '\0') {
rv = zfs_lookup_dataset(spa, rootname, &dev->root_guid);
@@ -554,10 +566,6 @@ zfs_fmtdev(void *vdev)
printf("ZFS: can't find pool by guid\n");
return (buf);
}
-   if (zfs_spa_init(spa) != 0) {
-   printf("ZFS: can't init pool\n");
-   return (buf);
-   }
if (dev->root_guid == 0 && zfs_get_root(spa, &dev->root_guid)) {
printf("ZFS: can't find root filesystem\n");
return (buf);
@@ -597,9 +605,6 @@ zfs_list(const char *name)
spa = spa_find_by_name(poolname);
if (!spa)
return (ENXIO);
-   rv = zfs_spa_init(spa);
-   if (rv != 0)
-   return (rv);
if (dsname != NULL)
rv = zfs_lookup_dataset(spa, dsname, &objid);
else

Modified: stable/8/sys/boot/zfs/zfsimpl.c
==
--- stable/8/sys/boot/zfs/zfsimpl.c Sun Oct 28 15:47:56 2012
(r242230)
+++ stable/8/sys/boot/zfs/zfsimpl.c Sun Oct 28 15:48:15 2012
(r242231)
@@ -1826,13 +1826,14 @@ static int
 zfs_spa_init(spa_t *spa)
 {
 
-   if (spa->spa_inited)
-   return (0);
if (zio_read(spa, &spa->spa_uberblock.ub_rootbp, &spa->spa_mos)) {
printf("ZFS: can't read MOS of pool %s\n", spa->spa_name);
return (EIO);
}
-   spa->spa_inited = 1;
+   if (spa->spa_mos.os_type != DMU_OST_META) {
+   printf("ZFS: corrupted MOS of pool %s\n", spa->spa_name);
+   return (EIO);
+   }
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242230 - stable/9/sys/boot/zfs

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:47:56 2012
New Revision: 242230
URL: http://svn.freebsd.org/changeset/base/242230

Log:
  MFC r241289: boot/zfs: call zfs_spa_init for all found pools

Modified:
  stable/9/sys/boot/zfs/zfs.c
  stable/9/sys/boot/zfs/zfsimpl.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/zfs/zfs.c
==
--- stable/9/sys/boot/zfs/zfs.c Sun Oct 28 15:45:18 2012(r242229)
+++ stable/9/sys/boot/zfs/zfs.c Sun Oct 28 15:47:56 2012(r242230)
@@ -369,10 +369,28 @@ vdev_read(vdev_t *vdev, void *priv, off_
 static int
 zfs_dev_init(void)
 {
+   spa_t *spa;
+   spa_t *next;
+   spa_t *prev;
+
zfs_init();
if (archsw.arch_zfs_probe == NULL)
return (ENXIO);
archsw.arch_zfs_probe();
+
+   prev = NULL;
+   spa = STAILQ_FIRST(&zfs_pools);
+   while (spa != NULL) {
+   next = STAILQ_NEXT(spa, spa_link);
+   if (zfs_spa_init(spa)) {
+   if (prev == NULL)
+   STAILQ_REMOVE_HEAD(&zfs_pools, spa_link);
+   else
+   STAILQ_REMOVE_AFTER(&zfs_pools, prev, spa_link);
+   } else
+   prev = spa;
+   spa = next;
+   }
return (0);
 }
 
@@ -435,9 +453,6 @@ zfs_dev_open(struct open_file *f, ...)
spa = spa_find_by_guid(dev->pool_guid);
if (!spa)
return (ENXIO);
-   rv = zfs_spa_init(spa);
-   if (rv != 0)
-   return (rv);
mount = malloc(sizeof(*mount));
rv = zfs_mount(spa, dev->root_guid, mount);
if (rv != 0) {
@@ -517,9 +532,6 @@ zfs_parsedev(struct zfs_devdesc *dev, co
spa = spa_find_by_name(poolname);
if (!spa)
return (ENXIO);
-   rv = zfs_spa_init(spa);
-   if (rv != 0)
-   return (rv);
dev->pool_guid = spa->spa_guid;
if (rootname[0] != '\0') {
rv = zfs_lookup_dataset(spa, rootname, &dev->root_guid);
@@ -554,10 +566,6 @@ zfs_fmtdev(void *vdev)
printf("ZFS: can't find pool by guid\n");
return (buf);
}
-   if (zfs_spa_init(spa) != 0) {
-   printf("ZFS: can't init pool\n");
-   return (buf);
-   }
if (dev->root_guid == 0 && zfs_get_root(spa, &dev->root_guid)) {
printf("ZFS: can't find root filesystem\n");
return (buf);
@@ -597,9 +605,6 @@ zfs_list(const char *name)
spa = spa_find_by_name(poolname);
if (!spa)
return (ENXIO);
-   rv = zfs_spa_init(spa);
-   if (rv != 0)
-   return (rv);
if (dsname != NULL)
rv = zfs_lookup_dataset(spa, dsname, &objid);
else

Modified: stable/9/sys/boot/zfs/zfsimpl.c
==
--- stable/9/sys/boot/zfs/zfsimpl.c Sun Oct 28 15:45:18 2012
(r242229)
+++ stable/9/sys/boot/zfs/zfsimpl.c Sun Oct 28 15:47:56 2012
(r242230)
@@ -1826,13 +1826,14 @@ static int
 zfs_spa_init(spa_t *spa)
 {
 
-   if (spa->spa_inited)
-   return (0);
if (zio_read(spa, &spa->spa_uberblock.ub_rootbp, &spa->spa_mos)) {
printf("ZFS: can't read MOS of pool %s\n", spa->spa_name);
return (EIO);
}
-   spa->spa_inited = 1;
+   if (spa->spa_mos.os_type != DMU_OST_META) {
+   printf("ZFS: corrupted MOS of pool %s\n", spa->spa_name);
+   return (EIO);
+   }
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242229 - stable/9/sys/boot/zfs

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:45:18 2012
New Revision: 242229
URL: http://svn.freebsd.org/changeset/base/242229

Log:
  MFC r241283: zfs boot: add code for listing child datasets of a given
  dataset

Modified:
  stable/9/sys/boot/zfs/libzfs.h
  stable/9/sys/boot/zfs/zfs.c
  stable/9/sys/boot/zfs/zfsimpl.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/zfs/libzfs.h
==
--- stable/9/sys/boot/zfs/libzfs.h  Sun Oct 28 15:45:15 2012
(r242228)
+++ stable/9/sys/boot/zfs/libzfs.h  Sun Oct 28 15:45:18 2012
(r242229)
@@ -59,6 +59,7 @@ int   zfs_parsedev(struct zfs_devdesc *dev
 const char **path);
 char   *zfs_fmtdev(void *vdev);
 intzfs_probe_dev(const char *devname, uint64_t *pool_guid);
+intzfs_list(const char *name);
 
 extern struct devsw zfs_dev;
 extern struct fs_ops zfs_fsops;

Modified: stable/9/sys/boot/zfs/zfs.c
==
--- stable/9/sys/boot/zfs/zfs.c Sun Oct 28 15:45:15 2012(r242228)
+++ stable/9/sys/boot/zfs/zfs.c Sun Oct 28 15:45:18 2012(r242229)
@@ -574,3 +574,38 @@ zfs_fmtdev(void *vdev)
rootname);
return (buf);
 }
+
+int
+zfs_list(const char *name)
+{
+   static char poolname[ZFS_MAXNAMELEN];
+   uint64_tobjid;
+   spa_t   *spa;
+   const char  *dsname;
+   int len;
+   int rv;
+
+   len = strlen(name);
+   dsname = strchr(name, '/');
+   if (dsname != NULL) {
+   len = dsname - name;
+   dsname++;
+   }
+   memcpy(poolname, name, len);
+   poolname[len] = '\0';
+
+   spa = spa_find_by_name(poolname);
+   if (!spa)
+   return (ENXIO);
+   rv = zfs_spa_init(spa);
+   if (rv != 0)
+   return (rv);
+   if (dsname != NULL)
+   rv = zfs_lookup_dataset(spa, dsname, &objid);
+   else
+   rv = zfs_get_root(spa, &objid);
+   if (rv != 0)
+   return (rv);
+   rv = zfs_list_dataset(spa, objid);
+   return (0);
+}

Modified: stable/9/sys/boot/zfs/zfsimpl.c
==
--- stable/9/sys/boot/zfs/zfsimpl.c Sun Oct 28 15:45:15 2012
(r242228)
+++ stable/9/sys/boot/zfs/zfsimpl.c Sun Oct 28 15:45:18 2012
(r242229)
@@ -1332,8 +1332,6 @@ zap_lookup(const spa_t *spa, const dnode
return (EIO);
 }
 
-#ifdef BOOT2
-
 /*
  * List a microzap directory. Assumes that the zap scratch buffer contains
  * the directory contents.
@@ -1458,8 +1456,6 @@ zap_list(const spa_t *spa, const dnode_p
return fzap_list(spa, dnode);
 }
 
-#endif
-
 static int
 objset_get_dnode(const spa_t *spa, const objset_phys_t *os, uint64_t objnum, 
dnode_phys_t *dnode)
 {
@@ -1696,6 +1692,38 @@ zfs_lookup_dataset(const spa_t *spa, con
return (0);
 }
 
+#ifndef BOOT2
+static int
+zfs_list_dataset(const spa_t *spa, uint64_t objnum/*, int pos, char *entry*/)
+{
+   uint64_t dir_obj, child_dir_zapobj;
+   dnode_phys_t child_dir_zap, dir, dataset;
+   dsl_dataset_phys_t *ds;
+   dsl_dir_phys_t *dd;
+
+   if (objset_get_dnode(spa, &spa->spa_mos, objnum, &dataset)) {
+   printf("ZFS: can't find dataset %ju\n", (uintmax_t)objnum);
+   return (EIO);
+   }
+   ds = (dsl_dataset_phys_t *) &dataset.dn_bonus;
+   dir_obj = ds->ds_dir_obj;
+
+   if (objset_get_dnode(spa, &spa->spa_mos, dir_obj, &dir)) {
+   printf("ZFS: can't find dirobj %ju\n", (uintmax_t)dir_obj);
+   return (EIO);
+   }
+   dd = (dsl_dir_phys_t *)&dir.dn_bonus;
+
+   child_dir_zapobj = dd->dd_child_dir_zapobj;
+   if (objset_get_dnode(spa, &spa->spa_mos, child_dir_zapobj, 
&child_dir_zap) != 0) {
+   printf("ZFS: can't find child zap %ju\n", (uintmax_t)dir_obj);
+   return (EIO);
+   }
+
+   return (zap_list(spa, &child_dir_zap) != 0);
+}
+#endif
+
 /*
  * Find the object set given the object number of its dataset object
  * and return its details in *objset
___
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: r242228 - stable/8/sys/boot/zfs

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:45:15 2012
New Revision: 242228
URL: http://svn.freebsd.org/changeset/base/242228

Log:
  MFC r241283: zfs boot: add code for listing child datasets of a given
  dataset

Modified:
  stable/8/sys/boot/zfs/libzfs.h
  stable/8/sys/boot/zfs/zfs.c
  stable/8/sys/boot/zfs/zfsimpl.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/boot/   (props changed)

Modified: stable/8/sys/boot/zfs/libzfs.h
==
--- stable/8/sys/boot/zfs/libzfs.h  Sun Oct 28 15:43:13 2012
(r242227)
+++ stable/8/sys/boot/zfs/libzfs.h  Sun Oct 28 15:45:15 2012
(r242228)
@@ -59,6 +59,7 @@ int   zfs_parsedev(struct zfs_devdesc *dev
 const char **path);
 char   *zfs_fmtdev(void *vdev);
 intzfs_probe_dev(const char *devname, uint64_t *pool_guid);
+intzfs_list(const char *name);
 
 extern struct devsw zfs_dev;
 extern struct fs_ops zfs_fsops;

Modified: stable/8/sys/boot/zfs/zfs.c
==
--- stable/8/sys/boot/zfs/zfs.c Sun Oct 28 15:43:13 2012(r242227)
+++ stable/8/sys/boot/zfs/zfs.c Sun Oct 28 15:45:15 2012(r242228)
@@ -574,3 +574,38 @@ zfs_fmtdev(void *vdev)
rootname);
return (buf);
 }
+
+int
+zfs_list(const char *name)
+{
+   static char poolname[ZFS_MAXNAMELEN];
+   uint64_tobjid;
+   spa_t   *spa;
+   const char  *dsname;
+   int len;
+   int rv;
+
+   len = strlen(name);
+   dsname = strchr(name, '/');
+   if (dsname != NULL) {
+   len = dsname - name;
+   dsname++;
+   }
+   memcpy(poolname, name, len);
+   poolname[len] = '\0';
+
+   spa = spa_find_by_name(poolname);
+   if (!spa)
+   return (ENXIO);
+   rv = zfs_spa_init(spa);
+   if (rv != 0)
+   return (rv);
+   if (dsname != NULL)
+   rv = zfs_lookup_dataset(spa, dsname, &objid);
+   else
+   rv = zfs_get_root(spa, &objid);
+   if (rv != 0)
+   return (rv);
+   rv = zfs_list_dataset(spa, objid);
+   return (0);
+}

Modified: stable/8/sys/boot/zfs/zfsimpl.c
==
--- stable/8/sys/boot/zfs/zfsimpl.c Sun Oct 28 15:43:13 2012
(r242227)
+++ stable/8/sys/boot/zfs/zfsimpl.c Sun Oct 28 15:45:15 2012
(r242228)
@@ -1332,8 +1332,6 @@ zap_lookup(const spa_t *spa, const dnode
return (EIO);
 }
 
-#ifdef BOOT2
-
 /*
  * List a microzap directory. Assumes that the zap scratch buffer contains
  * the directory contents.
@@ -1458,8 +1456,6 @@ zap_list(const spa_t *spa, const dnode_p
return fzap_list(spa, dnode);
 }
 
-#endif
-
 static int
 objset_get_dnode(const spa_t *spa, const objset_phys_t *os, uint64_t objnum, 
dnode_phys_t *dnode)
 {
@@ -1696,6 +1692,38 @@ zfs_lookup_dataset(const spa_t *spa, con
return (0);
 }
 
+#ifndef BOOT2
+static int
+zfs_list_dataset(const spa_t *spa, uint64_t objnum/*, int pos, char *entry*/)
+{
+   uint64_t dir_obj, child_dir_zapobj;
+   dnode_phys_t child_dir_zap, dir, dataset;
+   dsl_dataset_phys_t *ds;
+   dsl_dir_phys_t *dd;
+
+   if (objset_get_dnode(spa, &spa->spa_mos, objnum, &dataset)) {
+   printf("ZFS: can't find dataset %ju\n", (uintmax_t)objnum);
+   return (EIO);
+   }
+   ds = (dsl_dataset_phys_t *) &dataset.dn_bonus;
+   dir_obj = ds->ds_dir_obj;
+
+   if (objset_get_dnode(spa, &spa->spa_mos, dir_obj, &dir)) {
+   printf("ZFS: can't find dirobj %ju\n", (uintmax_t)dir_obj);
+   return (EIO);
+   }
+   dd = (dsl_dir_phys_t *)&dir.dn_bonus;
+
+   child_dir_zapobj = dd->dd_child_dir_zapobj;
+   if (objset_get_dnode(spa, &spa->spa_mos, child_dir_zapobj, 
&child_dir_zap) != 0) {
+   printf("ZFS: can't find child zap %ju\n", (uintmax_t)dir_obj);
+   return (EIO);
+   }
+
+   return (zap_list(spa, &child_dir_zap) != 0);
+}
+#endif
+
 /*
  * Find the object set given the object number of its dataset object
  * and return its details in *objset
___
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: r242227 - stable/8/sys/geom/part

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:43:13 2012
New Revision: 242227
URL: http://svn.freebsd.org/changeset/base/242227

Log:
  MFC r241296:  g_part_taste: directly destroy consumer and geom here, no
  need for withering

Modified:
  stable/8/sys/geom/part/g_part.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/geom/   (props changed)

Modified: stable/8/sys/geom/part/g_part.c
==
--- stable/8/sys/geom/part/g_part.c Sun Oct 28 15:41:14 2012
(r242226)
+++ stable/8/sys/geom/part/g_part.c Sun Oct 28 15:43:13 2012
(r242227)
@@ -1809,7 +1809,10 @@ g_part_taste(struct g_class *mp, struct 
if (error == 0)
error = g_access(cp, 1, 0, 0);
if (error != 0) {
-   g_part_wither(gp, error);
+   if (cp->provider)
+   g_detach(cp);
+   g_destroy_consumer(cp);
+   g_destroy_geom(gp);
return (NULL);
}
 
@@ -1869,7 +1872,9 @@ g_part_taste(struct g_class *mp, struct 
g_topology_lock();
root_mount_rel(rht);
g_access(cp, -1, 0, 0);
-   g_part_wither(gp, error);
+   g_detach(cp);
+   g_destroy_consumer(cp);
+   g_destroy_geom(gp);
return (NULL);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242226 - stable/9/sys/geom/part

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:41:14 2012
New Revision: 242226
URL: http://svn.freebsd.org/changeset/base/242226

Log:
  MFC r241296:  g_part_taste: directly destroy consumer and geom here, no
  need for withering

Modified:
  stable/9/sys/geom/part/g_part.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/part/g_part.c
==
--- stable/9/sys/geom/part/g_part.c Sun Oct 28 15:37:47 2012
(r242225)
+++ stable/9/sys/geom/part/g_part.c Sun Oct 28 15:41:14 2012
(r242226)
@@ -1875,7 +1875,10 @@ g_part_taste(struct g_class *mp, struct 
if (error == 0)
error = g_access(cp, 1, 0, 0);
if (error != 0) {
-   g_part_wither(gp, error);
+   if (cp->provider)
+   g_detach(cp);
+   g_destroy_consumer(cp);
+   g_destroy_geom(gp);
return (NULL);
}
 
@@ -1935,7 +1938,9 @@ g_part_taste(struct g_class *mp, struct 
g_topology_lock();
root_mount_rel(rht);
g_access(cp, -1, 0, 0);
-   g_part_wither(gp, error);
+   g_detach(cp);
+   g_destroy_consumer(cp);
+   g_destroy_geom(gp);
return (NULL);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r242225 - stable/8/sys/boot/i386/zfsboot

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:37:47 2012
New Revision: 242225
URL: http://svn.freebsd.org/changeset/base/242225

Log:
  MFC r241288: zfsboot: use the same zfs dataset naming format as loader

Modified:
  stable/8/sys/boot/i386/zfsboot/zfsboot.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/boot/   (props changed)

Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c
==
--- stable/8/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 15:37:32 2012
(r242224)
+++ stable/8/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 15:37:47 2012
(r242225)
@@ -548,7 +548,7 @@ main(void)
if (parse())
autoboot = 0;
if (!OPT_CHECK(RBX_QUIET))
-   printf("%s: %s", PATH_CONFIG, cmddup);
+   printf("%s: %s\n", PATH_CONFIG, cmddup);
/* Do not process this command twice */
*cmd = 0;
 }
@@ -572,13 +572,17 @@ main(void)
if (!autoboot || !OPT_CHECK(RBX_QUIET)) {
printf("\nFreeBSD/x86 boot\n");
if (zfs_rlookup(spa, zfsmount.rootobj, rootname) != 0)
-   printf("Default: %s:<0x%llx>:%s\n"
+   printf("Default: %s/<0x%llx>:%s\n"
   "boot: ",
   spa->spa_name, zfsmount.rootobj, kname);
-   else
-   printf("Default: %s:%s:%s\n"
+   else if (rootname[0] != '\0')
+   printf("Default: %s/%s:%s\n"
   "boot: ",
   spa->spa_name, rootname, kname);
+   else
+   printf("Default: %s:%s\n"
+  "boot: ",
+  spa->spa_name, kname);
}
if (ioctrl & IO_SERIAL)
sio_flush();
@@ -703,12 +707,46 @@ load(void)
 }
 
 static int
+zfs_mount_ds(char *dsname)
+{
+uint64_t newroot;
+spa_t *newspa;
+char *q;
+
+q = strchr(dsname, '/');
+if (q)
+   *q++ = '\0';
+newspa = spa_find_by_name(dsname);
+if (newspa == NULL) {
+   printf("\nCan't find ZFS pool %s\n", dsname);
+   return -1;
+}
+
+if (zfs_spa_init(newspa))
+   return -1;
+
+newroot = 0;
+if (q) {
+   if (zfs_lookup_dataset(newspa, q, &newroot)) {
+   printf("\nCan't find dataset %s in ZFS pool %s\n",
+   q, newspa->spa_name);
+   return -1;
+   }
+}
+if (zfs_mount(newspa, newroot, &zfsmount)) {
+   printf("\nCan't mount ZFS dataset\n");
+   return -1;
+}
+spa = newspa;
+return (0);
+}
+
+static int
 parse(void)
 {
 char *arg = cmd;
 char *ep, *p, *q;
 const char *cp;
-//unsigned int drv;
 int c, i, j;
 
 while ((c = *arg++)) {
@@ -768,37 +806,20 @@ parse(void)
}
 
/*
+* If there is "zfs:" prefix simply ignore it.
+*/
+   if (strncmp(arg, "zfs:", 4) == 0)
+   arg += 4;
+
+   /*
 * If there is a colon, switch pools.
 */
-   q = (char *) strchr(arg, ':');
+   q = strchr(arg, ':');
if (q) {
-   spa_t *newspa;
-   uint64_t newroot;
-
-   *q++ = 0;
-   newspa = spa_find_by_name(arg);
-   if (newspa) {
-   arg = q;
-   spa = newspa;
-   newroot = 0;
-   q = (char *) strchr(arg, ':');
-   if (q) {
-   *q++ = 0;
-   if (zfs_lookup_dataset(spa, arg, &newroot)) {
-   printf("\nCan't find dataset %s in ZFS pool %s\n",
-   arg, spa->spa_name);
-   return -1;
-   }
-   arg = q;
-   }
-   if (zfs_mount(spa, newroot, &zfsmount)) {
-   printf("\nCan't mount ZFS dataset\n");
-   return -1;
-   }
-   } else {
-   printf("\nCan't find ZFS pool %s\n", arg);
+   *q++ = '\0';
+   if (zfs_mount_ds(arg) != 0)
return -1;
-   }
+   arg = q;
}
if ((i = ep - arg)) {
if ((size_t)i >= sizeof(kname))
___
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: r242224 - stable/9/sys/boot/i386/zfsboot

2012-10-28 Thread Andriy Gapon
Author: avg
Date: Sun Oct 28 15:37:32 2012
New Revision: 242224
URL: http://svn.freebsd.org/changeset/base/242224

Log:
  MFC r241288: zfsboot: use the same zfs dataset naming format as loader

Modified:
  stable/9/sys/boot/i386/zfsboot/zfsboot.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/boot/   (props changed)

Modified: stable/9/sys/boot/i386/zfsboot/zfsboot.c
==
--- stable/9/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 14:37:17 2012
(r242223)
+++ stable/9/sys/boot/i386/zfsboot/zfsboot.cSun Oct 28 15:37:32 2012
(r242224)
@@ -553,7 +553,7 @@ main(void)
if (parse())
autoboot = 0;
if (!OPT_CHECK(RBX_QUIET))
-   printf("%s: %s", PATH_CONFIG, cmddup);
+   printf("%s: %s\n", PATH_CONFIG, cmddup);
/* Do not process this command twice */
*cmd = 0;
 }
@@ -577,13 +577,17 @@ main(void)
if (!autoboot || !OPT_CHECK(RBX_QUIET)) {
printf("\nFreeBSD/x86 boot\n");
if (zfs_rlookup(spa, zfsmount.rootobj, rootname) != 0)
-   printf("Default: %s:<0x%llx>:%s\n"
+   printf("Default: %s/<0x%llx>:%s\n"
   "boot: ",
   spa->spa_name, zfsmount.rootobj, kname);
-   else
-   printf("Default: %s:%s:%s\n"
+   else if (rootname[0] != '\0')
+   printf("Default: %s/%s:%s\n"
   "boot: ",
   spa->spa_name, rootname, kname);
+   else
+   printf("Default: %s:%s\n"
+  "boot: ",
+  spa->spa_name, kname);
}
if (ioctrl & IO_SERIAL)
sio_flush();
@@ -708,12 +712,46 @@ load(void)
 }
 
 static int
+zfs_mount_ds(char *dsname)
+{
+uint64_t newroot;
+spa_t *newspa;
+char *q;
+
+q = strchr(dsname, '/');
+if (q)
+   *q++ = '\0';
+newspa = spa_find_by_name(dsname);
+if (newspa == NULL) {
+   printf("\nCan't find ZFS pool %s\n", dsname);
+   return -1;
+}
+
+if (zfs_spa_init(newspa))
+   return -1;
+
+newroot = 0;
+if (q) {
+   if (zfs_lookup_dataset(newspa, q, &newroot)) {
+   printf("\nCan't find dataset %s in ZFS pool %s\n",
+   q, newspa->spa_name);
+   return -1;
+   }
+}
+if (zfs_mount(newspa, newroot, &zfsmount)) {
+   printf("\nCan't mount ZFS dataset\n");
+   return -1;
+}
+spa = newspa;
+return (0);
+}
+
+static int
 parse(void)
 {
 char *arg = cmd;
 char *ep, *p, *q;
 const char *cp;
-//unsigned int drv;
 int c, i, j;
 
 while ((c = *arg++)) {
@@ -773,37 +811,20 @@ parse(void)
}
 
/*
+* If there is "zfs:" prefix simply ignore it.
+*/
+   if (strncmp(arg, "zfs:", 4) == 0)
+   arg += 4;
+
+   /*
 * If there is a colon, switch pools.
 */
-   q = (char *) strchr(arg, ':');
+   q = strchr(arg, ':');
if (q) {
-   spa_t *newspa;
-   uint64_t newroot;
-
-   *q++ = 0;
-   newspa = spa_find_by_name(arg);
-   if (newspa) {
-   arg = q;
-   spa = newspa;
-   newroot = 0;
-   q = (char *) strchr(arg, ':');
-   if (q) {
-   *q++ = 0;
-   if (zfs_lookup_dataset(spa, arg, &newroot)) {
-   printf("\nCan't find dataset %s in ZFS pool %s\n",
-   arg, spa->spa_name);
-   return -1;
-   }
-   arg = q;
-   }
-   if (zfs_mount(spa, newroot, &zfsmount)) {
-   printf("\nCan't mount ZFS dataset\n");
-   return -1;
-   }
-   } else {
-   printf("\nCan't find ZFS pool %s\n", arg);
+   *q++ = '\0';
+   if (zfs_mount_ds(arg) != 0)
return -1;
-   }
+   arg = q;
}
if ((i = ep - arg)) {
if ((size_t)i >= sizeof(kname))
___
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: r242223 - head/sys/dev/sound/usb

2012-10-28 Thread Hans Petter Selasky
Author: hselasky
Date: Sun Oct 28 14:37:17 2012
New Revision: 242223
URL: http://svn.freebsd.org/changeset/base/242223

Log:
  Implement support for the so-called USB feedback endpoint for USB
  audio devices. This endpoint gives clues to the USB host about the
  actual data rate on asynchronous endpoints and makes the more
  expensive USB audio devices usable under FreeBSD.
  The Linux USB audio driver was used as reference for the
  automagic shift of the received value.
  
  MFC after:1 week

Modified:
  head/sys/dev/sound/usb/uaudio.c

Modified: head/sys/dev/sound/usb/uaudio.c
==
--- head/sys/dev/sound/usb/uaudio.c Sun Oct 28 13:21:35 2012
(r24)
+++ head/sys/dev/sound/usb/uaudio.c Sun Oct 28 14:37:17 2012
(r242223)
@@ -176,7 +176,7 @@ struct uaudio_chan {
struct mtx *pcm_mtx;/* lock protecting this structure */
struct uaudio_softc *priv_sc;
struct pcm_channel *pcm_ch;
-   struct usb_xfer *xfer[UAUDIO_NCHANBUFS];
+   struct usb_xfer *xfer[UAUDIO_NCHANBUFS + 1];
union uaudio_asf1d p_asf1d;
union uaudio_sed p_sed;
const usb_endpoint_descriptor_audio_t *p_ed1;
@@ -206,6 +206,12 @@ struct uaudio_chan {
uint8_t iface_index;
uint8_t iface_alt_index;
uint8_t channels;
+
+   uint8_t last_sync_time;
+   uint8_t last_sync_state;
+#defineUAUDIO_SYNC_NONE 0
+#defineUAUDIO_SYNC_MORE 1
+#defineUAUDIO_SYNC_LESS 2
 };
 
 #defineUMIDI_CABLES_MAX   16   /* units */
@@ -386,7 +392,9 @@ static device_attach_t uaudio_attach;
 static device_detach_t uaudio_detach;
 
 static usb_callback_t uaudio_chan_play_callback;
+static usb_callback_t uaudio_chan_play_sync_callback;
 static usb_callback_t uaudio_chan_record_callback;
+static usb_callback_t uaudio_chan_record_sync_callback;
 static usb_callback_t uaudio_mixer_write_cfg_callback;
 static usb_callback_t umidi_bulk_read_callback;
 static usb_callback_t umidi_bulk_write_callback;
@@ -482,7 +490,7 @@ static void uaudio_chan_dump_ep_desc(
 #endif
 
 static const struct usb_config
-   uaudio_cfg_record[UAUDIO_NCHANBUFS] = {
+   uaudio_cfg_record[UAUDIO_NCHANBUFS + 1] = {
[0] = {
.type = UE_ISOCHRONOUS,
.endpoint = UE_ADDR_ANY,
@@ -502,10 +510,20 @@ static const struct usb_config
.flags = {.short_xfer_ok = 1,},
.callback = &uaudio_chan_record_callback,
},
+
+   [2] = {
+   .type = UE_ISOCHRONOUS,
+   .endpoint = UE_ADDR_ANY,
+   .direction = UE_DIR_OUT,
+   .bufsize = 0,   /* use "wMaxPacketSize * frames" */
+   .frames = 1,
+   .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,},
+   .callback = &uaudio_chan_record_sync_callback,
+   },
 };
 
 static const struct usb_config
-   uaudio_cfg_play[UAUDIO_NCHANBUFS] = {
+   uaudio_cfg_play[UAUDIO_NCHANBUFS + 1] = {
[0] = {
.type = UE_ISOCHRONOUS,
.endpoint = UE_ADDR_ANY,
@@ -525,6 +543,16 @@ static const struct usb_config
.flags = {.short_xfer_ok = 1,},
.callback = &uaudio_chan_play_callback,
},
+
+   [2] = {
+   .type = UE_ISOCHRONOUS,
+   .endpoint = UE_ADDR_ANY,
+   .direction = UE_DIR_IN,
+   .bufsize = 0,   /* use "wMaxPacketSize * frames" */
+   .frames = 1,
+   .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,},
+   .callback = &uaudio_chan_play_sync_callback,
+   },
 };
 
 static const struct usb_config
@@ -845,9 +873,9 @@ uaudio_detach(device_t dev)
 * any.
 */
if (sc->sc_play_chan.valid)
-   usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS);
+   usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS + 
1);
if (sc->sc_rec_chan.valid)
-   usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS);
+   usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS + 
1);
 
if (bus_generic_detach(dev) != 0) {
DPRINTF("detach failed!\n");
@@ -1396,10 +1424,96 @@ done:
 }
 
 static void
+uaudio_chan_play_sync_callback(struct usb_xfer *xfer, usb_error_t error)
+{
+   struct uaudio_chan *ch = usbd_xfer_softc(xfer);
+   struct usb_page_cache *pc;
+   uint8_t buf[4];
+   uint64_t temp;
+   int len;
+   int actlen;
+   int nframes;
+
+   usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes);
+
+   switch (USB_GET_STATE(xfer)) {
+   case USB_ST_TRANSFERRED:
+
+   DPRINTFN(6, "transferred %d bytes\n", actlen);
+
+   if (nframes == 0)
+   break;
+   len = usbd_xfer_frame_len(xfer, 0);
+   if (len == 0)
+   

svn commit: r242222 - in stable/7: sys/dev/alc sys/dev/bge sys/dev/cxgb sys/dev/e1000 sys/dev/et sys/dev/jme sys/dev/pci sys/dev/re usr.sbin/pciconf

2012-10-28 Thread Gavin Atkinson
Author: gavin
Date: Sun Oct 28 13:21:35 2012
New Revision: 24
URL: http://svn.freebsd.org/changeset/base/24

Log:
  Merge r240680 from head:
  
Align the PCI Express #defines with the style used for the PCI-X
#defines.  This has the advantage that it makes the names more
compact, and also allows us to correct the non-uniform naming of
the PCIM_LINK_* defines, making them all consistent amongst themselves.
  
This is a mostly mechanical rename:
  s/PCIR_EXPRESS_/PCIER_/g
  s/PCIM_EXP_/PCIEM_/g
  s/PCIM_LINK_/PCIEM_LINK_/g
  
In this MFC, #defines have been added for the old names to assist
merges and out-of-tree drivers.

Modified:
  stable/7/sys/dev/alc/if_alc.c
  stable/7/sys/dev/bge/if_bge.c
  stable/7/sys/dev/cxgb/cxgb_main.c
  stable/7/sys/dev/cxgb/cxgb_osdep.h
  stable/7/sys/dev/e1000/if_em.c
  stable/7/sys/dev/et/if_et.c
  stable/7/sys/dev/jme/if_jme.c
  stable/7/sys/dev/pci/pci.c
  stable/7/sys/dev/pci/pcireg.h
  stable/7/sys/dev/re/if_re.c
  stable/7/usr.sbin/pciconf/cap.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/usr.sbin/pciconf/   (props changed)

Modified: stable/7/sys/dev/alc/if_alc.c
==
--- stable/7/sys/dev/alc/if_alc.c   Sun Oct 28 12:28:04 2012
(r242221)
+++ stable/7/sys/dev/alc/if_alc.c   Sun Oct 28 13:21:35 2012
(r24)
@@ -683,7 +683,7 @@ alc_aspm(struct alc_softc *sc, int media
if ((sc->alc_flags & (ALC_FLAG_APS | ALC_FLAG_PCIE)) ==
(ALC_FLAG_APS | ALC_FLAG_PCIE))
linkcfg = CSR_READ_2(sc, sc->alc_expcap +
-   PCIR_EXPRESS_LINK_CTL);
+   PCIER_LINK_CTL);
else
linkcfg = 0;
pmcfg &= ~PM_CFG_SERDES_PD_EX_L1;
@@ -698,7 +698,7 @@ alc_aspm(struct alc_softc *sc, int media
if (sc->alc_ident->deviceid == DEVICEID_ATHEROS_AR8152_B &&
sc->alc_rev == ATHEROS_AR8152_B_V10)
linkcfg |= 0x80;
-   CSR_WRITE_2(sc, sc->alc_expcap + PCIR_EXPRESS_LINK_CTL,
+   CSR_WRITE_2(sc, sc->alc_expcap + PCIER_LINK_CTL,
linkcfg);
pmcfg &= ~(PM_CFG_EN_BUFS_RX_L0S | PM_CFG_SA_DLY_ENB |
PM_CFG_HOTRST);
@@ -798,10 +798,10 @@ alc_attach(device_t dev)
if (pci_find_extcap(dev, PCIY_EXPRESS, &base) == 0) {
sc->alc_flags |= ALC_FLAG_PCIE;
sc->alc_expcap = base;
-   burst = CSR_READ_2(sc, base + PCIR_EXPRESS_DEVICE_CTL);
+   burst = CSR_READ_2(sc, base + PCIER_DEVICE_CTL);
sc->alc_dma_rd_burst =
-   (burst & PCIM_EXP_CTL_MAX_READ_REQUEST) >> 12;
-   sc->alc_dma_wr_burst = (burst & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5;
+   (burst & PCIEM_CTL_MAX_READ_REQUEST) >> 12;
+   sc->alc_dma_wr_burst = (burst & PCIEM_CTL_MAX_PAYLOAD) >> 5;
if (bootverbose) {
device_printf(dev, "Read request size : %u bytes.\n",
alc_dma_burst[sc->alc_dma_rd_burst]);
@@ -831,9 +831,9 @@ alc_attach(device_t dev)
CSR_WRITE_4(sc, ALC_PCIE_PHYMISC2, val);
}
/* Disable ASPM L0S and L1. */
-   cap = CSR_READ_2(sc, base + PCIR_EXPRESS_LINK_CAP);
-   if ((cap & PCIM_LINK_CAP_ASPM) != 0) {
-   ctl = CSR_READ_2(sc, base + PCIR_EXPRESS_LINK_CTL);
+   cap = CSR_READ_2(sc, base + PCIER_LINK_CAP);
+   if ((cap & PCIEM_LINK_CAP_ASPM) != 0) {
+   ctl = CSR_READ_2(sc, base + PCIER_LINK_CTL);
if ((ctl & 0x08) != 0)
sc->alc_rcb = DMA_CFG_RCB_128;
if (bootverbose)

Modified: stable/7/sys/dev/bge/if_bge.c
==
--- stable/7/sys/dev/bge/if_bge.c   Sun Oct 28 12:28:04 2012
(r242221)
+++ stable/7/sys/dev/bge/if_bge.c   Sun Oct 28 13:21:35 2012
(r24)
@@ -3663,19 +3663,19 @@ bge_reset(struct bge_softc *sc)
pci_write_config(dev, 0xC4, val | (1 << 15), 4);
}
devctl = pci_read_config(dev,
-   sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2);
+   sc->bge_expcap + PCIER_DEVICE_CTL, 2);
/* Clear enable no snoop and disable relaxed ordering. */
-   devctl &= ~(PCIM_EXP_CTL_RELAXED_ORD_ENABLE |
-   PCIM_EXP_CTL_NOSNOOP_ENABLE);
+   devctl &= ~(PCIEM_CTL_RELAXED_ORD_ENABLE |
+   PCIEM_CTL_NOSNOOP_ENABLE);
/* Set PCIE max payload size to 128. */
-   devctl &= ~PCIM_EXP_CTL_MAX_PAYLOAD;
-   pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL,
+   devctl &= ~PCI

svn commit: r242221 - stable/8/sys/rpc/rpcsec_gss

2012-10-28 Thread Rick Macklem
Author: rmacklem
Date: Sun Oct 28 12:28:04 2012
New Revision: 242221
URL: http://svn.freebsd.org/changeset/base/242221

Log:
  MFC: r242090
  Modify the comment to take out the names and URL.

Modified:
  stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/rpc/   (props changed)

Modified: stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
==
--- stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.cSun Oct 28 12:23:57 
2012(r242220)
+++ stable/8/sys/rpc/rpcsec_gss/svc_rpcsec_gss.cSun Oct 28 12:28:04 
2012(r242221)
@@ -1025,12 +1025,9 @@ svc_rpc_gss_validate(struct svc_rpc_gss_
rpc_gss_log_status("gss_verify_mic", client->cl_mech,
maj_stat, min_stat);
/*
-* Attila Bogar and Herbert Poeckl reported similar problems
-* w.r.t. a Linux NFS client doing a krb5 NFS mount against the
-* FreeBSD server. We determined this was a Linux bug:
-* http://www.spinics.net/lists/linux-nfs/msg32466.html, where
-* the mount failed to work because a Destroy operation with a
-* bogus encrypted checksum destroyed the authenticator handle.
+* A bug in some versions of the Linux client generates a
+* Destroy operation with a bogus encrypted checksum. Deleting
+* the credential handle for that case causes the mount to fail.
 * Since the checksum is bogus (gss_verify_mic() failed), it
 * doesn't make sense to destroy the handle and not doing so
 * fixes the Linux mount.
___
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"


  1   2   >