Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drop_monitor: fix trace_napi_poll_hit()

The net_dev of backlog napi is NULL, like below:

__get_cpu_var(softnet_data).backlog.dev == NULL

So, we should check it in napi tracepoint's probe function

Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Xiao Guangrong and committed by
David S. Miller
f2798eb4 3732e9bd

+2 -1
+2 -1
net/core/drop_monitor.c
··· 182 182 /* 183 183 * Ratelimit our check time to dm_hw_check_delta jiffies 184 184 */ 185 - if (!time_after(jiffies, napi->dev->last_rx + dm_hw_check_delta)) 185 + if (!napi->dev || 186 + !time_after(jiffies, napi->dev->last_rx + dm_hw_check_delta)) 186 187 return; 187 188 188 189 rcu_read_lock();