MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ip6_rewrite_node_add

Function ip6_rewrite_node_add

dpdk/app/graph/neigh.c:76–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76static int
77ip6_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
106static int
107ip4_rewrite_node_add(struct neigh_ipv4_config *v4_config)

Callers 2

neigh_ip6_addFunction · 0.85
neigh_ip6_add_to_rewriteFunction · 0.85

Calls 6

ethdev_portid_by_ip6Function · 0.85
memsetFunction · 0.85
rte_eth_macaddr_getFunction · 0.85
rte_node_ip6_rewrite_addFunction · 0.85
printfFunction · 0.50
rte_memcpyFunction · 0.50

Tested by

no test coverage detected