Skip to content

Commit

Permalink
drop_monitor: Document scope of spinlock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Aug 6, 2019
1 parent dbf896b commit 01921d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/core/drop_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 01921d5

Please sign in to comment.