OSDN Git Service

xdp: Fix cleanup on map free for devmap_hash map type
authorToke Høiland-Jørgensen <toke@redhat.com>
Thu, 21 Nov 2019 13:36:12 +0000 (14:36 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 25 Nov 2019 00:58:46 +0000 (16:58 -0800)
commit071cdecec57fb5d5df78e6a12114ad7bccea5b0e
tree6280415744ee6ce2e137d8d90262b20de7f6184f
parent1f60750401c7672419e1b606e2b73727c1f8626c
xdp: Fix cleanup on map free for devmap_hash map type

Tetsuo pointed out that it was not only the device unregister hook that was
broken for devmap_hash types, it was also cleanup on map free. So better
fix this as well.

While we're at it, there's no reason to allocate the netdev_map array for
DEVMAP_HASH, so skip that and adjust the cost accordingly.

Fixes: 6f9d451ab1a3 ("xdp: Add devmap_hash map type for looking up devices by hashed index")
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20191121133612.430414-1-toke@redhat.com
kernel/bpf/devmap.c