| 140 | } |
| 141 | |
| 142 | static inline int |
| 143 | app_pkt_handle(struct rte_mbuf *pkt, uint64_t time) |
| 144 | { |
| 145 | uint8_t input_color, output_color; |
| 146 | uint8_t *pkt_data = rte_pktmbuf_mtod(pkt, uint8_t *); |
| 147 | uint32_t pkt_len = rte_pktmbuf_pkt_len(pkt) - |
| 148 | sizeof(struct rte_ether_hdr); |
| 149 | uint8_t flow_id = (uint8_t)(pkt_data[APP_PKT_FLOW_POS] & (APP_FLOWS_MAX - 1)); |
| 150 | input_color = pkt_data[APP_PKT_COLOR_POS]; |
| 151 | enum policer_action action; |
| 152 | |
| 153 | /* color input is not used for blind modes */ |
| 154 | output_color = (uint8_t) FUNC_METER(&app_flows[flow_id], |
| 155 | &PROFILE, |
| 156 | time, |
| 157 | pkt_len, |
| 158 | (enum rte_color) input_color); |
| 159 | |
| 160 | /* Apply policing and set the output color */ |
| 161 | action = policer_table[input_color][output_color]; |
| 162 | app_set_pkt_color(pkt_data, action); |
| 163 | |
| 164 | return action; |
| 165 | } |
| 166 | |
| 167 | |
| 168 | static __rte_noreturn int |
no test coverage detected