Author: arybchik
Date: Fri Dec 30 17:24:28 2016
New Revision: 310830
URL: https://svnweb.freebsd.org/changeset/base/310830

Log:
  MFC r310627
  
  sfxge(4): do not limit driver RSS table to RSS channels max
  
  Specification of entire RSS table in the driver allows to spread traffic
  more equally across CPUs/RSS channels if number of RSS channels is not
  power of 2.
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/sfxge.h
  stable/10/sys/dev/sfxge/sfxge_rx.c
  stable/10/sys/dev/sfxge/sfxge_tx.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/sfxge.h
==============================================================================
--- stable/10/sys/dev/sfxge/sfxge.h     Fri Dec 30 17:12:41 2016        
(r310829)
+++ stable/10/sys/dev/sfxge/sfxge.h     Fri Dec 30 17:24:28 2016        
(r310830)
@@ -302,7 +302,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];
 

Modified: stable/10/sys/dev/sfxge/sfxge_rx.c
==============================================================================
--- stable/10/sys/dev/sfxge/sfxge_rx.c  Fri Dec 30 17:12:41 2016        
(r310829)
+++ stable/10/sys/dev/sfxge/sfxge_rx.c  Fri Dec 30 17:24:28 2016        
(r310830)
@@ -1128,10 +1128,10 @@ 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++)
                sc->rx_indir_table[index] = index % sc->rxq_count;
        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) |

Modified: stable/10/sys/dev/sfxge/sfxge_tx.c
==============================================================================
--- stable/10/sys/dev/sfxge/sfxge_tx.c  Fri Dec 30 17:12:41 2016        
(r310829)
+++ stable/10/sys/dev/sfxge/sfxge_tx.c  Fri Dec 30 17:24:28 2016        
(r310830)
@@ -820,8 +820,9 @@ sfxge_if_transmit(struct ifnet *ifp, str
                /* 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];
                }
 #if SFXGE_TX_PARSE_EARLY
                if (m->m_pkthdr.csum_flags & CSUM_TSO)
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to