aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamal Hadi Salim <jhs@mojatatu.com>2016-06-05 10:41:32 -0400
committerDavid S. Miller <davem@davemloft.net>2016-06-07 18:53:54 -0400
commit0b0f43fe2e7291aa97b1febeaa5a0de453d007ca (patch)
treec2f1c26ffbf8ec9d9b606a58b018622a023b2ae5
parentbe119913689724b6fe84caa779c2508547c4e8d5 (diff)
net sched: indentation and other OCD stylistic fixes
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Acked-by: Cong Wang <xiyou.wangcong@gmail.com>
-rw-r--r--include/net/act_api.h14
-rw-r--r--include/net/tc_act/tc_defact.h4
-rw-r--r--include/uapi/linux/pkt_cls.h6
-rw-r--r--net/sched/act_api.c19
-rw-r--r--net/sched/act_bpf.c3
-rw-r--r--net/sched/act_gact.c3
-rw-r--r--net/sched/act_ipt.c6
-rw-r--r--net/sched/act_vlan.c3
-rw-r--r--net/sched/cls_api.c11
9 files changed, 41 insertions, 28 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h
index a891978310e9..db218a12efb5 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -2,8 +2,8 @@
2#define __NET_ACT_API_H 2#define __NET_ACT_API_H
3 3
4/* 4/*
5 * Public police action API for classifiers/qdiscs 5 * Public action API for classifiers/qdiscs
6 */ 6*/
7 7
8#include <net/sch_generic.h> 8#include <net/sch_generic.h>
9#include <net/pkt_sched.h> 9#include <net/pkt_sched.h>
@@ -107,7 +107,8 @@ struct tc_action_ops {
107 char kind[IFNAMSIZ]; 107 char kind[IFNAMSIZ];
108 __u32 type; /* TBD to match kind */ 108 __u32 type; /* TBD to match kind */
109 struct module *owner; 109 struct module *owner;
110 int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *); 110 int (*act)(struct sk_buff *, const struct tc_action *,
111 struct tcf_result *);
111 int (*dump)(struct sk_buff *, struct tc_action *, int, int); 112 int (*dump)(struct sk_buff *, struct tc_action *, int, int);
112 void (*cleanup)(struct tc_action *, int bind); 113 void (*cleanup)(struct tc_action *, int bind);
113 int (*lookup)(struct net *, struct tc_action *, u32); 114 int (*lookup)(struct net *, struct tc_action *, u32);
@@ -125,8 +126,8 @@ struct tc_action_net {
125}; 126};
126 127
127static inline 128static inline
128int tc_action_net_init(struct tc_action_net *tn, const struct tc_action_ops *ops, 129int tc_action_net_init(struct tc_action_net *tn,
129 unsigned int mask) 130 const struct tc_action_ops *ops, unsigned int mask)
130{ 131{
131 int err = 0; 132 int err = 0;
132 133
@@ -169,7 +170,8 @@ static inline int tcf_hash_release(struct tc_action *a, bool bind)
169} 170}
170 171
171int tcf_register_action(struct tc_action_ops *a, struct pernet_operations *ops); 172int tcf_register_action(struct tc_action_ops *a, struct pernet_operations *ops);
172int tcf_unregister_action(struct tc_action_ops *a, struct pernet_operations *ops); 173int tcf_unregister_action(struct tc_action_ops *a,
174 struct pernet_operations *ops);
173int tcf_action_destroy(struct list_head *actions, int bind); 175int tcf_action_destroy(struct list_head *actions, int bind);
174int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions, 176int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions,
175 struct tcf_result *res); 177 struct tcf_result *res);
diff --git a/include/net/tc_act/tc_defact.h b/include/net/tc_act/tc_defact.h
index 9763dcbb9bc3..ab9b5d6be67b 100644
--- a/include/net/tc_act/tc_defact.h
+++ b/include/net/tc_act/tc_defact.h
@@ -5,8 +5,8 @@
5 5
6struct tcf_defact { 6struct tcf_defact {
7 struct tcf_common common; 7 struct tcf_common common;
8 u32 tcfd_datalen; 8 u32 tcfd_datalen;
9 void *tcfd_defdata; 9 void *tcfd_defdata;
10}; 10};
11#define to_defact(a) \ 11#define to_defact(a) \
12 container_of(a->priv, struct tcf_defact, common) 12 container_of(a->priv, struct tcf_defact, common)
diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
index 9ba1410bd21d..5702e933dc07 100644
--- a/include/uapi/linux/pkt_cls.h
+++ b/include/uapi/linux/pkt_cls.h
@@ -115,8 +115,8 @@ struct tc_police {
115 __u32 mtu; 115 __u32 mtu;
116 struct tc_ratespec rate; 116 struct tc_ratespec rate;
117 struct tc_ratespec peakrate; 117 struct tc_ratespec peakrate;
118 int refcnt; 118 int refcnt;
119 int bindcnt; 119 int bindcnt;
120 __u32 capab; 120 __u32 capab;
121}; 121};
122 122
@@ -128,7 +128,7 @@ struct tcf_t {
128}; 128};
129 129
130struct tc_cnt { 130struct tc_cnt {
131 int refcnt; 131 int refcnt;
132 int bindcnt; 132 int bindcnt;
133}; 133};
134 134
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 5ebf6d6f85f6..719bc2e85852 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -504,8 +504,8 @@ nla_put_failure:
504} 504}
505EXPORT_SYMBOL(tcf_action_dump_1); 505EXPORT_SYMBOL(tcf_action_dump_1);
506 506
507int 507int tcf_action_dump(struct sk_buff *skb, struct list_head *actions,
508tcf_action_dump(struct sk_buff *skb, struct list_head *actions, int bind, int ref) 508 int bind, int ref)
509{ 509{
510 struct tc_action *a; 510 struct tc_action *a;
511 int err = -EINVAL; 511 int err = -EINVAL;
@@ -688,9 +688,9 @@ errout:
688 return -1; 688 return -1;
689} 689}
690 690
691static int 691static int tca_get_fill(struct sk_buff *skb, struct list_head *actions,
692tca_get_fill(struct sk_buff *skb, struct list_head *actions, u32 portid, u32 seq, 692 u32 portid, u32 seq, u16 flags, int event, int bind,
693 u16 flags, int event, int bind, int ref) 693 int ref)
694{ 694{
695 struct tcamsg *t; 695 struct tcamsg *t;
696 struct nlmsghdr *nlh; 696 struct nlmsghdr *nlh;
@@ -731,7 +731,8 @@ act_get_notify(struct net *net, u32 portid, struct nlmsghdr *n,
731 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); 731 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
732 if (!skb) 732 if (!skb)
733 return -ENOBUFS; 733 return -ENOBUFS;
734 if (tca_get_fill(skb, actions, portid, n->nlmsg_seq, 0, event, 0, 0) <= 0) { 734 if (tca_get_fill(skb, actions, portid, n->nlmsg_seq, 0, event,
735 0, 0) <= 0) {
735 kfree_skb(skb); 736 kfree_skb(skb);
736 return -EINVAL; 737 return -EINVAL;
737 } 738 }
@@ -839,7 +840,8 @@ static int tca_action_flush(struct net *net, struct nlattr *nla,
839 if (a.ops == NULL) /*some idjot trying to flush unknown action */ 840 if (a.ops == NULL) /*some idjot trying to flush unknown action */
840 goto err_out; 841 goto err_out;
841 842
842 nlh = nlmsg_put(skb, portid, n->nlmsg_seq, RTM_DELACTION, sizeof(*t), 0); 843 nlh = nlmsg_put(skb, portid, n->nlmsg_seq, RTM_DELACTION,
844 sizeof(*t), 0);
843 if (!nlh) 845 if (!nlh)
844 goto out_module_put; 846 goto out_module_put;
845 t = nlmsg_data(nlh); 847 t = nlmsg_data(nlh);
@@ -1002,7 +1004,8 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n)
1002 u32 portid = skb ? NETLINK_CB(skb).portid : 0; 1004 u32 portid = skb ? NETLINK_CB(skb).portid : 0;
1003 int ret = 0, ovr = 0; 1005 int ret = 0, ovr = 0;
1004 1006
1005 if ((n->nlmsg_type != RTM_GETACTION) && !netlink_capable(skb, CAP_NET_ADMIN)) 1007 if ((n->nlmsg_type != RTM_GETACTION) &&
1008 !netlink_capable(skb, CAP_NET_ADMIN))
1006 return -EPERM; 1009 return -EPERM;
1007 1010
1008 ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL); 1011 ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL);
diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c
index ae0e7cbe488c..f7b6cf49ea6f 100644
--- a/net/sched/act_bpf.c
+++ b/net/sched/act_bpf.c
@@ -169,7 +169,8 @@ nla_put_failure:
169static const struct nla_policy act_bpf_policy[TCA_ACT_BPF_MAX + 1] = { 169static const struct nla_policy act_bpf_policy[TCA_ACT_BPF_MAX + 1] = {
170 [TCA_ACT_BPF_PARMS] = { .len = sizeof(struct tc_act_bpf) }, 170 [TCA_ACT_BPF_PARMS] = { .len = sizeof(struct tc_act_bpf) },
171 [TCA_ACT_BPF_FD] = { .type = NLA_U32 }, 171 [TCA_ACT_BPF_FD] = { .type = NLA_U32 },
172 [TCA_ACT_BPF_NAME] = { .type = NLA_NUL_STRING, .len = ACT_BPF_NAME_LEN }, 172 [TCA_ACT_BPF_NAME] = { .type = NLA_NUL_STRING,
173 .len = ACT_BPF_NAME_LEN },
173 [TCA_ACT_BPF_OPS_LEN] = { .type = NLA_U16 }, 174 [TCA_ACT_BPF_OPS_LEN] = { .type = NLA_U16 },
174 [TCA_ACT_BPF_OPS] = { .type = NLA_BINARY, 175 [TCA_ACT_BPF_OPS] = { .type = NLA_BINARY,
175 .len = sizeof(struct sock_filter) * BPF_MAXINSNS }, 176 .len = sizeof(struct sock_filter) * BPF_MAXINSNS },
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c
index 4c6e0085054a..19058a7f3e5c 100644
--- a/net/sched/act_gact.c
+++ b/net/sched/act_gact.c
@@ -162,7 +162,8 @@ static void tcf_gact_stats_update(struct tc_action *a, u64 bytes, u32 packets,
162 tm->lastuse = lastuse; 162 tm->lastuse = lastuse;
163} 163}
164 164
165static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) 165static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a,
166 int bind, int ref)
166{ 167{
167 unsigned char *b = skb_tail_pointer(skb); 168 unsigned char *b = skb_tail_pointer(skb);
168 struct tcf_gact *gact = a->priv; 169 struct tcf_gact *gact = a->priv;
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index 3fcde44b8f4d..e7c0f4d944a2 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -34,7 +34,8 @@ static int ipt_net_id;
34 34
35static int xt_net_id; 35static int xt_net_id;
36 36
37static int ipt_init_target(struct xt_entry_target *t, char *table, unsigned int hook) 37static int ipt_init_target(struct xt_entry_target *t, char *table,
38 unsigned int hook)
38{ 39{
39 struct xt_tgchk_param par; 40 struct xt_tgchk_param par;
40 struct xt_target *target; 41 struct xt_target *target;
@@ -250,7 +251,8 @@ static int tcf_ipt(struct sk_buff *skb, const struct tc_action *a,
250 251
251} 252}
252 253
253static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) 254static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind,
255 int ref)
254{ 256{
255 unsigned char *b = skb_tail_pointer(skb); 257 unsigned char *b = skb_tail_pointer(skb);
256 struct tcf_ipt *ipt = a->priv; 258 struct tcf_ipt *ipt = a->priv;
diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c
index f0a08a11f54f..b075d50e0fc3 100644
--- a/net/sched/act_vlan.c
+++ b/net/sched/act_vlan.c
@@ -179,7 +179,8 @@ static int tcf_vlan_dump(struct sk_buff *skb, struct tc_action *a,
179 179
180 if (v->tcfv_action == TCA_VLAN_ACT_PUSH && 180 if (v->tcfv_action == TCA_VLAN_ACT_PUSH &&
181 (nla_put_u16(skb, TCA_VLAN_PUSH_VLAN_ID, v->tcfv_push_vid) || 181 (nla_put_u16(skb, TCA_VLAN_PUSH_VLAN_ID, v->tcfv_push_vid) ||
182 nla_put_be16(skb, TCA_VLAN_PUSH_VLAN_PROTOCOL, v->tcfv_push_proto))) 182 nla_put_be16(skb, TCA_VLAN_PUSH_VLAN_PROTOCOL,
183 v->tcfv_push_proto)))
183 goto nla_put_failure; 184 goto nla_put_failure;
184 185
185 tcf_tm_dump(&t, &v->tcf_tm); 186 tcf_tm_dump(&t, &v->tcf_tm);
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index a75864d93142..aafa6bce173e 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -351,8 +351,9 @@ errout:
351 return err; 351 return err;
352} 352}
353 353
354static int tcf_fill_node(struct net *net, struct sk_buff *skb, struct tcf_proto *tp, 354static int tcf_fill_node(struct net *net, struct sk_buff *skb,
355 unsigned long fh, u32 portid, u32 seq, u16 flags, int event) 355 struct tcf_proto *tp, unsigned long fh, u32 portid,
356 u32 seq, u16 flags, int event)
356{ 357{
357 struct tcmsg *tcm; 358 struct tcmsg *tcm;
358 struct nlmsghdr *nlh; 359 struct nlmsghdr *nlh;
@@ -474,9 +475,11 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
474 TC_H_MIN(tcm->tcm_info) != tp->protocol) 475 TC_H_MIN(tcm->tcm_info) != tp->protocol)
475 continue; 476 continue;
476 if (t > s_t) 477 if (t > s_t)
477 memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0])); 478 memset(&cb->args[1], 0,
479 sizeof(cb->args)-sizeof(cb->args[0]));
478 if (cb->args[1] == 0) { 480 if (cb->args[1] == 0) {
479 if (tcf_fill_node(net, skb, tp, 0, NETLINK_CB(cb->skb).portid, 481 if (tcf_fill_node(net, skb, tp, 0,
482 NETLINK_CB(cb->skb).portid,
480 cb->nlh->nlmsg_seq, NLM_F_MULTI, 483 cb->nlh->nlmsg_seq, NLM_F_MULTI,
481 RTM_NEWTFILTER) <= 0) 484 RTM_NEWTFILTER) <= 0)
482 break; 485 break;