diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-27 12:13:39 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-27 13:07:45 -0400 |
commit | e176b681b00d2b60e9231072d3ca841f9ddc74ea (patch) | |
tree | ede73bf25281f0689606ef2ceb35dfd74976e5e4 /net/mac802154/rx.c | |
parent | 9cf215d0733256687796ef1161b7b358be1b0602 (diff) |
mac802154: rx: move rcu locking
Instead of twice lock and unlock mechanism this patch hold these locks
only once at one position.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154/rx.c')
-rw-r--r-- | net/mac802154/rx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c index c2999804126a..689bb7ff5b2a 100644 --- a/net/mac802154/rx.c +++ b/net/mac802154/rx.c | |||
@@ -205,7 +205,6 @@ mac802154_wpans_rx(struct ieee802154_local *local, struct sk_buff *skb) | |||
205 | return; | 205 | return; |
206 | } | 206 | } |
207 | 207 | ||
208 | rcu_read_lock(); | ||
209 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 208 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
210 | if (sdata->type != IEEE802154_DEV_WPAN || | 209 | if (sdata->type != IEEE802154_DEV_WPAN || |
211 | !netif_running(sdata->dev)) | 210 | !netif_running(sdata->dev)) |
@@ -215,7 +214,6 @@ mac802154_wpans_rx(struct ieee802154_local *local, struct sk_buff *skb) | |||
215 | skb = NULL; | 214 | skb = NULL; |
216 | break; | 215 | break; |
217 | } | 216 | } |
218 | rcu_read_unlock(); | ||
219 | 217 | ||
220 | if (skb) | 218 | if (skb) |
221 | kfree_skb(skb); | 219 | kfree_skb(skb); |
@@ -234,7 +232,6 @@ mac802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb) | |||
234 | skb->pkt_type = PACKET_OTHERHOST; | 232 | skb->pkt_type = PACKET_OTHERHOST; |
235 | skb->protocol = htons(ETH_P_IEEE802154); | 233 | skb->protocol = htons(ETH_P_IEEE802154); |
236 | 234 | ||
237 | rcu_read_lock(); | ||
238 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 235 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
239 | if (sdata->type != IEEE802154_DEV_MONITOR || | 236 | if (sdata->type != IEEE802154_DEV_MONITOR || |
240 | !netif_running(sdata->dev)) | 237 | !netif_running(sdata->dev)) |
@@ -249,7 +246,6 @@ mac802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb) | |||
249 | 246 | ||
250 | netif_rx_ni(skb2); | 247 | netif_rx_ni(skb2); |
251 | } | 248 | } |
252 | rcu_read_unlock(); | ||
253 | } | 249 | } |
254 | 250 | ||
255 | void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb) | 251 | void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb) |
@@ -273,9 +269,13 @@ void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb) | |||
273 | skb_trim(skb, skb->len - 2); /* CRC */ | 269 | skb_trim(skb, skb->len - 2); /* CRC */ |
274 | } | 270 | } |
275 | 271 | ||
272 | rcu_read_lock(); | ||
273 | |||
276 | mac802154_monitors_rx(local, skb); | 274 | mac802154_monitors_rx(local, skb); |
277 | mac802154_wpans_rx(local, skb); | 275 | mac802154_wpans_rx(local, skb); |
278 | 276 | ||
277 | rcu_read_unlock(); | ||
278 | |||
279 | return; | 279 | return; |
280 | 280 | ||
281 | fail: | 281 | fail: |