MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ktls_get_cpu

Function ktls_get_cpu

freebsd/kern/uipc_ktls.c:322–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320
321#if defined(INET) || defined(INET6)
322static u_int
323ktls_get_cpu(struct socket *so)
324{
325 struct inpcb *inp;
326#ifdef NUMA
327 struct ktls_domain_info *di;
328#endif
329 u_int cpuid;
330
331 inp = sotoinpcb(so);
332#ifdef RSS
333 cpuid = rss_hash2cpuid(inp->inp_flowid, inp->inp_flowtype);
334 if (cpuid != NETISR_CPUID_NONE)
335 return (cpuid);
336#endif
337 /*
338 * Just use the flowid to shard connections in a repeatable
339 * fashion. Note that some crypto backends rely on the
340 * serialization provided by having the same connection use
341 * the same queue.
342 */
343#ifdef NUMA
344 if (ktls_bind_threads > 1 && inp->inp_numa_domain != M_NODOM) {
345 di = &ktls_domains[inp->inp_numa_domain];
346 cpuid = di->cpu[inp->inp_flowid % di->count];
347 } else
348#endif
349 cpuid = ktls_cpuid_lookup[inp->inp_flowid % ktls_number_threads];
350 return (cpuid);
351}
352#endif
353
354static void

Callers 1

ktls_create_sessionFunction · 0.85

Calls 1

rss_hash2cpuidFunction · 0.85

Tested by

no test coverage detected