diff options
Diffstat (limited to 'usr/src/uts/common/inet/udp_impl.h')
| -rw-r--r-- | usr/src/uts/common/inet/udp_impl.h | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/usr/src/uts/common/inet/udp_impl.h b/usr/src/uts/common/inet/udp_impl.h index 4fbcbb5323..6a31ce5c22 100644 --- a/usr/src/uts/common/inet/udp_impl.h +++ b/usr/src/uts/common/inet/udp_impl.h @@ -86,9 +86,35 @@ typedef struct udp_stat { /* Class "net" kstats */ kstat_named_t udp_out_mapped; kstat_named_t udp_out_ipv4; #endif - } udp_stat_t; +/* + * This struct contains only the counter part of udp_stat_t. It is used + * in udp_stats_cpu_t instead of udp_stat_t to save memory space. + */ +typedef struct { + uint64_t udp_sock_fallback; + uint64_t udp_out_opt; + uint64_t udp_out_err_notconn; + uint64_t udp_out_err_output; + uint64_t udp_out_err_tudr; +#ifdef DEBUG + uint64_t udp_data_conn; + uint64_t udp_data_notconn; + uint64_t udp_out_lastdst; + uint64_t udp_out_diffdst; + uint64_t udp_out_ipv6; + uint64_t udp_out_mapped; + uint64_t udp_out_ipv4; +#endif +} udp_stat_counter_t; + +/* Per CPU stats: UDP MIB2 and UDP kstat. */ +typedef struct { + mib2_udp_t udp_sc_mib; + udp_stat_counter_t udp_sc_stats; +} udp_stats_cpu_t; + #define UDP_NUM_EPRIV_PORTS 64 /* Default buffer size and flow control wake up threshold. */ @@ -118,9 +144,6 @@ struct udp_stack { kstat_t *us_mibkp; /* kstats exporting mib data */ kstat_t *us_kstat; - udp_stat_t us_statistics; - - mib2_udp_t us_udp_mib; /* SNMP fixed size info */ /* * The smallest anonymous port in the priviledged port range which UDP @@ -129,6 +152,9 @@ struct udp_stack { in_port_t us_min_anonpriv_port; ldi_ident_t us_ldi_ident; + + udp_stats_cpu_t **us_sc; + int us_sc_cnt; }; typedef struct udp_stack udp_stack_t; @@ -194,9 +220,12 @@ typedef struct udpahdr_s { #define us_pmtu_discovery us_propinfo_tbl[11].prop_cur_bval #define us_sendto_ignerr us_propinfo_tbl[12].prop_cur_bval -#define UDP_STAT(us, x) ((us)->us_statistics.x.value.ui64++) +#define UDPS_BUMP_MIB(us, x) \ + BUMP_MIB(&(us)->us_sc[CPU->cpu_seqid]->udp_sc_mib, x) + +#define UDP_STAT(us, x) ((us)->us_sc[CPU->cpu_seqid]->udp_sc_stats.x++) #define UDP_STAT_UPDATE(us, x, n) \ - ((us)->us_statistics.x.value.ui64 += (n)) + ((us)->us->sc[CPU->cpu_seqid]->udp_sc_stats.x.value.ui64 += (n)) #ifdef DEBUG #define UDP_DBGSTAT(us, x) UDP_STAT(us, x) #else @@ -207,7 +236,7 @@ extern int udp_opt_default(queue_t *, t_scalar_t, t_scalar_t, uchar_t *); extern int udp_tpi_opt_get(queue_t *, t_scalar_t, t_scalar_t, uchar_t *); extern int udp_tpi_opt_set(queue_t *, uint_t, int, int, uint_t, uchar_t *, uint_t *, uchar_t *, void *, cred_t *); -extern mblk_t *udp_snmp_get(queue_t *, mblk_t *); +extern mblk_t *udp_snmp_get(queue_t *, mblk_t *, boolean_t); extern int udp_snmp_set(queue_t *, t_scalar_t, t_scalar_t, uchar_t *, int); extern void udp_ddi_g_init(void); extern void udp_ddi_g_destroy(void); @@ -215,6 +244,13 @@ extern void udp_output(conn_t *connp, mblk_t *mp, struct sockaddr *addr, socklen_t addrlen); extern void udp_wput(queue_t *, mblk_t *); +extern void *udp_kstat_init(netstackid_t stackid); +extern void udp_kstat_fini(netstackid_t stackid, kstat_t *ksp); +extern void *udp_kstat2_init(netstackid_t stackid); +extern void udp_kstat2_fini(netstackid_t, kstat_t *); + +extern void udp_stack_cpu_add(udp_stack_t *, processorid_t); + /* * Object to represent database of options to search passed to * {sock,tpi}optcom_req() interface routine to take care of option |
