summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Pijewski <wdp@joyent.com>2011-07-25 17:23:13 -0700
committerRobert Mustacchi <rm@joyent.com>2013-11-16 00:38:19 -0800
commit4a0bd0711d2aa8c9386d9c275964fd49a79f7ea5 (patch)
treee9b11a69c1ed2ca17a8271c49d03c8ed5ef48e9a
parent1ddb55e64530b7536b48b3ce8a2a9ad78793aa40 (diff)
downloadillumos-joyent-4a0bd0711d2aa8c9386d9c275964fd49a79f7ea5.tar.gz
4303 want local zone TCP kstats in the global zone
Reviewed by: Robert Mustacchi <rm@joyent.com> Reviewed by: Sebastien Roy <seb@delphix.com> Approved by: Gordon Ross <gordon.ross@nexenta.com>
-rw-r--r--usr/src/uts/common/inet/tcp/tcp_stats.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/usr/src/uts/common/inet/tcp/tcp_stats.c b/usr/src/uts/common/inet/tcp/tcp_stats.c
index 6e729ff461..e6b13fe6c9 100644
--- a/usr/src/uts/common/inet/tcp/tcp_stats.c
+++ b/usr/src/uts/common/inet/tcp/tcp_stats.c
@@ -21,12 +21,14 @@
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, Joyent Inc. All rights reserved.
*/
#include <sys/types.h>
#include <sys/tihdr.h>
#include <sys/policy.h>
#include <sys/tsol/tnet.h>
+#include <sys/kstat.h>
#include <inet/common.h>
#include <inet/ip.h>
@@ -505,7 +507,7 @@ tcp_kstat_init(netstackid_t stackid)
{ "connTableSize6", KSTAT_DATA_INT32, 0 }
};
- ksp = kstat_create_netstack(TCP_MOD_NAME, 0, TCP_MOD_NAME, "mib2",
+ ksp = kstat_create_netstack(TCP_MOD_NAME, stackid, TCP_MOD_NAME, "mib2",
KSTAT_TYPE_NAMED, NUM_OF_FIELDS(tcp_named_kstat_t), 0, stackid);
if (ksp == NULL)
@@ -518,6 +520,13 @@ tcp_kstat_init(netstackid_t stackid)
ksp->ks_update = tcp_kstat_update;
ksp->ks_private = (void *)(uintptr_t)stackid;
+ /*
+ * If this is an exclusive netstack for a local zone, the global zone
+ * should still be able to read the kstat.
+ */
+ if (stackid != GLOBAL_NETSTACKID)
+ kstat_zone_add(ksp, GLOBAL_ZONEID);
+
kstat_install(ksp);
return (ksp);
}
@@ -733,7 +742,7 @@ tcp_kstat2_init(netstackid_t stackid)
#endif
};
- ksp = kstat_create_netstack(TCP_MOD_NAME, 0, "tcpstat", "net",
+ ksp = kstat_create_netstack(TCP_MOD_NAME, stackid, "tcpstat", "net",
KSTAT_TYPE_NAMED, sizeof (template) / sizeof (kstat_named_t), 0,
stackid);
@@ -744,6 +753,13 @@ tcp_kstat2_init(netstackid_t stackid)
ksp->ks_private = (void *)(uintptr_t)stackid;
ksp->ks_update = tcp_kstat2_update;
+ /*
+ * If this is an exclusive netstack for a local zone, the global zone
+ * should still be able to read the kstat.
+ */
+ if (stackid != GLOBAL_NETSTACKID)
+ kstat_zone_add(ksp, GLOBAL_ZONEID);
+
kstat_install(ksp);
return (ksp);
}