From patchwork Sun Mar 16 16:29:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Veaceslav Falico X-Patchwork-Id: 330716 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 72B232C0099 for ; Mon, 17 Mar 2014 03:34:00 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754561AbaCPQdz (ORCPT ); Sun, 16 Mar 2014 12:33:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7755 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753281AbaCPQdy (ORCPT ); Sun, 16 Mar 2014 12:33:54 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2GGXpRB030030 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 16 Mar 2014 12:33:52 -0400 Received: from darkmag.usersys.redhat.com (dhcp-27-102.brq.redhat.com [10.34.27.102]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s2GGXn78014196; Sun, 16 Mar 2014 12:33:50 -0400 From: Veaceslav Falico To: netdev@vger.kernel.org Cc: Veaceslav Falico , Jay Vosburgh , Andy Gospodarek Subject: [PATCH net-next] bonding: net_ratelimit() pr_warn()s in 802.3ad mode Date: Sun, 16 Mar 2014 17:29:40 +0100 Message-Id: <1394987380-15765-1-git-send-email-vfalico@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Only ratelimit the ones that might spam, omiting the ones from enslave/deslave. CC: Jay Vosburgh CC: Andy Gospodarek Signed-off-by: Veaceslav Falico --- drivers/net/bonding/bond_3ad.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index dee2a84..f2700aa 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -1280,7 +1280,7 @@ static void ad_port_selection_logic(struct port *port) break; } } - if (!curr_port) { + if (!curr_port && net_ratelimit()) { /* meaning: the port was related to an aggregator * but was not on the aggregator port list */ @@ -1445,9 +1445,10 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best, break; default: - pr_warn("%s: Impossible agg select mode %d\n", - curr->slave->bond->dev->name, - __get_agg_selection_mode(curr->lag_ports)); + if (net_ratelimit()) + pr_warn("%s: Impossible agg select mode %d\n", + curr->slave->bond->dev->name, + __get_agg_selection_mode(curr->lag_ports)); break; } @@ -1559,7 +1560,7 @@ static void ad_agg_selection_logic(struct aggregator *agg) } /* check if any partner replys */ - if (best->is_individual) { + if (best->is_individual && net_ratelimit()) { pr_warn("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n", best->slave ? best->slave->bond->dev->name : "NULL"); @@ -2080,7 +2081,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work) /* select the active aggregator for the bond */ if (port) { - if (!port->slave) { + if (!port->slave && net_ratelimit()) { pr_warn("%s: Warning: bond's first port is uninitialized\n", bond->dev->name); goto re_arm; @@ -2095,7 +2096,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work) /* for each port run the state machines */ bond_for_each_slave_rcu(bond, slave, iter) { port = &(SLAVE_AD_INFO(slave).port); - if (!port->slave) { + if (!port->slave && net_ratelimit()) { pr_warn("%s: Warning: Found an uninitialized port\n", bond->dev->name); goto re_arm; @@ -2157,7 +2158,7 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, port = &(SLAVE_AD_INFO(slave).port); - if (!port->slave) { + if (!port->slave && net_ratelimit()) { pr_warn("%s: Warning: port of slave %s is uninitialized\n", slave->dev->name, slave->bond->dev->name); return ret;