From patchwork Mon Mar 7 22:36:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 593474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 98E4D140271; Tue, 8 Mar 2016 09:45:45 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ad3uI-0004dM-7X; Mon, 07 Mar 2016 22:45:42 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ad3lb-0008T9-NG for kernel-team@lists.ubuntu.com; Mon, 07 Mar 2016 22:36:43 +0000 Received: from 1.general.kamal.us.vpn ([10.172.68.52] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ad3lb-0007iB-8v; Mon, 07 Mar 2016 22:36:43 +0000 Received: from kamal by fourier with local (Exim 4.86) (envelope-from ) id 1ad3lY-0001K7-JZ; Mon, 07 Mar 2016 14:36:40 -0800 From: Kamal Mostafa To: Jay Vosburgh Subject: [4.2.y-ckt stable] Patch "bonding: don't use stale speed and duplex information" has been added to the 4.2.y-ckt tree Date: Mon, 7 Mar 2016 14:36:39 -0800 Message-Id: <1457390199-5052-1-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 2.7.0 X-Extended-Stable: 4.2 Cc: kernel-team@lists.ubuntu.com, Kamal Mostafa , Veaceslav Falico , "David S . Miller" , dingtianhong X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled bonding: don't use stale speed and duplex information to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree which can be found at: http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue This patch is scheduled to be released in version 4.2.8-ckt5. If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 4.2.y-ckt tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Kamal ---8<------------------------------------------------------------ From 8084f44b5b1dbd161b4ac935196eecbab893b2dc Mon Sep 17 00:00:00 2001 From: Jay Vosburgh Date: Mon, 8 Feb 2016 12:10:02 -0800 Subject: bonding: don't use stale speed and duplex information commit 266b495f11d6706018f66250cb02a788ff2490d7 upstream. There is presently a race condition between the bonding periodic link monitor and the updating of a slave's speed and duplex. The former occurs on a periodic basis, and the latter in response to a driver's calling of netif_carrier_on. It is possible for the periodic monitor to run between the driver call of netif_carrier_on and the receipt of the NETDEV_CHANGE event that causes bonding to update the slave's speed and duplex. This manifests most notably as a report that a slave is up and "0 Mbps full duplex" after enslavement, but in principle could report an incorrect speed and duplex after any link up event if the device comes up with a different speed or duplex. This affects the 802.3ad aggregator selection, as the speed and duplex are selection criteria. This is fixed by updating the speed and duplex in the periodic monitor, prior to using that information. This was done historically in bonding, but the call to bond_update_speed_duplex was removed in commit 876254ae2758 ("bonding: don't call update_speed_duplex() under spinlocks"), as it might sleep under lock. Later, the locking was changed to only hold RTNL, and so after commit 876254ae2758 ("bonding: don't call update_speed_duplex() under spinlocks") this call is again safe. Tested-by: "Tantilov, Emil S" Cc: Veaceslav Falico Cc: dingtianhong Fixes: 876254ae2758 ("bonding: don't call update_speed_duplex() under spinlocks") Signed-off-by: Jay Vosburgh Acked-by: Ding Tianhong Signed-off-by: David S. Miller Signed-off-by: Kamal Mostafa --- drivers/net/bonding/bond_main.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.0 diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index ba0e359..197ee34 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -2092,6 +2092,7 @@ static void bond_miimon_commit(struct bonding *bond) continue; case BOND_LINK_UP: + bond_update_speed_duplex(slave); bond_set_slave_link_state(slave, BOND_LINK_UP); slave->last_link_up = jiffies;