diff options
author | Jiri Pirko <jpirko@redhat.com> | 2012-06-19 01:54:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-19 18:00:24 -0400 |
commit | d1904fbd881e43cde2ec024117efaba83f8d9996 (patch) | |
tree | 51df81d4f7eafd3d2125fa0c71d0199f76e3f50d /drivers/net/team | |
parent | 2fcdb2c9e6598e6ced232eca7aa4a61342691f3b (diff) |
team: use rcu_dereference_bh() in tx path
Should be used instead of rcu_dereference, since rcu_read_lock_bh is
held.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/team')
-rw-r--r-- | drivers/net/team/team_mode_activebackup.c | 2 | ||||
-rw-r--r-- | drivers/net/team/team_mode_loadbalance.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c index bcc7d6d2579a..2fe02a8713ea 100644 --- a/drivers/net/team/team_mode_activebackup.c +++ b/drivers/net/team/team_mode_activebackup.c | |||
@@ -40,7 +40,7 @@ static bool ab_transmit(struct team *team, struct sk_buff *skb) | |||
40 | { | 40 | { |
41 | struct team_port *active_port; | 41 | struct team_port *active_port; |
42 | 42 | ||
43 | active_port = rcu_dereference(ab_priv(team)->active_port); | 43 | active_port = rcu_dereference_bh(ab_priv(team)->active_port); |
44 | if (unlikely(!active_port)) | 44 | if (unlikely(!active_port)) |
45 | goto drop; | 45 | goto drop; |
46 | skb->dev = active_port->dev; | 46 | skb->dev = active_port->dev; |
diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c index 33e30edeb202..45cc0951aa48 100644 --- a/drivers/net/team/team_mode_loadbalance.c +++ b/drivers/net/team/team_mode_loadbalance.c | |||
@@ -124,7 +124,7 @@ static struct team_port *lb_htpm_select_tx_port(struct team *team, | |||
124 | struct sk_buff *skb, | 124 | struct sk_buff *skb, |
125 | unsigned char hash) | 125 | unsigned char hash) |
126 | { | 126 | { |
127 | return rcu_dereference(LB_HTPM_PORT_BY_HASH(lb_priv, hash)); | 127 | return rcu_dereference_bh(LB_HTPM_PORT_BY_HASH(lb_priv, hash)); |
128 | } | 128 | } |
129 | 129 | ||
130 | struct lb_select_tx_port { | 130 | struct lb_select_tx_port { |
@@ -179,7 +179,7 @@ static unsigned int lb_get_skb_hash(struct lb_priv *lb_priv, | |||
179 | uint32_t lhash; | 179 | uint32_t lhash; |
180 | unsigned char *c; | 180 | unsigned char *c; |
181 | 181 | ||
182 | fp = rcu_dereference(lb_priv->fp); | 182 | fp = rcu_dereference_bh(lb_priv->fp); |
183 | if (unlikely(!fp)) | 183 | if (unlikely(!fp)) |
184 | return 0; | 184 | return 0; |
185 | lhash = SK_RUN_FILTER(fp, skb); | 185 | lhash = SK_RUN_FILTER(fp, skb); |
@@ -213,7 +213,7 @@ static bool lb_transmit(struct team *team, struct sk_buff *skb) | |||
213 | unsigned int tx_bytes = skb->len; | 213 | unsigned int tx_bytes = skb->len; |
214 | 214 | ||
215 | hash = lb_get_skb_hash(lb_priv, skb); | 215 | hash = lb_get_skb_hash(lb_priv, skb); |
216 | select_tx_port_func = rcu_dereference(lb_priv->select_tx_port_func); | 216 | select_tx_port_func = rcu_dereference_bh(lb_priv->select_tx_port_func); |
217 | port = select_tx_port_func(team, lb_priv, skb, hash); | 217 | port = select_tx_port_func(team, lb_priv, skb, hash); |
218 | if (unlikely(!port)) | 218 | if (unlikely(!port)) |
219 | goto drop; | 219 | goto drop; |