Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/dpdk_rte_lpm/dpdk_lpm.c
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
get_parent_rule(struct dpdk_lpm_data *dd, struct in_addr addr, uint8_t *plen, uint32_t *nhop_idx) | get_parent_rule(struct dpdk_lpm_data *dd, struct in_addr addr, uint8_t *plen, uint32_t *nhop_idx) | ||||
{ | { | ||||
struct route_nhop_data rnd; | struct route_nhop_data rnd; | ||||
struct rtentry *rt; | struct rtentry *rt; | ||||
rt = fib4_lookup_rt(dd->fibnum, addr, 0, NHR_UNLOCKED, &rnd); | rt = fib4_lookup_rt(dd->fibnum, addr, 0, NHR_UNLOCKED, &rnd); | ||||
if (rt != NULL) { | if (rt != NULL) { | ||||
/* FIXME check gw_sa.sa_family */ | |||||
melifaro: Does it matter? The only thing that should be relevant for the lookup algos is the nexthop… | |||||
struct in_addr addr4; | struct in_addr addr4; | ||||
uint32_t scopeid; | uint32_t scopeid; | ||||
int inet_plen; | int inet_plen; | ||||
rt_get_inet_prefix_plen(rt, &addr4, &inet_plen, &scopeid); | rt_get_inet_prefix_plen(rt, &addr4, &inet_plen, &scopeid); | ||||
if (inet_plen > 0) { | if (inet_plen > 0) { | ||||
*plen = inet_plen; | *plen = inet_plen; | ||||
*nhop_idx = fib_get_nhop_idx(dd->fd, rnd.rnd_nhop); | *nhop_idx = fib_get_nhop_idx(dd->fd, rnd.rnd_nhop); | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 272 Lines • Show Last 20 Lines |
Does it matter? The only thing that should be relevant for the lookup algos is the nexthop index.