* @brief Decides if new packet should be enqueued or dropped * Updates run time data and gives verdict whether to enqueue or drop the packet. * * @param pie_cfg [in] config pointer to a PIE configuration parameter structure * @param pie [in,out] data pointer to PIE runtime data * @param qlen [in] queue length * @param pkt_len [in] packet length in bytes * @param time [in] current time stamp
| 322 | * @retval 1 drop the packet based on drop probability criteria |
| 323 | */ |
| 324 | static inline int |
| 325 | rte_pie_enqueue(const struct rte_pie_config *pie_cfg, |
| 326 | struct rte_pie *pie, |
| 327 | const unsigned int qlen, |
| 328 | uint32_t pkt_len, |
| 329 | const uint64_t time) |
| 330 | { |
| 331 | RTE_ASSERT(pie_cfg != NULL); |
| 332 | RTE_ASSERT(pie != NULL); |
| 333 | |
| 334 | if (qlen != 0) |
| 335 | return rte_pie_enqueue_nonempty(pie_cfg, pie, pkt_len, time); |
| 336 | else |
| 337 | return rte_pie_enqueue_empty(pie_cfg, pie, pkt_len); |
| 338 | } |
| 339 | |
| 340 | /** |
| 341 | * @brief PIE rate estimation method |