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 #ifdef __cplusplus 9 extern "C" { 10 #endif 11 12 #include <rte_bitops.h> 13 14 /** 15 * @file 16 * Congestion management related parameters for DPDK. 17 */ 18 19 /** Congestion management modes */ 20 enum rte_cman_mode { 21 /** 22 * Congestion based on Random Early Detection. 23 * 24 * https://en.wikipedia.org/wiki/Random_early_detection 25 * http://www.aciri.org/floyd/papers/red/red.html 26 * @see struct rte_cman_red_params 27 */ 28 RTE_CMAN_RED = RTE_BIT32(0), 29 }; 30 31 /** 32 * RED based congestion management configuration parameters. 33 */ 34 struct rte_cman_red_params { 35 /** 36 * Minimum threshold (min_th) value 37 * 38 * Value expressed as percentage. Value must be in 0 to 100(inclusive). 39 */ 40 uint8_t min_th; 41 /** 42 * Maximum threshold (max_th) value 43 * 44 * Value expressed as percentage. Value must be in 0 to 100(inclusive). 45 */ 46 uint8_t max_th; 47 /** Inverse of packet marking probability maximum value (maxp = 1 / maxp_inv) */ 48 uint16_t maxp_inv; 49 }; 50 51 #ifdef __cplusplus 52 } 53 #endif 54 55 #endif /* RTE_CMAN_H */ 56