hello,

until 15 minutes ago I had a nasty ethernet behaviour on my laptop,
i.e watchdog timeout forever and ever in tx (rx seems ok for what I can see)
I decided to dig into the source and I've enabled a little bit of
degugging messages.

mskc0 at pci1 dev 0 function 0 "Marvell Yukon 88E8036" rev 0x13
begin mskc_attach
mskc_attach: allocate interrupt
mskc_reset
mskc_reset: sk_csr=4a
mskc_reset: sk_link_ctrl=2
mskc_attach: ramsize=4096 (4k), rboff=0
, Yukon-2 FE (0x1): apic 2 int 16 (irq 7)
msk0 at mskc0 port A
begin msk_attach: port=0, address 00:13:a9:60:1b:eb
msk_attach: rx_ramstart=0 rx_ramend=0x154
           tx_ramstart=0x155 tx_ramend=0x1fe

first thing I've noted is the rx and tx buffer dimension calculation

rx -> 0x154
tx -> 0xa9

w/o thinking twice with a priory knowledge of ramsize i.e 4k
I've modified the algorithm as follow:

chunk = sc->sk_ramsize  - (sc->sk_ramsize>>1);
val = sc->sk_rboff / sizeof(u_int64_t);
sc_if->sk_rx_ramstart = val;
val += (chunk / sizeof(u_int64_t));
sc_if->sk_rx_ramend = val - 1;
chunk = sc->sk_ramsize - chunk;
sc_if->sk_tx_ramstart = val;
val += (chunk / sizeof(u_int64_t));
sc_if->sk_tx_ramend = val - 1;

compiled and restarted:

mskc0 at pci1 dev 0 function 0 "Marvell Yukon 88E8036" rev 0x13
begin mskc_attach
mskc_attach: allocate interrupt
mskc_reset
mskc_reset: sk_csr=4a
mskc_reset: sk_link_ctrl=2
mskc_attach: ramsize=4096 (4k), rboff=0
, Yukon-2 FE (0x1): apic 2 int 16 (irq 7)
msk0 at mskc0 port A
begin msk_attach: port=0, address 00:13:a9:60:1b:eb
msk_attach: rx_ramstart=0 rx_ramend=0xff
           tx_ramstart=0x100 tx_ramend=0x1ff

now both rx and tx buffer has the same size

result: msk works like a charm with no more watchdog timeouts

hope in a answer,

thanks,

OpenBSD 4.1-current (GENERIC.MP) #5: Fri May 11 22:34:35 CEST 2007
   [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz ("GenuineIntel" 686-class) 1.67 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,EST,TM2,CX16,xTPR
real mem  = 1063415808 (1038492K)
avail mem = 963076096 (940504K)
using 4278 buffers containing 53293056 bytes (52044K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+ BIOS, date 11/15/06, BIOS32 rev. 0 @
0xfd5f0, SMBIOS rev. 2.4 @ 0xdc010 (18 entries)
bios0: Sony Corporation VGN-C1S_H
pcibios0 at bios0: rev 2.1 @ 0xfd5f0/0xa10
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdec0/288 (16 entries)
pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82371FB ISA" rev 0x00)
pcibios0: PCI bus #6 is the last bus
bios0: ROM list: 0xc0000/0x10000! 0xdc000/0x4000! 0xe0000/0x1800!
acpi0 at mainbus0: rev 0
acpi0: tables DSDT FACP APIC MCFG APIC BOOT SSDT SSDT
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 166 MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 CPU T5500 @ 1.66GHz ("GenuineIntel" 686-class) 1.67 GHz
cpu1: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,EST,TM2,CX16,xTPR
ioapic0 at mainbus0: apid 1 pa 0xfec00000, version 20, 24 pins
ioapic0: duplicate apic id, remapped to apid 2
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 0 (PEGP)
acpiprt2 at acpi0: bus 1 (RP01)
acpiprt3 at acpi0: bus 2 (RP02)
acpiprt4 at acpi0: bus 3 (RP03)
acpiprt5 at acpi0: bus 4 (RP04)
acpiprt6 at acpi0: bus 5 (PCIB)
acpiec0 at acpi0: EC__
acpicpu0 at acpi0: CPU0:
acpicpu1 at acpi0: CPU1:
acpitz0 at acpi0, critical temperature: 105 degC
acpitz1 at acpi0, critical temperature: 105 degC
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT0: not present
acpibtn0 at acpi0: LID0
acpibtn1 at acpi0: PWRB
acpidock0 at acpi0: DOCK: not docked (0)
cpu0: unknown Enhanced SpeedStep CPU, msr 0x06130a2a06000a2a
cpu0: using only highest and lowest power states
cpu0: Enhanced SpeedStep 1667 MHz (1372 mV): speeds: 1667, 1000 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel 82945GM MCH" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel 82945GM Video" rev 0x03: aperture
at 0xd0100000, size 0x10000000
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
"Intel 82945GM Video" rev 0x03 at pci0 dev 2 function 1 not configured
azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x02:
apic 2 int 22 (irq 4)
azalia0: host: High Definition Audio rev. 1.0
azalia0: codec: 0x10ec/0x0262 (rev. 1.0), HDA version 1.0
azalia0: codec: 0x14f1/0x2c06 (rev. 0.0), HDA version 1.0
azalia0: codec[1]: No support for modem function groups
azalia0: codec[1]: No audio function groups
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02
pci1 at ppb0 bus 1
mskc0 at pci1 dev 0 function 0 "Marvell Yukon 88E8036" rev 0x13begin mskc_attach
mskc_attach: allocate interrupt
mskc_reset
mskc_reset: sk_csr=4a
mskc_reset: sk_link_ctrl=2
mskc_attach: ramsize=4096 (4k), rboff=0
, Yukon-2 FE (0x1): apic 2 int 16 (irq 7)
msk0 at mskc0 port Abegin msk_attach: port=0
, address 00:13:a9:60:1b:eb
msk_attach: rx_ramstart=0 rx_ramend=0xff
          tx_ramstart=0x100 tx_ramend=0x1ff
msk_jumbo_buf = 0xE9284000
msk_init_yukon: start: sk_csr=0xa603154a
msk_init_yukon: 1
msk_init_yukon: gmac_ctrl=0x5a
msk_init_yukon: 3
msk_init_yukon: 4
msk_init_yukon: 4a
msk_init_yukon: YUKON_PAR=0
msk_init_yukon: YUKON_PAR=0x20
msk_init_yukon: 4b
msk_init_yukon: 5
msk_init_yukon: 7
msk_init_yukon: 8
msk_init_yukon: 9
msk_init_yukon: 10
msk_init_yukon: 11
msk_init_yukon: 12
msk_init_yukon: end
msk_attach: 1
eephy0 at msk0 phy 0: Marvell 88E3082 10/100 PHY, rev. 3
ukphy0 at msk0 phy 3: Generic IEEE 802.3u media interface, rev. 0: OUI
0x121012, model 0x0004
ukphy0: no media present
ukphy1 at msk0 phy 6: Generic IEEE 802.3u media interface, rev. 0: OUI
0x004c00, model 0x0013
ukphy1: no media present
msk_attach: end
ppb1 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02
pci2 at ppb1 bus 2
ppb2 at pci0 dev 28 function 2 "Intel 82801GB PCIE" rev 0x02
pci3 at ppb2 bus 3
wpi0 at pci3 dev 0 function 0 "Intel PRO/Wireless 3945ABG" rev 0x02:
apic 2 int 18 (irq 11), address 00:18:de:ad:3e:96
ppb3 at pci0 dev 28 function 3 "Intel 82801GB PCIE" rev 0x02
pci4 at ppb3 bus 4
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x02: apic 2
int 23 (irq 5)
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x02: apic 2
int 17 (irq 3)
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x02: apic 2
int 18 (irq 11)
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x02: apic 2
int 16 (irq 7)
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x02: apic 2
int 23 (irq 5)
ehci0: timed out waiting for BIOS
usb0 at ehci0: USB revision 2.0
uhub0 at usb0
uhub0: Intel EHCI root hub, rev 2.00/1.00, addr 1
uhub0: 8 ports with 8 removable, self powered
ppb4 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe2
pci5 at ppb4 bus 5
cbb0 at pci5 dev 3 function 0 "TI PCIXX12 CardBus" rev 0x00: apic 2
int 16 (irq 255)
vendor "TI", unknown product 0x803a (class serial bus subclass
Firewire, rev 0x00) at pci5 dev 3 function 1 not configured
"TI PCIXX12 Multimedia Card Reader" rev 0x00 at pci5 dev 3 function 2
not configured
cbb0: bad Vcc request. sock_ctrl 0xffffff88, sock_status 0xffffffff
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 6 device 0 cacheline 0x10, lattimer 0x20
pcmcia0 at cardslot0
ichpcib0 at pci0 dev 31 function 0 "Intel 82801GBM LPC" rev 0x02: PM disabled
pciide0 at pci0 dev 31 function 1 "Intel 82801GB IDE" rev 0x02: DMA,
channel 0 configured to compatibility, channel 1 configured to
compatibility
atapiscsi0 at pciide0 channel 0 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <PIONEER, DVD-RW DVR-K16M, 1.10> SCSI0
5/cdrom removable
cd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
pciide0: channel 1 ignored (disabled)
pciide1 at pci0 dev 31 function 2 "Intel 82801GBM SATA" rev 0x02: DMA,
channel 0 configured to native-PCI, channel 1 configured to native-PCI
pciide1: using apic 2 int 19 (irq 10) for native-PCI interrupt
wd0 at pciide1 channel 0 drive 0: <HTS541010G9SA00>
wd0: 16-sector PIO, LBA48, 95396MB, 195371568 sectors
wd0(pciide1:0:0): using PIO mode 4, Ultra-DMA mode 5
ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x02: apic
2 int 19 (irq 10)
iic0 at ichiic0
usb1 at uhci0: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
usb2 at uhci1: USB revision 1.0
uhub2 at usb2
uhub2: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
usb3 at uhci2: USB revision 1.0
uhub3 at usb3
uhub3: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
usb4 at uhci3: USB revision 1.0
uhub4 at usb4
uhub4: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub4: 2 ports with 2 removable, self powered
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
pctr: 686-class user-level performance counters enabled
mtrr: Pentium Pro MTRR support
uhidev0 at uhub1 port 1 configuration 1 interface 0
uhidev0: Logitech USB RECEIVER, rev 1.10/25.10, addr 2, iclass 3/1
ums0 at uhidev0: 16 buttons and Z dir.
wsmouse1 at ums0 mux 0
dkcsum: wd0 matches BIOS drive 0x80
root on wd0a swap on wd0b dump on wd0b
rootdev=0x0 rrootdev=0x300 rawdev=0x302
msk_init
msk_stop
msk_init_yukon: start: sk_csr=0xa603154a
msk_init_yukon: 1
msk_init_yukon: gmac_ctrl=0x5a
msk_init_yukon: 3
msk_init_yukon: 4
msk_init_yukon: 4a
msk_init_yukon: YUKON_PAR=0
msk_init_yukon: YUKON_PAR=0x20
msk_init_yukon: 4b
msk_init_yukon: 5
msk_init_yukon: 7
msk_init_yukon: 8
msk_init_yukon: 9
msk_init_yukon: 10
msk_init_yukon: 11
msk_init_yukon: 12
msk_init_yukon: end
msk_start
msk_encap
msk_encap: dm_nsegs=1
msk_encap: completed successfully
msk_txeof
msk_start
msk_encap
msk_encap: dm_nsegs=1
msk_encap: completed successfully
msk_txeof

--
giovanni

Reply via email to