aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Rybchenko <arybchik@FreeBSD.org>2016-12-27 08:51:26 +0000
committerAndrew Rybchenko <arybchik@FreeBSD.org>2016-12-27 08:51:26 +0000
commit44fcad033fb5e910f1b38381fab447b37dca765c (patch)
treeac30e4d3267915e29eb1875918dddbf705ac55e5
parent781487cfc648623c88424cb26077d01b784b9385 (diff)
Notes
-rw-r--r--sys/dev/sfxge/sfxge.h2
-rw-r--r--sys/dev/sfxge/sfxge_rx.c4
-rw-r--r--sys/dev/sfxge/sfxge_tx.c3
3 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/sfxge/sfxge.h b/sys/dev/sfxge/sfxge.h
index 456c150cbc47..667e2e7d8ba5 100644
--- a/sys/dev/sfxge/sfxge.h
+++ b/sys/dev/sfxge/sfxge.h
@@ -301,7 +301,7 @@ struct sfxge_softc {
unsigned int max_rss_channels;
uma_zone_t rxq_cache;
struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX];
- unsigned int rx_indir_table[SFXGE_RX_SCALE_MAX];
+ unsigned int rx_indir_table[EFX_RSS_TBL_SIZE];
struct sfxge_txq *txq[SFXGE_TXQ_NTYPES + SFXGE_RX_SCALE_MAX];
diff --git a/sys/dev/sfxge/sfxge_rx.c b/sys/dev/sfxge/sfxge_rx.c
index 590ac89fac85..643d0718e262 100644
--- a/sys/dev/sfxge/sfxge_rx.c
+++ b/sys/dev/sfxge/sfxge_rx.c
@@ -1128,7 +1128,7 @@ sfxge_rx_start(struct sfxge_softc *sc)
/*
* Set up the scale table. Enable all hash types and hash insertion.
*/
- for (index = 0; index < SFXGE_RX_SCALE_MAX; index++)
+ for (index = 0; index < nitems(sc->rx_indir_table); index++)
#ifdef RSS
sc->rx_indir_table[index] =
rss_get_indirection_to_bucket(index) % sc->rxq_count;
@@ -1136,7 +1136,7 @@ sfxge_rx_start(struct sfxge_softc *sc)
sc->rx_indir_table[index] = index % sc->rxq_count;
#endif
if ((rc = efx_rx_scale_tbl_set(sc->enp, sc->rx_indir_table,
- SFXGE_RX_SCALE_MAX)) != 0)
+ nitems(sc->rx_indir_table))) != 0)
goto fail;
(void)efx_rx_scale_mode_set(sc->enp, EFX_RX_HASHALG_TOEPLITZ,
(1 << EFX_RX_HASH_IPV4) | (1 << EFX_RX_HASH_TCPIPV4) |
diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c
index 198b1e558992..7ac48d181397 100644
--- a/sys/dev/sfxge/sfxge_tx.c
+++ b/sys/dev/sfxge/sfxge_tx.c
@@ -838,8 +838,9 @@ sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m)
/* check if flowid is set */
if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) {
uint32_t hash = m->m_pkthdr.flowid;
+ uint32_t idx = hash % nitems(sc->rx_indir_table);
- index = sc->rx_indir_table[hash % SFXGE_RX_SCALE_MAX];
+ index = sc->rx_indir_table[idx];
}
#endif
#if SFXGE_TX_PARSE_EARLY