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;
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;
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]);
}
SYSINIT(toeplitz, SI_SUB_PRE_DRIVERS, SI_ORDER_FIRST, toeplitz_init, NULL);
-#endif /* RSS */
-
void
toeplitz_get_key(uint8_t *key, int keylen)
{
#include <net/if.h>
#include <net/netisr.h>
-#ifdef RSS
#include <net/toeplitz2.h>
-#endif
#include <netinet/in_systm.h>
#include <netinet/in.h>
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
}
/*
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;
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));
}
/*