mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-08 12:18:42 +00:00
BGP: using closer pointer for netindex hash than all the way to the table
This commit is contained in:
parent
8e67cba528
commit
9f7874a5c9
@ -1723,7 +1723,7 @@ bgp_get_prefix(struct bgp_ptx_private *c, struct netindex *ni, struct rte_src *s
|
||||
.ni = ni,
|
||||
};
|
||||
|
||||
net_lock_index(c->c->c.table->netindex, ni);
|
||||
net_lock_index(c->exporter.netindex, ni);
|
||||
rt_lock_source(src);
|
||||
|
||||
HASH_INSERT2(c->prefix_hash, PXH, c->pool, px);
|
||||
@ -1795,7 +1795,7 @@ bgp_free_prefix(struct bgp_ptx_private *c, struct bgp_prefix *px)
|
||||
{
|
||||
HASH_REMOVE2(c->prefix_hash, PXH, c->pool, px);
|
||||
|
||||
net_unlock_index(c->c->c.table->netindex, px->ni);
|
||||
net_unlock_index(c->exporter.netindex, px->ni);
|
||||
rt_unlock_source(px->src);
|
||||
|
||||
sl_free(px);
|
||||
@ -1885,7 +1885,7 @@ bgp_out_feed_net(struct rt_exporter *e, struct rcu_unwinder *u, u32 index, _Bool
|
||||
SKIP_BACK_DECLARE(struct bgp_ptx_private, c, exporter, e);
|
||||
ASSERT_DIE(DOMAIN_IS_LOCKED(rtable, c->lock));
|
||||
|
||||
struct netindex *ni = net_resolve_index(c->c->c.table->netindex, index);
|
||||
struct netindex *ni = net_resolve_index(c->exporter.netindex, index);
|
||||
if (ni == &net_index_out_of_range)
|
||||
return &rt_feed_index_out_of_range;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user