+
+void
+ifclassq_calc_target_qdelay(struct ifnet *ifp, u_int64_t *if_target_qdelay)
+{
+ u_int64_t target_qdelay = 0;
+ target_qdelay = IFCQ_TARGET_QDELAY(&ifp->if_snd);
+
+ if (ifclassq_target_qdelay != 0)
+ target_qdelay = ifclassq_target_qdelay;
+
+ /*
+ * If we do not know the effective bandwidth, use the default
+ * target queue delay.
+ */
+ if (target_qdelay == 0)
+ target_qdelay = IFQ_TARGET_DELAY;
+
+ /*
+ * If a delay has been added to ifnet start callback for
+ * coalescing, we have to add that to the pre-set target delay
+ * because the packets can be in the queue longer.
+ */
+ if ((ifp->if_eflags & IFEF_ENQUEUE_MULTI) &&
+ ifp->if_start_delay_timeout > 0)
+ target_qdelay += ifp->if_start_delay_timeout;
+
+ *(if_target_qdelay) = target_qdelay;
+}
+
+void
+ifclassq_calc_update_interval(u_int64_t *update_interval)
+{
+ u_int64_t uint = 0;
+
+ /* If the system level override is set, use it */
+ if (ifclassq_update_interval != 0)
+ uint = ifclassq_update_interval;
+
+ /* Otherwise use the default value */
+ if (uint == 0)
+ uint = IFQ_UPDATE_INTERVAL;
+
+ *update_interval = uint;
+}