0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Merge commit 'v2.13.1-162-g5bf25678' into thread-next

This commit is contained in:
Maria Matejka 2024-01-27 19:01:06 +01:00
commit 57b5eb5cbd
3 changed files with 10 additions and 14 deletions

View File

@ -1014,12 +1014,12 @@ mpls_get_fec_by_label(struct mpls_fec_map *m, u32 label)
} }
struct mpls_fec * struct mpls_fec *
mpls_get_fec_by_net(struct mpls_fec_map *m, const net_addr *net, u32 path_id) mpls_get_fec_by_net(struct mpls_fec_map *m, const net_addr *net, u64 path_id)
{ {
if (!m->net_hash.data) if (!m->net_hash.data)
HASH_INIT(m->net_hash, m->pool, 4); HASH_INIT(m->net_hash, m->pool, 4);
u32 hash = net_hash(net) ^ u32_hash(path_id); u32 hash = net_hash(net) ^ u64_hash(path_id);
struct mpls_fec *fec = HASH_FIND(m->net_hash, NET, net, path_id, hash); struct mpls_fec *fec = HASH_FIND(m->net_hash, NET, net, path_id, hash);
if (fec) if (fec)

View File

@ -100,10 +100,6 @@ proto_configure_mpls_channel(struct proto *p, struct proto_config *pc, uint rts)
struct mpls_fec { struct mpls_fec {
u32 label; /* Label for FEC */ u32 label; /* Label for FEC */
u32 hash; /* Hash for primary key (net / rta) */ u32 hash; /* Hash for primary key (net / rta) */
union { /* Extension part of key */
u32 path_id; /* Source path_id */
};
u8 state; /* FEC state (MPLS_FEC_*) */ u8 state; /* FEC state (MPLS_FEC_*) */
u8 policy; /* Label policy (MPLS_POLICY_*) */ u8 policy; /* Label policy (MPLS_POLICY_*) */
@ -114,6 +110,11 @@ struct mpls_fec {
struct mpls_fec *next_k; /* Next in mpls_fec.net_hash/rta_hash */ struct mpls_fec *next_k; /* Next in mpls_fec.net_hash/rta_hash */
struct mpls_fec *next_l; /* Next in mpls_fec.label_hash */ struct mpls_fec *next_l; /* Next in mpls_fec.label_hash */
union { /* Extension part of key */
u64 path_id; /* Source path_id */
u32 class_id; /* Aaggregation class */
};
union { /* Primary key */ union { /* Primary key */
struct ea_storage *rta; struct ea_storage *rta;
struct iface *iface; struct iface *iface;
@ -146,7 +147,7 @@ void mpls_fec_map_reconfigure(struct mpls_fec_map *m, struct channel *C);
void mpls_fec_map_free(struct mpls_fec_map *m); void mpls_fec_map_free(struct mpls_fec_map *m);
struct mpls_fec *mpls_find_fec_by_label(struct mpls_fec_map *x, u32 label); struct mpls_fec *mpls_find_fec_by_label(struct mpls_fec_map *x, u32 label);
struct mpls_fec *mpls_get_fec_by_label(struct mpls_fec_map *m, u32 label); struct mpls_fec *mpls_get_fec_by_label(struct mpls_fec_map *m, u32 label);
struct mpls_fec *mpls_get_fec_by_net(struct mpls_fec_map *m, const net_addr *net, u32 path_id); struct mpls_fec *mpls_get_fec_by_net(struct mpls_fec_map *m, const net_addr *net, u64 path_id);
struct mpls_fec *mpls_get_fec_by_destination(struct mpls_fec_map *m, ea_list *dest); struct mpls_fec *mpls_get_fec_by_destination(struct mpls_fec_map *m, ea_list *dest);
void mpls_lock_fec(struct mpls_fec *fec); void mpls_lock_fec(struct mpls_fec *fec);

View File

@ -147,11 +147,6 @@ l3vpn_prepare_export_targets(struct l3vpn_proto *p)
ASSERT(p->export_target_length == len); ASSERT(p->export_target_length == len);
} }
/* Convert 64-bit RD to 32bit source ID, unfortunately it has collisions */
static inline struct rte_src * l3vpn_get_source(struct l3vpn_proto *p, u64 rd)
{ return rt_get_source(&p->p, (u32)(rd >> 32) ^ u32_hash(rd)); }
//{ return p->p.main_source; }
static void static void
l3vpn_rt_notify(struct proto *P, struct channel *c0, const net_addr *n0, rte *new, const rte *old UNUSED) l3vpn_rt_notify(struct proto *P, struct channel *c0, const net_addr *n0, rte *new, const rte *old UNUSED)
{ {
@ -180,14 +175,14 @@ l3vpn_rt_notify(struct proto *P, struct channel *c0, const net_addr *n0, rte *ne
case NET_VPN4: case NET_VPN4:
net_fill_ip4(n, net4_prefix(n0), net4_pxlen(n0)); net_fill_ip4(n, net4_prefix(n0), net4_pxlen(n0));
src = l3vpn_get_source(p, ((const net_addr_vpn4 *) n0)->rd); src = rt_get_source(&p->p, ((const net_addr_vpn4 *) n0)->rd);
dst = p->ip4_channel; dst = p->ip4_channel;
export = 0; export = 0;
break; break;
case NET_VPN6: case NET_VPN6:
net_fill_ip6(n, net6_prefix(n0), net6_pxlen(n0)); net_fill_ip6(n, net6_prefix(n0), net6_pxlen(n0));
src = l3vpn_get_source(p, ((const net_addr_vpn6 *) n0)->rd); src = rt_get_source(&p->p, ((const net_addr_vpn6 *) n0)->rd);
dst = p->ip6_channel; dst = p->ip6_channel;
export = 0; export = 0;
break; break;