TODO: To be tested */
| 296 | |
| 297 | /* TODO: To be tested */ |
| 298 | static inline uint16_t |
| 299 | route6_pkt(struct rte_mbuf *pkt, struct rt_ctx *rt_ctx) |
| 300 | { |
| 301 | uint8_t dst_ip[16]; |
| 302 | uint8_t *ip6_dst; |
| 303 | uint16_t offset; |
| 304 | uint32_t hop; |
| 305 | int ret; |
| 306 | |
| 307 | offset = RTE_ETHER_HDR_LEN + offsetof(struct ip6_hdr, ip6_dst); |
| 308 | ip6_dst = rte_pktmbuf_mtod_offset(pkt, uint8_t *, offset); |
| 309 | memcpy(&dst_ip[0], ip6_dst, 16); |
| 310 | |
| 311 | ret = rte_lpm6_lookup((struct rte_lpm6 *)rt_ctx, dst_ip, &hop); |
| 312 | |
| 313 | if (ret == 0) { |
| 314 | /* We have a hit */ |
| 315 | return hop; |
| 316 | } |
| 317 | |
| 318 | /* else */ |
| 319 | return RTE_MAX_ETHPORTS; |
| 320 | } |
| 321 | |
| 322 | static inline uint16_t |
| 323 | get_route(struct rte_mbuf *pkt, struct route_table *rt, enum pkt_type type) |
no test coverage detected