Skip to content

Commit

Permalink
[efi] Guard against GetStatus() failing to return a NULL TX buffer
Browse files Browse the repository at this point in the history
The UEFI specification requires the EFI_SIMPLE_NETWORK_PROTOCOL
GetStatus() method to set TxBuf to NULL if there are no transmit
buffers to recycle.

Some implementations (observed with Lan9118Dxe in EDK2) fill in TxBuf
only when there is a transmit buffer to recycle, which leads to large
numbers of "spurious TX completion" errors.

Work around this problem by initialising TxBuf to NULL before calling
the GetStatus() method.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed May 11, 2016
1 parent 47931a4 commit 6164741
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/drivers/net/efi/snpnet.c
Expand Up @@ -191,6 +191,7 @@ static void snpnet_poll_tx ( struct net_device *netdev ) {
int rc;

/* Get status */
txbuf = NULL;
if ( ( efirc = snp->snp->GetStatus ( snp->snp, &irq, &txbuf ) ) != 0 ) {
rc = -EEFI ( efirc );
DBGC ( snp, "SNP %s could not get status: %s\n",
Expand Down

0 comments on commit 6164741

Please sign in to comment.