aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/drop_monitor.c
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2019-08-06 16:19:53 +0300
committerDavid S. Miller <davem@davemloft.net>2019-08-06 12:37:56 -0700
commit01921d53f870653f04ebf8d3c375029ee3ca4a31 (patch)
treed1513f72b5008b7de07d94ed3ee1be9e44ebdfaa /net/core/drop_monitor.c
parentdrop_monitor: Rename and document scope of mutex (diff)
downloadlinux-dev-01921d53f870653f04ebf8d3c375029ee3ca4a31.tar.xz
linux-dev-01921d53f870653f04ebf8d3c375029ee3ca4a31.zip
drop_monitor: Document scope of spinlock
While 'per_cpu_dm_data' is a per-CPU variable, its 'skb' and 'send_timer' fields can be accessed concurrently by the CPU sending the netlink notification to user space from the workqueue and the CPU tracing kfree_skb(). This spinlock is meant to protect against that. Document its scope and suppress the checkpatch message "spinlock_t definition without comment". Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/drop_monitor.c')
-rw-r--r--net/core/drop_monitor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 000ec8b66d1e..35d31b007da4 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -52,7 +52,7 @@ static int trace_state = TRACE_OFF;
static DEFINE_MUTEX(net_dm_mutex);
struct per_cpu_dm_data {
- spinlock_t lock;
+ spinlock_t lock; /* Protects 'skb' and 'send_timer' */
struct sk_buff *skb;
struct work_struct dm_alert_work;
struct timer_list send_timer;