Lines Matching refs:tpcache
332 struct tcp_cache *__single tpcache = NULL; in tcp_getcache_with_lock() local
344 SLIST_FOREACH(tpcache, &head->tcp_caches, list) { in tcp_getcache_with_lock()
345 if (memcmp(&tpcache->tc_key, &key, sizeof(key)) == 0) { in tcp_getcache_with_lock()
353 if ((tpcache == NULL) && create) { in tcp_getcache_with_lock()
359 SLIST_FOREACH(tpcache, &head->tcp_caches, list) { in tcp_getcache_with_lock()
360 uint32_t age = tcp_now - tpcache->tc_last_access; in tcp_getcache_with_lock()
363 oldest_cache = tpcache; in tcp_getcache_with_lock()
368 tpcache = oldest_cache; in tcp_getcache_with_lock()
371 tpcache->tc_tfo_cookie_len = 0; in tcp_getcache_with_lock()
374 tpcache = kalloc_type(struct tcp_cache, Z_NOPAGEWAIT | Z_ZERO); in tcp_getcache_with_lock()
375 if (tpcache == NULL) { in tcp_getcache_with_lock()
380 tpcache->tc_mptcp_version = (uint8_t)mptcp_preferred_version; in tcp_getcache_with_lock()
381 tpcache->tc_mptcp_next_version_try = tcp_now; in tcp_getcache_with_lock()
383 SLIST_INSERT_HEAD(&head->tcp_caches, tpcache, list); in tcp_getcache_with_lock()
386 memcpy(&tpcache->tc_key, &key, sizeof(key)); in tcp_getcache_with_lock()
389 if (tpcache == NULL) { in tcp_getcache_with_lock()
394 tpcache->tc_last_access = tcp_now; in tcp_getcache_with_lock()
397 return tpcache; in tcp_getcache_with_lock()
445 struct tcp_cache *__single tpcache; in tcp_cache_set_cookie_common() local
448 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_set_cookie_common()
449 if (tpcache == NULL) { in tcp_cache_set_cookie_common()
453 tpcache->tc_tfo_cookie_len = len > TFO_COOKIE_LEN_MAX ? in tcp_cache_set_cookie_common()
455 memcpy(tpcache->tc_tfo_cookie, cookie, tpcache->tc_tfo_cookie_len); in tcp_cache_set_cookie_common()
475 struct tcp_cache *__single tpcache; in tcp_cache_get_cookie_common() local
478 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_common()
479 if (tpcache == NULL) { in tcp_cache_get_cookie_common()
483 if (tpcache->tc_tfo_cookie_len == 0) { in tcp_cache_get_cookie_common()
492 VERIFY(tpcache->tc_tfo_cookie_len <= *len); in tcp_cache_get_cookie_common()
494 memcpy(cookie, tpcache->tc_tfo_cookie, tpcache->tc_tfo_cookie_len); in tcp_cache_get_cookie_common()
495 *len = tpcache->tc_tfo_cookie_len; in tcp_cache_get_cookie_common()
524 struct tcp_cache *__single tpcache; in tcp_cache_get_cookie_len_common() local
528 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_len_common()
529 if (tpcache == NULL) { in tcp_cache_get_cookie_len_common()
533 cookie_len = tpcache->tc_tfo_cookie_len; in tcp_cache_get_cookie_len_common()
562 struct tcp_cache *__single tpcache; in tcp_cache_get_mptcp_version() local
565 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_get_mptcp_version()
566 if (tpcache == NULL) { in tcp_cache_get_mptcp_version()
570 version = tpcache->tc_mptcp_version; in tcp_cache_get_mptcp_version()
573 if (!tpcache->tc_mptcp_version_confirmed && in tcp_cache_get_mptcp_version()
575 TSTMP_GEQ(tcp_now, tpcache->tc_mptcp_next_version_try)) { in tcp_cache_get_mptcp_version()
590 struct tcp_cache *__single tpcache; in tcp_cache_update_mptcp_version() local
609 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_update_mptcp_version()
610 if (tpcache == NULL) { in tcp_cache_update_mptcp_version()
615 if (tpcache->tc_mptcp_version_confirmed) { in tcp_cache_update_mptcp_version()
622 tpcache->tc_mptcp_version_confirmed = true; in tcp_cache_update_mptcp_version()
623 tpcache->tc_mptcp_version = version; in tcp_cache_update_mptcp_version()
628 if (TSTMP_GEQ(tcp_now, tpcache->tc_mptcp_next_version_try)) { in tcp_cache_update_mptcp_version()
629 tpcache->tc_mptcp_next_version_try = tcp_now + tcp_min_to_hz(mptcp_version_timeout); in tcp_cache_update_mptcp_version()
635 tpcache->tc_mptcp_version = version == MPTCP_VERSION_0 ? MPTCP_VERSION_1 : MPTCP_VERSION_0; in tcp_cache_update_mptcp_version()
640 if (TSTMP_GEQ(tcp_now, tpcache->tc_mptcp_next_version_try)) { in tcp_cache_update_mptcp_version()
641 tpcache->tc_mptcp_next_version_try = tcp_now + tcp_min_to_hz(mptcp_version_timeout); in tcp_cache_update_mptcp_version()
1585 struct tcp_cache *__single tpcache, *__single tmp; in sysctl_cleartfocache() local
1590 SLIST_FOREACH_SAFE(tpcache, &head->tcp_caches, list, tmp) { in sysctl_cleartfocache()
1591 SLIST_REMOVE(&head->tcp_caches, tpcache, tcp_cache, list); in sysctl_cleartfocache()
1592 kfree_type(struct tcp_cache, tpcache); in sysctl_cleartfocache()