Re: Semi-reproduceable em0 network hangs in new snap
On 2014-09-06 23:13:51, Bryan Linton b...@shoshoni.info wrote: Hello list, [dmesg and ifconfig output attached inline at bottom] I upgraded from a mid-July snapshot to a recent one, and I've been experiencing a strange problem with the network losing connectivity that I haven't been able to pin down. What happens is the machine (a Thinkpad T60) will lose all network connectivity, even to the point where pinging local machines or the default gateway will produce no response. A simple ifconfig em0 down up will restore connectivity. There are no errors in the dmesg, and ifconfig em0 shows the interface as up and running when connectivity is lost. Fetching email with ports/mail/fdm (I haven't tried any other MDAs) will usually cause the hang to occur. Strangely, regular web browsing doesn't seem to be very likely to cause this. Does anyone have any idea of things I can do to try to isolate this? I've looked through the CVS logs since mid-July and nothing jumped out at me as being particularly likely to cause this. Thank you. -- Bryan OpenBSD 5.6-current (GENERIC.MP) #330: Thu Sep 4 02:53:34 MDT 2014 t...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP cpu0: Genuine Intel(R) CPU T2300 @ 1.66GHz (GenuineIntel 686-class) 1.67 GHz cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,SSE3,MWAIT,VMX,EST,TM2,xTPR,PDCM,PERF real mem = 2682613760 (2558MB) avail mem = 2626367488 (2504MB) mpath0 at root scsibus0 at mpath0: 256 targets mainbus0 at root bios0 at mainbus0: AT/286+ BIOS, date 04/01/10, BIOS32 rev. 0 @ 0xfd6b0, SMBIOS rev. 2.4 @ 0xe0010 (68 entries) bios0: vendor LENOVO version 79ETE6WW (2.26 ) date 04/01/2010 bios0: LENOVO 2623D9U acpi0 at bios0: rev 2 acpi0: sleep states S0 S3 S4 S5 acpi0: tables DSDT FACP SSDT ECDT TCPA APIC MCFG HPET BOOT SSDT SSDT SSDT SSDT acpi0: wakeup devices LID_(S3) SLPB(S3) LURT(S3) DURT(S3) EXP0(S4) EXP1(S4) EXP2(S4) EXP3(S4) PCI1(S4) USB0(S3) USB1(S3) USB2(S3) USB7(S3) HDEF(S4) acpitimer0 at acpi0: 3579545 Hz, 24 bits acpiec0 at acpi0 acpimadt0 at acpi0 addr 0xfee0: PC-AT compat cpu0 at mainbus0: apid 0 (boot processor) mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges cpu0: apic clock running at 166MHz cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2, IBE cpu1 at mainbus0: apid 1 (application processor) cpu1: Genuine Intel(R) CPU T2300 @ 1.66GHz (GenuineIntel 686-class) 1.67 GHz cpu1: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,SSE3,MWAIT,VMX,EST,TM2,xTPR,PDCM,PERF ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 24 pins ioapic0: misconfigured as apic 2, remapped to apid 1 acpimcfg0 at acpi0 addr 0xf000, bus 0-63 acpihpet0 at acpi0: 14318179 Hz acpiprt0 at acpi0: bus 0 (PCI0) acpiprt1 at acpi0: bus 1 (AGP_) acpiprt2 at acpi0: bus 2 (EXP0) acpiprt3 at acpi0: bus 3 (EXP1) acpiprt4 at acpi0: bus 4 (EXP2) acpiprt5 at acpi0: bus 12 (EXP3) acpiprt6 at acpi0: bus 21 (PCI1) acpicpu0 at acpi0: C3, C2, C1, PSS acpicpu1 at acpi0: C3, C2, C1, PSS acpipwrres0 at acpi0: PUBS, resource for USB0, USB2, USB7 acpitz0 at acpi0: critical temperature is 127 degC acpitz1 at acpi0: critical temperature is 99 degC acpibtn0 at acpi0: LID_ acpibtn1 at acpi0: SLPB acpibat0 at acpi0: BAT0 model 92P1139 serial 659 type LION oem Panasonic acpibat1 at acpi0: BAT1 not present acpiac0 at acpi0: AC unit online acpithinkpad0 at acpi0 acpidock0 at acpi0: GDCK docked (15) bios0: ROM list: 0xc/0xfe00 0xd/0x1000 0xd1000/0x1000 0xdc000/0x4000! 0xe/0x1! cpu0: Enhanced SpeedStep 1663 MHz: speeds: 1667, 1333, 1000 MHz pci0 at mainbus0 bus 0: configuration mode 1 (bios) pchb0 at pci0 dev 0 function 0 Intel 82945GM Host rev 0x03 ppb0 at pci0 dev 1 function 0 Intel 82945GM PCIE rev 0x03: apic 1 int 16 pci1 at ppb0 bus 1 radeondrm0 at pci1 dev 0 function 0 ATI Radeon Mobility X1300 M52-64 rev 0x00 drm0 at radeondrm0 radeondrm0: apic 1 int 16 azalia0 at pci0 dev 27 function 0 Intel 82801GB HD Audio rev 0x02: msi azalia0: codecs: Analog Devices AD1981HD, Conexant/0x2bfa, using Analog Devices AD1981HD audio0 at azalia0 ppb1 at pci0 dev 28 function 0 Intel 82801GB PCIE rev 0x02: apic 1 int 20 pci2 at ppb1 bus 2 em0 at pci2 dev 0 function 0 Intel 82573L rev 0x00: msi, address 00:16:41:52:7e:81 ppb2 at pci0 dev 28 function 1 Intel 82801GB PCIE rev 0x02: apic 1 int 21 pci3 at ppb2 bus 3 wpi0 at pci3 dev 0 function 0 Intel PRO/Wireless 3945ABG rev 0x02: msi, MoW1, address 00:13:02:20:41:18 ppb3 at pci0 dev 28 function 2 Intel 82801GB PCIE rev 0x02: apic 1 int 22 pci4 at ppb3 bus 4 ppb4 at pci0 dev 28 function 3 Intel 82801GB PCIE rev 0x02: apic 1 int 23 pci5 at ppb4 bus 12 uhci0 at pci0 dev 29 function 0 Intel 82801GB USB rev 0x02: apic 1 int 16 uhci1 at pci0 dev 29 function 1 Intel 82801GB USB rev 0x02:
Re: Real time programming in OpenBSD
On 9 September 2014 22:30, Matti Karnaattu mkarnaa...@gmail.com wrote: Hello, Is it possible to dedicate CPU core to process? What I'm looking for is simple way to take advantage of high quality and secure code base of OpenBSD to use in real time/embedded applications. If this trick can be achived, it is simple to use OpenBSD as platform when critical parts of software can run on own CPU core and rest of the software can developed conventional means. If this can be done, or this kind of feature may be noted and put to roadmap, I may have motivations to audit time requirements of library functions etc. and formally verify parts of the system. You can use this diff if you want, it adds support for nice(1) to do the binding, I use it to do MP tests. https://github.com/haesbaert/bitrig/commit/c0d5adb6ee5f3b77e17254c6eaf0e02333b30d8b
Re: Real time programming in OpenBSD
hobby and safety critical don't often go together. if you just want to improve your skills i say go for it but aiming for safety critical is a high bar to achieve. I like to keep bar high. But if you're really looking to do safety critical, which industry are you going to target? Medical and automotive. Medical mostly but automotive industry software needs are growing rapidly. Standards you mention are familiar to me. OpenBSD is kind of very useful research project so it is best to deploy QA practices that applies many industries. Goal to me is to make platform/components ready so that they could be used as a basis. Of course if anyone want's to use OpenBSD code in safety critical applications, it needs to be certified and still need work but.. I think it would be awesome if I can raise bar of open source components to that level. Patches addressing bugs found through static analysis are always welcome. Is there any centralized static analysis in OpenBSD QA process? Right way is to put effort there. These are listed on the interwebs: http://www.openbsd.org/goals.html I also find these: http://www.openbsd.org/faq/faq1.html#HowAbout http://www.openbsd.org/policy.html Honestly, goals.html describe current state of project. It doesn't describe long term goals/roadmap what developers are interested to do. I understand that every one has personal aims but I'm looking something like list of: we must get rid of or rewrite this peace of crap in next/following cycle. FAQ says also something about installation boot media and it is not clear to me what are OpenBSB project specifications. I'm looking all defined requirements for OpenBSD code and features. I assume that contributions are accepted, not only some bug patches but it make things easier (for new developers and users) if the mindset is defined. It should also define priority what is more important. Examples: -Is license purity more important than following standards? -What are standards to follow (even partially) and what are not? -Preferred targets. Embedded hardware and security applications, but what else? -Hey, I like to create GUI application, what is the preferred API? I think that programming should be mandatory in elementary school because it force to describe what you wan't without ambiguity. For this reason, I know this is easy task developers to do. However, I can't do that task because I don't know the OpenBSD developers mindset and I don't know yet is this the right community. I'm interested to put effort in controlled manner and help to remove ambiquity. I'm still probing this community.
Re: Real time programming in OpenBSD
You can use this diff if you want, it adds support for nice(1) to do the binding, I use it to do MP tests. Thanks! This helps a lot.
Re: Real time programming in OpenBSD
On Wed, Sep 10, 2014 at 7:09 AM, Matti Karnaattu mkarnaa...@gmail.com wrote: You can use this diff if you want, it adds support for nice(1) to do the binding, I use it to do MP tests. Thanks! This helps a lot. Note that that diff does the converse of what you requested, pegging a thread to a CPU instead of banning the CPU from running other processes' threads. On your bigger question: I don't know of any one working on making OpenBSD a realtime OS in the sense of providing latency guarantees. This would require massive changes to all levels of the kernel, from interrupt handling/routing/blocking to the buffer cache and UVM subsystems to filesystems. Philip Guenther
New Queue system
Where can find the docs for the new queue system in OpenBSD ? I remeber the ALTQ in the OpenBSD pf faq. Best Regards. -- Francisco Valladolid H. -- http://blog.bsdguy.net - Jesus Christ follower.
Re: Real time programming in OpenBSD
Hi Matti, i don't know about safety critical and have no idea whether what you are saying / trying to do there makes any sense, so i'm snipping that. Replying to your other questions... Matti Karnaattu wrote on Wed, Sep 10, 2014 at 04:29:14PM +0300: Is there any centralized static analysis in OpenBSD QA process? No. Our only process is code review, and knowing (without writing it down) who is responsible for what. If you really need to know whom to talk to for something *specific* (like, a patch), it's usually easy to find out without a list if you know the culture. If not, ask here. Static analysis tools are just tools, and variety is an asset. Besides, some of them aren't free, so they cannot be centralized. Honestly, goals.html describe current state of project. It doesn't describe long term goals/roadmap what developers are interested to do. I understand that every one has personal aims but I'm looking something like list of: we must get rid of or rewrite this peace of crap in next/following cycle. That doesn't exist, intentionally. It just doesn't work if you try to do it that way. You will mostly fail, and even if you succeed now and then, it will feel like a chore in retrospect. The best stuff gets done when people do, creatively, what they enjoy and feel is important right now, whenever they find the time. Remember, almost all of us work on OpenBSD in our free time. Well, there are exceptions. Like, in a security emergency, everybody knows what will get done within 24 hours, even though it may not be clear yet who does it. I certainly do know a few things i will do within one year from now, but i'm *not* going to commit to it. And Theo *will* sometimes be fiercely determined that something must get done the sooner the better, even if he ain't gonna do it personally, and he may even say so. But that's the exception rather than the rule, and even then, it does unfortunately happen now and then that nobody acts on it. I'm looking all defined requirements for OpenBSD code and features. No way you are going to get that, even though unwritten standards are rather high. The most important aspect is common sense, and experience. You will learn from feedback you get when sending patches, so start with small ones to avoid wasted effort. Well there is style(9), but that is *not* the essential part but merely scratching the surface, maybe not even that. There is a quote about it in usr.bin/mg/theo.c IIRC. Actually, there are two, both very drastic. All the same, stuff not conforming to KNF will not get committed, because a consistent coding style *is* one minor aspect of code quality. Yes, that will unavoidably seem confusing to you at this point, but it's likely to become clear with time. Point is, it is completely impossible to write down what is needed to write high quality code in a high quality style as a set of rules that you just need to follow. It is no doubt possible to write down part of that, but whatever parts you write down, it will always be both horribly incomplete and much too restricting at the same time. Like, using goto in C code is a bad idea. Except that it is often the best idiom for prematurely erroring out of a moderately complex function. And yet, i have used it for other purposes, rarely, but multiple times, even in OpenBSD base. Like, mktemp(3) is almost obsolete, you should really use mkstemp(3). Yet, it *can* be used correctly, and sometimes, there is no other correct way, i once had to use it in OpenBSD base, and sure as hell, people did ask me to replace it, but i explained and it was confirmed to be the right thing to do in that exceptional case. You won't ever get away with using strcat(3), and you definitely won't get away without being yelled at for even trying to use gets(3), but such unambiguous, unconditional truths are the rare exception. Ultimately, the requirement is that code be correct, in particular using interfaces correctly and safely, as simple and as readable as possible, and using safe, common idioms wherever possible. Only human review, using common sense, experience, and good judgement, can check that. I assume that contributions are accepted, not only some bug patches but it make things easier (for new developers and users) if the mindset is defined. It should also define priority what is more important. Work on what is important for *you*, and where *your* competence lies. We are not going to tell you what to spend your time on. -Is license purity more important than following standards? An acceptable, fully free license is an absolute requirement, and /usr/share/misc/license.template is strongly preferred. Coming as close as possible to standards is one goal, but sometimes has to be balanced against other goals, like sanity and safety of interfaces. In that sense, the statement license purity is more important than following standards can be construed as true, but it is misleading. Code needlessly
Re: Real time programming in OpenBSD
Note that that diff does the converse of what you requested, pegging a thread to a CPU instead of banning the CPU from running other processes' threads. True, but this is good starting point. On your bigger question: I don't know of any one working on making OpenBSD a realtime OS in the sense of providing latency guarantees. This would require massive changes to all levels of the kernel, from interrupt handling/routing/blocking to the buffer cache and UVM subsystems to filesystems. Real time is a plus, but I understand that this may be massive task to accomplish and when looking for safety perspective, isolation and correctness are more important. Real time requirements come when correct working has requirements to latency. If isolation can be done and process running isolated on own core, it is good point to start to study how to make it work on real time. It is also ok that real time works partially and fails on certain I/O. As some functions are thread safe, it is work to making some functions latency safe or verified correct. Now there is OpenBSD core witch is very clean and secure, and ports where rest of packages are dumped. This kind of work requires more granularity as QA perspective.
Re: New Queue system
Thank you. There are a docs or FAQ ? On Wed, Sep 10, 2014 at 12:13 PM, Christopher Zimmermann chr...@openbsd.org wrote: On Wed, 10 Sep 2014 12:01:17 -0500 Francisco Valladolid H. fic...@gmail.com wrote: Where can find the docs for the new queue system in OpenBSD ? pf.conf(5) search for QUEUEING -- http://gmerlin.de OpenPGP: http://gmerlin.de/christopher.pub F190 D013 8F01 AA53 E080 3F3C F17F B0A1 D44E 4FEE -- Francisco Valladolid H. -- http://blog.bsdguy.net - Jesus Christ follower.
Re: New Queue system
Hi, I believe he intended to reference http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man5/pf.conf.5?query=pf%2econfarch=i386 On 9/11/2014 午前 02:27, Francisco Valladolid H. wrote: Thank you. There are a docs or FAQ ? On Wed, Sep 10, 2014 at 12:13 PM, Christopher Zimmermann chr...@openbsd.org wrote: On Wed, 10 Sep 2014 12:01:17 -0500 Francisco Valladolid H. fic...@gmail.com wrote: Where can find the docs for the new queue system in OpenBSD ? pf.conf(5) search for QUEUEING -- http://gmerlin.de OpenPGP: http://gmerlin.de/christopher.pub F190 D013 8F01 AA53 E080 3F3C F17F B0A1 D44E 4FEE
Re: New Queue system
I'm reading now. Thank you. On Wed, Sep 10, 2014 at 12:40 PM, Christopher Zimmermann chr...@openbsd.org wrote: On Wed, 10 Sep 2014 12:27:00 -0500 Francisco Valladolid H. fic...@gmail.com wrote: Thank you. There are a docs or FAQ ? not that I know of. That's what I do: queue dsl on pppoe0 bandwidth 223K max 223K queue voip parent dsl qlimit 5 bandwidth 110K min 110K queue lowdelay parent dsl qlimit 5 bandwidth 50K min 40K queue std parent dsl qlimit 10bandwidth 50K default queue bulk parent dsl qlimit 50bandwidth 5K -- http://gmerlin.de OpenPGP: http://gmerlin.de/christopher.pub F190 D013 8F01 AA53 E080 3F3C F17F B0A1 D44E 4FEE -- Francisco Valladolid H. -- http://blog.bsdguy.net - Jesus Christ follower.
Re: Real time programming in OpenBSD
| | However, I can't do that task because I don't know the OpenBSD developers | mindset and I don't know yet is this the right community. I'm | interested to put effort in controlled manner and help to remove ambiquity. | | I'm still probing this community. | Hi Matti, Best way to see what this community is like is to subscribe to the mailing lists (and browse/search the archives http://marc.info/ or http://dir.gmane.org/index.php?prefix=gmane.os.openbsd ) and see what people are doing and talking about, or to send in small patches as others have suggested. Cheers, Brett.
Re: Real time programming in OpenBSD
Thanks for the comprehensive answer. I was already looking for coding conventions. That preferred style is actually fair, and it is important that everyone is in line and respect that. I also agree that goto is fair way to model exceptions in C language. Couple of questions before I start hacking: 1. Is there any preferred way to post diffs? 2. Is there any preferred framework to write tests? 3. If I wrote a bit more code and there is need to separate it, is there any ready guidelines/templates for software modules, folder structure etc? 4. What kind of test suites are used to ensure that changes don't break thigs or causes bugs? I mean others that are found in sources. 5. What is the licence policy in toolchain? I mean, it is clear to me that platform itself conforms much as possible http://www.openbsd.org/policy.html but how about development tools which are used only to produce ISC code? Is the policy relaxed to allow then more restricted open source code? Let's say, GPL code in some verification tool or testsuite? That question is unrelated to OpenBSD. The OpenBSD base system does not contain any GUI API. Well, Xenocara does contain the bare X11R6 API, but we certainly don't recommend using that for application programming. But i'm not aware of anybody developing a GUI application *as an OpenBSD subproject*. Right. And I don't expect that anybody do that because there is no API for that in base system. To fully understand mindset correctly related to standards, licenses and contributions I use GUI API as an example: As we know, UNIX 98 workstation defines Motif and CDE. Nowadays possible to use because these are open sourced. Well, enough standard to me but no one want's to write that legacy, and that is LGPL. Not as nice ISC. However, OpenBSD default FVWM look is like Motif. Practically GTK+ 2 replaced it as a C-language, standard GUI API. Everyone used that because it was open source. Enough standard to me as it is defined in LSB. That was too LGPL. Coming GTK+ 4 replaces it to next fifteen years but when it is ready, probably no one else uses that then except Red Hat. Nowadays, GUI programming is usually not done using C. It is correct to say that ECMAScript is standard language for portable applications, using browser technology and native applications are written usually platform dependent APIs. And what is nice, Webkit is mostly BSD code. But it is also C++, which is ugly while rest of the base is C code. Assume that rich man appears, $70 cash in briefcase and say: I love your work and I will donate this pile of money to OpenBSD foundation, if you provide GUI API that is most appropriate, secure and practical for OpenBSD base. If offer is accepted, what is the preferred way to do the task? --- In terms of licensing, I don't think LGPL is as pure as ISC, but I can accept that to commercial product if BSD-style license won't cut. It may be even preferred to application programmer. -Matti
Re: Real time programming in OpenBSD
Hi Matti, Matti Karnaattu wrote on Thu, Sep 11, 2014 at 02:14:25AM +0300: 1. Is there any preferred way to post diffs? * cvs diff -Nup * send inline in the mail body, not as MIME attachments * if you are already in contact with a particular group of developers who want to review diffs in that area, send directly to them (two to four people is ideal), otherwise and in case of doubt, send to tech@ * make sure every single diff makes the system better, that is, can be justified on its own, even if it actually is part of an ongoing project * make sure each patch does exactly one thing, and does that completely, avoid diffs doing five different things at the same time, and do not split one logical change into two diffs * keep diffs small, in particular at the beginning * make diffs easy to review * never ever send quilt patchsets or similar things 2. Is there any preferred framework to write tests? bsd.regress.mk(5), /usr/src/regress 3. If I wrote a bit more code and there is need to separate it, is there any ready guidelines/templates for software modules, folder structure etc? Don't start with that, start with small things where this question does not arise. Getting in stuff that requires new files or even new directories is *much* harder than changing existing files and certainly not recommended for beginners. That said, no, it really depends on the individual case, and which part of the system you are talking about. 4. What kind of test suites are used to ensure that changes don't break thigs or causes bugs? I mean others that are found in sources. /usr/src/regress 5. What is the licence policy in toolchain? I mean, it is clear to me that platform itself conforms much as possible http://www.openbsd.org/policy.html but how about development tools which are used only to produce ISC code? Is the policy relaxed to allow then more restricted open source code? Let's say, GPL code in some verification tool or testsuite? The policy is no new GPL code below /usr/src, no exceptions. Deleting existing GPL code from /usr/src will result in much cheering. What you do on your private machines is up to you. However, OpenBSD default FVWM look is like Motif. See /usr/xenocara/app/fvwm/COPYING for the license(s), fvwm is mostly close to ISC with an advertising clause. Admittedly, a few parts are GPL. [... large snip about GUI stuff ...] If offer is accepted, what is the preferred way to do the task? I have no idea, and i'm not interested. I wouldn't even use the result. There are problems with fvwm, yes. It is old, crufty code of horrible quality. But regarding functionality, i would rather call it bloated than ask for more features. Then again, i don't care enough about GUIs to waste my time trying anything else. Yours, Ingo