From: "Samer El-Haj-Mahmoud" <samer.el-haj-mahmoud@arm.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"andrey.warkentin@gmail.com" <andrey.warkentin@gmail.com>
Cc: Ard Biesheuvel <Ard.Biesheuvel@arm.com>,
"leif@nuviainc.com" <leif@nuviainc.com>,
"pete@akeo.ie" <pete@akeo.ie>,
"philmd@redhat.com" <philmd@redhat.com>
Subject: Re: [edk2-devel] [edk2-platforms][PATCH 1/1] BcmGenetDxe: fix reliability issues
Date: Tue, 12 May 2020 21:57:03 +0000 [thread overview]
Message-ID: <DB7PR08MB3260950D438AF1A15838943790BE0@DB7PR08MB3260.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20200512215257.51748-1-andrey.warkentin@gmail.com>
Tested-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
> -----Original Message-----
> From: devel@edk2.groups.io <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 <Ard.Biesheuvel@arm.com>; 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 & 0xffff).
>
> Signed-off-by: Andrei Warkentin <andrey.warkentin@gmail.com>
> ---
> 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 = Genet->TxBuffer[Genet->TxNext];
> Genet->TxQueued--;
> Genet->TxNext = (Genet->TxNext + 1) % GENET_DMA_DESC_COUNT;
> - Genet->TxConsIndex++;
> + Genet->TxConsIndex = (Genet->TxConsIndex + 1) & 0xFFFF;
> } else {
> *TxBuf = 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 = (Genet->TxProdIndex + 1) & 0xFFFF;
> GenetDmaTriggerTx (Genet, Desc, DmaDeviceAddress,
> DmaNumberOfBytes);
> -
> - Genet->TxProdIndex = (Genet->TxProdIndex + 1) % 0xFFFF;
> Genet->TxQueued++;
>
> EfiReleaseLock (&Genet->Lock);
> --
> 2.17.1
>
>
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
next prev parent reply other threads:[~2020-05-12 21:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 21:52 [edk2-platforms][PATCH 1/1] BcmGenetDxe: fix reliability issues Andrei Warkentin
2020-05-12 21:57 ` Samer El-Haj-Mahmoud [this message]
2020-05-12 22:03 ` [edk2-devel] " Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB7PR08MB3260950D438AF1A15838943790BE0@DB7PR08MB3260.eurprd08.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox