Skip to content

Commit

Permalink
northd: Fix multicast table full comparison.
Browse files Browse the repository at this point in the history
atomic_compare_exchange_strong(src, exp, dst) returns false if
*exp != src and stores src in *exp.

This was overwriting mcast_sw_info->table_size with 0 every time the
first igmp group was processed, causing all others to be skipped.

Fixes: 74daa06 ("ovn-northd: Introduce parallel lflow build")
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1979870
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
dceara authored and numansiddique committed Jul 13, 2021
1 parent ca66895 commit 969c98d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions northd/ovn-northd.c
Expand Up @@ -7611,6 +7611,7 @@ build_lswitch_ip_mcast_igmp_mld(struct ovn_igmp_group *igmp_group,

struct mcast_switch_info *mcast_sw_info =
&igmp_group->datapath->mcast_info.sw;
uint64_t table_size = mcast_sw_info->table_size;

if (IN6_IS_ADDR_V4MAPPED(&igmp_group->address)) {
/* RFC 4541, section 2.1.2, item 2: Skip groups in the 224.0.0.X
Expand All @@ -7621,10 +7622,8 @@ build_lswitch_ip_mcast_igmp_mld(struct ovn_igmp_group *igmp_group,
if (ip_is_local_multicast(group_address)) {
return;
}

if (atomic_compare_exchange_strong(
&mcast_sw_info->active_v4_flows,
(uint64_t *) &mcast_sw_info->table_size,
&mcast_sw_info->active_v4_flows, &table_size,
mcast_sw_info->table_size)) {
return;
}
Expand All @@ -7639,8 +7638,7 @@ build_lswitch_ip_mcast_igmp_mld(struct ovn_igmp_group *igmp_group,
return;
}
if (atomic_compare_exchange_strong(
&mcast_sw_info->active_v6_flows,
(uint64_t *) &mcast_sw_info->table_size,
&mcast_sw_info->active_v6_flows, &table_size,
mcast_sw_info->table_size)) {
return;
}
Expand Down

0 comments on commit 969c98d

Please sign in to comment.