Changeset 89503 in vbox for trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/SnpInitialize.c
- Timestamp:
- Jun 4, 2021 10:38:21 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144860
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/E1kNetDxe/SnpInitialize.c
r89462 r89503 4 4 any. 5 5 6 Copyright (c) 2021, Oracle and/or its affiliates. 7 Copyright (c) 2017, AMD Inc, All rights reserved. 6 8 Copyright (C) 2013, Red Hat, Inc. 7 9 Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> 8 Copyright (c) 2017, AMD Inc, All rights reserved.<BR>9 10 10 11 SPDX-License-Identifier: BSD-2-Clause-Patent … … 146 147 EFI_STATUS Status; 147 148 UINTN RxBufSize; 148 UINT16 RxAlwaysPending;149 149 UINTN PktIdx; 150 150 UINTN NumBytes; … … 161 161 162 162 // 163 // Limit the number of pending RX packets if the queue is big. The division164 // by two is due to the above "two descriptors per packet" trait.165 //166 RxAlwaysPending = E1K_NET_MAX_PENDING;167 168 //169 163 // The RxBuf is shared between guest and hypervisor, use 170 164 // AllocateSharedPages() to allocate this memory region and map it with … … 172 166 // hypervisor. 173 167 // 174 NumBytes = RxAlwaysPending* RxBufSize;168 NumBytes = E1K_NET_MAX_PENDING * RxBufSize; 175 169 Dev->RxBufNrPages = EFI_SIZE_TO_PAGES (NumBytes); 176 170 Status = Dev->PciIo->AllocateBuffer ( … … 201 195 202 196 Dev->RxRing = RxBuffer; 203 Dev->RxBuf = (UINT8 *)RxBuffer + sizeof(*Dev->RxRing) * RxAlwaysPending;197 Dev->RxBuf = (UINT8 *)RxBuffer + sizeof(*Dev->RxRing) * E1K_NET_MAX_PENDING; 204 198 Dev->RdhLastSeen = 0; 205 199 206 200 // Set up the RX descriptors. 207 Dev->RxBufDeviceBase = Dev->RxDeviceBase + sizeof(*Dev->RxRing) * RxAlwaysPending;201 Dev->RxBufDeviceBase = Dev->RxDeviceBase + sizeof(*Dev->RxRing) * E1K_NET_MAX_PENDING; 208 202 RxBufDeviceAddress = Dev->RxBufDeviceBase; 209 for (PktIdx = 0; PktIdx < RxAlwaysPending; ++PktIdx) {203 for (PktIdx = 0; PktIdx < E1K_NET_MAX_PENDING; ++PktIdx) { 210 204 Dev->RxRing[PktIdx].AddrBufferLow = (UINT32)RxBufDeviceAddress; 211 205 Dev->RxRing[PktIdx].AddrBufferHigh = (UINT32)RShiftU64(RxBufDeviceAddress, 32); … … 278 272 EFI_STATUS Status; 279 273 274 DEBUG((DEBUG_INFO, "E1kNetInitialize:\n")); 275 280 276 if (This == NULL) { 281 277 return EFI_INVALID_PARAMETER;
Note:
See TracChangeset
for help on using the changeset viewer.