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

Function dummy_modify

dpdk/lib/fib/rte_fib6.c:66–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66static int
67dummy_modify(struct rte_fib6 *fib, const uint8_t ip[RTE_FIB6_IPV6_ADDR_SIZE],
68 uint8_t depth, uint64_t next_hop, int op)
69{
70 struct rte_rib6_node *node;
71 if ((fib == NULL) || (depth > RTE_FIB6_MAXDEPTH))
72 return -EINVAL;
73
74 node = rte_rib6_lookup_exact(fib->rib, ip, depth);
75
76 switch (op) {
77 case RTE_FIB6_ADD:
78 if (node == NULL)
79 node = rte_rib6_insert(fib->rib, ip, depth);
80 if (node == NULL)
81 return -rte_errno;
82 return rte_rib6_set_nh(node, next_hop);
83 case RTE_FIB6_DEL:
84 if (node == NULL)
85 return -ENOENT;
86 rte_rib6_remove(fib->rib, ip, depth);
87 return 0;
88 }
89 return -EINVAL;
90}
91
92static int
93init_dataplane(struct rte_fib6 *fib, __rte_unused int socket_id,

Callers

nothing calls this directly

Calls 4

rte_rib6_lookup_exactFunction · 0.85
rte_rib6_insertFunction · 0.85
rte_rib6_set_nhFunction · 0.85
rte_rib6_removeFunction · 0.85

Tested by

no test coverage detected