From nobody Sat Feb 7 09:34:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+58984+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+58984+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1589107407; cv=none; d=zohomail.com; s=zohoarc; b=e7JUSHEqjt1ujsKeN9VolLqTInTiVQv8oEUJyIaBqZ0iQvB57NfNcK/8WxHcHtgns+9zlWIxFMF0vS5PKCH+2b7+6J6594t7BPpPEZNtCgAYTqLMQj79q+Y1EYrX/CQUnctYwWRN9vpRTnS2ViJxfTLAq5WvRSSp6Wj+3jrer8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589107407; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=J3zCS0RXTcj0XzIrJ1xRRs8JlrKDPY+a11+IrZXUU8A=; b=UX4Yujev00kKmuL/iDufKwVqr7JBJVDfIWyV/1UbyDfA1mIqkihm5Dr4HIsbu9TqeFjAocbbEnTCqylm1klns33YQi6nqGr0ufZ5NEuyO8vR/NtXVmQZ3XvVinK+GXBCK0TJysvp0Sn8kMGXe2N0LFPS8kLWcPiAOsceYWYKa4k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+58984+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1589107407893981.2554881761049; Sun, 10 May 2020 03:43:27 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id PLpaYY1788612xPS603jOVOK; Sun, 10 May 2020 03:43:27 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.12425.1589107406975511096 for ; Sun, 10 May 2020 03:43:27 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 90CCF1FB; Sun, 10 May 2020 03:43:26 -0700 (PDT) X-Received: from e123331-lin.nice.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 259B73F68F; Sun, 10 May 2020 03:43:25 -0700 (PDT) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Pete Batard , Jared McNeill , Andrei Warkentin , Samer El-Haj-Mahmoud Subject: [edk2-devel] [PATCH edk2-platforms v2 3/4] Silicon/Broadcom/BcmGenetDxe: fix multicast/broadcast handling Date: Sun, 10 May 2020 12:42:58 +0200 Message-Id: <20200510104259.23739-4-ard.biesheuvel@arm.com> In-Reply-To: <20200510104259.23739-1-ard.biesheuvel@arm.com> References: <20200510104259.23739-1-ard.biesheuvel@arm.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@arm.com X-Gm-Message-State: oo63S8m0cRx9NlHMEuwUmnM2x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589107407; bh=8z+JoKQzC3IqF06qej2mkEXyIR3uIaE0qKfz9jr7TOY=; h=Cc:Date:From:Reply-To:Subject:To; b=egFjm1HeYI2QzEhAJCp+Tu0U/h4hrQex6wrS1CDEpgO43t+VuERuHfTyUTBV/QtLSPh exg98CzZND3+0kBHhK4EQ2/K45sLzG//3s+2FE8+jAlfnLPtsS8U5rT5JfNyLOBBY+NhD iF8sSuFcbD3Vb8LI4DvnuuRXtKlO8dN0DN4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Move the handling of the promiscuous receive control to the SNP ReceiveFilters() method where it belongs. Given that we do not support multicast filtering, only minimal handling is required to test the promiscuous bit and program the MAC accordingly. Any multicast handling will be done by the MNP layer above it. For reception of broadcast frames, wire up the new helper that programs the MDF filter bank accordingly. Signed-off-by: Ard Biesheuvel --- Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c | 7 +++---- Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c | 20 +++++++++---= -------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c b/Sil= icon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c index e3d015dd0820..a6102421cc26 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/DriverBinding.c @@ -154,11 +154,10 @@ GenetDriverBindingStart ( Genet->SnpMode.NvRamSize =3D 0; Genet->SnpMode.NvRamAccessSize =3D 0; Genet->SnpMode.ReceiveFilterMask =3D EFI_SIMPLE_NETWORK_RECEIVE_UNI= CAST | - EFI_SIMPLE_NETWORK_RECEIVE_MULTI= CAST | EFI_SIMPLE_NETWORK_RECEIVE_BROAD= CAST | - EFI_SIMPLE_NETWORK_RECEIVE_PROMI= SCUOUS | - EFI_SIMPLE_NETWORK_RECEIVE_PROMI= SCUOUS_MULTICAST; - Genet->SnpMode.ReceiveFilterSetting =3D Genet->SnpMode.ReceiveFilterMa= sk; + EFI_SIMPLE_NETWORK_RECEIVE_PROMI= SCUOUS; + Genet->SnpMode.ReceiveFilterSetting =3D EFI_SIMPLE_NETWORK_RECEIVE_UNI= CAST | + EFI_SIMPLE_NETWORK_RECEIVE_BROAD= CAST; Genet->SnpMode.MaxMCastFilterCount =3D 0; Genet->SnpMode.MCastFilterCount =3D 0; Genet->SnpMode.IfType =3D NET_IFTYPE_ETHERNET; diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c b/Sil= icon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c index bf28448445d1..e6de4653cde9 100644 --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c @@ -148,10 +148,6 @@ GenetSimpleNetworkInitialize ( } =20 GenetSetMacAddress (Genet, &Genet->SnpMode.CurrentAddress); - /* - * TODO: this belongs in GenetSimpleNetworkReceiveFilters, not here. - */ - GenetSetPromisc (Genet, TRUE); =20 GenetDmaInitRings (Genet); =20 @@ -306,6 +302,10 @@ GenetSimpleNetworkReceiveFilters ( } =20 Genet =3D GENET_PRIVATE_DATA_FROM_SNP_THIS (This); + if (((Enable | Disable) & ~Genet->SnpMode.ReceiveFilterMask) !=3D 0 || + (!ResetMCastFilter && MCastFilterCnt > Genet->SnpMode.MaxMCastFilter= Count)) { + return EFI_INVALID_PARAMETER; + } if (Genet->SnpMode.State =3D=3D EfiSimpleNetworkStopped) { return EFI_NOT_STARTED; } @@ -313,13 +313,11 @@ GenetSimpleNetworkReceiveFilters ( return EFI_DEVICE_ERROR; } =20 - // - // Can't actually return EFI_UNSUPPORTED, so just ignore the filters - // (we set promiscuous mode ON inside GenetSimpleNetworkInitialize). - // - // TODO: move promisc handling here. - // TODO 2: support multicast/broadcast. - // + GenetEnableBroadcastFilter (Genet, + (Enable & ~Disable & EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST) !=3D 0); + + GenetSetPromisc (Genet, + (Enable & ~Disable & EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS) !=3D 0); =20 return EFI_SUCCESS; } --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#58984): https://edk2.groups.io/g/devel/message/58984 Mute This Topic: https://groups.io/mt/74112948/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-