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

Function dummy_modify

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

Source from the content-addressed store, hash-verified

64}
65
66static int
67dummy_modify(struct rte_fib *fib, uint32_t ip, uint8_t depth,
68 uint64_t next_hop, int op)
69{
70 struct rte_rib_node *node;
71 if ((fib == NULL) || (depth > RTE_FIB_MAXDEPTH))
72 return -EINVAL;
73
74 node = rte_rib_lookup_exact(fib->rib, ip, depth);
75
76 switch (op) {
77 case RTE_FIB_ADD:
78 if (node == NULL)
79 node = rte_rib_insert(fib->rib, ip, depth);
80 if (node == NULL)
81 return -rte_errno;
82 return rte_rib_set_nh(node, next_hop);
83 case RTE_FIB_DEL:
84 if (node == NULL)
85 return -ENOENT;
86 rte_rib_remove(fib->rib, ip, depth);
87 return 0;
88 }
89 return -EINVAL;
90}
91
92static int
93init_dataplane(struct rte_fib *fib, __rte_unused int socket_id,

Callers

nothing calls this directly

Calls 4

rte_rib_lookup_exactFunction · 0.85
rte_rib_insertFunction · 0.85
rte_rib_set_nhFunction · 0.85
rte_rib_removeFunction · 0.85

Tested by

no test coverage detected