From 3bb6b9ca3088b447721bed970a00defe422e6955 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Fri, 13 Dec 2024 10:06:57 +0100 Subject: [PATCH] nexthop: remove unused spinlock Nexthops are now only modified in the control plane thread. No need for a lock to guard the held packets list. Signed-off-by: Robin Jarry --- modules/infra/control/gr_nh_control.h | 2 -- modules/infra/control/nexthop.c | 2 -- modules/ip/control/gr_ip4_control.h | 1 - modules/ip6/control/gr_ip6_control.h | 1 - modules/ip6/datapath/ndp_ns_output.c | 1 - 5 files changed, 7 deletions(-) diff --git a/modules/infra/control/gr_nh_control.h b/modules/infra/control/gr_nh_control.h index ab4423ed..d128ab06 100644 --- a/modules/infra/control/gr_nh_control.h +++ b/modules/infra/control/gr_nh_control.h @@ -9,7 +9,6 @@ #include #include -#include // Forward declaration struct nexthop; @@ -80,7 +79,6 @@ struct __rte_cache_aligned nexthop { uint64_t last_reply; // packets waiting for address resolution - rte_spinlock_t lock; uint16_t held_pkts_num; struct rte_mbuf *held_pkts_head; struct rte_mbuf *held_pkts_tail; diff --git a/modules/infra/control/nexthop.c b/modules/infra/control/nexthop.c index 4726059b..d269b44c 100644 --- a/modules/infra/control/nexthop.c +++ b/modules/infra/control/nexthop.c @@ -182,7 +182,6 @@ struct nexthop *nexthop_lookup(struct nh_pool *nhp, uint16_t vrf_id, const void void nexthop_decref(struct nexthop *nh) { if (nh->ref_count <= 1) { struct nh_pool *nhp = nh->pool; - rte_spinlock_lock(&nh->lock); // Flush all held packets. struct rte_mbuf *m = nh->held_pkts_head; while (m != NULL) { @@ -192,7 +191,6 @@ void nexthop_decref(struct nexthop *nh) { } rte_mempool_put(nhp->mp, nh); memset(nh, 0, sizeof(*nh)); - rte_spinlock_unlock(&nh->lock); } else { nh->ref_count--; } diff --git a/modules/ip/control/gr_ip4_control.h b/modules/ip/control/gr_ip4_control.h index 4ccb29f9..85438974 100644 --- a/modules/ip/control/gr_ip4_control.h +++ b/modules/ip/control/gr_ip4_control.h @@ -12,7 +12,6 @@ #include #include #include -#include #include diff --git a/modules/ip6/control/gr_ip6_control.h b/modules/ip6/control/gr_ip6_control.h index 2e1e69ef..c90d505e 100644 --- a/modules/ip6/control/gr_ip6_control.h +++ b/modules/ip6/control/gr_ip6_control.h @@ -13,7 +13,6 @@ #include #include #include -#include #include diff --git a/modules/ip6/datapath/ndp_ns_output.c b/modules/ip6/datapath/ndp_ns_output.c index 886b420c..672fcb38 100644 --- a/modules/ip6/datapath/ndp_ns_output.c +++ b/modules/ip6/datapath/ndp_ns_output.c @@ -21,7 +21,6 @@ #include #include #include -#include enum { OUTPUT = 0,