aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/net/raw.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2022-06-20 03:05:09 -0700
committerPaolo Abeni <pabeni@redhat.com>2022-06-21 11:38:29 +0200
commitaf185d8c76333daa877678e0166a7b45e63bf3c4 (patch)
tree0c3f2c0168c01595f1b17e34d9b4cd290a0e82c6 /include/net/raw.h
parentnet: warn if mac header was not set (diff)
downloadwireguard-linux-af185d8c76333daa877678e0166a7b45e63bf3c4.tar.xz
wireguard-linux-af185d8c76333daa877678e0166a7b45e63bf3c4.zip
raw: complete rcu conversion
raw_diag_dump() can use rcu_read_lock() instead of read_lock() Now the hashinfo lock is only used from process context, in write mode only, we can convert it to a spinlock, and we do not need to block BH anymore. Signed-off-by: Eric Dumazet <edumazet@google.com> Link: https://lore.kernel.org/r/20220620100509.3493504-1-eric.dumazet@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/net/raw.h')
-rw-r--r--include/net/raw.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/net/raw.h b/include/net/raw.h
index d81eeeb8f1e6..d224376360e1 100644
--- a/include/net/raw.h
+++ b/include/net/raw.h
@@ -32,7 +32,7 @@ int raw_rcv(struct sock *, struct sk_buff *);
#define RAW_HTABLE_SIZE MAX_INET_PROTOS
struct raw_hashinfo {
- rwlock_t lock;
+ spinlock_t lock;
struct hlist_nulls_head ht[RAW_HTABLE_SIZE];
};
@@ -40,7 +40,7 @@ static inline void raw_hashinfo_init(struct raw_hashinfo *hashinfo)
{
int i;
- rwlock_init(&hashinfo->lock);
+ spin_lock_init(&hashinfo->lock);
for (i = 0; i < RAW_HTABLE_SIZE; i++)
INIT_HLIST_NULLS_HEAD(&hashinfo->ht[i], i);
}