aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2015-01-15 03:52:40 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-17 23:51:10 -0500
commit33e9fcc666e23d2a09d413ab89a43e0514b91d77 (patch)
tree3519ecf178cc618ca071495694dc57b200bbbf18
parentd23b8ad8ab23f5a18b91e2396fb63d10f66b08d6 (diff)
tc: cls_bpf: rename bpf_len to bpf_num_ops
It was suggested by DaveM to change the name as "len" might indicate unit bytes. Suggested-by: David Miller <davem@davemloft.net> Signed-off-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sched/cls_bpf.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c
index 84c8219c3e1c..1029923f9e86 100644
--- a/net/sched/cls_bpf.c
+++ b/net/sched/cls_bpf.c
@@ -37,7 +37,7 @@ struct cls_bpf_prog {
37 struct tcf_result res; 37 struct tcf_result res;
38 struct list_head link; 38 struct list_head link;
39 u32 handle; 39 u32 handle;
40 u16 bpf_len; 40 u16 bpf_num_ops;
41 struct tcf_proto *tp; 41 struct tcf_proto *tp;
42 struct rcu_head rcu; 42 struct rcu_head rcu;
43}; 43};
@@ -160,7 +160,7 @@ static int cls_bpf_modify_existing(struct net *net, struct tcf_proto *tp,
160 struct tcf_exts exts; 160 struct tcf_exts exts;
161 struct sock_fprog_kern tmp; 161 struct sock_fprog_kern tmp;
162 struct bpf_prog *fp; 162 struct bpf_prog *fp;
163 u16 bpf_size, bpf_len; 163 u16 bpf_size, bpf_num_ops;
164 u32 classid; 164 u32 classid;
165 int ret; 165 int ret;
166 166
@@ -173,13 +173,13 @@ static int cls_bpf_modify_existing(struct net *net, struct tcf_proto *tp,
173 return ret; 173 return ret;
174 174
175 classid = nla_get_u32(tb[TCA_BPF_CLASSID]); 175 classid = nla_get_u32(tb[TCA_BPF_CLASSID]);
176 bpf_len = nla_get_u16(tb[TCA_BPF_OPS_LEN]); 176 bpf_num_ops = nla_get_u16(tb[TCA_BPF_OPS_LEN]);
177 if (bpf_len > BPF_MAXINSNS || bpf_len == 0) { 177 if (bpf_num_ops > BPF_MAXINSNS || bpf_num_ops == 0) {
178 ret = -EINVAL; 178 ret = -EINVAL;
179 goto errout; 179 goto errout;
180 } 180 }
181 181
182 bpf_size = bpf_len * sizeof(*bpf_ops); 182 bpf_size = bpf_num_ops * sizeof(*bpf_ops);
183 bpf_ops = kzalloc(bpf_size, GFP_KERNEL); 183 bpf_ops = kzalloc(bpf_size, GFP_KERNEL);
184 if (bpf_ops == NULL) { 184 if (bpf_ops == NULL) {
185 ret = -ENOMEM; 185 ret = -ENOMEM;
@@ -188,14 +188,14 @@ static int cls_bpf_modify_existing(struct net *net, struct tcf_proto *tp,
188 188
189 memcpy(bpf_ops, nla_data(tb[TCA_BPF_OPS]), bpf_size); 189 memcpy(bpf_ops, nla_data(tb[TCA_BPF_OPS]), bpf_size);
190 190
191 tmp.len = bpf_len; 191 tmp.len = bpf_num_ops;
192 tmp.filter = bpf_ops; 192 tmp.filter = bpf_ops;
193 193
194 ret = bpf_prog_create(&fp, &tmp); 194 ret = bpf_prog_create(&fp, &tmp);
195 if (ret) 195 if (ret)
196 goto errout_free; 196 goto errout_free;
197 197
198 prog->bpf_len = bpf_len; 198 prog->bpf_num_ops = bpf_num_ops;
199 prog->bpf_ops = bpf_ops; 199 prog->bpf_ops = bpf_ops;
200 prog->filter = fp; 200 prog->filter = fp;
201 prog->res.classid = classid; 201 prog->res.classid = classid;
@@ -303,10 +303,10 @@ static int cls_bpf_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
303 303
304 if (nla_put_u32(skb, TCA_BPF_CLASSID, prog->res.classid)) 304 if (nla_put_u32(skb, TCA_BPF_CLASSID, prog->res.classid))
305 goto nla_put_failure; 305 goto nla_put_failure;
306 if (nla_put_u16(skb, TCA_BPF_OPS_LEN, prog->bpf_len)) 306 if (nla_put_u16(skb, TCA_BPF_OPS_LEN, prog->bpf_num_ops))
307 goto nla_put_failure; 307 goto nla_put_failure;
308 308
309 nla = nla_reserve(skb, TCA_BPF_OPS, prog->bpf_len * 309 nla = nla_reserve(skb, TCA_BPF_OPS, prog->bpf_num_ops *
310 sizeof(struct sock_filter)); 310 sizeof(struct sock_filter));
311 if (nla == NULL) 311 if (nla == NULL)
312 goto nla_put_failure; 312 goto nla_put_failure;