Commit 01921d53 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

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: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dbf896b7
...@@ -52,7 +52,7 @@ static int trace_state = TRACE_OFF; ...@@ -52,7 +52,7 @@ static int trace_state = TRACE_OFF;
static DEFINE_MUTEX(net_dm_mutex); static DEFINE_MUTEX(net_dm_mutex);
struct per_cpu_dm_data { struct per_cpu_dm_data {
spinlock_t lock; spinlock_t lock; /* Protects 'skb' and 'send_timer' */
struct sk_buff *skb; struct sk_buff *skb;
struct work_struct dm_alert_work; struct work_struct dm_alert_work;
struct timer_list send_timer; struct timer_list send_timer;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment