Re: best approximation of getcpu() ?

2016-12-16 Thread Luigi Rizzo
On Fri, Dec 16, 2016 at 09:29:15AM +, David Chisnall wrote: > On 16 Dec 2016, at 03:10, Alan Somers wrote: > > > > What about pthread_setaffinity(3) and friends? You can use it to pin > > a thread to a single CPU, and know that it will never migrate. > > This is not a

best approximation of getcpu() ?

2016-12-15 Thread Luigi Rizzo
TL;DR; is there any way a userspace thread in FreeBSD can tell on which CPU it is (was) running ? I know the thread can migrate at any time but as long as the event is rare I can live with the occasionally wrong information. Linux has getcpu(2) which is exposed by glibc as sched_getcpu(3), but the

Re: CURRENT:Build Break

2016-10-16 Thread Luigi Rizzo
http://www.lerctr.org/~ler > Phone: +1 214-642-9640 E-Mail: l...@lerctr.org > US Mail: 17716 Limpia Crk, Round Rock, TX 78664-7281 > -- -----+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. de

Re: stall-free memory reads ? (possibly stale) ?

2016-04-11 Thread Luigi Rizzo
thank you, much appreciated. On Fri, Apr 8, 2016 at 11:22 PM, Slawa Olhovchenkov <s...@zxy.spb.ru> wrote: > On Fri, Apr 08, 2016 at 06:24:16PM +0200, Luigi Rizzo wrote: > > > Hi, > > I have an application with two threads sharing a memory variable, > > one continuo

stall-free memory reads ? (possibly stale) ?

2016-04-08 Thread Luigi Rizzo
Hi, I have an application with two threads sharing a memory variable, one continuously writing, one continuously reading. Because of the way my system works, the reader can tolerate reading stale data, but it should not stall on memory reads (the line is on the local cache for the reader, just

Re: accessing a PCIe register from userspace through kmem or other ways ?

2016-04-01 Thread Luigi Rizzo
On Thu, Mar 31, 2016 at 11:55 PM, Ryan Stone <ryst...@gmail.com> wrote: > On Thu, Mar 31, 2016 at 4:39 PM, John Baldwin <j...@freebsd.org> wrote: > >> On Wednesday, March 30, 2016 11:20:51 AM Jim Harris wrote: >> > On Wed, Mar 30, 2016 at 10:47 AM, Luigi Ri

accessing a PCIe register from userspace through kmem or other ways ?

2016-03-30 Thread Luigi Rizzo
-- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita` di Pisa TEL +39-050-2217533 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy

Re: three new netmap tools: pcap player, link emulator, load distributor

2016-02-22 Thread Luigi Rizzo
On Mon, Feb 22, 2016 at 3:55 PM, Slawa Olhovchenkov <s...@zxy.spb.ru> wrote: > On Mon, Feb 22, 2016 at 02:40:15PM -0800, Luigi Rizzo wrote: >> please try now. > > compiled, ok. > and i need wrote some apps for forwarding from pipes to output > interface? just use mu

Re: three new netmap tools: pcap player, link emulator, load distributor

2016-02-22 Thread Luigi Rizzo
On Mon, Feb 22, 2016 at 10:16 AM, Slawa Olhovchenkov <s...@zxy.spb.ru> wrote: > On Mon, Feb 22, 2016 at 08:17:06AM -0800, Luigi Rizzo wrote: > >> Give this a try and let us know. > > I can't compile this. > > # cc -o lb lb.c > lb.c:17:10: fatal error: 'ctrs.h'

Re: three new netmap tools: pcap player, link emulator, load distributor

2016-02-22 Thread Luigi Rizzo
On Monday, February 22, 2016, Slawa Olhovchenkov <s...@zxy.spb.ru> wrote: > On Sun, Feb 21, 2016 at 10:18:36AM -0800, Luigi Rizzo wrote: > > > lb > > a packet distributor that reads from a netmap port and distributes > > traffic to multiple netmap ports, using

three new netmap tools: pcap player, link emulator, load distributor

2016-02-21 Thread Luigi Rizzo
added a few features. Feedback welcome cheers luigi -- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita` di Pisa TEL +39-050-2217533

Re: libXO-ification - Why - and is it a symptom of deeper issues?

2015-11-18 Thread Luigi Rizzo
On Wed, Nov 18, 2015 at 11:32 AM, Lars Engels wrote: > On Sun, Nov 15, 2015 at 01:14:57PM -0500, Allan Jude wrote: >> You can setup an atexit() call to call xo_finish automatically when the >> program exits. The original changes to uptime had a few other issues, >> which I

nice stuff from cloudflare (and, we need something like ethtool!)

2015-10-10 Thread Luigi Rizzo
mechanism to configure traffic steering. We really need to address the latter. cheers luigi -- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita

proper way to terminate a kthread when the parent process dies ?

2015-08-04 Thread Luigi Rizzo
-- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita` di Pisa TEL +39-050-2217533 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy

Re: proper way to terminate a kthread when the parent process dies ?

2015-08-04 Thread Luigi Rizzo
On Tue, Aug 4, 2015 at 4:53 PM, Konstantin Belousov kostik...@gmail.com wrote: On Tue, Aug 04, 2015 at 04:38:14PM +0200, Luigi Rizzo wrote: Hi, we have a doubt on the proper way to terminate a kernel thread that has been associated to a user process U within a system call

Re: proper way to terminate a kthread when the parent process dies ?

2015-08-04 Thread Luigi Rizzo
On Tue, Aug 4, 2015 at 6:02 PM, Konstantin Belousov kostik...@gmail.com wrote: On Tue, Aug 04, 2015 at 05:32:28PM +0200, Luigi Rizzo wrote: On Tue, Aug 4, 2015 at 4:53 PM, Konstantin Belousov kostik...@gmail.com wrote: If this is a thread of the normal user process, then it is not a kernel

eventfd lookalike in FreeBSD ?

2015-07-28 Thread Luigi Rizzo
Hi, for some work we are doing on bhyve, we need some lightweight mechanism that a kernel thread can use to wake up another user thread possibly waiting for some event. If the recipient of the event were a kernel thread it would simply do a tsleep(chan...) and the sender would do a wakeup() or

protection against module unloading ?

2015-07-13 Thread Luigi Rizzo
luigi -- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita` di Pisa TEL +39-050-2217533 . via Diotisalvi 2 Mobile +39-338

Re: protection against module unloading ?

2015-07-13 Thread Luigi Rizzo
On Mon, Jul 13, 2015 at 03:46:03PM +0300, Konstantin Belousov wrote: On Mon, Jul 13, 2015 at 02:28:40PM +0200, Luigi Rizzo wrote: Hi, I am trying to understand how to protect efficiently against module removals when a device driver is in use. This issue came up some time ago when trying

Re: protection against module unloading ?

2015-07-13 Thread Luigi Rizzo
On Mon, Jul 13, 2015 at 06:29:12PM +0300, Konstantin Belousov wrote: On Mon, Jul 13, 2015 at 05:00:30PM +0200, Luigi Rizzo wrote: ... thanks a lot for the clarification on the intent. I clearly need to understand more on the architecture of the module unload. In any case: the global

gcc/amd64 head build error after r281316

2015-07-08 Thread Luigi Rizzo
Hi, the r281316 commit introduces the following lines which break compilation with gcc on amd64 (as far as i know immintrin.h is only available in our clang). If there are no objections I'd like to add a further check for the use of clang, see attached patch Index:

Re: gcc/amd64 head build error after r281316

2015-07-08 Thread Luigi Rizzo
On Wed, Jul 8, 2015 at 9:36 PM, Dimitry Andric d...@freebsd.org wrote: On 08 Jul 2015, at 19:05, Luigi Rizzo ri...@iet.unipi.it wrote: the r281316 commit introduces the following lines which break compilation with gcc on amd64 (as far as i know immintrin.h is only available in our clang

Re: PicoBSD build error after r281316

2015-06-22 Thread Luigi Rizzo
: http://github.com/stefano-garzarella linkedin: http://it.linkedin.com/pub/stefano-garzarella -- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita

Re: superpages in FreeBSD (netmap related) ?

2015-06-01 Thread Luigi Rizzo
On Monday, June 1, 2015, Marko Zec z...@fer.hr wrote: On Mon, 1 Jun 2015 11:34:00 +0200 Luigi Rizzo ri...@iet.unipi.it javascript:; wrote: Hi, i was wondering how we can improve the netmap memory allocator to make use of 2M pages (through the page promotion trick). in netmap, when we

superpages in FreeBSD (netmap related) ?

2015-06-01 Thread Luigi Rizzo
is mapped to 2M pages ? cheers luigi -- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita` di Pisa TEL +39-050-2217533 . via

per file descriptor device driver data ?

2015-05-29 Thread Luigi Rizzo
Hi, in the kernel module for netmap we need to store some private data associated to each open netmap file descriptor. Our current design uses devfs_set_cdevpriv() during the open() handler, but for some reason a subsequent devfs_get_cdevpriv(p) returns *p = NULL in additional threads created by

heads up: netmap code update next week.

2015-05-21 Thread Luigi Rizzo
Hi, some time next week we will push to head (and hopefully, to stable/10 before the code slush) an update to the netmap code. There will be no API changes, and the changes are mostly internal restructuring of the netmap kernel code and simplification of device drivers (we will ll handle most of

pedantic compiler warnings: double semicolons, function to data pointers

2015-05-19 Thread Luigi Rizzo
While trying to compile some of my (kernel) code in different environments, i noticed a couple of errors that perhaps might be worth fixing - extra semicolons. These come either from explicit repetitions in the code (see the output of a grep at the end of this message), or sometimes from the

netmap support for the Intel 40G card in head

2015-02-23 Thread Luigi Rizzo
, 24 Mpps on rx with two ports on the same card connected to each other. This is our second 40G device for which we have native netmap support, which makes FreeBSD quite unique. cheers luigi Date: Tue, 24 Feb 2015 06:20:51 + (UTC) From: Luigi Rizzo lu...@freebsd.org Subject: svn commit: r279232

process checkpoint and migration support?

2015-02-13 Thread Luigi Rizzo
the process must be stopped during a migration). Cheers Luigi -- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita` di Pisa TEL +39-050-2211611

howto: nvidia geforce210 and 4k display

2015-02-06 Thread Luigi Rizzo
Thought this might be useful to others: I have managed to use the nvidia geforce210 card with a 4k display and am attaching below the relevant xorg.conf info: -- # ... Section Monitor Identifier seiki39u Modeline 4k25 225 3840 3900 3950 4000 2160 2168 2178

Re: PSA: If you run -current, beware!

2015-02-05 Thread Luigi Rizzo
On Thu, Feb 05, 2015 at 08:21:45AM -0500, John Baldwin wrote: On Thursday, February 05, 2015 08:48:33 AM Luigi Rizzo wrote: ... It is fixed (in the proper meaning of the word, not like worked around, covered by paper) by the patch at the end of the mail. We already have a story

Re: PSA: If you run -current, beware!

2015-02-04 Thread Luigi Rizzo
wider exercise. -- Peter Wemm - pe...@wemm.org javascript:;; pe...@freebsd.org; pe...@yahoo-inc.com javascript:;; KI6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 -- -+--- Prof. Luigi RIZZO, ri

Re: PSA: If you run -current, beware!

2015-02-03 Thread Luigi Rizzo
Signed 32 bit overflow it seems from the numbers ? Wasn't that a windows feature in the old days ? :) Cheers Luigi -- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it

elftoolchain version of strip unlinks hard-linked files ?

2015-01-24 Thread Luigi Rizzo
I just found that recent versions of 'strip' on head (the change occurred between svn 276756 and 277633, not in the code but with the change from GNU binutils to the elf toolchain) when operating on hard-linked files, creates a new file instead of modifying the original: This is the old

false alarm (Re: invalid checksum with vtnet and in_kernel BOOTP)

2015-01-05 Thread Luigi Rizzo
for the records, this was not a problem with vtnet but a bug in some bhyve modifications of ours. Thanks to Bryan who pointed out the potential location of the problem. cheers luigi On Sat, Jan 03, 2015 at 08:00:22PM +0100, Luigi Rizzo wrote: I am trying to run a diskless bhyve client diskless

BOOTP_SETTLE_DELAY in sys/nfs/bootp_subr.c ?

2015-01-04 Thread Luigi Rizzo
[I realize this is code from 15 years ago so i am not sure if anyone still knows or remembers the answer] sys/nfs/bootp_subr.c is used to request via bootp or dhcp an address and a boot path. The negotiation is done in a loop, and apparently when replies are received on _all_ interfaces, the code

Re: any primer on running bhyve guests sharing disk with host ?

2015-01-04 Thread Luigi Rizzo
On Sat, Jan 03, 2015 at 11:00:13AM -0800, Neel Natu wrote: Hi Luigi, On Sat, Jan 3, 2015 at 8:15 AM, Luigi Rizzo ri...@iet.unipi.it wrote: Hi, in order to do some kernel testing, I would like to run bhyve guests using (through NFS, probably) the host's file system. diskless(8

any primer on running bhyve guests sharing disk with host ?

2015-01-03 Thread Luigi Rizzo
Hi, in order to do some kernel testing, I would like to run bhyve guests using (through NFS, probably) the host's file system. diskless(8) is probably one way to go, i was wondering if someone has instructions for that. Specifically: - how to bhyveload a kernel (rather than the full disk image);

invalid checksum with vtnet and in_kernel BOOTP

2015-01-03 Thread Luigi Rizzo
I am trying to run a diskless bhyve client diskless using in-kernel bootp support and vtnet connected to tap and bridge on the host side and I am having the problem in the subject which may be vtnet-related. Packets generated by the in-kernel DHCP arrive to the host tap interface with a corrupt

wrapping a vararg C function (specifically, log() in the kernel)

2014-12-18 Thread Luigi Rizzo
Hi, in the porting of some kernel code to FreeBSD, i need to remap one function with a variable number of arguments to the log() function from the freebsd kernel. Normally i would do #define WARN(x, args...)log(LOG_WARNING, args) but this does not work in my case because the

comments on code-in tasks for FreeBSD (Re: FreeBSD + Google Code-In 2014 = we need ideas.)

2014-11-13 Thread Luigi Rizzo
-- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA

Re: netmap: extension to store user data per packet/slot?

2014-11-12 Thread Luigi Rizzo
On Wed, Nov 12, 2014 at 11:16 AM, Slawa Olhovchenkov s...@zxy.spb.ru wrote: On Tue, Nov 11, 2014 at 10:13:54PM +0100, Franco Fichtner wrote: Hi Luigi, hi all, so I was running into logistics issues with netmap(4) with regard to zero-copy and redirection through pipes: working on a

Re: netmap: extension to store user data per packet/slot?

2014-11-11 Thread Luigi Rizzo
-- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy

Re: dev_lock() contention for fdesc syscalls -- possible fix

2014-11-10 Thread Luigi Rizzo
On Mon, Nov 10, 2014 at 10:34:57AM +0200, Konstantin Belousov wrote: On Mon, Nov 10, 2014 at 02:49:39AM +0100, Luigi Rizzo wrote: It was noticed that there is huge dev_lock() contention when multiple processes do a poll() even on independent file descriptors. Turns out that not just poll

dev_lock() contention for fdesc syscalls -- possible fix

2014-11-09 Thread Luigi Rizzo
It was noticed that there is huge dev_lock() contention when multiple processes do a poll() even on independent file descriptors. Turns out that not just poll but most syscalls on file descriptors (as opposed to sockets) in sys/fs/devfs/devfs_vnops.c including devfs_poll_f(), devfs_ioctl_f() and

adding netmap support to libpcap in FreeBSD

2014-10-02 Thread Luigi Rizzo
+++ lib/libpcap/pcap-netmap.c 2014-10-02 23:37:33.0 +0200 @@ -0,0 +1,265 @@ +/* + * Copyright (C) 2014 Luigi Rizzo. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions

capsicum and netmap ?

2014-09-29 Thread Luigi Rizzo
Hi, while trying the netmap-enabled libpcap library with tcpdump, i noticed it fails to return data on a kernel with capsicum (the string capability mode sandbox enabled made me suspicious, and removing the cap_*() calls from tcpdump.c seems to make things work again). Would anyone be able to

Re: capsicum and netmap ?

2014-09-29 Thread Luigi Rizzo
On Mon, Sep 29, 2014 at 05:27:09PM +, Brooks Davis wrote: On Mon, Sep 29, 2014 at 05:30:43PM +0200, Luigi Rizzo wrote: Hi, while trying the netmap-enabled libpcap library with tcpdump, i noticed it fails to return data on a kernel with capsicum (the string capability mode sandbox

Re: capsicum and netmap ?

2014-09-29 Thread Luigi Rizzo
On Mon, Sep 29, 2014 at 06:53:08PM +, Brooks Davis wrote: On Mon, Sep 29, 2014 at 08:20:08PM +0200, Luigi Rizzo wrote: ... The nm_open() (which includes open and mmap) occurs before the cap_enter() call, and poll() works fine until we do the cap_enter()/cap_sandboxed() calls. I

RFC: please put back spare fields in struct ifnet (removed in svn 270870)

2014-09-09 Thread Luigi Rizzo
hi, sorry if i just noticed it recently. svn 270870 removed all the if_*spare fields in struct ifnet. They are replaced with the following comment /* * Spare fields to be added before branching a stable branch, so * that structure can be enhanced without changing the kernel * binary

Re: RFC: please put back spare fields in struct ifnet (removed in svn 270870)

2014-09-09 Thread Luigi Rizzo
On Tue, Sep 9, 2014 at 12:37 PM, Gleb Smirnoff gleb...@freebsd.org wrote: Luigi, On Tue, Sep 09, 2014 at 12:13:42PM +0200, Luigi Rizzo wrote: L svn 270870 removed all the if_*spare fields in struct ifnet. L They are replaced with the following comment L L /* L * Spare fields

Re: RFC: please put back spare fields in struct ifnet (removed in svn 270870)

2014-09-09 Thread Luigi Rizzo
On Tue, Sep 9, 2014 at 2:17 PM, Gleb Smirnoff gleb...@freebsd.org wrote: Luigi, On Tue, Sep 09, 2014 at 01:01:13PM +0200, Luigi Rizzo wrote: L The harm is obvious: someone commits code that _uses_ spare field L without assigning it a new name. Spare field is a placeholder. Of L course

Re: [RFC] Add support for hardware transmit rate limiting queues [WAS: Add support for changing the flow ID of TCP connections]

2014-08-20 Thread Luigi Rizzo
On Wed, Aug 20, 2014 at 9:34 AM, Hans Petter Selasky h...@selasky.org wrote: Hi, A month has passed since the last e-mail on this topic, and in the meanwhile some new patches have been created and tested: Basically the approach has been changed a little bit: - The creation of hardware

Re: [RFC] Add support for hardware transmit rate limiting queues [WAS: Add support for changing the flow ID of TCP connections]

2014-08-20 Thread Luigi Rizzo
On Wed, Aug 20, 2014 at 3:29 PM, Hans Petter Selasky h...@selasky.org wrote: Hi Luigi, On 08/20/14 11:32, Luigi Rizzo wrote: On Wed, Aug 20, 2014 at 9:34 AM, Hans Petter Selasky h...@selasky.org wrote: Hi, A month has passed since the last e-mail on this topic, and in the meanwhile

Re: android bsd connectivity tools etc ?

2014-08-14 Thread Luigi Rizzo
On Thu, Aug 14, 2014 at 09:40:56AM +0200, Lars Engels wrote: On Thu, Aug 14, 2014 at 08:29:37AM +0200, Per olof Ljungmark wrote: On 08/14/14 01:47, Julian H. Stacey wrote: Hi, Any tips for Android / FreeBSD BSD tools for connectivity etc ? ... There's also Airdroid [1]. After installing

Re: Fix Emulex oce driver in CURRENT

2014-07-07 Thread Luigi Rizzo
On Mon, Jul 7, 2014 at 1:03 PM, Borja Marcos bor...@sarenet.es wrote: On Jul 1, 2014, at 10:24 PM, Luigi Rizzo wrote: On Tue, Jul 1, 2014 at 8:58 PM, bor...@sarenet.es wrote: El 30.06.2014 18:36, Stefano Garzarella escribió: Hello, I had problems during some experiments with Emulex

Re: Fix Emulex oce driver in CURRENT

2014-07-07 Thread Luigi Rizzo
On Mon, Jul 7, 2014 at 1:57 PM, Borja Marcos bor...@sarenet.es wrote: ... The environment details are here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=183391 The way I produce an instant panic is: 1) Connect to another machine (cross connect cable) 2) iperf3 -s on the other

Re: FreeBSD iscsi target

2014-07-04 Thread Luigi Rizzo
On Fri, Jul 4, 2014 at 12:16 PM, Slawa Olhovchenkov s...@zxy.spb.ru wrote: On Thu, Jul 03, 2014 at 08:39:42PM -0700, Kevin Oberman wrote: In real world Reality is quite different than it actually is.

Re: Fix Emulex oce driver in CURRENT

2014-07-01 Thread Luigi Rizzo
On Tue, Jul 1, 2014 at 8:58 PM, bor...@sarenet.es wrote: El 30.06.2014 18:36, Stefano Garzarella escribió: Hello, I had problems during some experiments with Emulex and oce driver in CURRENT. I found several bugs in the oce driver and this patch fixes them. At least with some cards, the

do we have a generic string-number sysctl mapping library ?

2014-06-27 Thread Luigi Rizzo
Hi, I have frequently found myself using sysctls to control some kernel feature where a string would be a better (and sometimes the only) option than using a numeric value, yet the internal representation should be numeric for speed and robustness. Examples are the kern.timecounter, the default

Re: do we have a generic string-number sysctl mapping library ?

2014-06-27 Thread Luigi Rizzo
On Fri, Jun 27, 2014 at 11:27:56AM +0200, Trond Endrest?l wrote: On Fri, 27 Jun 2014 11:14+0200, Luigi Rizzo wrote: Hi, I have frequently found myself using sysctls to control some kernel feature where a string would be a better (and sometimes the only) option than using a numeric value

Re: Problems building FreeBSD 9.2 on FreeBSD 10

2014-06-17 Thread Luigi Rizzo
On Tue, Jun 17, 2014 at 8:35 PM, Craig Rodrigues rodr...@freebsd.org wrote: Simon, Do you know if there is some sort of patch that can be applied to FreeBSD stable/9 sources so that it can be built on a FreeBSD 10/stable, or FreeBSD CURRENT host with bmake? I'm trying to build a FreeBSD

how to i get both clang and gcc4.2.1 in buildworld ?

2014-06-10 Thread Luigi Rizzo
As the subject says... i upgraded to stable/10 without special options, clang is the default compiler but the gcc4.2.1 whose sources are in the tree is not compiled. Is there any way to get both gcc and clang compiled during a buildworld ? Or any port that brings in the gcc 4.2.1 (and not one of

Re: netmap(4) transparent mode

2014-06-09 Thread Luigi Rizzo
-- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875

BUG: some drivers return ENOBUFS when the mbuf is actually queued

2014-06-04 Thread Luigi Rizzo
Hi, if I read correctly the code, there are a few network device drivers (igb, ixgbe, i40e, vtnet, vmxnet) where ifp-if_transmit(ifp, m) can return ENOBUFS even when 'm' has _not_ been dropped: e1000/if_igb.c :: igb_mq_start() can return ENOBUFS from igb_xmit()

Re: Select() vs Netmap

2014-06-01 Thread Luigi Rizzo
:; mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org javascript:; -- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing

Select() vs Netmap

2014-06-01 Thread Luigi Rizzo
-- -+--- Prof. Luigi RIZZO, ri...@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/. Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy

Re: BSD XXI Manifesto [agree] [intersting]

2014-02-21 Thread Luigi Rizzo
On Fri, Feb 21, 2014 at 8:59 PM, Allan Jude free...@allanjude.com wrote: On 2014-02-21 21:21, Julian Elischer wrote: On 2/18/14, 3:28 PM, Wojciech A. Koszek wrote: (cross-posted message: eventual discussion let's keep on hackers@) Hello, After being disappointed with the list of

Re: HEAD buildkernel error (aic7xxx_seq.h is missing. Run 'make ahcfirmware')

2014-02-18 Thread Luigi Rizzo
On Tue, Feb 18, 2014 at 11:24 AM, Ian Lepore i...@freebsd.org wrote: On Fri, 2014-02-14 at 13:46 -0800, Luigi Rizzo wrote: On Fri, Feb 14, 2014 at 10:23 AM, Ian Lepore i...@freebsd.org wrote: On Fri, 2014-02-14 at 18:35 +0100, Luigi Rizzo wrote: on a freshly checked out HEAD, make

HEAD buildkernel error (aic7xxx_seq.h is missing. Run 'make ahcfirmware')

2014-02-14 Thread Luigi Rizzo
on a freshly checked out HEAD, make toolchain followed by make buildkernel fails at this stage: ... @ - /usr/home/luigi/FreeBSD/head/sys machine - /usr/home/luigi/FreeBSD/head/sys/amd64/include x86 - /usr/home/luigi/FreeBSD/head/sys/x86/include Error:

Re: HEAD buildkernel error (aic7xxx_seq.h is missing. Run 'make ahcfirmware')

2014-02-14 Thread Luigi Rizzo
On Fri, Feb 14, 2014 at 10:23 AM, Ian Lepore i...@freebsd.org wrote: On Fri, 2014-02-14 at 18:35 +0100, Luigi Rizzo wrote: on a freshly checked out HEAD, make toolchain followed by make buildkernel fails at this stage: ... @ - /usr/home/luigi/FreeBSD/head/sys

Re: HEAD buildkernel error (aic7xxx_seq.h is missing. Run 'make ahcfirmware')

2014-02-14 Thread Luigi Rizzo
On Fri, Feb 14, 2014 at 10:23 AM, Ian Lepore i...@freebsd.org wrote: On Fri, 2014-02-14 at 18:35 +0100, Luigi Rizzo wrote: on a freshly checked out HEAD, make toolchain followed by make buildkernel fails at this stage: ... @ - /usr/home/luigi/FreeBSD/head/sys

Re: possible selrecord optimization ?

2014-01-23 Thread Luigi Rizzo
On Thu, Jan 23, 2014 at 02:52:41PM -0500, John Baldwin wrote: On Wednesday, January 22, 2014 7:39:48 pm Luigi Rizzo wrote: ... 2. am i correct that we do need to protect concurrent invocations of selrecord() on the same selinfo because mtx_pool_find() return the same mutex for a given

any use for sys/sys/selinfo.h outside the kernel ?

2014-01-22 Thread Luigi Rizzo
Looking at sys/sys/selinfo.h i see that parts of it are in #ifdef _KERNEL ... #endif but it seems to me that also the remaining content (definition of struct selinfo) is only of use within the kernel -- or possibly to programs who want to peek into kmem. So i wonder,

Re: possible selrecord optimization ?

2014-01-22 Thread Luigi Rizzo
On Wed, Jan 22, 2014 at 02:29:56PM -0500, John Baldwin wrote: On Tuesday, January 21, 2014 9:25:27 pm Luigi Rizzo wrote: Looking at how selrecord() / selwakeup() and their Linux counterparts poll_wait() and wake_up() are used, i noticed the following: I wonder if we could use the same

possible selrecord optimization ?

2014-01-21 Thread Luigi Rizzo
Looking at how selrecord() / selwakeup() and their Linux counterparts poll_wait() and wake_up() are used, i noticed the following: - linux tends to call wake_up() unconditionally at the beginning of the poll handler - FreeBSD tends to call selrecord() only when it detects a blocking

Re: picking a new AF_* number for NETLINK ?

2014-01-17 Thread Luigi Rizzo
On Fri, Jan 17, 2014 at 7:57 AM, Alexander V. Chernikov melif...@freebsd.org wrote: On 17.01.2014 03:19, Luigi Rizzo wrote: In porting the kernel openvswitch code to FreeBSD we have implemented netlink sockets, so we need to pick a Wow, great! How deep you're planning to go with netlink

svn 260311 breaks gcc builds on releng9 ?

2014-01-17 Thread Luigi Rizzo
Hi, I am seeing an odd problem which seems to be triggered by svn260311 I have two machines running snapshots of stable/9 from last fall (one 255898 sep.26, the other 258126 nov.14). All is amd64 Build a recent head (260311 and newer) with gcc fails on the sep.26 machine: ...

Re: svn 260311 breaks gcc builds on releng9 ?

2014-01-17 Thread Luigi Rizzo
On Fri, Jan 17, 2014 at 12:50 PM, Pedro Giffuni p...@freebsd.org wrote: Hello Luigi; On 17.01.2014 15:18, Luigi Rizzo wrote: Hi, I am seeing an odd problem which seems to be triggered by svn260311 I have two machines running snapshots of stable/9 from last fall (one 255898 sep.26

Re: svn 260311 breaks gcc builds on releng9 ?

2014-01-17 Thread Luigi Rizzo
On Fri, Jan 17, 2014 at 04:26:30PM -0500, Pedro Giffuni wrote: On 17.01.2014 16:07, Luigi Rizzo wrote: ... The Apple change was incomplete so I guess the compiler in head is not being strict enough. I removed the dead code and rebuilt. Should be fixed as r260831. Thank you for the report

picking a new AF_* number for NETLINK ?

2014-01-16 Thread Luigi Rizzo
In porting the kernel openvswitch code to FreeBSD we have implemented netlink sockets, so we need to pick a number to use for AF_NETLINK/PF_NETLINK in the messages. Obviously we'd like ovs to be loadable as a module on existing kernels, so i wonder if there are any restrictions on what we can use

Re: unused in_cksum_update() ?

2014-01-10 Thread Luigi Rizzo
On Fri, Jan 10, 2014 at 02:31:40PM +0400, Gleb Smirnoff wrote: On Thu, Jan 09, 2014 at 08:21:14PM +0100, Luigi Rizzo wrote: L a lot of arch-specific headers (sys/${ARCH}/include/in_cksum.h) L have a lengthy definition for L Lin_cksum_update(struct ip *ip) L L which seems completely

unused in_cksum_update() ?

2014-01-09 Thread Luigi Rizzo
a lot of arch-specific headers (sys/${ARCH}/include/in_cksum.h) have a lengthy definition for in_cksum_update(struct ip *ip) which seems completely unused in our source tree. Time to remove it perhaps ? grep cannot find any use at least since stable/8 cheers luigi

Re: unused in_cksum_update() ?

2014-01-09 Thread Luigi Rizzo
On Thu, Jan 09, 2014 at 01:27:52PM -0800, Adrian Chadd wrote: It's likely used elsewhere; it's the kind of thing you abuse when doing header rewriting and reinjection. So, what's the NAT and such code using? natd/libalias has its own code with a DifferentialChecksum() function in

Re: RFC: less chatty system builds

2013-12-19 Thread Luigi Rizzo
On Thu, Dec 19, 2013 at 1:18 AM, David Chisnall thera...@freebsd.orgwrote: On 16 Dec 2013, at 21:35, Dimitry Andric d...@freebsd.org wrote: In any case, if anything like this is implemented, I would really prefer something like CMake does, e.g. give you a percentage counter that provides

Re: RFC: less chatty system builds

2013-12-19 Thread Luigi Rizzo
On Thu, Dec 19, 2013 at 09:57:38AM +, David Chisnall wrote: On 19 Dec 2013, at 09:40, Luigi Rizzo ri...@iet.unipi.it wrote: ... Oh, and when I do a build of LLVM/Clang on my laptop using Ninja, it takes about 3-5 minutes, whereas when I do it with our build system it takes about 15

Re: RFC: less chatty system builds

2013-12-18 Thread Luigi Rizzo
On Mon, Dec 16, 2013 at 10:35 PM, Dimitry Andric d...@freebsd.org wrote: On 16 Dec 2013, at 19:46, Luigi Rizzo ri...@iet.unipi.it wrote: The following is a proof-of-concept patch to make system builds less chatty. It also has the nice side effect of showing more clearly which rules

RFC can we use __builtin_prefetch() directly in our kernel sources ?

2013-12-16 Thread Luigi Rizzo
Is it ok in kernel code to use __builtin_prefetch() and assume that all supported compilers will do the right thing for all architectures ? I am asking is because I need to use prefetch() in a small number of places in my netmap code, and nothing in our kernel sources uses __builtin_prefetch()

RFC: less chatty system builds

2013-12-16 Thread Luigi Rizzo
The following is a proof-of-concept patch to make system builds less chatty. It also has the nice side effect of showing more clearly which rules are used during the build and possibly help debugging the share/mk files and the individual Makefiles. The logic is the following: the

'silent' kernel builds ?

2013-12-14 Thread Luigi Rizzo
Hi, I was trying to make buildkernel a bit quieter (just listing the name of the file being compiled). I hoped to modify the .c.o: rules in share/sys.mk but apparently kernel builds generate their own Makefile using definitions in sys/conf/kern.pre.mk . As a result, a patch like the one below

Re: 'silent' kernel builds ?

2013-12-14 Thread Luigi Rizzo
On Sat, Dec 14, 2013 at 09:53:30PM -0800, Rui Paulo wrote: On 14 Dec 2013, at 21:45, Luigi Rizzo ri...@iet.unipi.it wrote: Hi, I was trying to make buildkernel a bit quieter (just listing the name of the file being compiled). I hoped to modify the .c.o: rules in share/sys.mk

Re: [RFC] how to get the size of a malloc(9) block ?

2013-12-02 Thread Luigi Rizzo
On Mon, Dec 2, 2013 at 4:36 AM, jb jb.1234a...@gmail.com wrote: dt71 at gmx.com writes: So new flags could be [1]: - realloc_flags(p, s, REALLOCF_NO_MOVE) ... - realloc_flags(p, s, REALLOCF_NO_MOVE | REALLOCF_ELASTIC) ... For this, there could be a REALLOCF_FORCE flag In case

Re: [RFC] how to get the size of a malloc(9) block ?

2013-11-29 Thread Luigi Rizzo
On Thu, Nov 28, 2013 at 7:13 AM, jb jb.1234a...@gmail.com wrote: Luigi Rizzo rizzo at iet.unipi.it writes: ... But I don't understand why you find ksize()/malloc_usable_size() dangerous. ... The original crime is commited when *usable size* (an implementation detail) is exported

Re: [RFC] how to get the size of a malloc(9) block ?

2013-11-29 Thread Luigi Rizzo
On Fri, Nov 29, 2013 at 3:44 PM, jb jb.1234a...@gmail.com wrote: Luigi Rizzo rizzo at iet.unipi.it writes: ... There is a difference between applications peeking into implementation details that should be hidden, and providing instead limited and specific information through a well

Re: [RFC] how to get the size of a malloc(9) block ?

2013-11-29 Thread Luigi Rizzo
On Fri, Nov 29, 2013 at 4:49 PM, Adrian Chadd adr...@freebsd.org wrote: The reason I wouldn't implement this is to avoid having code that _relies_ on this behaviour in order to function or perform well. nobody ever said (or could reasonably expect to do) that. Applications don't know if the

Re: [RFC] how to get the size of a malloc(9) block ?

2013-11-29 Thread Luigi Rizzo
On Fri, Nov 29, 2013 at 5:02 PM, jb jb.1234a...@gmail.com wrote: Luigi Rizzo rizzo at iet.unipi.it writes: ... If you want to improve memory management, that is, have the system (kernel or user space) handle memory reallocation intelligently and transparently to the user, then aim

[RFC] how to get the size of a malloc(9) block ?

2013-11-28 Thread Luigi Rizzo
in porting some linux kernel code to FreeBSD we stumbled upon ksize(), which returns the actual size of a kmalloc() block. We could easily implement it as the first part of realloc(9) -- see kern/kern_malloc.c Would it make sense to add this to the malloc(9) API ? The userspace equivalent seems

Re: [RFC] how to get the size of a malloc(9) block ?

2013-11-28 Thread Luigi Rizzo
On Thu, Nov 28, 2013 at 01:33:41PM +, jb wrote: Luigi Rizzo rizzo at iet.unipi.it writes: in porting some linux kernel code to FreeBSD we stumbled upon ksize(), which returns the actual size of a kmalloc() block. We could easily implement it as the first part of realloc(9

Re: UMA cache back pressure

2013-11-18 Thread Luigi Rizzo
On Mon, Nov 18, 2013 at 10:20 AM, Alexander Motin m...@freebsd.org wrote: On 18.11.2013 10:41, Adrian Chadd wrote: Your patch does three things: * adds a couple new buckets; These new buckets make bucket size self-tuning more soft and precise. Without them there are buckets for 1, 5, 13,

  1   2   3   4   5   >