All of lore.kernel.org
 help / color / mirror / Atom feed
From: Calvin Owens <jcalvinowens@gmail.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH] mac80211: ath9k: Use RCU protection calling ieee80211_get_tx_rates
Date: Tue, 11 Jun 2013 12:13:04 -0500	[thread overview]
Message-ID: <20130611171304.GA2189@gmail.com> (raw)
In-Reply-To: <1370950926.8356.14.camel@jlt4.sipsolutions.net>

Signed-off-by: Calvin Owens <jcalvinowens@gmail.com>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 2 ++
 drivers/net/wireless/mac80211_hwsim.c | 6 ++++++
 include/net/mac80211.h                | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 1c9b1ba..1d57015 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -142,8 +142,10 @@ static void ath_send_bar(struct ath_atx_tid *tid, u16 seqno)
 static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
 			  struct ath_buf *bf)
 {
+	rcu_read_lock();
 	ieee80211_get_tx_rates(vif, sta, bf->bf_mpdu, bf->rates,
 			       ARRAY_SIZE(bf->rates));
+	rcu_read_unlock();
 }
 
 static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index cb34c78..468a5a6 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -900,9 +900,11 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
 		hwsim_check_sta_magic(control->sta);
 
 	if (rctbl)
+		rcu_read_lock();
 		ieee80211_get_tx_rates(txi->control.vif, control->sta, skb,
 				       txi->control.rates,
 				       ARRAY_SIZE(txi->control.rates));
+		rcu_read_unlock();
 
 	txi->rate_driver_data[0] = channel;
 	mac80211_hwsim_monitor_rx(hw, skb, channel);
@@ -1008,9 +1010,11 @@ static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
 
 	if (rctbl) {
 		struct ieee80211_tx_info *txi = IEEE80211_SKB_CB(skb);
+		rcu_read_lock();
 		ieee80211_get_tx_rates(txi->control.vif, NULL, skb,
 				       txi->control.rates,
 				       ARRAY_SIZE(txi->control.rates));
+		rcu_read_unlock();
 	}
 
 	mac80211_hwsim_monitor_rx(hw, skb, chan);
@@ -1044,9 +1048,11 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
 		return;
 	info = IEEE80211_SKB_CB(skb);
 	if (rctbl)
+		rcu_read_lock();
 		ieee80211_get_tx_rates(vif, NULL, skb,
 				       info->control.rates,
 				       ARRAY_SIZE(info->control.rates));
+		rcu_read_unlock();
 
 	txrate = ieee80211_get_tx_rate(hw, info);
 
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 885898a..df345c1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3175,7 +3175,8 @@ void ieee80211_sta_set_buffered(struct ieee80211_sta *sta,
  *
  * Call this function in a driver with per-packet rate selection support
  * to combine the rate info in the packet tx info with the most recent
- * rate selection table for the station entry.
+ * rate selection table for the station entry. Must be called with RCU
+ * protection.
  *
  * @vif: &struct ieee80211_vif pointer from the add_interface callback.
  * @sta: the receiver station to which this packet is sent.
-- 
1.8.2.1

WARNING: multiple messages have this Message-ID (diff)
From: Calvin Owens <jcalvinowens@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	"Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	Felix Fietkau <nbd@openwrt.org>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	ath9k-devel@lists.ath9k.org, netdev@vger.kernel.org,
	jcalvinowens@gmail.com
Subject: [PATCH] mac80211: ath9k: Use RCU protection calling ieee80211_get_tx_rates
Date: Tue, 11 Jun 2013 12:13:04 -0500	[thread overview]
Message-ID: <20130611171304.GA2189@gmail.com> (raw)
In-Reply-To: <1370950926.8356.14.camel@jlt4.sipsolutions.net>

Signed-off-by: Calvin Owens <jcalvinowens@gmail.com>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 2 ++
 drivers/net/wireless/mac80211_hwsim.c | 6 ++++++
 include/net/mac80211.h                | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 1c9b1ba..1d57015 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -142,8 +142,10 @@ static void ath_send_bar(struct ath_atx_tid *tid, u16 seqno)
 static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
 			  struct ath_buf *bf)
 {
+	rcu_read_lock();
 	ieee80211_get_tx_rates(vif, sta, bf->bf_mpdu, bf->rates,
 			       ARRAY_SIZE(bf->rates));
+	rcu_read_unlock();
 }
 
 static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index cb34c78..468a5a6 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -900,9 +900,11 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
 		hwsim_check_sta_magic(control->sta);
 
 	if (rctbl)
+		rcu_read_lock();
 		ieee80211_get_tx_rates(txi->control.vif, control->sta, skb,
 				       txi->control.rates,
 				       ARRAY_SIZE(txi->control.rates));
+		rcu_read_unlock();
 
 	txi->rate_driver_data[0] = channel;
 	mac80211_hwsim_monitor_rx(hw, skb, channel);
@@ -1008,9 +1010,11 @@ static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
 
 	if (rctbl) {
 		struct ieee80211_tx_info *txi = IEEE80211_SKB_CB(skb);
+		rcu_read_lock();
 		ieee80211_get_tx_rates(txi->control.vif, NULL, skb,
 				       txi->control.rates,
 				       ARRAY_SIZE(txi->control.rates));
+		rcu_read_unlock();
 	}
 
 	mac80211_hwsim_monitor_rx(hw, skb, chan);
@@ -1044,9 +1048,11 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
 		return;
 	info = IEEE80211_SKB_CB(skb);
 	if (rctbl)
+		rcu_read_lock();
 		ieee80211_get_tx_rates(vif, NULL, skb,
 				       info->control.rates,
 				       ARRAY_SIZE(info->control.rates));
+		rcu_read_unlock();
 
 	txrate = ieee80211_get_tx_rate(hw, info);
 
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 885898a..df345c1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3175,7 +3175,8 @@ void ieee80211_sta_set_buffered(struct ieee80211_sta *sta,
  *
  * Call this function in a driver with per-packet rate selection support
  * to combine the rate info in the packet tx info with the most recent
- * rate selection table for the station entry.
+ * rate selection table for the station entry. Must be called with RCU
+ * protection.
  *
  * @vif: &struct ieee80211_vif pointer from the add_interface callback.
  * @sta: the receiver station to which this packet is sent.
-- 
1.8.2.1


WARNING: multiple messages have this Message-ID (diff)
From: Calvin Owens <jcalvinowens@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	"Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>,
	"John W. Linville" <linville@tuxdriver.com>,
	Felix Fietkau <nbd@openwrt.org>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	ath9k-devel@venema.h4ckr.net, netdev@vger.kernel.org,
	jcalvinowens@gmail.com
Subject: [PATCH] mac80211: ath9k: Use RCU protection calling ieee80211_get_tx_rates
Date: Tue, 11 Jun 2013 12:13:04 -0500	[thread overview]
Message-ID: <20130611171304.GA2189@gmail.com> (raw)
In-Reply-To: <1370950926.8356.14.camel@jlt4.sipsolutions.net>

Signed-off-by: Calvin Owens <jcalvinowens@gmail.com>
---
 drivers/net/wireless/ath/ath9k/xmit.c | 2 ++
 drivers/net/wireless/mac80211_hwsim.c | 6 ++++++
 include/net/mac80211.h                | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 1c9b1ba..1d57015 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -142,8 +142,10 @@ static void ath_send_bar(struct ath_atx_tid *tid, u16 seqno)
 static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta,
 			  struct ath_buf *bf)
 {
+	rcu_read_lock();
 	ieee80211_get_tx_rates(vif, sta, bf->bf_mpdu, bf->rates,
 			       ARRAY_SIZE(bf->rates));
+	rcu_read_unlock();
 }
 
 static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index cb34c78..468a5a6 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -900,9 +900,11 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
 		hwsim_check_sta_magic(control->sta);
 
 	if (rctbl)
+		rcu_read_lock();
 		ieee80211_get_tx_rates(txi->control.vif, control->sta, skb,
 				       txi->control.rates,
 				       ARRAY_SIZE(txi->control.rates));
+		rcu_read_unlock();
 
 	txi->rate_driver_data[0] = channel;
 	mac80211_hwsim_monitor_rx(hw, skb, channel);
@@ -1008,9 +1010,11 @@ static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
 
 	if (rctbl) {
 		struct ieee80211_tx_info *txi = IEEE80211_SKB_CB(skb);
+		rcu_read_lock();
 		ieee80211_get_tx_rates(txi->control.vif, NULL, skb,
 				       txi->control.rates,
 				       ARRAY_SIZE(txi->control.rates));
+		rcu_read_unlock();
 	}
 
 	mac80211_hwsim_monitor_rx(hw, skb, chan);
@@ -1044,9 +1048,11 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
 		return;
 	info = IEEE80211_SKB_CB(skb);
 	if (rctbl)
+		rcu_read_lock();
 		ieee80211_get_tx_rates(vif, NULL, skb,
 				       info->control.rates,
 				       ARRAY_SIZE(info->control.rates));
+		rcu_read_unlock();
 
 	txrate = ieee80211_get_tx_rate(hw, info);
 
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 885898a..df345c1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3175,7 +3175,8 @@ void ieee80211_sta_set_buffered(struct ieee80211_sta *sta,
  *
  * Call this function in a driver with per-packet rate selection support
  * to combine the rate info in the packet tx info with the most recent
- * rate selection table for the station entry.
+ * rate selection table for the station entry. Must be called with RCU
+ * protection.
  *
  * @vif: &struct ieee80211_vif pointer from the add_interface callback.
  * @sta: the receiver station to which this packet is sent.
-- 
1.8.2.1


  reply	other threads:[~2013-06-11 17:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-09 22:51 rcu Calvin Owens
2013-06-10  4:29 ` [PATCH] mac80211: Fix bogus RCU warning from ieee80211_get_tx_rates (Was: Re: rcu) Calvin Owens
2013-06-11 11:42   ` Johannes Berg
2013-06-11 17:13     ` Calvin Owens [this message]
2013-06-11 17:13       ` [PATCH] mac80211: ath9k: Use RCU protection calling ieee80211_get_tx_rates Calvin Owens
2013-06-11 17:13       ` Calvin Owens
2013-06-11 19:55       ` [ath9k-devel] " Johannes Berg
2013-06-11 19:55         ` Johannes Berg
2013-06-11 19:55         ` Johannes Berg
2013-06-12  6:37         ` [ath9k-devel] " Kalle Valo
2013-06-12  6:37           ` Kalle Valo
2013-06-12  6:37           ` Kalle Valo
2013-06-12  7:56         ` [ath9k-devel] " Calvin Owens
2013-06-12  7:56           ` Calvin Owens
2013-06-12  7:56           ` Calvin Owens
2013-06-12  8:00           ` [ath9k-devel] [PATCH] mac80211: Use RCU protection in ieee80211_get_tx_rates() Calvin Owens
2013-06-12  8:00             ` Calvin Owens
2013-06-12  8:00             ` Calvin Owens
2013-06-12  9:47             ` [ath9k-devel] " Felix Fietkau
2013-06-12  9:47               ` Felix Fietkau
2013-06-12  9:47               ` Felix Fietkau
2013-06-13 15:27               ` [ath9k-devel] " Calvin Owens
2013-06-13 15:27                 ` Calvin Owens
2013-06-13 15:27                 ` Calvin Owens

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=20130611171304.GA2189@gmail.com \
    --to=jcalvinowens@gmail.com \
    --cc=ath9k-devel@lists.ath9k.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.