Lines Matching +full:max +full:- +full:virtual +full:- +full:functions

1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* IP Virtual Server
40 return net->ipvs; in net_ipvs()
74 iphdr->hdr_flags = hdr_flags; in ip_vs_fill_iph_skb_off()
75 iphdr->off = offset; in ip_vs_fill_iph_skb_off()
85 iphdr->saddr.in6 = iph->saddr; in ip_vs_fill_iph_skb_off()
86 iphdr->daddr.in6 = iph->daddr; in ip_vs_fill_iph_skb_off()
88 iphdr->len = offset; in ip_vs_fill_iph_skb_off()
89 iphdr->flags = 0; in ip_vs_fill_iph_skb_off()
90 iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, in ip_vs_fill_iph_skb_off()
91 &iphdr->fragoffs, in ip_vs_fill_iph_skb_off()
92 &iphdr->flags); in ip_vs_fill_iph_skb_off()
93 if (iphdr->protocol < 0) in ip_vs_fill_iph_skb_off()
104 iphdr->len = offset + iph->ihl * 4; in ip_vs_fill_iph_skb_off()
105 iphdr->fragoffs = 0; in ip_vs_fill_iph_skb_off()
106 iphdr->protocol = iph->protocol; in ip_vs_fill_iph_skb_off()
107 iphdr->saddr.ip = iph->saddr; in ip_vs_fill_iph_skb_off()
108 iphdr->daddr.ip = iph->daddr; in ip_vs_fill_iph_skb_off()
142 return !!(iph->hdr_flags & IP_VS_HDR_INVERSE); in ip_vs_iph_inverse()
148 return !!(iph->hdr_flags & IP_VS_HDR_ICMP); in ip_vs_iph_icmp()
156 dst->in6 = src->in6; in ip_vs_addr_copy()
159 dst->ip = src->ip; in ip_vs_addr_copy()
167 dst->in6 = src->in6; in ip_vs_addr_set()
171 dst->ip = src->ip; in ip_vs_addr_set()
172 dst->all[1] = 0; in ip_vs_addr_set()
173 dst->all[2] = 0; in ip_vs_addr_set()
174 dst->all[3] = 0; in ip_vs_addr_set()
182 return ipv6_addr_equal(&a->in6, &b->in6); in ip_vs_addr_equal()
184 return a->ip == b->ip; in ip_vs_addr_equal()
199 len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6c]", in ip_vs_dbg_addr()
200 &addr->in6) + 1; in ip_vs_dbg_addr()
203 len = snprintf(&buf[*idx], buf_len - *idx, "%pI4", in ip_vs_dbg_addr()
204 &addr->ip) + 1; in ip_vs_dbg_addr()
208 return &buf[*idx - len]; in ip_vs_dbg_addr()
244 pp->debug_packet(af, pp, skb, ofs, msg); \
250 pp->debug_packet(af, pp, skb, ofs, msg); \
368 s32 ktid:16, /* kthread ID, -1=temp list */
374 * IPVS statistics object, 64-bit kernel version of struct ip_vs_stats_user
410 /* Estimation uses a 2-second period containing ticks (in jiffies) */
461 int chain_max; /* max ests per tick chain */
462 int tick_max; /* max ests per tick */
464 int est_max_count; /* max ests per kthread */
571 union nf_inet_addr vaddr; /* virtual address */
633 /* virtual service addresses */
636 union nf_inet_addr addr; /* virtual ip address */
640 /* virtual service options */
643 unsigned int flags; /* virtual service flags */
672 * The information about the virtual service offered to the net and the
677 struct hlist_node f_list; /* for fwmark-based service table */
682 union nf_inet_addr addr; /* IP address for virtual service */
690 struct list_head destinations; /* real server d-linked list */
747 /* for virtual service */
750 __be16 vport; /* virtual port number */
751 union nf_inet_addr vaddr; /* virtual IP address */
761 struct list_head n_list; /* d-linked list head */
785 struct list_head n_list; /* d-linked list head */
797 /* create connections for real-server outgoing packets */
902 #define IP_VS_RTAB_MASK (IP_VS_RTAB_SIZE - 1)
914 #define TCP_APP_TAB_MASK (TCP_APP_TAB_SIZE - 1)
921 #define UDP_APP_TAB_MASK (UDP_APP_TAB_SIZE - 1)
928 #define SCTP_APP_TAB_MASK (SCTP_APP_TAB_SIZE - 1)
938 int num_services; /* no of virtual services */
939 int num_services6; /* IPv6 virtual services */
953 /* 1/rate drop and drop-entry variables */
964 /* sys-ctl struct */
1064 return ipvs->sysctl_sync_threshold[0]; in sysctl_sync_threshold()
1069 return READ_ONCE(ipvs->sysctl_sync_threshold[1]); in sysctl_sync_period()
1074 return READ_ONCE(ipvs->sysctl_sync_refresh_period); in sysctl_sync_refresh_period()
1079 return ipvs->sysctl_sync_retries; in sysctl_sync_retries()
1084 return ipvs->sysctl_sync_ver; in sysctl_sync_ver()
1089 return ipvs->sysctl_sloppy_tcp; in sysctl_sloppy_tcp()
1094 return ipvs->sysctl_sloppy_sctp; in sysctl_sloppy_sctp()
1099 return READ_ONCE(ipvs->sysctl_sync_ports); in sysctl_sync_ports()
1104 return ipvs->sysctl_sync_persist_mode; in sysctl_sync_persist_mode()
1109 return ipvs->sysctl_sync_qlen_max; in sysctl_sync_qlen_max()
1114 return ipvs->sysctl_sync_sock_size; in sysctl_sync_sock_size()
1119 return ipvs->sysctl_pmtu_disc; in sysctl_pmtu_disc()
1124 return ipvs->sync_state & IP_VS_STATE_BACKUP && in sysctl_backup_only()
1125 ipvs->sysctl_backup_only; in sysctl_backup_only()
1130 return ipvs->sysctl_conn_reuse_mode; in sysctl_conn_reuse_mode()
1135 return ipvs->sysctl_expire_nodest_conn; in sysctl_expire_nodest_conn()
1140 return ipvs->sysctl_schedule_icmp; in sysctl_schedule_icmp()
1145 return ipvs->sysctl_ignore_tunneled; in sysctl_ignore_tunneled()
1150 return ipvs->sysctl_cache_bypass; in sysctl_cache_bypass()
1155 return ipvs->sysctl_run_estimation; in sysctl_run_estimation()
1160 if (ipvs->est_cpulist_valid) in sysctl_est_cpulist()
1161 return ipvs->sysctl_est_cpulist; in sysctl_est_cpulist()
1168 return ipvs->sysctl_est_nice; in sysctl_est_nice()
1280 /* IPVS core functions
1295 /* ip_vs_conn handling functions
1312 p->ipvs = ipvs; in ip_vs_conn_fill_param()
1313 p->af = af; in ip_vs_conn_fill_param()
1314 p->protocol = protocol; in ip_vs_conn_fill_param()
1315 p->caddr = caddr; in ip_vs_conn_fill_param()
1316 p->cport = cport; in ip_vs_conn_fill_param()
1317 p->vaddr = vaddr; in ip_vs_conn_fill_param()
1318 p->vport = vport; in ip_vs_conn_fill_param()
1319 p->pe = NULL; in ip_vs_conn_fill_param()
1320 p->pe_data = NULL; in ip_vs_conn_fill_param()
1337 * By default, RCU read-side critical sections have access only to
1342 return refcount_inc_not_zero(&cp->refcnt); in __ip_vs_conn_get()
1349 refcount_dec(&cp->refcnt); in __ip_vs_conn_put()
1370 struct ip_vs_conn *ctl_cp = cp->control; in ip_vs_control_del()
1374 IP_VS_DBG_ADDR(cp->af, &cp->caddr), in ip_vs_control_del()
1375 ntohs(cp->cport), in ip_vs_control_del()
1376 IP_VS_DBG_ADDR(cp->af, &cp->vaddr), in ip_vs_control_del()
1377 ntohs(cp->vport)); in ip_vs_control_del()
1384 IP_VS_DBG_ADDR(cp->af, &cp->caddr), in ip_vs_control_del()
1385 ntohs(cp->cport), in ip_vs_control_del()
1386 IP_VS_DBG_ADDR(cp->af, &ctl_cp->caddr), in ip_vs_control_del()
1387 ntohs(ctl_cp->cport)); in ip_vs_control_del()
1389 cp->control = NULL; in ip_vs_control_del()
1390 if (atomic_read(&ctl_cp->n_control) == 0) { in ip_vs_control_del()
1393 IP_VS_DBG_ADDR(cp->af, &cp->caddr), in ip_vs_control_del()
1394 ntohs(cp->cport), in ip_vs_control_del()
1395 IP_VS_DBG_ADDR(cp->af, &cp->vaddr), in ip_vs_control_del()
1396 ntohs(cp->vport)); in ip_vs_control_del()
1400 atomic_dec(&ctl_cp->n_control); in ip_vs_control_del()
1406 if (cp->control) { in ip_vs_control_add()
1409 IP_VS_DBG_ADDR(cp->af, &cp->caddr), in ip_vs_control_add()
1410 ntohs(cp->cport), in ip_vs_control_add()
1411 IP_VS_DBG_ADDR(cp->af, &cp->vaddr), in ip_vs_control_add()
1412 ntohs(cp->vport)); in ip_vs_control_add()
1419 IP_VS_DBG_ADDR(cp->af, &cp->caddr), in ip_vs_control_add()
1420 ntohs(cp->cport), in ip_vs_control_add()
1421 IP_VS_DBG_ADDR(cp->af, &ctl_cp->caddr), in ip_vs_control_add()
1422 ntohs(ctl_cp->cport)); in ip_vs_control_add()
1424 cp->control = ctl_cp; in ip_vs_control_add()
1425 atomic_inc(&ctl_cp->n_control); in ip_vs_control_add()
1432 struct ip_vs_conn *ct = cp->control; in ip_vs_control_assure_ct()
1434 if (ct && !(ct->state & IP_VS_CTPL_S_ASSURED) && in ip_vs_control_assure_ct()
1435 (ct->flags & IP_VS_CONN_F_TEMPLATE)) in ip_vs_control_assure_ct()
1436 ct->state |= IP_VS_CTPL_S_ASSURED; in ip_vs_control_assure_ct()
1439 /* IPVS netns init & cleanup functions */
1454 /* IPVS application functions
1479 if (pe && pe->module) \
1480 __module_get(pe->module);
1483 if (pe && pe->module) \
1484 module_put(pe->module);
1486 /* IPVS protocol functions (from ip_vs_proto.c) */
1502 /* Registering/unregistering scheduler functions
1522 /* IPVS control data and functions (from ip_vs_ctl.c) */
1555 refcount_inc(&dest->refcnt); in ip_vs_dest_hold()
1561 refcount_dec(&dest->refcnt); in ip_vs_dest_put()
1566 if (refcount_dec_and_test(&dest->refcnt)) in ip_vs_dest_put_and_free()
1592 ipvs->est_stopped = !sysctl_run_estimation(ipvs) || in ip_vs_est_stopped_recalc()
1593 (ipvs->est_cpulist_valid && in ip_vs_est_stopped_recalc()
1601 return ipvs->est_stopped; in ip_vs_est_stopped()
1612 return max(1U, limit); in ip_vs_est_max_threads()
1652 if (!ipvs->drop_rate) in ip_vs_todrop()
1654 if (--ipvs->drop_counter > 0) in ip_vs_todrop()
1656 ipvs->drop_counter = ipvs->drop_rate; in ip_vs_todrop()
1671 &ipvs->expire_nodest_conn_work, 1); in ip_vs_enqueue_expire_nodest_conns()
1679 #define IP_VS_DFWD_METHOD(dest) (atomic_read(&(dest)->conn_flags) & \
1683 #define IP_VS_FWD_METHOD(cp) (cp->flags & IP_VS_CONN_F_FWD_MASK)
1749 nf_conntrack_put(&ct->ct_general); in ip_vs_notrack()
1762 return ipvs->sysctl_conntrack; in ip_vs_conntrack_enabled()
1816 int afmask = (svc->af == AF_INET6) ? 2 : 1; in ip_vs_register_conntrack()
1819 if (!(svc->conntrack_afmask & afmask)) { in ip_vs_register_conntrack()
1820 ret = nf_ct_netns_get(svc->ipvs->net, svc->af); in ip_vs_register_conntrack()
1822 svc->conntrack_afmask |= afmask; in ip_vs_register_conntrack()
1833 int afmask = (svc->af == AF_INET6) ? 2 : 1; in ip_vs_unregister_conntrack()
1835 if (svc->conntrack_afmask & afmask) { in ip_vs_unregister_conntrack()
1836 nf_ct_netns_put(svc->ipvs->net, svc->af); in ip_vs_unregister_conntrack()
1837 svc->conntrack_afmask &= ~afmask; in ip_vs_unregister_conntrack()
1852 * dest->activeconns*256 + dest->inactconns in ip_vs_dest_conn_overhead()
1854 return (atomic_read(&dest->activeconns) << 8) + in ip_vs_dest_conn_overhead()
1855 atomic_read(&dest->inactconns); in ip_vs_dest_conn_overhead()