1 Reply Latest reply: Nov 19, 2011 11:41 AM by sscdvp RSS

    kstat: invalid reactivation of dormant kstat

    899777
      Hi,

      If I try to add new kstat entries in my driver and remove old driver module to load new module then I get the warning:
      "" invalid reactivation of dormant kstat""
      Driver uses KSTAT_FLAG_PERSISTENT in kstat creation. But after reboot the entries show up. There are many drivers
      in solaris kernel, which use KSTAT_FLAG_PERSISTENT flag. So is it a acceptable warning.

      Thanks
        • 1. Re: kstat: invalid reactivation of dormant kstat
          sscdvp
          In fact it is shown as
          h4.
          WARNING: kstat_create(<kstat_provider_name>, 1, '<kstat_structure_name>'): invalid reactivation of dormant kstat

          You need to remove old persistent kstat in order to solve the issue.
          Solaris 11 has a routine - kstat_delete_persistent() for cleanup of dormant kstat,
          on Solaris 10 it can't be done.

          The following code block tries to reactivate kstat and to avoid failure if possible

          -----
          kstat_create_attempts = 0;
          retry_kstat_create:
          ksp = kstat_create (MODULE_NAME, instance_id,
          MODULE_KSTAT_STRUCTURE_NAME, "net", KSTAT_TYPE_NAMED,
          sizeof (obj_kstat_named_t) / sizeof (kstat_named_t),
          KSTAT_FLAG_PERSISTENT);
          kstat_create_attempts++;
          if (ksp == NULL) {                             
          #if defined kstat_delete_persistent
          ksp = kstat_hold_byname (MODULE_NAME, instance_id, MODULE_KSTAT_STRUCTURE_NAME, ALL_ZONES);
          if (ksp != NULL) {                                                                                                                    
          kstat_rele (ksp);
          kstat_delete_persistent (ksp);
          ksp = NULL;
          }
          #else
          kstat_delete_byname (MODULE_NAME, instance_id, MODULE_KSTAT_STRUCTURE_NAME);
          #endif
          if (kstat_create_attempts == 1)
          goto retry_kstat_create;
          cmn_err (CE_WARN, "instance ID %d: KSTAT structures will be available after reboot", instance_id);
          return;
          }

          -----