if_bge driver problem.

husnu demir hdemir at metu.edu.tr
Sun Jan 29 07:38:08 PST 2006


Hi,

Today I tried again and it worked with the following versions. 

http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/sys/dev/bge/if_bge.c?rev=1.91.2.7&content-type=text/plain&only_with_tag=RELENG_6
http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/sys/dev/bge/if_bgereg.h?rev=1.36.2.2&content-type=text/plain&only_with_tag=RELENG_6


root@~# uname -a
FreeBSD nrouter.cc 6.0-STABLE FreeBSD 6.0-STABLE #2: Sun Jan 29 17:18:00 EET 2006     root at nrouter.cc:/usr/obj/usr/src/sys/NON-GENERIC  i386

root@~# ping xxx.yyy.2.1
PING xxx.yyy.2.1 (xxx.yyy.2.1): 56 data bytes
64 bytes from xxx.yyy.2.1: icmp_seq=0 ttl=255 time=2.347 ms
64 bytes from xxx.yyy.2.1: icmp_seq=1 ttl=255 time=1.295 ms
^C
--- xxx.yyy.2.1 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.295/1.821/2.347/0.526 ms


But the switch still shows the RX (meaning TX for the card) CRC Errors. But I could not see any error on the interface with "netstat -I bge2" command.

Switch output;

 Slot/Port 16/2  :
  Operational Status     : up,
  Last Time Link Changed : SUN JAN 29 17:13:31 ,
  Number of Status Change: 34,
  Type                   : Ethernet,
  MAC address            : 00:d0:95:85:3d:89,
  BandWidth (Megabits)   : 1000,                Duplex           : Full,
  Autonegotiation        :   1  [ 1000-F                       ],
  Long Accept            : Enable,              Runt Accept      : Disable,
  Long Frame Size(Bytes) : 10240,               Runt Size(Bytes) : 64,
 Rx               :
  Bytes Received  :                33080, Unicast Frames :                    2,
  Broadcast Frames:                    1, M-cast Frames  :                    0,
  UnderSize Frames:                    0, OverSize Frames:                    0,
  Lost Frames     :                    0, Error Frames   :                   19,
  CRC Error Frames:                   19, Alignments Err :                    0,
 Tx               :
  Bytes Xmitted   :              1404575, Unicast Frames :                  338,
  Broadcast Frames:                   18, M-cast Frames  :                 5138,
  UnderSize Frames:                    0, OverSize Frames:                    0,
  Lost Frames     :                    0, Error Frames   :                    0,
  Collided Frames :                    0

Each UP/DOWN increases the Error Frames number. But no increase in other times?

Also, when I said "ifconfig bge2 down" no messages comes. Only, first ifconfig up messages seen on the console;

root@~# dmesg | grep bge
..
...
bge1: Ethernet address: 00:04:76:f7:99:6e
bge2: <Broadcom BCM5703 Gigabit Ethernet, ASIC rev. 0x1002> mem 0xf1010000-0xf101ffff irq 56 at device 3.0 on pci3
bge2: Ethernet address: 00:10:18:00:4d:53
bge0: link state changed to UP

I do "ifconfig bge2 down/up" several times at that point.



See you tomorrow morning.


Husnu Demir.




On Fri, Jan 27, 2006 at 08:13:25PM +0300, Gleb Smirnoff wrote:
> On Fri, Jan 27, 2006 at 07:01:53PM +0200, husnu demir wrote:
> h> I tried "http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/sys/dev/bge/if_bge.c?rev=1.91.2.7&content-type=text/plain" version and replaced VLAN_INPUT_TAG with VLAN_INPUT_TAG_NEW (only one occurance). And the following errors come up.
> 
> Ohh, you also need to keep if_bgereg.h in sync with if_bge.c. Sorry,
> I didn't mention this.
> 
> h> Not: I am leaving the office. Most probly, I will be here tomorrow morning :(
> 
> Me too. I will be online tomorrow for short time. I think Oleg will
> join debugging your problem.
> 
> Here is attached files of all (if I haven't lost anything) important
> changes. You can fetch actual files from cvsweb.
> 
> -- 
> Totus tuus, Glebius.
> GLEBIUS-RIPN GLEB-RIPE

> pjd         2005-09-28 19:20:49 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c 
>   Log:
>   Implement suspend/resume methods to be more ACPI friendly.
>   I'm able to suspend/resume my laptop without this change, but then I need
>   to wait for the watchdog to reset the card.
>   With this change, it is ready immediately.
>   
>   Glanced at by:  glebius
>   
>   Revision  Changes    Path
>   1.96      +36 -0     src/sys/dev/bge/if_bge.c
> 
> glebius     2005-10-22 14:31:02 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c if_bgereg.h 
>   Log:
>   Introduce polling(4) capability for bge(4).
>   
>   Submitted by:   Oleg Bulyzhin <oleg rinet.ru>
>   
>   Revision  Changes    Path
>   1.98      +110 -2    src/sys/dev/bge/if_bge.c
>   1.37      +3 -0      src/sys/dev/bge/if_bgereg.h
> 
> glebius     2005-11-15 14:43:23 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c if_bgereg.h 
>   Log:
>   Recognize Broadcom BCM5752 chip, that can be found in HP DC7600.
>   
>   PR:             kern/88940
>   Submitted by:   Alexander Hausner
>   
>   Revision  Changes    Path
>   1.100     +5 -2      src/sys/dev/bge/if_bge.c
>   1.38      +2 -0      src/sys/dev/bge/if_bgereg.h
> 
> glebius     2005-11-30 12:37:07 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c 
>   Log:
>   If bus_dmamap_load() failed, we free the mbuf. We also need to clear
>   the pointer, to avoid double free on next bge_stop().
>   
>   Revision  Changes    Path
>   1.101     +6 -2      src/sys/dev/bge/if_bge.c
> 
> oleg        2005-12-08 13:31:52 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c 
>     sys/dev/mii          brgphy.c 
>   Log:
>   1) fix tiny bug in bge_start_locked()
>   2) rework link state detection code & use it in POLLING mode
>   3) fix 2 bugs in link state detection code:
>           a) driver unable to detect link loss on bcm5721
>           b) on bcm570x chips (tested on bcm5700 bcm5701 bcm5702) driver fails
>              to detect link loss with probability 1/6 (solved in brgphy.c)
>   
>   Devices working in TBI mode should not be affected by this change.
>   
>   Approved by:    glebius (mentor)
>   MFC after:      1 month
>   
>   Revision  Changes    Path
>   1.102     +115 -105  src/sys/dev/bge/if_bge.c
>   1.38      +1 -1      src/sys/dev/mii/brgphy.c
> 
> glebius     2005-12-08 16:11:45 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c if_bgereg.h 
>   Log:
>   A big rewrite of receive Jumbo frame handling. Remove the local Jumbo
>   cluster allocator, that wasn't MPSAFE. Instead, utilize our new generic
>   UMA jumbo cluster allocator. Since UMA gives us a 9k piece that is contigous
>   in virtual memory, but isn't contigous in physical memory we need to handle
>   a few segments. To deal with this we utilize Tigon chip feature - extended
>   RX descriptors, that can handle up to four DMA segments for one frame.
>   
>   Details:
>   
>   o Remove bge_alloc_jumbo_mem(), bge_free_jumbo_mem(),
>     bge_jalloc(), bge_jfree() functions.
>   o Remove SLIST heads, bge_jumbo_tag, bge_jumbo_map from softc.
>   o Use extended RX BDs for Jumbo receive producer ring, and
>     initialize it appropriately.
>   o New bge_newbuf_jumbo():
>     - Allocate an mbuf with Jumbo cluster with help of m_cljget().
>     - Load the cluster for DMA with help of bus_dmamap_load_mbuf_sg().
>     - Assert that we got 3 segments in the DMA mapping.
>     - Fill in these 3 segments into the extended RX descriptor.
>   
>   Revision  Changes    Path
>   1.103     +49 -233   src/sys/dev/bge/if_bge.c
>   1.39      +26 -15    src/sys/dev/bge/if_bgereg.h
> 
> 
> marcel      2005-12-13 06:14:14 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c 
>   Log:
>   In bge_link_upd(), rewrite the logic so that status is assigned
>   on the code path it is used in a way that GCC understands. This
>   avoids breakage due to higher optimization levels.
>   
>   Revision  Changes    Path
>   1.104     +2 -4      src/sys/dev/bge/if_bge.c
> 
> 
> yongari     2005-12-15 05:48:49 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c if_bgereg.h 
>   Log:
>   Add bge(4) support for big-endian architectures(part 1/2).
>    - Give up endianess support and switch to native-endian format for
>      accessing hardware structures. In fact embedded processor for
>      BCM57xx is big-endian architure(MIPS) and it requires native-endian
>      format for NIC structures.The NIC performs necessary byte/word
>      swapping depending on programmed endian type.
>    - With above changes all htole16/htole32 calls were gone.
>    - Remove bge_vhandle member in softc and changed to use explicit
>      register access. This may add additional performance penalty
>      that than that of previous memory access. But most of the access
>      is performed on initialization phase(e.g. RCB setup), it would be
>      negligible.
>   
>   Due to incorrect use of bus_dma(9) in bge(4) it still panics sparc64
>   system in device detach path. The issue would be fixed in next patch.
>   
>   Reviewed by:    jkim (initial version)
>   Silence from:   ps
>   Tested by:      glebius
>   Obtained from:  NetBSD via OpenBSD
>   
>   Revision  Changes    Path
>   1.105     +74 -80    src/sys/dev/bge/if_bge.c
>   1.40      +66 -9     src/sys/dev/bge/if_bgereg.h
> 
> 
> glebius     2005-12-15 09:45:54 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c 
>   Log:
>   o Rewrite bge_encap() to use bus_dmamap_load_mbuf_sg(9), inlining the
>     callback function bge_dma_map_tx_desc() into the bge_encap() itself.
>   o If busdma returns EFBIG, try to m_defrag() the packet.
>   
>   Reviewed by:    yongari
>   
>   Revision  Changes    Path
>   1.106     +55 -82    src/sys/dev/bge/if_bge.c
> 
> glebius     2005-12-18 18:24:27 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c 
>     sys/dev/em           if_em.c 
>     sys/dev/ixgb         if_ixgb.c 
>     sys/dev/nge          if_nge.c 
>     sys/dev/re           if_re.c 
>     sys/dev/ti           if_ti.c 
>     sys/dev/txp          if_txp.c 
>     sys/dev/vge          if_vge.c 
>     sys/net              if_vlan_var.h 
>     sys/net80211         ieee80211_input.c 
>   Log:
>   - Fix VLAN_INPUT_TAG() macro, so that it doesn't touch mtag in
>     case if memory allocation failed.
>   - Remove fourth argument from VLAN_INPUT_TAG(), that was used
>     incorrectly in almost all drivers. Indicate failure with
>     mbuf value of NULL.
>   
>   In collaboration with:  yongari, ru, sam
>   
>   Revision  Changes    Path
>   1.107     +5 -2      src/sys/dev/bge/if_bge.c
>   1.93      +1 -2      src/sys/dev/em/if_em.c
>   1.18      +1 -2      src/sys/dev/ixgb/if_ixgb.c
>   1.85      +3 -1      src/sys/dev/nge/if_nge.c
>   1.62      +5 -2      src/sys/dev/re/if_re.c
>   1.118     +5 -2      src/sys/dev/ti/if_ti.c
>   1.40      +3 -2      src/sys/dev/txp/if_txp.c
>   1.23      +5 -2      src/sys/dev/vge/if_vge.c
>   1.23      +7 -6      src/sys/net/if_vlan_var.h
>   1.85      +3 -2      src/sys/net80211/ieee80211_input.c
> 
> glebius     2005-12-18 20:26:12 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c if_bgereg.h 
>   Log:
>   Since BGE_MBX_TX_HOST_PROD0_LO register is write-only to software,
>   we can cache its value in the softc. Eliminates one PCI register
>   write per call to bge_start().
>   
>   A 1.8% speedup for UDP_RR test on my old box.
>   
>   Obtained from:  NetBSD(jonathan) via delphij
>   
>   Revision  Changes    Path
>   1.108     +10 -4     src/sys/dev/bge/if_bge.c
>   1.41      +1 -0      src/sys/dev/bge/if_bgereg.h
> 
> yongari     2005-12-22 01:44:27 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c 
>   Log:
>   Add bge(4) support for big-endian architectures(part 2/2).
>    - removed unused funtion bge_handle_events().
>    - removed bus_dmamap_destroy(9) calls for DMA maps created by
>      bus_dmamem_alloc(9). This should fix panics seen on sparc64
>      in device detach.
>    - added check for parent DMA tag creation.
>    - switched to use __NO_STRICT_ALIGNMENT as bge(4) supports all
>      architectures.
>    - added missing bus_dmamap_sync(9) in bge_txeof().
>    - added missing bus_dmamap_sync(9) in bge_encap().
>    - corrected memory synchronization operation on status block.
>      As the driver just read status block that was DMAed by NIC it
>      should use BUS_DMASYNC_POSTREAD. Likewise the driver does not
>      need to write status block back, so remove unnecessary
>      bus_dmamap_sync(9) calls in bge_intr().
>    - corrected memory synchronization operation on RX return ring.
>      The driver only read the block so remove unnecessary
>      bus_dmamap_sync(9) in bge_rxeof().
>    - force bus_dmamap_sync(9) for only modified descriptors. Blindly
>      synching all desciptor rings would reduce performance.
>    - call bus_dmamap_sync(9) for DMA maps that were modified in bge_rxeof().
>   
>   Reviewed by:    jkim(initial version)
>   Tested by:      glebius(i386), jkim(amd64 initial version)
>   
>   Revision  Changes    Path
>   1.109     +75 -92    src/sys/dev/bge/if_bge.c
> 
> 
> yongari     2005-12-22 02:03:57 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c 
>   Log:
>   Fix bge_eeprom_getbyte() to return 1 when timeout happens.
>   Previously it always returned 0 which means success regardless of
>   EEPROM status.
>   
>   While here, add a check whether EEPROM read is successful.
>   
>   Submitted by:   jkim
>   
>   Revision  Changes    Path
>   1.110     +8 -3      src/sys/dev/bge/if_bge.c
> 
> glebius     2005-12-22 15:14:42 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c 
>   Log:
>   - All bge(4) supported hardware is known to support RX/TX checksum offloading,
>     except for BGE_CHIPID_BCM5700_B0, which is buggy.
>   - All bge(4) supported hardware, has a bug that produces incorrect checksums
>     on Ethernet runts. However, in case of a transmitted packet, the latter can
>     be padded with zeroes, and the checksum would be correct. (Probably chip
>     includes the pad data into checksum). In case of receive, we just don't
>     trust checksum data in received runts.
>   
>   Obtained from:  NetBSD (jonathan) via Mihail Balikov
>   
>   Revision  Changes    Path
>   1.111     +69 -10    src/sys/dev/bge/if_bge.c
> 
> yongari     2005-12-23 02:04:41 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c if_bgereg.h 
>   Log:
>   Use device_printf() and if_printf() rather than printf() and axe
>   bge_unit from the softc.
>   
>   Requested by:   marius
>   
>   Revision  Changes    Path
>   1.112     +51 -52    src/sys/dev/bge/if_bge.c
>   1.42      +0 -1      src/sys/dev/bge/if_bgereg.h
> 
> oleg        2006-01-13 08:59:40 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c 
>   Log:
>   1) move all link state detection code from bge_tick_locked() to bge_link_upd()
>   2) use more robust way of link state handling for BCM5700 rev.B2 chip
>   3) workaround bug of some BCM570x chips which cause spurious "link up" messages
>   4) fix bug: some BCM570x chips was unable to detect link state changes after
>      ifconfig down/up sequence until any 'non-link related' interrupt generated.
>      (this happened due to pending internal link state attention which blocked
>      interrupt generation)
>   
>   Approved by:    glebius (mentor)
>   MFC after:      1 week
>   
>   Revision  Changes    Path
>   1.113     +101 -60   src/sys/dev/bge/if_bge.c
> 
> scottl      2006-01-14 17:42:22 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bgereg.h 
>   Log:
>   Don't base the number of jumbo segments on page size, instead base it on the
>   fact that jumbo desriptors are defined to have 3 segments.
>   
>   Found by: Coverity Prevent(tm)
>   
>   Revision  Changes    Path
>   1.43      +1 -1      src/sys/dev/bge/if_bgereg.h
> 
> oleg        2006-01-17 23:01:58 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c if_bgereg.h 
>   Log:
>    - Count packets discarded by RX/TX MAC (cause of FIFO overflow, etc)
>      as input/output interface errors.
>    - Keep values of rx/tx discards & tx collisions inside struct bge_softc.
>      So we can keep statistic across ifconfig down/up runs (cause bringing
>      bge up will reset chip).
>   
>   Approved by:    glebius (mentor)
>   MFC after:      1 week
>   
>   Revision  Changes    Path
>   1.114     +30 -29    src/sys/dev/bge/if_bge.c
>   1.44      +3 -0      src/sys/dev/bge/if_bgereg.h
> 
> glebius     2006-01-18 14:31:21 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/bge          if_bge.c if_bgereg.h 
>   Log:
>   Be ready to a case when not a constant number of segments is returned
>   by bus_dmamap_load_mbuf_sg() on jumbo buffer allocation.
>   
>   Reviewed by:    scottl, gallatin
>   
>   Revision  Changes    Path
>   1.115     +22 -12    src/sys/dev/bge/if_bge.c
>   1.45      +1 -1      src/sys/dev/bge/if_bgereg.h



More information about the freebsd-stable mailing list