From owner-svn-src-all@FreeBSD.ORG Sat Feb 21 06:27:17 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF1A568D; Sat, 21 Feb 2015 06:27:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9A109E6; Sat, 21 Feb 2015 06:27:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1L6RHkm053060; Sat, 21 Feb 2015 06:27:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1L6RHjq053059; Sat, 21 Feb 2015 06:27:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502210627.t1L6RHjq053059@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sat, 21 Feb 2015 06:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279096 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2015 06:27:17 -0000 Author: arybchik Date: Sat Feb 21 06:27:16 2015 New Revision: 279096 URL: https://svnweb.freebsd.org/changeset/base/279096 Log: sfxge: keep fw and driver view of autoneg parameters consistent Previously the driver's view was the expected outcome of any reconfiguration even if that reconfiguration failed. Submitted by: Ben Horgan Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/common/efx_phy.c Modified: head/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- head/sys/dev/sfxge/common/efx_phy.c Sat Feb 21 06:26:10 2015 (r279095) +++ head/sys/dev/sfxge/common/efx_phy.c Sat Feb 21 06:27:16 2015 (r279096) @@ -427,6 +427,7 @@ efx_phy_adv_cap_set( { efx_port_t *epp = &(enp->en_port); efx_phy_ops_t *epop = epp->ep_epop; + uint32_t old_mask; int rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -440,6 +441,7 @@ efx_phy_adv_cap_set( if (epp->ep_adv_cap_mask == mask) goto done; + old_mask = epp->ep_adv_cap_mask; epp->ep_adv_cap_mask = mask; if ((rc = epop->epo_reconfigure(enp)) != 0) @@ -450,6 +452,17 @@ done: fail2: EFSYS_PROBE(fail2); + + epp->ep_adv_cap_mask = old_mask; + /* Reconfigure for robustness */ + if (epop->epo_reconfigure(enp) != 0) { + /* + * We may have an inconsistent view of our advertised speed + * capabilities. + */ + EFSYS_ASSERT(0); + } + fail1: EFSYS_PROBE1(fail1, int, rc);