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

Function init_dataplane

dpdk/lib/fib/rte_fib6.c:92–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92static int
93init_dataplane(struct rte_fib6 *fib, __rte_unused int socket_id,
94 struct rte_fib6_conf *conf)
95{
96 char dp_name[sizeof(void *)];
97
98 snprintf(dp_name, sizeof(dp_name), "%p", fib);
99 switch (conf->type) {
100 case RTE_FIB6_DUMMY:
101 fib->dp = fib;
102 fib->lookup = dummy_lookup;
103 fib->modify = dummy_modify;
104 return 0;
105 case RTE_FIB6_TRIE:
106 fib->dp = trie_create(dp_name, socket_id, conf);
107 if (fib->dp == NULL)
108 return -rte_errno;
109 fib->lookup = trie_get_lookup_fn(fib->dp, RTE_FIB6_LOOKUP_DEFAULT);
110 fib->modify = trie_modify;
111 return 0;
112 default:
113 return -EINVAL;
114 }
115 return 0;
116}
117
118int
119rte_fib6_add(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE],

Callers 1

rte_fib6_createFunction · 0.70

Calls 3

snprintfFunction · 0.85
trie_createFunction · 0.85
trie_get_lookup_fnFunction · 0.85

Tested by

no test coverage detected