Re: NdisMIndicateReceivePacket cost too much time, why?
- From: "zhangfei" <fzhang@xxxxxxxxxxx>
- Date: Thu, 2 Oct 2008 14:30:54 +0800
from MiniportInitialize,
NdisMSetAttributesEx(
MiniportAdapterHandle,
(NDIS_HANDLE) pL1e,
0,
NDIS_ATTRIBUTE_BUS_MASTER |
NDIS_ATTRIBUTE_DESERIALIZE|
#ifdef NDIS51_MINIPORT
NDIS_ATTRIBUTE_USES_SAFE_BUFFER_APIS|
#endif
0,
NdisInterfacePci);
"zhangfei" <fzhang@xxxxxxxxxxx> дÈëÏûÏ¢ÐÂÎÅ:O%23sSxaFJJHA.3548@xxxxxxxxxxxxxxxxxxxxxxx
I use the SmartBit to send random packets with the MAC address of my NIC,
my NIC driver makes 8 packets
receive indications with NdisMIndicateReceivePacket every time, and
NdisMIndicateReceivePacket will occupy more than
16us, too long time, so that the driver can¡¯t config the rx descriptions
for the NIC quickly enough.
The rx source code is like this:
PNDIS_PACKET PacketArray[8];
ULONG dwPacketCount = 0;
PNDIS_PACKET NdisPacket;
PNDIS_BUFFER NdisBuffer;
NDIS_TCP_IP_CHECKSUM_PACKET_INFO CheckSumInfo;
CheckSumInfo.Value = 0;
......
NdisDprAcquireSpinLock(&pL1c->RecvLock);
for( pDmaRrd=pL1c->RrdVirAddr+ulRrdConsumer; pDmaRrd->updt;
pDmaRrd=pL1c->RrdVirAddr+ulRrdConsumer )
{
pQueueUnit = QueueRemoveFromHeader( &pL1c->ReceiveQueue );
/* If there is enough free rx entry, there must be enough NdisPacket
from ReceiveQueue. So this could
never be NULL, check this to pass prefast. */
NdisPacket = MR_TO_PACKET( pQueueUnit );
pRxEntry = pL1c->ppRxEntryInUseArray[RfdStartIndex];
NdisBuffer = pRxEntry->NdisBuffer;
NdisAdjustBufferLength( NdisBuffer, FrameLen );/*FrameLen includes
the MAC header, excluded CRC.*/
NdisChainBufferAtBack( NdisPacket, NdisBuffer );
NDIS_PER_PACKET_INFO_FROM_PACKET(Packet, TcpIpChecksumPacketInfo) =
(PVOID)(ULONG_PTR)CheckSumInfo.Value;
NDIS_SET_PACKET_STATUS(NdisPacket, NDIS_STATUS_SUCCESS);
PacketArray[dwPacketCount++] = NdisPacket;
if( dwPacketFreeCount >=
sizeof(PacketFreeArray)/sizeof(PacketFreeArray[0]) )
{
NdisDprReleaseSpinLock(&pL1c->RecvLock);
NdisMIndicateReceivePacket(pL1c->MiniportAdapterHandle,
PacketArray, dwPacketCount);
NdisDprAcquireSpinLock(&pL1c->RecvLock);
}
......
}
NdisDprReleaseSpinLock(&pL1c->RecvLock);
.
- Follow-Ups:
- Re: NdisMIndicateReceivePacket cost too much time, why?
- From: Pavel A.
- Re: NdisMIndicateReceivePacket cost too much time, why?
- References:
- NdisMIndicateReceivePacket cost too much time, why?
- From: zhangfei
- NdisMIndicateReceivePacket cost too much time, why?
- Prev by Date: NdisMIndicateReceivePacket cost too much time, why?
- Next by Date: Re: NdisMIndicateReceivePacket cost too much time, why?
- Previous by thread: NdisMIndicateReceivePacket cost too much time, why?
- Next by thread: Re: NdisMIndicateReceivePacket cost too much time, why?
- Index(es):
Relevant Pages
|