1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(C) 2022 Marvell International Ltd. 3 */ 4 5 #ifndef RTE_CMAN_H 6 #define RTE_CMAN_H 7 8 #include <rte_bitops.h> 9 10 /** 11 * @file 12 * Congestion management related parameters for DPDK. 13 */ 14 15 /** Congestion management modes */ 16 enum rte_cman_mode { 17 /** 18 * Congestion based on Random Early Detection. 19 * 20 * https://en.wikipedia.org/wiki/Random_early_detection 21 * http://www.aciri.org/floyd/papers/red/red.html 22 * @see struct rte_cman_red_params 23 */ 24 RTE_CMAN_RED = RTE_BIT32(0), 25 }; 26 27 /** 28 * RED based congestion management configuration parameters. 29 */ 30 struct rte_cman_red_params { 31 /** 32 * Minimum threshold (min_th) value 33 * 34 * Value expressed as percentage. Value must be in 0 to 100(inclusive). 35 */ 36 uint8_t min_th; 37 /** 38 * Maximum threshold (max_th) value 39 * 40 * Value expressed as percentage. Value must be in 0 to 100(inclusive). 41 */ 42 uint8_t max_th; 43 /** Inverse of packet marking probability maximum value (maxp = 1 / maxp_inv) */ 44 uint16_t maxp_inv; 45 }; 46 47 #endif /* RTE_CMAN_H */ 48