Commit 6ff9c3644e72bfac20844e0155c2cc8108602820

Authored by stephen hemminger
Committed by David S. Miller
1 parent 00c60a8312

net sched: printk message severity

The previous patch encourage me to go look at all the messages in
the network scheduler and fix them. Many messages were missing
any severity level. Some serious ones that should never happen
were turned into WARN(), and the random noise messages that were
handled changed to pr_debug().

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 8 changed files with 33 additions and 28 deletions Side-by-side Diff

... ... @@ -153,7 +153,7 @@
153 153 } else if (type == RTM_GETACTION) {
154 154 return tcf_dump_walker(skb, cb, a, hinfo);
155 155 } else {
156   - printk("tcf_generic_walker: unknown action %d\n", type);
  156 + WARN(1, "tcf_generic_walker: unknown action %d\n", type);
157 157 return -EINVAL;
158 158 }
159 159 }
... ... @@ -403,8 +403,9 @@
403 403 module_put(a->ops->owner);
404 404 act = act->next;
405 405 kfree(a);
406   - } else { /*FIXME: Remove later - catch insertion bugs*/
407   - printk("tcf_action_destroy: BUG? destroying NULL ops\n");
  406 + } else {
  407 + /*FIXME: Remove later - catch insertion bugs*/
  408 + WARN(1, "tcf_action_destroy: BUG? destroying NULL ops\n");
408 409 act = act->next;
409 410 kfree(a);
410 411 }
... ... @@ -744,7 +745,7 @@
744 745  
745 746 act = kzalloc(sizeof(*act), GFP_KERNEL);
746 747 if (act == NULL) {
747   - printk("create_a: failed to alloc!\n");
  748 + pr_debug("create_a: failed to alloc!\n");
748 749 return NULL;
749 750 }
750 751 act->order = i;
751 752  
... ... @@ -766,13 +767,13 @@
766 767 int err = -ENOMEM;
767 768  
768 769 if (a == NULL) {
769   - printk("tca_action_flush: couldnt create tc_action\n");
  770 + pr_debug("tca_action_flush: couldnt create tc_action\n");
770 771 return err;
771 772 }
772 773  
773 774 skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL);
774 775 if (!skb) {
775   - printk("tca_action_flush: failed skb alloc\n");
  776 + pr_debug("tca_action_flush: failed skb alloc\n");
776 777 kfree(a);
777 778 return err;
778 779 }
... ... @@ -979,7 +980,7 @@
979 980 return ret;
980 981  
981 982 if (tca[TCA_ACT_TAB] == NULL) {
982   - printk("tc_ctl_action: received NO action attribs\n");
  983 + pr_notice("tc_ctl_action: received NO action attribs\n");
983 984 return -EINVAL;
984 985 }
985 986  
... ... @@ -1056,7 +1057,7 @@
1056 1057 struct nlattr *kind = find_dump_kind(cb->nlh);
1057 1058  
1058 1059 if (kind == NULL) {
1059   - printk("tc_dump_action: action bad kind\n");
  1060 + pr_info("tc_dump_action: action bad kind\n");
1060 1061 return 0;
1061 1062 }
1062 1063  
... ... @@ -1069,7 +1070,8 @@
1069 1070 a.ops = a_o;
1070 1071  
1071 1072 if (a_o->walk == NULL) {
1072   - printk("tc_dump_action: %s !capable of dumping table\n", a_o->kind);
  1073 + WARN(1, "tc_dump_action: %s !capable of dumping table\n",
  1074 + a_o->kind);
1073 1075 goto nla_put_failure;
1074 1076 }
1075 1077  
net/sched/act_gact.c
... ... @@ -202,9 +202,9 @@
202 202 static int __init gact_init_module(void)
203 203 {
204 204 #ifdef CONFIG_GACT_PROB
205   - printk("GACT probability on\n");
  205 + printk(KERN_INFO "GACT probability on\n");
206 206 #else
207   - printk("GACT probability NOT on\n");
  207 + printk(KERN_INFO "GACT probability NOT on\n");
208 208 #endif
209 209 return tcf_register_action(&act_gact_ops);
210 210 }
... ... @@ -235,7 +235,8 @@
235 235 break;
236 236 default:
237 237 if (net_ratelimit())
238   - printk("Bogus netfilter code %d assume ACCEPT\n", ret);
  238 + pr_notice("tc filter: Bogus netfilter code"
  239 + " %d assume ACCEPT\n", ret);
239 240 result = TC_POLICE_OK;
240 241 break;
241 242 }
net/sched/act_mirred.c
... ... @@ -164,8 +164,8 @@
164 164 dev = m->tcfm_dev;
165 165 if (!(dev->flags & IFF_UP)) {
166 166 if (net_ratelimit())
167   - printk("mirred to Houston: device %s is gone!\n",
168   - dev->name);
  167 + pr_notice("tc mirred to Houston: device %s is gone!\n",
  168 + dev->name);
169 169 goto out;
170 170 }
171 171  
... ... @@ -252,7 +252,7 @@
252 252  
253 253 static int __init mirred_init_module(void)
254 254 {
255   - printk("Mirror/redirect action on\n");
  255 + pr_info("Mirror/redirect action on\n");
256 256 return tcf_register_action(&act_mirred_ops);
257 257 }
258 258  
net/sched/act_pedit.c
... ... @@ -158,11 +158,13 @@
158 158 }
159 159  
160 160 if (offset % 4) {
161   - printk("offset must be on 32 bit boundaries\n");
  161 + pr_info("tc filter pedit"
  162 + " offset must be on 32 bit boundaries\n");
162 163 goto bad;
163 164 }
164 165 if (offset > 0 && offset > skb->len) {
165   - printk("offset %d cant exceed pkt length %d\n",
  166 + pr_info("tc filter pedit"
  167 + " offset %d cant exceed pkt length %d\n",
166 168 offset, skb->len);
167 169 goto bad;
168 170 }
... ... @@ -176,9 +178,8 @@
176 178 if (munged)
177 179 skb->tc_verd = SET_TC_MUNGED(skb->tc_verd);
178 180 goto done;
179   - } else {
180   - printk("pedit BUG: index %d\n", p->tcf_index);
181   - }
  181 + } else
  182 + WARN(1, "pedit BUG: index %d\n", p->tcf_index);
182 183  
183 184 bad:
184 185 p->tcf_qstats.overlimits++;
net/sched/act_simple.c
... ... @@ -49,7 +49,7 @@
49 49 * Example if this was the 3rd packet and the string was "hello"
50 50 * then it would look like "hello_3" (without quotes)
51 51 **/
52   - printk("simple: %s_%d\n",
  52 + pr_info("simple: %s_%d\n",
53 53 (char *)d->tcfd_defdata, d->tcf_bstats.packets);
54 54 spin_unlock(&d->tcf_lock);
55 55 return d->tcf_action;
... ... @@ -205,7 +205,7 @@
205 205 {
206 206 int ret = tcf_register_action(&act_simp_ops);
207 207 if (!ret)
208   - printk("Simple TC action Loaded\n");
  208 + pr_info("Simple TC action Loaded\n");
209 209 return ret;
210 210 }
211 211  
... ... @@ -211,7 +211,7 @@
211 211  
212 212 deadloop:
213 213 if (net_ratelimit())
214   - printk("cls_u32: dead loop\n");
  214 + printk(KERN_WARNING "cls_u32: dead loop\n");
215 215 return -1;
216 216 }
217 217  
218 218  
219 219  
220 220  
... ... @@ -768,15 +768,15 @@
768 768  
769 769 static int __init init_u32(void)
770 770 {
771   - printk("u32 classifier\n");
  771 + pr_info("u32 classifier\n");
772 772 #ifdef CONFIG_CLS_U32_PERF
773   - printk(" Performance counters on\n");
  773 + pr_info(" Performance counters on\n");
774 774 #endif
775 775 #ifdef CONFIG_NET_CLS_IND
776   - printk(" input device check on\n");
  776 + pr_info(" input device check on\n");
777 777 #endif
778 778 #ifdef CONFIG_NET_CLS_ACT
779   - printk(" Actions configured\n");
  779 + pr_info(" Actions configured\n");
780 780 #endif
781 781 return register_tcf_proto_ops(&cls_u32_ops);
782 782 }
... ... @@ -527,7 +527,8 @@
527 527  
528 528 stack_overflow:
529 529 if (net_ratelimit())
530   - printk("Local stack overflow, increase NET_EMATCH_STACK\n");
  530 + printk(KERN_WARNING "tc ematch: local stack overflow,"
  531 + " increase NET_EMATCH_STACK\n");
531 532 return -1;
532 533 }
533 534 EXPORT_SYMBOL(__tcf_em_tree_match);