mxge: use ether_input_chain()
authorAggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Mon, 13 Jul 2009 15:12:38 +0000 (18:12 +0300)
committerAggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Mon, 13 Jul 2009 15:12:38 +0000 (18:12 +0300)
sys/dev/netif/mxge/if_mxge.c

index 82d966b..1b3758b 100644 (file)
@@ -2536,7 +2536,8 @@ mxge_vlan_tag_remove(struct mbuf *m, uint32_t *csum)
 
 
 static inline void
-mxge_rx_done_big(struct mxge_slice_state *ss, uint32_t len, uint32_t csum)
+mxge_rx_done_big(struct mxge_slice_state *ss, uint32_t len, uint32_t csum,
+                  struct mbuf_chain *chain)
 {
        mxge_softc_t *sc;
        struct ifnet *ifp;
@@ -2598,12 +2599,12 @@ mxge_rx_done_big(struct mxge_slice_state *ss, uint32_t len, uint32_t csum)
                m->m_flags |= M_FLOWID;
        }
 #endif
-       /* pass the frame up the stack */
-       (*ifp->if_input)(ifp, m);
+       ether_input_chain(ifp, m, NULL, chain);
 }
 
 static inline void
-mxge_rx_done_small(struct mxge_slice_state *ss, uint32_t len, uint32_t csum)
+mxge_rx_done_small(struct mxge_slice_state *ss, uint32_t len, uint32_t csum,
+                  struct mbuf_chain *chain)
 {
        mxge_softc_t *sc;
        struct ifnet *ifp;
@@ -2665,8 +2666,7 @@ mxge_rx_done_small(struct mxge_slice_state *ss, uint32_t len, uint32_t csum)
                m->m_flags |= M_FLOWID;
        }
 #endif
-       /* pass the frame up the stack */
-       (*ifp->if_input)(ifp, m);
+       ether_input_chain(ifp, m, NULL, chain);
 }
 
 static inline void
@@ -2676,16 +2676,17 @@ mxge_clean_rx_done(struct mxge_slice_state *ss)
        int limit = 0;
        uint16_t length;
        uint16_t checksum;
+       struct mbuf_chain chain[MAXCPU];
 
-
+       ether_input_chain_init(chain);
        while (rx_done->entry[rx_done->idx].length != 0) {
                length = ntohs(rx_done->entry[rx_done->idx].length);
                rx_done->entry[rx_done->idx].length = 0;
                checksum = rx_done->entry[rx_done->idx].checksum;
                if (length <= (MHLEN - MXGEFW_PAD))
-                       mxge_rx_done_small(ss, length, checksum);
+                       mxge_rx_done_small(ss, length, checksum, chain);
                else
-                       mxge_rx_done_big(ss, length, checksum);
+                       mxge_rx_done_big(ss, length, checksum, chain);
                rx_done->cnt++;
                rx_done->idx = rx_done->cnt & rx_done->mask;
 
@@ -2693,6 +2694,7 @@ mxge_clean_rx_done(struct mxge_slice_state *ss)
                if (__predict_false(++limit > rx_done->mask / 2))
                        break;
        }
+       ether_input_dispatch(chain);
 #ifdef INET
        while (!SLIST_EMPTY(&ss->lro_active)) {
                struct lro_entry *lro = SLIST_FIRST(&ss->lro_active);