Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc fixes: ip6 #174

Merged
merged 3 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/infra/datapath/main_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ void *gr_datapath_loop(void *priv) {
shutdown:
log(NOTICE, "shutting down tid=%d", w->tid);
atomic_store(&w->stats, NULL);
rte_graph_cluster_stats_destroy(ctx.stats);
if (ctx.stats)
rte_graph_cluster_stats_destroy(ctx.stats);
rte_free(ctx.w_stats);
rte_thread_unregister();
w->lcore_id = LCORE_ID_ANY;
Expand Down
6 changes: 5 additions & 1 deletion modules/ip/control/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,14 @@ void rib4_cleanup(struct nexthop *nh) {
uintptr_t nh_id;
ip4_addr_t ip;

rib4_delete(nh->vrf_id, nh->ipv4, 32);
local_ip = nh->ipv4;
local_prefixlen = nh->prefixlen;

if (nh->flags & (GR_NH_F_LOCAL | GR_NH_F_LINK))
rib4_delete(nh->vrf_id, nh->ipv4, nh->prefixlen);
else
rib4_delete(nh->vrf_id, nh->ipv4, 32);

rib = get_rib(nh->vrf_id);
while ((rn = rte_rib_get_nxt(rib, 0, 0, rn, RTE_RIB_GET_NXT_ALL)) != NULL) {
rte_rib_get_nh(rn, &nh_id);
Expand Down
6 changes: 5 additions & 1 deletion modules/ip6/control/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,14 @@ void rib6_cleanup(struct nexthop *nh) {
struct rte_rib6 *rib;
uintptr_t nh_id;

rib6_delete(nh->vrf_id, nh->iface_id, &nh->ipv6, RTE_IPV6_MAX_DEPTH);
local_ip = nh->ipv6;
local_depth = nh->prefixlen;

if (nh->flags & (GR_NH_F_LOCAL | GR_NH_F_LINK))
rib6_delete(nh->vrf_id, nh->iface_id, &nh->ipv6, nh->prefixlen);
else
rib6_delete(nh->vrf_id, nh->iface_id, &nh->ipv6, RTE_IPV6_MAX_DEPTH);

rib = get_rib6(nh->vrf_id);
while ((rn = rte_rib6_get_nxt(rib, 0, 0, rn, RTE_RIB6_GET_NXT_ALL)) != NULL) {
rte_rib6_get_nh(rn, &nh_id);
Expand Down
4 changes: 4 additions & 0 deletions smoke/ip6_add_del_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@

p0=${run_id}0

grcli add interface port $p0 devargs net_tap0,iface=$p0 mac f0:0d:ac:dc:00:00
grcli del interface $p0
grcli add interface port $p0 devargs net_tap0,iface=$p0 mac f0:0d:ac:dc:00:00

grcli add ip6 address 2001::1/64 iface $p0
grcli show ip6 address
grcli del ip6 address 2001::1/64 iface $p0
grcli show ip6 address
grcli add ip6 address 2001::1/64 iface $p0
grcli show ip6 address
2 changes: 2 additions & 0 deletions smoke/ip_add_del_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ grcli add ip address 172.16.0.1/24 iface $p0
grcli show ip address
grcli del ip address 172.16.0.1/24 iface $p0
grcli show ip address
grcli add ip address 172.16.0.1/24 iface $p0
grcli show ip address