Skip to content

Commit

Permalink
nexthop: prevent creation from datapath workers
Browse files Browse the repository at this point in the history
Nexthops should only be allocated from the control plane thread. Ensure
no datapath thread can create one.

Signed-off-by: Robin Jarry <[email protected]>
  • Loading branch information
rjarry committed Jan 28, 2025
1 parent 7e42875 commit a827035
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/infra/control/nexthop.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ nexthop_new(struct nh_pool *nhp, uint16_t vrf_id, uint16_t iface_id, const void
void *data;
int ret;

if (rte_lcore_has_role(rte_lcore_id(), ROLE_NON_EAL))
ABORT("nexthop created from datapath thread");

if (nhp == NULL)
ABORT("nhp == NULL");

Expand Down

0 comments on commit a827035

Please sign in to comment.