From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.58]) by mx.groups.io with SMTP id smtpd.web11.85.1589320634279238735 for ; Tue, 12 May 2020 14:57:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=bOeyYfES; spf=pass (domain: arm.com, ip: 40.107.7.58, mailfrom: samer.el-haj-mahmoud@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VaAqr06JtOop00ro6YaxfFy/atw5HAAM4g7gLHU/H/s=; b=bOeyYfESWs3G+1f9zhgIN5kjUhyv5PQd0uKVrRtIVDbNsvOfDY8OlZLPtA1Eof7BU7+IJSFusxBWA25DcrEBh6eDgANa385vSEwPjNfHwKAjbdFLDtqW72F2fn+bkiXEDTJ8YZ3uisiPanqIy1JfP51PLp9uJpFPrKT1xXycss4= Received: from AM6PR08CA0005.eurprd08.prod.outlook.com (2603:10a6:20b:b2::17) by VI1PR08MB5517.eurprd08.prod.outlook.com (2603:10a6:803:139::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.30; Tue, 12 May 2020 21:57:11 +0000 Received: from AM5EUR03FT053.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:b2:cafe::5) by AM6PR08CA0005.outlook.office365.com (2603:10a6:20b:b2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20 via Frontend Transport; Tue, 12 May 2020 21:57:11 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT053.mail.protection.outlook.com (10.152.16.210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.27 via Frontend Transport; Tue, 12 May 2020 21:57:10 +0000 Received: ("Tessian outbound 4cdf5642225a:v54"); Tue, 12 May 2020 21:57:10 +0000 X-CR-MTA-TID: 64aa7808 Received: from 05ddaf874e16.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BDDEA6DF-A3BD-48D3-8D7F-FEB71DB79EA5.1; Tue, 12 May 2020 21:57:05 +0000 Received: from EUR02-AM5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 05ddaf874e16.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 12 May 2020 21:57:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gi9+66qG0ognaaziiIW9T6MK4PcSAisrejweqsoMlvJPZtoMZJ4OIIes0+YhU0ag+0W5/DcBOM27rXCO6JwTzLHdxfMN9hIZSrdP3Cq7sfbJw8EKkmy+Ddw+QYt4CH+p1Fm7qq998C6Af02adF0f9usLsaJ75h5SWK7+n/WRewbOOrcsQoILL8mYdRaPtTiSNPXAzv7GyQzYISlMdO1XBng5qNTZM27IrWBWZju6IM5ysXTjhpuM1tmWz9EdKYtUgIFRkIEsecw8o1UeY5eRyWUKvg6vygEMs9507h2CY2elx5DsZ8OdXMvqW6SFXB/kDsazYUEhqkCAA2sibPWI9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VaAqr06JtOop00ro6YaxfFy/atw5HAAM4g7gLHU/H/s=; b=ZnA4eIvoNc+c7f/xEQ4FAP6vtiBkB5ktJ6mQN07PdAEzOfaV+lOgwERa6tmeUjKLyiZ1ssAYrlJRg+TyRNRHVuCsicu95BK0g/MWAscGNObE1KvNjxqa2DqhDp9rAAIymwacY1Ze6eBWvEy1sjmrnq8S43w3n1UMx8MoHJggYNLt0RNGFTRGmOH1NRs1a+KQBpFHXCXDj246oe0tJ46fBdfbSYAEupyf3W8/0UU2GIok4C+20xWcM1ekvvQCEqX31gGHTuCDmVUdMhuFg9xVmAkvgyoDngEG44wCaLlu7ZYGX+nSsnQcOFjKoUz3r4QQbd0mIzNfxqG6bJw2N5TiNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VaAqr06JtOop00ro6YaxfFy/atw5HAAM4g7gLHU/H/s=; b=bOeyYfESWs3G+1f9zhgIN5kjUhyv5PQd0uKVrRtIVDbNsvOfDY8OlZLPtA1Eof7BU7+IJSFusxBWA25DcrEBh6eDgANa385vSEwPjNfHwKAjbdFLDtqW72F2fn+bkiXEDTJ8YZ3uisiPanqIy1JfP51PLp9uJpFPrKT1xXycss4= Received: from DB7PR08MB3260.eurprd08.prod.outlook.com (2603:10a6:5:21::23) by DB7PR08MB3179.eurprd08.prod.outlook.com (2603:10a6:5:25::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3000.20; Tue, 12 May 2020 21:57:04 +0000 Received: from DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::990e:ed79:bec0:9dac]) by DB7PR08MB3260.eurprd08.prod.outlook.com ([fe80::990e:ed79:bec0:9dac%7]) with mapi id 15.20.2979.033; Tue, 12 May 2020 21:57:04 +0000 From: "Samer El-Haj-Mahmoud" To: "devel@edk2.groups.io" , "andrey.warkentin@gmail.com" CC: Ard Biesheuvel , "leif@nuviainc.com" , "pete@akeo.ie" , "philmd@redhat.com" Subject: Re: [edk2-devel] [edk2-platforms][PATCH 1/1] BcmGenetDxe: fix reliability issues Thread-Topic: [edk2-devel] [edk2-platforms][PATCH 1/1] BcmGenetDxe: fix reliability issues Thread-Index: AQHWKKfCcV3xAXrkU0mrAD08+EXFR6ik/oZA Date: Tue, 12 May 2020 21:57:03 +0000 Message-ID: References: <20200512215257.51748-1-andrey.warkentin@gmail.com> In-Reply-To: <20200512215257.51748-1-andrey.warkentin@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 1e8d0eb7-9846-4ffe-9216-f0826a222a97.1 x-checkrecipientchecked: true Authentication-Results-Original: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; x-originating-ip: [99.132.126.10] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1be4244e-c24b-4d3d-94f5-08d7f6bf6bf9 x-ms-traffictypediagnostic: DB7PR08MB3179:|VI1PR08MB5517: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:5236;OLM:9508; x-forefront-prvs: 0401647B7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 09OMYMbHB48jUeoQ9iTWqu7hJRaJ7yojom0oZ3fd+qSRs49ziJVELpzpl/IqH7aSo4NeYLoMo7Iy7TXpg6p+hTq7+79fcIWLuqEnhR4wBn1GkgmnMRLNJq4A7B5CaLmIHeeQRwnRoDHFFSifXDtEdXAQxJTimmoLQAi9omFo4KhWb7YXQ3ZJC86r4HQGZ9O1lbQ8XsJ3fUEq+Qp3spGVctwc0GJDhAMNYJ8/xMXR7TRC8f4Zv0tF57niX1+KdgYd6um/ozgVQghc71qitfcpI6FMH5vLV0gKmHVQRf+F7JudOtk6+QmlyxxeBXkvEBjgwIBZHjh5qo9TgnERGoVyn4blFRe/viTJd1iLKduMwehJgzu6ikDLQPCKtz2KPi8RYDKJrGP0HVC4PpgUgJzXVUqRLG7P+k+o5/5QQimwV1amhyDIOW7oP0XD7gfZ/3GUK42fDxnrRo/3pDLgWblNIs2HPdCFJ5EDufkloV31BOO3ekr+CgMsfmFbQDfEs61gfWpX/ElalsreXKTaYQBFTcWgP0YF6i+N9lyZLUOliID4IfFukA85cfokwXt0xoLTcjwVz9KB/5PKhEid5jlr1jdfhtBtt1khtXFSd3Iou28= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR08MB3260.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(376002)(346002)(39860400002)(396003)(366004)(136003)(33430700001)(71200400001)(186003)(8936002)(2906002)(316002)(7696005)(6506007)(54906003)(110136005)(33656002)(86362001)(53546011)(26005)(66476007)(66446008)(64756008)(66556008)(76116006)(33440700001)(5660300002)(478600001)(966005)(66946007)(8676002)(4326008)(52536014)(55016002)(9686003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: 8UGxQob6SPzzPrRy/KWKy0RvQHYwp/ng3ctz6okSr0oS3E8HsYKm7GROSEfyWtmpFokUxI57F8OV2J/fF56n645LX8BYBInQ2I4idc0nUh51cb/YVhMFX0UgEiaN56066iHttApsUV5HbT7p0vhWS81nK2VClmaFqcm4DunKxse9lUsHZ7WhKna+UPTneii7qh2WfeqmC+rpAAaeW/JfwGLE6tEG8h7wNc24oWGHw+TSJuisw/fou1PqC84Z9jVXJ+WBbz+bHiKFILUMO4kJKxOuft3MrGVKHr3ZDYItLIoD8XOyYDpXw3pasi2Fobsymlmd7wxTujhdB+U2pa/fiVgkPITiXWjV5WB0qWIURCtmipmmBeNluv6radOStMwr2rYY3d8jHe2zARGQk2yLAdc72dV6WlwOPK25uwAF/WjINnvR/hATE0Fkir5zc9hcUNr6EAWLX34DlLMdqDKniAxDpbWXwuNJRfW5nid1sVtr7RNKgLrbEElUQ0WoNLaq MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3179 Original-Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=arm.com; Return-Path: Samer.El-Haj-Mahmoud@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT053.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFTY:;SFS:(4636009)(376002)(346002)(39860400002)(396003)(136003)(46966005)(33430700001)(55016002)(356005)(52536014)(966005)(336012)(107886003)(5660300002)(26005)(186003)(2906002)(478600001)(54906003)(53546011)(8676002)(81166007)(6506007)(82310400002)(33440700001)(47076004)(33656002)(36906005)(110136005)(70206006)(82740400003)(4326008)(7696005)(86362001)(9686003)(316002)(8936002)(70586007);DIR:OUT;SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 756de602-dbb7-4ce3-a8f2-08d7f6bf67ff X-Forefront-PRVS: 0401647B7F X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z+dqfqxS8qUys8gVOfZq5L1lKMs5YzxDUVmxXMdA9i985NVvSkIz1GyAkI3wUmkTqRhU3xy1KLVqM8TXqhJDAW/Suh/T3St5nCasV3EgegVu6Qj5bShdaCPMpscGXQUeXl8WQ+ZwIswLPyEUMel/0a3eLHJeIopSeeVTdP3t4+aiuc+v19yFL2Wmk7pJXYq9iehw0yo2Nhl1xdzP8zCiBrVNrNT+8rRr1skbRWKWR2N/qMxHVlZzJgTE43ioVfSw8rXh5YcxkWjizsaPzC1fXH2ypsEZGSmr3spXeQEf34/ftz9X/jowRyHN9Sx0k2qPU79hzxtGZRyENBSD5IjNKQHH1xro3OzAJtkUrjI6XENhcHGEzfJ1WbeyWcK5230Da9hqsFcmqR+fVUgbx/9a6Xn2q/ERXFZAmKqQvyUMjugdziHepcGPflZisbc5fVyb5K7JJPxB9/FdYlxpQxBVeJ4jr8wVD4PkTxzA6emtGsZHT5ynHbReZXiGXMrDinV6NY59z1WHUm89yV/whmvDvmKrS3Ghnup6sNXCKc4cEwjvnkENs/p/+vxgU+0Hiy5zK3GOXLByCXGF4GjV0L+J93aDvXhhRmmw5AlGEbOTXOM9xZv8lOUf32TZeW8G5mPCTXulCoLZCX8JiENsq4Zt3w== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2020 21:57:10.6349 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1be4244e-c24b-4d3d-94f5-08d7f6bf6bf9 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5517 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Tested-by: Samer El-Haj-Mahmoud > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Andrei > Warkentin via groups.io > Sent: Tuesday, May 12, 2020 5:53 PM > To: devel@edk2.groups.io > Cc: Ard Biesheuvel ; leif@nuviainc.com; > pete@akeo.ie; philmd@redhat.com > Subject: [edk2-devel] [edk2-platforms][PATCH 1/1] BcmGenetDxe: fix > reliability issues > > - Failed TFTP boots > - Failed HTTP boots > > The definite problem was that the incorrect PROD index was being written= TX > ring. The PROD index should be the TxProdIndex (on the scale of 0-0xffff= ), > not the descriptor index (on the scale of 0-max descs). > > The other small things were suspect (mod 0xffff is not the same as & 0xf= fff). > > Signed-off-by: Andrei Warkentin > --- > Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c | 4 ++-- > Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c | 3 +-- > 2 files changed, 3 insertions(+), 4 deletions(-) > > diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c > b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c > index 4b0995e3..1c4c8527 100644 > --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c > +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c > @@ -737,7 +737,7 @@ GenetDmaTriggerTx ( > GenetMmioWrite (Genet, GENET_TX_DESC_STATUS (DescIndex), > DescStatus); > > GenetMmioWrite (Genet, GENET_TX_DMA_PROD_INDEX > (GENET_DMA_DEFAULT_QUEUE), > - (DescIndex + 1) & 0xFFFF); > + Genet->TxProdIndex); > } > > /** > @@ -764,7 +764,7 @@ GenetTxIntr ( > *TxBuf =3D Genet->TxBuffer[Genet->TxNext]; > Genet->TxQueued--; > Genet->TxNext =3D (Genet->TxNext + 1) % GENET_DMA_DESC_COUNT; > - Genet->TxConsIndex++; > + Genet->TxConsIndex =3D (Genet->TxConsIndex + 1) & 0xFFFF; > } else { > *TxBuf =3D NULL; > } > diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c > b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c > index 74677927..371216ca 100644 > --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c > +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c > @@ -641,9 +641,8 @@ GenetSimpleNetworkTransmit ( > return Status; > } > > + Genet->TxProdIndex =3D (Genet->TxProdIndex + 1) & 0xFFFF; > GenetDmaTriggerTx (Genet, Desc, DmaDeviceAddress, > DmaNumberOfBytes); > - > - Genet->TxProdIndex =3D (Genet->TxProdIndex + 1) % 0xFFFF; > Genet->TxQueued++; > > EfiReleaseLock (&Genet->Lock); > -- > 2.17.1 > > >=20 IMPORTANT NOTICE: The contents of this email and any attachments are confi= dential and may also be privileged. If you are not the intended recipient, = please notify the sender immediately and do not disclose the contents to an= y other person, use it for any purpose, or store or copy the information in= any medium. Thank you.