summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/inet/tcp.h
diff options
context:
space:
mode:
authordh155122 <none@none>2007-01-19 16:59:38 -0800
committerdh155122 <none@none>2007-01-19 16:59:38 -0800
commitf4b3ec61df05330d25f55a36b975b4d7519fdeb1 (patch)
tree395c234b901886c84a82603a767e031fca136e09 /usr/src/uts/common/inet/tcp.h
parent2e59fc6dac28cd69376c21d6b90a5624160ba94c (diff)
downloadillumos-joyent-f4b3ec61df05330d25f55a36b975b4d7519fdeb1.tar.gz
PSARC 2006/366 IP Instances
6289221 RFE: Need virtualized ip-stack for each local zone 6512601 panic in ipsec_in_tag - allocation failure 6514637 error message from dhcpagent: add_pkt_opt: option type 60 is missing required value 6364643 RFE: allow persistent setting of interface flags per zone 6307539 RFE: Invalid network address causes zone boot failure 5041214 Allow IPMP configuration with zones 5005887 RFE: zoneadmd should support plumbing an interface via DHCP 4991139 RFE: zones should provide a mechanism to configure a defaultrouter for a zone 6218378 zoneadmd doesn't set the netmask for non-loopback addresses hosted on lo0 4963280 zones: need to virtualize the IPv6 default address selection mechanism 4963285 zones: need support of stateless address autoconfiguration for IPv6 5048068 zones don't boot if one of its interfaces has failed 5057154 RFE: ability to change interface status from within a zone 4963287 zones should support the plumbing of the first (and only) logical interface 4978517 TCP privileged port space should be partitioned per zone 5023347 zones don't work well with network routes other than default 4963372 investigate whether global zone can act as a router for local zones 6378364 RFE: Allow each zone to have its own virtual IPFilter
Diffstat (limited to 'usr/src/uts/common/inet/tcp.h')
-rw-r--r--usr/src/uts/common/inet/tcp.h63
1 files changed, 50 insertions, 13 deletions
diff --git a/usr/src/uts/common/inet/tcp.h b/usr/src/uts/common/inet/tcp.h
index a586064d3b..6937e3e9e0 100644
--- a/usr/src/uts/common/inet/tcp.h
+++ b/usr/src/uts/common/inet/tcp.h
@@ -36,9 +36,16 @@ extern "C" {
#include <sys/inttypes.h>
#include <netinet/ip6.h>
#include <netinet/tcp.h>
-#include <inet/tcp_sack.h>
#include <sys/socket.h>
#include <sys/multidata.h>
+#include <sys/md5.h>
+#include <inet/common.h>
+#include <inet/ip.h>
+#include <inet/ip6.h>
+#include <inet/mi.h>
+#include <inet/mib2.h>
+#include <inet/tcp_stack.h>
+#include <inet/tcp_sack.h>
#include <inet/kssl/ksslapi.h>
/*
@@ -142,12 +149,14 @@ struct conn_s;
typedef struct tcp_s {
/* Pointer to previous bind hash next. */
- struct tcp_s *tcp_time_wait_next;
+ struct tcp_s *tcp_time_wait_next;
/* Pointer to next T/W block */
- struct tcp_s *tcp_time_wait_prev;
+ struct tcp_s *tcp_time_wait_prev;
/* Pointer to previous T/W next */
- clock_t tcp_time_wait_expire;
- struct conn_s *tcp_connp;
+ clock_t tcp_time_wait_expire;
+
+ struct conn_s *tcp_connp;
+ tcp_stack_t *tcp_tcps; /* Shortcut via conn_netstack */
int32_t tcp_state;
int32_t tcp_rcv_ws; /* My window scale power */
@@ -603,16 +612,48 @@ typedef struct tcp_s {
#define TCP_DEBUG_GETPCSTACK(buffer, depth)
#endif
+/*
+ * Track a reference count on the tcps in order to know when
+ * the tcps_g_q can be removed. As long as there is any
+ * tcp_t, other that the tcps_g_q itself, in the tcp_stack_t we
+ * need to keep tcps_g_q around so that a closing connection can
+ * switch to using tcps_g_q as part of it closing.
+ */
+#define TCPS_REFHOLD(tcps) { \
+ atomic_add_32(&(tcps)->tcps_refcnt, 1); \
+ ASSERT((tcps)->tcps_refcnt != 0); \
+ DTRACE_PROBE1(tcps__refhold, tcp_stack_t, tcps); \
+}
+
+/*
+ * Decrement the reference count on the tcp_stack_t.
+ * In architectures e.g sun4u, where atomic_add_32_nv is just
+ * a cas, we need to maintain the right memory barrier semantics
+ * as that of mutex_exit i.e all the loads and stores should complete
+ * before the cas is executed. membar_exit() does that here.
+ */
+#define TCPS_REFRELE(tcps) { \
+ ASSERT((tcps)->tcps_refcnt != 0); \
+ membar_exit(); \
+ DTRACE_PROBE1(tcps__refrele, tcp_stack_t, tcps); \
+ if (atomic_add_32_nv(&(tcps)->tcps_refcnt, -1) == 0 && \
+ (tcps)->tcps_g_q != NULL) { \
+ /* Only tcps_g_q left */ \
+ tcp_g_q_inactive(tcps); \
+ } \
+}
+
extern void tcp_free(tcp_t *tcp);
-extern void tcp_ddi_init(void);
-extern void tcp_ddi_destroy(void);
+extern void tcp_ddi_g_init(void);
+extern void tcp_ddi_g_destroy(void);
+extern void tcp_g_q_inactive(tcp_stack_t *);
extern void tcp_xmit_listeners_reset(mblk_t *mp, uint_t ip_hdr_len,
- zoneid_t zoneid);
+ zoneid_t zoneid, tcp_stack_t *);
extern void tcp_conn_request(void *arg, mblk_t *mp, void *arg2);
extern void tcp_conn_request_unbound(void *arg, mblk_t *mp, void *arg2);
extern void tcp_input(void *arg, mblk_t *mp, void *arg2);
extern void tcp_rput_data(void *arg, mblk_t *mp, void *arg2);
-extern void *tcp_get_conn(void *arg);
+extern void *tcp_get_conn(void *arg, tcp_stack_t *);
extern void tcp_time_wait_collector(void *arg);
extern int tcp_snmp_get(queue_t *, mblk_t *);
extern int tcp_snmp_set(queue_t *, int, int, uchar_t *, int len);
@@ -627,15 +668,11 @@ extern mblk_t *tcp_xmit_mp(tcp_t *tcp, mblk_t *mp, int32_t max_to_send,
*
* The listener and acceptor hash queues are lists of tcp_t.
*/
-
/* listener hash and acceptor hash queue head */
typedef struct tf_s {
tcp_t *tf_tcp;
kmutex_t tf_lock;
} tf_t;
-
-extern mib2_tcp_t tcp_mib;
-
#endif /* (defined(_KERNEL) || defined(_KMEMUSER)) */
/* Contract private interface between TCP and Clustering. */