Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
carllin committed Apr 9, 2020
1 parent 6f80733 commit e564ab5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 5 additions & 5 deletions net-shaper/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ fn delete_ifb(interface: &str) -> bool {
],
"Failed to setup ingress qdisc",
"tc qdisc delete dev <if> handle ffff: ingress",
false,
true,
) && run(
"modprobe",
&["ifb", "--remove"],
"Failed to delete ifb module",
"modprobe ifb --remove",
false,
true,
)
}

Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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),
_ => {}
Expand Down
2 changes: 1 addition & 1 deletion net/remote/cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions scripts/net-shaper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e564ab5

Please sign in to comment.