Skip to content

Commit 2fe6fb3

Browse files
edumazetkuba-moo
authored andcommitted
net: dst_cache: add two DEBUG_NET warnings
After fixing four different bugs involving dst_cache users, it might be worth adding a check about BH being blocked by dst_cache callers. DEBUG_NET_WARN_ON_ONCE(!in_softirq()); It is not fatal, if we missed valid case where no BH deadlock is to be feared, we might change this. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Paolo Abeni <pabeni@redhat.com> Link: https://lore.kernel.org/r/20240531132636.2637995-6-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent cf28ff8 commit 2fe6fb3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

net/core/dst_cache.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct dst_cache_pcpu {
2727
static void dst_cache_per_cpu_dst_set(struct dst_cache_pcpu *dst_cache,
2828
struct dst_entry *dst, u32 cookie)
2929
{
30+
DEBUG_NET_WARN_ON_ONCE(!in_softirq());
3031
dst_release(dst_cache->dst);
3132
if (dst)
3233
dst_hold(dst);
@@ -40,6 +41,7 @@ static struct dst_entry *dst_cache_per_cpu_get(struct dst_cache *dst_cache,
4041
{
4142
struct dst_entry *dst;
4243

44+
DEBUG_NET_WARN_ON_ONCE(!in_softirq());
4345
dst = idst->dst;
4446
if (!dst)
4547
goto fail;

0 commit comments

Comments
 (0)