瀏覽代碼

[efi] Guard against GetStatus() failing to return a NULL TX buffer

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>
tags/v1.20.1
Michael Brown 8 年之前
父節點
當前提交
6164741f81
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1
    0
      src/drivers/net/efi/snpnet.c

+ 1
- 0
src/drivers/net/efi/snpnet.c 查看文件

@@ -191,6 +191,7 @@ static void snpnet_poll_tx ( struct net_device *netdev ) {
191 191
 	int rc;
192 192
 
193 193
 	/* Get status */
194
+	txbuf = NULL;
194 195
 	if ( ( efirc = snp->snp->GetStatus ( snp->snp, &irq, &txbuf ) ) != 0 ) {
195 196
 		rc = -EEFI ( efirc );
196 197
 		DBGC ( snp, "SNP %s could not get status: %s\n",

Loading…
取消
儲存