em(4)/82571eb: fifo not dma'ed to host memory

Jack Vogel jfvogel at gmail.com
Tue Jul 17 16:17:42 UTC 2007


As an experiment, search in if_em.c for 'msix' look at the logic there.
If the adapter is 82575 it will use msix, but the else clause has it
use msi ONLY if its '>82571', change that to >=82571 and let's
see if maybe using MSI will help you with your problems as I'm
pretty confident its interrupt related.

I had intended on making this change shortly anyway, my tests
have shown the 571 to work fine this way.

Let me know of the results.

Jack


On 7/17/07, Patrick Oeschger <paketix at bluewin.ch> wrote:
> bug description for 7.0-CURRENT - em(4) driver version 6.5.3
> - frame reception is not possible (missed packets counter incrementing)
> - frame transmission is not possible (driver watchdog fires)
> bug exists also on 6.2-RELENG - em(4) driver version 6.2.9
> bug does *not* exist on 6.1-RELENG - em(4) driver version 3.2.18
>
> jack vogel told me that the i82571 can be tricky when having a bunch
> of them - i have 8 such interfaces on the motherboard so i disabled
> 7 of them with a modified em_probe (if_em.c)
> running the driver on just one interface does not change the behaviour
>
> - init of the interface during verbose boot looks fine
> - bringing the interface to upness looks fine too
> - RDH0/RDT0 registers do *not* increment after frame reception
> - frames suspected *not* getting dma'ed from fifo to host memory
> - RX interrupt suspected *not* being sent to the driver
>
> see dmesg and debug ouput for futher details...
> anybody having some experience with this issue?
> any advice to track this further down?
> thanks, pat
>
>
> diff for em_probe subr to ensure that only one interface is init'ed:
>
>   freebsd70# diff -u if_em.c.orig if_em.c
>   --- if_em.c.orig        Tue Jul 17 11:18:18 2007
>   +++ if_em.c     Tue Jul 17 06:34:48 2007
>   @@ -379,6 +379,10 @@
>
>           INIT_DEBUGOUT("em_probe: begin");
>
>   +       // prevent init of all em(4) devices except pci9/0/0
>   +       if(pci_get_bus(dev) != 0x09 || pci_get_slot(dev) != 0x00 ||
>   +          pci_get_function(dev) != 0x00)
>   +               return (ENXIO);
>   +
>           pci_vendor_id = pci_get_vendor(dev);
>           if (pci_vendor_id != EM_VENDOR_ID)
>                   return (ENXIO);
>
> excerpt of verbose dmesg looks fine for em0:
>
>   pcib9: <PCI-PCI bridge> irq 19 at device 11.0 on pci2
>   pcib9:   secondary bus     9
>   pcib9:   subordinate bus   9
>   pcib9:   I/O decode        0x6000-0x6fff
>   pcib9:   memory decode     0xfd700000-0xfd7fffff
>   pcib9:   prefetched decode 0xfce00000-0xfcefffff
>   pci9: <PCI bus> on pcib9
>   pci9: physical bus=9
>   found-> vendor=0x8086, dev=0x105e, revid=0x06
>           bus=9, slot=0, func=0
>           class=02-00-00, hdrtype=0x00, mfdev=1
>           cmdreg=0x0000, statreg=0x0010, cachelnsz=16 (dwords)
>           lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
>           intpin=a, irq=255
>           powerspec 2  supports D0 D3  current D0
>           MSI supports 1 message, 64 bit
>           map[10]: type Memory, range 32, base 0, size 17, memory disabled
>           map[14]: type Memory, range 32, base 0, size 17, memory disabled
>           map[18]: type I/O Port, range 32, base 0, size  5, port disabled
>   found-> vendor=0x8086, dev=0x105e, revid=0x06
>           bus=9, slot=0, func=1
>           class=02-00-00, hdrtype=0x00, mfdev=1
>           cmdreg=0x0000, statreg=0x0010, cachelnsz=16 (dwords)
>           lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
>           intpin=b, irq=255
>           powerspec 2  supports D0 D3  current D0
>           MSI supports 1 message, 64 bit
>           map[10]: type Memory, range 32, base 0, size 17, memory disabled
>           map[14]: type Memory, range 32, base 0, size 17, memory disabled
>           map[18]: type I/O Port, range 32, base 0, size  5, port disabled
>   em0: <Intel(R) PRO/1000 Network Connection Version - 6.5.3>
>     at device 0.0 on pci9
>   pcib9: em0 requested memory range 0xfd700000-0xfd7fffff: good
>   pcib2: em0 requested memory range 0xfd700000-0xfd7fffff: good
>   pcib1: em0 requested memory range 0xfd700000-0xfd7fffff: good
>   em0: Lazy allocation of 0x20000 bytes rid 0x10 type 3 at 0xfd700000
>   pcib1: matched entry for 1.0.INTD
>   pcib1: slot 0 INTD hardwired to IRQ 19
>   pcib2: slot 11 INTA is routed to irq 19
>   pcib9: slot 0 INTA is routed to irq 19
>   em0: bpf attached
>   em0: Ethernet address: 00:10:f3:0c:5b:2a
>   ioapic0: routing intpin 19 (PCI IRQ 19) to vector 49
>   em0: [FILTER]
>   pci9: <network, ethernet> at device 0.1 (no driver attached)
>
> bringing em0 to upness seems to work fine:
> printf's inserted into subroutines em_handle_link and em_rxeof (if_em.c)
>
>   freebsd70# ifconfig em0 up
>   em0: Link is Down
>   em_handle_link
>   em_rxeof
>   em_handle_link
>   em_rxeof
>   em0: Link is up 1000 Mbps Full Duplex
>   freebsd70# ifconfig em0
>   em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0
>        mtu 1500
>           options=18b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWCSUM,TSO4>
>           ether 00:10:f3:0c:5b:2a
>           media: Ethernet autoselect (1000baseTX <full-duplex>)
>           status: active
>
> interface stats:
> good packets increment but no em_rxeof/interrupts generated
> fifo is full after 85 received frames
> memory and missed packets are incrementing because they cant be
> stored in fifo (fifo exhausted)
>
>   freebsd70# sysctl dev.em.0.stats=1
>   em0: Excessive collisions = 0
>   em0: Sequence errors = 0
>   em0: Defer count = 0
>   em0: Missed Packets = 144
>   em0: Receive No Buffers = 0
>   em0: Receive Length Errors = 0
>   em0: Receive errors = 0
>   em0: Crc errors = 0
>   em0: Alignment errors = 0
>   em0: Carrier extension errors = 0
>   em0: RX overruns = 0
>   em0: watchdog timeouts = 0
>   em0: XON Rcvd = 0
>   em0: XON Xmtd = 0
>   em0: XOFF Rcvd = 0
>   em0: XOFF Xmtd = 0
>   em0: Good Packets Rcvd = 85
>   em0: Good Packets Xmtd = 0
>   em0: TSO Contexts Xmtd = 0
>   em0: TSO Contexts Failed = 0
>
> interface debug_info:
> output for registers RDBAH0/RDBAL0/RDLEN0/RDH0/RDT0/RXDCTL added
> RDH0/RDT0 do not increment after frame reception...
> cp. 6.1-RELENG: RDH0/RDT0 incremented after frame reception
>                 RDT0 is always 'RDH0 - 1'
>
>   freebsd70# sysctl dev.em.0.debug_info=1
>   em0: Adapter hardware address = 0xc3b69a1c
>   em0: CTRL = 0x81c0241 RCTL = 0x8002
>   em0: RDBAH0 = 0x0 RDBAL0 = 0x1458000
>   em0: RDLEN0 = 0x1000 RDH0 = 0x0
>   em0: RDT0 = 0xff RXDCTL = 0x10000
>   em0: Packet buffer = Tx=16k Rx=32k
>   em0: Flow control watermarks high = 30720 low = 29220
>   em0: tx_int_delay = 66, tx_abs_int_delay = 66
>   em0: rx_int_delay = 0, rx_abs_int_delay = 66
>   em0: fifo workaround = 0, fifo_reset_count = 0
>   em0: hw tdh = 0, hw tdt = 0
>   em0: hw rdh = 0, hw rdt = 255
>   em0: Num Tx descriptors avail = 256
>   em0: Tx Descriptors not avail1 = 0
>   em0: Tx Descriptors not avail2 = 0
>   em0: Std mbuf failed = 0
>   em0: Std mbuf cluster failed = 0
>   em0: Driver dropped packets = 0
>   em0: Driver tx dma failure in encap = 0
> _______________________________________________
> freebsd-net at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>


More information about the freebsd-net mailing list