Commit fd325c20 authored by Jamal Hadi Salim's avatar Jamal Hadi Salim Committed by David S. Miller

[NET]: Two tc action fixes.

Another patchlet after turning on preempt and rerunning tests.
- against dev.c is a genuine bug - i wish preempt would have
given a more sane hint. Strange on how its a non issue when preempt is
off. 
- against act_api.c is just an annoyance. I removed the kmod because it
will only make sense to list actions if policies exist for that action.
And if policies exist, the module would be loaded.
Signed-off-by: default avatarJamal Hadi Salim <hadi@zynx.com>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent be4f1e00
...@@ -1834,6 +1834,7 @@ int netif_receive_skb(struct sk_buff *skb) ...@@ -1834,6 +1834,7 @@ int netif_receive_skb(struct sk_buff *skb)
#ifdef CONFIG_NET_CLS_ACT #ifdef CONFIG_NET_CLS_ACT
if (skb->tc_verd & TC_NCLS) { if (skb->tc_verd & TC_NCLS) {
skb->tc_verd = CLR_TC_NCLS(skb->tc_verd); skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
rcu_read_lock();
goto ncls; goto ncls;
} }
#endif #endif
......
...@@ -38,6 +38,11 @@ ...@@ -38,6 +38,11 @@
#else #else
#define DPRINTK(format,args...) #define DPRINTK(format,args...)
#endif #endif
#if 0 /* data */
#define D2PRINTK(format,args...) printk(KERN_DEBUG format,##args)
#else
#define D2PRINTK(format,args...)
#endif
static struct tc_action_ops *act_base = NULL; static struct tc_action_ops *act_base = NULL;
static rwlock_t act_mod_lock = RW_LOCK_UNLOCKED; static rwlock_t act_mod_lock = RW_LOCK_UNLOCKED;
...@@ -158,7 +163,7 @@ int tcf_action_exec(struct sk_buff *skb,struct tc_action *act) ...@@ -158,7 +163,7 @@ int tcf_action_exec(struct sk_buff *skb,struct tc_action *act)
if (skb->tc_verd & TC_NCLS) { if (skb->tc_verd & TC_NCLS) {
skb->tc_verd = CLR_TC_NCLS(skb->tc_verd); skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
DPRINTK("(%p)tcf_action_exec: cleared TC_NCLS in %s out %s\n",skb,skb->input_dev?skb->input_dev->name:"xxx",skb->dev->name); D2PRINTK("(%p)tcf_action_exec: cleared TC_NCLS in %s out %s\n",skb,skb->input_dev?skb->input_dev->name:"xxx",skb->dev->name);
return TC_ACT_OK; return TC_ACT_OK;
} }
while ((a = act) != NULL) { while ((a = act) != NULL) {
...@@ -816,6 +821,8 @@ int tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr ) ...@@ -816,6 +821,8 @@ int tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr )
if (NULL == act) if (NULL == act)
return -ENOMEM; return -ENOMEM;
memset(act, 0, sizeof(*act));
ret = tcf_action_init(rta, NULL,act,NULL,ovr,0); ret = tcf_action_init(rta, NULL,act,NULL,ovr,0);
/* NOTE: We have an all-or-none model /* NOTE: We have an all-or-none model
* This means that of any of the actions fail * This means that of any of the actions fail
...@@ -936,13 +943,6 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -936,13 +943,6 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
a_o = tc_lookup_action_n(kind); a_o = tc_lookup_action_n(kind);
#ifdef CONFIG_KMOD
if (NULL == a_o) {
DPRINTK("tc_dump_action: trying to load module %s\n", kind);
request_module(kind);
a_o = tc_lookup_action_n(kind);
}
#endif
if (NULL == a_o) { if (NULL == a_o) {
printk("failed to find %s\n", kind); printk("failed to find %s\n", kind);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment