]> asedeno.scripts.mit.edu Git - linux.git/commit
xdp: Simplify devmap cleanup
authorBjörn Töpel <bjorn.topel@intel.com>
Thu, 19 Dec 2019 06:09:59 +0000 (07:09 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 20 Dec 2019 05:09:43 +0000 (21:09 -0800)
commit0536b85239b8440735cdd910aae0eb076ebbb439
treefab5254d7ae58913aca58e39a04d856a016c913a
parent5bf2fc1f9c88397b125d5ec5f65b1ed9300ba59d
xdp: Simplify devmap cleanup

After the RCU flavor consolidation [1], call_rcu() and
synchronize_rcu() waits for preempt-disable regions (NAPI) in addition
to the read-side critical sections. As a result of this, the cleanup
code in devmap can be simplified

* There is no longer a need to flush in __dev_map_entry_free, since we
  know that this has been done when the call_rcu() callback is
  triggered.

* When freeing the map, there is no need to explicitly wait for a
  flush. It's guaranteed to be done after the synchronize_rcu() call
  in dev_map_free(). The rcu_barrier() is still needed, so that the
  map is not freed prior the elements.

[1] https://lwn.net/Articles/777036/

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/20191219061006.21980-2-bjorn.topel@gmail.com
kernel/bpf/devmap.c