FreeBSD/sys/netinet/tcp_timer.c
/*
 * Map the given inp to a CPU id.
 *
 * This queries RSS if it's compiled in, else it defaults to the current
 * CPU ID.
 */
Map the given inp to a CPU id.
This queries RSS if it's compiled in, else it defaults to the current
CPU ID.
Map the given inp to a CPU id . This queries RSS if it ' s compiled in else it defaults to the current CPU ID .
static inline int
inp_to_cpuid(struct inpcb *inp)
{
	u_int cpuid;
#ifdef	RSS
	if (per_cpu_timers) {
		cpuid = rss_hash2cpuid(inp->inp_flowid, inp->inp_flowtype);
		if (cpuid == NETISR_CPUID_NONE)
			return (curcpu);	
		else
			return (cpuid);
	}
#else
	if (per_cpu_timers) {
		cpuid = inp->inp_flowid % (mp_maxid + 1);
		if (! CPU_ABSENT(cpuid))
			return (cpuid);
		return (curcpu);
	}
#endif
	else {
		return (0);
	}
}
static inline int inp_to_cpuid ( struct inpcb * inp ) { u_int cpuid ; #ifdef RSS if ( per_cpu_timers ) { cpuid = rss_hash2cpuid ( inp -> inp_flowid , inp -> inp_flowtype ) ; if ( cpuid == NETISR_CPUID_NONE ) return ( curcpu ) ; else return ( cpuid ) ; } #else if ( per_cpu_timers ) { cpuid = inp -> inp_flowid % ( mp_maxid + 1 ) ; if ( ! CPU_ABSENT ( cpuid ) ) return ( cpuid ) ; return ( curcpu ) ; } #endif else { return ( 0 ) ; } }
Map the given inp to a CPU id.
Map the given inp to a CPU id .
/* XXX */ /* Legacy, pre-RSS behaviour */ /*
		 * We don't have a flowid -> cpuid mapping, so cheat and
		 * just map unknown cpuids to curcpu.  Not the best, but
		 * apparently better than defaulting to swi 0.
		 */ /* Default for RSS and non-RSS - cpuid 0 */