Skip to content

Commit

Permalink
of-dpa: remove micro-optimization for l3 interface ids
Browse files Browse the repository at this point in the history
Remove the micro-optimization for controller::l3_egress_remove((), as it
would have only done anything if the removed id was the last one added.

On top of that the condition was broken, so it never even triggered, as
it checks for the freed id to be one more than the next id to use, which
will never be true.

Signed-off-by: Jonas Gorski <[email protected]>
  • Loading branch information
KanjiMonster committed Jun 3, 2024
1 parent c4ad68b commit 3e040fc
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/of-dpa/controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1226,12 +1226,7 @@ int controller::l3_egress_remove(uint32_t l3_interface_id) noexcept {
rv = -EINVAL;
}

if (l3_interface_id == egress_interface_id + 1) {
egress_interface_id--;
// TODO free even more ids from set?
} else {
freed_egress_interfaces_ids.insert(l3_interface_id);
}
freed_egress_interfaces_ids.insert(l3_interface_id);

return rv;
}
Expand Down

0 comments on commit 3e040fc

Please sign in to comment.