From 8800b3a4e1f7424e6a3b2b8610a75f56434f822c Mon Sep 17 00:00:00 2001 From: Aggelos Economopoulos Date: Mon, 13 Jul 2009 18:12:38 +0300 Subject: [PATCH] mxge: use ether_input_chain() --- sys/dev/netif/mxge/if_mxge.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/dev/netif/mxge/if_mxge.c b/sys/dev/netif/mxge/if_mxge.c index 82d966bf75..1b3758bde6 100644 --- a/sys/dev/netif/mxge/if_mxge.c +++ b/sys/dev/netif/mxge/if_mxge.c @@ -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); -- 2.41.0