Lines Matching refs:dql
3 * Dynamic queue limits (dql) - Definitions
7 * This header file contains the definitions for dynamic queue limits (dql).
8 * dql would be used in conjunction with a producer/consumer type queue
19 * The goal of dql is to calculate the limit as the minimum number of objects
22 * The primary functions of dql are:
29 * The dql implementation does not implement any locking for the dql data
45 #define DQL_HIST_ENT(dql, idx) ((dql)->history[(idx) % DQL_HIST_LEN])
47 struct dql {
88 static inline void dql_queue_stall(struct dql *dql)
96 * bit trackes time the packet was queued. The dql->history buffer
99 if (unlikely(now_hi != dql->history_head)) {
104 (dql->history_head + i) * BITS_PER_LONG)
106 DQL_HIST_ENT(dql, dql->history_head + i + 1) = 0;
110 WRITE_ONCE(dql->history_head, now_hi);
114 map = DQL_HIST_ENT(dql, now_hi);
118 WRITE_ONCE(DQL_HIST_ENT(dql, now_hi), map | BIT_MASK(now));
125 static inline void dql_queued(struct dql *dql, unsigned int count)
130 dql->last_obj_cnt = count;
139 dql->num_queued += count;
142 if (READ_ONCE(dql->stall_thrs))
143 dql_queue_stall(dql);
147 static inline int dql_avail(const struct dql *dql)
149 return READ_ONCE(dql->adj_limit) - READ_ONCE(dql->num_queued);
153 void dql_completed(struct dql *dql, unsigned int count);
155 /* Reset dql state */
156 void dql_reset(struct dql *dql);
158 /* Initialize dql state */
159 void dql_init(struct dql *dql, unsigned int hold_time);