network - Make toeplitz the default
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 9 Sep 2010 16:27:40 +0000 (09:27 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 9 Sep 2010 16:27:40 +0000 (09:27 -0700)
sys/conf/options
sys/config/LINT
sys/dev/netif/emx/if_emx.c
sys/dev/netif/jme/if_jme.c
sys/net/toeplitz.c
sys/net/toeplitz2.h
sys/netinet/ip_demux.c

index 3424890..a214a05 100644 (file)
@@ -658,8 +658,7 @@ SYSLINK                     opt_syslink.h
 # DSCHED stuff
 DSCHED_FQ              opt_dsched.h
 
-# Receive Side Scaling
-RSS                    opt_rss.h
+# Receive Side Scaling (now basecode)
 RSS_DEBUG              opt_rss.h
 
 # Enable watchdogs
index fe244b7..0664204 100644 (file)
@@ -2913,10 +2913,6 @@ options          SCTP_MAP_LOGGING
 # DSCHED stuff
 options                DSCHED_FQ
 
-# Receive Side Scaling
-options                RSS
-options                RSS_DEBUG
-
 # WATCHDOG
 options                WATCHDOG_ENABLE         # Enable watchdog support framework
 options                WDOG_DISABLE_ON_PANIC   # Automatically disable watchdogs on panic
index 51fc3f3..cfba53f 100644 (file)
@@ -514,12 +514,10 @@ emx_attach(device_t dev)
        /* This controls when hardware reports transmit completion status. */
        sc->hw.mac.report_tx_early = 1;
 
-#ifdef RSS
        /* Calculate # of RX rings */
        if (ncpus > 1)
                sc->rx_ring_cnt = EMX_NRX_RING;
        else
-#endif
                sc->rx_ring_cnt = 1;
        sc->rx_ring_inuse = sc->rx_ring_cnt;
 
index b6a90b6..7cc5d2a 100644 (file)
@@ -620,7 +620,9 @@ jme_attach(device_t dev)
        if (sc->jme_tx_desc_cnt > JME_NDESC_MAX)
                sc->jme_tx_desc_cnt = JME_NDESC_MAX;
 
-#ifdef RSS
+       /*
+        * Calculate rx rings based on ncpus2
+        */
        sc->jme_rx_ring_cnt = jme_rx_ring_count;
        if (sc->jme_rx_ring_cnt <= 0)
                sc->jme_rx_ring_cnt = JME_NRXRING_1;
@@ -631,9 +633,6 @@ jme_attach(device_t dev)
                sc->jme_rx_ring_cnt = JME_NRXRING_4;
        else if (sc->jme_rx_ring_cnt >= JME_NRXRING_2)
                sc->jme_rx_ring_cnt = JME_NRXRING_2;
-#else
-       sc->jme_rx_ring_cnt = JME_NRXRING_MIN;
-#endif
        sc->jme_rx_ring_inuse = sc->jme_rx_ring_cnt;
 
        sc->jme_dev = dev;
index d330ab6..889df2f 100644 (file)
@@ -70,8 +70,6 @@
 static uint32_t        toeplitz_keyseeds[TOEPLITZ_KEYSEED_CNT] =
        { TOEPLITZ_KEYSEED0, TOEPLITZ_KEYSEED1 };
 
-#ifdef RSS
-
 uint32_t       toeplitz_cache[TOEPLITZ_KEYSEED_CNT][256];
 
 TUNABLE_INT("net.toeplitz.keyseed0", &toeplitz_keyseeds[0]);
@@ -183,8 +181,6 @@ toeplitz_init(void *dummy __unused)
 }
 SYSINIT(toeplitz, SI_SUB_PRE_DRIVERS, SI_ORDER_FIRST, toeplitz_init, NULL);
 
-#endif /* RSS */
-
 void
 toeplitz_get_key(uint8_t *key, int keylen)
 {
index fb8d317..3f53c1f 100644 (file)
@@ -45,8 +45,6 @@
 
 #define TOEPLITZ_KEYSEED_CNT   2
 
-#ifdef RSS
-
 extern uint32_t        toeplitz_cache[TOEPLITZ_KEYSEED_CNT][256];
 
 static __inline uint32_t
@@ -90,8 +88,6 @@ toeplitz_rawhash_addr(in_addr_t _faddr, in_addr_t _laddr)
        return _res;
 }
 
-#endif /* RSS */
-
 static __inline int
 toeplitz_hash(uint32_t _rawhash)
 {
index 5a0d164..faf2cc9 100644 (file)
@@ -47,9 +47,7 @@
 
 #include <net/if.h>
 #include <net/netisr.h>
-#ifdef RSS
 #include <net/toeplitz2.h>
-#endif
 
 #include <netinet/in_systm.h>
 #include <netinet/in.h>
@@ -69,48 +67,19 @@ extern int udp_mpsafe_thread;
 static struct thread tcp_thread[MAXCPU];
 static struct thread udp_thread[MAXCPU];
 
-#ifndef RSS
-
-static __inline int
-INP_MPORT_HASH(in_addr_t faddr, in_addr_t laddr,
-              in_port_t fport, in_port_t lport)
-{
-       /*
-        * Use low order bytes.
-        */
-
-#if (BYTE_ORDER == LITTLE_ENDIAN)
-       KASSERT(ncpus2 < 256, ("need different hash function"));  /* XXX JH */
-       return (((faddr >> 24) ^ (fport >> 8) ^ (laddr >> 24) ^ (lport >> 8)) &
-               ncpus2_mask);
-#else
-       return ((faddr ^ fport ^ laddr ^ lport) & ncpus2_mask);
-#endif
-}
-
-#endif /* !RSS */
-
 static __inline int
 INP_MPORT_HASH_UDP(in_addr_t faddr, in_addr_t laddr,
                   in_port_t fport, in_port_t lport)
 {
-#ifndef RSS
-       return INP_MPORT_HASH(faddr, laddr, fport, lport);
-#else
        return toeplitz_hash(toeplitz_rawhash_addr(faddr, laddr));
-#endif
 }
 
 static __inline int
 INP_MPORT_HASH_TCP(in_addr_t faddr, in_addr_t laddr,
                   in_port_t fport, in_port_t lport)
 {
-#ifndef RSS
-       return INP_MPORT_HASH(faddr, laddr, fport, lport);
-#else
        return toeplitz_hash(
               toeplitz_rawhash_addrport(faddr, laddr, fport, lport));
-#endif
 }
 
 /*
@@ -304,25 +273,20 @@ ip_mport(struct mbuf **mptr, int dir)
        case IPPROTO_TCP:
                th = (struct tcphdr *)((caddr_t)ip + iphlen);
                thoff = th->th_off << 2;
-               cpu = INP_MPORT_HASH_TCP(ip->ip_src.s_addr, ip->ip_dst.s_addr,
-                   th->th_sport, th->th_dport);
+               cpu = INP_MPORT_HASH_TCP(ip->ip_src.s_addr,
+                                        ip->ip_dst.s_addr,
+                                        th->th_sport,
+                                        th->th_dport);
                port = &tcp_thread[cpu].td_msgport;
                break;
 
        case IPPROTO_UDP:
                uh = (struct udphdr *)((caddr_t)ip + iphlen);
 
-#ifndef RSS
-               if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
-                   (dir == IP_MPORT_IN &&
-                    in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif))) {
-                       cpu = 0;
-               } else
-#endif
-               {
-                       cpu = INP_MPORT_HASH_UDP(ip->ip_src.s_addr,
-                           ip->ip_dst.s_addr, uh->uh_sport, uh->uh_dport);
-               }
+               cpu = INP_MPORT_HASH_UDP(ip->ip_src.s_addr,
+                                        ip->ip_dst.s_addr,
+                                        uh->uh_sport,
+                                        uh->uh_dport);
                port = &udp_thread[cpu].td_msgport;
                break;
 
@@ -538,12 +502,7 @@ tcp_addrcpu(in_addr_t faddr, in_port_t fport, in_addr_t laddr, in_port_t lport)
 int
 udp_addrcpu(in_addr_t faddr, in_port_t fport, in_addr_t laddr, in_port_t lport)
 {
-#ifndef RSS
-       if (IN_MULTICAST(ntohl(laddr)))
-               return (0);
-       else
-#endif
-               return (INP_MPORT_HASH_UDP(faddr, laddr, fport, lport));
+       return (INP_MPORT_HASH_UDP(faddr, laddr, fport, lport));
 }
 
 /*