Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/uipc_ktls.c
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | |||||
#ifdef RSS | #ifdef RSS | ||||
static int ktls_bind_threads = 1; | static int ktls_bind_threads = 1; | ||||
#else | #else | ||||
static int ktls_bind_threads; | static int ktls_bind_threads; | ||||
#endif | #endif | ||||
SYSCTL_INT(_kern_ipc_tls, OID_AUTO, bind_threads, CTLFLAG_RDTUN, | SYSCTL_INT(_kern_ipc_tls, OID_AUTO, bind_threads, CTLFLAG_RDTUN, | ||||
&ktls_bind_threads, 0, | &ktls_bind_threads, 0, | ||||
"Bind crypto threads to cores or domains at boot"); | "Bind crypto threads to cores (1) or cores and domains (2) at boot"); | ||||
static u_int ktls_maxlen = 16384; | static u_int ktls_maxlen = 16384; | ||||
SYSCTL_UINT(_kern_ipc_tls, OID_AUTO, maxlen, CTLFLAG_RWTUN, | SYSCTL_UINT(_kern_ipc_tls, OID_AUTO, maxlen, CTLFLAG_RWTUN, | ||||
&ktls_maxlen, 0, "Maximum TLS record size"); | &ktls_maxlen, 0, "Maximum TLS record size"); | ||||
static int ktls_number_threads; | static int ktls_number_threads; | ||||
SYSCTL_INT(_kern_ipc_tls_stats, OID_AUTO, threads, CTLFLAG_RD, | SYSCTL_INT(_kern_ipc_tls_stats, OID_AUTO, threads, CTLFLAG_RD, | ||||
&ktls_number_threads, 0, | &ktls_number_threads, 0, | ||||
▲ Show 20 Lines • Show All 305 Lines • ▼ Show 20 Lines | CPU_FOREACH(i) { | ||||
ktls_cpuid_lookup[ktls_number_threads] = i; | ktls_cpuid_lookup[ktls_number_threads] = i; | ||||
ktls_number_threads++; | ktls_number_threads++; | ||||
} | } | ||||
/* | /* | ||||
* If we somehow have an empty domain, fall back to choosing | * If we somehow have an empty domain, fall back to choosing | ||||
* among all KTLS threads. | * among all KTLS threads. | ||||
*/ | */ | ||||
if (ktls_bind_threads > 1) { | |||||
for (i = 0; i < vm_ndomains; i++) { | for (i = 0; i < vm_ndomains; i++) { | ||||
if (ktls_domains[i].count == 0) { | if (ktls_domains[i].count == 0) { | ||||
ktls_bind_threads = 0; | ktls_bind_threads = 1; | ||||
break; | break; | ||||
} | |||||
} | } | ||||
} | } | ||||
printf("KTLS: Initialized %d threads\n", ktls_number_threads); | printf("KTLS: Initialized %d threads\n", ktls_number_threads); | ||||
} | } | ||||
SYSINIT(ktls, SI_SUB_SMP + 1, SI_ORDER_ANY, ktls_init, NULL); | SYSINIT(ktls, SI_SUB_SMP + 1, SI_ORDER_ANY, ktls_init, NULL); | ||||
#if defined(INET) || defined(INET6) | #if defined(INET) || defined(INET6) | ||||
▲ Show 20 Lines • Show All 1,726 Lines • Show Last 20 Lines |