5 #ifndef __INCLUDE_RTE_SCHED_COMMON_H__ 6 #define __INCLUDE_RTE_SCHED_COMMON_H__ 13 #include <sys/types.h> 16 static inline uint32_t
17 rte_min_pos_4_u16(uint16_t *x)
21 pos0 = (x[0] <= x[1])? 0 : 1;
22 pos1 = (x[2] <= x[3])? 2 : 3;
24 return (x[pos0] <= x[pos1])? pos0 : pos1;
30 static inline uint32_t
31 rte_min_pos_4_u16(uint16_t *x)
36 if (x[1] <= x[0]) pos0 = 1;
37 if (x[3] <= x[2]) pos1 = 3;
38 if (x[pos1] <= x[pos0]) pos0 = pos1;
51 static inline uint64_t
52 rte_get_gcd64(uint64_t a, uint64_t b)
79 static inline uint32_t
80 rte_get_gcd(uint32_t a, uint32_t b)
82 return rte_get_gcd64(a, b);
90 static inline uint32_t
91 rte_get_lcd(uint32_t a, uint32_t b)
93 return (a * b) / rte_get_gcd(a, b);