bge: Fix a bug in the polling code when status tag is used
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 3 Nov 2012 14:49:32 +0000 (22:49 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 3 Nov 2012 14:49:32 +0000 (22:49 +0800)
Status tag always needs to be written even if interrupt is not enabled.

sys/dev/netif/bge/if_bge.c

index 7115fe9..f5ec26b 100644 (file)
@@ -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;
        }