diff --git a/net-shaper/src/main.rs b/net-shaper/src/main.rs index b1cc924eedfff7..966b4ec910a70a 100644 --- a/net-shaper/src/main.rs +++ b/net-shaper/src/main.rs @@ -273,13 +273,13 @@ fn delete_ifb(interface: &str) -> bool { ], "Failed to setup ingress qdisc", "tc qdisc delete dev handle ffff: ingress", - false, + true, ) && run( "modprobe", &["ifb", "--remove"], "Failed to delete ifb module", "modprobe ifb --remove", - false, + true, ) } @@ -407,7 +407,7 @@ fn shape_network_steps( ); println!("My partition is {}", my_partition); - force_cleanup_network(interface); + cleanup_network(interface); // Mark egress packets with our partition id if !insert_iptables_rule(partition_id_to_tos(my_partition)) { @@ -466,7 +466,7 @@ fn parse_interface(interfaces: &str) -> &str { panic!("No valid interfaces"); } -fn force_cleanup_network(interface: &str) { +fn cleanup_network(interface: &str) { delete_all_filters("ifb0"); delete_ifb(interface); flush_iptables_rule(); @@ -622,7 +622,7 @@ fn main() { ("cleanup", Some(args_matches)) => { let interfaces = value_t_or_exit!(args_matches, "iface", String); let iface = parse_interface(&interfaces); - force_cleanup_network(iface) + cleanup_network(iface) } ("configure", Some(args_matches)) => configure(args_matches), _ => {} diff --git a/net/remote/cleanup.sh b/net/remote/cleanup.sh index f2efdc00428020..8252c840a87cbc 100755 --- a/net/remote/cleanup.sh +++ b/net/remote/cleanup.sh @@ -18,7 +18,7 @@ if [[ -f solana/netem.cfg ]]; then solana/scripts/netem.sh delete < solana/netem.cfg rm -f solana/netem.cfg fi -solana/scripts/net-shaper.sh force_cleanup +solana/scripts/net-shaper.sh cleanup for pattern in validator.sh boostrap-leader.sh solana- remote- iftop validator client node; do echo "killing $pattern" pkill -f $pattern diff --git a/scripts/net-shaper.sh b/scripts/net-shaper.sh index 8bd39cafa4f836..28b277a0a1efc3 100755 --- a/scripts/net-shaper.sh +++ b/scripts/net-shaper.sh @@ -19,8 +19,6 @@ iface="$(ifconfig | grep mtu | grep -iv loopback | grep -i running | awk 'BEGIN if [[ "$1" = cleanup ]]; then $sudo ~solana/.cargo/bin/solana-net-shaper cleanup -f "$2" -s "$3" -p "$4" -i "$iface" -elif [[ "$1" = force_cleanup ]]; then - $sudo ~solana/.cargo/bin/solana-net-shaper force_cleanup -i "$iface" else $sudo ~solana/.cargo/bin/solana-net-shaper shape -f "$2" -s "$3" -p "$4" -i "$iface" fi