From: Johannes Berg <johannes@sipsolutions.net>
To: linux-kernel@vger.kernel.org
Cc: Josh Triplett <josh@freedesktop.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
linux-wireless@vger.kernel.org, linux-sparse@vger.kernel.org
Subject: [RFC 3/3] mac80211: annotate with __requires_rcu
Date: Thu, 10 Apr 2008 15:48:13 +0200 [thread overview]
Message-ID: <20080410134829.412424000@sipsolutions.net> (raw)
In-Reply-To: 20080410134810.629048000@sipsolutions.net
[-- Attachment #1: 013-mac80211-rcu-sparse.patch --]
[-- Type: text/plain, Size: 4688 bytes --]
As an example, this annotates mac80211 with the new __requires_rcu.
Not-yet-signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/mac80211/key.c | 2 +-
net/mac80211/key.h | 2 +-
net/mac80211/rx.c | 12 ++++++------
net/mac80211/sta_info.h | 3 ++-
net/mac80211/tx.c | 3 ++-
5 files changed, 12 insertions(+), 10 deletions(-)
--- everything.orig/net/mac80211/sta_info.h 2008-04-10 15:36:20.000000000 +0200
+++ everything/net/mac80211/sta_info.h 2008-04-10 15:36:45.000000000 +0200
@@ -321,7 +321,8 @@ static inline enum plink_state sta_plink
/*
* Get a STA info, must have be under RCU read lock.
*/
-struct sta_info *sta_info_get(struct ieee80211_local *local, u8 *addr);
+struct sta_info *sta_info_get(struct ieee80211_local *local, u8 *addr) __requires_rcu;
+
/*
* Get STA info by index, BROKEN!
*/
--- everything.orig/net/mac80211/key.c 2008-04-10 15:36:20.000000000 +0200
+++ everything/net/mac80211/key.c 2008-04-10 15:36:45.000000000 +0200
@@ -299,7 +299,7 @@ struct ieee80211_key *ieee80211_key_allo
void ieee80211_key_link(struct ieee80211_key *key,
struct ieee80211_sub_if_data *sdata,
- struct sta_info *sta)
+ struct sta_info *sta) __requires_rcu
{
struct ieee80211_key *old_key;
unsigned long flags;
--- everything.orig/net/mac80211/key.h 2008-04-10 15:36:20.000000000 +0200
+++ everything/net/mac80211/key.h 2008-04-10 15:36:45.000000000 +0200
@@ -146,7 +146,7 @@ struct ieee80211_key *ieee80211_key_allo
*/
void ieee80211_key_link(struct ieee80211_key *key,
struct ieee80211_sub_if_data *sdata,
- struct sta_info *sta);
+ struct sta_info *sta) __requires(RCU);
void ieee80211_key_free(struct ieee80211_key *key);
void ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, int idx);
void ieee80211_free_keys(struct ieee80211_sub_if_data *sdata);
--- everything.orig/net/mac80211/rx.c 2008-04-10 15:36:20.000000000 +0200
+++ everything/net/mac80211/rx.c 2008-04-10 15:36:45.000000000 +0200
@@ -1261,7 +1261,7 @@ static bool ieee80211_frame_allowed(stru
* requires that rx->skb is a frame with ethernet header
*/
static void
-ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
+ieee80211_deliver_skb(struct ieee80211_rx_data *rx) __requires_rcu
{
struct net_device *dev = rx->dev;
struct ieee80211_local *local = rx->local;
@@ -1349,7 +1349,7 @@ ieee80211_deliver_skb(struct ieee80211_r
}
static ieee80211_rx_result
-ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
+ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx) __requires_rcu
{
struct net_device *dev = rx->dev;
struct ieee80211_local *local = rx->local;
@@ -1466,7 +1466,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx
}
static ieee80211_rx_result
-ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
+ieee80211_rx_h_data(struct ieee80211_rx_data *rx) __requires_rcu
{
struct net_device *dev = rx->dev;
u16 fc;
@@ -1876,7 +1876,7 @@ static void __ieee80211_rx_handle_packet
struct sk_buff *skb,
struct ieee80211_rx_status *status,
u32 load,
- struct ieee80211_rate *rate)
+ struct ieee80211_rate *rate) __requires_rcu
{
struct ieee80211_local *local = hw_to_local(hw);
struct ieee80211_sub_if_data *sdata;
@@ -1997,7 +1997,7 @@ static inline u16 seq_sub(u16 sq1, u16 s
u8 ieee80211_sta_manage_reorder_buf(struct ieee80211_hw *hw,
struct tid_ampdu_rx *tid_agg_rx,
struct sk_buff *skb, u16 mpdu_seq_num,
- int bar_req)
+ int bar_req) __requires_rcu
{
struct ieee80211_local *local = hw_to_local(hw);
struct ieee80211_rx_status status;
@@ -2100,7 +2100,7 @@ u8 ieee80211_sta_manage_reorder_buf(stru
}
static u8 ieee80211_rx_reorder_ampdu(struct ieee80211_local *local,
- struct sk_buff *skb)
+ struct sk_buff *skb) __requires_rcu
{
struct ieee80211_hw *hw = &local->hw;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
--- everything.orig/net/mac80211/tx.c 2008-04-10 15:36:20.000000000 +0200
+++ everything/net/mac80211/tx.c 2008-04-10 15:36:45.000000000 +0200
@@ -968,7 +968,7 @@ static ieee80211_tx_result
__ieee80211_tx_prepare(struct ieee80211_tx_data *tx,
struct sk_buff *skb,
struct net_device *dev,
- struct ieee80211_tx_control *control)
+ struct ieee80211_tx_control *control) __requires_rcu
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_hdr *hdr;
@@ -1047,6 +1047,7 @@ static int ieee80211_tx_prepare(struct i
struct sk_buff *skb,
struct net_device *mdev,
struct ieee80211_tx_control *control)
+ __requires_rcu
{
struct ieee80211_tx_packet_data *pkt_data;
struct net_device *dev;
--
next prev parent reply other threads:[~2008-04-10 14:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-10 13:48 [RFC 0/3] Examples for the new sparse context tracking functionality Johannes Berg
2008-04-10 13:48 ` [RFC 1/3] add macros for new sparse features Johannes Berg
2008-04-10 16:37 ` Stefan Richter
2008-04-11 12:20 ` Johannes Berg
2008-04-10 13:48 ` [RFC 2/3] rcu: allow functions to declare they need RCU locking Johannes Berg
2008-04-10 13:48 ` Johannes Berg [this message]
[not found] ` <20080410134829.412424000-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2008-04-12 8:50 ` [RFC 3/3] mac80211: annotate with __requires_rcu Geert Uytterhoeven
2008-04-12 8:56 ` Johannes Berg
[not found] ` <20080410134810.629048000-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2008-04-10 15:22 ` [RFC 0/3] Examples for the new sparse context tracking functionality Johannes Berg
2008-04-19 23:33 ` Paul E. McKenney
2008-04-21 8:25 ` Johannes Berg
[not found] ` <1208766355.26186.37.camel-YfaajirXv214zXjbi5bjpg@public.gmane.org>
2008-04-21 14:55 ` Paul E. McKenney
[not found] ` <20080421145525.GB9153-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-04-21 15:05 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080410134829.412424000@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=josh@freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).