Commit e3c9673e authored by Pedro Tammela's avatar Pedro Tammela Committed by David S. Miller

net/sched: act_pedit: rate limit datapath messages

Unbounded info messages in the pedit datapath can flood the printk
ring buffer quite easily depending on the action created.
As these messages are informational, usually printing some, not all,
is enough to bring attention to the real issue.
Reviewed-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Signed-off-by: default avatarPedro Tammela <pctammela@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 57714018
...@@ -396,7 +396,7 @@ TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb, ...@@ -396,7 +396,7 @@ TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
u8 *d, _d; u8 *d, _d;
if (!offset_valid(skb, hoffset + tkey->at)) { if (!offset_valid(skb, hoffset + tkey->at)) {
pr_info("tc action pedit 'at' offset %d out of bounds\n", pr_info_ratelimited("tc action pedit 'at' offset %d out of bounds\n",
hoffset + tkey->at); hoffset + tkey->at);
goto bad; goto bad;
} }
...@@ -407,14 +407,13 @@ TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb, ...@@ -407,14 +407,13 @@ TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
offset += (*d & tkey->offmask) >> tkey->shift; offset += (*d & tkey->offmask) >> tkey->shift;
if (offset % 4) { if (offset % 4) {
pr_info("tc action pedit offset must be on 32 bit boundaries\n"); pr_info_ratelimited("tc action pedit offset must be on 32 bit boundaries\n");
goto bad; goto bad;
} }
} }
if (!offset_valid(skb, hoffset + offset)) { if (!offset_valid(skb, hoffset + offset)) {
pr_info("tc action pedit offset %d out of bounds\n", pr_info_ratelimited("tc action pedit offset %d out of bounds\n", hoffset + offset);
hoffset + offset);
goto bad; goto bad;
} }
...@@ -431,8 +430,7 @@ TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb, ...@@ -431,8 +430,7 @@ TC_INDIRECT_SCOPE int tcf_pedit_act(struct sk_buff *skb,
val = (*ptr + tkey->val) & ~tkey->mask; val = (*ptr + tkey->val) & ~tkey->mask;
break; break;
default: default:
pr_info("tc action pedit bad command (%d)\n", pr_info_ratelimited("tc action pedit bad command (%d)\n", cmd);
cmd);
goto bad; goto bad;
} }
......
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