netmap : about update single ring

2012-05-31 Thread r...@9du.org
i want to update single ring use the ringid

like code:
struct netmap_ring *ring = NETMAP_TXRING(me-nifp, ringid);
i can't find a way to do this.
so i try to change the netmap core.

add code sys/net/netmap.h
struct node {
int ringid;
int update;
};
#define NIOCTXNODE  _IOWR('i', 150, struct node)

add code in sys/dev/netmap/netmap.c
case NIOCTXNODE:
if (priv == NULL) {
error = ENXIO;
break;
}
ifp = priv-np_ifp;
na = NA(ifp);
node-ringid += priv-np_qfirst;
na-nm_txsync(ifp, node-ringid, 1 /* do lock */);
break;
in my case.
struct node node;
node.ringid = s;
node.update = 0;
ioctl(me-fd, NIOCTXNODE, node);

but her can't work. 
have some error in somewhere, i can't found it.
can your help me ? luigi.___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org

Cross dev tools for arm

2012-05-31 Thread Guillaume Bibaut
Hello,

I've been trying to build arm cross dev tools on an amd64 virtual machine with 
clang, and it doesn't seem to build.
The virtual machine is built on base/head svn tree with revision r236355.

Since I'm really new to the arm world, my mail might seem awkward and it might 
be completly normal that it doesn't build.

here is a tail of what I'm getting
(there are escaped string from clang)

/usr/src # make xdev XDEV=arm XDEV_ARCH=arm

...
=== lib/libcompiler_rt (obj,depend,all,install)
clang  -O -pipe  -fpic -fvisibility=hidden -DVISIBILITY_HIDDEN -std=gnu99 
-Qunused-arguments  -c /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c -o 
__sync_fetch_and_add_4.o
In file included from /usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c:6:
/usr/src/lib/libcompiler_rt/__sync_fetch_and_op_n.h:34:1: 
error: conflicting
  types for '__sync_fetch_and_add_4'

NAME(volatile TYPE *ptr, TYPE value)
^
/usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c:2:15: 
note: expanded from
  macro 'NAME'
#define NAME__sync_fetch_and_add_4
^
/usr/src/lib/libcompiler_rt/__sync_fetch_and_op_n.h:34:1: 
note: 
  '__sync_fetch_and_add_4' is a builtin with type 'int (volatile int *, int,
  ...)'
NAME(volatile TYPE *ptr, TYPE value)
^
/usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c:2:15: 
note: expanded from
  macro 'NAME'
#define NAME__sync_fetch_and_add_4
^
In file included from 
/usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c:6:
/usr/src/lib/libcompiler_rt/__sync_fetch_and_op_n.h:34:1: 
error: definition of
  builtin function '__sync_fetch_and_add_4'
NAME(volatile TYPE *ptr, TYPE value)
^
/usr/src/lib/libcompiler_rt/__sync_fetch_and_add_4.c:2:15: 
note: expanded from
  macro 'NAME'
#define NAME__sync_fetch_and_add_4
^
2 errors generated.
*** [__sync_fetch_and_add_4.o] Error code 1

Stop in /usr/src/lib/libcompiler_rt.
*** [lib/libcompiler_rt__PL] Error code 1

Stop in /usr/src.
*** [libraries] Error code 1

Stop in /usr/src.
*** [_xi-libraries] Error code 1

Stop in /usr/src.
*** [xdev] Error code 1

Stop in /usr/src.

Script done on Thu May 31 17:06:06 2012


Thanks for any answer you guys could give me, or not :)

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


Re: ctfmerge core dump

2012-05-31 Thread John Baldwin
On Thursday, May 24, 2012 4:10:59 pm Sergey Dyatko wrote:
 2012/5/7 Steve Wills swi...@freebsd.org
 
   On 2012/5/6 5:08, b. f. wrote:
   On 5/5/12, Steve Willsswi...@freebsd.org  wrote:
   Thanks for the info. I took a look at the dump and see this:
  
   % sudo gdb /usr/bin/ctfmerge ctfmerge.core
   [GDB will not be able to debug user-mode threads: Undefined symbol
   td_thr_getxmmregs]
  
   Hmm, is the thread debugging broken on amd64 now ?  td_thr_getxmmregs
   resides
   in libthread_db and /usr/src/gnu/usr.bin/gdb/libgdb is complaining about
   the missing
   symbol.
  
 
  Maybe or maybe I have done something wrong on my system. FWIW, I do all my
  builds with debugging enabled.
 
  BTW, just to confirm, I was able to work around the original issue once I
  updated past r235068. I had to disable DTrace build and build and install
  a new libthr, then was able to re-enable DTrace and everything was fine.
 
  Thanks,
  Steve
 
 
 
 hm.. looks like problem is still here. I'm trying update my r234992 to
 r235887
 http://pastebin.com/stm7b8hQ

I believe this was fixed by 235563 in HEAD.

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


Re: KDE 3.5.10 10-CURRENT r235646 (May 19)

2012-05-31 Thread John Baldwin
On Saturday, May 26, 2012 4:36:28 am Matthias Apitz wrote:
 
 Hello,
 
 The Good message first: KDE 3.5.10 compiles clean in 10-CURRENT; thanks!
 
 With a recent 10-CURRENT and clean ports from CVS (both from May 19) I
 encounter some crashes on KDE start or stop; there are messages from
 'startkde':
 
 Warning: kbuildsycoca is unable to register with DCOP.
 kbuildsycoca running...
 kbuildsycoca running...
 Reusing existing ksycoca
 ...
 startkde: Starting up...
 kbuildsycoca running...
  running as realtime process now (priority 15)
 kdecore (KProcess): WARNING: Can't open a pseudo teletype

Maybe it's using the old pty's?  Try putting 'device pty' back in your kernel 
config perhaps?

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


Re: 10-CURRENT r235646 open-vm-tools-8.6.0-425873

2012-05-31 Thread John Baldwin
On Saturday, May 26, 2012 10:22:29 am Matthias Apitz wrote:
 
 Hi,
 
 The port ports/emulators/open-vm-tools does not compile in 10-CURRENT:
 
 # make install clean
 ...
 make VM_UNAME=10.0-CURRENT MV=mv RM=rm 
OVT_SOURCE_DIR=/usr/ports/emulators/open-vm-tools/work/open-vm-
tools-8.6.0-425873
 MODULEBUILDDIR=/usr/ports/emulators/open-vm-tools/work/open-vm-
tools-8.6.0-425873/modules/freebsd  -C /usr/ports/emulators/open-vm-
tools/work/open-vm-tools-8.6.0-425873/modules/freebsd/vmxnet
 @ - /usr/src/sys
 machine - /usr/src/sys/i386/include
 x86 - /usr/src/sys/x86/include
 : opt_bdg.h
 awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
 awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
 awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
 cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc  
-I/u
 sr/ports/emulators/open-vm-tools/work/open-vm-tools-8.6.0-425873/lib/include
 -I/usr/ports/emulators/open-vm-tools/work/open-vm-
tools-8.6.0-425873/modules/shared/vmxnet -I. -I@ -I@/contrib/altq -finline-
limit=8000 --param
 inline-unit-growth=100 --param large-function-growth=1000 -fno-common
 -mno-align-long-strings -mp
 referred-stack-boundary=2 -mno-mmx -mno-sse -msoft-float -ffreestanding
 -fstack-
 protector -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls
 -Wnested-e
 xterns -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith
 -Winline -Wcast
 -qual  -Wundef -Wno-pointer-sign -fformat-extensions
 -Wmissing-include-dirs -fd
 iagnostics-show-option   -c if_vxn.c
 cc1: warnings being treated as errors
 if_vxn.c: In function 'vxn_load_multicast':
 if_vxn.c:719: warning: implicit declaration of function 'IF_ADDR_LOCK'
 if_vxn.c:719: warning: nested extern declaration of 'IF_ADDR_LOCK'
 [-Wnested-ext erns]
 if_vxn.c:746: warning: implicit declaration of function 'IF_ADDR_UNLOCK'
 if_vxn.c:746: warning: nested extern declaration of 'IF_ADDR_UNLOCK'
 [-Wnested-e xterns]
 *** [if_vxn.o] Error code 1
 
 Let me know if you need more information.
 Thanks

It should be using if_mcast_rlock() and if_mcast_runlock() instead of using 
those macros directly.  This works all the way back to 8.0.

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


Re: Use of C99 extra long double math functions after r236148

2012-05-31 Thread John Baldwin
On Monday, May 28, 2012 7:02:18 pm Steve Kargl wrote:
 On Tue, May 29, 2012 at 07:05:07AM +1000, Peter Jeremy wrote:
  On 2012-May-28 11:01:24 -0500, Stephen Montgomery-Smith 
step...@missouri.edu wrote:
  One thing that could be done is to have a math/cephes port that adds 
  the extra C99 math functions.  This is already done in the math/sage 
  port, using a rather clever patch due to Peter Jeremy, that applies to 
  the cephes code.
  
  What it would do is to create a /usr/local/lib/libm.so that would 
  provide the extra functions not currently included in /lib/libm.so, and 
  then link in /lib/libm.so as well.  It would also create its own 
  /usr/local/include/math.h and /usr/local/include/complex.h as well.
  
  Basically, as long as the compiler searches /usr/local/{include,lib}
  before the base include/lib then math.h, complex.h and -lm give
  the application a complete C99 math implementation by using base
  functions where they exist and cephes functions where they don't.
  
  The patch I wrote for sage can be found at
  http://trac.sagemath.org/sage_trac/ticket/9543
  If there's any interest, I could produce a port for this.
  
  Another option would be to import cephes into base and use it to
  provide the missing C99 functions.  Cephes includes copyright notices
  but the closest I can find to a license is:
 Some software in this archive may be from the book _Methods and
   Programs for Mathematical Functions_ (Prentice-Hall or Simon  Schuster
   International, 1989) or from the Cephes Mathematical Library, a
   commercial product. In either event, it is copyrighted by the author.
   What you see here may be used freely but it comes with no support or
   guarantee.
 
 Please talk to das@ (although I believe he's finishing up his
 dissertation).  I recall that he's stated that he looked into
 using cephes, and concluded that it is not suitable for libm.
 
 Note there is also
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/147599
 
 which I've also objected to importing into libm.

I do think we should provide something in ports as an interim solution.
There are other 3rd party applications looking to drop FreeBSD support
because we are missing APIs that almost all other OS's have.  I'm fine
if the interim lives in ports and that we don't import substandard
routines into the base.  I would even be fine with calling it 
/usr/local/lib/libm_inaccurate.so.  However, I do think we need an option.

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


Re: No reboot on shutdown -r

2012-05-31 Thread John Baldwin
On Wednesday, May 30, 2012 2:31:06 pm Larry Rosenman wrote:
 For the last month or so, when I reboot via shtudown -r the machine
 sits at All Buffers Flushed, and I have to hit it with a IPMI reset.
 
 What can I do to help debug this?
 
 Current rev:
 
 FreeBSD borg.lerctr.org 10.0-CURRENT FreeBSD 10.0-CURRENT #38 r236314: Wed 
May 30 11:10:24 CDT 2012 r...@borg.lerctr.org:/usr/obj/usr/src/sys/BORG-
DTRACE  amd64
 
 
 I can provide anything else needed.

Did you have any hung NFS mounts (that is, the NFS server was down)?  I have 
seen reboot hangs due to that on 7 and 8.

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


Re: No reboot on shutdown -r

2012-05-31 Thread Larry Rosenman

On Thu, May 31, 2012 10:46 am, John Baldwin wrote:
 On Wednesday, May 30, 2012 2:31:06 pm Larry Rosenman wrote:
 For the last month or so, when I reboot via shtudown -r the machine
 sits at All Buffers Flushed, and I have to hit it with a IPMI reset.

 What can I do to help debug this?

 Current rev:

 FreeBSD borg.lerctr.org 10.0-CURRENT FreeBSD 10.0-CURRENT #38 r236314:
 Wed
 May 30 11:10:24 CDT 2012
 r...@borg.lerctr.org:/usr/obj/usr/src/sys/BORG-
 DTRACE  amd64


 I can provide anything else needed.

 Did you have any hung NFS mounts (that is, the NFS server was down)?  I
 have
 seen reboot hangs due to that on 7 and 8.

No, the NFS NAS was up and functioning.



-- 
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 512-248-2683 E-Mail: l...@lerctr.org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3893


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


Re: Use of C99 extra long double math functions after r236148

2012-05-31 Thread Stephen Montgomery-Smith

On 05/31/12 10:45, John Baldwin wrote:

On Monday, May 28, 2012 7:02:18 pm Steve Kargl wrote:

On Tue, May 29, 2012 at 07:05:07AM +1000, Peter Jeremy wrote:

On 2012-May-28 11:01:24 -0500, Stephen Montgomery-Smith

step...@missouri.edu  wrote:

One thing that could be done is to have a math/cephes port that adds
the extra C99 math functions.  This is already done in the math/sage
port, using a rather clever patch due to Peter Jeremy, that applies to
the cephes code.

What it would do is to create a /usr/local/lib/libm.so that would
provide the extra functions not currently included in /lib/libm.so, and
then link in /lib/libm.so as well.  It would also create its own
/usr/local/include/math.h and /usr/local/include/complex.h as well.


Basically, as long as the compiler searches /usr/local/{include,lib}
before the base include/lib thenmath.h,complex.h  and -lm give
the application a complete C99 math implementation by using base
functions where they exist and cephes functions where they don't.

The patch I wrote for sage can be found at
http://trac.sagemath.org/sage_trac/ticket/9543
If there's any interest, I could produce a port for this.

Another option would be to import cephes into base and use it to
provide the missing C99 functions.  Cephes includes copyright notices
but the closest I can find to a license is:
   Some software in this archive may be from the book _Methods and
  Programs for Mathematical Functions_ (Prentice-Hall or Simon  Schuster
  International, 1989) or from the Cephes Mathematical Library, a
  commercial product. In either event, it is copyrighted by the author.
  What you see here may be used freely but it comes with no support or
  guarantee.


Please talk to das@ (although I believe he's finishing up his
dissertation).  I recall that he's stated that he looked into
using cephes, and concluded that it is not suitable for libm.

Note there is also

http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/147599

which I've also objected to importing into libm.


I do think we should provide something in ports as an interim solution.
There are other 3rd party applications looking to drop FreeBSD support
because we are missing APIs that almost all other OS's have.  I'm fine
if the interim lives in ports and that we don't import substandard
routines into the base.  I would even be fine with calling it
/usr/local/lib/libm_inaccurate.so.  However, I do think we need an option.



I think it should be called libm.so.  Otherwise we have to do a serious 
editing job on the Makefiles/configure scripts.


sed -E 's/[[::]]-lm[[::]]/-lm_inaccuarate/'

might have some false positives and false negatives.  (Did I even get 
the sed syntax correct?)




By the way, I was looking through:
http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/147599

They say they compute cosh(2y) - cos(2x) using Taylor's series.  I would 
agree with Steve that this is seriously low quality.  Floating point 
errors are likely to be truly horrible.  This will fail even for 
non-edge cases.  (This was the same error that openoffice used to have 
for computing erf(x), that gave things like erf(100) = -4353243242.)


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


Re: OptionalObsoleteFiles.inc completeness

2012-05-31 Thread Peter Jeremy
On 2012-May-30 13:27:03 +1000, Peter Jeremy pe...@rulingia.com wrote:
On 2012-May-29 02:18:25 +0400, Dmitry Marakasov amd...@amdmi3.ru wrote:
Then you should try to profile it - my script basically runs
delete-old delete-old-libs for every knob (131 of them), and it
hadn't taken more than 4 seconds even once.

I've done some investigating and the problem is that xargs -n1
fork()/exec()s /bin/echo on each file (and there are 5538 files for
me).  Changing this to tr ' ' '\n' reduces make delete-old runtime
to 1.75s - which is much nicer.  I've checked a variety of other
systems running 8.x  9.x and the 97s seems to be anomalously long so
I'll do some more investigating.

I've tracked the problem down to excessive VM faults caused by
jemalloc.  Whilst executing /bin/echo, jemalloc mmap()s two 4MiB
chunks of memory.  Unless you build with MALLOC_PRODUCTION (which I
hadn't), it then proceeds to verify that both blocks are zero-filled.
This causes 2048 (unnecessary) page faults (out of a total of 2133).
When I rebuilt jemalloc with MALLOC_PRODUCTION, this dropped to 87
page faults (cf 76 an 8.x and 62 on 9.x) and the elapsed time for
make delete-old dropped to slightly more than 8.x  9.x.

xargs -n1 is probably a worst case scenario for jemalloc but this
probably similarly affects other short-lived processes (and the shell
scripts that invoke them).  It's a pity that this particular test is a
compile-time option.

I still think that saving 5500 fork()/exec() pairs is a good reason
to switch from xargs -n1 to tr ' ' '\n'.

-- 
Peter Jeremy


pgp66hvYrS7pF.pgp
Description: PGP signature


Re: Use of C99 extra long double math functions after r236148

2012-05-31 Thread Daniel O'Connor

On 01/06/2012, at 2:42, Stephen Montgomery-Smith wrote:
 
 I do think we should provide something in ports as an interim solution.
 There are other 3rd party applications looking to drop FreeBSD support
 because we are missing APIs that almost all other OS's have.  I'm fine
 if the interim lives in ports and that we don't import substandard
 routines into the base.  I would even be fine with calling it
 /usr/local/lib/libm_inaccurate.so.  However, I do think we need an option.
 
 
 I think it should be called libm.so.  Otherwise we have to do a serious 
 editing job on the Makefiles/configure scripts.
 
 sed -E 's/[[::]]-lm[[::]]/-lm_inaccuarate/'
 
 might have some false positives and false negatives.  (Did I even get the sed 
 syntax correct?)


Another option would be to put it in base but bleat about it if it's actually 
used (like mktemp et al)

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






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


Re: Chrome crashing system (amd64-10.0-CURRENT)

2012-05-31 Thread Cy Schubert
In message 20120517071141.gl2...@thinkbsd.divinix.org, John Hixson writes:
 On Thu, May 17, 2012 at 01:15:54AM -0500, Conrad J. Sabatier wrote:
  For the last week or so, I've been unable to run chrome.  Any attempt
  to start it up will cause the system either to freeze up or reboot.
  
  To make matters worse, no trace of what's happening is anywhere to be
  found.  Nothing in any log files.  The system doesn't drop into the
  kernel debugger, either.  It's either a hard freeze or sudden reboot.
  
  I've tried rebuilding the chromium port, with both clang and gcc 4.6,
  to no avail.  I've also updated the system sources several times this
  week and remade world/kernel.  Nothing seems to help.
  
  I'm totally stumped as to how to determine what's going on here.  Any
  suggestions as to how to obtain some useful info?
  
 
 To add to this, I've had the same problem on 10-CURRENT for several months
 now.

I think we're dealing with two issues here. First, the application is 
passing out of bound data or corrupt data to the O/S. Secondly, FreeBSD 
should be able to withstand this (DoS).


-- 
Cheers,
Cy Schubert cy.schub...@komquats.com
FreeBSD UNIX:  c...@freebsd.org   Web:  http://www.FreeBSD.org



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