aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordingtianhong <dingtianhong@huawei.com>2014-03-25 05:44:44 -0400
committerDavid S. Miller <davem@davemloft.net>2014-03-26 16:41:28 -0400
commit4873ac3c8ed3b0285f18b81e501249c26284c2ca (patch)
treeea3955db51ca63b5f7117535aaee782cbb64382b
parentfbd929f2dce460456807a51e18d623db3db9f077 (diff)
bonding: add net_ratelimt to avoid spam in arp interval
Remove the unnecessary log and add net_ratelimit to the others, in order to avoid spam the log. Cc: Joe Perches <joe@perches.com> Cc: Jay Vosburgh <fubar@us.ibm.com> Cc: Veaceslav Falico <vfalico@redhat.com> Cc: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bonding/bond_main.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 7802c2ebdb0d..5be34b72a048 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2138,16 +2138,17 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
2138 NULL, slave_dev->dev_addr, NULL); 2138 NULL, slave_dev->dev_addr, NULL);
2139 2139
2140 if (!skb) { 2140 if (!skb) {
2141 pr_err("ARP packet allocation failed\n"); 2141 net_err_ratelimited("ARP packet allocation failed\n");
2142 return; 2142 return;
2143 } 2143 }
2144 if (outer->vlan_id) { 2144 if (outer->vlan_id) {
2145 if (inner->vlan_id) { 2145 if (inner->vlan_id) {
2146 pr_debug("inner tag: proto %X vid %X\n", 2146 pr_debug("inner tag: proto %X vid %X\n",
2147 ntohs(inner->vlan_proto), inner->vlan_id); 2147 ntohs(inner->vlan_proto), inner->vlan_id);
2148 skb = __vlan_put_tag(skb, inner->vlan_proto, inner->vlan_id); 2148 skb = __vlan_put_tag(skb, inner->vlan_proto,
2149 inner->vlan_id);
2149 if (!skb) { 2150 if (!skb) {
2150 pr_err("failed to insert inner VLAN tag\n"); 2151 net_err_ratelimited("failed to insert inner VLAN tag\n");
2151 return; 2152 return;
2152 } 2153 }
2153 } 2154 }
@@ -2156,7 +2157,7 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
2156 ntohs(outer->vlan_proto), outer->vlan_id); 2157 ntohs(outer->vlan_proto), outer->vlan_id);
2157 skb = vlan_put_tag(skb, outer->vlan_proto, outer->vlan_id); 2158 skb = vlan_put_tag(skb, outer->vlan_proto, outer->vlan_id);
2158 if (!skb) { 2159 if (!skb) {
2159 pr_err("failed to insert outer VLAN tag\n"); 2160 net_err_ratelimited("failed to insert outer VLAN tag\n");
2160 return; 2161 return;
2161 } 2162 }
2162 } 2163 }
@@ -2187,9 +2188,10 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
2187 /* there's no route to target - try to send arp 2188 /* there's no route to target - try to send arp
2188 * probe to generate any traffic (arp_validate=0) 2189 * probe to generate any traffic (arp_validate=0)
2189 */ 2190 */
2190 if (bond->params.arp_validate && net_ratelimit()) 2191 if (bond->params.arp_validate)
2191 pr_warn("%s: no route to arp_ip_target %pI4 and arp_validate is set\n", 2192 net_warn_ratelimited("%s: no route to arp_ip_target %pI4 and arp_validate is set\n",
2192 bond->dev->name, &targets[i]); 2193 bond->dev->name,
2194 &targets[i]);
2193 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], 0, &inner, &outer); 2195 bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], 0, &inner, &outer);
2194 continue; 2196 continue;
2195 } 2197 }