Skip to content

Commit

Permalink
nexthop: remove unused spinlock
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rjarry committed Dec 16, 2024
1 parent 86ac575 commit a3995ee
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 7 deletions.
2 changes: 0 additions & 2 deletions modules/infra/control/gr_nh_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <event2/event.h>
#include <rte_mbuf.h>
#include <rte_spinlock.h>

// Forward declaration
struct nexthop;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions modules/infra/control/nexthop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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--;
}
Expand Down
1 change: 0 additions & 1 deletion modules/ip/control/gr_ip4_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <rte_fib.h>
#include <rte_hash.h>
#include <rte_rcu_qsbr.h>
#include <rte_spinlock.h>

#include <stdint.h>

Expand Down
1 change: 0 additions & 1 deletion modules/ip6/control/gr_ip6_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <rte_hash.h>
#include <rte_ip6.h>
#include <rte_rcu_qsbr.h>
#include <rte_spinlock.h>

#include <stdint.h>

Expand Down
1 change: 0 additions & 1 deletion modules/ip6/datapath/ndp_ns_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <rte_ip.h>
#include <rte_mbuf.h>
#include <rte_ring.h>
#include <rte_spinlock.h>

enum {
OUTPUT = 0,
Expand Down

0 comments on commit a3995ee

Please sign in to comment.