Skip to content

Commit b66bf55

Browse files
Nikolay Aleksandrovkuba-moo
authored andcommitted
net: bridge: multicast: optimize TO_INCLUDE EHT timeouts
This is an optimization specifically for TO_INCLUDE which sends queries for the older entries and thus lowers the S,G timers to LMQT. If we have the following situation for a group in either include or exclude mode: - host A was interested in srcs X and Y, but is timing out - host B sends TO_INCLUDE src Z, the bridge lowers X and Y's timeouts to LMQT - host B sends BLOCK src Z after LMQT time has passed => since host B is the last host we can delete the group, but if we still have host A's EHT entries for X and Y (i.e. if they weren't lowered to LMQT previously) then we'll have to wait another LMQT time before deleting the group, with this optimization we can directly remove it regardless of the group mode as there are no more interested hosts Signed-off-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ddc255d commit b66bf55

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

net/bridge/br_multicast_eht.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,8 @@ static bool __eht_inc_exc(struct net_bridge_port_group *pg,
656656
}
657657
/* we can be missing sets only if we've deleted some entries */
658658
if (flush_entries) {
659+
struct net_bridge *br = pg->key.port->br;
660+
struct net_bridge_group_eht_set *eht_set;
659661
struct net_bridge_group_src *src_ent;
660662
struct hlist_node *tmp;
661663

@@ -667,6 +669,25 @@ static bool __eht_inc_exc(struct net_bridge_port_group *pg,
667669
changed = true;
668670
continue;
669671
}
672+
/* this is an optimization for TO_INCLUDE where we lower
673+
* the set's timeout to LMQT to catch timeout hosts:
674+
* - host A (timing out): set entries X, Y
675+
* - host B: set entry Z (new from current TO_INCLUDE)
676+
* sends BLOCK Z after LMQT but host A's EHT
677+
* entries still exist (unless lowered to LMQT
678+
* so they can timeout with the S,Gs)
679+
* => we wait another LMQT, when we can just delete the
680+
* group immediately
681+
*/
682+
if (!(src_ent->flags & BR_SGRP_F_SEND) ||
683+
filter_mode != MCAST_INCLUDE ||
684+
!to_report)
685+
continue;
686+
eht_set = br_multicast_eht_set_lookup(pg,
687+
&eht_src_addr);
688+
if (!eht_set)
689+
continue;
690+
mod_timer(&eht_set->timer, jiffies + br_multicast_lmqt(br));
670691
}
671692
}
672693

0 commit comments

Comments
 (0)