Re: smp_rendezvous_cpus() vs sched_bind()
Am 22.11.2010 22:16, schrieb Andriy Gapon: If I need to call a function func on a specific CPU which one of the following I should use? 1. smp_rendezvous_cpus(1<< cpuid, ..., func, ...); 2. sched_bind(cpuid); func(); sched_unbind(); Or does it depend on some additional factors? What are the main differences here? And also by extension. If I need to execute func() on all CPUs - which one is better again - smp_rendezvous_cpus() or CPU_FOREACH+sched_bind? It depends on what you are trying to do in func() really. One huge caveat against smp_rendezvous is that func will be running from interrupt context in an unknown lock state with interrupts disabled. Most of the time sched_bind() should be sufficient/preferrable. You should think of smp_rendezvous as a basic building block rather than a general purpose API ... unless you really need the rendezvous part and the preemption and all that other stuff ... stay clear of it. It might make sense to have one of the deferred action APIs (callout/taskqueue/...) provide means to run a task on a specific CPU/all of them ... I hope this helps. Best, Max ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: arp(8) performance w/ many aliases assigned to an interface
Hello Nick, On Wednesday 09 June 2010 23:56:27 Nick Rogers wrote: > Can this change make it into 8.1-RELEASE? just MFCed it to stable/8. It will, however, not make it to 8.1-Release. As it is not a bug fix, just a performance improvement, it is not considered a candidate for the release branch at this late time - sorry. Thanks for your report again, Max ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: arp(8) performance w/ many aliases assigned to an interface
On Thursday 10 June 2010 10:05:24 Adrian Chadd wrote: > On 10 June 2010 05:21, Max Laier wrote: > >> Is there something that can be done to speedup the call to > >> if_indextoname(), or would it be worthwhile for me to submit a patch > >> that adds the ability to skip the interface lookup as an arp(8) option? > > > > how about the attached: > This patch only short-circuits the lookup for a specific case - lots > of entries with the same ifname. What about other situations - say, > alternating interfaces in ARP? Yes, it is bandaid, but I believe it covers most if not all common cases. I didn't want to start with a full cache, to avoid a big memory footprint. > I read if_indextoname(). The problem is that each call is sucking down > the ifaddrs table and looking for the index. Is this likely to be a > problem in other situations, rather than just /usr/sbin/arp ? I was also thinking about building a sysctl to export index to name information directly, but I don't think it's worth the hassle. Other (long running) programs that need index->name mapping over and over again already do caching that is specific to their particular usecase. See e.g. routed's if.c Regards, Max ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: arp(8) performance w/ many aliases assigned to an interface
On Wednesday 09 June 2010 23:56:27 Nick Rogers wrote: > Thanks a lot, I have been trying to get a meaningful response on this issue > for about a week now. Guess I finally got the right list. Thanks again! I saw your post before on -net etc, just never found the time ... and then I forgot. So it was more the right timing, than the right list :-) > Can this change make it into 8.1-RELEASE? It looks like it might be too late, I'll ask once the HEAD commit is done, but I wouldn't count on it. > On Wed, Jun 9, 2010 at 5:30 PM, Max Laier wrote: > > On Wednesday 09 June 2010 23:21:05 Max Laier wrote: > > > Hello Nick, > > > > > > On Wednesday 09 June 2010 20:17:43 Nick Rogers wrote: > > > > Is there something that can be done to speedup the call to > > > > if_indextoname(), or would it be worthwhile for me to submit a patch > > > > that > > > > > > adds the ability to skip the interface lookup as an arp(8) option? > > > > > > how about the attached: > > > > > > # time arp -an > /dev/null > > > 0.171u 0.462s 0:00.63 100.0%21+1538k 0+0io 0pf+0w > > > # time arp.patched -an > /dev/null > > > 0.005u 0.000s 0:00.00 0.0% 0+0k 0+0io 0pf+0w > > > > > > # arp -an | wc -l > > > > > > 1095 > > > > > > I'll commit this soon unless somebody objects. > > > > ... make that s/long/int64_t/ ... I keep forgetting that long is 32bit > > sometimes. > > !DSPAM:4c100e18981892214220659! ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: arp(8) performance w/ many aliases assigned to an interface
On Wednesday 09 June 2010 23:21:05 Max Laier wrote: > Hello Nick, > > On Wednesday 09 June 2010 20:17:43 Nick Rogers wrote: > > Is there something that can be done to speedup the call to > > if_indextoname(), or would it be worthwhile for me to submit a patch that > > adds the ability to skip the interface lookup as an arp(8) option? > > how about the attached: > > # time arp -an > /dev/null > 0.171u 0.462s 0:00.63 100.0%21+1538k 0+0io 0pf+0w > # time arp.patched -an > /dev/null > 0.005u 0.000s 0:00.00 0.0% 0+0k 0+0io 0pf+0w > > # arp -an | wc -l > 1095 > > I'll commit this soon unless somebody objects. ... make that s/long/int64_t/ ... I keep forgetting that long is 32bit sometimes. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: arp(8) performance w/ many aliases assigned to an interface
Hello Nick, On Wednesday 09 June 2010 20:17:43 Nick Rogers wrote: > Is there something that can be done to speedup the call to > if_indextoname(), or would it be worthwhile for me to submit a patch that > adds the ability to skip the interface lookup as an arp(8) option? how about the attached: # time arp -an > /dev/null 0.171u 0.462s 0:00.63 100.0%21+1538k 0+0io 0pf+0w # time arp.patched -an > /dev/null 0.005u 0.000s 0:00.00 0.0% 0+0k 0+0io 0pf+0w # arp -an | wc -l 1095 I'll commit this soon unless somebody objects. Thanks for your report. Max diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index a0e228c..cc4d383 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -555,6 +555,9 @@ search(u_long addr, action_fn *action) /* * Display an arp entry */ +static char lifname[IF_NAMESIZE]; +static long lifindex = -1; + static void print_entry(struct sockaddr_dl *sdl, struct sockaddr_inarp *addr, struct rt_msghdr *rtm) @@ -562,7 +565,6 @@ print_entry(struct sockaddr_dl *sdl, const char *host; struct hostent *hp; struct iso88025_sockaddr_dl_data *trld; - char ifname[IF_NAMESIZE]; int seg; if (nflag == 0) @@ -591,8 +593,12 @@ print_entry(struct sockaddr_dl *sdl, } } else printf("(incomplete)"); - if (if_indextoname(sdl->sdl_index, ifname) != NULL) - printf(" on %s", ifname); + if (sdl->sdl_index != lifindex && + if_indextoname(sdl->sdl_index, lifname) != NULL) { + lifindex = sdl->sdl_index; + printf(" on %s", lifname); +} else if (sdl->sdl_index == lifindex) + printf(" on %s", lifname); if (rtm->rtm_rmx.rmx_expire == 0) printf(" permanent"); else { ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: sysbench / fileio - Linux vs. FreeBSD
On Saturday 05 June 2010 01:58:35 Adam PAPAI wrote: > Why FreeBSD is supreme with 1 and 2 thread. And why is it 2 and 3 times > slower with 4-8-16-32 threads compared to Debian? The first two tests (1 > thread and 2 thread) showed me that FreeBSD is supreme in I/O, but later > tests showed me, that it can produce horrible I/O. > > How can I tune my disk to make it faster? Is it possible? What is the > reason of the really slow I/O with more than 4 threads? What do you > recommend me to do? Why is it damn slow with 8K blocksize? You may find this interesting: http://info.iet.unipi.it/~luigi/geom_sched/ Regards, Max ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: proposed change to style(9): require yoda style if statements
On Tuesday 11 May 2010 21:36:11 Eitan Adler wrote: > My proposal is simple: > require that any if statement that compares a constant to a mutable > variable be written as > if (constant == variable) > instead of > if (variable == constant) > > this prevents an extremely common programming error > if (variable = constant) > > While this is almost always found in testing sometimes thing can slip > through and writing it using the former method will generate a compiler > warning. With proper -W flags, "if (var = const)" also yields a warning: warning: suggest parentheses around assignment used as truth value and style already tells you to avoid unnecessary parentheses. Chaning style(9) in such a fundamental way almost, always isn't a good idea. It's simply unrealistic to change all current code to comply and the difference between old and new code will just add to the confusion. Best, Max ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: 2 bytes allocated problems
On Thursday 25 February 2010 23:46:03 Dag-Erling Smørgrav wrote: > "Matthias Andree" writes: > > Dag-Erling Smørgrav writes: > > > char a[9] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i' }; > > > > char a[9] = "abcdefghi"; > > > > suffices. The compiler knows there isn't room for the terminal '\0' > > and omits it. > > Some compilers (gcc at least) warn about it. It shouldn't. C99 explicitly has this as an example (6.7.8.32). It's also of note that char *p = "abc" is different from char a[] = "abc" in that the elements of a are modifiable, while modifying p[x] yields undefined behavior. But this is increasingly getting out of scope for hackers@ ... so I'll shut up now. -- Max ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: 2 bytes allocated problems
On Wednesday 24 February 2010 14:44:35 Andrey Zonov wrote: > Hi, > > When I try allocated pointer to a pointer, and in it some pointers > (important: size is 2 bytes), the pointers lose their boundaries. > Why it can happen? > > Test program in attach. Your test program is broken: >#define S1 "ab" >#define S2 "cd" > >pp = (char **) Malloc(2 * sizeof(char *)); > >pp[0] = (char *) malloc(2); >memcpy(pp[0], S1, 2); >pp[1] = (char *) malloc(2); >memcpy(pp[1], S2, 2); > >printf("%s\n", *pp); >printf("%s\n", pp[0]); >printf("%s\n", pp[1]); Why should *pp == pp[0], or pp[1] be a nul-terminated string? You just copied the two characters. It's pure luck if there is a \0 at the end of any of these elements, or that the access doesn't cause a SEGV. If you do: >pp[0] = (char *) malloc(3); >memcpy(pp[0], S1, 3); >pp[1] = (char *) malloc(3); >memcpy(pp[1], S2, 3); instead, you copy the termination and things work as expected. Regards, Max ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: Q:possibility PFIL+mbuf use for packet spawning
On Friday 15 January 2010 12:26:06 q q wrote: > I'm using pfil as packet filter for packet modifications. > > Is it possible to spawn new packets to network from pfil using mbuf? You can call into ip_output with a new mbuf to send a new packet. See for example pf_send_tcp in contrib/pf/net/pf.c > Another question: im using m_append to change packet length and add > data(its working, at least server got longer message) but when i wireshark > clients packets(win machine) i see that i got acknoledge on older length > not on new one. Am i missunderstanding something? Assuming you are talking about tcp packets (otherwise there wouldn't be an ack), you have to alter the tcp header, checksums, etc. as well. Just adding data doesn't work. Regards, -- Max ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: uiomove and mutex
On Monday 11 January 2010 20:22:39 H.Fazaeli wrote: > dear gurus > > man mutex(9) states that: > > "No mutexes should be held (except for Giant) across functions which > access memory in userspace, such as copyin(9), copyout(9), uiomove(9), > fuword(9), etc. No locks are needed when calling these functions." > > can someone pls. explain why it is so? Any memory access to user memory (unless the memory has been wired down before) can result in a swap in from secondary storage, which - in turn - results in a sleep. Most locks are not allowed to be held over a sleep. See locking(9) for details. > Suppose I have a kernel buffer to which kernel writes and > userland processes read via a character device. In the device > read method, If we unlock the mutex just before uiomove, is it > guaranteed that kernel does not write to the buffer in the middle > of uiomove? If yes, how? What is the solution in such a situation? > rwlocks? an intermediate buffer? sx(9) is one possibility. The other way is to use a pointer or state that you modify while holding the mutex: Thread1: lock(&mtx); buffer_in_use=1; unlock(&mtx); uiomove() lock(&mtx); buffer_in_use=0; wakeup(&buffer_in_use); unlock(&mtx); Thread2: lock(&mtx); while(buffer_in_use) mlseep(&buffer_in_use, &mtx, ...) do_stuff_to_the_buffer(); unlock(&mtx); -- Max ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: bus_dmamap_load_uio() and user data
On Friday 08 January 2010 17:13:29 John Baldwin wrote: > On Friday 08 January 2010 9:14:36 am Mark Tinguely wrote: > > > You should use the pmap from the thread in the uio structure. Similar > > > to this from the x86 bus_dma code: > > > > > > if (uio->uio_segflg == UIO_USERSPACE) { > > > KASSERT(uio->uio_td != NULL, > > > ("bus_dmamap_load_uio: USERSPACE but no > > > proc")); pmap = vmspace_pmap(uio->uio_td->td_proc->p_vmspace); } else > > > pmap = NULL; > > > > > > Later when doing VA -> PA conversions the code does this: > > > > > > if (pmap) > > > paddr = pmap_extract(pmap, vaddr); > > > else > > > paddr = pmap_kextract(vaddr); > > > > We do that, but I notice that all the architecture that implement > > bounce buffers assume the VA is in the current map. Most of the > > addresses are KVA, but bus_dmamap_load_uio() can be in the user space. > > > > I was wondering about the sequence: > > > > bus_dmamap_load_uio() user space > >dma_load_buffer() > > add bounce page save UVA (in caller user map) > > > > later: > > > > bus_dma_sync > >copies bounce buffer from saved UVA. <- here is my concern. The user > > pmap is not remembered use current pmap. > > > > Since the bounce buffer copy routines have been running in other > > architectures for years without corruption, I was wondering we can safely > > assume that the dma sync is running in the same thread/address space as > > the bus_dmamap_load_uio call. I was hoping you would say, don't worry the > > scheduler would always reload the same thread to execute the dma sync code > > ... > > Ahh. I think bus_dmamap_load_uio() doesn't do deferred callbacks (i.e. > mandates BUS_DMA_NOWAIT), and probably is always invoked from curthread. > Even in the case of aio, the thread's vmspace is the effective one at the > time bus_dmamap_load_uio() would be invoked, so in practice it is safe. I ran into ?this? problem with bus_dmamap_sync and bounce buffers while trying to do a BUS_DMASYNC_POSTREAD in interrupt context. The sync code was trying to copy from bounce buffer to the UVA without proper context -> SEGFAULT. I tried to move the sync to the ioctl context that is used by the userland to figure out which part of the buffer is "ready" ... this /kind of/ worked, but lead to DMA problems in ata (which I didn't yet investigate) when trying to write the buffer to disk. I meanwhile moved to exporting a kernel buffer instead, using OBJT_SG - which is a bit more work and eats KVA, but at least on amd64 there is no shortage of that. -- Max ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: Make process title - % complete
On Monday 19 October 2009 16:08:06 Rink Springer wrote: > Hi Ivan, > > On Mon, Oct 19, 2009 at 03:52:30PM +0200, Ivan Voras wrote: > > if nobody objects, I'll commit it :) > > I seem to recall that setproctitle() is quite expensive to call; perhaps > it would make sense offer a flag to prevent make(1) from calling it? [1] Just rate-limit the setproctitle() call to once/sec or once/percentage-step and be done with it. I must say that trying it out on a kernel build didn't proof too useful as the targets have vastly different runtimes, but I think it's a good addition nonetheless. So please, go for it Ivan. > Anyway, the feature looks nice! I'd like to have it... > > [1] I'm unsure how expensive it is compared to fork(1)-ing etc; I'd > expect it's negligable but who knows... > -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: sx locks and memory barriers
On Tuesday 29 September 2009 17:39:37 Attilio Rao wrote: > 2009/9/25 Fabio Checconi : > > Hi all, > > looking at sys/sx.h I have some troubles understanding this comment: > > > > * A note about memory barriers. Exclusive locks need to use the same > > * memory barriers as mutexes: _acq when acquiring an exclusive lock > > * and _rel when releasing an exclusive lock. On the other side, > > * shared lock needs to use an _acq barrier when acquiring the lock > > * but, since they don't update any locked data, no memory barrier is > > * needed when releasing a shared lock. > > > > In particular, I'm not understanding what prevents the following sequence > > from happening: > > > > CPU A CPU B > > > > sx_slock(&data->lock); > > > > sx_sunlock(&data->lock); > > > > /* reordered after the unlock > > by the cpu */ > > if (data->buffer) > >sx_xlock(&data->lock); > >free(data->buffer); > >data->buffer = NULL; > >sx_xunlock(&data->lock); > > > >a = *data->buffer; > > > > IOW, even if readers do not modify the data protected by the lock, > > without a release barrier a memory access may leak past the unlock (as > > the cpu won't notice any dependency between the unlock and the fetch, > > feeling free to reorder them), thus potentially racing with an exclusive > > writer accessing the data. > > > > On architectures where atomic ops serialize memory accesses this would > > never happen, otherwise the sequence above seems possible; am I missing > > something? > > I think your concerns are right, possibly we need this patch: > http://www.freebsd.org/~attilio/sxrw_unlockb.diff > > However speaking with John we agreed possibly there is a more serious > breakage. Possibly, memory barriers would also require to ensure the > compiler to not reorder the operation, while right now, in FreeBSD, they > just take care of the reordering from the architecture perspective. > The only way I'm aware of GCC offers that is to clobber memory. > I will provide a patch that address this soon, hoping that GCC will be > smart enough to not overhead too much the memory clobbering but just > try to understand what's our purpose and servers it (I will try to > compare code generated before and after the patch at least for tier-1 > architectures). Does GCC really reorder accesses to volatile objects? The C Standard seems to object: 5.1.2.3 - 2 Accessing a volatile object, modifying an object, modifying a file, or calling a function that does any of those operations are all side effects,11) which are changes in the state of the execution environment. Evaluation of an expression may produce side effects. At certain specified points in the execution sequence called sequence points, all side effects of previous evaluations shall be complete and no side effects of subsequent evaluations shall have taken place. (A summary of the sequence points is given in annex C.) I might be reading this wrong, of course. -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: memchr() strangeness
On Friday 04 September 2009 19:43:37 Gabor Kovesdan wrote: > Alfred Perlstein escribió: > > Moved to -hackers. > > Thanks, this was my original intention. > > > Gabor, can you please make a smaller program to exhibit this behavior? > > (not just the error line) > > > > I will be glad to help out. > > After reading your mail, I've made a small program: > > #include > #include > #include > #include > > int > main(int argc, char *argv[]) > { > bool foo; > > foo = memchr(argv[1], '\0', strlen(argv[1])); > if (foo) > fprintf(stderr, "Ops!\n"); > > } > > And it works correctly, so actually grep fails somewhere else but it's > very strange why it behaves differently jailed (or chrooted). Once > submitted it for a portbuild test because it had been working correctly > for me on a production system and then it failed on the cluster because > the package build run jailed. And then I created a jail and in fact I > could reproduce this but only in the jail. LC_* set to a locale not available in the jail? Just a wild guess. -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: Need help trying to to use the ntohl() call with in_addr
On Friday 14 August 2009 05:29:19 bert wiley wrote: > Hi everyone > > Im new to list and this question may be out of place. This is my first > post. Im new to freebsd and trying to understand how to create a jail from > some system calls. I followed the jail subsystem description from the > handbook and im having a problem or may be using the call incorrectly. But > here is what im trying to do. > > > int main() > { > struct in_addr ipaddr; > struct jail myjail; > > char path[PATH_MAX]; > > realpath("/tmp", path); > > myjail.version = 1; > myjail.path = path; > myjail.hostname = "testjail"; > > const char *ip; > ip = "192.168.1.142"; > > inet_aton(ip, &ipaddr); > myjail.ip4 = ntohl(ipaddr.s_addr); // I get and error here, invalid > conversion from _uint32_t' to in_addr* > myjail.ip4 = ipaddr.s_addr;// and and error here, invlid > conversion from in_addr_t to in_addr* > } > > > I know that there is more that needs to be done but this just a test stub > as im trying to work thru the calls and understand whats going on. > Any would be appreciated thanks. Take a look at the jail(2) man page: The ``ip4s'' and ``ip6s'' give the numbers of IPv4 and IPv6 addresses that will be passed via their respective pointers. The ``ip4'' and ``ip6'' pointers can be set to an arrays of IPv4 and IPv6 addresses to be assigned to the prison, or NULL if none. IPv4 addresses must be in network byte order. So you'd do something like the following: myjail.ip4s = 1; inet_aton(ip, &ipaddr); myjail.ip4 = &ipaddr; You don't have to switch byte order. -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: Was system rebooted by power fail or by kernel panic?
On Friday 07 August 2009 19:19:37 cronfy wrote: > Hello! > > Is there a way to find out was system rebooted by power fail or by > kernel panic? > > The problem is that there is no free space on devices to store kernel > core dump (swap is smaller than physical memory, no more dump devices > exist). Will FreeBSD report about panic somehow if it cannot create core > dump? You can try textdumps: http://www.freebsd.org/cgi/man.cgi?query=textdump&manpath=FreeBSD+8-current -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: sosend() and mbuf
On Tuesday 04 August 2009 00:03:40 Dag-Erling Smørgrav wrote: > Dag-Erling Smørgrav writes: > > One thing that springs to mind is that kern_open() will dereference > > td->td_proc, and AFAIK kthread_create() does not associate the thread > > with a process. > > This is wrong, and contradicts what I wrote further down. Just ignore > it. IIRC, kernel threads don't have root. -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: How to increase the max pty's on Freebsd 7.0?
On Wednesday 08 April 2009 13:25:39 Bernd Walter wrote: > On Thu, Apr 02, 2009 at 08:10:03AM +0200, Ed Schouten wrote: > > * Paul Schenkeveld wrote: > > > Or change 'pts' to, for example, 'pt' so without changing utmp and > > > related stuff we'll have space for a four digit pty number. > > > > I've noticed lots of apps already misbehave because of the pty(4) -> > > pts(4) migration. I guess using a new naming scheme would totally break > > stuff. There are lots of apps that do things like: > > > > if (strncmp(tty, "tty", 3) != 0 && strncmp(tty, "pts/", 4) != 0) > > printf("Not a valid pseudo-terminal!\n"); > > > > But those are just workarounds. Our utmp format is broken anyway. It's > > not just UT_LINESIZE that's too small. I think we received many > > complaints from people who want to increase UT_HOSTSIZE as well. > > Well, UT_HOSTSIZE can't hold a full sized IPv6 address. RFC 1924 (still needs four more, but avoids ridiculously large UT_HOSTSIZE ;) -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: Tyan S2895 7.1 amd64 >4Gb RAM support?
On Friday 13 February 2009 19:00:31 Karl Pielorz wrote: > Hi, > > I've a Tyan S2895 (bios 1.04), w/10Gb of ECC RAM onboard using 2 * Opteron > 285's. The machine used to run WinXP x64, and Vista x64 (mostly doing video > production, ray tracing etc.) > > I recently switched this machine to FreeBSD 7.1 amd64 - to run ZFS on it, > but I've been having horrific problems with it. > > Basically, with more than ~3Gb of RAM usable in the system - it shows signs > of chronic RAM problems (everything from sig11's through to failing to > compile the kernel with 'weird' errors - as well as kernel panics, and > spontaneous reboots). > > I've tested all the RAM (ECC is enabled on the BIOS) - it all tests fine > (even if I jumble it up between different simms in different sockets etc.) > > By setting: > > hw.physmem="3G" > > In loader.conf - I get a stable system. > > I've not setup any ZFS pools or anything yet, until I get the system > stable. I've also tried changing the BIOS settings for the Memory Hole, > IOMMU, MTRR etc. - all to no avail (nor does a BIOS 'use safe defaults' > make any difference). I have a S2882-D populated with 6GB (6x1G) running FreeBSD since early 7. It took some tuning of the memory timing in the BIOS to get it to work, but ever since it works like a charm. > It boots off the onboard nVidia RAID controller (a pair of 36Gb drives > configured as RAID1), this shows up as: Can you maybe try to take the nVidia RAID out of the equation? I figure the "professional" version of the chip is not that common so maybe the corruption stems from the disk controller. > " > atapci0: port > 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x1400-0x140f at device 6.0 on pci0 > ata0: on atapci0 > ata0: [ITHREAD] > ata1: on atapci0 > ata1: [ITHREAD] > atapci1: port > 0x1440-0x1447,0x1434-0x1437,0x1438-0x143f,0x1430-0x1433,0x1410-0x141f mem > 0xc0002000-0xc0002fff irq 22 at device 7.0 on pci0 > atapci1: [ITHREAD] > ata2: on atapci1 > ata2: [ITHREAD] > ata3: on atapci1 > ata3: [ITHREAD] > atapci2: port > 0x1458-0x145f,0x144c-0x144f,0x1450-0x1457,0x1448-0x144b,0x1420-0x142f mem > 0xc0003000-0xc0003fff irq 23 at device 8.0 on pci0 > atapci2: [ITHREAD] > ata4: on atapci2 > ata4: [ITHREAD] > ata5: on atapci2 > ata5: [ITHREAD] > ... > ad8: 35304MB at ata4-master SATA150 > ad10: 35304MB at ata5-master SATA150 > ... > ar0: 35304MB status: READY > ar0: disk0 READY (master) using ad10 at ata5-master > ar0: disk1 READY (mirror) using ad8 at ata4-master > Trying to mount root from ufs:/dev/ar0s1a > " > > Anyone got any ideas? - At this time, I can't prove 100% whether it's the > disk controller messing up and corrupting data as it's loaded into RAM, or > data getting corrupt once in RAM that's causing the crashes - all I know is > with ~3Gb RAM - either by physically pulling SIMMs or using the hw.physmem > option - it works fine. > > I tried booting 8.0-CURRENT-200812-amd64-disc1.iso - to see if anything was > different with this hardware in 8.0 - but unfortunately that doesn't boot > past the BTX loader on this machine, regardless of how much RAM is / isn't > in it :( Any more details on how it fails would help. -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: pahole - Finding holes in kernel structs
On Thursday 12 February 2009 17:42:19 Sam Leffler wrote: > Max Laier wrote: > > On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: > >> So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that > >> many of the struct had holes, and some of which could be rearranged to > >> fill the gap. > > > > Interesting tool ... > > Someone should be able to do the same thing with coverity but it's > obviously less effort to use something that exists. If I recall this > and related tools like sparse use dwarf symbols which we don't generate > by default. But with dtrace support I think we now can in fact generate > the symbols easily so maybe someone can look at porting the tools... > > >> I've made the list available here[2]. So my questions > >> are two fold: > >> > >> 1) Is it worth my time trying to rearrange structs? If so do you think > >> many of my patches would be accepted? > >> > >> 2) Is there a way to find out the most heavily used structs? There are > >> ~3600 structs, and ~2000 holes, it might be a waste of my time fixing > >> the structs which are only used once. > > > > That's the tricky part. Rearranging the structs itself is not that > > difficult, but identifying which should be rearranged and if, how ... > > that's the problem. The fact that gaps might be different for 64 vs. 32 > > bit architectures has already been mentioned. > > > > In addition one needs to keep in mind that changing a struct layout is a > > ABI change. So if we do identify structs that we want to change we > > should do them all at once to keep the different versions down to a > > minimum. > > > > So to answer your first question, submitting 101 patches to rearrange 101 > > structs is certainly a wasted effort. However, if you take a good look > > at the 2000 holes, identify an interesting subset and submit a patch to > > fix that subset ... that would be a worthwhile effort ... IMHO. > > The other thing to keep in mind is that structure layout can have a > noticeable effect on cache locality. Arbitrarily rearranging structure > members can generate many more cache misses so one should sanity check > changes w/ something like hwpmc. However as noted because layout may be > platform-dependent even if something shows no change on x86 it may be a > loss on another architecture and finding that performance drop may be > really hard. Let's not be too "glass half empty" about it, though. The same is true in the opposite direction. If we can identify and eliminate an unnecessary hole in an important structure we might gain that same performance just by reshuffling a few lines. -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: pahole - Finding holes in kernel structs
On Thursday 12 February 2009 15:08:22 Andrew Brampton wrote: > So I ran the tool pahole over a 7.1 FreeBSD Kernel, and found that > many of the struct had holes, and some of which could be rearranged to > fill the gap. Interesting tool ... > I've made the list available here[2]. So my questions > are two fold: > > 1) Is it worth my time trying to rearrange structs? If so do you think > many of my patches would be accepted? > > 2) Is there a way to find out the most heavily used structs? There are > ~3600 structs, and ~2000 holes, it might be a waste of my time fixing > the structs which are only used once. That's the tricky part. Rearranging the structs itself is not that difficult, but identifying which should be rearranged and if, how ... that's the problem. The fact that gaps might be different for 64 vs. 32 bit architectures has already been mentioned. In addition one needs to keep in mind that changing a struct layout is a ABI change. So if we do identify structs that we want to change we should do them all at once to keep the different versions down to a minimum. So to answer your first question, submitting 101 patches to rearrange 101 structs is certainly a wasted effort. However, if you take a good look at the 2000 holes, identify an interesting subset and submit a patch to fix that subset ... that would be a worthwhile effort ... IMHO. -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: CFT: Graphics support for /boot/loader
On Thursday 05 February 2009 23:18:36 Oliver Fromme wrote: > I have posted detailed instructions on the FreeBSD wiki: > > http://wiki.freebsd.org/OliverFromme/BootLoaderTest > > Any kind of feedback is welcome. quick test in qemu - works well. Very cool! -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: write-only variables in src/sys/ - possible bugs
On Monday 02 February 2009 20:42:32 Christoph Mallon wrote: > Hi, > > I compiled a list of all local variables in src/sys/ (r188000), which > are only written to, but never read. This is more than the GCC warning, > which only complains about variables, which are only declared (and maybe > initialised) and not used otherwise. In contrast this list contains > variables with the following usage pattern: > > int w = 42; // GCC warns about this ... > int x; // ... but not this > x = 23; > x++; > return 0; > > The list contains about 700 entries. About three dozen concern variables > named 'error'. Here's one *example* from the list: > > sys/dev/kbdmux/kbdmux.c:1304 > > In the function kbdmux_modevent() the variable 'error' is assigned > values eight times, but at the end of the function there is just a > return 0; and the variable is never read. Probably the value should be > returned. > > You can find the list here: > http://tron.homeunix.org/unread_variables.log > > The list was generated by cparser, a C99 compiler, which uses libFIRM > for optimisation and code generation (lang/cparser in the ports). > > > A small disclaimer: There might be some false positives due to errors > which are caused by HEAD sources in combination with my installed 7.x > headers plus a hacked up build process. Also some warnings are the > result from variables, which are only used in debug macros, so td = > curthread; KASSERT(td != NULL); provokes a warning (I consider this bad > style). Nonetheless the number of false positives should be low. If > there is interest, then I can compile a "proper" list. Are you interested in false positive reports? If so, I think sys/contrib/pf/net/pf.c:2931 is one. Seems cparser is confused by the union in struct assignment, maybe? Or it suffers from the similar issue with switch/case-statements as gcc. saddr is read from in all but the default case. -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: how ipfw firewall is implemented in the kernel
On Wednesday 14 January 2009 18:32:07 Biks N wrote: > Hi, > > Can anyone please help me understand how the IPFW firewall is > implemented in the kernel. > > I have created new ACTIONS in ipfw. I have already implemented in the > userland. > > Now i need to check the IPFW rule list (in ip_input.c and in > ip_output.c) and call a custom routine if there is a match to those > rules. > > I would really appreciate if anyone could point me to right > direction/reference. ipfw is hooked into the pfil(9) hook points in ip_{in,out}put() (look for calls to pfil_run_hooks() in the respective files). From there the call path goes on to the ipfw_check_* functions defined in netinet/ip_fw_pfil.c Finally ipfw_chk() in netinet/ip_fw2.c where the ruleset is processed and where you should add your required processing. -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: ntpd
On Monday 15 December 2008 14:07:26 vasanth raonaik wrote: > I am looking into the ntpd code. I need to know in which file and function > does ntpd reply/reponse query packets are formulated. Please provide any > pointers for the same. I don't know what "query packets" are supposed to be in the NTP context, but it looks like you are looking for ntp_proto.c - convenient name, isn't it? ;) -- /"\ Best regards, | mla...@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mla...@efnet / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
Re: keeping track of local modifications
On Monday 01 December 2008 07:07:00 [EMAIL PROTECTED] wrote: > Tim Kientzle <[EMAIL PROTECTED]> wrote: > > ... most of us are volunteers who enjoy using and working on > > FreeBSD in our (often quite limited) spare time ... If I only > > have a couple of hours a week, I'd usually rather spend it coding > > ... > > Sounds familiar :) > > Getting back to the OP's original question, and in light of the > limited time that many of us have available, I was wondering which of > the readily-available VCS would impose the least overhead on someone > who has very little experience with any open source VCS (and thus is > going to have to learn *something* new). After looking at the pages > recommended by others in this thread, I wonder if there are other > possibilities which one should consider. > > * http://wiki.freebsd.org/SubversionPrimer > > I got the impression that SVN is quite resource-hungry, both in > disk space and in bandwidth, and has an extremely steep learning > curve. While a committer clearly has to deal with SVN, I was left > wondering if it really had much to offer the more casual hacker, > esp. one who is not already familiar with it. In particular, given > that one will likely have already installed /usr/src/... from the > distribution, I was put off by the apparent need to download > another entire instance. > > * http://wiki.freebsd.org/LocalMercurial > > This seems less of a resource hog, and (if I am understanding > matters correctly) is able to start from the installed /usr/src/... > rather than requiring the would-be hacker to download a redundant > instance, but I was concerned that the page may not be up to date > with current FreeBSD development methodology (e.g. csup vs cvsup). If you want to contribute back, this is *not* the way to go. Patches from anything other than SVN and maybe CVS are mostly useless. The local hg/git approach is nice if you are already familiar with hg or git and just want to keep some patch sets for yourself. If you are looking to keep/develop a patch set and eventually share it with the world, svn or svk is the way to go. Yes, a full svk mirror takes up 3.5g of space, but that's not even two bucks at today's storage costs. The issue with the initial setup is a different thing, but once that is done (at your local university, employer, or the like) svn/svk is really resource efficient. On top of that you will find that "svn ann" is a very powerful tool to figure out why a certain line of code is the way it is (much more pleasant to use than cvsweb, too - esp. when you are on a slow network connection). So it really depends on what your goal is. If you are (as the OP) looking to contribute back to the community, there is really no way around svn - sorry. If you are looking for some means to store your favorite patches from the lists and some of your own, the local hg/git stuff might be a better fit. > In case it makes any difference, I've used SCCS and RCS a little (but > neither all that recently), and have been using ClearCase a great > deal for the last several years (but it is not a candidate for this > inquiry since I'm not licensed to use it outside the office). No idea about ClearCase, but SCCS and RCS are not too far away from SVN ... natural progression. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: keeping track of local modifications
On Sunday 30 November 2008 04:08:34 Eitan Adler wrote: ... > >> As an aside can anyone point me to a relatively easy bug/feature that I > >> can work on as a beginner C coder? > > > > Check http://www.freebsd.org/projects/ideas/ > > Most of these involve C coding beyond my skill level. Find a project you care about - no matter how difficult it might seem - and start reading code & hacking. If you are truly passionate about your project you can learn quite a bit in short time. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: keeping track of local modifications
On Sunday 30 November 2008 00:06:42 Eitan Adler wrote: > I'm starting to work on local modifications to freeBSD and I was > thinking of how to keep track of my local modifications. > My first thought was to make a svn repo and and keep the freeBSD source > as a "vendor branch". Has anyone else done this? What else do you do to > keep track of local modifications? > Note: I'm tracking -STABLE; not -CURRENT. Use svk. There is information about how to set that up on the wiki: http://wiki.freebsd.org/SubversionPrimer > As an aside can anyone point me to a relatively easy bug/feature that I > can work on as a beginner C coder? Check http://www.freebsd.org/projects/ideas/ -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: New C compiler and analyzer lang/cparser in ports
On Thursday 27 November 2008 21:39:45 Christoph Mallon wrote: > A few days ago libFIRM[1] and cparser were added to the ports tree. If > you want to see, what other compilers besides GCC have to offer, this > might be of interest for you. libFIRM is a modern optimizing > intermediate representation (IR) library. cparser is a C compiler > providing many useful warnings and uses libFIRM for optimization and > code generation. Nice stuff! I remember from a practical work with libFIRM that it is quite pleasant to work with (though there is a bit of a learning curve). How are the chances of this code staying under GPL2? I suppose there is no chance to get it dual-licensed under BSDL as well? In addition, how much work is it to build missing backends? It seems like there is no amd64 or sparc support at the moment? -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: copy, copyin, copyout
On Tuesday 25 November 2008 18:37:50 Alexej Sokolov wrote: > Hello, > could anyone please explain to me the difference between functions: > copystr() and copyinstr() ? > > For i386 copyinstr is implemented in assembler. I can not read > the assembler code very well. > > I tried to allocate a memory in space of user process using vm_map_find > and then with copystr() I could copy data between user and kernel > memory. copystr() seemed to be able to do the same what copyinstr do. You might get lucky with copystr() if the user page is already resident, but if you page fault copystr() will kill the kernel. copyinstr() handles page faults. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Intel 5100 WiFi
On Monday 17 November 2008 05:27:48 jT wrote: >I know you are busy, but can you explain what about my response was > wrong when you say doesn't require sysctl ack -- you mean > acknowledgment? I just would like to know for my future reference and > Steve sorry for my misinformation. the firmware for the iwn(4) powered cards is (in contrast to ipw(4)) provided by Intel under a permissive license that does not require end-user acknowledgment. It is unfortunate that Intel doesn't release all firmware similarly - so we have to live with the slight confusion stemming from that. You can identify all firmware(9) modules in the tree that require a license ack, by grepping for "FIRMWARE_LICENSE" in the module Makefiles. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: VLAN offloads on FreeBSD 6.3 & 7.0
On Sunday 16 November 2008 15:10:19 Yony Yossef wrote: > Hi All, > > I'm working on an Ethernet driver for FreeBSD, currently implementing > VLAN offloads. > I have two problems, one is enabling TSO over the VLAN interface and > the second is enabling the VLAN filtering offload. > > About the TSO problem, I'm currently suffering a hugh performance > penalty since I have no TSO enabled over my vlan interfaces. > When I create a VLAN interface it does not inherit the features of > it's mother-interface, e.g. IFCAP_TSO. > Can it be done on FreeBSD 6.3 / 7.0 ? > > Second, my NIC is capable of holding a vlan table on HW, filtering > vlans on it's own, now I need to find a way to update that HW table > with added/deleted VLANs in order to use that VLAN filtering offload. > One way is to recieve a ioctl from the OS of it's vlan table events > (add, remove). I can't find such ioctl. > > Second way is to have direct access from the driver to the OS vlan > table. I'm not familiar with the interface though (something parallel > to vlan_group_get_device on linux) or if it's possible at all, can > anyone help on this one? See http://svn.freebsd.org/viewvc/base?view=revision&revision=180510 for the VLAN tag issue. Simply EVENTHANDLER_REGISTER a function in your driver to update the hw-table on config/unconfig events. I hope this helps. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: du -A / -B options [Re: zfs quota question]
On Wednesday 05 November 2008 03:31:26 Giorgos Keramidas wrote: > On Tue, 4 Nov 2008 23:42:49 +0100, Max Laier <[EMAIL PROTECTED]> wrote: > > Hi again, > > > > On Saturday 01 November 2008 21:14:42 I wrote: > >> a thread on freebsd-stable@ [1] about problems with du(1) and compressed > >> zfs filesystems got me looking for a possible solution. Attached is a > >> diff for du(1) that adds two new options: > >> > >> -A to display the apparent size of the file instead of the used blocks. > >> -B bsize to specify a custom blocksize. In particular one <512byte > >> > >> The GNU du(1) has --apparent-size for -A, but we don't like long > >> options. That's not to say that it couldn't be added for script compat. > >> -B is probably not that interesting, but it can be helpful and came for > >> free. > > > > Attached is an updated patch. This refines the -B option to something > > more useful (and fixes a bug in the original patch). > > > > From the man page: > > > > -B blocksize > > Calculate block counts in blocksize byte blocks. This is > > differ- ent from the -k, -m options or setting BLOCKSIZE and gives an > > estimate of how many space the examined file hierachy would require on a > > filesystem with the given blocksize. Unless in -A mode, blocksize is > > rounded up to the next multiple of 512. > > That looks nice! With a small fix (``how _much_ space'') I like the > idea a lot :) > > The patch fails to apply on a recent /head snapshot of du though: ... > Can you please refresh and repost it? Hum ... are you sure your snapshot is up to date? I did some style(9) cleanup in r184654/6 that you might not have yet. Anyways ... here is a diff with those revisions included. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News Index: du.c === --- du.c(revision 176561) +++ du.c(working copy) @@ -73,20 +73,21 @@ static int linkchk(FTSENT *); static voidusage(void); -void prthumanval(int64_t); -void ignoreadd(const char *); -void ignoreclean(void); -intignorep(FTSENT *); +static voidprthumanval(int64_t); +static voidignoreadd(const char *); +static voidignoreclean(void); +static int ignorep(FTSENT *); -intnodumpflag = 0; +static int nodumpflag = 0; +static int Aflag; +static longblocksize, cblocksize; int main(int argc, char *argv[]) { FTS *fts; FTSENT *p; - off_t savednumber = 0; - longblocksize; + off_t savednumber, curblocks; int ftsoptions; int listall; int depth; @@ -98,79 +99,91 @@ setlocale(LC_ALL, ""); Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = - lflag = 0; + lflag = Aflag = 0; save = argv; ftsoptions = 0; + savednumber = 0; + cblocksize = DEV_BSIZE; + blocksize = 0; depth = INT_MAX; SLIST_INIT(&ignores); - while ((ch = getopt(argc, argv, "HI:LPasd:chklmnrx")) != -1) + while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrx")) != -1) switch (ch) { - case 'H': - Hflag = 1; - break; - case 'I': - ignoreadd(optarg); - break; - case 'L': - if (Pflag) - usage(); - Lflag = 1; - break; - case 'P': - if (Lflag) - usage(); - Pflag = 1; - break; - case 'a': - aflag = 1; - break; - case 's': - sflag = 1; - break; - case 'd': - dflag = 1; - errno = 0; - depth = atoi(optarg); - if (errno == ERANGE || depth < 0) { -
Re: du -A / -B options [Re: zfs quota question]
Hi again, On Saturday 01 November 2008 21:14:42 I wrote: > a thread on freebsd-stable@ [1] about problems with du(1) and compressed > zfs filesystems got me looking for a possible solution. Attached is a diff > for du(1) that adds two new options: > > -A to display the apparent size of the file instead of the used blocks. > -B bsize to specify a custom blocksize. In particular one <512byte > > The GNU du(1) has --apparent-size for -A, but we don't like long options. > That's not to say that it couldn't be added for script compat. -B is > probably not that interesting, but it can be helpful and came for free. Attached is an updated patch. This refines the -B option to something more useful (and fixes a bug in the original patch). From the man page: -B blocksize Calculate block counts in blocksize byte blocks. This is differ- ent from the -k, -m options or setting BLOCKSIZE and gives an estimate of how many space the examined file hierachy would require on a filesystem with the given blocksize. Unless in -A mode, blocksize is rounded up to the next multiple of 512. I think this is also very helpful and came for almost free. I made sure to not loose any range in the calculations when not in -A mode. In -A mode and with small -B values you obviously can blast the 2^63bit block counter in struct fts earlier. Please review, test & comment ... I plan to commit this in a few days if I don't hear otherwise. Thanks. > Any objections against the general concept? It's rather complicated to get > the apparent size of a directory hierarchy without scripting. I often > wonder if some hierarchy will fit on a CD/DVD and compressed zfs makes this > really difficult. > > As for the code, I know that there are a couple of style(9) errors in there > - mostly because the lines already exceeded 80 chars before my changes and > I plan to clean that up before I commit - should there be enough support > for the change itself. > > Thoughts? > > [1] > http://lists.freebsd.org/pipermail/freebsd-stable/2008-October/045698.html -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News Index: du.1 === --- du.1(revision 184563) +++ du.1(working copy) @@ -40,11 +40,12 @@ .Nd display disk usage statistics .Sh SYNOPSIS .Nm +.Op Fl A .Op Fl H | L | P .Op Fl a | s | d Ar depth .Op Fl c .Op Fl l -.Op Fl h | k | m +.Op Fl h | k | m | B Ar blocksize .Op Fl n .Op Fl x .Op Fl I Ar mask @@ -60,6 +61,25 @@ .Pp The options are as follows: .Bl -tag -width indent +.It Fl A +Display the apparent size instead of the disk usage. +This can be helpful when operating on compressed volumes or sparse files. +.It Fl B Ar blocksize +Calculate block counts in +.Ar blocksize +byte blocks. +This is different from the +.Fl k, m +options or setting +.Ev BLOCKSIZE +and gives an estimate of how many space the examined file hierachy would +require on a filesystem with the given +.Ar blocksize . +Unless in +.Fl A +mode, +.Ar blocksize +is rounded up to the next multiple of 512. .It Fl H Symbolic links on the command line are followed, symbolic links in file hierarchies are not followed. @@ -136,14 +156,19 @@ If the environment variable .Ev BLOCKSIZE is set, and the -.Fl k -option is not specified, the block counts will be displayed in units of that -size block. +.Fl k, m +or +.Fl h +options are not specified, the block counts will be displayed in units of +that size block. If .Ev BLOCKSIZE is not set, and the -.Fl k -option is not specified, the block counts will be displayed in 512-byte blocks. +.Fl k, m +or +.Fl h +options are not specified, the block counts will be displayed in 512-byte +blocks. .El .Sh SEE ALSO .Xr df 1 , Index: du.c === --- du.c(revision 184656) +++ du.c(working copy) @@ -79,14 +79,15 @@ static int ignorep(FTSENT *); static int nodumpflag = 0; +static int Aflag; +static longblocksize, cblocksize; int main(int argc, char *argv[]) { FTS *fts; FTSENT *p; - off_t savednumber; - longblocksize; + off_t savednumber, curblocks; int ftsoptions; int listall; int depth; @@ -98,16 +99,30 @@ setlocale(LC_ALL, ""); Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = - lflag = 0; + lflag = Aflag = 0; save = argv; ftsoptions = 0; saved
du -A / -B options [Re: zfs quota question]
Hi, a thread on freebsd-stable@ [1] about problems with du(1) and compressed zfs filesystems got me looking for a possible solution. Attached is a diff for du(1) that adds two new options: -A to display the apparent size of the file instead of the used blocks. -B bsize to specify a custom blocksize. In particular one <512byte The GNU du(1) has --apparent-size for -A, but we don't like long options. That's not to say that it couldn't be added for script compat. -B is probably not that interesting, but it can be helpful and came for free. Any objections against the general concept? It's rather complicated to get the apparent size of a directory hierarchy without scripting. I often wonder if some hierarchy will fit on a CD/DVD and compressed zfs makes this really difficult. As for the code, I know that there are a couple of style(9) errors in there - mostly because the lines already exceeded 80 chars before my changes and I plan to clean that up before I commit - should there be enough support for the change itself. Thoughts? [1] http://lists.freebsd.org/pipermail/freebsd-stable/2008-October/045698.html -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News Index: du.1 === --- du.1(revision 184513) +++ du.1(working copy) @@ -40,11 +40,12 @@ .Nd display disk usage statistics .Sh SYNOPSIS .Nm +.Op Fl A .Op Fl H | L | P .Op Fl a | s | d Ar depth .Op Fl c .Op Fl l -.Op Fl h | k | m +.Op Fl h | k | m | B Ar blocksize .Op Fl n .Op Fl x .Op Fl I Ar mask @@ -60,6 +61,14 @@ .Pp The options are as follows: .Bl -tag -width indent +.It Fl A +Display the apparent size instead of the diskusage. +This can be helpful to find sparse files and when operating on +compressed volumes. +.It Fl B Ar blocksize +Display block counts in +.Ar blocksize +byte blocks. .It Fl H Symbolic links on the command line are followed, symbolic links in file hierarchies are not followed. @@ -136,14 +145,14 @@ If the environment variable .Ev BLOCKSIZE is set, and the -.Fl k -option is not specified, the block counts will be displayed in units of that +.Fl k, m, h, B +options are not specified, the block counts will be displayed in units of that size block. If .Ev BLOCKSIZE is not set, and the -.Fl k -option is not specified, the block counts will be displayed in 512-byte blocks. +.Fl k, m, h, B +options are not specified, the block counts will be displayed in 512-byte blocks. .El .Sh SEE ALSO .Xr df 1 , Index: du.c === --- du.c(revision 184513) +++ du.c(working copy) @@ -86,27 +86,39 @@ FTS *fts; FTSENT *p; off_t savednumber = 0; - longblocksize; + longblocksize = 0; int ftsoptions; int listall; int depth; int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag; - int hflag, lflag, ch, notused, rval; + int Aflag, hflag, lflag, ch, notused, rval; char**save; static char dot[] = "."; setlocale(LC_ALL, ""); Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = - lflag = 0; + Aflag = lflag = 0; save = argv; ftsoptions = 0; depth = INT_MAX; SLIST_INIT(&ignores); - while ((ch = getopt(argc, argv, "HI:LPasd:chklmnrx")) != -1) + while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrx")) != -1) switch (ch) { + case 'A': + Aflag = 1; + if (blocksize == 0) + blocksize = 1; + break; + case 'B': + blocksize = atoi(optarg); + if (errno == ERANGE || blocksize < 0) { + warnx("invalid argument to option B: %s", optarg); + usage(); + } + break; case 'H': Hflag = 1; break; @@ -142,23 +154,18 @@ cflag = 1; break; case 'h': - if (setenv("BLOCKSIZE", "512", 1) == -1) -
Re: conf/128030: [request] Isn't it time to enable IPsec in GENERIC?
On Saturday 18 October 2008 19:05:26 Sam Leffler wrote: > [EMAIL PROTECTED] wrote: > > Synopsis: [request] Isn't it time to enable IPsec in GENERIC? > > > > Responsible-Changed-From-To: freebsd-bugs->freebsd-net > > Responsible-Changed-By: gavin > > Responsible-Changed-When: Sat Oct 18 16:55:14 UTC 2008 > > Responsible-Changed-Why: > > Over to maintainer(s) for consideration > > > > http://www.freebsd.org/cgi/query-pr.cgi?pr=128030 > > Last I checked IPSEC added noticeable overhead. Before anyone does this > you need to measure the cost of having it enabled but not used. It should be possible to turn IPSEC into a module - maybe only loadable on boot to avoid locking issues. This would reduce the overhead to a handful of function pointer checks that should not impact performance (thanks to modern branch prediction and cache sizes). This would have to be measured as well, of course. Maybe this should go to the project page? It's a good junior kernel hacker project, I believe. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: tracing pf code
On Wednesday 15 October 2008 02:47:46 alan yang wrote: > hello, > > for pf port on freebsd, i would like to trace the packet flow, looking > at from ether_input -> etiher_demux -> ip_input -> tcp_input where / > how pf handles / process the packet. > > can people shed some lights where to start. really appreciate. ps hooks into the pfil(9) hook point in ip[6]_{in,out}put(). Look for calls to "pfil_run_hooks" in the code. From there the call proceeds to the hook functions defined in pf_ioctl.c pf_check_{in,out}[6]. The processing inside pf is best understood by looking at the following chart: http://homepage.mac.com/quension/pf/flow.png Is this the information you are looking for? -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: svn rev. number
On Wednesday 01 October 2008 14:04:20 Danny Braniss wrote: > Hi, > Now that freebsd is under svn, I decided to try what I failed > with cvs, and actually using svn/svk/svnsync I have a mirror and a local > branch in sync! > Since the date reported by uname is not that relevant, is it possible to > add the svn-revision # ala build-...? This could make finding problems > easier, instead of kernel from 'date' one could say date/revision... just a > thought. We are doing that - for quite some time now. (see r179637 & r179655). The requirements are that: 1) svnversion is executable in /bin, /usr/bin or /usr/local/bin 2) there is a .svn directory in your SRCDIR If that's the case, newvers.sh will add the output of it to uname: "FreeBSD fbsd8 8.0-CURRENT FreeBSD 8.0-CURRENT #4 r180876:183019M:..." -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: What file on FreeBSD acts like autoexec.bat?
On Monday 29 September 2008 07:19:34 Mike Price wrote: > What file on FreeBSD acts like autoexec.bat? > Also please leave the full path% You might find the following article enlightening: http://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/ -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
cosum: Checkout verification PoC
Hi, the attached script will generate md5 and sha256 checksums of a checkout and try to find the corresponding svn-revision. This can help to verify that your checkout from cvsupX.yy.freebsd.org is authentic. Not that there is reason to believe that we have compromised cvsup-servers. This is just something I've been toying with and wanted to let you know to see if people find the idea interesting. I'd also be interested in reviews of the concept (note that I know that https would be a good idea, I just cba to setup a certificate). The coverage currently is head and stable/{6,7} svn revision 179451:183186 (i.e. since the first svn commit up to "2008-09-19 16:51:41 +0200". I don't yet have a cronjob in place to generate new checksums, so this will become less useful quick. If people do find it interesting, however, I could certainly roll something. As you can see, the script is ready to checksum cvs and svn checkouts. If you obtain your checkout from some local git/hg/svk/... mirror you must modify the find excludes accordingly. Let me know what you think. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News #!/bin/sh BASEURL="http://laiers.net/cosum/data/md5"; tempfoo=`basename $0` TMPFILE=`mktemp -t ${tempfoo}` || exit 1 MD5SUM=`find -s . -type f -not -path "*/.svn/*" -not -path "*/CVS/*" \ -exec cat {} + | md5` SHA256SUM=`find -s . -type f -not -path "*/.svn/*" -not -path "*/CVS/*" \ -exec cat {} + | sha256` MD5DIR=`echo ${MD5SUM} | cut -c 1-2` if ! fetch -o ${TMPFILE} ${BASEURL}/${MD5DIR}/${MD5SUM} ; then echo "No corresponding md5sum found, try again in a bit" >&2 exit 1 fi ORIG_MD5SUM=`cat ${TMPFILE} | grep ^md5 | cut -d":" -f 2` ORIG_SHA256SUM=`cat ${TMPFILE} | grep ^sha256 | cut -d":" -f 2` if [ "${MD5SUM}" != "${ORIG_MD5SUM}" ]; then echo "md5 mismatch - something went terribly wrong!" >&2 exit 1 fi if [ "${SHA256SUM}" != "${ORIG_SHA256SUM}" ]; then echo "sha256 mismatch, but same md5 - please report this!" >&2 cat ${TMPFILE} exit 1 fi echo "Your checkout seems to be:" cat ${TMPFILE} ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
MFC of r180753: ABI problems?
Hi, I'm wondering how to merge r180753 to stable/7 as luoqi@ has indicated that he doesn't have time to take care of it right now. It seems that changing the size of pcicfgregs (aka struct pcicfg) which is part of struct pci_devinfo is out of the question, right? Ideas where to store the HT related state or how to avoid storing the state are welcome. The merge result is attached for reference. This fix is essential for many nforce based boards from ASUS which are rather common, I'm afraid. So it would be good to have this in 7.1/6.4, I think. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News Index: dev/pci/pci_pci.c === --- dev/pci/pci_pci.c (revision 181970) +++ dev/pci/pci_pci.c (working copy) @@ -607,9 +607,15 @@ uint32_t *data) { device_t bus; + int error; bus = device_get_parent(pcib); - return (PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data)); + error = PCIB_MAP_MSI(device_get_parent(bus), dev, irq, addr, data); + if (error) + return (error); + + pci_ht_map_msi(pcib, *addr); + return (0); } /* Index: dev/pci/pci.c === --- dev/pci/pci.c (revision 181970) +++ dev/pci/pci.c (working copy) @@ -562,11 +562,12 @@ cfg->domain, cfg->bus, cfg->slot, cfg->func, (long long)addr); -} +} else + addr = MSI_INTEL_ADDR_BASE; -/* Enable MSI -> HT mapping. */ -val |= PCIM_HTCMD_MSI_ENABLE; -WREG(ptr + PCIR_HT_COMMAND, val, 2); +cfg->ht.ht_msimap = ptr; +cfg->ht.ht_msictrl = val; +cfg->ht.ht_msiaddr = addr; break; } break; @@ -1095,6 +1096,9 @@ bus_write_4(msix->msix_table_res, offset, address & 0x); bus_write_4(msix->msix_table_res, offset + 4, address >> 32); bus_write_4(msix->msix_table_res, offset + 8, data); + + /* Enable MSI -> HT mapping. */ + pci_ht_map_msi(dev, address); } void @@ -1534,6 +1538,34 @@ } /* + * HyperTransport MSI mapping control + */ +void +pci_ht_map_msi(device_t dev, uint64_t addr) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + struct pcicfg_ht *ht = &dinfo->cfg.ht; + + if (!ht->ht_msimap) + return; + + if (addr && !(ht->ht_msictrl & PCIM_HTCMD_MSI_ENABLE) && + ht->ht_msiaddr >> 20 == addr >> 20) { + /* Enable MSI -> HT mapping. */ + ht->ht_msictrl |= PCIM_HTCMD_MSI_ENABLE; + pci_write_config(dev, ht->ht_msimap + PCIR_HT_COMMAND, + ht->ht_msictrl, 2); + } + + if (!addr && ht->ht_msictrl & PCIM_HTCMD_MSI_ENABLE) { + /* Disable MSI -> HT mapping. */ + ht->ht_msictrl &= ~PCIM_HTCMD_MSI_ENABLE; + pci_write_config(dev, ht->ht_msimap + PCIR_HT_COMMAND, + ht->ht_msictrl, 2); + } +} + +/* * Support for MSI message signalled interrupts. */ void @@ -1558,6 +1590,9 @@ msi->msi_ctrl |= PCIM_MSICTRL_MSI_ENABLE; pci_write_config(dev, msi->msi_location + PCIR_MSI_CTRL, msi->msi_ctrl, 2); + + /* Enable MSI -> HT mapping. */ + pci_ht_map_msi(dev, address); } void @@ -1566,6 +1601,9 @@ struct pci_devinfo *dinfo = device_get_ivars(dev); struct pcicfg_msi *msi = &dinfo->cfg.msi; + /* Disable MSI -> HT mapping. */ + pci_ht_map_msi(dev, 0); + /* Disable MSI in the control register. */ msi->msi_ctrl &= ~PCIM_MSICTRL_MSI_ENABLE; pci_write_config(dev, msi->msi_location + PCIR_MSI_CTRL, msi->msi_ctrl, Index: dev/pci/pcivar.h === --- dev/pci/pcivar.h (revision 181970) +++ dev/pci/pcivar.h (working copy) @@ -115,6 +115,13 @@ struct resource *msix_pba_res; /* Resource containing PBA. */ }; +/* Interesting values for HyperTransport */ +struct pcicfg_ht { +uint8_t ht_msimap; /* Offset of MSI mapping cap registers. */ +uint16_t ht_msictrl; /* MSI mapping control */ +uint64_t ht_msiaddr; /* MSI mapping base address */ +}; + /* config header information common to all header types */ typedef struct pcicfg { struct device *dev; /* device which owns this */ @@ -156,6 +163,7 @@ struct pcicfg_vpd vpd; /* pci vital product data */ struct pcicfg_msi msi; /* pci msi */ struct pcicfg_msix msix; /* pci msi-x */ +struct pcicfg_ht ht; /* HyperTransport */ } pcicfgregs; /* additional type 1 device config header information (PCI to PCI bridge) */ @@ -462,6 +470,8 @@ int pci_msi_device_blacklisted(device_t dev); +void pci_ht_map_msi(device_t dev, uint64_t addr); + #endif /* _SYS_BUS_H_ */ /* ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Acquiring a mtx after an sx lock
On Monday 18 August 2008 17:14:01 Ryan Stone wrote: > Are there any problems acquiring a sleep mutex after acquiring an sx lock? > man 9 locking says that you can't, but doesn't provide any reasons. > Obviously while you're holding the mutex you have to abide by the rules > applying to mutexes, but as long as you do that, I can't see why acquiring > a mutex after an sx lock would cause an issue. Is the locking man page > wrong about this? Where does it say so? The interaction table clearly shows: You have: You want: Spin_mtx Slp_mtx sx_lock rw_lock rm_locksleep SPIN mutex ok-1 no no no nono-3 Sleep mutex okok-1no ok okno-3 | V sx_lock ok -->ok<-- ok-2ok okok-4 ^ | rw_lock okok no ok-2okno-3 rm_lock okok no ok ok-2 no -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: High syscall rate
On Sunday 17 August 2008 20:32:03 Artem Naluzhnyy wrote: > I have 6.1-RELEASE system with lots of processes in production. Is > there any way to determine which process causes high syscall rate? No > kernel upgrade or sizeable downtime allowed. see ktrace(1) -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Fwd: Q: case studies about scalable, enterprise-class firewall w/ IPFilter
Hello Matthias, On Tuesday 05 August 2008 10:05:20 Matthias Apitz wrote: > We're currently protecting our network (and as well some FreeBSD laptops > standalone) with IPFilter... I'm wondering if there are any case studies > about scalable, enterprise-class firewall solutions, redundancy with > state-full failover, and application-level inspection, and all that a > like, based on IPFilter and FreeBSD; > > thanks in advance for any pointers if IPFilter isn't the primary selection criteria, you might want to take a look at www.pfsense.org. Application-level inspection is just in the making, but all your other feature requests get a check mark. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: General questions about virtual memory
On Wednesday 30 July 2008 18:07:51 FreeBSD Hackers wrote: > > This suggest that you don't understand virtual memory at all. Go back to > > the > > start of the chapter and re-read. The page directories and page tables > > describe a *virtual* address space. For a given architecture the > > *virtual* address space has a fixed size (4GB for i386), so the page > > table structure is > > always the same size (though it might be sparsely populated). Inside the > > page > > Ack! As soon as I read this I realized the mistake I had made in my > thinking. This was a dumb question, and I knew better than to ask. > Somehow I had confused myself. > > - 8< - > > If a read request is made to a virtual address who's data has been swapped > out, the CPU traps to the OS to fix the problem. Assuming there are no > free page frames for the new data, a page frame is selected and evicted to > make room for the new page. Whatever page was chosen belongs to a process > somewhere in the system. When that page frame gets swapped, the PTE > pointing to that page frame must be updated to indicate that that data is > no longer in RAM. How does the OS find that PTE? Does it search through > every entry of every page table for every process in the system until it > finds it? You should have quoted (and I suppose read) my entire message: >.. you need additional bookkeeping > to track that (see core map, free lists, ...) Wikipedia really does a good job explaining all this. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: General questions about virtual memory
Hi, On Wednesday 30 July 2008 13:59:53 FreeBSD Hackers wrote: > Examples of some specific questions that I have include: > > WRT translation of virtual addresses to physical addresses, where does the > hardware stop and the software begin? Explanation: who determines the > format of the page tables (CPU or OS)? Who populates and maintains the > page tables? Where does the translation lookaside buffer reside? Who > maintains the TLB? it depends ... different architectures use different models. In i386 most of the above is done by hardware aided by software (i.e. the software has to flush the hardware TLB when it knows that the entries are no longer up to date ...) > Also WRT page tables, how does the OS and the MMU adjust for different > sizes of physical RAM? Wouldn't the page tables for a system with 512 MB > of RAM will be fewer than the page tables for a system with 2 GB of RAM? > How does the CPU know how many page table entries there are? This suggest that you don't understand virtual memory at all. Go back to the start of the chapter and re-read. The page directories and page tables describe a *virtual* address space. For a given architecture the *virtual* address space has a fixed size (4GB for i386), so the page table structure is always the same size (though it might be sparsely populated). Inside the page table you store *physical* addresses, the size of which is defined by the hardware. Also note that the physical addresses of your RAM might not necessarily start at zero and go for XX MB ... you need additional bookkeeping to track that (see core map, free lists, ...). The size of the PTE is defined by hardware and doesn't change at runtime. > I have a few more questions, but for starters this is the kind of > information I'm seeking. I'm just not getting a clear enough picture from > the textbook I'm reading now. (It makes me wish I was still in college so > I could dump my questions on my college professor. :) > > If anyone is willing to help me understand this, I would greatly appreciate > it. I would also value your input if there are other resources (people, > mailing lists, books, web pages, etc.) that you want to recommend instead > of taking some time to help teach me. google, wikipedia, the FreeBSD articles, ... all there at your fingertips. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Sysinstall is still inadequate after all of these years
http://www.pcbsd.org/ ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: kmem_alloc_wait and memory pools questions
On Friday 27 June 2008 10:43:29 Roman Divacky wrote: > hi > > I have two questions: > > 1) is kmem_alloc_wait() expensive operation? I believe it's not > very cheap looking at the code but I want confirmation > > 2) is there a support for memory pools in FreeBSD? > > to give you a little background why I am asking this. In NetBSD Andrew > Doran claims that replacing allocation from a memory submap with an > allocation from a memory pool for exec*() args he can speedup exec*() > by ~25% I think what is called a "memory pool" in NetBSD refers to their pool(9) API. This is more or less the same as our uma(9). Whether or not this is what you are looking for - I don't know. > I wonder if this applies to FreeBSD too so I am investigating it a > little. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
New Mailinglist: freebsd-wip-status@
Hello everybody, SHORT SUMMARY: http://lists.freebsd.org/mailman/listinfo/freebsd-wip-status Subscribe today!! Tell all your friends, co-workers and everybody you know who's interested in FreeBSD. Post this on your blog! ;) LONG VERSION: if you've been around lately you might already know about our effort to provide periodical status reports about ongoing FreeBSD related WIPs. The past reports can be found at: http://www.freebsd.org/news/status This system has some shortcomings however. The biggest one is that due to the collection overhead and the high rate of exciting development under the FreeBSD umbrella most of the reports are somewhat outdated by the time they get to "print". Other projects never are announced in the status reports because they happen in-between and fall through the cracks. In order to improve this situation we have created a new mailing list that should receive status reports from now on. This list will be moderated in order to keep it close to the subject. The intend is to make this an inviting place for people with little time to still stay on top of the latest and greatest in and around FreeBSD, but where one can avoid the chatter that comes with the technical debates on the normal lists. For all developers, contributors, conference organizers, 3rd party distributions, SoC-students and whoeverelse has exciting news about their FreeBSD related project this means little work. Most of you already are sending out announcement- and update-emails to lists like current@, net@ or whichever fits your project in order to inform the world about the progress you've made. Now we would like to invite you to BCC: this email to freebsd-wip-status@ as well for maximum exposure. Emails with a lot of gory, technical details are probably not suited for this list, but the usual: "Hey, I've got these cool patches to test. Here is what they do: ..." most certainly is. So this is really like the status reports before, but everybody subscribed can get the news when they happen (and not three month later when the next status reports are due). I hope for your support in bootstrapping this idea. During the next few weeks I'll keep a close eye on the lists I'm subscribed to and will encourage people to forward matching posts to freebsd-wip-status@ You are welcome to do the same. We also plan to keep the status reports as is, but collecting the reports from this new list, too. This should give the best of both worlds, we hope. If you have any questions or would like to help with editing the status reports, please contact [EMAIL PROTECTED] (reply-to set) or myself directly. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Standard byteorder functions across BSD / Linux
On Thursday 05 June 2008 00:33:19 Nanno Langstraat wrote: > My question to FreeBSD: > I don't use FreeBSD myself, but I'll prepare a patch if you like the > idea and if you indicate what you'll accept: > > * or ? > I maintain that it should be for user applications: > IMHO is for the user-kernel API, and byteorder belongs to > libc not the kernel API. > glibc apparently agrees, OpenBSD disagreed. Not sure about this. There might be namespace issues with this approach, though there probably shouldn't. It's obviously not a problem to have both, but getting rid of sys/endian.h now is too late for sure. > * You're OK with userspace applications standardizing on OpenBSD's > original betoh64() instead of FreeBSD's derivate be64toh() ? I'm all for this. We should keep the both for backward compatibility and it will probably take some fixing to hunt down all ported code that does define betoh64 on its own. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: hashinit versus phashinit
On Tuesday 06 May 2008 09:48:30 Roman Divacky wrote: > On Tue, May 06, 2008 at 02:25:56AM -0400, David Schultz wrote: > > On Mon, May 05, 2008, Roman Divacky wrote: > > > hi > > > > > > when we want to use a hash table in kernel we call "hashinit" which > > > initializes a hash table with power-of-2 size. There's also > > > "phashinit" that creates hash table of size that is a prime number. > > > This was added in 1995 by davidg@ but it is not used anywhere in > > > the kernel. > > > > > > phk@ commited rev. 1.30 of vfs_cache.c replacing phashinit with > > > hashinit stating that it's better because it replaces a division > > > with logical and. is this reason still valid today? (the commit was > > > done almost 11 years ago) > > > > > > is there still any reason why not use the phashinit instead of > > > hashinit? I believe using prime-sized hash table might have > > > positive performance impact... > > > > There's a tradeoff. > > > > The argument for using powers of 2 is that division takes many > > times longer than a logical AND. > > > > The argument for using primes is that if your hash function isn't > > as good as you thought it was, or if the data has some regularity > > you weren't expecting, you can get screwed a lot more easily with > > a power of 2 hash table. With a prime-sized hash table, you only > > get screwed if lots of your data is congruent modulo the prime, > > which is very rare. > > > > Most general-purpose hash implementations I've used (e.g., GNU > > libstdc++, Sun JDK, Microsoft .NET) use prime table sizes, > > probably to make it less likely that programmers will shoot > > themselves in the foot with pathological data or bad hash functions. > > yes... a division takes roughly 40 cycles on modern i386 hw, while > and is just 1, but does it matter compared to the access times of > memory these days? > > the ratio between cpu-speed/mem-speed has changed a lot. I am not > arguing if it's still true that avoiding the division helps the > performance these days... requests/s * div_overhead - [avoided_]collisions/s * collision_overhead ~= -([avoided_]collisions/requests * collision_overhead) assuming the collision_overhead (requiring memory operations) greatly dominates the div_overhead. So if there is a high collision rate and you can reasonably assert that you will lower that significantly by using a prime sized hash table, the div_overhead doesn't matter. At least that's what I've come up with off the top of my head now. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: indent(1) support for gcc(1) 0b prefix
On Saturday 26 April 2008 23:35:57 Romain Tartière wrote: > Hello FreeBSD hackers! > > I'm using avr-gcc from the ports and relying on the 0b prefix notation > for binary constants, that is: > > foo = 0b00101010; > > Thanks to /usr/ports/devel/avr-gcc/files/patch-0b-constants this is > possible :-) > > But I would like to use indent(1) to reformat contributed code > automatically. Unfortunately, the 0b notation is not supported by that > program, and the resulting code looks like this: > > foo = 0 b00101010; > > ... then compilation fails, bla bla bla... I can't think of a case (outside of "0x" context) where "...0b..." would be valid C code, let alone better formated as "...0 b...". Hence I see no harm in adding your patch to the base indent(1). Does anyone have an example where "...0 b..." is valid C code? > A quick look at indent(1) source code leaded me to tweak > /usr/src/usr.bin/indent/lexi.c so that the 0b notation is supported > (patch attached). > > I was so wondering how useful(less) it was to support this extension in > FreeBSD indent(1) program. The version of gcc provided with the base > system does not support this syntax, and AFAIK, only the avr-gcc port > support this kind of constructs... > > So options are: > - Add support for 0b notation to FreeBSD indent(1) (maybe requiring > the use of an extra command line argument to support this feature); > - Provide a patch for indent(1) that can be conditionally applied on > the code when compiling the world; > - Create another port, say avr-indent(1), that is not more than a > copy of indent(1) with support of 0b constructs; > - Do nothing: tweaking indent(1) for supporting this is so trivial > that the few individuals interested in this can have their local > version of indent. > > Can you please tell me your opinion about this? > > Thank you in advance, > Romain > > PS: I also took a look at GNU indent (gindent(1) from the ports), but > it does not support 0b notation too. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Perforce and `p4 diff2' against the origin
On Saturday 05 April 2008 18:03:12 Roman Divacky wrote: > On Sat, Apr 05, 2008 at 04:50:38PM +0200, Ed Schouten wrote: > > Hello everyone, > > > > Because my mpsafetty project in Perforce is going quite well, I'm > > considering running some kind of cron job to generate nightly diffs, > > so other people (interested friends, colleagues and others) to test > > my work. > > > > I've read `p4 help diff2' and it seems you can run the following > > command: > > > > p4 diff2 -b mpsafetty > > > > Unfortunately this command just does a braindead diff against the > > latest FreeBSD vendor source, which is not useful in my case. I just > > want it to generate a diff against the version I integrated. > > > > Is it possible to do this with Perforce? > > this is what I use > > p4 diff2 -du //depot/vendor/freebsd/src/sys/[EMAIL PROTECTED] > //depot/projects/soc2007/rdivacky/linux_at/sys/... | ~/awkdiff > > you can adjust that to your needs The @rev to use can be obtained with: p4 changes -m 1 -i -u importer ... while inside your branched directory. Yes, this is an expensive command. You should rather check out the latest rev on the vendor tree before doing an IFC and record that rev into the IFC commit message. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: features of objcopy
On Friday 21 March 2008 21:03:19 Kai Wang wrote: > Hi list, > > I'm working on a BSD Licensed objcopy/strip rewrite(in p4) based on > libelf, I really want to know the answers to a few questions listed > below, and please do not hesitate if you have other related > suggestions. Thanks in advance! > > 1. Do you often use object/strip on 'ar' archives? > > 2. Do you often convert ELF to raw binary, iHex, S-Record or > vice versa? > > 3. What features do you like to add into objcopy? > > 4. What features would be useful for FreeBSD build system > and is currently missing in objcopy? take a look at how we currently build firmware(9) modules (this concerns 2-4). Right now we use ld to convert a raw binary to something we can link and have basic symbols to find the start and length of the binary. This works, but not for all archs (ia64) and could be more comfortable. I remember that we tried GNU objcopy at first, but it didn't give what we were looking for - don't recall details, though. Let me know if you have questions about this. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Building in /usr/src copied to $HOME
On Wednesday 19 March 2008 05:36:47 Giorgos Keramidas wrote: > On 2008-03-18 21:28, V??clav Haisman <[EMAIL PROTECTED]> wrote: > > Hi, > > I am trying to use /usr/src copied to my $HOME but the build process > > doesn't want to work. For example when I try build /bin/cp I get the > > following: > > > > shell::wilx:~/freebsd/src/bin/cp> make > > "/usr/home/users/wilx/freebsd/src/bin/cp/../Makefile.inc", line 9: > > Malformed conditional (${MK_DYNAMICROOT} == "no") > > "/usr/share/mk/bsd.init.mk", line 15: if-less endif > > make: fatal errors encountered -- cannot continue Looks like a problem with /usr/share/mk being out of date (not sure this should be an issue, though). A simple fix should be to add "-m `pwd`/share/mk" to make ... or "-m `pwd`/../../share/mk" in your example above. The buildworld target seems to pick this automatically. > > Is there any sort of tutorial/prescription anywhere how to use > > /usr/src tree that does not reside in /usr/src? > > Hmmm, that should work. I regularly build as a non-root user, at > `/home/build/src'. > > The error about ``Malformed conditional'' seems a bit odd too. Are you > using /usr/bin/make? What version of FreeBSD is the build host > running, and what version of the source tree have you checked out? -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Review please: pfil FIRST/LAST
On Monday 17 March 2008 11:29:15 Vadim Goncharov wrote: > On Sun, 16 Mar 2008 00:05:36 +0100; Max Laier wrote about 'Review please: pfil FIRST/LAST': > > attached is a small diff to allow pfil(9) consumers to force a > > sticky position on the head/tail of the processing queue. This > > can be used to do traffic conditioning kind of tasks w/o > > disturbing the other filters. I will need this to implement > > carp(4) ip based load balancing. While here I also removed a few > > paragraphs in BUGS which are no longer true (since we are using > > rmlocks for pfil(9)). > > > > I'd appreciate review of the logic in pfil_list_add - just to make > > sure I didn't botch it. Thanks. > > Could it be done a way which will allow user a simple configuration of > filter plly ordering? E.g. to specify that order must alway be "ipfw, > then pf". This is a separate issue. I had patches once to specify hook order via sysctl and will probably revisit this as I like the idea. For now, though, this is not what I'm interested in. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Review please: pfil FIRST/LAST
Hi, attached is a small diff to allow pfil(9) consumers to force a sticky position on the head/tail of the processing queue. This can be used to do traffic conditioning kind of tasks w/o disturbing the other filters. I will need this to implement carp(4) ip based load balancing. While here I also removed a few paragraphs in BUGS which are no longer true (since we are using rmlocks for pfil(9)). I'd appreciate review of the logic in pfil_list_add - just to make sure I didn't botch it. Thanks. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News Index: sys/net/pfil.c === RCS file: /home/ncvs/src/sys/net/pfil.c,v retrieving revision 1.15 diff -u -r1.15 pfil.c --- sys/net/pfil.c 25 Nov 2007 12:41:47 - 1.15 +++ sys/net/pfil.c 15 Mar 2008 22:35:50 - @@ -182,6 +182,9 @@ struct packet_filter_hook *pfh2 = NULL; int err; + if ((flags & (PFIL_FIRST|PFIL_LAST)) == (PFIL_FIRST|PFIL_LAST)) + return (EDOOFUS); + /* Get memory */ if (flags & PFIL_IN) { pfh1 = (struct packet_filter_hook *)malloc(sizeof(*pfh1), @@ -267,23 +270,50 @@ static int pfil_list_add(pfil_list_t *list, struct packet_filter_hook *pfh1, int flags) { - struct packet_filter_hook *pfh; + struct packet_filter_hook *pfh, *fh, *lh; /* * First make sure the hook is not already there. */ - TAILQ_FOREACH(pfh, list, pfil_link) + fh = TAILQ_FIRST(list); + lh = NULL; + TAILQ_FOREACH(pfh, list, pfil_link) { + /* fh is the first hook not marked PFIL_FIRST */ + if (pfh->pfil_flags & PFIL_FIRST) + fh = TAILQ_NEXT(pfh, pfil_link); + /* lh ist the last hook not marked PFIL_LAST */ + if (!(pfh->pfil_flags & PFIL_LAST)) + lh = pfh; if (pfh->pfil_func == pfh1->pfil_func && pfh->pfil_arg == pfh1->pfil_arg) return EEXIST; + } + /* * insert the input list in reverse order of the output list * so that the same path is followed in or out of the kernel. */ - if (flags & PFIL_IN) + if (flags & PFIL_FIRST) { TAILQ_INSERT_HEAD(list, pfh1, pfil_link); - else + } else if (flags & PFIL_LAST) { TAILQ_INSERT_TAIL(list, pfh1, pfil_link); + } else { + if (flags & PFIL_IN) { + if (fh) +TAILQ_INSERT_BEFORE(fh, pfh1, pfil_link); + else if (!TAILQ_EMPTY(list)) +TAILQ_INSERT_TAIL(list, pfh1, pfil_link); + else +TAILQ_INSERT_HEAD(list, pfh1, pfil_link); + } else { + if (lh) +TAILQ_INSERT_AFTER(list, lh, pfh1, pfil_link); + else if (!TAILQ_EMPTY(list)) +TAILQ_INSERT_HEAD(list, pfh1, pfil_link); + else +TAILQ_INSERT_TAIL(list, pfh1, pfil_link); + } + } return 0; } Index: sys/net/pfil.h === RCS file: /home/ncvs/src/sys/net/pfil.h,v retrieving revision 1.17 diff -u -r1.17 pfil.h --- sys/net/pfil.h 25 Nov 2007 12:41:47 - 1.17 +++ sys/net/pfil.h 15 Mar 2008 22:34:44 - @@ -54,10 +54,12 @@ int pfil_flags; }; -#define PFIL_IN 0x0001 -#define PFIL_OUT 0x0002 -#define PFIL_WAITOK 0x0004 -#define PFIL_ALL (PFIL_IN|PFIL_OUT) +#define PFIL_IN (1<<0) +#define PFIL_OUT (1<<2) +#define PFIL_WAITOK (1<<3) +#define PFIL_ALL (PFIL_IN|PFIL_OUT) +#define PFIL_FIRST (1<<4) +#define PFIL_LAST (1<<5) typedef TAILQ_HEAD(pfil_list, packet_filter_hook) pfil_list_t; Index: share/man/man9/pfil.9 === RCS file: /home/ncvs/src/share/man/man9/pfil.9,v retrieving revision 1.22 diff -u -r1.22 pfil.9 --- share/man/man9/pfil.9 18 Sep 2006 15:24:20 - 1.22 +++ share/man/man9/pfil.9 15 Mar 2008 22:50:48 - @@ -28,7 +28,7 @@ .\" .\" $FreeBSD: src/share/man/man9/pfil.9,v 1.22 2006/09/18 15:24:20 ru Exp $ .\" -.Dd September 29, 2004 +.Dd March 15, 2008 .Dt PFIL 9 .Os .Sh NAME @@ -115,6 +115,11 @@ or .Dv PFIL_OUT ) that the packet is traveling. +.Dv PFIL_FIRST +and +.Dv PFIL_LAST +can be used to force a sticky positioning of the hook in the front or the +tail of the processing queue respectively. The filter may change which mbuf the .Vt "mbuf\ **" argument references. @@ -134,15 +139,6 @@ .Fn pfil_remove_hook functions return 0 if successful. -If called with flag -.Dv PFIL_WAITOK , -.Fn pfil_remove_hook -is expected to always succeed. -.Pp -The -.Fn pfil_head_unregister -function -might sleep! .Sh SEE ALSO .Xr bpf 4 , .Xr if_bridge 4 @@ -203,14 +199,3 @@ .Dv AF_INET6 traffic according to its sysctl settings, but contrary to the above statements, the data is provided in host byte order. -.Pp -When a -.Vt pfil_head -is being modified, no traffic is diverted -(to avoid deadlock). -This means that traffic may be dropped unconditionally for
Re: Documentation on writing a custom socket
Am Sa, 8.03.2008, 11:33, schrieb Hans Petter Selasky: > I'm planning to create a new socket type in FreeBSD called AF_Q921, which > is > to be used for ISDN telephony. Where do I find documentation on how to interesting ... can you share more information on this project? > implement a new socket in the kernel ? src/sys/netgraph/bluetooth/socket/ng_btsocket.c (and the rest of the .c files in there) are a good reference. Depeding on your needs netgraph might even be the right place for the whole project. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: if_start() and sending packets problem
Am Sa, 16.02.2008, 09:11, schrieb Tofig Suleymanov: > Hello hackers, > > I will be grateful if someone could point me to the right direction > regarding the question below. > > My device driver is getting incoming packets fine, but for some reason I > am not able to send a single packet. Here is the source code: > > http://www.freebsd.az/if_ib.c > > I've added several debug messages to the source and here is the output: > > (bringing interface up and assigning the ip/netmask combination) > > ifconfig ib0 192.168.0.6 netmask 255.255.255.0 up > > (At this moment I get this in my /var/log/messages. It seems to be a > gratuitous arp who-has packet ) > > Feb 7 19:14:32 schizo kernel: ib_init entered > Feb 7 19:14:32 schizo kernel: ib_start entered > Feb 7 19:14:32 schizo kernel: ib_encap entered > Feb 7 19:14:32 schizo kernel: DHOST ff ff ff ff ff ff > Feb 7 19:14:32 schizo kernel: SHOST 0 c0 ee 22 3 14 > Feb 7 19:14:32 schizo kernel: txeof entered > Feb 7 19:14:32 schizo kernel: txeof exiting > > (now I try pinging, but no joy . I've added extra debug messages inside > ping.c) > > schizo# ping 192.168.0.1 > PING 192.168.0.1 (192.168.0.1): 56 data bytes > packets sent: -1 > ping: sendto: Invalid argument > packets sent: -1 > ping: sendto: Invalid argument > packets sent: -1 > ping: sendto: Invalid argument > ^C > --- 192.168.0.1 ping statistics --- > 3 packets transmitted, 0 packets received, 100% packet loss > > > I have also tried to add debug messages to sys/net/if.c and > sys/net/netisr.c and it seems that the kernel doesn't even try to run my > ib_start() function. > > Doing tcpdump on the interface and pinging does not show any packets > flowing. Please note that tcpdump shows the arp who-has request right > after I assign the ip address. > > ifconfig ib0 gives the following: > ib0: flags=1008c3 mtu 1500 Why do you set NOARP? It seems that your ping can't figure out the ARP address of 192.168.0.1 and hence returns early. Either install a static arp entry for 192.168.0.1 or lose the NOARP. >inet 192.168.0.5 netmask 0xff00 broadcast 192.168.0.255 >ether 00:c0:ee:22:03:14 >media: Ethernet 10baseT/UTP >status: active > > netstat -in gives the following output: > NameMtu Network Address Ipkts IerrsOpkts Oerrs > Coll > bge0* 1500 00:16:41:52:fb:1e0 000 > 0 > iwi0 1500 00:13:ce:cc:b8:10 3065 0 28560 > 0 > iwi0 1500 192.168.1 192.168.1.5 3034 - 2825- > - > lo0 16384 80 8 0 > 0 > lo0 16384 127 127.0.0.1 8- 8 - > - > ib01500 00:c0:ee:22:03:14 40 2 0 > 0 > ib01500 192.168.0 192.168.0.5 0- 3 - > - > > Any ideas are highly appreciated. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Memory allocation performance
Am Sa, 2.02.2008, 23:05, schrieb Alexander Motin: > Robert Watson wrote: >> Hence my request for drilling down a bit on profiling -- the question >> I'm asking is whether profiling shows things running or taking time that >> shouldn't be. > > I have not yet understood why does it happend, but hwpmc shows huge > amount of "p4-resource-stall"s in UMA functions: >% cumulative self self total > time seconds secondscalls ms/call ms/call name > 45.22303.00 2303.000 100.00% uma_zfree_arg [1] > 41.24402.00 2099.000 100.00% uma_zalloc_arg [2] >1.44472.0070.000 100.00% > uma_zone_exhausted_nolock [3] >0.94520.0048.000 100.00% ng_snd_item [4] >0.84562.0042.000 100.00% __qdivrem [5] >0.84603.0041.000 100.00% ether_input [6] >0.64633.0030.000 100.00% ng_ppp_prepend [7] > > Probably it explains why "p4-global-power-events" shows many hits into > them >% cumulative self self total > time seconds secondscalls ms/call ms/call name > 20.0 37984.00 37984.000 100.00% uma_zfree_arg [1] > 17.8 71818.00 33834.000 100.00% uma_zalloc_arg [2] >4.0 79483.00 7665.000 100.00% ng_snd_item [3] >3.0 85256.00 5773.000 100.00% __mcount [4] >2.3 89677.00 4421.000 100.00% bcmp [5] >2.2 93853.00 4176.000 100.00% generic_bcopy [6] > > , while "p4-instr-retired" does not. >% cumulative self self total > time seconds secondscalls ms/call ms/call name > 11.15351.00 5351.000 100.00% ng_apply_item [1] >7.99178.00 3827.000 100.00% > legacy_pcib_alloc_msi [2] >4.1 11182.00 2004.000 100.00% init386 [3] >4.0 13108.00 1926.000 100.00% rn_match [4] >3.5 14811.00 1703.000 100.00% uma_zalloc_arg [5] >2.6 16046.00 1235.000 100.00% SHA256_Transform > [6] >2.2 17130.00 1084.000 100.00% ng_add_hook [7] >2.0 18111.00 981.000 100.00% ng_rmhook_self [8] >2.0 19054.00 943.000 100.00% em_encap [9] > > For this moment I have invent two possible explanation. One is that due > to UMA's cyclic block allocation order it does not fits CPU caches and > another that it is somehow related to critical_exit(), which possibly > can cause context switch. Does anybody have better explanation how such > small and simple in this part function can cause such results? I didn't see bzero accounted for in any of the traces in this thread - makes me wonder if that might mean that it's counted within uma_zalloc? Maybe we are calling it twice by accident? I wasn't quite able to figure out the logic of M_ZERO vs. UMA_ZONE_MALLOC etc. ... just a crazy idea. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: How long is a hz?
On Monday 28 January 2008, Sean Bruno wrote: > I couldn't quite find the definition for "hz" in sys/ this morning. > What is it's value and where is it defined? sys/kern/subr_param.c:int hz; sys/sys/time.h: int hz; /* clock frequency */ sys/kernel.h:extern int tick; /* usec per tick (100 / hz) */ sys/kernel.h:extern int hz; /* system clock's frequency */ The actual value for hz comes from your kernel configuration. The default is "options HZ=1000" at the moment. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News signature.asc Description: This is a digitally signed message part.
Re: Some diffs
On Thursday 20 December 2007, M. Warner Losh wrote: > Consider the following diffs. The first one does a tiny cleanup of > strfile's include style (no real reason other than it bugged me when I > added stdint.h). > > The second one cleans up a minor problem where ${CFLAGS} isn't used > where it should be. > > The next three cleanup the compilation by not assuming sys/types.h is > included or by also including > > And the last, rather long, patch converts the .y in config to a form > that more versions of yacc would grok. > > Comments? sys/types.h (xor param.h) is supposed to be the first include (other than cdefs.h) according to style. The rest seems fine from a quick glance. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News signature.asc Description: This is a digitally signed message part.
Re: How to get filename of an open file descriptor
On Wednesday 14 November 2007, Robert Watson wrote: > On Tue, 13 Nov 2007, Yuri wrote: > > Thank you for letting me know about this new feature procstat. > > > > But is there any workaround in 6.3? I need to port one package that > > needs to lookup file names by FDs to the current FreeBSD and need > > some solution now. I'm not completely certain what you are looking for, but doesn't lsof do just that? > If the port uses a script to extract the data, a tool like lsof may do > the trick. However, I'm not sure there are any native APIs to query > that data "as shipped" in 6.3. Once I've had some reasonable feedback > on procstat(1), I'll merge it into CVS and start it on the MFC route, > but 6.3 is almost certainly too soon for it to ship as part of that > release. I don't know if there will be a 6.4 or not, but I would > anticipate procstat(1) appearing in 7.1, and 6-STABLE if there are > requests. procstat(1) mostly relies on existing sysctls, and adds two > new ones for the purposes of exporting the file descriptor and VM > information only, so it is a fairly straight forward MFC. > > Robert N M Watson > Computer Laboratory > University of Cambridge > > > Yuri > > > > Quoting Robert Watson <[EMAIL PROTECTED]>: > >> On Mon, 12 Nov 2007, Yuri wrote: > >>> Thank you for your response. > >>> > >>> I attempted to compile procstat but procstat.h seems to be missing > >>> in > >> > >> tgz. > >> > >> Yuri, > >> > >> Indeed -- looks like I forgot to p4 add on my development box. I've > >> updated > >> > >> the tarball to now include procstat.h. If there are any other > >> problems, do > >> > >> let me know. > >> > >> Robert N M Watson > >> Computer Laboratory > >> University of Cambridge > > ___ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "[EMAIL PROTECTED]" -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News signature.asc Description: This is a digitally signed message part.
Re: TCP/IP redundant connections
On Tuesday 11 September 2007, Artem Kazakov wrote: > Hello Everyone! > > For my research project I'm working on making some network services > redundant. And I have one idea, but I'm not so good and operating > system > internals, so could you please tell what do you think. If it is > possible at all. > > So, I have two hosts, which are all the same and they have some > network service which I need to make available all the time. This > service has some internal state, which is synchronized over private > connection. And at one time only one of the servers actually works > with clients, the other on is just sitting there and kept > synchronized. > The clients have persistent TCP connections to the server, and in case > of failure they make UDP broadcasts searching for server and then > reconnect. So basically there is no need to use IP-sharing between two > of them. But if the server fails, the client usually notices that > after some time-out (tcp keep alive time out I suppose) which is not > very good in some cases. > So I want to utilize IP-sharing and TCP-connection synchronization > (which is not yet implemented by anyone as far as I know). I want it > in case of failure seamlessly to switch to the other machine. As far > as the internal state is synchronized, if it is possible to > synchronize open connections as well(and all the low level stuff as > packet sequence numbers and so on) it would allow to make switch-over > to the back-up server in a matter of seconds, and the clients would > stay connected. > Is is possible to do so ? And if yes, how difficult would it be for a > person who has solid background in general-tasks programming, but no > experience with low level system programming ? And what are the > possible cave-eats of this approach? TCP is a reliable protocol. That means once you ACK a segment the other side assumes that you have actually received it. In your scenario, that would mean to defer the ACK until the secondary box has received the copy of the segment and acknowledged to the first one which then in turn will acknowledge the client. As a result you are back to a single point of failure and greatly diminished performance. If you try to do it differently - e.g. have the second box just snoop in on the TCP state. There is no guarantee that it has actually seen every packet and once a segment (that the primary has ACKed) is lost, there's no way to get it back. I think you should rather look at session management in the application and move away from long-lived TCP connections for that purpose. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News signature.asc Description: This is a digitally signed message part.
Re: Exclusive binary files
On Saturday 01 September 2007, Klaus Schneider wrote: > Hi. > > Well, anybody know a way to make the FreeBSD run just binaries that I > have compiled? > > For example: > A hacker get a access to a shell into my server, and then it put a > exploit code, but on the machine don't have a compiler, then he tries > to put the compiled exploit... supose that I can't mount the users > partition in "noexec" mode... > > Anybode knows a solution for these? IIRC csjp@ had some code to do this inside the MAC framework. Storing hashes in extended attributes and only allowing execution of signed executables ... http://perforce.freebsd.org/fileLogView.cgi?FSPC=//depot/projects/trustedbsd/mac/sys/security/mac%5fchkexec/mac%5fchkexec.c ... not sure what became of it, though. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News signature.asc Description: This is a digitally signed message part.
Re: what happened to make world?
On Thursday 30 August 2007, Pietro Cerutti wrote: > # make world > WARNING: make world will overwrite your existing FreeBSD > installation without also building and installing a new > kernel. This can be dangerous. Please read the handbook, > 'Rebuilding world', for how to upgrade your system. > Define DESTDIR to where you want to install FreeBSD, > including /, to override this warning and proceed as usual. > You may get the historical 'make world' behavior by defining > HISTORICAL_MAKE_WORLD. You should understand the implications > before doing this. > > Bailing out now... > *** Error code 1 > > Stop in /usr/src. > > > Now, THIS is quite funny... do you really thing that a person with > - root access > - the knowledge of the existence of "make world" > needs this sort of things? > > I didn't see anything about this new-wave-of-user-friendly-bsd going on > the list.. have I missed something? And your complaint would be ... what exactly? -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News signature.asc Description: This is a digitally signed message part.
Re: is there any up to date info on how to write simple drivers for the FBSD 6.1 kernel ?
I suggest looking at John-Mark Gurney's 2006 BSDCan presentation: http://www.bsdcan.org/2006/papers/freebsd.device.driver.slides.pdf http://www.bsdcan.org/2006/papers/freebsd.driver.pdf -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News signature.asc Description: This is a digitally signed message part.
Re: FreeBSD status reports due: July 7, 2007
Hello again, kind reminder that the repdigit date is on this Saturday! So far we have received only 18 reports - I know there is more going on out there. Please let the world know what kind of cool stuff is going on in FreeBSD! On Sunday 24 June 2007, Max Laier wrote: > it's that time again. We would like to remind everybody who has > exciting news to share to write a report about their project. This is > a good way to improve exposure of your work, receive feedback and help. > As we are closing in on 7.0 everybody is interested to know what's new > - so please, do tell! > > In addition we would like to gather public relations status reports as > well - did you run a FreeBSD conference or are you going to? Let the > world know how it went or why they should attend. On that note, > everybody remember the early bird deadline for EuroBSDCon? It's July 1 > already! > > Looking forward to your reports. As always you can either use the > template or the generator CGI and mail the result to monthly@ by > 07/07/07 > > http://www.freebsd.org/news/status/ > http://www.freebsd.org/cgi/monthly.cgi > http://www.freebsd.org/news/status/report-sample.xml -- FreeBSD Status reports due: 07/07/07 :-) /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News signature.asc Description: This is a digitally signed message part.
FreeBSD status reports due: July 7, 2007
Hello Everybody, it's that time again. We would like to remind everybody who has exciting news to share to write a report about their project. This is a good way to improve exposure of your work, receive feedback and help. As we are closing in on 7.0 everybody is interested to know what's new - so please, do tell! In addition we would like to gather public relations status reports as well - did you run a FreeBSD conference or are you going to? Let the world know how it went or why they should attend. On that note, everybody remember the early bird deadline for EuroBSDCon? It's July 1 already! Looking forward to your reports. As always you can either use the template or the generator CGI and mail the result to monthly@ by 07/07/07 http://www.freebsd.org/news/status/ http://www.freebsd.org/cgi/monthly.cgi http://www.freebsd.org/news/status/report-sample.xml -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpq0lbzySxB1.pgp Description: PGP signature
FreeBSD Status Reports due Saturday (04/07)
Hi, quick note from the "better late than never"-department. This is a reminder that we collect status reports every three months. The reports for the first three month (January - Now) are due by Saturday, April 7. We are looking for anything FreeBSD related: Code, Advocacy, Vendor reports, Community activities ... ... on that note, I'd like to remind you that BSDCan in Ottawa is coming up 16-19 May. http://www.bsdcan.org/ for more information - see you there! Please use the xml generator[1] or the template[2] and send your report to monthly@ by Saturday. Thanks, looking forward to your reports. [1] http://www.freebsd.org/cgi/monthly.cgi [2] http://www.freebsd.org/news/status/report-sample.xml -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpN6DcwA77dr.pgp Description: PGP signature
Re: FreeBSD panics...
On Thursday 22 March 2007 20:58, Sławomir Babiński SYSINFO wrote: > Can anyone look at this and sell any tips why my server panics? Wrong list. This should have been sent to -current or -net ... > [EMAIL PROTECTED]:/root# uname -a > > FreeBSD mercury.msi.pl 6.2-STABLE FreeBSD 6.2-STABLE #7: Wed Mar 21 > 19:20:18 CET 2007 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/cobaltus > i386 ... > #7 0xc0743318 in m_copydata (m=0x0, off=0, len=1, cp=0xc502bf08 > "essful\r\n257 \"/\" is the current directory\r\n250 CWó\f") > at /usr/src/sys/kern/uipc_mbuf.c:543 > #8 0xc048d71d in ippr_ftp_process (fin=0xe2d4db30, nat=0xca66e400, > ftp=0xc502be00, rv=1) at ip_ftp_pxy.c:1192 > #9 0xc048db2c in ippr_ftp_in (fin=0xe2d4db30, aps=0x0, nat=0xca66e400) > at ip_ftp_pxy.c:1358 > #10 0xc0492dfb in appr_check (fin=0xe2d4db30, nat=0xca66e400) at > /usr/src/sys/contrib/ipfilter/netinet/ip_proxy.c:540 > #11 0xc048a8af in fr_natin (fin=0xe2d4db30, nat=0xca66e400, natadd=1, > nflags=1) > at /usr/src/sys/contrib/ipfilter/netinet/ip_nat.c:4105 > #12 0xc048a744 in fr_checknatin (fin=0xe2d4db30, passp=0xe2d4db2c) at > /usr/src/sys/contrib/ipfilter/netinet/ip_nat.c:4040 > #13 0xc047c666 in fr_check (ip=0xc4a18820, hlen=20, ifp=0x0, out=0, > mp=0xe2d4dc18) > at /usr/src/sys/contrib/ipfilter/netinet/fil.c:2466 Looks like a good example why it is a bad idea to have an application proxy running in the kernel. More to the point, could you provide "fin" in frames 8 through 12 and the local variables in frame 8, too? -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpWa7Y8eHspB.pgp Description: PGP signature
Re: i am facing these issues after my FreeBSD 6.2 installation.
Hello Ajay, On Tuesday 13 March 2007 13:23, ajay gopalakrishnan wrote: > I've recently installed FreeBSD release 6.2 successfully except that > the following things that i need importantly dont work. How should i do > these? this is the wrong list to ask such questions. I referred your email to the more appropriate list "freebsd-questions". You might also find that the handbook can be quite helpful. > 1. I am using PPP over Ethernet (PPPoE). I am running FreeBSD on Vmware > and i set the network connection as "Bridged" on Vmware. I configured > my Ethernet device with the correct IP, Gateway, Netmask, DNS but i > dont know how to start my internet on FreeBSD. All i do to connect to > the internet on Windows is give my username and password. I also read > the PPPoE chapter on the FreeBSD manual but of no use. How should i > start PPoE on FreeBSD? http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/pppoe.html > 2. I need Vim. I dont want to use Vi. I searched in my CD-1 and CD-2. > But i could not find the package "vim" inside it. Since i am not able > to connect to the internet is there any other way to install Vim ? http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/editors.html > 3. How should i configure FreeBSD to start in X mode directly. > Currently i have to do startx to start X on my machine. http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-xdm.html > 4. I want to make "bash" as the default shell instead of "csh". Where > is that configured? http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/shells.html > 5. Where are the kernel sources located? I need it because i want to do > kernel network programming? Is having kernel sources sufficient or > there are other dependencies also? http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/install-choosing.html > 6. How do developers usually keep their kernel sources in sync with the > main Central Kernel source? Do we use CVS or Subversion for this? Use a cvsup file along these lines: --- *default host=cvsup.XXX.FreeBSD.org *default base=/home//.cvsupdb *default prefix=/home//fcvs *default release=cvs *default delete use-rel-suffix *default compress src-all ports-all doc-all www cvsroot-all --- After that "cvs -d /home//fcvs co src" will get you up and running. Ready to do "cvs diff -u" to check for the local changes you made etc. As a side note: If you can't figure out simple questions like this by your self, you will have a hard time to do actual development. We provide a large amount of documentation, but you must use it yourself! -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpuYMfEteiZZ.pgp Description: PGP signature
Re: how to deny reading of several sysctls (for a set of uids, f.e.)
On Wednesday 24 January 2007 14:23, you wrote: > On Tue, 23 Jan 2007 14:10:19 +0100 > Max Laier <[EMAIL PROTECTED]> wrote: > > [..] > > > td->td_proc->p_ucred has the user credentials. You > >probably want to do > > your checks in userland_sysctl() according to the > >comment just above. > > Thanks, it is really what I need. > > Now I have once more question. > I made the kernel object with one check-function and all > works fine from userland via syscall(). > > Is there a documented possibility to use syscalls _inside_ > kernel code? > In other words, I need to call the function located in > loadable kernel object from kernel, doesn't matter how > this would be done (syscall, etc). > > My goal is to avoid kernel rebuilding each time after > function modification. > > Is it possible? You should use a function pointer. Look for example at "ip_dn_io_ptr" in netinet. This is a function pointer that is populated from the dummynet module and (if non-NULL) called from the kernel (or ip_fw_pfil.c). Note that you might need some locking around the pointer access if you want to be able to load and unload the module at will. OTOH, sysctl seems to be protected by Giant anyways. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgp65DOghzAf6.pgp Description: PGP signature
Re: how to deny reading of several sysctls (for a set of uids, f.e.)
On Tuesday 23 January 2007 12:44, Andrew N. Below wrote: > System - RELENG_6. > > Easiest way I found is to patch libc. > But in this case we still can get an original library and use > LD_PRELOAD. > > Is there any way to obtain uid of calling process (thread?) > within the kernel? > > We have following extern in src/lib/libc/gen/sysctl.c: > [..] > extern int __sysctl(int *name, u_int namelen, void *oldp, size_t > *oldlenp, void *newp, size_t newlen); > [..] > > And there is __sysctl (src/sys/kern/kern_sysctl.c): > > [..] > /* > * MPSAFE > */ > int > __sysctl(struct thread *td, struct sysctl_args *uap) > [..] > > 1. Whether this function is called from libc sysctl() ? > > 2. What can we get from td here? My knowledge about FreeBSD kernel > and kernel threads is not yet enough for understanding this. td->td_proc->p_ucred has the user credentials. You probably want to do your checks in userland_sysctl() according to the comment just above. > I also thought about passing control variable from libc > to kernel, but it seems to be bad idea. > > Any other ways? -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpOlKKcYIDRL.pgp Description: PGP signature
Re: ipw3945 assistance?
On Saturday 20 January 2007 05:10, xoundmind wrote: > Please excuse my noob status...I would like some assistance with > installing the wpi-freebsd driver on a 6_2 Release setup. Please feel N.B. wpi(4) != ipw(4) !!! The latter is for the - now ancient - 1st generation centrino cards (2100). The former - supporting the 3945 cards - is in early stages of development (at least the port to FreeBSD is). The latest attempt is located at: http://www.clearchain.com/wiki/Wpi Note that this is not yet recommended for consumer use. Eventhough testing is welcome and encouraged, this work is simply not yet in a stable enough state that documentation can be made available. In general, the tarball from the page above supplies you with everything you need (other than a FreeBSD src-tree). There is no need to download additional firmware. The focus, for now, is HEAD so testing in RELENG_6 is not supported. The best advice, as a user and for now, seems to be to try ndis (though I have heard reports that it doesn't work for the ipw hardware), or wait for the driver to hit the tree. > free to be a specific as possible, as I suspect there are many others > who wish to get this working (and are not used to applying > "non-standard" drivers.) Many thanks -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpcllOUMG5RO.pgp Description: PGP signature
Call for FreeBSD Status Reports
Hi, and a good 2007 to everyone! It's time to reminisce about last year, in particular about the last three month aka. forth quarter. This is the call for Status Reports covering this timeframe! Submission due has just been moved to January 14th. Submissions must be in the report xml format. You can either use the template[1] or the generator cgi[2]. Please mail the result of either to monthly@ by January 14th. Every project related to FreeBSD should submit a report. Past reports can be browsered from the Status Report homepage[3]. Looking forward to your submissions! I'd also like to remind you that the BSDCan Call for Papers ends at January 19th. While you are writting a Status Report - consider submitting a talk about your work, too! [1] http://www.freebsd.org/news/status/report-sample.xml [2] http://www.freebsd.org/cgi/monthly.cgi [3] http://www.freebsd.org/news/status/ -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgp8FAYgR76x6.pgp Description: PGP signature
Re: Updated Driver for 3945ABG Intel 3945ABG Wireless LAN controller
On Sunday 07 January 2007 14:35, Benjamin Close wrote: > Massimo Lusetti wrote: > > On 1/5/07, Max Laier <[EMAIL PROTECTED]> wrote: > >> Thoughts? Volunteers? > > > > I can say that the first attempt still running fine here on my laptop > > on a -STABLE as of yesterday. I use it on a daily basis without any > > glitch. I must say i don't do or tried to do nothing special or > > network intensive job, but for reading emails, doing a lot of ssh and > > http/https the drivers is working smoothly. > > > > I will try to compile this new one on my stable during the week end > > and will see on Monday how it will perform on my office wi-lan. > > > > For the records: my wpi doesn't still work on OpenBSD-current cause > > it's integrated and the switch used to turn it on seems an acpi one > > which OpenBSD doesn't attach very well yet. > > Hi Folks, > I did the port as my searching led me to believe that progress on a > driver had stagnated. > Port 1: was done by Damien himself > (http://lists.freebsd.org/pipermail/freebsd-mobile/2006-July/008768.htm >l) Port 2: was an updated version by Daminen: > http://osdir.com/ml/freebsd-hackers@freebsd.org/msg58154.html > which seems to be duplicated here: > http://people.freebsd.org/~flz/local/wpi/ > (http://www.mail-archive.com/freebsd-net@freebsd.org/msg20710.html) > With version 2 being minor bug fixes to version 1 to try and get it > working. Since then the driver has come a long way in netbsd with the > FreeBSD version just getting older. > > To others working on a wpi driver, please post something indicating > what you've done and even a sample of what your up to so we can one > build one driver that just works. I also did the driver port as > everything I found failed to work on a 64bit kernel, most the time > wouldn't even compile. > > I'm happy to try and maintain this driver. I have the hardware. Excellent! > The main bugs I know about in this driver port are: > > * The use of the iee80211_amrr code > The files exist in -current in /usr/src/sys/net80211 but the required > symbols are not in a GENERIC kernel build. There is a wlan_amrr module > which uses this code, though I'm not sure how to make use of this, it > appears a simple dependency on the module is not enough. The use of the > 80211_amrr code also means that use under -stable requires quite a bit > more work as Rink pointed out. > > * Bus resource allocation issues > Mainly related to: "bus_dmamem_alloc failed to align memory properly." > I'm hoping Mike > (http://lists.freebsd.org/pipermail/freebsd-stable/2006-June/026262.htm >l) might be able to help resolve these. > > These allocation issues are caused while allocating of the rx & tx ring > buffers - which if they are broken explain why things don't work. > I'm still coming to grips to how the whole bus_dma_tag_create works. > The Netbsd bus_dma_map_alloc seems much more intuitive. > I've found if the module failed the first time, unloading it, then > reloading it would often make the allocation issues disappear and the > driver just work. > Though I've also found sometimes that even though the allocation issues > are reported, things still work, I'm guessing the alignment is pulled > into line by higher levels of bus_dma. > > * ifconfig down causes timeouts reseting the tx ring > I'm still chasing the cause of this. It seems non critical as the > driver still works with an ifconfig up > > * Watch dog timer uses an obsolete interface > I'm looking into the correct way to do watchdog timing I have patches for iwi(4) somewhere and should finally get to doing something with them ... > * A lock order reversal in wpi_intr > lock order reversal: > 1st 0x812d9e20 wpi0 (network driver) @ if_wpi.c:1554 > 2nd 0xff003cee32f0 radix node head (radix node head) @ > net/route.c:147 KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x3a > witness_checkorder() at witness_checkorder+0x4f9 > _mtx_lock_flags() at _mtx_lock_flags+0x75 > rtalloc1() at rtalloc1+0x7a > arplookup() at arplookup+0x5c > arpintr() at arpintr+0x255 > ether_demux() at ether_demux+0x2d3 > ether_input() at ether_input+0x1e9 > ieee80211_input() at ieee80211_input+0xd05 > wpi_intr() at wpi_intr+0x9d7 > ithread_loop() at ithread_loop+0xfe > fork_exit() at fork_exit+0xaa > fork_trampoline() at fork_trampoline+0xe > --- trap 0, rip = 0, rsp = 0xa0698d40, rbp = 0 --- This one looks like the same issue as if_iwi.c, 1.43: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/iwi/if_iwi.c#rev1.43 i.e.
Re: Updated Driver for 3945ABG Intel 3945ABG Wireless LAN controller
On Friday 05 January 2007 16:58, Florent Thoumie wrote: > Max Laier wrote: > > On Friday 05 January 2007 15:45, Benjamin Close wrote: > >> Hi All, > >> After getting a new laptop I discovered being tied to a wire > >> when your used to wireless is extremely annoying. > >> > >> Hence I've done a port of the NetBSD driver wpi (20070106 rev) for > >> the Intel3945ABG wireless card to FreeBSD > >> Many thanks to Damien for writing the NetBSD driver in the first > >> place and the initial FreeBSD port which I referenced extensively. > >> > >> The driver is available at: > >> > >> > >> http://www.clearchain.com/~benjsc/download/20070106-wpi-freebsd.tar. > >>gz > >> > >> (dynamic dns host, so just retry later if it's down): > > > > Mirror'ed at: http://people.freebsd.org/~mlaier/wpi_port/ > > > >> Please let me know if you have any issues and I'll try to address > >> them. I'm not sure how well it will work on -stable, I'm running > >> > >> FreeBSD wolf.clearchain.com 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Wed > >> Dec 13 16:09:21 CST 2006 > >> [EMAIL PROTECTED]:/usr/src/sys/amd64/compile/GENERIC amd64 > >> > >> and don't have a -stable machine for testing. > >> Those not using -current, be sure to remove > >> > >> #define WPI_CURRENT > >> > >> in if_wpi.c before compiling. > >> > >> This email was sent through the driver :) > > While I'm really happy to see people working on this, isn't this a > duplicated effort? This is at least the third attempt to get a wpi(4) > driver on FreeBSD (and I'm sure two of them are based on Damien's > driver). I might be missing something though. Hence the extensive CC-list ... I'm trying to get all people involved to talk to each other and coordinate. From what I hear the other drivers showed some problems regarding resource allocation - maybe this one does better ... I'm more than willing to shepherd one of these drivers into the tree, but I'd need people with the actual hardware to say: "Yes it works" (for a large enough fraction of cases) and possibly somebody to serve as a maintainer willing to deal with PRs and stuff in the future. Given that part one of this is fullfilled by either of the available drivers - let's get something in and work from there. Thoughts? Volunteers? -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgppQgFMSDRRG.pgp Description: PGP signature
Re: Updated Driver for 3945ABG Intel 3945ABG Wireless LAN controller
On Friday 05 January 2007 15:45, Benjamin Close wrote: > Hi All, > After getting a new laptop I discovered being tied to a wire when > your used to wireless is extremely annoying. > > Hence I've done a port of the NetBSD driver wpi (20070106 rev) for the > Intel3945ABG wireless card to FreeBSD > Many thanks to Damien for writing the NetBSD driver in the first place > and the initial FreeBSD port which I referenced extensively. > > The driver is available at: > > http://www.clearchain.com/~benjsc/download/20070106-wpi-freebsd.tar.gz > > (dynamic dns host, so just retry later if it's down): Mirror'ed at: http://people.freebsd.org/~mlaier/wpi_port/ > > Please let me know if you have any issues and I'll try to address them. > I'm not sure how well it will work on -stable, I'm running > > FreeBSD wolf.clearchain.com 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Wed Dec > 13 16:09:21 CST 2006 > [EMAIL PROTECTED]:/usr/src/sys/amd64/compile/GENERIC amd64 > > and don't have a -stable machine for testing. > Those not using -current, be sure to remove > > #define WPI_CURRENT > > in if_wpi.c before compiling. > > This email was sent through the driver :) -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpJwRS6CI5lR.pgp Description: PGP signature
Re: freebsd programming
On Friday 15 December 2006 20:33, Jai wrote: > I am a student in Computer Science. I m moved * to FreeBSD from two > year ago and enjoyed the power of BSD. But now I want to program it so > that I customize it to get best results. I want to program it. I know > shell programming, c programming. Is this knowledge is sufficient to > program to FreeBSD or I need to learn more. Please guide me how can I > make my desires true. Also tell me the steps by step development > procedure of FreeBSD. You will find a lot of interesting documentaion about FreeBSD programming on the FreeBSD website when you click on the "Developers" link [1] in the menu on top. "The Design and Implementation of the FreeBSD Operating System" [2] is also a recommended read if you want to get serious about kernel hacking. Other than that, there is always learning by doing. There is a list of projects [3] that might be helpful to the community. You can look there and see if you feel up to pick up something. [1] http://www.freebsd.org/projects/index.html [2] ISBN 0201702452 (eng. - many translations available) [3] http://www.freebsd.org/projects/ideas/ -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpCm027XfcBO.pgp Description: PGP signature
Re: Forcing C program to core dump
On Wednesday 06 December 2006 20:02, Garrett Cooper wrote: > Hello, > This may be obvious to some, but after some Googling (apparently > with the wrong search terms, perhaps) and reading the gcc/gdb manpages, > I can't seem to find out how to get a program to produce core dumps. > So I was wondering, is there some simple means to produce core > dumps or a set of conditions that I need to adhere to in order to get > the OS to core dump the progrdam??? See gcore(1) and abort(3). sysctl -a | grep core might turn up some interesting sysctls. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgp7Tja5B2ZqY.pgp Description: PGP signature
Re: ipv6 connection hash function wanted ...
On Wednesday 15 November 2006 12:26, Oliver Fromme wrote: > Max Laier wrote: > > David Malone wrote: > > > Assuming you don't want to use one of the standard cryptographic > > > ones (which I can imagine being a bit slow for something done > > > per-packet), then one option might be to use a simpler hash that > > > is keyed. Choose the key at boot/module load time and make it hard > > > to produce collisions unless you know the key. > > > > That's exactly what I am looking for ... now I need someone[tm] - > > with better Math-Knowledge than mine - to write such a thing down in > > a simple formula :-) i.e. take those bits from there and there and > > XOR them with your canary yada-yada-yada ... > > In that case, simply use crc32 (available from libkern.h) > and xor with a random key generated at boot time. crc32 > is fast to calculate and has the properties that you need. Oops, I missed one requirement: /* * IMPORTANT: the hash function for dynamic rules must be commutative * in source and destination (ip,port), because rules are bidirectional * and we want to find both in the same bucket. */ AFAICT, the attached has this property, but I have no idea if it adds sufficient entropy to the result - it looks like it, though. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News Index: ip_fw2.c === RCS file: /usr/store/mlaier/fcvs/src/sys/netinet/ip_fw2.c,v retrieving revision 1.153 diff -u -r1.153 ip_fw2.c --- ip_fw2.c 6 Nov 2006 13:42:04 - 1.153 +++ ip_fw2.c 15 Nov 2006 12:36:34 - @@ -230,6 +230,7 @@ static ipfw_dyn_rule **ipfw_dyn_v = NULL; static u_int32_t dyn_buckets = 256; /* must be power of 2 */ static u_int32_t curr_dyn_buckets = 256; /* must be power of 2 */ +static u_int32_t hash_nonce = 0; static struct mtx ipfw_dyn_mtx; /* mutex guarding dynamic rules */ #define IPFW_DYN_LOCK_INIT() \ @@ -642,12 +643,19 @@ hash_packet6(struct ipfw_flow_id *id) { u_int32_t i; - i = (id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ + + i = (id->dst_ip6.__u6_addr.__u6_addr32[0]) ^ + (id->dst_ip6.__u6_addr.__u6_addr32[1]) ^ + (id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ + (id->src_ip6.__u6_addr.__u6_addr32[0]) ^ + (id->src_ip6.__u6_addr.__u6_addr32[1]) ^ (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ (id->src_ip6.__u6_addr.__u6_addr32[3]) ^ (id->dst_port) ^ (id->src_port); - return i; + i = crc32_raw(&i, sizeof(i), hash_nonce); + + return (i); } static int @@ -4360,6 +4368,7 @@ uma_zdestroy(ipfw_dyn_rule_zone); return (error); } + hash_nonce = arc4random(); ip_fw_ctl_ptr = ipfw_ctl; ip_fw_chk_ptr = ipfw_chk; callout_reset(&ipfw_timeout, hz, ipfw_tick, NULL); pgpkc5EmS5WoQ.pgp Description: PGP signature
Re: ipv6 connection hash function wanted ...
On Tuesday 14 November 2006 20:09, David Malone wrote: > On Tue, Nov 14, 2006 at 05:09:20PM +0100, Max Laier wrote: > > Any ideas? Any papers that deal with this problem? > > Assuming you don't want to use one of the standard cryptographic > ones (which I can imagine being a bit slow for something done > per-packet), then one option might be to use a simpler hash that > is keyed. Choose the key at boot/module load time and make it hard > to produce collisions unless you know the key. That's exactly what I am looking for ... now I need someone[tm] - with better Math-Knowledge than mine - to write such a thing down in a simple formula :-) i.e. take those bits from there and there and XOR them with your canary yada-yada-yada ... -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpMrd7KwVOAM.pgp Description: PGP signature
ipv6 connection hash function wanted ...
Hello, this one is something for people who know their math. Input: 2x128bit of address (lower ~80bit selectable by user) and 2x16bit of ports (more or less selectable by user). Note that the "flow_id" is not useable as several broken stack implementations do not set it consistently - and it is user settable as well. Output: "int" hash value - by default we use the lower 8bit of it. Problems: Most of the input can be selected by a user meaning it is easy to produce collisions. For legal connections, the lower 64bit are the one with the highest entropy - in fact the upper 64bit might be the same for many connections coming from/going to the same subnet. This function will be used for every packet that is passed to a dynamic IPFW rule, so efficiency is a concern. Any ideas? Any papers that deal with this problem? ref: sys/netinet/ip_fw2.c::hash_packet6 -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpspYaBpu9CL.pgp Description: PGP signature
Re: New wpi driver
On Friday 10 November 2006 10:37, Massimo Lusetti wrote: > On Thu, 2006-11-09 at 22:39 +0100, Gábor Kövesdán wrote: > > Unfortunately, it seems that this is still that unfinished driver from > > Damien, that circulates on the net everywhere, but it only works for > > some lucky people. As for me, I get an error message when loading the > > module, that it could not allocate resources. > > I don't think it's "that unfinished driver from Damien" classify it > correctly, as stated it's an unsupported version so case where it will > not work are expected. Feel free to improve it or wait when some FreeBSD > developer will port and maintain it. I agree. On top of that, a more detailed error report would be preferable. From what you put above, it seems that you are out of sufficient continous memory at the point where you enable the hardware. Try enabling it before bringing up X11 etc. > Thanks Florent for mirroring. -- Max ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Where was that iSCSI initiator?
On Thursday 19 October 2006 00:35, Ceri Davies wrote: > Could anyone please let me know the status of the iSCSI initiator that > was floated here some time ago? Is it in a commitable state and, if > not, can I help with testing (we have some Netware targets)? ftp://ftp.cs.huji.ac.il/users/danny/freebsd/iscsi-17.5.tar.bz2 is that the one you were thinking about? -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpT8uX68pty8.pgp Description: PGP signature
Re: Call for Status Reports: Oct 6^H11 (extended)
On Wednesday 27 September 2006 14:23, Max Laier wrote: > Submissions are due by 6 October, 2006. Submission details can be > found on http://www.freebsd.org/news/status/ > > As always, this is by no means limited to FreeBSD committers, but a > call to report news and status about any FreeBSD related project. Due to a fairly low turnout so far, we are extending the deadline to ***Wednesday, October 11***. Please tell us what exciting project you are so busy with that you didn't see the initial call ;) > Looking forward to reading your reports. http://www.freebsd.org/cgi/monthly.cgi http://www.freebsd.org/news/status/report-sample.xml Thanks. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgp6Qh7O4jqFV.pgp Description: PGP signature
Spam protection foo [Re: installkernel target.]
On Wednesday 04 October 2006 17:58, Nikolay Pavlov's MX wrote: > HEY YOU! PLEASE READ THIS IF YOU ARE NOT A ROBOT =) > IT'S JUST A SPAM PROTECTION. > > This message was created automatically by mail delivery software. >... Please don't use such stupid obfuscation. It doesn't help and just increases the frustration of everybody. Thanks. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpPkV5zJn4Ss.pgp Description: PGP signature
Re: installkernel target.
On Wednesday 04 October 2006 17:58, Nikolay Pavlov wrote: > Is there any supported way to make installkernel directly to some > directory. I want to build two kernels (like /boot/kernel.SMP/ and > /boot/kernel.UP/) in my installation script and DESTDIR is quite > useless is this case. It seems that you can set KODIR to "/boot/kernel.foo" in order to install elsewhere. See sys/conf/kern.post.mk for details. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpjPkMUNwfw9.pgp Description: PGP signature
Call for Status Reports: Oct 6
All, it almost slipped my mind to remind you that it's that time again. We are collecting Status Reports for the third quarter of 2006. I know that most of you are wrapped in the preparation for FreeBSD 6.2. It would be great if you could still find some time to write about all the goodies that where MFCed and newly appeared in CURRENT between June and now. We would also like to hear from our Google Summer of Code participants how their projects turned out - you may copy and paste or redirect to your "official" documentation ;) Just let's make sure your work gets the attention it deserves! Submissions are due by 6 October, 2006. Submission details can be found on http://www.freebsd.org/news/status/ As always, this is by no means limited to FreeBSD committers, but a call to report news and status about any FreeBSD related project. Looking forward to reading your reports. See you at EuroBSDCon 2006 in Milan: http://www.eurobsdcon.org/ -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpWIodi9jzPK.pgp Description: PGP signature
Re: PRO/wireless scanning
On Wednesday 06 September 2006 13:32, Johnny Choque wrote: > I'm testing the scanning features of Intel PRO/Wireless 2200BG build-in > Toshiba Tecra M3 using FreeBSD 6.1 and iwi-firmware-2.4_7 (I think that > it is the last version, isn't it?). I have noticed a unstable behavior > of the wireless interface when I try to scan the access point around it > (ifconfig iwi0 scan). Sometimes it provide the report of the detected > access points but sometimes it keep waiting a long time without provide > any report. Do you have the same behavior with iwi driver and > iwi-firmware?, do you know how I can find a solution for that? > > I have also noticed that the web pages for Intel PRO/Wireless 2200BG > for FreeBSD (http://damien.bergamini.free.fr/ipw/iwi-freebsd.html) have > a watermark that say "discontinued", does mean that there are another > web or project that will continue to improve the iwi driver and > iwi-firmware? Do you know any information about that? Please use iwi(4) from RELENG_6 (soon to be 6.2), which has many improvements and bug fixes over the version that was shipped with 6.1. Note that it uses the firmware(9) subsystem to load the firmware image, so you will have to change to net/iwi-firmware-kmod from ports - as described in UPDATING. The latest firmware version - IIRC is 3.0. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgp9lKDZ0vgkt.pgp Description: PGP signature
Re: style(9)-like guide for man pages
On Monday 21 August 2006 18:26, Kostik Belousov wrote: > is there style(9)-like guide for writing FreeBSD man pages ? "man mdoc" aka GROFF_MDOC(7) is the closest one I can think of. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgppxBTLRCf2t.pgp Description: PGP signature
Re: Packet filtering on tap interfaces
On Saturday 12 August 2006 18:36, mal content wrote: > Hello, this is a simplified re-phrasing of a question posted to > [EMAIL PROTECTED] It didn't get any answers over there because I > think people took one look at it and switched off. A cut down > version follows... > > How does one do packet filtering on tap interfaces? I'm using > qemu and I'm going to be loading some untrusted OS images > so I'd like complete filtering of packets to and from the qemu > process. > > I was given a partial solution by somebody before, but I couldn't > get it to work. > > I'm currently: > > 1. Using bridge.sh[1] to bridge between tap0 and my real fxp0 > interface. > > 2. Trying to log or filter packets on tap0. > > My current pf.conf looks like this: > > nic0 = "fxp0" > host_ip = "192.168.2.5" > pass in log all > pass out log all > > Which should surely filter everything. However, I can use the > network on the guest OS (going through tap0) without ever > triggering the pf logging. Why is this happening? Even when > explicity specifying: > > pass in log all on tap0 > pass out log all on tap0 > > I still don't see any logs. > > Can tap interfaces reliably be filtered? This is because the packets never make it to the IP-Layer (where our packet filters normally hook into). You can try to use if_bridge(4) to bridge tap0 and fxp0. if_bridge(4) offers extensive means of packet filtering described in the man page in great detail. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgp4cxWeloppn.pgp Description: PGP signature
FreeBSD Status Report Second Quarter 2006
. spdif switching, virtual-3D effects) by an user (instead of the sysctl approach in -current); pcmplay(1), pcmrec(1), pcmutil(1). 3. Plugable FEEDER infrastructure. For ease of debugging various feeder stuff and/or as userland library and test suite. 4. Support for new hardware (envy24, Intel HDA). _ SSE2 Kernel support URL: http://www.freebsd.org/projects/ideas/#p-memcpy URL: http://unix.derkeiler.com/Mailing-Lists/FreeBSD/arch/2006-05/msg00109. html Contact: Attilio Rao <[EMAIL PROTECTED]> Some FPU system and kernel memcpy/copyin/copyout changes have been performed. In particular, a per-CPU save area has been introduced (protected with an interlock) in order to assure a stable saving mechanism. copyout/copyin have changed in order to use vectorised version of memcpy and an xmm version of memcpy has been provided. Open tasks: 1. Benchmarks on different versions of xmm copy, in particular showing differences between UP and SMP architectures (evaluating possibility to add block prefetch, non-temporal hints usage, etc.) 2. Modifying npxdna trap handler in order to recognise xmm environment usage and replace fxsave with 8-movdqa _ TrustedBSD Audit URL: http://www.TrustedBSD.org/audit.html Contact: Robert Watson <[EMAIL PROTECTED]> Contact: Wayne Salamon <[EMAIL PROTECTED]> Contact: Christian Peron <[EMAIL PROTECTED]> TrustedBSD Audit provides fine-grained security event auditing in FreeBSD 7.x, with a planned merge to 6.x for FreeBSD 6.2. Work performed in the last three months: * Per audit pipe preselection allows IDS applications to configure audit record selection per-pipe, new auditpipe.4 document. * audit_submit library call to reduce complexity of adding audit support to applications. * Significant cleanup, bug fixing, locking improvements, token parsing and generation improvements. * Solaris subject token compatibility, extended address support. * Auditing of extended attributes calls, ACL support a work in progress. * OpenBSM 1.0 alpha 7 integrated into CVS. * OpenBSM test tools in progress. * Experimental auditeventd which allows shared object plug-ins to subscribe to live audit events via a shared pipe in order to support the easy authoring of simple intrusion detection and monitoring components. Open tasks: 1. Bring audit event daemon API and implementation to maturity. Currently these are not installed by default in the CVS-merged version. 2. Complete system call coverage. 3. Allow finer-grained configuration of what is audited: implement control flags regarding paths, execve arguments, environmental variables. 4. Support for auditing MAC policy data. 5. Additional user space application coverage, such as application layer audit events from adduser, rmuser, pw, etc. _ Update of the Linux userland infrastructure in the Ports Collection Contact: Boris Samorodov <[EMAIL PROTECTED]> Contact: Alexander Leidinger <[EMAIL PROTECTED]> Contact: Emulation Mailinglist <[EMAIL PROTECTED]> We updated the default linux base port to Fedora Core 4 and the default linux X11 libs port to the X.org RPM in FC4. An update to FC5 or FC6 has to wait until the kernel got support for syscalls of a newer linux kernel. See the corresponding SoC project report for more. _ Wireless Networking Contact: Sam Leffler <[EMAIL PROTECTED]> The wireless suport has been stable for a while so most work has focused on bug fixing and improving legacy drivers. Max Laier and I worked on improving support for Intel wireless cards. The results of this work included significant improvements to the iwi(4) driver (for 2195/2200 parts) and the firmware(9) facility for managing loadable device firmware. There is also an updated ipw(4) that has improvements similar to those done for iwi that is in early test. Support for the latest Intel devices, the 3945 pci-express cards, is planned for later this summer. Atheros support was updated with a new hal that fixes a few minor issues and provides known working builds for SPARC, PPC, and ARM platforms. There is also working MIPS support that will be used when the MIPS port is ready to test. Otherwise one useful bug was fixed that affected AP operation with associated stations operating in power save mode. wpa_supplicant and hostapd were updated to the latest stable build releases from Jouni Malinen. Experimental changes to support injecti
Re: Call for Status Reports: 07/07
On Sunday 25 June 2006 21:39, I wrote: > All, > > it's time for the Status Reports for the second quater of 2006. During the > last three month a lot of progress has been made. FreeBSD 6.1 and 5.5 are > released, a new round of Google's Summer of Code has been started, and a > very productive Developer Summit took place during BSDCan. On top of that, > we are now running on Sun's new architecture and a lot of progress has been > made for the arm platform, making FreeBSD more viable in the embedded > market. > > We hope that all your projects made good progress as well and would like to > hear about it. Please share your news and progress over the last three > month with us. Submission are due by 7 July, 2006. > > Once again, submissions are not limited to FreeBSD developers. We will > happily include non-code projects of any kind as long as it is FreeBSD > related. > > For previous reports and submission details, please see: > http://www.freebsd.org/news/status/ Last call, if you have something to submit but didn't yet, let me know *now* about it and send in the report ASAP!! We have a really good turnout already, so we won't be waiting much longer. Thanks. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpxfb3KRcJoH.pgp Description: PGP signature
Re: Alternative compiler toolchain ?
On Saturday 01 July 2006 20:01, Attilio Rao wrote: > 2006/7/1, Divacky Roman <[EMAIL PROTECTED]>: > > afaik tendra doesnt support gnu C extensions and our srcs are full of it > > so the only possible compilers ATM are gcc and icc > > That's not completely true. > A lot of GCC stubs are masked through macros, so, with a little work > on it, you can successful optimize the code, if your compiler has the > same (or partial) supports. afaik __asm is the most interesting feature that is missing from ten15's tendra which keeps us from using it for kernel compiling. As I understand this is mostly due to tendra's way of constructing objects: It translates to a machine independent intermediate language where it does all the optimisations and only thereafter "installs" - in tendra speak - to the target architecture. This is quite nice for cross builds as you can do the expensive first pass on fast hardware and do the "installation" on the target. It has the downside for __asm and the like. I might be all wrong, though. -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpu6XZfWxNy5.pgp Description: PGP signature
Re: Call for Status Reports: 07/07
Seems I haven't been clear enough about how to submit reports. Please use the XML template or XML creator provided at: http://www.freebsd.org/cgi/monthly.cgi http://www.freebsd.org/news/status/report-sample.xml Thanks. On Sunday 25 June 2006 21:39, I wrote: > All, > > it's time for the Status Reports for the second quater of 2006. During the > last three month a lot of progress has been made. FreeBSD 6.1 and 5.5 are > released, a new round of Google's Summer of Code has been started, and a > very productive Developer Summit took place during BSDCan. On top of that, > we are now running on Sun's new architecture and a lot of progress has been > made for the arm platform, making FreeBSD more viable in the embedded > market. > > We hope that all your projects made good progress as well and would like to > hear about it. Please share your news and progress over the last three > month with us. Submission are due by 7 July, 2006. > > Once again, submissions are not limited to FreeBSD developers. We will > happily include non-code projects of any kind as long as it is FreeBSD > related. > > For previous reports and submission details, please see: > http://www.freebsd.org/news/status/ -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpzrFj3qtUWv.pgp Description: PGP signature
Call for Status Reports: 07/07
All, it's time for the Status Reports for the second quater of 2006. During the last three month a lot of progress has been made. FreeBSD 6.1 and 5.5 are released, a new round of Google's Summer of Code has been started, and a very productive Developer Summit took place during BSDCan. On top of that, we are now running on Sun's new architecture and a lot of progress has been made for the arm platform, making FreeBSD more viable in the embedded market. We hope that all your projects made good progress as well and would like to hear about it. Please share your news and progress over the last three month with us. Submission are due by 7 July, 2006. Once again, submissions are not limited to FreeBSD developers. We will happily include non-code projects of any kind as long as it is FreeBSD related. For previous reports and submission details, please see: http://www.freebsd.org/news/status/ -- /"\ Best regards, | [EMAIL PROTECTED] \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | [EMAIL PROTECTED] / \ ASCII Ribbon Campaign | Against HTML Mail and News pgpMXe8O6Olt7.pgp Description: PGP signature