igb: Utilize power of 2 mask based CPUID to subqueue mapping
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 28 Jan 2013 13:24:55 +0000 (21:24 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 28 Jan 2013 13:24:55 +0000 (21:24 +0800)
sys/dev/netif/igb/if_igb.c

index 529bd3b..e1af2f3 100644 (file)
@@ -937,6 +937,7 @@ igb_init(void *xsc)
 
        /* Configured used RX/TX rings */
        igb_set_ring_inuse(sc, polling);
 
        /* Configured used RX/TX rings */
        igb_set_ring_inuse(sc, polling);
+       ifq_set_subq_mask(&ifp->if_snd, sc->tx_ring_inuse - 1);
 
        /* Initialize interrupt */
        igb_init_intr(sc);
 
        /* Initialize interrupt */
        igb_init_intr(sc);
@@ -1470,6 +1471,9 @@ igb_setup_ifp(struct igb_softc *sc)
        ifq_set_ready(&ifp->if_snd);
        ifq_set_subq_cnt(&ifp->if_snd, sc->tx_ring_cnt);
 
        ifq_set_ready(&ifp->if_snd);
        ifq_set_subq_cnt(&ifp->if_snd, sc->tx_ring_cnt);
 
+       ifp->if_mapsubq = ifq_mapsubq_mask;
+       ifq_set_subq_mask(&ifp->if_snd, 0);
+
        ether_ifattach(ifp, sc->hw.mac.addr, NULL);
 
        ifp->if_capabilities =
        ether_ifattach(ifp, sc->hw.mac.addr, NULL);
 
        ifp->if_capabilities =