Lines Matching refs:tpcache

333 	struct tcp_cache *tpcache = NULL;  in tcp_getcache_with_lock()  local
345 SLIST_FOREACH(tpcache, &head->tcp_caches, list) { in tcp_getcache_with_lock()
346 if (memcmp(&tpcache->tc_key, &key, sizeof(key)) == 0) { in tcp_getcache_with_lock()
354 if ((tpcache == NULL) && create) { in tcp_getcache_with_lock()
360 SLIST_FOREACH(tpcache, &head->tcp_caches, list) { in tcp_getcache_with_lock()
361 uint32_t age = tcp_now - tpcache->tc_last_access; in tcp_getcache_with_lock()
364 oldest_cache = tpcache; in tcp_getcache_with_lock()
369 tpcache = oldest_cache; in tcp_getcache_with_lock()
372 tpcache->tc_tfo_cookie_len = 0; in tcp_getcache_with_lock()
375 tpcache = kalloc_type(struct tcp_cache, Z_NOPAGEWAIT | Z_ZERO); in tcp_getcache_with_lock()
376 if (tpcache == NULL) { in tcp_getcache_with_lock()
381 tpcache->tc_mptcp_version = (uint8_t)mptcp_preferred_version; in tcp_getcache_with_lock()
382 tpcache->tc_mptcp_next_version_try = tcp_now; in tcp_getcache_with_lock()
384 SLIST_INSERT_HEAD(&head->tcp_caches, tpcache, list); in tcp_getcache_with_lock()
387 memcpy(&tpcache->tc_key, &key, sizeof(key)); in tcp_getcache_with_lock()
390 if (tpcache == NULL) { in tcp_getcache_with_lock()
395 tpcache->tc_last_access = tcp_now; in tcp_getcache_with_lock()
398 return tpcache; in tcp_getcache_with_lock()
446 struct tcp_cache *tpcache; in tcp_cache_set_cookie_common() local
449 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_set_cookie_common()
450 if (tpcache == NULL) { in tcp_cache_set_cookie_common()
454 tpcache->tc_tfo_cookie_len = len > TFO_COOKIE_LEN_MAX ? in tcp_cache_set_cookie_common()
456 memcpy(tpcache->tc_tfo_cookie, cookie, tpcache->tc_tfo_cookie_len); in tcp_cache_set_cookie_common()
474 struct tcp_cache *tpcache; in tcp_cache_get_cookie_common() local
477 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_common()
478 if (tpcache == NULL) { in tcp_cache_get_cookie_common()
482 if (tpcache->tc_tfo_cookie_len == 0) { in tcp_cache_get_cookie_common()
491 VERIFY(tpcache->tc_tfo_cookie_len <= *len); in tcp_cache_get_cookie_common()
493 memcpy(cookie, tpcache->tc_tfo_cookie, tpcache->tc_tfo_cookie_len); in tcp_cache_get_cookie_common()
494 *len = tpcache->tc_tfo_cookie_len; in tcp_cache_get_cookie_common()
522 struct tcp_cache *tpcache; in tcp_cache_get_cookie_len_common() local
526 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_len_common()
527 if (tpcache == NULL) { in tcp_cache_get_cookie_len_common()
531 cookie_len = tpcache->tc_tfo_cookie_len; in tcp_cache_get_cookie_len_common()
560 struct tcp_cache *tpcache; in tcp_cache_get_mptcp_version() local
563 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_get_mptcp_version()
564 if (tpcache == NULL) { in tcp_cache_get_mptcp_version()
568 version = tpcache->tc_mptcp_version; in tcp_cache_get_mptcp_version()
571 if (!tpcache->tc_mptcp_version_confirmed && in tcp_cache_get_mptcp_version()
573 TSTMP_GEQ(tcp_now, tpcache->tc_mptcp_next_version_try)) { in tcp_cache_get_mptcp_version()
588 struct tcp_cache *tpcache; in tcp_cache_update_mptcp_version() local
607 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_update_mptcp_version()
608 if (tpcache == NULL) { in tcp_cache_update_mptcp_version()
613 if (tpcache->tc_mptcp_version_confirmed) { in tcp_cache_update_mptcp_version()
620 tpcache->tc_mptcp_version_confirmed = true; in tcp_cache_update_mptcp_version()
621 tpcache->tc_mptcp_version = version; in tcp_cache_update_mptcp_version()
626 if (TSTMP_GEQ(tcp_now, tpcache->tc_mptcp_next_version_try)) { in tcp_cache_update_mptcp_version()
627 tpcache->tc_mptcp_next_version_try = tcp_now + tcp_min_to_hz(mptcp_version_timeout); in tcp_cache_update_mptcp_version()
633 tpcache->tc_mptcp_version = version == MPTCP_VERSION_0 ? MPTCP_VERSION_1 : MPTCP_VERSION_0; in tcp_cache_update_mptcp_version()
638 if (TSTMP_GEQ(tcp_now, tpcache->tc_mptcp_next_version_try)) { in tcp_cache_update_mptcp_version()
639 tpcache->tc_mptcp_next_version_try = tcp_now + tcp_min_to_hz(mptcp_version_timeout); in tcp_cache_update_mptcp_version()
1531 struct tcp_cache *tpcache, *tmp; in sysctl_cleartfocache() local
1536 SLIST_FOREACH_SAFE(tpcache, &head->tcp_caches, list, tmp) { in sysctl_cleartfocache()
1537 SLIST_REMOVE(&head->tcp_caches, tpcache, tcp_cache, list); in sysctl_cleartfocache()
1538 kfree_type(struct tcp_cache, tpcache); in sysctl_cleartfocache()