Remove links to www@

2015-06-25 Thread Pavel Plamenov

There are some leftover links to www@, which is gone.

Index: build/pkg-stable.html.head
===
RCS file: /cvs/www/build/pkg-stable.html.head,v
retrieving revision 1.7
diff -u -p -r1.7 pkg-stable.html.head
--- build/pkg-stable.html.head  1 May 2007 17:24:58 -   1.7
+++ build/pkg-stable.html.head  25 Jun 2015 06:53:16 -
@@ -2,7 +2,6 @@
 html
 head
 titleOpenBSD _STABLE_ packages errata/title
-link rev=made href=mailto:w...@openbsd.org;
 meta name=resource-type content=document
 meta name=description content=the OpenBSD _STABLE_ packages errata page
 meta name=keywords content=openbsd,packages,errata
Index: build/pkg-stable.html.tail
===
RCS file: /cvs/www/build/pkg-stable.html.tail,v
retrieving revision 1.1
diff -u -p -r1.1 pkg-stable.html.tail
--- build/pkg-stable.html.tail  11 Nov 2005 18:47:33 -  1.1
+++ build/pkg-stable.html.tail  25 Jun 2015 06:53:16 -
@@ -2,7 +2,6 @@
 
 hr

 a href=index.htmlimg height=24 width=24 src=back.gif border=0 
alt=OpenBSD/a
-a href=mailto:w...@openbsd.org;w...@openbsd.org/a
 brsmall$OpenBSD: pkg-stable.html.tail,v 1.1 2005/11/11 18:47:33 sturm Exp 
$/small
 
 /body

Index: build/pkg-stable.prev.html.head
===
RCS file: /cvs/www/build/pkg-stable.prev.html.head,v
retrieving revision 1.6
diff -u -p -r1.6 pkg-stable.prev.html.head
--- build/pkg-stable.prev.html.head 1 May 2007 17:24:58 -   1.6
+++ build/pkg-stable.prev.html.head 25 Jun 2015 06:53:16 -
@@ -2,7 +2,6 @@
 html
 head
 titleOpenBSD _PREV_ packages errata/title
-link rev=made href=mailto:w...@openbsd.org;
 meta name=resource-type content=document
 meta name=description content=the OpenBSD _PREV_ packages errata page
 meta name=keywords content=openbsd,packages,errata
Index: hp300/domain.commands.html
===
RCS file: /cvs/www/hp300/domain.commands.html,v
retrieving revision 1.2
diff -u -p -r1.2 domain.commands.html
--- hp300/domain.commands.html  20 Dec 1999 00:22:10 -  1.2
+++ hp300/domain.commands.html  25 Jun 2015 06:53:16 -
@@ -102,7 +102,6 @@ Select System, type RETURN
 
 p

 a href=hp300faq.htmlimg height=24 width=24 src=../back.gif border=0 alt=OpenBSD/hp300 
FAQ/a
-a href=mailto:w...@openbsd.orgw...@openbsd.org/a
 br
 small$OpenBSD: domain.commands.html,v 1.2 1999/12/20 00:22:10 downsj Exp 
$/small
 /p
Index: hp300/hp300faq.html
===
RCS file: /cvs/www/hp300/hp300faq.html,v
retrieving revision 1.19
diff -u -p -r1.19 hp300faq.html
--- hp300/hp300faq.html 1 May 2014 15:13:16 -   1.19
+++ hp300/hp300faq.html 25 Jun 2015 06:53:17 -
@@ -3,7 +3,6 @@
 html
 head
 titleOpenBSD/hp300 FAQ/title
-link rev=made href=mailto:w...@openbsd.org;
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 meta name=resource-type content=document
 meta name=description content=the OpenBSD/hp300 FAQ page
@@ -703,8 +702,6 @@ HP Order No. A1630-90005
 
 a href=../hp300.html

 img height=24 width=24 src=../back.gif border=0 
alt=OpenBSD/hp300/a
-br
-smalla href=mailto:w...@openbsd.org;w...@openbsd.org/a/small
 br
 small$OpenBSD: hp300faq.html,v 1.19 2014/05/01 15:13:16 miod Exp $/small
 
Index: hp300/serialconsole.html

===
RCS file: /cvs/www/hp300/serialconsole.html,v
retrieving revision 1.3
diff -u -p -r1.3 serialconsole.html
--- hp300/serialconsole.html3 Dec 2004 20:46:36 -   1.3
+++ hp300/serialconsole.html25 Jun 2015 06:53:17 -
@@ -116,7 +116,6 @@ Bit Mapped Video at 133 (Console)
 
 p

 a href=hp300faq.htmlimg height=24 width=24 src=../back.gif border=0 alt=OpenBSD/hp300 
FAQ/a
-a href=mailto:w...@openbsd.orgw...@openbsd.org/a
 br
 small$OpenBSD: serialconsole.html,v 1.3 2004/12/03 20:46:36 miod Exp 
$/small
 /p
Index: libressl/goals.html
===
RCS file: /cvs/www/libressl/goals.html,v
retrieving revision 1.4
diff -u -p -r1.4 goals.html
--- libressl/goals.html 20 Mar 2015 15:29:48 -  1.4
+++ libressl/goals.html 25 Jun 2015 06:53:17 -
@@ -2,7 +2,6 @@
 html
 head
 titleLibreSSL Goals/title
-link rev=made href=mailto:w...@openbsd.org;
 meta name=resource-type content=document
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 meta name=distribution content=global
Index: libressl/papers.html
===
RCS file: /cvs/www/libressl/papers.html,v
retrieving revision 1.5
diff -u -p -r1.5 papers.html
--- libressl/papers.html20 Mar 2015 15:29:48 -  1.5
+++ libressl/papers.html25 Jun 2015 06:53:17 -
@@ -2,7 +2,6 @@
 html
 head
 titleLibreSSL related presentations amp; papers/title
-link rev=made 

SMP steroids for PF

2015-06-25 Thread Alexandr Nedvedicky
Hello,

attached is SMP patch for PF. consider it as toxic proof of concept as it has
paniced my amd64 system (see attached phone-shot). I have to figure out how to
debug it yet. The problem is the USB keyboard has died, so I had no chance to
type anything.  fortunately the issue is 100% reproducible.

The patch compiles in .MP and non-MP version. As you'll see more work is
needed to stabilize it and get full SMP support of PF. Those PF
features are not covered by SMP changes:
- packet queues
- packet logging
- pf-sync

patch is attached.

regards
sasha


pf_smp.amd64.2015-06-25.diff.gz
Description: application/gunzip


Should the patterns(7) manual use C-style indexing of strings?

2015-06-25 Thread Theo Buehler
From http://www.lua.org/manual/5.3/manual.html#6.4:

  When indexing a string in Lua, the first character is at position 1 (not
  at 0, as in C).

The example of applying the pattern ()aa() to the string flaaap in
the manpage shows that the empty captures () capture the positions
between the 'l' and the first 'a' and between the second and the third
'a's, which in C-style indexing would be positions 2 and 4, and in Lua
positions 3 and 5.

Maybe this difference should also be pointed out explicitly in the man
page for people familiar with Lua.

Positions 2 and 4 are also the numbers determined by `str_find', as
the following simple program shows:

--- 8 --- pattest.c
#include err.h
#include stdio.h

#include patterns.h

int
main(int argc, char *argv[])
{
struct str_find  sm[MAXCAPTURES];
const char  *string = flaaap;
const char  *pattern = ()aa();
const char  *errstr = NULL;
int  i, ret;

ret = str_find(string, pattern, sm, MAXCAPTURES, errstr);

if (errstr != NULL)
errx(1, str_find, %s\n, errstr);

printf(string: \%s\, pattern: \%s\, ret: %d\n, string,
pattern, ret);
for (i = 0; i  ret; i++)
printf(sm[%d].sm_so = %lld, sm[%d].sm_eo = %lld\n,
i, sm[i].sm_so, i, sm[i].sm_eo);

return 0;
}
--- 8 --- pattest.c

$ obj/pattest
string: flaaap, pattern: ()aa(), ret: 3
sm[0].sm_so = 0, sm[0].sm_eo = 6
sm[1].sm_so = 2, sm[1].sm_eo = 2
sm[2].sm_so = 4, sm[2].sm_eo = 4
$

Thus, I suggest to modify the patterns(7) manual as follows:

Index: usr.sbin/httpd/patterns.7
===
RCS file: /cvs/src/usr.sbin/httpd/patterns.7,v
retrieving revision 1.2
diff -u -p -r1.2 patterns.7
--- usr.sbin/httpd/patterns.7   23 Jun 2015 17:29:19 -  1.2
+++ usr.sbin/httpd/patterns.7   25 Jun 2015 12:11:19 -
@@ -268,7 +268,7 @@ For instance, if we apply the pattern
 .Qq ()aa()
 on the string
 .Qq flaaap ,
-there will be two captures: 3 and 5.
+there will be two captures: 2 and 4.
 .Sh SEE ALSO
 .Xr fnmatch 3 ,
 .Xr re_format 7 ,



Re: Better de(4) fix

2015-06-25 Thread Chris Cappuccio
Why do we still prefer de over dc for 211140 ?

Reyk Floeter [r...@openbsd.org] wrote:
 On Thu, Jun 25, 2015 at 09:21:11PM +0200, Mark Kettenis wrote:
  There really is no excuse for using dma_alloc(9) if you have the
  bus_dmatag_t available.
  
  This re-uses tulip_busdma_allocmem(), which simplifies the code for
  allocating the dmamap and such.
  
  Unfortunately I can't test this myself right now.
  
 
 Fixes the panic on Hyper-V, see dmesg below.
 
 Unrelated to that, no interrupts on the nic with the ioapic enabled
 (no traffic and autoneg timeouts).  
 
 Reyk
 
 OpenBSD 5.8-beta (GENERIC.MP) #7: Thu Jun 25 22:03:02 CEST 2015
 root@openbsd.hyperv:/usr/src/sys/arch/amd64/compile/GENERIC.MP
 real mem = 8573091840 (8175MB)
 avail mem = 8309399552 (7924MB)
 mpath0 at root
 scsibus0 at mpath0: 256 targets
 mainbus0 at root
 bios0 at mainbus0: SMBIOS rev. 2.3 @ 0xf8ec0 (216 entries)
 bios0: vendor American Megatrends Inc. version 090006 date 05/23/2012
 bios0: Microsoft Corporation Virtual Machine
 acpi0 at bios0: rev 0
 acpi0: sleep states S0 S5
 acpi0: tables DSDT FACP WAET SLIC OEM0 SRAT APIC OEMB
 acpi0: wakeup devices
 acpitimer0 at acpi0: 3579545 Hz, 32 bits
 acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
 cpu0 at mainbus0: apid 0 (boot processor)
 cpu0: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 1645.76 MHz
 cpu0: 
 FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,LONG,LAHF,ABM,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,RTM
 cpu0: 256KB 64b/line 8-way L2 cache
 cpu0: smt 0, core 0, package 0
 mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
 cpu0: apic clock running at 106MHz
 cpu1 at mainbus0: apid 1 (application processor)
 cpu1: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 1745.46 MHz
 cpu1: 
 FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,LONG,LAHF,ABM,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,RTM
 cpu1: 256KB 64b/line 8-way L2 cache
 cpu1: smt 0, core 0, package 1
 ioapic0 at mainbus0: apid 0 pa 0xfec0, version 11, 24 pins
 ioapic0: misconfigured as apic 2, remapped to apid 0
 acpiprt0 at acpi0: bus 0 (PCI0)
 acpicpu0 at acpi0
 acpicpu1 at acpi0
 pci0 at mainbus0 bus 0
 pchb0 at pci0 dev 0 function 0 Intel 82443BX rev 0x03
 pcib0 at pci0 dev 7 function 0 Intel 82371AB PIIX4 ISA rev 0x01
 pciide0 at pci0 dev 7 function 1 Intel 82371AB IDE rev 0x01: DMA, channel 0 
 wired to compatibility, channel 1 wired to compatibility
 wd0 at pciide0 channel 0 drive 0: Virtual HD
 wd0: 128-sector PIO, LBA48, 10240MB, 20971520 sectors
 wd0(pciide0:0:0): using PIO mode 4, DMA mode 2
 atapiscsi0 at pciide0 channel 1 drive 0
 scsibus1 at atapiscsi0: 2 targets
 cd0 at scsibus1 targ 0 lun 0: Msft, Virtual CD/ROM, 1.0 ATAPI 5/cdrom 
 removable
 cd0(pciide0:1:0): using PIO mode 4, DMA mode 2
 piixpm0 at pci0 dev 7 function 3 Intel 82371AB Power rev 0x02: SMBus 
 disabled
 vga1 at pci0 dev 8 function 0 Microsoft VGA rev 0x00
 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
 wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
 de0 at pci0 dev 10 function 0 DEC 21140 rev 0x20, 21140A pass 2.0: apic 0 
 int 11, address 00:15:5d:01:9b:03
 isa0 at pcib0
 isadma0 at isa0
 fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
 fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
 fd1 at fdc0 drive 1: density unknown
 com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
 com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
 pckbc0 at isa0 port 0x60/5 irq 1 irq 12
 pckbd0 at pckbc0 (kbd slot)
 wskbd0 at pckbd0: console keyboard, using wsdisplay0
 pms0 at pckbc0 (aux slot)
 wsmouse0 at pms0 mux 0
 pcppi0 at isa0 port 0x61
 spkr0 at pcppi0
 vscsi0 at root
 scsibus2 at vscsi0: 256 targets
 softraid0 at root
 scsibus3 at softraid0: 256 targets
 root on wd0a (02632bce06e92172.a) swap on wd0b dump on wd0b
 
 

-- 
The bums will always lose



Re: Better de(4) fix

2015-06-25 Thread Reyk Floeter
On Thu, Jun 25, 2015 at 09:21:11PM +0200, Mark Kettenis wrote:
 There really is no excuse for using dma_alloc(9) if you have the
 bus_dmatag_t available.
 
 This re-uses tulip_busdma_allocmem(), which simplifies the code for
 allocating the dmamap and such.
 
 Unfortunately I can't test this myself right now.
 

Fixes the panic on Hyper-V, see dmesg below.

Unrelated to that, no interrupts on the nic with the ioapic enabled
(no traffic and autoneg timeouts).  

Reyk

OpenBSD 5.8-beta (GENERIC.MP) #7: Thu Jun 25 22:03:02 CEST 2015
root@openbsd.hyperv:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8573091840 (8175MB)
avail mem = 8309399552 (7924MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.3 @ 0xf8ec0 (216 entries)
bios0: vendor American Megatrends Inc. version 090006 date 05/23/2012
bios0: Microsoft Corporation Virtual Machine
acpi0 at bios0: rev 0
acpi0: sleep states S0 S5
acpi0: tables DSDT FACP WAET SLIC OEM0 SRAT APIC OEMB
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 1645.76 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,LONG,LAHF,ABM,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,RTM
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 106MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 1745.46 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,LONG,LAHF,ABM,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,RTM
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 0, package 1
ioapic0 at mainbus0: apid 0 pa 0xfec0, version 11, 24 pins
ioapic0: misconfigured as apic 2, remapped to apid 0
acpiprt0 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0
acpicpu1 at acpi0
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel 82443BX rev 0x03
pcib0 at pci0 dev 7 function 0 Intel 82371AB PIIX4 ISA rev 0x01
pciide0 at pci0 dev 7 function 1 Intel 82371AB IDE rev 0x01: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: Virtual HD
wd0: 128-sector PIO, LBA48, 10240MB, 20971520 sectors
wd0(pciide0:0:0): using PIO mode 4, DMA mode 2
atapiscsi0 at pciide0 channel 1 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: Msft, Virtual CD/ROM, 1.0 ATAPI 5/cdrom 
removable
cd0(pciide0:1:0): using PIO mode 4, DMA mode 2
piixpm0 at pci0 dev 7 function 3 Intel 82371AB Power rev 0x02: SMBus disabled
vga1 at pci0 dev 8 function 0 Microsoft VGA rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
de0 at pci0 dev 10 function 0 DEC 21140 rev 0x20, 21140A pass 2.0: apic 0 int 
11, address 00:15:5d:01:9b:03
isa0 at pcib0
isadma0 at isa0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
fd1 at fdc0 drive 1: density unknown
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on wd0a (02632bce06e92172.a) swap on wd0b dump on wd0b





Re: Better de(4) fix

2015-06-25 Thread Imre Vadasz
On 22:27 Thu 25 Jun , Reyk Floeter wrote:
 On Thu, Jun 25, 2015 at 09:21:11PM +0200, Mark Kettenis wrote:
  There really is no excuse for using dma_alloc(9) if you have the
  bus_dmatag_t available.
  
  This re-uses tulip_busdma_allocmem(), which simplifies the code for
  allocating the dmamap and such.
  
  Unfortunately I can't test this myself right now.
  
 
 Fixes the panic on Hyper-V, see dmesg below.
 
 Unrelated to that, no interrupts on the nic with the ioapic enabled
 (no traffic and autoneg timeouts).  
 
 Reyk

On DragonFly BSD and NetBSD I was able to get the NIC interrupts working
with enabled ioapic, by forcing the NIC's IRQ to be configured as
edge/high triggered instead of level/low in the ioapic.



Re: Remove links to www@

2015-06-25 Thread Jean-Philippe Ouellet
On Thu, Jun 25, 2015 at 07:01:29AM +, Pavel Plamenov wrote:
 There are some leftover links to www@, which is gone.

I sent an almost identical diff over a year ago:
https://www.marc.info/?l=openbsd-miscm=139627200904849w=2

I think this is the right direction.



Better de(4) fix

2015-06-25 Thread Mark Kettenis
There really is no excuse for using dma_alloc(9) if you have the
bus_dmatag_t available.

This re-uses tulip_busdma_allocmem(), which simplifies the code for
allocating the dmamap and such.

Unfortunately I can't test this myself right now.


Index: if_de.c
===
RCS file: /home/cvs/src/sys/dev/pci/if_de.c,v
retrieving revision 1.122
diff -u -p -r1.122 if_de.c
--- if_de.c 25 Jun 2015 18:35:48 -  1.122
+++ if_de.c 25 Jun 2015 19:14:49 -
@@ -4085,7 +4085,8 @@ tulip_txput_setup(tulip_softc_t * const 
sc-tulip_if.if_start = tulip_ifstart;
return;
 }
-bcopy(sc-tulip_setupdata, sc-tulip_setupdma, 
sizeof(sc-tulip_setupdata));
+bcopy(sc-tulip_setupdata, sc-tulip_setupbuf,
+sizeof(sc-tulip_setupdata));
 /*
  * Clear WANTSETUP and set DOINGSETUP.  Set know that WANTSETUP is
  * set and DOINGSETUP is clear doing an XOR of the two will DTRT.
@@ -4356,19 +4357,12 @@ tulip_busdma_init(tulip_softc_t * const 
 {
 int error = 0;
 
-sc-tulip_setupdma = dma_alloc(sizeof(sc-tulip_setupdata), PR_WAITOK);
-
 /*
- * Allocate dmamap for setup descriptor
+ * Allocate space and dmamap for setup descriptor
  */
-error = bus_dmamap_create(sc-tulip_dmatag, TULIP_SETUP, 2,
-   TULIP_SETUP, 0, BUS_DMA_NOWAIT, sc-tulip_setupmap);
-if (error == 0) {
-   error = bus_dmamap_load(sc-tulip_dmatag, sc-tulip_setupmap,
-   sc-tulip_setupdma, TULIP_SETUP, NULL, BUS_DMA_NOWAIT);
-   if (error)
-   bus_dmamap_destroy(sc-tulip_dmatag, sc-tulip_setupmap);
-}
+error = tulip_busdma_allocmem(sc, sizeof(sc-tulip_setupdata),
+ sc-tulip_setupmap, sc-tulip_setupbuf);
+
 /*
  * Allocate space and dmamap for transmit ring
  */
Index: if_devar.h
===
RCS file: /home/cvs/src/sys/dev/pci/if_devar.h,v
retrieving revision 1.34
diff -u -p -r1.34 if_devar.h
--- if_devar.h  25 Jun 2015 18:35:48 -  1.34
+++ if_devar.h  25 Jun 2015 19:07:19 -
@@ -601,7 +601,7 @@ struct _tulip_softc_t {
  * filled.
  */
 #define TULIP_SETUP192
-u_int32_t *tulip_setupdma;
+tulip_desc_t *tulip_setupbuf;
 u_int32_t tulip_setupdata[TULIP_SETUP / sizeof(u_int32_t)];
 
 char tulip_boardid[16];/* buffer for board ID */



wc(1) SIGINFO - show count so far

2015-06-25 Thread Jean-Philippe Ouellet
SIGINFO is awesome, but it's even better when it actually does
something relevant.

This makes it print the total counts so far to stderr.

Useful? Feature creep? You decide.


Index: wc.c
===
RCS file: /cvs/src/usr.bin/wc/wc.c,v
retrieving revision 1.17
diff -u -p -d -r1.17 wc.c
--- wc.c16 Jan 2015 06:40:14 -  1.17
+++ wc.c25 Jun 2015 14:49:21 -
@@ -32,6 +32,9 @@
 #include sys/param.h /* MAXBSIZE */
 #include sys/stat.h
 #include sys/file.h
+
+#include errno.h
+#include signal.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -41,18 +44,23 @@
 #include unistd.h
 #include util.h
 
+int64_tlinect, wordct, charct;
 int64_ttlinect, twordct, tcharct;
 intdoline, doword, dochar, humanchar;
 intrval;
 extern char *__progname;
+volatile sig_atomic_t wants_info = 0;
 
-void   print_counts(int64_t, int64_t, int64_t, char *);
-void   format_and_print(long long);
+void   handler(int);
+ssize_treread(int, void *, size_t);
+void   print_counts(FILE *, int64_t, int64_t, int64_t, char *);
+void   format_and_print(FILE *, long long);
 void   cnt(char *);
 
 int
 main(int argc, char *argv[])
 {
+   struct sigaction act;
int ch;
 
setlocale(LC_ALL, );
@@ -90,6 +98,13 @@ main(int argc, char *argv[])
if (!doline  !doword  !dochar)
doline = doword = dochar = 1;
 
+   memset(act, 0, sizeof(act));
+   act.sa_handler = handler;
+   sigemptyset(act.sa_mask);
+   /* SA_RESTART specifically not set */
+   if (sigaction(SIGINFO, act, NULL) == -1)
+   err(1, sigaction);
+
if (!*argv) {
cnt((char *)NULL);
} else {
@@ -100,19 +115,43 @@ main(int argc, char *argv[])
} while(*++argv);
 
if (dototal)
-   print_counts(tlinect, twordct, tcharct, total);
+   print_counts(stdout, tlinect, twordct, tcharct,
+   total);
}
 
exit(rval);
 }
 
 void
+handler(int sig __unused)
+{
+   wants_info = 1;
+}
+
+ssize_t
+reread(int d, void *buf, size_t nbytes)
+{
+   ssize_t len;
+
+restart:
+   len = read(d, buf, nbytes);
+   if (wants_info) {
+   print_counts(stderr, linect + tlinect, wordct + twordct,
+   charct + tcharct, total so far);
+   wants_info = 0;
+   }
+   if (len == -1  errno == EINTR)
+   goto restart;
+
+   return len;
+}
+
+void
 cnt(char *file)
 {
u_char *C;
short gotsp;
int len;
-   int64_t linect, wordct, charct;
struct stat sbuf;
int fd;
u_char buf[MAXBSIZE];
@@ -135,7 +174,7 @@ cnt(char *file)
 * the word count requires some logic.
 */
if (doline) {
-   while ((len = read(fd, buf, MAXBSIZE))  0) {
+   while ((len = reread(fd, buf, MAXBSIZE))  0) {
charct += len;
for (C = buf; len--; ++C)
if (*C == '\n')
@@ -165,7 +204,7 @@ cnt(char *file)
|| ifmt == S_IFDIR) {
charct = sbuf.st_size;
} else {
-   while ((len = read(fd, buf, MAXBSIZE)) 
 0)
+   while ((len = reread(fd, buf, 
MAXBSIZE))  0)
charct += len;
if (len == -1) {
warn(%s, file);
@@ -177,7 +216,7 @@ cnt(char *file)
} else {
/* Do it the hard way... */
gotsp = 1;
-   while ((len = read(fd, buf, MAXBSIZE))  0) {
+   while ((len = reread(fd, buf, MAXBSIZE))  0) {
/*
 * This loses in the presence of multi-byte characters.
 * To do it right would require a function to return a
@@ -211,7 +250,7 @@ cnt(char *file)
}
}
 
-   print_counts(linect, wordct, charct, file);
+   print_counts(stdout, linect, wordct, charct, file);
 
/*
 * Don't bother checking doline, doword, or dochar -- speeds
@@ -228,30 +267,30 @@ cnt(char *file)
 }
 
 void 
-format_and_print(long long v)
+format_and_print(FILE *f, long long v)
 {
if (humanchar) {
char result[FMT_SCALED_STRSIZE];
 
(void)fmt_scaled(v, result);
-   (void)printf(%7s, result);
+   (void)fprintf(f, %7s, result);
} else {
-   (void)printf( %7lld, v);
+   (void)fprintf(f,  %7lld, v);
}
 }
 
 void
-print_counts(int64_t lines, int64_t words, int64_t chars, char *name)
+print_counts(FILE *f, 

Re: wc(1) SIGINFO - show count so far

2015-06-25 Thread Theo de Raadt
We do not need (or want) SIGINFO support in a program like this.

The complexity is way too high, and I see no benefit.



Re: Better de(4) fix

2015-06-25 Thread Reyk Floeter
On Thu, Jun 25, 2015 at 11:04:00PM +0200, Imre Vadasz wrote:
 On 22:27 Thu 25 Jun , Reyk Floeter wrote:
  On Thu, Jun 25, 2015 at 09:21:11PM +0200, Mark Kettenis wrote:
   There really is no excuse for using dma_alloc(9) if you have the
   bus_dmatag_t available.
   
   This re-uses tulip_busdma_allocmem(), which simplifies the code for
   allocating the dmamap and such.
   
   Unfortunately I can't test this myself right now.
   
  
  Fixes the panic on Hyper-V, see dmesg below.
  
  Unrelated to that, no interrupts on the nic with the ioapic enabled
  (no traffic and autoneg timeouts).  
  
  Reyk
 
 On DragonFly BSD and NetBSD I was able to get the NIC interrupts working
 with enabled ioapic, by forcing the NIC's IRQ to be configured as
 edge/high triggered instead of level/low in the ioapic.

I had to try this: with a horrible hack(tm) in pci_intr_establish() I
turned de0 into edge triggered and everything works.

Reyk

OpenBSD 5.8-beta (GENERIC.MP) #17: Thu Jun 25 23:54:49 CEST 2015
root@openbsd.hyperv:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8573091840 (8175MB)
avail mem = 8309399552 (7924MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.3 @ 0xf8ec0 (216 entries)
bios0: vendor American Megatrends Inc. version 090006 date 05/23/2012
bios0: Microsoft Corporation Virtual Machine
acpi0 at bios0: rev 0
acpi0: sleep states S0 S5
acpi0: tables DSDT FACP WAET SLIC OEM0 SRAT APIC OEMB
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 1647.71 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,LONG,LAHF,ABM,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,RTM
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 120MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 1975.61 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,LONG,LAHF,ABM,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,RTM
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 0, package 1
ioapic0 at mainbus0: apid 0 pa 0xfec0, version 11, 24 pins
ioapic0: misconfigured as apic 2, remapped to apid 0
acpiprt0 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0
acpicpu1 at acpi0
allocated pic ioapic0 type level pin 9 level 9 to cpu0 slot 9 idt entry 144
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel 82443BX rev 0x03
pcib0 at pci0 dev 7 function 0 Intel 82371AB PIIX4 ISA rev 0x01
pciide0 at pci0 dev 7 function 1 Intel 82371AB IDE rev 0x01: DMA, channel 0 
wired to compatibility, channel 1 wired to compatibility
allocated pic ioapic0 type edge pin 14 level 6 to cpu0 slot 14 idt entry 96
wd0 at pciide0 channel 0 drive 0: Virtual HD
wd0: 128-sector PIO, LBA48, 10240MB, 20971520 sectors
wd0(pciide0:0:0): using PIO mode 4, DMA mode 2
allocated pic ioapic0 type edge pin 15 level 6 to cpu0 slot 15 idt entry 97
atapiscsi0 at pciide0 channel 1 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: Msft, Virtual CD/ROM, 1.0 ATAPI 5/cdrom 
removable
cd0(pciide0:1:0): using PIO mode 4, DMA mode 2
piixpm0 at pci0 dev 7 function 3 Intel 82371AB Power rev 0x02: SMBus disabled
vga1 at pci0 dev 8 function 0 Microsoft VGA rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
de0 at pci0 dev 10 function 0 DEC 21140 rev 0x20allocated pic ioapic0 type 
edge pin 11 level 7 to cpu0 slot 11 idt entry 112
, 21140A pass 2.0: apic 0 int 11, normal, address 00:15:5d:01:9b:03
isa0 at pcib0
isadma0 at isa0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
allocated pic ioapic0 type edge pin 6 level 6 to cpu0 slot 6 idt entry 98
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
fd1 at fdc0 drive 1: density unknown
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
allocated pic ioapic0 type edge pin 4 level 9 to cpu0 slot 4 idt entry 145
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
allocated pic ioapic0 type edge pin 3 level 9 to cpu0 slot 3 idt entry 146
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
allocated pic ioapic0 type edge pin 1 level 9 to cpu0 slot 1 idt entry 147
allocated pic ioapic0 type edge pin 12 level 9 to cpu0 slot 12 idt entry 148
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
cpu0: interrupt masks:
IPL 0 mask 7ff25a5 unmask f800da5a
IPL 1 mask 7ff25a5 unmask f800da5a
IPL 2 mask 

syslogd -U bind UDP address

2015-06-25 Thread Alexander Bluhm
Hi,

I have added a -U feature for syslogd to specify an explict bind
address to receive UDP packets.  One advantge over -u and the *
sockets is, that you can bind to localhost and divert the packets
with pf.  It is also possible to use a different port.

My plan is to extend the interface with -T listen_address:port to
receive syslog via TCP.

ok?

bluhm

Index: usr.sbin/syslogd/privsep.c
===
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/privsep.c,v
retrieving revision 1.51
diff -u -p -r1.51 privsep.c
--- usr.sbin/syslogd/privsep.c  19 Jan 2015 16:40:49 -  1.51
+++ usr.sbin/syslogd/privsep.c  25 Jun 2015 20:03:17 -
@@ -186,6 +186,8 @@ priv_init(char *conf, int numeric, int l
close(fd_udp);
if (fd_udp6 != -1)
close(fd_udp6);
+   if (fd_bind != -1)
+   close(fd_bind);
for (i = 0; i  nunix; i++)
if (fd_unix[i] != -1)
close(fd_unix[i]);
Index: usr.sbin/syslogd/syslogd.8
===
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/syslogd.8,v
retrieving revision 1.35
diff -u -p -r1.35 syslogd.8
--- usr.sbin/syslogd/syslogd.8  15 Jun 2015 22:39:14 -  1.35
+++ usr.sbin/syslogd/syslogd.8  25 Jun 2015 19:48:21 -
@@ -111,6 +111,19 @@ Specify path to an
 .Dv AF_LOCAL
 socket for use in reporting logs stored in memory buffers using
 .Xr syslogc 8 .
+.It Fl U Ar bind_address
+Create an UDP socket for receiving messages and bind it to the
+specified address.
+A port number may be specified using the
+.Ar host:port
+syntax.
+IPv6 addresses can be used by surrounding the address portion with
+square brackets
+.Po
+.Ql [\
+and
+.Ql ]\
+.Pc .
 .It Fl u
 Select the historical
 .Dq insecure
Index: usr.sbin/syslogd/syslogd.c
===
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.164
diff -u -p -r1.164 syslogd.c
--- usr.sbin/syslogd/syslogd.c  15 Jun 2015 21:42:15 -  1.164
+++ usr.sbin/syslogd/syslogd.c  25 Jun 2015 19:49:00 -
@@ -218,6 +218,8 @@ int NoDNS = 0;  /* when true, will refra
 intIPv4Only = 0;   /* when true, disable IPv6 */
 intIPv6Only = 0;   /* when true, disable IPv4 */
 intIncludeHostname = 0;/* include RFC 3164 style hostnames when 
forwarding */
+char   *bind_host = NULL;
+char   *bind_port = NULL;
 
 char   *path_ctlsock = NULL;   /* Path to control socket */
 
@@ -274,9 +276,9 @@ char*linebuf;
 int linesize;
 
 int fd_ctlsock, fd_ctlconn, fd_klog, fd_sendsys,
-fd_udp, fd_udp6, fd_unix[MAXUNIX];
+fd_udp, fd_udp6, fd_bind, fd_unix[MAXUNIX];
 struct eventev_ctlaccept, ev_ctlread, ev_ctlwrite, ev_klog, ev_sendsys,
-ev_udp, ev_udp6, ev_unix[MAXUNIX],
+ev_udp, ev_udp6, ev_bind, ev_unix[MAXUNIX],
 ev_hup, ev_int, ev_quit, ev_term, ev_mark;
 
 voidklog_readcb(int, short, void *);
@@ -313,7 +315,7 @@ voidprintsys(char *);
 char   *ttymsg(struct iovec *, int, char *, int);
 void   usage(void);
 void   wallmsg(struct filed *, struct iovec *);
-intloghost(char *, char **, char **, char **);
+intloghost_parse(char *, char **, char **, char **);
 intgetmsgbufsize(void);
 intunix_socket(char *, int, mode_t);
 void   double_rbuf(int);
@@ -329,7 +331,7 @@ main(int argc, char *argv[])
int  ch, i;
int  lockpipe[2] = { -1, -1}, pair[2], nullfd, fd;
 
-   while ((ch = getopt(argc, argv, 46C:dhnuf:Fm:p:a:s:V)) != -1)
+   while ((ch = getopt(argc, argv, 46C:dhnuf:Fm:p:a:s:U:V)) != -1)
switch (ch) {
case '4':   /* disable IPv6 */
IPv4Only = 1;
@@ -366,6 +368,11 @@ main(int argc, char *argv[])
case 'p':   /* path */
path_unix[0] = optarg;
break;
+   case 'U':   /* allow udp only from address */
+   if (loghost_parse(optarg, NULL, bind_host, bind_port)
+   == -1)
+   errx(1, bad bind address: %s, optarg);
+   break;
case 'u':   /* allow udp input port */
SecureMode = 0;
break;
@@ -424,8 +431,7 @@ main(int argc, char *argv[])
hints.ai_protocol = IPPROTO_UDP;
hints.ai_flags = AI_PASSIVE;
 
-   i = getaddrinfo(NULL, syslog, hints, res0);
-   if (i) {
+   if (getaddrinfo(NULL, syslog, hints, res0)) {
errno = 0;
logerror(syslog/udp: unknown service);
die(0);
@@ -475,6 +481,64 @@ main(int argc, char *argv[])
 
freeaddrinfo(res0);

upd(4) man page update

2015-06-25 Thread David Higgs
If there’s no further work on upd(4) prior to 5.8, at least make the man page 
reflect present reality.

- Update list of supported sensors, re-sorted by source file occurrence
- Explain why manual sensorsd.conf(5) intervention can be necessary
- Link to HID power specs
- Prefer “a UPS” over “an UPS”, matches HID docs above
- Other misc linguistic bikeshedding

Apologies, this is my first experience with mdoc(7).

--david

Index: upd.4
===
RCS file: /cvs/src/share/man/man4/upd.4,v
retrieving revision 1.3
diff -u -p -r1.3 upd.4
--- upd.4   19 Mar 2014 09:22:25 -  1.3
+++ upd.4   26 Jun 2015 02:46:15 -
@@ -25,17 +25,23 @@
 .Sh DESCRIPTION
 The
 .Nm
-driver exposes data from USB Power Devices (such as an UPS),
-as hardware sensors via
-.Xr sysctl 3 .
+driver provides support for monitoring various sensors provided by
+USB Power Devices (such as a UPS).
+Supported sensor values are made available via the
+.Xr sysctl 8 interface.
 .Pp
-The following sensors are provided by the
-.Nm
-driver, which can be monitored using
-.Xr sensorsd 8 :
+The following sensors are supported by the driver:
 .Pp
 .Bl -item -offset indent -compact
 .It
+BatteryPresent
+.It
+ShutdownImminent
+.It
+ACPresent
+.It
+Overload
+.It
 RelativeStateOfCharge
 .It
 AbsoluteStateOfCharge
@@ -48,19 +54,23 @@ Charging
 .It
 Discharging
 .It
-BatteryPresent
+AtRateTimeToFull
 .It
-ShutdownImminent
+AtRateTimeToEmpty
 .It
-ACPresent
+RunTimeToEmpty
 .It
-AtRateTimeToFull
+NeedReplacement
 .El
 .Sh SEE ALSO
 .Xr intro 4 ,
 .Xr uhidev 4 ,
 .Xr sensorsd 8 ,
+.Xr sensorsd.conf 5 ,
 .Xr sysctl 8
+.Pp
+The USB Power Devices specification can be found at
+.Lk http://www.usb.org/developers/hidpage/
 .Sh HISTORY
 The
 .Nm
@@ -71,3 +81,18 @@ The
 .Nm
 driver was written by
 .An Andre de Oliveira .
+.Sh BUGS
+The
+.Nm
+driver does not indicate device health via aggregate or
+individual sensor status.
+Users who wish to monitor
+.Nm
+status using
+.Xr sensorsd 8
+must manually establish
+.Dq high
+and
+.Dq low
+limits for sensor values of interest via
+.Xr sensorsd.conf 5 .




Pure L2TP client upload performance

2015-06-25 Thread Sergey Ryazanov
Hello,

during building l2tp tunnel with xl2tpd-1.3.1 I was faced with its too
low  upload  performance.  When  download,  the  speed is 20 mbit/s at
nearly  100% CPU utilization. CPU is Pentium D 930 3 GHz. When upload,
the speed is below 2 mbit/s at nearly zero CPU utilization.

First,  I  examined xl2tpd code and did not find any potential issues.
Then  I  compiled  it with -pg option and do a quick test with help of
iperf(1):  4  TCP  flows,  direction  is toward the L2TP server, 2 min
test.   Then  I run gprof and got pretty strange output:

Full output: http://pastebin.com/dm4wz6VK
granularity: each sample hit covers 4 byte(s) for 11.11% of 0.09 seconds
  %   cumulative   self  self total
 time   seconds   secondscalls  ms/call  ms/call  name
 77.8   0.07 0.0724311 0.00 0.00  write [4]
 22.2   0.09 0.0235897 0.00 0.00  _thread_sys_sendmsg [7]
  0.0   0.09 0.00   109136 0.00 0.00  memset [46]
  0.0   0.09 0.00   107997 0.00 0.00  ___errno [926]
  0.0   0.09 0.0071740 0.00 0.00  read_packet [47]
  0.0   0.09 0.0071726 0.00 0.00  _thread_sys_read [927]
  0.0   0.09 0.0060154 0.00 0.00  _thread_sys_gettimeofday 
[928]
  0.0   0.09 0.0060114 0.00 0.00  process_signal [32]
  0.0   0.09 0.0060113 0.00 0.00  build_fdset [29]
  0.0   0.09 0.0060113 0.00 0.00  process_schedule [26]
  0.0   0.09 0.0060113 0.00 0.00  select [48]
  0.0   0.09 0.0035897 0.00 0.00  udp_xmit [6]

Another one run also gives something strange:

Full output: http://pastebin.com/vXvHPuyj
granularity: each sample hit covers 4 byte(s) for 14.29% of 0.07 seconds
  %   cumulative   self  self total
 time   seconds   secondscalls  ms/call  ms/call  name
 71.4   0.05 0.0524348 0.00 0.00  write [4]
 14.3   0.06 0.0160265 0.00 0.00  select [6]
 14.3   0.07 0.01   10 1.00 1.00  calloc [7]
  0.0   0.07 0.00   109324 0.00 0.00  memset [55]
  0.0   0.07 0.00   108285 0.00 0.00  ___errno [925]
  0.0   0.07 0.0071997 0.00 0.00  read_packet [56]
  0.0   0.07 0.0071980 0.00 0.00  _thread_sys_read [926]
  0.0   0.07 0.0060282 0.00 0.00  _thread_sys_gettimeofday 
[927]
  0.0   0.07 0.0060266 0.00 0.00  process_signal [50]
  0.0   0.07 0.0060265 0.00 0.00  build_fdset [49]
  0.0   0.07 0.0060265 0.00 0.00  process_schedule [57]
  0.0   0.07 0.0036020 0.00 0.00  _thread_sys_sendmsg [928]
  0.0   0.07 0.0036020 0.00 0.00  udp_xmit [58]

For comparison I changed direction and did a download test:

Full output: http://pastebin.com/FFF6xGcy
granularity: each sample hit covers 4 byte(s) for 0.01% of 114.30 seconds
  %   cumulative   self  self total
 time   seconds   secondscalls  ms/call  ms/call  name
 93.7 107.06   107.06   370804 0.29 0.29  write [5]
  1.8 109.08 2.02   370770 0.01 0.01  recvmsg [6]
  1.4 110.67 1.59   370799 0.00 0.00  _thread_sys_gettimeofday 
[8]
  1.1 111.90 1.23   370770 0.00 0.30  handle_packet [4]
  1.0 113.01 1.11   370761 0.00 0.00  add_fcs [9]
  0.7 113.81 0.81   370781 0.00 0.00  select [10]
  0.2 114.03 0.211   210.00 114172.55  network_thread [3]
  0.1 114.14 0.12 mcount [11]
  0.0 114.19 0.05   370781 0.00 0.00  build_fdset [12]
  0.0 114.23 0.04   370771 0.00 0.00  get_call [13]
  0.0 114.27 0.03  1112701 0.00 0.00  memset [14]
  0.0 114.28 0.02   370781 0.00 0.00  process_schedule [7]
  0.0 114.30 0.01   29 0.34 0.34  _thread_sys_sendmsg [20]
  0.0 114.30 0.018 0.62 0.74  inet_ntoa [24]
  0.0 114.30 0.00   370785 0.00 0.00  swaps [110]
  0.0 114.30 0.00   370782 0.00 0.00  process_signal [41]
  0.0 114.30 0.00   370770 0.00 0.00  recycle_buf [111]

During  upload  tests, everything looks like if xl2tpd doesn't perform
any work and stucks somewhere in I/O operation.

May  be  there are some options, what could be tuned to speedup ppp(4)
I/O  performance  or  did  I missed something during my tests? I am in
doubts. Any clues?

-- 
Sergey



Re: Better de(4) fix

2015-06-25 Thread Mike Larkin
On Fri, Jun 26, 2015 at 12:09:40AM +0200, Reyk Floeter wrote:
 On Thu, Jun 25, 2015 at 11:04:00PM +0200, Imre Vadasz wrote:
  On 22:27 Thu 25 Jun , Reyk Floeter wrote:
   On Thu, Jun 25, 2015 at 09:21:11PM +0200, Mark Kettenis wrote:
There really is no excuse for using dma_alloc(9) if you have the
bus_dmatag_t available.

This re-uses tulip_busdma_allocmem(), which simplifies the code for
allocating the dmamap and such.

Unfortunately I can't test this myself right now.

   
   Fixes the panic on Hyper-V, see dmesg below.
   
   Unrelated to that, no interrupts on the nic with the ioapic enabled
   (no traffic and autoneg timeouts).  
   
   Reyk
  
  On DragonFly BSD and NetBSD I was able to get the NIC interrupts working
  with enabled ioapic, by forcing the NIC's IRQ to be configured as
  edge/high triggered instead of level/low in the ioapic.
 
 I had to try this: with a horrible hack(tm) in pci_intr_establish() I
 turned de0 into edge triggered and everything works.
 
 Reyk

I suspect something is amiss in our interpretation of the interrupt config
on amd64 since de(4) works unmodified on i386 with Hyper-V.

Maybe some AML parse screwup?

-ml

 
 OpenBSD 5.8-beta (GENERIC.MP) #17: Thu Jun 25 23:54:49 CEST 2015
 root@openbsd.hyperv:/usr/src/sys/arch/amd64/compile/GENERIC.MP
 real mem = 8573091840 (8175MB)
 avail mem = 8309399552 (7924MB)
 mpath0 at root
 scsibus0 at mpath0: 256 targets
 mainbus0 at root
 bios0 at mainbus0: SMBIOS rev. 2.3 @ 0xf8ec0 (216 entries)
 bios0: vendor American Megatrends Inc. version 090006 date 05/23/2012
 bios0: Microsoft Corporation Virtual Machine
 acpi0 at bios0: rev 0
 acpi0: sleep states S0 S5
 acpi0: tables DSDT FACP WAET SLIC OEM0 SRAT APIC OEMB
 acpi0: wakeup devices
 acpitimer0 at acpi0: 3579545 Hz, 32 bits
 acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
 cpu0 at mainbus0: apid 0 (boot processor)
 cpu0: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 1647.71 MHz
 cpu0: 
 FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,LONG,LAHF,ABM,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,RTM
 cpu0: 256KB 64b/line 8-way L2 cache
 cpu0: smt 0, core 0, package 0
 mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
 cpu0: apic clock running at 120MHz
 cpu1 at mainbus0: apid 1 (application processor)
 cpu1: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz, 1975.61 MHz
 cpu1: 
 FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,LONG,LAHF,ABM,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,RTM
 cpu1: 256KB 64b/line 8-way L2 cache
 cpu1: smt 0, core 0, package 1
 ioapic0 at mainbus0: apid 0 pa 0xfec0, version 11, 24 pins
 ioapic0: misconfigured as apic 2, remapped to apid 0
 acpiprt0 at acpi0: bus 0 (PCI0)
 acpicpu0 at acpi0
 acpicpu1 at acpi0
 allocated pic ioapic0 type level pin 9 level 9 to cpu0 slot 9 idt entry 144
 pci0 at mainbus0 bus 0
 pchb0 at pci0 dev 0 function 0 Intel 82443BX rev 0x03
 pcib0 at pci0 dev 7 function 0 Intel 82371AB PIIX4 ISA rev 0x01
 pciide0 at pci0 dev 7 function 1 Intel 82371AB IDE rev 0x01: DMA, channel 0 
 wired to compatibility, channel 1 wired to compatibility
 allocated pic ioapic0 type edge pin 14 level 6 to cpu0 slot 14 idt entry 96
 wd0 at pciide0 channel 0 drive 0: Virtual HD
 wd0: 128-sector PIO, LBA48, 10240MB, 20971520 sectors
 wd0(pciide0:0:0): using PIO mode 4, DMA mode 2
 allocated pic ioapic0 type edge pin 15 level 6 to cpu0 slot 15 idt entry 97
 atapiscsi0 at pciide0 channel 1 drive 0
 scsibus1 at atapiscsi0: 2 targets
 cd0 at scsibus1 targ 0 lun 0: Msft, Virtual CD/ROM, 1.0 ATAPI 5/cdrom 
 removable
 cd0(pciide0:1:0): using PIO mode 4, DMA mode 2
 piixpm0 at pci0 dev 7 function 3 Intel 82371AB Power rev 0x02: SMBus 
 disabled
 vga1 at pci0 dev 8 function 0 Microsoft VGA rev 0x00
 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
 wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
 de0 at pci0 dev 10 function 0 DEC 21140 rev 0x20allocated pic ioapic0 type 
 edge pin 11 level 7 to cpu0 slot 11 idt entry 112
 , 21140A pass 2.0: apic 0 int 11, normal, address 00:15:5d:01:9b:03
 isa0 at pcib0
 isadma0 at isa0
 fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
 allocated pic ioapic0 type edge pin 6 level 6 to cpu0 slot 6 idt entry 98
 fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
 fd1 at fdc0 drive 1: density unknown
 com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
 allocated pic ioapic0 type edge pin 4 level 9 to cpu0 slot 4 idt entry 145
 com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
 allocated pic ioapic0 type edge pin 3 level 9 to cpu0 slot 3 idt entry 146
 pckbc0 at isa0 port 0x60/5 irq 1 irq 12
 allocated pic ioapic0 type edge pin 1 level 9 to cpu0 slot 1 idt entry 147
 allocated pic ioapic0 type edge pin 12 level 9 to cpu0 

Re: Remove links to www@

2015-06-25 Thread Anthony J. Bentley
Pavel Plamenov writes:
 There are some leftover links to www@, which is gone.

Your patch seems to have gotten broken somehow, by adding extra
space to the beginning of lines. I removed those and committed it;
thanks for sending.