Lines Matching refs:tpcache

312 	struct tcp_cache *__single tpcache = NULL;  in tcp_getcache_with_lock()  local
324 SLIST_FOREACH(tpcache, &head->tcp_caches, list) { in tcp_getcache_with_lock()
325 if (memcmp(&tpcache->tc_key, &key, sizeof(key)) == 0) { in tcp_getcache_with_lock()
333 if ((tpcache == NULL) && create) { in tcp_getcache_with_lock()
339 SLIST_FOREACH(tpcache, &head->tcp_caches, list) { in tcp_getcache_with_lock()
340 uint32_t age = tcp_now - tpcache->tc_last_access; in tcp_getcache_with_lock()
343 oldest_cache = tpcache; in tcp_getcache_with_lock()
348 tpcache = oldest_cache; in tcp_getcache_with_lock()
351 tpcache->tc_tfo_cookie_len = 0; in tcp_getcache_with_lock()
354 tpcache = kalloc_type(struct tcp_cache, Z_NOPAGEWAIT | Z_ZERO); in tcp_getcache_with_lock()
355 if (tpcache == NULL) { in tcp_getcache_with_lock()
360 tpcache->tc_mptcp_version = (uint8_t)mptcp_preferred_version; in tcp_getcache_with_lock()
361 tpcache->tc_mptcp_next_version_try = tcp_now; in tcp_getcache_with_lock()
363 SLIST_INSERT_HEAD(&head->tcp_caches, tpcache, list); in tcp_getcache_with_lock()
366 memcpy(&tpcache->tc_key, &key, sizeof(key)); in tcp_getcache_with_lock()
369 if (tpcache == NULL) { in tcp_getcache_with_lock()
374 tpcache->tc_last_access = tcp_now; in tcp_getcache_with_lock()
377 return tpcache; in tcp_getcache_with_lock()
425 struct tcp_cache *__single tpcache; in tcp_cache_set_cookie_common() local
428 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_set_cookie_common()
429 if (tpcache == NULL) { in tcp_cache_set_cookie_common()
433 tpcache->tc_tfo_cookie_len = len > TFO_COOKIE_LEN_MAX ? in tcp_cache_set_cookie_common()
435 memcpy(tpcache->tc_tfo_cookie, cookie, tpcache->tc_tfo_cookie_len); in tcp_cache_set_cookie_common()
455 struct tcp_cache *__single tpcache; in tcp_cache_get_cookie_common() local
458 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_common()
459 if (tpcache == NULL) { in tcp_cache_get_cookie_common()
463 if (tpcache->tc_tfo_cookie_len == 0) { in tcp_cache_get_cookie_common()
472 VERIFY(tpcache->tc_tfo_cookie_len <= *len); in tcp_cache_get_cookie_common()
474 memcpy(cookie, tpcache->tc_tfo_cookie, tpcache->tc_tfo_cookie_len); in tcp_cache_get_cookie_common()
475 *len = tpcache->tc_tfo_cookie_len; in tcp_cache_get_cookie_common()
504 struct tcp_cache *__single tpcache; in tcp_cache_get_cookie_len_common() local
508 tpcache = tcp_getcache_with_lock(tcks, 1, &head); in tcp_cache_get_cookie_len_common()
509 if (tpcache == NULL) { in tcp_cache_get_cookie_len_common()
513 cookie_len = tpcache->tc_tfo_cookie_len; in tcp_cache_get_cookie_len_common()
542 struct tcp_cache *__single tpcache; in tcp_cache_get_mptcp_version() local
545 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_get_mptcp_version()
546 if (tpcache == NULL) { in tcp_cache_get_mptcp_version()
550 version = tpcache->tc_mptcp_version; in tcp_cache_get_mptcp_version()
553 if (!tpcache->tc_mptcp_version_confirmed && in tcp_cache_get_mptcp_version()
555 TSTMP_GEQ(tcp_now, tpcache->tc_mptcp_next_version_try)) { in tcp_cache_get_mptcp_version()
570 struct tcp_cache *__single tpcache; in tcp_cache_update_mptcp_version() local
589 tpcache = tcp_getcache_with_lock(&tcks, 1, &head); in tcp_cache_update_mptcp_version()
590 if (tpcache == NULL) { in tcp_cache_update_mptcp_version()
595 if (tpcache->tc_mptcp_version_confirmed) { in tcp_cache_update_mptcp_version()
602 tpcache->tc_mptcp_version_confirmed = true; in tcp_cache_update_mptcp_version()
603 tpcache->tc_mptcp_version = version; in tcp_cache_update_mptcp_version()
608 if (TSTMP_GEQ(tcp_now, tpcache->tc_mptcp_next_version_try)) { in tcp_cache_update_mptcp_version()
609 tpcache->tc_mptcp_next_version_try = tcp_now + tcp_min_to_hz(mptcp_version_timeout); in tcp_cache_update_mptcp_version()
615 tpcache->tc_mptcp_version = version == MPTCP_VERSION_0 ? MPTCP_VERSION_1 : MPTCP_VERSION_0; in tcp_cache_update_mptcp_version()
620 if (TSTMP_GEQ(tcp_now, tpcache->tc_mptcp_next_version_try)) { in tcp_cache_update_mptcp_version()
621 tpcache->tc_mptcp_next_version_try = tcp_now + tcp_min_to_hz(mptcp_version_timeout); in tcp_cache_update_mptcp_version()
1495 struct tcp_cache *__single tpcache, *__single tmp; in sysctl_cleartfocache() local
1500 SLIST_FOREACH_SAFE(tpcache, &head->tcp_caches, list, tmp) { in sysctl_cleartfocache()
1501 SLIST_REMOVE(&head->tcp_caches, tpcache, tcp_cache, list); in sysctl_cleartfocache()
1502 kfree_type(struct tcp_cache, tpcache); in sysctl_cleartfocache()
1661 struct tcp_cache *tpcache; variable
1664 SLIST_FOREACH(tpcache, &head->tcp_caches, list) {
1684 struct tcp_cache *tpcache; variable
1687 SLIST_FOREACH(tpcache, &head->tcp_caches, list) {
1691 cache_data.tc_last_access = tpcache->tc_last_access;
1693 cache_data.tc_key = tpcache->tc_key;
1695 cache_data.tc_key.tck_family = tpcache->tc_key.tck_family;
1697 memcpy(cache_data.tc_tfo_cookie, tpcache->tc_tfo_cookie, TFO_COOKIE_LEN_MAX);
1698 cache_data.tc_tfo_cookie_len = tpcache->tc_tfo_cookie_len;
1699 cache_data.tc_mptcp_version_confirmed = tpcache->tc_mptcp_version_confirmed;
1700 cache_data.tc_mptcp_version = tpcache->tc_mptcp_version;
1701 cache_data.tc_mptcp_next_version_try = tpcache->tc_mptcp_next_version_try;