| 74 | } |
| 75 | |
| 76 | static int |
| 77 | ip6_rewrite_node_add(struct neigh_ipv6_config *v6_config) |
| 78 | { |
| 79 | uint8_t data[2 * RTE_ETHER_ADDR_LEN]; |
| 80 | uint8_t len = 2 * RTE_ETHER_ADDR_LEN; |
| 81 | struct rte_ether_addr smac; |
| 82 | int16_t portid = 0; |
| 83 | int rc; |
| 84 | |
| 85 | portid = ethdev_portid_by_ip6(v6_config->ip, NULL); |
| 86 | if (portid < 0) { |
| 87 | printf("Invalid portid found to add neigh\n"); |
| 88 | return -EINVAL; |
| 89 | } |
| 90 | |
| 91 | memset(data, 0, len); |
| 92 | |
| 93 | /* Copy dst mac */ |
| 94 | rte_memcpy((void *)&data[0], (void *)&v6_config->mac, RTE_ETHER_ADDR_LEN); |
| 95 | |
| 96 | /* Copy src mac */ |
| 97 | rc = rte_eth_macaddr_get(portid, &smac); |
| 98 | if (rc < 0) |
| 99 | return rc; |
| 100 | |
| 101 | rte_memcpy(&data[RTE_ETHER_ADDR_LEN], smac.addr_bytes, RTE_ETHER_ADDR_LEN); |
| 102 | |
| 103 | return rte_node_ip6_rewrite_add(portid, data, len, portid); |
| 104 | } |
| 105 | |
| 106 | static int |
| 107 | ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config) |
no test coverage detected