Skip to content

Commit 4873ac3

Browse files
dingtianhongdavem330
authored andcommitted
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>
1 parent fbd929f commit 4873ac3

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,16 +2138,17 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
21382138
NULL, slave_dev->dev_addr, NULL);
21392139

21402140
if (!skb) {
2141-
pr_err("ARP packet allocation failed\n");
2141+
net_err_ratelimited("ARP packet allocation failed\n");
21422142
return;
21432143
}
21442144
if (outer->vlan_id) {
21452145
if (inner->vlan_id) {
21462146
pr_debug("inner tag: proto %X vid %X\n",
21472147
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);
21492150
if (!skb) {
2150-
pr_err("failed to insert inner VLAN tag\n");
2151+
net_err_ratelimited("failed to insert inner VLAN tag\n");
21512152
return;
21522153
}
21532154
}
@@ -2156,7 +2157,7 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op,
21562157
ntohs(outer->vlan_proto), outer->vlan_id);
21572158
skb = vlan_put_tag(skb, outer->vlan_proto, outer->vlan_id);
21582159
if (!skb) {
2159-
pr_err("failed to insert outer VLAN tag\n");
2160+
net_err_ratelimited("failed to insert outer VLAN tag\n");
21602161
return;
21612162
}
21622163
}
@@ -2187,9 +2188,10 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
21872188
/* there's no route to target - try to send arp
21882189
* probe to generate any traffic (arp_validate=0)
21892190
*/
2190-
if (bond->params.arp_validate && net_ratelimit())
2191-
pr_warn("%s: no route to arp_ip_target %pI4 and arp_validate is set\n",
2192-
bond->dev->name, &targets[i]);
2191+
if (bond->params.arp_validate)
2192+
net_warn_ratelimited("%s: no route to arp_ip_target %pI4 and arp_validate is set\n",
2193+
bond->dev->name,
2194+
&targets[i]);
21932195
bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], 0, &inner, &outer);
21942196
continue;
21952197
}

0 commit comments

Comments
 (0)