netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Veaceslav Falico <vfalico@redhat.com>
To: Ding Tianhong <dingtianhong@huawei.com>
Cc: fubar@us.ibm.com, andy@greyhouse.net, joe@perches.com,
	kaber@trash.net, davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 3/3] bonding: add ratelimit for bond_arp_rcv()
Date: Tue, 25 Mar 2014 08:34:55 +0100	[thread overview]
Message-ID: <20140325073455.GB1476@redhat.com> (raw)
In-Reply-To: <1395731037-4812-4-git-send-email-dingtianhong@huawei.com>

On Tue, Mar 25, 2014 at 03:03:57PM +0800, Ding Tianhong wrote:
>Add ratelimit to avoid spam when processing the arp package.

You've ratelimited here only debug statements. As with the another
patchset, I think that it's a bad idea for debugging - if the user turns
debugging on he wants to see all messages, and otherwise he won't ever see
any.

>
>Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
>---
> drivers/net/bonding/bond_main.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 9e8b888..7328a3f 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -2239,13 +2239,15 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
> 	int i;
>
> 	if (!sip || !bond_has_this_ip(bond, tip)) {
>-		pr_debug("bva: sip %pI4 tip %pI4 not found\n", &sip, &tip);
>+		pr_debug_ratelimited("bva: sip %pI4 tip %pI4 not found\n",
>+				     &sip, &tip);
> 		return;
> 	}
>
> 	i = bond_get_targets_ip(bond->params.arp_targets, sip);
> 	if (i == -1) {
>-		pr_debug("bva: sip %pI4 not found in targets\n", &sip);
>+		pr_debug_ratelimited("bva: sip %pI4 not found in targets\n",
>+				     &sip);
> 		return;
> 	}
> 	slave->last_rx = jiffies;
>@@ -2272,8 +2274,8 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
>
> 	alen = arp_hdr_len(bond->dev);
>
>-	pr_debug("bond_arp_rcv: bond %s skb->dev %s\n",
>-		 bond->dev->name, skb->dev->name);
>+	pr_debug_ratelimited("bond_arp_rcv: bond %s skb->dev %s\n",
>+			     bond->dev->name, skb->dev->name);
>
> 	if (alen > skb_headlen(skb)) {
> 		arp = kmalloc(alen, GFP_ATOMIC);
>@@ -2297,10 +2299,11 @@ int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond,
> 	arp_ptr += 4 + bond->dev->addr_len;
> 	memcpy(&tip, arp_ptr, 4);
>
>-	pr_debug("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n",
>-		 bond->dev->name, slave->dev->name, bond_slave_state(slave),
>-		 bond->params.arp_validate, slave_do_arp_validate(bond, slave),
>-		 &sip, &tip);
>+	pr_debug_ratelimited("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n",
>+			     bond->dev->name, slave->dev->name,
>+			     bond_slave_state(slave),
>+			     bond->params.arp_validate,
>+			     slave_do_arp_validate(bond, slave), &sip, &tip);
>
> 	curr_active_slave = rcu_dereference(bond->curr_active_slave);
>
>-- 
>1.8.0
>
>

  reply	other threads:[~2014-03-25  7:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25  7:03 [PATCH net-next 0/3] slight optimization and avoid spam for bond fast path Ding Tianhong
2014-03-25  7:03 ` [PATCH net-next 1/3] bonding: slight optimization for bond xmit path Ding Tianhong
2014-03-25  7:03 ` [PATCH net-next 2/3] bonding: ratelimit pr_err() for bond xmit broadcast Ding Tianhong
2014-03-25  7:19   ` Joe Perches
2014-03-25  8:12     ` Ding Tianhong
2014-03-25  7:03 ` [PATCH net-next 3/3] bonding: add ratelimit for bond_arp_rcv() Ding Tianhong
2014-03-25  7:34   ` Veaceslav Falico [this message]
2014-03-25  8:17     ` Ding Tianhong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140325073455.GB1476@redhat.com \
    --to=vfalico@redhat.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=dingtianhong@huawei.com \
    --cc=fubar@us.ibm.com \
    --cc=joe@perches.com \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).