ifiq_input pressure drop too aggressive for msk interfaces

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ifiq_input pressure drop too aggressive for msk interfaces

Olivier Taïbi
On one of my machines equipped with two msk(4) gigabit ethernet devices,
the reintroduction (rev. 1.32) of counting backpressure in ifiq_input() in
sys/net/ifq.c causes drops when more than 8 ethernet frames arrive in a short
amount of time.  I noticed this because this machine is an NFS server, mounted
with the (client-side) option "-w 32768", but the drops are reproducible
(visible with netstat -I msk*) simply by sending to the machine a large (e.g.
17kB) UDP packet which gets fragmented into >8 IP packets.
Increasing net.link.ifrxq.pressure_drop (e.g. from the default value 8 to 40)
suppresses this problem, although I am not sure whether this is the correct
solution.

OpenBSD 6.5-current (GENERIC.MP) #21: Fri Jul 26 13:25:41 CEST 2019
    [hidden email]:/sys/arch/amd64/compile/GENERIC.MP
real mem = 4269277184 (4071MB)
avail mem = 4129763328 (3938MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xf0700 (81 entries)
bios0: vendor American Megatrends Inc. version "0404" date 01/28/2010
bios0: ASUSTeK Computer INC. P6TD DELUXE
acpi0 at bios0: ACPI 3.0
acpi0: sleep states S0 S1 S3 S4 S5
acpi0: tables DSDT FACP APIC MCFG OEMB HPET OSFR SSDT
acpi0: wakeup devices NPE2(S4) NPE4(S4) NPE5(S4) NPE6(S4) NPE8(S4) NPE9(S4) NPEA(S4) P0P1(S4) USB0(S4) USB1(S4) USB2(S4) USB5(S4) EUSB(S4) USB3(S4) USB4(S4) USB6(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz, 3207.67 MHz, 06-1a-04
cpu0: FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,MELTDOWN
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 133MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz, 2674.42 MHz, 06-1a-04
cpu1: FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,MELTDOWN
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz, 2672.74 MHz, 06-1a-04
cpu2: FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,MELTDOWN
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz, 2672.74 MHz, 06-1a-04
cpu3: FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,MELTDOWN
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 0, core 3, package 0
cpu4 at mainbus0: apid 1 (application processor)
cpu4: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz, 2672.73 MHz, 06-1a-04
cpu4: FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,MELTDOWN
cpu4: 256KB 64b/line 8-way L2 cache
cpu4: smt 1, core 0, package 0
cpu5 at mainbus0: apid 3 (application processor)
cpu5: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz, 2672.73 MHz, 06-1a-04
cpu5: FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,MELTDOWN
cpu5: 256KB 64b/line 8-way L2 cache
cpu5: smt 1, core 1, package 0
cpu6 at mainbus0: apid 5 (application processor)
cpu6: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz, 2672.73 MHz, 06-1a-04
cpu6: FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,MELTDOWN
cpu6: 256KB 64b/line 8-way L2 cache
cpu6: smt 1, core 2, package 0
cpu7 at mainbus0: apid 7 (application processor)
cpu7: Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz, 2672.73 MHz, 06-1a-04
cpu7: FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,SENSOR,MELTDOWN
cpu7: 256KB 64b/line 8-way L2 cache
cpu7: smt 1, core 3, package 0
ioapic0 at mainbus0: apid 8 pa 0xfec00000, version 20, 24 pins
ioapic1 at mainbus0: apid 9 pa 0xfec8a000, version 20, 24 pins
acpimcfg0 at acpi0
acpimcfg0: addr 0xe0000000, bus 0-255
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (NPE2)
acpiprt2 at acpi0: bus -1 (NPE4)
acpiprt3 at acpi0: bus -1 (NPE5)
acpiprt4 at acpi0: bus -1 (NPE6)
acpiprt5 at acpi0: bus -1 (NPE8)
acpiprt6 at acpi0: bus -1 (NPE9)
acpiprt7 at acpi0: bus -1 (NPEA)
acpiprt8 at acpi0: bus 8 (P0P1)
acpiprt9 at acpi0: bus 7 (P0P4)
acpiprt10 at acpi0: bus -1 (P0P5)
acpiprt11 at acpi0: bus 6 (P0P6)
acpiprt12 at acpi0: bus -1 (P0P7)
acpiprt13 at acpi0: bus 5 (P0P8)
acpiprt14 at acpi0: bus 4 (P0P9)
acpiprt15 at acpi0: bus 1 (NPE1)
acpiprt16 at acpi0: bus 2 (NPE3)
acpiprt17 at acpi0: bus 3 (NPE7)
acpicpu0 at acpi0: C1(@1 halt!), PSS
acpicpu1 at acpi0: C1(@1 halt!), PSS
acpicpu2 at acpi0: C1(@1 halt!), PSS
acpicpu3 at acpi0: C1(@1 halt!), PSS
acpicpu4 at acpi0: C1(@1 halt!), PSS
acpicpu5 at acpi0: C1(@1 halt!), PSS
acpicpu6 at acpi0: C1(@1 halt!), PSS
acpicpu7 at acpi0: C1(@1 halt!), PSS
acpipci0 at acpi0 PCI0: _OSC failed
acpicmos0 at acpi0
aibs0 at acpi0 RTMP RVLT RFAN GGRP GITM SITM
"pnp0c14" at acpi0 not configured
acpibtn0 at acpi0: PWRB
cpu0: using IvyBridge MDS workaround
cpu0: Enhanced SpeedStep 3207 MHz: speeds: 2668, 2667, 2533, 2400, 2267, 2133, 2000, 1867, 1733, 1600 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel X58 Host" rev 0x13
ppb0 at pci0 dev 1 function 0 "Intel X58 PCIE" rev 0x13: msi
pci1 at ppb0 bus 1
ppb1 at pci0 dev 3 function 0 "Intel X58 PCIE" rev 0x13: msi
pci2 at ppb1 bus 2
radeondrm0 at pci2 dev 0 function 0 "ATI Radeon HD 5670" rev 0x00
drm0 at radeondrm0
radeondrm0: msi
azalia0 at pci2 dev 0 function 1 "ATI Radeon HD 5600 Audio" rev 0x00: msi
azalia0: no supported codecs
ppb2 at pci0 dev 7 function 0 "Intel X58 PCIE" rev 0x13: msi
pci3 at ppb2 bus 3
"Intel X58 Misc" rev 0x13 at pci0 dev 20 function 0 not configured
"Intel X58 GPIO" rev 0x13 at pci0 dev 20 function 1 not configured
"Intel X58 RAS" rev 0x13 at pci0 dev 20 function 2 not configured
"Intel X58 Throttle" rev 0x13 at pci0 dev 20 function 3 not configured
uhci0 at pci0 dev 26 function 0 "Intel 82801JI USB" rev 0x00: apic 8 int 16
uhci1 at pci0 dev 26 function 1 "Intel 82801JI USB" rev 0x00: apic 8 int 21
uhci2 at pci0 dev 26 function 2 "Intel 82801JI USB" rev 0x00: apic 8 int 19
ehci0 at pci0 dev 26 function 7 "Intel 82801JI USB" rev 0x00: apic 8 int 18
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia1 at pci0 dev 27 function 0 "Intel 82801JI HD Audio" rev 0x00: msi
azalia1: codecs: Analog Devices AD1989B
audio0 at azalia1
ppb3 at pci0 dev 28 function 0 "Intel 82801JI PCIE" rev 0x00: msi
pci4 at ppb3 bus 7
ppb4 at pci0 dev 28 function 2 "Intel 82801JI PCIE" rev 0x00: msi
pci5 at ppb4 bus 6
mskc0 at pci5 dev 0 function 0 "Marvell Yukon 88E8056" rev 0x12, Yukon-2 EC Ultra rev. B0 (0x3): msi
msk0 at mskc0 port A: address 00:26:18:9f:4b:a4
eephy0 at msk0 phy 0: 88E1149 Gigabit PHY, rev. 1
ppb5 at pci0 dev 28 function 4 "Intel 82801JI PCIE" rev 0x00: msi
pci6 at ppb5 bus 5
pciide0 at pci6 dev 0 function 0 "Marvell 88SE6121 SATA" rev 0xb2: DMA (unsupported), channel 0 configured to native-PCI, channel 1 configured to native-PCI
pciide0: using apic 8 int 16 for native-PCI interrupt
pciide0: channel 0 ignored (not responding; disabled or no drives?)
pciide0: channel 1 ignored (not responding; disabled or no drives?)
ppb6 at pci0 dev 28 function 5 "Intel 82801JI PCIE" rev 0x00: msi
pci7 at ppb6 bus 4
mskc1 at pci7 dev 0 function 0 "Marvell Yukon 88E8056" rev 0x12, Yukon-2 EC Ultra rev. B0 (0x3): msi
msk1 at mskc1 port A: address 00:26:18:9f:4b:a3
eephy1 at msk1 phy 0: 88E1149 Gigabit PHY, rev. 1
uhci3 at pci0 dev 29 function 0 "Intel 82801JI USB" rev 0x00: apic 8 int 23
uhci4 at pci0 dev 29 function 1 "Intel 82801JI USB" rev 0x00: apic 8 int 19
uhci5 at pci0 dev 29 function 2 "Intel 82801JI USB" rev 0x00: apic 8 int 18
ehci1 at pci0 dev 29 function 7 "Intel 82801JI USB" rev 0x00: apic 8 int 23
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb7 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0x90
pci8 at ppb7 bus 8
"VIA VT6306 FireWire" rev 0xc0 at pci8 dev 2 function 0 not configured
pcib0 at pci0 dev 31 function 0 "Intel 82801JIR LPC" rev 0x00
ahci0 at pci0 dev 31 function 2 "Intel 82801JI AHCI" rev 0x00: msi, AHCI 1.2
ahci0: port 0: 3.0Gb/s
ahci0: port 4: 3.0Gb/s
ahci0: port 5: 3.0Gb/s
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <ATA, CT120BX500SSD1, M6C> SCSI3 0/direct fixed naa.0000000000000000
sd0: 114473MB, 512 bytes/sector, 234441648 sectors, thin
sd1 at scsibus1 targ 4 lun 0: <ATA, HGST HTS725050A7, GH2Z> SCSI3 0/direct fixed naa.5000cca7c5c227fa
sd1: 476940MB, 512 bytes/sector, 976773168 sectors
sd2 at scsibus1 targ 5 lun 0: <ATA, Hitachi HDP72505, GM4O> SCSI3 0/direct fixed naa.5000cca359c3f5b0
sd2: 476940MB, 512 bytes/sector, 976773168 sectors
ichiic0 at pci0 dev 31 function 3 "Intel 82801JI SMBus" rev 0x00: apic 8 int 18
iic0 at ichiic0
iic0: addr 0x1e 01=01 02=01 11=01 12=01 21=01 22=01 31=01 32=01 words 00=0001 01=0101 02=0100 03=0000 04=0000 05=0000 06=0000 07=0000
iic0: addr 0x20 01=80 02=17 03=7f 10=00 19=b0 20=20 21=00 25=20 26=b2 38=74 39=03 4a=99 6a=2c 78=02 79=08 7a=00 7b=00 7e=82 80=20 8b=47 8c=3d 96=99 99=41 9a=98 9b=01 d0=00 d1=03 d2=72 d3=72 d4=03 d5=02 d6=01 d7=56 d8=22 d9=00 da=00 db=00 dc=00 dd=00 de=00 df=10 e0=00 e1=00 e2=10 e3=0c e4=10 e5=10 e6=17 e7=10 e8=10 e9=10 ea=10 ec=07 ee=00 ef=00 f1=24 f5=01 f6=02 f9=cd fa=c0 fb=50 words 00=ffff 01=8037 02=1766 03=7fff 04=ffff 05=ffff 06=ffff 07=ffff
spdmem0 at iic0 addr 0x50: 2GB DDR3 SDRAM PC3-10600
spdmem1 at iic0 addr 0x52: 2GB DDR3 SDRAM PC3-10600
spdmem2 at iic0 addr 0x54: 2GB DDR3 SDRAM PC3-10600
usb2 at uhci0: USB revision 1.0
uhub2 at usb2 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci1: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci2: USB revision 1.0
uhub4 at usb4 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb5 at uhci3: USB revision 1.0
uhub5 at usb5 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb6 at uhci4: USB revision 1.0
uhub6 at usb6 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb7 at uhci5: USB revision 1.0
uhub7 at usb7 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
lm0 at isa0 port 0x290/8: W83627DHG
vmm0 at mainbus0: VMX/EPT (using slow L1TF mitigation)
uhub8 at uhub0 port 5 configuration 1 interface 0 "NEC hub" rev 2.00/1.00 addr 2
uhidev0 at uhub6 port 1 configuration 1 interface 0 "Holtek USB Keyboard" rev 1.10/1.05 addr 2
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd1 at ukbd0 mux 1
uhidev1 at uhub6 port 1 configuration 1 interface 1 "Holtek USB Keyboard" rev 1.10/1.05 addr 2
uhidev1: iclass 3/1, 2 report ids
uhid0 at uhidev1 reportid 1: input=6, output=0, feature=0
uhid1 at uhidev1 reportid 2: input=1, output=0, feature=0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
sd3 at scsibus3 targ 1 lun 0: <OPENBSD, SR RAID 1, 006> SCSI2 0/direct fixed
sd3: 476937MB, 512 bytes/sector, 976767473 sectors
root on sd0a (e91ba70896bdefb7.a) swap on sd0b dump on sd0b
initializing kernel modesetting (REDWOOD 0x1002:0x68D8 0x174B:0xE166 0x00).
radeondrm0: 1920x1200, 32bpp
wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0
wskbd1: connecting to wsdisplay0
wsdisplay0: screen 1-5 added (std, vt100 emulation)

Reply | Threaded
Open this post in threaded view
|

Re: ifiq_input pressure drop too aggressive for msk interfaces

David Gwynne-5
On Mon, Jul 29, 2019 at 12:22:28AM +0200, Olivier Ta??bi wrote:

> On one of my machines equipped with two msk(4) gigabit ethernet devices,
> the reintroduction (rev. 1.32) of counting backpressure in ifiq_input() in
> sys/net/ifq.c causes drops when more than 8 ethernet frames arrive in a short
> amount of time.  I noticed this because this machine is an NFS server, mounted
> with the (client-side) option "-w 32768", but the drops are reproducible
> (visible with netstat -I msk*) simply by sending to the machine a large (e.g.
> 17kB) UDP packet which gets fragmented into >8 IP packets.
> Increasing net.link.ifrxq.pressure_drop (e.g. from the default value 8 to 40)
> suppresses this problem, although I am not sure whether this is the correct
> solution.

i think i see the more fundamental problem. the diff below should fix it
so you don't need to tune the ifrxq pressure levels.

this basically tweaks msk so it enqueues packets for the stack once per
interrupt, rather than once per rx completion event. this helps when you
rx multiple packets per interrupt like you are when a packet gets
fragmented. while here it uses ifiq_input so it can apply earlier
backpressure.

i'll commit this soon, so hopefully it will be in the tree for you to
test.

Index: if_msk.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_msk.c,v
retrieving revision 1.131
diff -u -p -r1.131 if_msk.c
--- if_msk.c 6 Jan 2018 03:11:04 -0000 1.131
+++ if_msk.c 30 Jul 2019 03:59:11 -0000
@@ -134,7 +134,7 @@ int mskcprint(void *, const char *);
 int msk_intr(void *);
 void msk_intr_yukon(struct sk_if_softc *);
 static inline int msk_rxvalid(struct sk_softc *, u_int32_t, u_int32_t);
-void msk_rxeof(struct sk_if_softc *, uint16_t, uint32_t);
+void msk_rxeof(struct sk_if_softc *, struct mbuf_list *, uint16_t, uint32_t);
 void msk_txeof(struct sk_if_softc *);
 static unsigned int msk_encap(struct sk_if_softc *, struct mbuf *, uint32_t);
 void msk_start(struct ifnet *);
@@ -1591,11 +1591,11 @@ msk_rxvalid(struct sk_softc *sc, u_int32
 }
 
 void
-msk_rxeof(struct sk_if_softc *sc_if, uint16_t len, uint32_t rxstat)
+msk_rxeof(struct sk_if_softc *sc_if, struct mbuf_list *ml,
+    uint16_t len, uint32_t rxstat)
 {
  struct sk_softc *sc = sc_if->sk_softc;
  struct ifnet *ifp = &sc_if->arpcom.ac_if;
- struct mbuf_list ml = MBUF_LIST_INITIALIZER();
  struct mbuf *m = NULL;
  int prod, cons, tail;
  bus_dmamap_t map;
@@ -1640,8 +1640,7 @@ msk_rxeof(struct sk_if_softc *sc_if, uin
 
  m->m_pkthdr.len = m->m_len = len;
 
- ml_enqueue(&ml, m);
- if_input(ifp, &ml);
+ ml_enqueue(ml, m);
 }
 
 void
@@ -1770,8 +1769,12 @@ msk_intr(void *xsc)
  struct sk_if_softc *sc_if;
  struct sk_if_softc *sc_if0 = sc->sk_if[SK_PORT_A];
  struct sk_if_softc *sc_if1 = sc->sk_if[SK_PORT_B];
+ struct mbuf_list ml[2] = {
+ MBUF_LIST_INITIALIZER(),
+ MBUF_LIST_INITIALIZER(),
+ };
  struct ifnet *ifp0 = NULL, *ifp1 = NULL;
- int claimed = 0, rx[2] = {0, 0};
+ int claimed = 0;
  u_int32_t status;
  struct msk_status_desc *cur_st;
 
@@ -1809,8 +1812,8 @@ msk_intr(void *xsc)
  switch (cur_st->sk_opcode) {
  case SK_Y2_STOPC_RXSTAT:
  sc_if = sc->sk_if[cur_st->sk_link & 0x01];
- rx[cur_st->sk_link & 0x01] = 1;
- msk_rxeof(sc_if, lemtoh16(&cur_st->sk_len),
+ msk_rxeof(sc_if, &ml[cur_st->sk_link & 0x01],
+    lemtoh16(&cur_st->sk_len),
     lemtoh32(&cur_st->sk_status));
  break;
  case SK_Y2_STOPC_TXSTAT:
@@ -1837,12 +1840,16 @@ msk_intr(void *xsc)
 
  CSR_WRITE_4(sc, SK_Y2_ICR, 2);
 
- if (rx[0]) {
+ if (!ml_empty(&ml[0])) {
+ if (ifiq_input(&ifp0->if_rcv, &ml[0]))
+ if_rxr_livelocked(&sc_if0->sk_cdata.sk_rx_ring);
  msk_fill_rx_ring(sc_if0);
  SK_IF_WRITE_2(sc_if0, 0, SK_RXQ1_Y2_PREF_PUTIDX,
     sc_if0->sk_cdata.sk_rx_prod);
  }
- if (rx[1]) {
+ if (!ml_empty(&ml[1])) {
+ if (ifiq_input(&ifp1->if_rcv, &ml[1]))
+ if_rxr_livelocked(&sc_if1->sk_cdata.sk_rx_ring);
  msk_fill_rx_ring(sc_if1);
  SK_IF_WRITE_2(sc_if1, 0, SK_RXQ1_Y2_PREF_PUTIDX,
     sc_if1->sk_cdata.sk_rx_prod);