Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5899827imd; Wed, 31 Oct 2018 03:59:58 -0700 (PDT) X-Google-Smtp-Source: AJdET5d0Kmn3LNkuRlNHWdOg35tM8OsQg0LTj+Dn+3woQy6tcHNBtm71wod+G7GTX1c/bIZ+XO3p X-Received: by 2002:a62:1d92:: with SMTP id d140-v6mr2802634pfd.157.1540983598484; Wed, 31 Oct 2018 03:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540983598; cv=none; d=google.com; s=arc-20160816; b=KdF3Y07jgFE8/ra1OuvoL48FbMiq565ry7CPwgOyhk9CakbdnL0wn6FeCYWLgxi1tr 8obEUw7AflR2v3RrloAlv8brBS5xi16K1aF/mBh3qk/GWe7c/DwmaQOyG53d8mVjbk6g ffRSEVQD7XMAk0pvNRMNL3w8tTAL1oiGpWmlj1q51oqZ4MfxrDiIFufQqQT3Eomdz9Wn bE/mHBOrY6gIttrfX0Oh3AQ6QlwzYPuvwZLsvD8CauZJftPnuwMht6ifc8UgbME+q4iq slIIkxN6q05VqHEB6a1otcXR10MCt4MysRfuwGbd6eiXsQ2fKqgyJ9J+p8oBRjtkZpHT TJmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=V4/gdpncSNEQ4mZl16I2UnE30UBx6m4HftDP1gv2Atw=; b=scYue3sMlKy+KUyZsQRUa4p4KnzvZWzx0jNSh3uvUwXZdIBKMy8vOozb3jZIDWivwU bfT7woEuUdyrZmrRamsSdscunpxm9z22m882ZawvKia2dhdKQNqk44VdqjqhJDyI+F9c tOOOATMi5oo8GIOeF4uxQW3SHATETvrWKs9u/bo7Q/3hJN4yZlwLxgq03B/zykbx5P4c y7SxX8IJr6DP9lmA8q8Tptxw037C4LJXrYg+PqLJwxxa6rX44zeHGnhhWYa3KDJy98Pf GM5DUkPFuueFiqPdIGb8hlC00DIS7sYabtwn2MdtuaIRIEz2KShb5XriqhBuqV1TjeBL z/hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=d0c9joiE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f14-v6si26713208pgr.259.2018.10.31.03.59.43; Wed, 31 Oct 2018 03:59:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=d0c9joiE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729235AbeJaT4b (ORCPT + 99 others); Wed, 31 Oct 2018 15:56:31 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:38338 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728918AbeJaTzo (ORCPT ); Wed, 31 Oct 2018 15:55:44 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9VAnn9r133983; Wed, 31 Oct 2018 10:58:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=V4/gdpncSNEQ4mZl16I2UnE30UBx6m4HftDP1gv2Atw=; b=d0c9joiE/zKrhnyCi1N6JtSUqChZZ6zYUIHOriAMbo/3lc/o3U33e61oSVtm0zKXGA6I gGYBmMol36B1+LD9JbIZMCjTW/URtdZm++rcJjecv4KdMVe14RfVJt9yT6w0QiLnWBJh +uGVa0oGoM6JOnMUap4jMJWicINX7LmawY/f7oZI+IY6f3XyVuI6b+dCpOuBQ/9+CeMG IXmhnmG/tSdKYhPz0MGpmkU7Zo+G3NiqAuqYm5CiiWqzR18tdg7052ppgbS09tUPxkub 9uXIIlQHc9FmyCGu4jFFrxdqVJcmvjNPvPodyg9hi7+QSkpIFA2bd/BHaEhJo3B+h7Pm Mw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2ncfyq235b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Oct 2018 10:58:02 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9VAw1EY018986 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Oct 2018 10:58:01 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w9VAvxlB029153; Wed, 31 Oct 2018 10:58:00 GMT Received: from manish-VirtualBox.in.oracle.com (/10.191.249.11) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 31 Oct 2018 03:57:59 -0700 From: mk.singh@oracle.com To: netdev@vger.kernel.org Cc: eric.dumazet@gmail.com, mkubecek@suse.cz, Manish Kumar Singh , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH] bonding:avoid repeated display of same link status change Date: Wed, 31 Oct 2018 16:27:28 +0530 Message-Id: <20181031105729.7442-1-mk.singh@oracle.com> X-Mailer: git-send-email 2.14.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9062 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810310090 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Manish Kumar Singh When link status change needs to be committed and rtnl lock couldn't be taken, avoid redisplay of same link status change message. Signed-off-by: Manish Kumar Singh --- drivers/net/bonding/bond_main.c | 8 ++++++-- include/net/bonding.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 2b01180be834..b3d95c7040ac 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2096,7 +2096,8 @@ static int bond_miimon_inspect(struct bonding *bond) bond_propose_link_state(slave, BOND_LINK_FAIL); commit++; slave->delay = bond->params.downdelay; - if (slave->delay) { + if (slave->delay && + !atomic64_read(&bond->rtnl_needed)) { netdev_info(bond->dev, "link status down for %sinterface %s, disabling it in %d ms\n", (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) ? @@ -2136,7 +2137,8 @@ static int bond_miimon_inspect(struct bonding *bond) commit++; slave->delay = bond->params.updelay; - if (slave->delay) { + if (slave->delay && + !atomic64_read(&bond->rtnl_needed)) { netdev_info(bond->dev, "link status up for interface %s, enabling it in %d ms\n", slave->dev->name, ignore_updelay ? 0 : @@ -2310,9 +2312,11 @@ static void bond_mii_monitor(struct work_struct *work) if (!rtnl_trylock()) { delay = 1; should_notify_peers = false; + atomic64_set(&bond->rtnl_needed, 1); goto re_arm; } + atomic64_set(&bond->rtnl_needed, 0); bond_for_each_slave(bond, slave, iter) { bond_commit_link_state(slave, BOND_SLAVE_NOTIFY_LATER); } diff --git a/include/net/bonding.h b/include/net/bonding.h index a4f116f06c50..20c3c875266f 100644 --- a/include/net/bonding.h +++ b/include/net/bonding.h @@ -229,6 +229,7 @@ struct bonding { struct dentry *debug_dir; #endif /* CONFIG_DEBUG_FS */ struct rtnl_link_stats64 bond_stats; + atomic64_t rtnl_needed; }; #define bond_slave_get_rcu(dev) \ -- 2.14.1