Print this page
1915 IPsec kstats shouldn't be persistent


 147 
 148 static taskq_t *esp_taskq;
 149 
 150 /*
 151  * OTOH, this one is set at open/close, and I'm D_MTQPAIR for now.
 152  *
 153  * Question:    Do I need this, given that all instance's esps->esps_wq point
 154  *              to IP?
 155  *
 156  * Answer:      Yes, because I need to know which queue is BOUND to
 157  *              IPPROTO_ESP
 158  */
 159 
 160 static int      esp_kstat_update(kstat_t *, int);
 161 
 162 static boolean_t
 163 esp_kstat_init(ipsecesp_stack_t *espstack, netstackid_t stackid)
 164 {
 165         espstack->esp_ksp = kstat_create_netstack("ipsecesp", 0, "esp_stat",
 166             "net", KSTAT_TYPE_NAMED,
 167             sizeof (esp_kstats_t) / sizeof (kstat_named_t),
 168             KSTAT_FLAG_PERSISTENT, stackid);
 169 
 170         if (espstack->esp_ksp == NULL || espstack->esp_ksp->ks_data == NULL)
 171                 return (B_FALSE);
 172 
 173         espstack->esp_kstats = espstack->esp_ksp->ks_data;
 174 
 175         espstack->esp_ksp->ks_update = esp_kstat_update;
 176         espstack->esp_ksp->ks_private = (void *)(uintptr_t)stackid;
 177 
 178 #define K64 KSTAT_DATA_UINT64
 179 #define KI(x) kstat_named_init(&(espstack->esp_kstats->esp_stat_##x), #x, K64)
 180 
 181         KI(num_aalgs);
 182         KI(num_ealgs);
 183         KI(good_auth);
 184         KI(bad_auth);
 185         KI(bad_padding);
 186         KI(replay_failures);
 187         KI(replay_early_failures);
 188         KI(keysock_in);




 147 
 148 static taskq_t *esp_taskq;
 149 
 150 /*
 151  * OTOH, this one is set at open/close, and I'm D_MTQPAIR for now.
 152  *
 153  * Question:    Do I need this, given that all instance's esps->esps_wq point
 154  *              to IP?
 155  *
 156  * Answer:      Yes, because I need to know which queue is BOUND to
 157  *              IPPROTO_ESP
 158  */
 159 
 160 static int      esp_kstat_update(kstat_t *, int);
 161 
 162 static boolean_t
 163 esp_kstat_init(ipsecesp_stack_t *espstack, netstackid_t stackid)
 164 {
 165         espstack->esp_ksp = kstat_create_netstack("ipsecesp", 0, "esp_stat",
 166             "net", KSTAT_TYPE_NAMED,
 167             sizeof (esp_kstats_t) / sizeof (kstat_named_t), 0, stackid);

 168 
 169         if (espstack->esp_ksp == NULL || espstack->esp_ksp->ks_data == NULL)
 170                 return (B_FALSE);
 171 
 172         espstack->esp_kstats = espstack->esp_ksp->ks_data;
 173 
 174         espstack->esp_ksp->ks_update = esp_kstat_update;
 175         espstack->esp_ksp->ks_private = (void *)(uintptr_t)stackid;
 176 
 177 #define K64 KSTAT_DATA_UINT64
 178 #define KI(x) kstat_named_init(&(espstack->esp_kstats->esp_stat_##x), #x, K64)
 179 
 180         KI(num_aalgs);
 181         KI(num_ealgs);
 182         KI(good_auth);
 183         KI(bad_auth);
 184         KI(bad_padding);
 185         KI(replay_failures);
 186         KI(replay_early_failures);
 187         KI(keysock_in);