Re: [PATCH] frame length validation for USB ethernet adapters

2011-03-20 Thread Fred Crowson

On 03/19/11 18:01, Loganaden Velvindron wrote:

Hi, I'm uploading the new diffs for this. It concerns
axe(4), aue(4), cdce(4), cue(4), kue(4), mos(4) and url(4).

Of these, axe(4) is the most tricky, and I'd appreciate testing
on all vaariants of axe(4).

Please test both small and large packets (NFS and SCP).

As usual,
feedback is most welcomed.


Hi,

Running the patch here for Linksys USB adapter:

x41:fred ~> dmesg|grep url
url0 at uhub2 port 2 "Linksys Linksys USB LAN Adapter" rev 1.10/1.00 addr 2
url0: address 00:10:60:e9:42:87
urlphy0 at url0 phy 0: RTL internal phy

No regressions so far.

Thanks

Fred
--
PS dmesg follows:

OpenBSD 4.9-current (usbeth) #0: Sun Mar 20 11:08:54 GMT 2011
f...@x41.crowsons.com:/usr/src/sys/arch/i386/compile/usbeth
cpu0: Intel(R) Pentium(R) M processor 1.60GHz ("GenuineIntel" 686-class) 
1.60 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,TM,SBF,EST,TM2

real mem  = 1600548864 (1526MB)
avail mem = 1564225536 (1491MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 03/14/06, BIOS32 rev. 0 @ 0xfd750, 
SMBIOS rev. 2.33 @ 0xe0010 (59 entries)

bios0: vendor IBM version "74ET61WW (2.06 )" date 03/14/2006
bios0: IBM 2525FAG
apm0 at bios0: Power Management spec V1.2
apm0: battery life expectancy 100%
apm0: AC on, battery charge high
acpi at bios0 function 0x0 not configured
pcibios0 at bios0: rev 2.1 @ 0xfd6e0/0x920
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdec0/240 (13 entries)
pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82371FB ISA" rev 0x00)
pcibios0: PCI bus #5 is the last bus
bios0: ROM list: 0xc/0xe800! 0xce800/0x1600 0xd/0x1000 
0xdc000/0x4000! 0xe/0x1

cpu0 at mainbus0: (uniprocessor)
cpu0: Enhanced SpeedStep 1597 MHz: speeds: 1600, 1500, 1400, 1300, 1200, 
1100, 1000, 900, 800, 600 MHz

pci0 at mainbus0 bus 0: configuration mode 1 (bios)
mem address conflict 0x5f70/0x8
io address conflict 0x5800/0x8
io address conflict 0x5808/0x4
io address conflict 0x5810/0x8
io address conflict 0x580c/0x4
pchb0 at pci0 dev 0 function 0 "Intel 82915GM Host" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel 82915GM Video" rev 0x03
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xc000, size 0x1000
inteldrm0 at vga1: no ifp : irq 11
drm0 at inteldrm0
"Intel 82915GM Video" rev 0x03 at pci0 dev 2 function 1 not configured
ppb0 at pci0 dev 28 function 0 "Intel 82801FB PCIE" rev 0x03: irq 11
pci1 at ppb0 bus 2
bge0 at pci1 dev 0 function 0 "Broadcom BCM5751M" rev 0x11, BCM5750 B1 
(0x4101): irq 11, address 00:16:d3:2f:63:7c

brgphy0 at bge0 phy 1: BCM5750 10/100/1000baseT PHY, rev. 0
uhci0 at pci0 dev 29 function 0 "Intel 82801FB USB" rev 0x03: irq 11
uhci1 at pci0 dev 29 function 1 "Intel 82801FB USB" rev 0x03: irq 11
uhci2 at pci0 dev 29 function 2 "Intel 82801FB USB" rev 0x03: irq 11
uhci3 at pci0 dev 29 function 3 "Intel 82801FB USB" rev 0x03: irq 11
ehci0 at pci0 dev 29 function 7 "Intel 82801FB USB" rev 0x03: irq 11
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb1 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xd3
pci2 at ppb1 bus 4
cbb0 at pci2 dev 0 function 0 "Ricoh 5C476 CardBus" rev 0x8d: irq 11
sdhc0 at pci2 dev 0 function 1 "Ricoh 5C822 SD/MMC" rev 0x13: irq 11
sdmmc0 at sdhc0
iwi0 at pci2 dev 2 function 0 "Intel PRO/Wireless 2915ABG" rev 0x05: irq 
11, address 00:16:6f:c1:16:40

cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 5 device 0 cacheline 0x0, lattimer 0xb0
pcmcia0 at cardslot0
auich0 at pci0 dev 30 function 2 "Intel 82801FB AC97" rev 0x03: irq 11, 
ICH6 AC97

ac97: codec id 0x41445374 (Analog Devices AD1981B)
ac97: codec features headphone, 20 bit DAC, No 3D Stereo
audio0 at auich0
"Intel 82801FB Modem" rev 0x03 at pci0 dev 30 function 3 not configured
ichpcib0 at pci0 dev 31 function 0 "Intel 82801FBM LPC" rev 0x03: PM 
disabled
pciide0 at pci0 dev 31 function 2 "Intel 82801FBM SATA" rev 0x03: DMA, 
channel 0 wired to compatibility, channel 1 wired to compatibility

wd0 at pciide0 channel 0 drive 0: 
wd0: 16-sector PIO, LBA, 57231MB, 117210240 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0:  ATAPI 
5/cdrom removable

cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
ichiic0 at pci0 dev 31 function 3 "Intel 82801FB SMBus" rev 0x03: irq 11
iic0 at ichiic0
spdmem0 at iic0 addr 0x51: 1GB DDR2 SDRAM non-parity PC2-4200CL3 SO-DIMM
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00

Re: [patch] -H flag for grep.

2011-02-21 Thread Fred Crowson

On 02/21/11 15:54, Alexander Schrijver wrote:

On Mon, Feb 21, 2011 at 01:34:51PM +0100, Pascal Stumpf wrote:

Implement a -H flag for grep, useful for combining e.g. find and grep.


-o used to do this but has been removed. (See the commit logs for the reason, i
forgot it)

grep(1) only prints the filename when it receives more then 1 filename as
arguments. Thus, when you do this:

$ find . -name '*.c' -exec grep bla {} \;

It doesn't print the filename.

But when you use xargs(1), like Bret suggests it does.



$ find . -name "*.php" -exec grep blah {} \; -print

Will print the file name after the line that grep matches.

hth

Fred



missing function definition uvm_pmemrange.c

2010-07-16 Thread Fred Crowson

Hi tech@

While trying to build a debug ramdisk kernel - I came across a build 
error in uvm_pmemrange.c where the function uvm_pmr_isfree was not 
defined, I've added it to #ifdef not sure if this is the correct process 
or whether it needs its own #ifdef.


diff -ui follows.

Thanks

Fred

x41:fred /usr/src/sys/uvm> diff -ui uvm_pmemrange.c my_uvm_pmerange.c
--- uvm_pmemrange.c Fri Jul 16 20:34:42 2010
+++ my_uvm_pmerange.c   Fri Jul 16 12:36:59 2010
@@ -75,8 +75,10 @@
 intuvm_pmr_size_cmp(struct vm_page *, struct vm_page *);
 intuvm_pmr_pg_to_memtype(struct vm_page *);

-#ifdef DDB
+
+#if defined(DDB) || defined(DEBUG)
 void   uvm_pmr_print(void);
+intuvm_pmr_isfree(struct vm_page *pg);
 #endif

 /*



typos in #ifdef DEBUG

2010-07-13 Thread Fred Crowson

Hi tech@

While building a kernel with option DEBUG to try to hunt down my issue 
with the Libretto 70CT (PR 6052) I came across the following typos which 
prevented the build:


sys/arch/i386/i386/trap.c

--- trap.c  Wed Jul 14 00:55:31 2010
+++ mytrap.cWed Jul 14 00:44:26 2010
@@ -173,7 +173,7 @@
 #ifdef DEBUG
if (trapdebug) {
printf("trap %d code %x eip %x cs %x eflags %x cr2 %x 
cpl %x\n",

-   frame->tf_trapno, frame->tf_err, frame.->f_eip,
+   frame->tf_trapno, frame->tf_err, frame->tf_eip,
frame->tf_cs, frame->tf_eflags, rcr2(), lapic_tpr);
printf("curproc %p\n", curproc);
}

and in sys/kern/dma_alloc.c

--- dma_alloc.c Wed Jul 14 01:05:14 2010
+++ my_dma_alloc.c  Wed Jul 14 00:26:56 2010
@@ -49,7 +49,7 @@
if (sz <= (1 << (b + DMA_BUCKET_OFFSET)))
return (b);
 #ifdef DEBUG
-   printf("dma_alloc/free: object %d too large\n", sz)
+   printf("dma_alloc/free: object %d too large\n", sz);
 #endif
return (-1);
 }

Thanks

Fred