MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_pie_enqueue_empty

Function rte_pie_enqueue_empty

dpdk/lib/sched/rte_pie.h:115–136  ·  view source on GitHub ↗

* @brief Decides packet enqueue when queue is empty * * Note: packet is never dropped in this particular case. * * @param pie_cfg [in] config pointer to a PIE configuration parameter structure * @param pie [in, out] data pointer to PIE runtime data * @param pkt_len [in] packet length in bytes * * @return Operation status * @retval 0 enqueue the packet * @retval !0 drop the packet */

Source from the content-addressed store, hash-verified

113 * @retval !0 drop the packet
114 */
115static int
116rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
117 struct rte_pie *pie,
118 uint32_t pkt_len)
119{
120 RTE_ASSERT(pkt_len != 0);
121
122 /* Update the PIE qlen parameter */
123 pie->qlen++;
124 pie->qlen_bytes += pkt_len;
125
126 /**
127 * If the queue has been idle for a while, turn off PIE and Reset counters
128 */
129 if ((pie->active == 1) &&
130 (pie->qlen < (pie_cfg->tailq_th * 0.1))) {
131 pie->active = 0;
132 pie->in_measurement = 0;
133 }
134
135 return 0;
136}
137
138/**
139 * @brief make a decision to drop or enqueue a packet based on probability

Callers 1

rte_pie_enqueueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected