727 ksi64->hki64_last_read[HERMON_PERFCNTR64_RECV_PKTS_IDX],
728 sm_perfcntr.portrcpkts);
729 }
730
731 return (HERMON_CMD_SUCCESS);
732 }
733
734 /*
735 * hermon_kstat_perfcntr64_update_thread()
736 * Context: Entry point for a kernel thread
737 *
738 * Maintain 64 bit performance counters in software using the 32 bit
739 * hardware counters.
740 */
741 static void
742 hermon_kstat_perfcntr64_update_thread(void *arg)
743 {
744 hermon_state_t *state = (hermon_state_t *)arg;
745 hermon_ks_info_t *ksi = state->hs_ks_info;
746 uint_t i;
747 clock_t delta = drv_usectohz(1000000);
748
749 mutex_enter(&ksi->hki_perfcntr64_lock);
750 /*
751 * Every one second update the values 64 bit software counters
752 * for all ports. Exit if HERMON_PERFCNTR64_THREAD_EXIT flag is set.
753 */
754 while (!(ksi->hki_perfcntr64_flags & HERMON_PERFCNTR64_THREAD_EXIT)) {
755 for (i = 0; i < state->hs_cfg_profile->cp_num_ports; i++) {
756 if (ksi->hki_perfcntr64[i].hki64_enabled) {
757 (void) hermon_kstat_perfcntr64_read(state,
758 i + 1, 1);
759 }
760 }
761 /* sleep for a second */
762 (void) cv_reltimedwait(&ksi->hki_perfcntr64_cv,
763 &ksi->hki_perfcntr64_lock, delta, TR_CLOCK_TICK);
764 }
765 ksi->hki_perfcntr64_flags = 0;
766 mutex_exit(&ksi->hki_perfcntr64_lock);
767 }
|
727 ksi64->hki64_last_read[HERMON_PERFCNTR64_RECV_PKTS_IDX],
728 sm_perfcntr.portrcpkts);
729 }
730
731 return (HERMON_CMD_SUCCESS);
732 }
733
734 /*
735 * hermon_kstat_perfcntr64_update_thread()
736 * Context: Entry point for a kernel thread
737 *
738 * Maintain 64 bit performance counters in software using the 32 bit
739 * hardware counters.
740 */
741 static void
742 hermon_kstat_perfcntr64_update_thread(void *arg)
743 {
744 hermon_state_t *state = (hermon_state_t *)arg;
745 hermon_ks_info_t *ksi = state->hs_ks_info;
746 uint_t i;
747 clock_t delta = drv_sectohz(1);
748
749 mutex_enter(&ksi->hki_perfcntr64_lock);
750 /*
751 * Every one second update the values 64 bit software counters
752 * for all ports. Exit if HERMON_PERFCNTR64_THREAD_EXIT flag is set.
753 */
754 while (!(ksi->hki_perfcntr64_flags & HERMON_PERFCNTR64_THREAD_EXIT)) {
755 for (i = 0; i < state->hs_cfg_profile->cp_num_ports; i++) {
756 if (ksi->hki_perfcntr64[i].hki64_enabled) {
757 (void) hermon_kstat_perfcntr64_read(state,
758 i + 1, 1);
759 }
760 }
761 /* sleep for a second */
762 (void) cv_reltimedwait(&ksi->hki_perfcntr64_cv,
763 &ksi->hki_perfcntr64_lock, delta, TR_CLOCK_TICK);
764 }
765 ksi->hki_perfcntr64_flags = 0;
766 mutex_exit(&ksi->hki_perfcntr64_lock);
767 }
|