From: Sepherosa Ziehau Date: Sat, 3 Nov 2012 14:49:32 +0000 (+0800) Subject: bge: Fix a bug in the polling code when status tag is used X-Git-Tag: v3.2.2~38 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/c3640a43a372e4b33901e3e5bee48abbe9f5fbfd bge: Fix a bug in the polling code when status tag is used Status tag always needs to be written even if interrupt is not enabled. --- diff --git a/sys/dev/netif/bge/if_bge.c b/sys/dev/netif/bge/if_bge.c index 7115fe9465..f5ec26b1b5 100644 --- a/sys/dev/netif/bge/if_bge.c +++ b/sys/dev/netif/bge/if_bge.c @@ -3073,16 +3073,18 @@ bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) */ cpu_lfence(); } + rx_prod = sblk->bge_idx[0].bge_rx_prod_idx; + if (sc->bge_rx_saved_considx != rx_prod) + bge_rxeof(sc, rx_prod); + tx_cons = sblk->bge_idx[0].bge_tx_cons_idx; - if (ifp->if_flags & IFF_RUNNING) { - rx_prod = sblk->bge_idx[0].bge_rx_prod_idx; - if (sc->bge_rx_saved_considx != rx_prod) - bge_rxeof(sc, rx_prod); - - tx_cons = sblk->bge_idx[0].bge_tx_cons_idx; - if (sc->bge_tx_saved_considx != tx_cons) - bge_txeof(sc, tx_cons); + if (sc->bge_tx_saved_considx != tx_cons) + bge_txeof(sc, tx_cons); + + if (sc->bge_flags & BGE_FLAG_STATUS_TAG) { + bge_writembx(sc, BGE_MBX_IRQ0_LO, + sc->bge_status_tag << 24); } break; }