svn commit: r216095 - head/sbin/bsdlabel

2010-12-01 Thread Kevin Lo
Author: kevlo
Date: Wed Dec  1 08:07:32 2010
New Revision: 216095
URL: http://svn.freebsd.org/changeset/base/216095

Log:
  Closing file descriptors when it's done

Modified:
  head/sbin/bsdlabel/bsdlabel.c

Modified: head/sbin/bsdlabel/bsdlabel.c
==
--- head/sbin/bsdlabel/bsdlabel.c   Wed Dec  1 05:52:27 2010
(r216094)
+++ head/sbin/bsdlabel/bsdlabel.c   Wed Dec  1 08:07:32 2010
(r216095)
@@ -370,10 +370,12 @@ readboot(void)
p[60] = (st.st_size + secsize - 1) / secsize;
p[61] = 1;
p[62] = 0;
+   close(fd);
return;
} else if ((!alphacksum) && st.st_size <= BBSIZE) {
if (read(fd, bootarea, st.st_size) != st.st_size)
err(1, "read error %s", xxboot);
+   close(fd);
return;
}
errx(1, "boot code %s is wrong size", xxboot);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r216016 - head/sys/sparc64/include

2010-12-01 Thread Alan Cox

Marius Strobl wrote:

On Mon, Nov 29, 2010 at 08:23:08PM +0100, Marius Strobl wrote:
  

On Tue, Nov 30, 2010 at 12:31:31AM +0600, Max Khon wrote:


Marius,

On Mon, Nov 29, 2010 at 1:45 AM, Marius Strobl wrote:

On Sun, Nov 28, 2010 at 07:26:20PM +, Max Khon wrote:
  

Author: fjoe
Date: Sun Nov 28 19:26:20 2010
New Revision: 216016
URL: http://svn.freebsd.org/changeset/base/216016

Log:
  Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with
  DEBUG_MEMGUARD panics early in kmeminit() with the message
  "kmem_suballoc: bad status return of 1" because of zero "size" argument
  passed to kmem_suballoc() due to "vm_kmem_size_max" being zero.

  The problem also exists on ia64.

Modified:
  head/sys/sparc64/include/vmparam.h

Modified: head/sys/sparc64/include/vmparam.h

  

==


--- head/sys/sparc64/include/vmparam.hSun Nov 28 18:59:52 2010
  

 (r216015)


+++ head/sys/sparc64/include/vmparam.hSun Nov 28 19:26:20 2010
  

 (r216016)


@@ -237,6 +237,14 @@
 #endif

 /*
+ * Ceiling on amount of kmem_map kva space.
+ */
+#ifndef VM_KMEM_SIZE_MAX
+#define  VM_KMEM_SIZE_MAX((VM_MAX_KERNEL_ADDRESS - \
+VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5)
+#endif
+
+/*
  * Initial pagein size of beginning of executable file.
  */
 #ifndef  VM_INITIAL_PAGEIN
  

How was that value determined?



I've just copied it from amd64 to be non-zero for now. Do you have a better
idea of what it should look like?

  

Well, on sparc64 VM_MAX_KERNEL_ADDRESS already is dynamically adjusted
to the maximum appropriate for the specific CPU during the early cycles
of the kernel so I'd think one could just use VM_MAX_KERNEL_ADDRESS -
VM_MIN_KERNEL_ADDRESS for VM_KMEM_SIZE_MAX there, I'm not sure what
the intention of the ceiling provided by that macro actually is though
In any case, the commit message of r180210 which changed the amd64
version to the current one talks about limiting the kmem map to 3.6GB
and while it also fails to explain where that value comes from it
looks rather amd64 specific and the formula used by the macro will
result in a different ceiling on sparc64 and thus inappropriate. I've
CC'ed alc@ who hopefully can shed some light on this.
Apart from this the actual bug here seems to be that memguard_fudge()
can't deal with a km_max being zero or that zero is passed to it as
kmeminit() allows for VM_KMEM_SIZE_MAX not being defined.




Oops, forgot to actually CC a...@.
  


There's nothing particularly amd64-specific about the definition.  In 
general, if you allow the kmem_map, which is basically the kernel's 
heap, to consume the entire kernel address space as you propose, then 
you're leaving no room for the buffer cache, thread stacks, pipes, and a 
few other things.  Since the cap on the kmem_map size as defined by 
r180210 is a fraction of the overall kernel address space size, it 
scales automatically with the kernel address space size and should be a 
reasonable cap definition for most architectures.


In the specific case of sparc64, I think it's fair to say that the 
kernel virtual address is sufficiently large and the amount of physical 
memory in any of the supported machines is small enough in comparison 
that it hasn't mattered that a kmem_map cap doesn't exist, because most 
of the aforementioned structures are scaled based on the amount of 
physical memory.  In fact, it probably won't matter any time soon.


All of that said, I would suggest fixing memguard_fudge() and reverting 
r216016 and the follow up change.  All I think that is required to fix 
memguard_fudge() is


Index: vm/memguard.c
===
--- vm/memguard.c   (revision 216070)
+++ vm/memguard.c   (working copy)
@@ -186,7 +186,7 @@ memguard_fudge(unsigned long km_size, unsigned lon
   memguard_mapsize = round_page(memguard_mapsize);
   if (memguard_mapsize / (2 * PAGE_SIZE) > mem_pgs)
   memguard_mapsize = mem_pgs * 2 * PAGE_SIZE;
-   if (km_size + memguard_mapsize > km_max)
+   if (km_max > 0 && km_size + memguard_mapsize > km_max)
   return (km_max);
   return (km_size + memguard_mapsize);
}


Regards,
Alan

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


svn commit: r216098 - head/sys/geom/label

2010-12-01 Thread Jaakko Heinonen
Author: jh
Date: Wed Dec  1 19:24:07 2010
New Revision: 216098
URL: http://svn.freebsd.org/changeset/base/216098

Log:
  - Report an error when a label with invalid name is attempted to be
created with glabel(8).
  - Fix a typo in an error message.
  - Fix comment typos.
  
  Approved by:  pjd

Modified:
  head/sys/geom/label/g_label.c

Modified: head/sys/geom/label/g_label.c
==
--- head/sys/geom/label/g_label.c   Wed Dec  1 15:31:31 2010
(r216097)
+++ head/sys/geom/label/g_label.c   Wed Dec  1 19:24:07 2010
(r216098)
@@ -124,13 +124,13 @@ g_label_is_name_ok(const char *label)
 {
const char *s;
 
-   /* Check is the label starts from ../ */
+   /* Check if the label starts from ../ */
if (strncmp(label, "../", 3) == 0)
return (0);
-   /* Check is the label contains /../ */
+   /* Check if the label contains /../ */
if (strstr(label, "/../") != NULL)
return (0);
-   /* Check is the label ends at ../ */
+   /* Check if the label ends at ../ */
if ((s = strstr(label, "/..")) != NULL && s[3] == '\0')
return (0);
return (1);
@@ -151,6 +151,8 @@ g_label_create(struct gctl_req *req, str
G_LABEL_DEBUG(0, "%s contains suspicious label, skipping.",
pp->name);
G_LABEL_DEBUG(1, "%s suspicious label is: %s", pp->name, label);
+   if (req != NULL)
+   gctl_error(req, "Label name %s is invalid.", label);
return (NULL);
}
gp = NULL;
@@ -346,7 +348,7 @@ g_label_ctl_create(struct gctl_req *req,
return;
}
if (*nargs != 2) {
-   gctl_error(req, "Invalid number of argument.");
+   gctl_error(req, "Invalid number of arguments.");
return;
}
/*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r216099 - head/sys/ufs/ffs

2010-12-01 Thread Konstantin Belousov
Author: kib
Date: Wed Dec  1 21:19:11 2010
New Revision: 216099
URL: http://svn.freebsd.org/changeset/base/216099

Log:
  Journal start looks up .sujournal file by doing lookup on the root dvp.
  As result, failed softdep_mount() might leave up to two vnodes on the
  mp mountlist, preventing mnt_ref from going to zero.
  
  Call ffs_flushfiles() after failed softdep_mount() to clean mountlist.
  
  Initial report by:Garrett Cooper
  Reproduced and tested by: pho

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

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==
--- head/sys/ufs/ffs/ffs_vfsops.c   Wed Dec  1 19:24:07 2010
(r216098)
+++ head/sys/ufs/ffs/ffs_vfsops.c   Wed Dec  1 21:19:11 2010
(r216099)
@@ -928,6 +928,7 @@ ffs_mountfs(devvp, mp, td)
if ((fs->fs_flags & FS_DOSOFTDEP) &&
(error = softdep_mount(devvp, mp, fs, cred)) != 0) {
free(fs->fs_csp, M_UFSMNT);
+   ffs_flushfiles(mp, FORCECLOSE, td);
goto out;
}
if (fs->fs_snapinum[0] != 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r216100 - head/bin/sh

2010-12-01 Thread Jilles Tjoelker
Author: jilles
Date: Wed Dec  1 23:26:32 2010
New Revision: 216100
URL: http://svn.freebsd.org/changeset/base/216100

Log:
  sh(1): Document that command's -p option also works with -v/-V.
  
  This was implemented in r201343.

Modified:
  head/bin/sh/sh.1

Modified: head/bin/sh/sh.1
==
--- head/bin/sh/sh.1Wed Dec  1 21:19:11 2010(r216099)
+++ head/bin/sh/sh.1Wed Dec  1 23:26:32 2010(r216100)
@@ -32,7 +32,7 @@
 .\"from: @(#)sh.1  8.6 (Berkeley) 5/4/95
 .\" $FreeBSD$
 .\"
-.Dd November 19, 2010
+.Dd December 1, 2010
 .Dt SH 1
 .Os
 .Sh NAME
@@ -1712,7 +1712,8 @@ A synonym for the
 .Ic cd
 built-in command.
 .It Ic command Oo Fl p Oc Op Ar utility Op Ar argument ...
-.It Ic command Oo Fl v | V Oc Op Ar utility
+.It Ic command Oo Fl p Oc Fl v Ar utility
+.It Ic command Oo Fl p Oc Fl V Ar utility
 The first form of invocation executes the specified
 .Ar utility ,
 ignoring shell functions in the search.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r216091 - head/sys/dev/usb

2010-12-01 Thread Jung-uk Kim
On Tuesday 30 November 2010 10:51 pm, Weongyo Jeong wrote:
> Author: weongyo
> Date: Wed Dec  1 03:51:06 2010
> New Revision: 216091
> URL: http://svn.freebsd.org/changeset/base/216091
>
> Log:
>   Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's
> attached or detached.  Normally it should be changed through user
> land ioctl(2) system calls but it looks there's no apps for USB and
> no need.
>
>   With this patch, libpcap would detect the usbus interfaces
> correctly and tcpdump(1) could dump the USB packets into PCAP
> format with -w option. However it couldn't print the output to
> console because there's no printer-routine at tcpdump(1).

I have written a very hackish USB packet printer for tcpdump based on 
Linux version.

http://people.freebsd.org/~jkim/tcpdump-usb.diff

Note we can only print headers as Linux version does.

Are you planning on adopting DLT_USB_LINUX or DLT_USB_LINUX_MMAPPED or 
applying for our own DLT, BTW?

Jung-uk Kim
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r216101 - head/sys/netinet

2010-12-01 Thread Lawrence Stewart
Author: lstewart
Date: Thu Dec  2 00:47:55 2010
New Revision: 216101
URL: http://svn.freebsd.org/changeset/base/216101

Log:
  Pass NULL instead of 0 for the th pointer value. NULL != 0 on all platforms.
  
  Submitted by: David Hayes 
  MFC after:9 weeks
  X-MFC with:   r215166

Modified:
  head/sys/netinet/tcp_timer.c

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cWed Dec  1 23:26:32 2010
(r216100)
+++ head/sys/netinet/tcp_timer.cThu Dec  2 00:47:55 2010
(r216101)
@@ -567,7 +567,7 @@ tcp_timer_rexmt(void * xtp)
 */
tp->t_rtttime = 0;
 
-   cc_cong_signal(tp, 0, CC_RTO);
+   cc_cong_signal(tp, NULL, CC_RTO);
 
(void) tcp_output(tp);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r216101 - head/sys/netinet

2010-12-01 Thread Lawrence Stewart
On 12/02/10 11:47, Lawrence Stewart wrote:
> Author: lstewart
> Date: Thu Dec  2 00:47:55 2010
> New Revision: 216101
> URL: http://svn.freebsd.org/changeset/base/216101
> 
> Log:
>   Pass NULL instead of 0 for the th pointer value. NULL != 0 on all platforms.
>   
Sponsored by:   FreeBSD Foundation
>   Submitted by:   David Hayes 
>   MFC after:  9 weeks
>   X-MFC with: r215166
> 
> Modified:
>   head/sys/netinet/tcp_timer.c
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r216103 - head/sys/netinet

2010-12-01 Thread Lawrence Stewart
Author: lstewart
Date: Thu Dec  2 01:01:37 2010
New Revision: 216103
URL: http://svn.freebsd.org/changeset/base/216103

Log:
  Set ssthresh appropriately on RTO. This change was accidentally not ported 
from
  the pre modular CC stack.
  
  Sponsored by: FreeBSD Foundation
  Submitted by: David Hayes 
  MFC after:9 weeks
  X-MFC with:   r215166

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cThu Dec  2 00:49:02 2010
(r216102)
+++ head/sys/netinet/tcp_input.cThu Dec  2 01:01:37 2010
(r216103)
@@ -378,6 +378,8 @@ cc_cong_signal(struct tcpcb *tp, struct 
tp->t_dupacks = 0;
tp->t_bytes_acked = 0;
EXIT_RECOVERY(tp->t_flags);
+   tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 /
+   tp->t_maxseg) * tp->t_maxseg;
tp->snd_cwnd = tp->t_maxseg;
break;
case CC_RTO_ERR:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r216104 - head/sys/kern

2010-12-01 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu Dec  2 01:14:45 2010
New Revision: 216104
URL: http://svn.freebsd.org/changeset/base/216104

Log:
  Remove useless NULL checks for M_WAITOK mallocs.

Modified:
  head/sys/kern/sysv_msg.c
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_msg.c
==
--- head/sys/kern/sysv_msg.cThu Dec  2 01:01:37 2010(r216103)
+++ head/sys/kern/sysv_msg.cThu Dec  2 01:14:45 2010(r216104)
@@ -200,18 +200,10 @@ msginit()
TUNABLE_INT_FETCH("kern.ipc.msgtql", &msginfo.msgtql);
 
msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK);
-   if (msgpool == NULL)
-   panic("msgpool is NULL");
msgmaps = malloc(sizeof(struct msgmap) * msginfo.msgseg, M_MSG, 
M_WAITOK);
-   if (msgmaps == NULL)
-   panic("msgmaps is NULL");
msghdrs = malloc(sizeof(struct msg) * msginfo.msgtql, M_MSG, M_WAITOK);
-   if (msghdrs == NULL)
-   panic("msghdrs is NULL");
msqids = malloc(sizeof(struct msqid_kernel) * msginfo.msgmni, M_MSG,
M_WAITOK);
-   if (msqids == NULL)
-   panic("msqids is NULL");
 
/*
 * msginfo.msgssz should be a power of two for efficiency reasons.
@@ -233,9 +225,6 @@ msginit()
panic("msginfo.msgseg > 32767");
}
 
-   if (msgmaps == NULL)
-   panic("msgmaps is NULL");
-
for (i = 0; i < msginfo.msgseg; i++) {
if (i > 0)
msgmaps[i-1].next = i;
@@ -244,9 +233,6 @@ msginit()
free_msgmaps = 0;
nfree_msgmaps = msginfo.msgseg;
 
-   if (msghdrs == NULL)
-   panic("msghdrs is NULL");
-
for (i = 0; i < msginfo.msgtql; i++) {
msghdrs[i].msg_type = 0;
if (i > 0)
@@ -258,9 +244,6 @@ msginit()
}
free_msghdrs = &msghdrs[0];
 
-   if (msqids == NULL)
-   panic("msqids is NULL");
-
for (i = 0; i < msginfo.msgmni; i++) {
msqids[i].u.msg_qbytes = 0; /* implies entry is available */
msqids[i].u.msg_perm.seq = 0;   /* reset to a known value */

Modified: head/sys/kern/sysv_shm.c
==
--- head/sys/kern/sysv_shm.cThu Dec  2 01:01:37 2010(r216103)
+++ head/sys/kern/sysv_shm.cThu Dec  2 01:14:45 2010(r216104)
@@ -878,8 +878,6 @@ shminit()
 
shmalloced = shminfo.shmmni;
shmsegs = malloc(shmalloced * sizeof(shmsegs[0]), M_SHM, M_WAITOK);
-   if (shmsegs == NULL)
-   panic("cannot allocate initial memory for sysvshm");
for (i = 0; i < shmalloced; i++) {
shmsegs[i].u.shm_perm.mode = SHMSEG_FREE;
shmsegs[i].u.shm_perm.seq = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r216105 - in head/sys/netinet: . cc

2010-12-01 Thread Lawrence Stewart
Author: lstewart
Date: Thu Dec  2 01:36:00 2010
New Revision: 216105
URL: http://svn.freebsd.org/changeset/base/216105

Log:
  - Reinstantiate the after_idle hook call in tcp_output(), which got lost
somewhere along the way due to mismerging r211464 in our development tree.
  
  - Capture the essence of r211464 in NewReno's after_idle() hook. We don't
use V_ss_fltsz/V_ss_fltsz_local yet which needs to be revisited.
  
  Sponsored by: FreeBSD Foundation
  Submitted by: David Hayes 
  MFC after:9 weeks
  X-MFC with:   r215166

Modified:
  head/sys/netinet/cc/cc_newreno.c
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/cc/cc_newreno.c
==
--- head/sys/netinet/cc/cc_newreno.cThu Dec  2 01:14:45 2010
(r216104)
+++ head/sys/netinet/cc/cc_newreno.cThu Dec  2 01:36:00 2010
(r216105)
@@ -216,15 +216,28 @@ newreno_post_recovery(struct cc_var *ccv
 void
 newreno_after_idle(struct cc_var *ccv)
 {
+   int rw;
+
/*
-* We have been idle for "a while" and no acks are expected to clock out
-* any data we send -- slow start to get ack "clock" running again.
+* If we've been idle for more than one retransmit timeout the old
+* congestion window is no longer current and we have to reduce it to
+* the restart window before we can transmit again.
+*
+* The restart window is the initial window or the last CWND, whichever
+* is smaller.
+*
+* This is done to prevent us from flooding the path with a full CWND at
+* wirespeed, overloading router and switch buffers along the way.
+*
+* See RFC5681 Section 4.1. "Restarting Idle Connections".
 */
if (V_tcp_do_rfc3390)
-   CCV(ccv, snd_cwnd) = min(4 * CCV(ccv, t_maxseg),
+   rw = min(4 * CCV(ccv, t_maxseg),
max(2 * CCV(ccv, t_maxseg), 4380));
else
-   CCV(ccv, snd_cwnd) = CCV(ccv, t_maxseg) * 2;
+   rw = CCV(ccv, t_maxseg) * 2;
+
+   CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd));
 }
 
 

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Thu Dec  2 01:14:45 2010
(r216104)
+++ head/sys/netinet/tcp_output.c   Thu Dec  2 01:36:00 2010
(r216105)
@@ -148,7 +148,7 @@ tcp_output(struct tcpcb *tp)
 {
struct socket *so = tp->t_inpcb->inp_socket;
long len, recwin, sendwin;
-   int off, flags, error, rw;
+   int off, flags, error;
struct mbuf *m;
struct ip *ip = NULL;
struct ipovly *ipov = NULL;
@@ -182,37 +182,8 @@ tcp_output(struct tcpcb *tp)
 * to send, then transmit; otherwise, investigate further.
 */
idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una);
-   if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur) {
-   /*
-* If we've been idle for more than one retransmit
-* timeout the old congestion window is no longer
-* current and we have to reduce it to the restart
-* window before we can transmit again.
-*
-* The restart window is the initial window or the last
-* CWND, whichever is smaller.
-* 
-* This is done to prevent us from flooding the path with
-* a full CWND at wirespeed, overloading router and switch
-* buffers along the way.
-*
-* See RFC5681 Section 4.1. "Restarting Idle Connections".
-*/
-   if (V_tcp_do_rfc3390)
-   rw = min(4 * tp->t_maxseg,
-max(2 * tp->t_maxseg, 4380));
-#ifdef INET6
-   else if ((isipv6 ? in6_localaddr(&tp->t_inpcb->in6p_faddr) :
- in_localaddr(tp->t_inpcb->inp_faddr)))
-#else
-   else if (in_localaddr(tp->t_inpcb->inp_faddr))
-#endif
-   rw = V_ss_fltsz_local * tp->t_maxseg;
-   else
-   rw = V_ss_fltsz * tp->t_maxseg;
-
-   tp->snd_cwnd = min(rw, tp->snd_cwnd);
-   }
+   if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur)
+   cc_after_idle(tp);
tp->t_flags &= ~TF_LASTIDLE;
if (idle) {
if (tp->t_flags & TF_MORETOCOME) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r216106 - head/usr.bin/find

2010-12-01 Thread Kevin Lo
Author: kevlo
Date: Thu Dec  2 01:46:06 2010
New Revision: 216106
URL: http://svn.freebsd.org/changeset/base/216106

Log:
  Don't error out while searching for empty directories.
  
  Submitted by: Bakul Shah 

Modified:
  head/usr.bin/find/function.c

Modified: head/usr.bin/find/function.c
==
--- head/usr.bin/find/function.cThu Dec  2 01:36:00 2010
(r216105)
+++ head/usr.bin/find/function.cThu Dec  2 01:46:06 2010
(r216106)
@@ -559,7 +559,7 @@ f_empty(PLAN *plan __unused, FTSENT *ent
empty = 1;
dir = opendir(entry->fts_accpath);
if (dir == NULL)
-   err(1, "%s", entry->fts_accpath);
+   return 0;
for (dp = readdir(dir); dp; dp = readdir(dir))
if (dp->d_name[0] != '.' ||
(dp->d_name[1] != '\0' &&
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r216107 - head/sys/netinet/cc

2010-12-01 Thread Lawrence Stewart
Author: lstewart
Date: Thu Dec  2 02:32:46 2010
New Revision: 216107
URL: http://svn.freebsd.org/changeset/base/216107

Log:
  General cleanup of the NewReno CC module (no functional changes):
  
  - Remove superfluous includes and unhelpful comments.
  
  - Alphabetically order functions.
  
  - Make functions static.
  
  Sponsored by: FreeBSD Foundation
  MFC after:9 weeks
  X-MFC with:   r215166

Modified:
  head/sys/netinet/cc/cc_newreno.c

Modified: head/sys/netinet/cc/cc_newreno.c
==
--- head/sys/netinet/cc/cc_newreno.cThu Dec  2 01:46:06 2010
(r216106)
+++ head/sys/netinet/cc/cc_newreno.cThu Dec  2 02:32:46 2010
(r216107)
@@ -52,41 +52,35 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
-#include 
-#include 
+#include 
 
 #include 
-#include 
-#include 
 #include 
 #include 
 
 #include 
 
-void   newreno_ack_received(struct cc_var *ccv, uint16_t type);
-void   newreno_cong_signal(struct cc_var *ccv, uint32_t type);
-void   newreno_post_recovery(struct cc_var *ccv);
-void   newreno_after_idle(struct cc_var *ccv);
+static voidnewreno_ack_received(struct cc_var *ccv, uint16_t type);
+static voidnewreno_after_idle(struct cc_var *ccv);
+static voidnewreno_cong_signal(struct cc_var *ccv, uint32_t type);
+static voidnewreno_post_recovery(struct cc_var *ccv);
 
 struct cc_algo newreno_cc_algo = {
.name = "newreno",
.ack_received = newreno_ack_received,
+   .after_idle = newreno_after_idle,
.cong_signal = newreno_cong_signal,
.post_recovery = newreno_post_recovery,
-   .after_idle = newreno_after_idle
 };
 
-/*
- * Increase cwnd on receipt of a successful ACK:
- * if cwnd <= ssthresh, increases by 1 MSS per ACK
- * if cwnd > ssthresh, increase by ~1 MSS per RTT
- */
-void
+static void
 newreno_ack_received(struct cc_var *ccv, uint16_t type)
 {
if (type == CC_ACK && !IN_RECOVERY(CCV(ccv, t_flags)) &&
@@ -153,10 +147,37 @@ newreno_ack_received(struct cc_var *ccv,
}
 }
 
+static void
+newreno_after_idle(struct cc_var *ccv)
+{
+   int rw;
+
+   /*
+* If we've been idle for more than one retransmit timeout the old
+* congestion window is no longer current and we have to reduce it to
+* the restart window before we can transmit again.
+*
+* The restart window is the initial window or the last CWND, whichever
+* is smaller.
+*
+* This is done to prevent us from flooding the path with a full CWND at
+* wirespeed, overloading router and switch buffers along the way.
+*
+* See RFC5681 Section 4.1. "Restarting Idle Connections".
+*/
+   if (V_tcp_do_rfc3390)
+   rw = min(4 * CCV(ccv, t_maxseg),
+   max(2 * CCV(ccv, t_maxseg), 4380));
+   else
+   rw = CCV(ccv, t_maxseg) * 2;
+
+   CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd));
+}
+
 /*
- * manage congestion signals
+ * Perform any necessary tasks before we enter congestion recovery.
  */
-void
+static void
 newreno_cong_signal(struct cc_var *ccv, uint32_t type)
 {
u_int win;
@@ -183,11 +204,9 @@ newreno_cong_signal(struct cc_var *ccv, 
 }
 
 /*
- * decrease the cwnd in response to packet loss or a transmit timeout.
- * th can be null, in which case cwnd will be set according to reno instead
- * of new reno.
+ * Perform any necessary tasks before we exit congestion recovery.
  */
-void
+static void
 newreno_post_recovery(struct cc_var *ccv)
 {
if (IN_FASTRECOVERY(CCV(ccv, t_flags))) {
@@ -209,36 +228,5 @@ newreno_post_recovery(struct cc_var *ccv
}
 }
 
-/*
- * if a connection has been idle for a while and more data is ready to be sent,
- * reset cwnd
- */
-void
-newreno_after_idle(struct cc_var *ccv)
-{
-   int rw;
-
-   /*
-* If we've been idle for more than one retransmit timeout the old
-* congestion window is no longer current and we have to reduce it to
-* the restart window before we can transmit again.
-*
-* The restart window is the initial window or the last CWND, whichever
-* is smaller.
-*
-* This is done to prevent us from flooding the path with a full CWND at
-* wirespeed, overloading router and switch buffers along the way.
-*
-* See RFC5681 Section 4.1. "Restarting Idle Connections".
-*/
-   if (V_tcp_do_rfc3390)
-   rw = min(4 * CCV(ccv, t_maxseg),
-   max(2 * CCV(ccv, t_maxseg), 4380));
-   else
-   rw = CCV(ccv, t_maxseg) * 2;
-
-   CCV(ccv, snd_cwnd) = min(rw, CCV(ccv, snd_cwnd));
-}
-
 
 DECLARE_CC_MODULE(newreno, &newreno_cc_algo);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To u

svn commit: r216109 - in head/sys/modules: . cc

2010-12-01 Thread Lawrence Stewart
Author: lstewart
Date: Thu Dec  2 03:10:35 2010
New Revision: 216109
URL: http://svn.freebsd.org/changeset/base/216109

Log:
  Add build infrastructure for the forthcoming CC algorithm modules.
  
  Sponsored by: FreeBSD Foundation
  Submitted by: David Hayes 
  MFC after:3 months

Added:
  head/sys/modules/cc/
  head/sys/modules/cc/Makefile   (contents, props changed)
Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Thu Dec  2 02:34:39 2010(r216108)
+++ head/sys/modules/Makefile   Thu Dec  2 03:10:35 2010(r216109)
@@ -51,6 +51,7 @@ SUBDIR=   ${_3dfx} \
${_cardbus} \
cas \
${_cbb} \
+   cc \
cd9660 \
cd9660_iconv \
${_ce} \

Added: head/sys/modules/cc/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/cc/MakefileThu Dec  2 03:10:35 2010
(r216109)
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+SUBDIR=
+
+.include 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r216101 - head/sys/netinet

2010-12-01 Thread Bruce Evans

On Thu, 2 Dec 2010, Lawrence Stewart wrote:


Log:
 Pass NULL instead of 0 for the th pointer value. NULL != 0 on all platforms.

 Submitted by:  David Hayes 
 MFC after: 9 weeks
 X-MFC with:r215166

Modified:
 head/sys/netinet/tcp_timer.c

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cWed Dec  1 23:26:32 2010
(r216100)
+++ head/sys/netinet/tcp_timer.cThu Dec  2 00:47:55 2010
(r216101)
@@ -567,7 +567,7 @@ tcp_timer_rexmt(void * xtp)
 */
tp->t_rtttime = 0;

-   cc_cong_signal(tp, 0, CC_RTO);
+   cc_cong_signal(tp, NULL, CC_RTO);

(void) tcp_output(tp);



Er this never passed 0, (provided a prototype is in scope), and can neverpass
either 0 or NULL, since 0 and NULL are null pointer constants and functions
cannot pass constants.

It used to pass a null pointer, after converting the null pointer
constant 0 according to the prototype.  Now it passes the same null
pointer after converting the possibly-different null pointer constant
NULL according to the prototype.

NULL == 0 on all platform, since both are null pointer constants, and
one of the following cases applies:
- if NULL is an integer constant with value 0, then of course it equals
  plain int 0.  Moreover, even if the type of NULL is different from
  the type of plain int 0, the types become identical before the
  comparison is done, since both operands are converted to a common
  type.
- if NULL is an integer constant with value 0 cast to (void *), then it
  certainly has a different type than plain int 0, and may have a
  different representation.  However, when compared with plain 0, both
  operands are converted to a common type, which is necessarily that
  of NULL.  This is a pointer type, so so both operands are null
  pointers.  These null pointers may have different representations,
  but any two null pointers to the same type are specified to compare
  equal.  So NULL == 0 in this case too.

The last case is essentially what applies in function calls.  Now the
conversion of either NULL or 0 or any other null pointer constant to a
null pointer is done according to the prototype.  The results are not
necessarily the same like I said above, but they compare the same.
Thus spelling the null pointer constant as 0 made no difference to
the higher-level results on any platform (unless you do something like
memcmp of null pointers, and use an exotic platform where null pointers
have different representations).  It was just a style bug.

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


svn commit: r216111 - head/sys/dev/fxp

2010-12-01 Thread Pyun YongHyeon
Author: yongari
Date: Thu Dec  2 03:53:29 2010
New Revision: 216111
URL: http://svn.freebsd.org/changeset/base/216111

Log:
  If RX lockup workaround is enabled, fxp(4) will periodically reset
  the controller to workaround silicon bug of i82557. Each reset will
  re-establish link which in turn triggers MII status change
  callback. The callback will try to reconfigure controller if the
  controller is not i82557 to enable flow-control. This caused
  endless link UP/DOWN when the workaround was enabled on non-i82557
  controller.
  
  To fix the issue, apply RX lockup workaround only for i82557.
  Previously it blindly checked undocumented EEPROM location such
  that it sometimes enabled the workaround for other controllers. At
  this time, only i82557 is known to have the silicon bug.
  This fixes a regression introduced in r215906 which enabled flow
  control support for all controllers except i82557.
  
  Reported by:  Karl Denninger (karl <> denninger dot net)
  Tested by:Karl Denninger (karl <> denninger dot net)
  MFC after:3 days

Modified:
  head/sys/dev/fxp/if_fxp.c

Modified: head/sys/dev/fxp/if_fxp.c
==
--- head/sys/dev/fxp/if_fxp.c   Thu Dec  2 03:34:27 2010(r216110)
+++ head/sys/dev/fxp/if_fxp.c   Thu Dec  2 03:53:29 2010(r216111)
@@ -526,10 +526,12 @@ fxp_attach(device_t dev)
}
 
/* Receiver lock-up workaround detection. */
-   fxp_read_eeprom(sc, &data, 3, 1);
-   if ((data & 0x03) != 0x03) {
-   sc->flags |= FXP_FLAG_RXBUG;
-   device_printf(dev, "Enabling Rx lock-up workaround\n");
+   if (sc->revision < FXP_REV_82558_A4) {
+   fxp_read_eeprom(sc, &data, 3, 1);
+   if ((data & 0x03) != 0x03) {
+   sc->flags |= FXP_FLAG_RXBUG;
+   device_printf(dev, "Enabling Rx lock-up workaround\n");
+   }
}
 
/*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r216112 - head/sys/kern

2010-12-01 Thread Warner Losh
Author: imp
Date: Thu Dec  2 04:28:01 2010
New Revision: 216112
URL: http://svn.freebsd.org/changeset/base/216112

Log:
  removed tag is '-', not '+'.
  remove extra return.

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==
--- head/sys/kern/subr_bus.cThu Dec  2 03:53:29 2010(r216111)
+++ head/sys/kern/subr_bus.cThu Dec  2 04:28:01 2010(r216112)
@@ -718,8 +718,7 @@ devadded(device_t dev)
 static void
 devremoved(device_t dev)
 {
-   devaddq("+", device_get_nameunit(dev), dev);
-   return;
+   devaddq("-", device_get_nameunit(dev), dev);
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r216101 - head/sys/netinet

2010-12-01 Thread Lawrence Stewart
On 12/02/10 14:45, Bruce Evans wrote:
> On Thu, 2 Dec 2010, Lawrence Stewart wrote:
> 
>> Log:
>>  Pass NULL instead of 0 for the th pointer value. NULL != 0 on all
>> platforms.
>>
>>  Submitted by:David Hayes 
>>  MFC after:9 weeks
>>  X-MFC with:r215166
>>
>> Modified:
>>  head/sys/netinet/tcp_timer.c
>>
>> Modified: head/sys/netinet/tcp_timer.c
>> ==
>>
>> --- head/sys/netinet/tcp_timer.cWed Dec  1 23:26:32 2010(r216100)
>> +++ head/sys/netinet/tcp_timer.cThu Dec  2 00:47:55 2010(r216101)
>> @@ -567,7 +567,7 @@ tcp_timer_rexmt(void * xtp)
>>  */
>> tp->t_rtttime = 0;
>>
>> -cc_cong_signal(tp, 0, CC_RTO);
>> +cc_cong_signal(tp, NULL, CC_RTO);
>>
>> (void) tcp_output(tp);
>>
> 
> Er this never passed 0, (provided a prototype is in scope), and can
> neverpass
> either 0 or NULL, since 0 and NULL are null pointer constants and functions
> cannot pass constants.
> 
> It used to pass a null pointer, after converting the null pointer
> constant 0 according to the prototype.  Now it passes the same null
> pointer after converting the possibly-different null pointer constant
> NULL according to the prototype.
> 
> NULL == 0 on all platform, since both are null pointer constants, and
> one of the following cases applies:
> - if NULL is an integer constant with value 0, then of course it equals
>   plain int 0.  Moreover, even if the type of NULL is different from
>   the type of plain int 0, the types become identical before the
>   comparison is done, since both operands are converted to a common
>   type.
> - if NULL is an integer constant with value 0 cast to (void *), then it
>   certainly has a different type than plain int 0, and may have a
>   different representation.  However, when compared with plain 0, both
>   operands are converted to a common type, which is necessarily that
>   of NULL.  This is a pointer type, so so both operands are null
>   pointers.  These null pointers may have different representations,
>   but any two null pointers to the same type are specified to compare
>   equal.  So NULL == 0 in this case too.
> 
> The last case is essentially what applies in function calls.  Now the
> conversion of either NULL or 0 or any other null pointer constant to a
> null pointer is done according to the prototype.  The results are not
> necessarily the same like I said above, but they compare the same.
> Thus spelling the null pointer constant as 0 made no difference to
> the higher-level results on any platform (unless you do something like
> memcmp of null pointers, and use an exotic platform where null pointers
> have different representations).  It was just a style bug.

hmm, thanks for the informative response. I'm not sure where I got it in
my head that NULL != 0 on all platforms, but you've now corrected that
bit of misunderstanding. For the record, the now known to be bogus
commit log was my own creation based on my (mis)understanding and did
not come from David.

When it comes time to MFC, should I use the bogus log message or correct
it to something like:

"Fix a minor style nit by passing NULL instead of 0 for the th pointer
value."

Cheers,
Lawrence
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r209110 - in head/lib/msun: . src

2010-12-01 Thread David Schultz
On Tue, Jun 15, 2010, David Schultz wrote:
> On Tue, Jun 15, 2010, Kostik Belousov wrote:
> > On Sat, Jun 12, 2010 at 05:32:05PM +, David Schultz wrote:
> > > Author: das
> > > Date: Sat Jun 12 17:32:05 2010
> > > New Revision: 209110
> > > URL: http://svn.freebsd.org/changeset/base/209110
> > > 
> > > Log:
> > >   Introduce __isnanf() as an alias for isnanf(), and make the isnan()
> > >   macro expand to __isnanf() instead of isnanf() for float arguments.
> > >   This change is needed because isnanf() isn't declared in strict POSIX
> > >   or C99 mode.
> > >   
> > >   Compatibility note: Apps using isnan(float) that are compiled after
> > >   this change won't link against an older libm.
> > >   
> > >   Reported by:Florian Forster 
> > 
> > May be, it makes sense to remove the default version for the isnan symbol ?
> 
> Wouldn't this mean apps that use isnanf() directly will no longer
> compile?  isnanf() is a historical BSD interface, and although
> it's been deprecated for many years, it's still declared (if
> __BSD_VISIBLE).
> 
> Oops, to complicate matters further, I just noticed that we
> already have isnanf and __isnanf symbols in libc, so maybe the new
> symbol isn't needed.  (isnan() and isnanf() are in libc because
> that's where they were historically.)  The second version in
> libm looks like a mistake (wrong scope of the #if 0 in s_isnan.c.)
> Perhaps we could just remove the duplicate symbols from libm.

Any thoughts on removing the isnanf and __isnanf symbols from
libm?  Both symbols are already in libc for historical reasons, so
the duplication isn't needed.

Although we've had the duplicate isnanf symbol in libm for several
releases, I don't believe removing it will cause problems; apps
will just pick up the libc version.  __isnanf is only present in
libm in 9-CURRENT (due to the commit referenced above).  Because
of symbol version differences, however, removing it will affect
apps that were linked under 9-CURRENT AND rely on isnanf AND link
against libm before libc.  On my system, libwebkit is the only
affected binary I could find.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r216113 - head/gnu/usr.bin/cc

2010-12-01 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Dec  2 04:58:07 2010
New Revision: 216113
URL: http://svn.freebsd.org/changeset/base/216113

Log:
  The driver-XXX.c files used for host CPU detection with -march=native
  should not be compiled in the cross-tools case (where -march=native makes
  no sense). This fixes cross-building x86 toolchains on non-x86 systems.

Modified:
  head/gnu/usr.bin/cc/Makefile.fe

Modified: head/gnu/usr.bin/cc/Makefile.fe
==
--- head/gnu/usr.bin/cc/Makefile.fe Thu Dec  2 04:28:01 2010
(r216112)
+++ head/gnu/usr.bin/cc/Makefile.fe Thu Dec  2 04:58:07 2010
(r216113)
@@ -19,7 +19,8 @@ CFLAGS+= ${DRIVER_DEFINES}
 
 SRCS=  gcc.c opts-common.c options.c intl.c prefix.c version.c
 
-.if exists(${GCCDIR}/config/${GCC_CPU}/driver-${GCC_CPU}.c)
+.if ${TARGET_ARCH} == ${MACHINE_ARCH} && \
+   exists(${GCCDIR}/config/${GCC_CPU}/driver-${GCC_CPU}.c)
 SRCS+=  driver-${GCC_CPU}.c
 .endif
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r209110 - in head/lib/msun: . src

2010-12-01 Thread Garrett Cooper
On Wed, Dec 1, 2010 at 8:57 PM, David Schultz  wrote:
> On Tue, Jun 15, 2010, David Schultz wrote:
>> On Tue, Jun 15, 2010, Kostik Belousov wrote:
>> > On Sat, Jun 12, 2010 at 05:32:05PM +, David Schultz wrote:
>> > > Author: das
>> > > Date: Sat Jun 12 17:32:05 2010
>> > > New Revision: 209110
>> > > URL: http://svn.freebsd.org/changeset/base/209110
>> > >
>> > > Log:
>> > >   Introduce __isnanf() as an alias for isnanf(), and make the isnan()
>> > >   macro expand to __isnanf() instead of isnanf() for float arguments.
>> > >   This change is needed because isnanf() isn't declared in strict POSIX
>> > >   or C99 mode.
>> > >
>> > >   Compatibility note: Apps using isnan(float) that are compiled after
>> > >   this change won't link against an older libm.
>> > >
>> > >   Reported by:    Florian Forster 
>> >
>> > May be, it makes sense to remove the default version for the isnan symbol ?
>>
>> Wouldn't this mean apps that use isnanf() directly will no longer
>> compile?  isnanf() is a historical BSD interface, and although
>> it's been deprecated for many years, it's still declared (if
>> __BSD_VISIBLE).
>>
>> Oops, to complicate matters further, I just noticed that we
>> already have isnanf and __isnanf symbols in libc, so maybe the new
>> symbol isn't needed.  (isnan() and isnanf() are in libc because
>> that's where they were historically.)  The second version in
>> libm looks like a mistake (wrong scope of the #if 0 in s_isnan.c.)
>> Perhaps we could just remove the duplicate symbols from libm.
>
> Any thoughts on removing the isnanf and __isnanf symbols from
> libm?  Both symbols are already in libc for historical reasons, so
> the duplication isn't needed.
>
> Although we've had the duplicate isnanf symbol in libm for several
> releases, I don't believe removing it will cause problems; apps
> will just pick up the libc version.  __isnanf is only present in
> libm in 9-CURRENT (due to the commit referenced above).  Because
> of symbol version differences, however, removing it will affect
> apps that were linked under 9-CURRENT AND rely on isnanf AND link
> against libm before libc.  On my system, libwebkit is the only
> affected binary I could find.

Yeah... it's going to be broken according to the manpage (manpage
explicitly calls out -lm and math.h) and POSIX (POSIX only calls out
math.h) as math.h lives in lib/msun for C apps:

$ find /usr/src/ -name math.h
/usr/src/contrib/libstdc++/include/tr1/math.h
/usr/src/contrib/libstdc++/include/c_compatibility/math.h
/usr/src/lib/msun/src/math.h

So unless math.h is going to move to libc, I'd leave it alone if I
was making the final call.
Thanks,
-Garrett
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r209110 - in head/lib/msun: . src

2010-12-01 Thread Garrett Cooper
On Wed, Dec 1, 2010 at 9:16 PM, Garrett Cooper  wrote:
> On Wed, Dec 1, 2010 at 8:57 PM, David Schultz  wrote:
>> On Tue, Jun 15, 2010, David Schultz wrote:
>>> On Tue, Jun 15, 2010, Kostik Belousov wrote:
>>> > On Sat, Jun 12, 2010 at 05:32:05PM +, David Schultz wrote:
>>> > > Author: das
>>> > > Date: Sat Jun 12 17:32:05 2010
>>> > > New Revision: 209110
>>> > > URL: http://svn.freebsd.org/changeset/base/209110
>>> > >
>>> > > Log:
>>> > >   Introduce __isnanf() as an alias for isnanf(), and make the isnan()
>>> > >   macro expand to __isnanf() instead of isnanf() for float arguments.
>>> > >   This change is needed because isnanf() isn't declared in strict POSIX
>>> > >   or C99 mode.
>>> > >
>>> > >   Compatibility note: Apps using isnan(float) that are compiled after
>>> > >   this change won't link against an older libm.
>>> > >
>>> > >   Reported by:    Florian Forster 
>>> >
>>> > May be, it makes sense to remove the default version for the isnan symbol 
>>> > ?
>>>
>>> Wouldn't this mean apps that use isnanf() directly will no longer
>>> compile?  isnanf() is a historical BSD interface, and although
>>> it's been deprecated for many years, it's still declared (if
>>> __BSD_VISIBLE).
>>>
>>> Oops, to complicate matters further, I just noticed that we
>>> already have isnanf and __isnanf symbols in libc, so maybe the new
>>> symbol isn't needed.  (isnan() and isnanf() are in libc because
>>> that's where they were historically.)  The second version in
>>> libm looks like a mistake (wrong scope of the #if 0 in s_isnan.c.)
>>> Perhaps we could just remove the duplicate symbols from libm.
>>
>> Any thoughts on removing the isnanf and __isnanf symbols from
>> libm?  Both symbols are already in libc for historical reasons, so
>> the duplication isn't needed.
>>
>> Although we've had the duplicate isnanf symbol in libm for several
>> releases, I don't believe removing it will cause problems; apps
>> will just pick up the libc version.  __isnanf is only present in
>> libm in 9-CURRENT (due to the commit referenced above).  Because
>> of symbol version differences, however, removing it will affect
>> apps that were linked under 9-CURRENT AND rely on isnanf AND link
>> against libm before libc.  On my system, libwebkit is the only
>> affected binary I could find.
>
>    Yeah... it's going to be broken according to the manpage (manpage
> explicitly calls out -lm and math.h) and POSIX (POSIX only calls out
> math.h) as math.h lives in lib/msun for C apps:
>
> $ find /usr/src/ -name math.h
> /usr/src/contrib/libstdc++/include/tr1/math.h
> /usr/src/contrib/libstdc++/include/c_compatibility/math.h
> /usr/src/lib/msun/src/math.h
>
>    So unless math.h is going to move to libc, I'd leave it alone if I
> was making the final call.

Arg -- please ignore this email. I did another search and you said
isnanf, not isnan. It's not mentioned anywhere in POSIX land or in any
of our manpages.
Sorry bout that,
-Garrett
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r216114 - in head/sys: modules/cc modules/cc/cc_cubic netinet/cc

2010-12-01 Thread Lawrence Stewart
Author: lstewart
Date: Thu Dec  2 06:05:44 2010
New Revision: 216114
URL: http://svn.freebsd.org/changeset/base/216114

Log:
  Import a clean-room implementation of the experimental CUBIC congestion 
control
  algorithm based on the Internet-Draft "draft-rhee-tcpm-cubic-02.txt". It is
  implemented as a kernel module compatible with the recently committed modular
  congestion control framework.
  
  CUBIC was designed for provide increased throughput in fast and long-distance
  networks. It attempts to maintain fairness when competing with legacy NewReno
  TCP in lower speed scenarios where NewReno is able to operate adequately. The
  paper "CUBIC: A New TCP-Friendly High-Speed TCP Variant" provides additional
  detail.
  
  In collaboration with:David Hayes  and
Grenville Armitage 
  Sponsored by: FreeBSD Foundation
  Reviewed by:  rpaulo (older patch from a few weeks ago)
  MFC after:3 months

Added:
  head/sys/modules/cc/cc_cubic/
  head/sys/modules/cc/cc_cubic/Makefile   (contents, props changed)
  head/sys/netinet/cc/cc_cubic.c   (contents, props changed)
  head/sys/netinet/cc/cc_cubic.h   (contents, props changed)
Modified:
  head/sys/modules/cc/Makefile

Modified: head/sys/modules/cc/Makefile
==
--- head/sys/modules/cc/MakefileThu Dec  2 04:58:07 2010
(r216113)
+++ head/sys/modules/cc/MakefileThu Dec  2 06:05:44 2010
(r216114)
@@ -1,5 +1,5 @@
 # $FreeBSD$
 
-SUBDIR=
+SUBDIR=cc_cubic
 
 .include 

Added: head/sys/modules/cc/cc_cubic/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/cc/cc_cubic/Makefile   Thu Dec  2 06:05:44 2010
(r216114)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+.include 
+
+.PATH: ${.CURDIR}/../../../netinet/cc
+KMOD=  cc_cubic
+SRCS=  cc_cubic.c
+
+.include 

Added: head/sys/netinet/cc/cc_cubic.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/netinet/cc/cc_cubic.c  Thu Dec  2 06:05:44 2010
(r216114)
@@ -0,0 +1,396 @@
+/*-
+ * Copyright (c) 2008-2010 Lawrence Stewart 
+ * Copyright (c) 2010 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by Lawrence Stewart while studying at the Centre
+ * for Advanced Internet Architectures, Swinburne University, made possible in
+ * part by a grant from the Cisco University Research Program Fund at Community
+ * Foundation Silicon Valley.
+ *
+ * Portions of this software were developed at the Centre for Advanced
+ * Internet Architectures, Swinburne University of Technology, Melbourne,
+ * Australia by David Hayes under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * An implementation of the CUBIC congestion control algorithm for FreeBSD,
+ * based on the Internet Draft "draft-rhee-tcpm-cubic-02" by Rhee, Xu and Ha.
+ * Originally released as part of the NewTCP research project at Swinburne
+ * University's Centre for Advanced Internet Architectures, Melbourne,
+ * Australia, which was made possible in part by a grant from the Cisco
+ * University Research Program Fund at Community Foundation Silicon Valley. 
More
+ * details are available at:
+ *   http://caia.swin.edu.au/urp/newtcp/
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+static voidcubic_a

svn commit: r216115 - in head/sys: modules/cc modules/cc/cc_htcp netinet/cc

2010-12-01 Thread Lawrence Stewart
Author: lstewart
Date: Thu Dec  2 06:40:21 2010
New Revision: 216115
URL: http://svn.freebsd.org/changeset/base/216115

Log:
  Import a clean-room implementation of the experimental H-TCP congestion 
control
  algorithm based on the Internet-Draft "draft-leith-tcp-htcp-06.txt". It is
  implemented as a kernel module compatible with the recently committed modular
  congestion control framework.
  
  H-TCP was designed to provide increased throughput in fast and long-distance
  networks. It attempts to maintain fairness when competing with legacy NewReno
  TCP in lower speed scenarios where NewReno is able to operate adequately. The
  paper "H-TCP: A framework for congestion control in high-speed and 
long-distance
  networks" provides additional detail.
  
  In collaboration with:David Hayes  and
Grenville Armitage 
  Sponsored by: FreeBSD Foundation
  Reviewed by:  rpaulo (older patch from a few weeks ago)
  MFC after:3 months

Added:
  head/sys/modules/cc/cc_htcp/
  head/sys/modules/cc/cc_htcp/Makefile   (contents, props changed)
  head/sys/netinet/cc/cc_htcp.c   (contents, props changed)
Modified:
  head/sys/modules/cc/Makefile

Modified: head/sys/modules/cc/Makefile
==
--- head/sys/modules/cc/MakefileThu Dec  2 06:05:44 2010
(r216114)
+++ head/sys/modules/cc/MakefileThu Dec  2 06:40:21 2010
(r216115)
@@ -1,5 +1,6 @@
 # $FreeBSD$
 
-SUBDIR=cc_cubic
+SUBDIR=cc_cubic \
+   cc_htcp
 
 .include 

Added: head/sys/modules/cc/cc_htcp/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/cc/cc_htcp/MakefileThu Dec  2 06:40:21 2010
(r216115)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+.include 
+
+.PATH: ${.CURDIR}/../../../netinet/cc
+KMOD=  cc_htcp
+SRCS=  cc_htcp.c
+
+.include 

Added: head/sys/netinet/cc/cc_htcp.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/netinet/cc/cc_htcp.c   Thu Dec  2 06:40:21 2010
(r216115)
@@ -0,0 +1,521 @@
+/*-
+ * Copyright (c) 2007-2008
+ * Swinburne University of Technology, Melbourne, Australia
+ * Copyright (c) 2009-2010 Lawrence Stewart 
+ * Copyright (c) 2010 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed at the Centre for Advanced Internet
+ * Architectures, Swinburne University, by Lawrence Stewart and James Healy,
+ * made possible in part by a grant from the Cisco University Research Program
+ * Fund at Community Foundation Silicon Valley.
+ *
+ * Portions of this software were developed at the Centre for Advanced
+ * Internet Architectures, Swinburne University of Technology, Melbourne,
+ * Australia by David Hayes under sponsorship from the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * An implementation of the H-TCP congestion control algorithm for FreeBSD,
+ * based on the Internet Draft "draft-leith-tcp-htcp-06.txt" by Leith and
+ * Shorten. Originally released as part of the NewTCP research project at
+ * Swinburne University's Centre for Advanced Internet Architectures, 
Melbourne,
+ * Australia, which was made possible in part by a grant from the Cisco
+ * University Research Program Fund at Community Foundation Silicon Valley. 
More
+ * details are available at:
+ *   http://caia.swin.edu.au/urp/newtcp/
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#includ