From owner-svn-src-head@freebsd.org Tue Feb 2 12:42:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC048A76ABA; Tue, 2 Feb 2016 12:42:41 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B49EBEAC; Tue, 2 Feb 2016 12:42:40 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id d2bc563e; Tue, 2 Feb 2016 13:35:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=eG35VYTCw+FydPDqC1e9xcFyN2g=; b=OJn8SvNHDX8gGi80ncYvn1MDr4ss mhvZF2s8/vzvv6jl708mMjdHg0a+J6DvfVQBeoqoGdSFqJXPGM3JVzvoLtimZtj5 aVah1e6xvQ2JSDwOWTmWluwoTparFT8jZvNG2cs3NoOzMwVTmBsXqray/la9/bdW JU8gXrd9C8M5ZlA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=X2mbftO4nQNZc+1BXcXlJViaIianT2j4d9TfYCYU2osJbqSCKbw1Kk61 IbZupcZl05nrz4FTO46NHfrPrgVccIGLFd1MPZAgIA1X3D04GE9g5vN7kzqVLp4Y GUJrCzIhYEn4lp3r50Kp8XzQLGqfj510F9NQCkQ+GZ4Xal66X8c= Received: from atlantis.staff.bocal.org (163.5.250.138 [163.5.250.138]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 02cb9a33 TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO; Tue, 2 Feb 2016 13:35:56 +0100 (CET) Date: Tue, 2 Feb 2016 13:35:56 +0100 From: Emmanuel Vadot To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r295144 - head/sys/boot/efi/libefi Message-Id: <20160202133556.72ca80c30c159ce5c7b54116@bidouilliste.com> In-Reply-To: <201602021039.u12AdJxt066072@repo.freebsd.org> References: <201602021039.u12AdJxt066072@repo.freebsd.org> X-Mailer: Sylpheed 3.4.3 (GTK+ 2.24.29; amd64-portbld-freebsd10.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2016 12:42:42 -0000 I cannot netboot loader.efi anymore now. Consoles: EFI console Unable to open network interface 1 Unable to open network interface 2 ... panic: netboot: no interfaces left untried Netboot loader.efi works before even if loading the kernel was really really slow. On Tue, 2 Feb 2016 10:39:19 +0000 (UTC) Andrew Turner wrote: > Author: andrew > Date: Tue Feb 2 10:39:18 2016 > New Revision: 295144 > URL: https://svnweb.freebsd.org/changeset/base/295144 > > Log: > Add suppor to loader.efi to load files off hte network. For this we need > to open the device in exclusive mode as, without this, the firmware may > also be reading packets off the interface leading to a race. > > Reviewed by: emaste > Sponsored by: ABT Systems Ltd > Differential Revision: https://reviews.freebsd.org/D4132 > > Modified: > head/sys/boot/efi/libefi/efinet.c > > Modified: head/sys/boot/efi/libefi/efinet.c > ============================================================================== > --- head/sys/boot/efi/libefi/efinet.c Tue Feb 2 10:32:45 2016 (r295143) > +++ head/sys/boot/efi/libefi/efinet.c Tue Feb 2 10:39:18 2016 (r295144) > @@ -184,11 +184,16 @@ efinet_init(struct iodesc *desc, void *m > EFI_HANDLE h; > EFI_STATUS status; > > + if (nif->nif_driver->netif_ifs[nif->nif_unit].dif_unit < 0) { > + printf("Invalid network interface %d\n", nif->nif_unit); > + return; > + } > + > h = nif->nif_driver->netif_ifs[nif->nif_unit].dif_private; > status = BS->HandleProtocol(h, &sn_guid, (VOID **)&nif->nif_devdata); > if (status != EFI_SUCCESS) { > - printf("net%d: cannot start interface (status=%ld)\n", > - nif->nif_unit, (long)status); > + printf("net%d: cannot start interface (status=%lu)\n", > + nif->nif_unit, EFI_ERROR_CODE(status)); > return; > } > > @@ -288,11 +293,30 @@ efinet_dev_init() > stats = calloc(nifs, sizeof(struct netif_stats)); > > for (i = 0; i < nifs; i++) { > + EFI_SIMPLE_NETWORK *net; > + EFI_HANDLE h; > + > dif = &efinetif.netif_ifs[i]; > + dif->dif_unit = -1; > + > + h = efi_find_handle(&efinet_dev, i); > + > + /* > + * Open the network device in exclusive mode. Without this > + * we will be racing with the UEFI network stack. It will > + * pull packets off the network leading to lost packets. > + */ > + status = BS->OpenProtocol(h, &sn_guid, (void **)&net, > + IH, 0, EFI_OPEN_PROTOCOL_EXCLUSIVE); > + if (status != EFI_SUCCESS) { > + printf("Unable to open network interface %d\n", i); > + continue; > + } > + > dif->dif_unit = i; > dif->dif_nsel = 1; > dif->dif_stats = &stats[i]; > - dif->dif_private = efi_find_handle(&efinet_dev, i); > + dif->dif_private = h; > } > > return (0); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" -- Emmanuel Vadot