Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jul 2017 15:06:34 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321621 - head/sys/boot/efi/libefi
Message-ID:  <201707271506.v6RF6YxM030585@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Thu Jul 27 15:06:34 2017
New Revision: 321621
URL: https://svnweb.freebsd.org/changeset/base/321621

Log:
  Always set the receive mask in loader.efi. Some UEFI implementations set
  this to be too restrictive. We need to have both broadcast and unicast
  enabled for loader to work. Set them in all cases to ensure this is true.
  
  This allows the Cavium ThunderX 2s in the netperf cluster to netboot using
  a USB NIC.
  
  PR:		221001
  Reviewed by:	emaste, tsoome
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D11732

Modified:
  head/sys/boot/efi/libefi/efinet.c

Modified: head/sys/boot/efi/libefi/efinet.c
==============================================================================
--- head/sys/boot/efi/libefi/efinet.c	Thu Jul 27 14:34:57 2017	(r321620)
+++ head/sys/boot/efi/libefi/efinet.c	Thu Jul 27 15:06:34 2017	(r321621)
@@ -187,6 +187,7 @@ efinet_init(struct iodesc *desc, void *machdep_hint)
 	EFI_SIMPLE_NETWORK *net;
 	EFI_HANDLE h;
 	EFI_STATUS status;
+	UINT32 mask;
 
 	if (nif->nif_driver->netif_ifs[nif->nif_unit].dif_unit < 0) {
 		printf("Invalid network interface %d\n", nif->nif_unit);
@@ -220,16 +221,14 @@ efinet_init(struct iodesc *desc, void *machdep_hint)
 		}
 	}
 
-	if (net->Mode->ReceiveFilterSetting == 0) {
-		UINT32 mask = EFI_SIMPLE_NETWORK_RECEIVE_UNICAST |
-		    EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST;
+	mask = EFI_SIMPLE_NETWORK_RECEIVE_UNICAST |
+	    EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST;
 
-		status = net->ReceiveFilters(net, mask, 0, FALSE, 0, NULL);
-		if (status != EFI_SUCCESS) {
-			printf("net%d: cannot set rx. filters (status=%lu)\n",
-			    nif->nif_unit, EFI_ERROR_CODE(status));
-			return;
-		}
+	status = net->ReceiveFilters(net, mask, 0, FALSE, 0, NULL);
+	if (status != EFI_SUCCESS) {
+		printf("net%d: cannot set rx. filters (status=%lu)\n",
+		    nif->nif_unit, EFI_ERROR_CODE(status));
+		return;
 	}
 
 #ifdef EFINET_DEBUG



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707271506.v6RF6YxM030585>