From owner-svn-src-all@FreeBSD.ORG Fri Jan 30 18:25:54 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 8F366B67; Fri, 30 Jan 2015 18:25:54 +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 7B68D3A6; Fri, 30 Jan 2015 18:25:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0UIPsV5089221; Fri, 30 Jan 2015 18:25:54 GMT (envelope-from ambrisko@FreeBSD.org) Received: (from ambrisko@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0UIPsf0089220; Fri, 30 Jan 2015 18:25:54 GMT (envelope-from ambrisko@FreeBSD.org) Message-Id: <201501301825.t0UIPsf0089220@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ambrisko set sender to ambrisko@FreeBSD.org using -f From: Doug Ambrisko Date: Fri, 30 Jan 2015 18:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277943 - head/sys/boot/efi/libefi 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: Fri, 30 Jan 2015 18:25:54 -0000 Author: ambrisko Date: Fri Jan 30 18:25:53 2015 New Revision: 277943 URL: https://svnweb.freebsd.org/changeset/base/277943 Log: Fix UEFI PXE boot on a NIC that isn't the first NIC. In UEFI it appears all available NICS are present to pass network traffic. This gives the capability to load the loader.efi from disk then set currdev="net3:" and then all I/O will over over the 2nd NIC. On this machine is appears the first handle is the first NIC in IPv4 mode and then the 2nd handle is the first NIC in IPv6 mode. The 3rd handle is the 2nd NIC in IPv4 mode. The fix is to index into the handle based on the unit cached from boot device passed into the loader. Some testing info from a test boot via kenv: currdev="net3:" loaddev="net3:" boot.netif.name="igb1" Modified: head/sys/boot/efi/libefi/efinet.c Modified: head/sys/boot/efi/libefi/efinet.c ============================================================================== --- head/sys/boot/efi/libefi/efinet.c Fri Jan 30 18:19:22 2015 (r277942) +++ head/sys/boot/efi/libefi/efinet.c Fri Jan 30 18:25:53 2015 (r277943) @@ -99,8 +99,11 @@ dump_mode(EFI_SIMPLE_NETWORK_MODE *mode) static int efinet_match(struct netif *nif, void *machdep_hint) { + struct devdesc *dev = machdep_hint; - return (1); + if (dev->d_unit - 1 == nif->nif_unit) + return (1); + return(0); } static int