aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sched/act_bpf.c10
-rw-r--r--net/sched/act_csum.c10
-rw-r--r--net/sched/act_gact.c10
-rw-r--r--net/sched/act_mirred.c16
-rw-r--r--net/sched/act_sample.c25
-rw-r--r--net/sched/act_tunnel_key.c10
-rw-r--r--net/sched/act_vlan.c10
7 files changed, 47 insertions, 44 deletions
diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c
index 9b30e62805c7..d30b23e42436 100644
--- a/net/sched/act_bpf.c
+++ b/net/sched/act_bpf.c
@@ -147,7 +147,7 @@ static int tcf_bpf_dump(struct sk_buff *skb, struct tc_action *act,
147 struct tcf_t tm; 147 struct tcf_t tm;
148 int ret; 148 int ret;
149 149
150 spin_lock(&prog->tcf_lock); 150 spin_lock_bh(&prog->tcf_lock);
151 opt.action = prog->tcf_action; 151 opt.action = prog->tcf_action;
152 if (nla_put(skb, TCA_ACT_BPF_PARMS, sizeof(opt), &opt)) 152 if (nla_put(skb, TCA_ACT_BPF_PARMS, sizeof(opt), &opt))
153 goto nla_put_failure; 153 goto nla_put_failure;
@@ -164,11 +164,11 @@ static int tcf_bpf_dump(struct sk_buff *skb, struct tc_action *act,
164 TCA_ACT_BPF_PAD)) 164 TCA_ACT_BPF_PAD))
165 goto nla_put_failure; 165 goto nla_put_failure;
166 166
167 spin_unlock(&prog->tcf_lock); 167 spin_unlock_bh(&prog->tcf_lock);
168 return skb->len; 168 return skb->len;
169 169
170nla_put_failure: 170nla_put_failure:
171 spin_unlock(&prog->tcf_lock); 171 spin_unlock_bh(&prog->tcf_lock);
172 nlmsg_trim(skb, tp); 172 nlmsg_trim(skb, tp);
173 return -1; 173 return -1;
174} 174}
@@ -340,7 +340,7 @@ static int tcf_bpf_init(struct net *net, struct nlattr *nla,
340 340
341 prog = to_bpf(*act); 341 prog = to_bpf(*act);
342 342
343 spin_lock(&prog->tcf_lock); 343 spin_lock_bh(&prog->tcf_lock);
344 if (res != ACT_P_CREATED) 344 if (res != ACT_P_CREATED)
345 tcf_bpf_prog_fill_cfg(prog, &old); 345 tcf_bpf_prog_fill_cfg(prog, &old);
346 346
@@ -352,7 +352,7 @@ static int tcf_bpf_init(struct net *net, struct nlattr *nla,
352 352
353 prog->tcf_action = parm->action; 353 prog->tcf_action = parm->action;
354 rcu_assign_pointer(prog->filter, cfg.filter); 354 rcu_assign_pointer(prog->filter, cfg.filter);
355 spin_unlock(&prog->tcf_lock); 355 spin_unlock_bh(&prog->tcf_lock);
356 356
357 if (res == ACT_P_CREATED) { 357 if (res == ACT_P_CREATED) {
358 tcf_idr_insert(tn, *act); 358 tcf_idr_insert(tn, *act);
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c
index 5596fae4e478..e698d3fe2080 100644
--- a/net/sched/act_csum.c
+++ b/net/sched/act_csum.c
@@ -96,11 +96,11 @@ static int tcf_csum_init(struct net *net, struct nlattr *nla,
96 } 96 }
97 params_new->update_flags = parm->update_flags; 97 params_new->update_flags = parm->update_flags;
98 98
99 spin_lock(&p->tcf_lock); 99 spin_lock_bh(&p->tcf_lock);
100 p->tcf_action = parm->action; 100 p->tcf_action = parm->action;
101 rcu_swap_protected(p->params, params_new, 101 rcu_swap_protected(p->params, params_new,
102 lockdep_is_held(&p->tcf_lock)); 102 lockdep_is_held(&p->tcf_lock));
103 spin_unlock(&p->tcf_lock); 103 spin_unlock_bh(&p->tcf_lock);
104 104
105 if (params_new) 105 if (params_new)
106 kfree_rcu(params_new, rcu); 106 kfree_rcu(params_new, rcu);
@@ -604,7 +604,7 @@ static int tcf_csum_dump(struct sk_buff *skb, struct tc_action *a, int bind,
604 }; 604 };
605 struct tcf_t t; 605 struct tcf_t t;
606 606
607 spin_lock(&p->tcf_lock); 607 spin_lock_bh(&p->tcf_lock);
608 params = rcu_dereference_protected(p->params, 608 params = rcu_dereference_protected(p->params,
609 lockdep_is_held(&p->tcf_lock)); 609 lockdep_is_held(&p->tcf_lock));
610 opt.action = p->tcf_action; 610 opt.action = p->tcf_action;
@@ -616,12 +616,12 @@ static int tcf_csum_dump(struct sk_buff *skb, struct tc_action *a, int bind,
616 tcf_tm_dump(&t, &p->tcf_tm); 616 tcf_tm_dump(&t, &p->tcf_tm);
617 if (nla_put_64bit(skb, TCA_CSUM_TM, sizeof(t), &t, TCA_CSUM_PAD)) 617 if (nla_put_64bit(skb, TCA_CSUM_TM, sizeof(t), &t, TCA_CSUM_PAD))
618 goto nla_put_failure; 618 goto nla_put_failure;
619 spin_unlock(&p->tcf_lock); 619 spin_unlock_bh(&p->tcf_lock);
620 620
621 return skb->len; 621 return skb->len;
622 622
623nla_put_failure: 623nla_put_failure:
624 spin_unlock(&p->tcf_lock); 624 spin_unlock_bh(&p->tcf_lock);
625 nlmsg_trim(skb, b); 625 nlmsg_trim(skb, b);
626 return -1; 626 return -1;
627} 627}
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index 52a3e474d822..6a3f25a8ffb3 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -113,7 +113,7 @@ static int tcf_gact_init(struct net *net, struct nlattr *nla,
113 113
114 gact = to_gact(*a); 114 gact = to_gact(*a);
115 115
116 spin_lock(&gact->tcf_lock); 116 spin_lock_bh(&gact->tcf_lock);
117 gact->tcf_action = parm->action; 117 gact->tcf_action = parm->action;
118#ifdef CONFIG_GACT_PROB 118#ifdef CONFIG_GACT_PROB
119 if (p_parm) { 119 if (p_parm) {
@@ -126,7 +126,7 @@ static int tcf_gact_init(struct net *net, struct nlattr *nla,
126 gact->tcfg_ptype = p_parm->ptype; 126 gact->tcfg_ptype = p_parm->ptype;
127 } 127 }
128#endif 128#endif
129 spin_unlock(&gact->tcf_lock); 129 spin_unlock_bh(&gact->tcf_lock);
130 130
131 if (ret == ACT_P_CREATED) 131 if (ret == ACT_P_CREATED)
132 tcf_idr_insert(tn, *a); 132 tcf_idr_insert(tn, *a);
@@ -183,7 +183,7 @@ static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a,
183 }; 183 };
184 struct tcf_t t; 184 struct tcf_t t;
185 185
186 spin_lock(&gact->tcf_lock); 186 spin_lock_bh(&gact->tcf_lock);
187 opt.action = gact->tcf_action; 187 opt.action = gact->tcf_action;
188 if (nla_put(skb, TCA_GACT_PARMS, sizeof(opt), &opt)) 188 if (nla_put(skb, TCA_GACT_PARMS, sizeof(opt), &opt))
189 goto nla_put_failure; 189 goto nla_put_failure;
@@ -202,12 +202,12 @@ static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a,
202 tcf_tm_dump(&t, &gact->tcf_tm); 202 tcf_tm_dump(&t, &gact->tcf_tm);
203 if (nla_put_64bit(skb, TCA_GACT_TM, sizeof(t), &t, TCA_GACT_PAD)) 203 if (nla_put_64bit(skb, TCA_GACT_TM, sizeof(t), &t, TCA_GACT_PAD))
204 goto nla_put_failure; 204 goto nla_put_failure;
205 spin_unlock(&gact->tcf_lock); 205 spin_unlock_bh(&gact->tcf_lock);
206 206
207 return skb->len; 207 return skb->len;
208 208
209nla_put_failure: 209nla_put_failure:
210 spin_unlock(&gact->tcf_lock); 210 spin_unlock_bh(&gact->tcf_lock);
211 nlmsg_trim(skb, b); 211 nlmsg_trim(skb, b);
212 return -1; 212 return -1;
213} 213}
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 8ec216001077..38fd20f10f67 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -159,14 +159,14 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
159 } 159 }
160 m = to_mirred(*a); 160 m = to_mirred(*a);
161 161
162 spin_lock(&m->tcf_lock); 162 spin_lock_bh(&m->tcf_lock);
163 m->tcf_action = parm->action; 163 m->tcf_action = parm->action;
164 m->tcfm_eaction = parm->eaction; 164 m->tcfm_eaction = parm->eaction;
165 165
166 if (parm->ifindex) { 166 if (parm->ifindex) {
167 dev = dev_get_by_index(net, parm->ifindex); 167 dev = dev_get_by_index(net, parm->ifindex);
168 if (!dev) { 168 if (!dev) {
169 spin_unlock(&m->tcf_lock); 169 spin_unlock_bh(&m->tcf_lock);
170 tcf_idr_release(*a, bind); 170 tcf_idr_release(*a, bind);
171 return -ENODEV; 171 return -ENODEV;
172 } 172 }
@@ -177,7 +177,7 @@ static int tcf_mirred_init(struct net *net, struct nlattr *nla,
177 dev_put(dev); 177 dev_put(dev);
178 m->tcfm_mac_header_xmit = mac_header_xmit; 178 m->tcfm_mac_header_xmit = mac_header_xmit;
179 } 179 }
180 spin_unlock(&m->tcf_lock); 180 spin_unlock_bh(&m->tcf_lock);
181 181
182 if (ret == ACT_P_CREATED) { 182 if (ret == ACT_P_CREATED) {
183 spin_lock(&mirred_list_lock); 183 spin_lock(&mirred_list_lock);
@@ -305,7 +305,7 @@ static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind,
305 struct net_device *dev; 305 struct net_device *dev;
306 struct tcf_t t; 306 struct tcf_t t;
307 307
308 spin_lock(&m->tcf_lock); 308 spin_lock_bh(&m->tcf_lock);
309 opt.action = m->tcf_action; 309 opt.action = m->tcf_action;
310 opt.eaction = m->tcfm_eaction; 310 opt.eaction = m->tcfm_eaction;
311 dev = tcf_mirred_dev_dereference(m); 311 dev = tcf_mirred_dev_dereference(m);
@@ -318,12 +318,12 @@ static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind,
318 tcf_tm_dump(&t, &m->tcf_tm); 318 tcf_tm_dump(&t, &m->tcf_tm);
319 if (nla_put_64bit(skb, TCA_MIRRED_TM, sizeof(t), &t, TCA_MIRRED_PAD)) 319 if (nla_put_64bit(skb, TCA_MIRRED_TM, sizeof(t), &t, TCA_MIRRED_PAD))
320 goto nla_put_failure;