lport = 0xe606;
kprintf("toeplitz: verify addr/port 0x%08x, addr 0x%08x\n",
- toeplitz_hash_tcp(faddr, laddr, fport, lport),
- toeplitz_hash(faddr, laddr));
+ toeplitz_rawhash_addrport(faddr, laddr, fport, lport),
+ toeplitz_rawhash_addr(faddr, laddr));
}
#endif /* RSS_DEBUG */
#error "kernel only header file"
#endif
+#ifndef _SYS_SYSTM_H_
+#include <sys/systm.h>
+#endif
+
#define TOEPLITZ_KEYSEED_CNT 2
extern uint32_t toeplitz_cache[TOEPLITZ_KEYSEED_CNT][256];
static __inline uint32_t
-toeplitz_hash_tcp(in_addr_t _faddr, in_addr_t _laddr,
- in_port_t _fport, in_port_t _lport)
+toeplitz_rawhash_addrport(in_addr_t _faddr, in_addr_t _laddr,
+ in_port_t _fport, in_port_t _lport)
{
uint32_t _res;
}
static __inline uint32_t
-toeplitz_hash(in_addr_t _faddr, in_addr_t _laddr)
+toeplitz_rawhash_addr(in_addr_t _faddr, in_addr_t _laddr)
{
uint32_t _res;
return _res;
}
+static __inline int
+toeplitz_hash(uint32_t _rawhash)
+{
+ return (_rawhash & ncpus2_mask);
+}
+
#endif /* !_NET_TOEPLITZ2_H_ */
#ifndef RSS
return INP_MPORT_HASH(faddr, laddr, fport, lport);
#else
- return (toeplitz_hash(faddr, laddr) & ncpus2_mask);
+ return toeplitz_hash(toeplitz_rawhash_addr(faddr, laddr));
#endif
}
#ifndef RSS
return INP_MPORT_HASH(faddr, laddr, fport, lport);
#else
- return (toeplitz_hash_tcp(faddr, laddr, fport, lport) & ncpus2_mask);
+ return toeplitz_hash(
+ toeplitz_rawhash_addrport(faddr, laddr, fport, lport));
#endif
}