From patchwork Tue Dec 29 02:32:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yanjun X-Patchwork-Id: 561422 X-Patchwork-Delegate: davem@davemloft.net 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 E0A93140BFC for ; Tue, 29 Dec 2015 13:32:22 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753058AbbL2CcS (ORCPT ); Mon, 28 Dec 2015 21:32:18 -0500 Received: from mail5.windriver.com ([192.103.53.11]:46171 "EHLO mail5.wrs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753037AbbL2CcP (ORCPT ); Mon, 28 Dec 2015 21:32:15 -0500 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id tBT2W56o009245 (version=TLSv1 cipher=AES128-SHA bits=128 verify=OK); Mon, 28 Dec 2015 18:32:06 -0800 Received: from sustaining-2.corp.ad.wrs.com (128.224.162.248) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.248.2; Mon, 28 Dec 2015 18:32:05 -0800 From: To: , , , , , , , , , , CC: , , Subject: [PATCH 2/2] ixgbe: restrict synchronization of link_up and speed Date: Tue, 29 Dec 2015 10:32:06 +0800 Message-ID: <1451356326-2919-3-git-send-email-zyjzyj2000@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1451356326-2919-1-git-send-email-zyjzyj2000@gmail.com> References: <1450926752-11392-1-git-send-email-zyjzyj2000@gmail.com> <1451356326-2919-1-git-send-email-zyjzyj2000@gmail.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Zhu Yanjun When the X540 NIC acts as a slave of some virtual NICs, it is very important to synchronize link_up and link_speed, such as a bonding driver in 802.3ad mode. When X540 NIC acts as an independent interface, it is not necessary to synchronize link_up and link_speed. That is, the time span between link_up and link_speed is acceptable. Signed-off-by: Zhu Yanjun --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index ace21b9..1bb6056 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -6436,8 +6436,15 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter) * time. To X540 NIC, there is a time span between link_up and * link_speed. As such, only continue if link_up and link_speed are * ready to X540 NIC. + * The time span between link_up and link_speed is very important + * when the X540 NIC acts as a slave in some virtual NICs, such as + * a bonding driver in 802.3ad mode. When X540 NIC acts as an + * independent interface, it is not necessary to synchronize link_up + * and link_speed. + * In the end, not continue if (X540 NIC && SLAVE && link_speed UNKNOWN) */ - if (hw->mac.type == ixgbe_mac_X540) + if ((hw->mac.type == ixgbe_mac_X540) && + (netdev->flags & IFF_SLAVE)) if (link_speed == IXGBE_LINK_SPEED_UNKNOWN) return;