cvs commit: src/sys/dev/netif/re if_re.c if_revar.h

Sepherosa Ziehau sephe at
Fri Dec 22 19:43:59 PST 2006

sephe       2006/12/22 19:41:55 PST

DragonFly src repository

  Modified files:
    sys/dev/netif/re     if_re.c if_revar.h 
  - Don't call m_adj() to make RX buffer's _payload_ on longword aligned,
    because some re(4) chips (e.g. RTL8101E) require RX buffer to be
    8-bytes aligned.  This change shows no noticeable performance change.
    Reported-by: Joe Talbott <josepht at>
  - Avoid writing extra hardware registers by writing 2 bytes to IDR4
    instead instead of writing 4 bytes, bacause:
    1) the extra two registers after IDR5 are reserved.
    2) accessing arpcom.ac_enaddr[6,7] should be invalid.
  - Add a flag field in re_softc and re_hwrev.  Currently only one flag,
    RE_F_HASMPC, is defined.  This flag is used to indicate whether the
    hardware has MPC register or not, so we can avoid writing to MPC's
    position, if that position is reserved.
  - Move descriptor ring address setting up before RX/TX enabling, since
    some re(4) chips (e.g. RTL8101E) will try accessing descriptor ring
    immediately after RX/TX is enabled, which results in intermittent
    kernel panic or system hanging.
    Paniced-by: Joe Talbott <josepht at>
  - Avoid calling re_init(), if hw.reX.tx_moderation is changed but NIC
    is not up yet.
  - Const-fy global hardware id arrays and nuke unused macro while I'm here.
  Thank Joe Talbott <josepht at> to help debugging and provide
  valuable information (esp. locating the problematic RX/TX enabling :)
  Thank dillon@ to provide debugging hints.
    Joe Talbott <josepht at> (RTL8101E)
    swildner@ (onboard RTL8169S) (*)
    me (RTL8169S)
  # (*) swildner@'s card is still half broken even after this commit :\
  Revision  Changes    Path
  1.29      +44 -40    src/sys/dev/netif/re/if_re.c
  1.2       +5 -5      src/sys/dev/netif/re/if_revar.h

More information about the Commits mailing list