Lines Matching refs:tswtcl_data
54 * Given a packet and the tswtcl_data it belongs to, this routine meters the
56 * the tswtcl_data.
60 tswtcl_process(mblk_t **mpp, tswtcl_data_t *tswtcl_data,
71 tswtcl_cfg_t *cfg_parms = tswtcl_data->cfg_parms;
75 atomic_inc_64(&tswtcl_data->epackets);
85 atomic_inc_64(&tswtcl_data->epackets);
94 atomic_inc_64(&tswtcl_data->epackets);
113 /* Update the avg_rate and win_front tswtcl_data */
114 mutex_enter(&tswtcl_data->tswtcl_lock);
117 bitsinwin = ((uint64_t)tswtcl_data->avg_rate * cfg_parms->window /
120 deltaT = now - tswtcl_data->win_front + cfg_parms->nsecwindow;
122 tswtcl_data->avg_rate = (uint64_t)bitsinwin * METER_SEC_TO_NSEC /
124 tswtcl_data->win_front = now;
126 if (tswtcl_data->avg_rate <= cfg_parms->committed_rate) {
128 } else if (tswtcl_data->avg_rate <= cfg_parms->peak_rate) {
143 rnd = min + (additive % (tswtcl_data->avg_rate - min + 1));
145 aminusc = tswtcl_data->avg_rate - cfg_parms->committed_rate;
168 rnd = min + (additive % (tswtcl_data->avg_rate - min + 1));
170 aminusp = tswtcl_data->avg_rate - cfg_parms->peak_rate;
181 mutex_exit(&tswtcl_data->tswtcl_lock);
185 atomic_inc_64(&tswtcl_data->green_packets);
186 atomic_add_64(&tswtcl_data->green_bits, pkt_len);
188 atomic_inc_64(&tswtcl_data->yellow_packets);
189 atomic_add_64(&tswtcl_data->yellow_bits, pkt_len);
192 atomic_inc_64(&tswtcl_data->red_packets);
193 atomic_add_64(&tswtcl_data->red_bits, pkt_len);