[ros-dev] Ros boot failure with networking enabled in real
hardware - ed 2 with tcpip traces
art yerkes
ayerkes at speakeasy.net
Sun Dec 5 08:39:49 CET 2004
On Sun, 05 Dec 2004 13:03:05 +0100
Gge <gerard.gatineau at laposte.net> wrote:
> With current CVS + Realtek8139 nic driver enabled in Hivesy , Ros still
> fails to boot as per debug messages below
> => ed 2 based on Tcpip debug traces enabled.
Gge: hmm i'm not sure. I wonder if any big guns in DPCs will help out here.
Please try this patch. My feeling is that TransferDataComplete is being
allowed to run parallel with the work item. The only way i can see this
happening is if somehow a buffer is reclaimed before its fully freed. This
does seem to be the same bug as before but i'm not convinced its a
regression so much as the same bug having been recently hidden and then
reexposed. I've also ordered an RTL8139 card for the real hardware box i
intend to start using for reactos. No time like the present to try this
myself.
--
Here's a simple experiment. Stand on a train track between two locomotives
which are pushing on you with equal force in opposite directions. You will
exhibit no net motion. None the less, you may soon begin to notice that
something important is happening.
-- Robert Stirniman
-------------- next part --------------
Index: drivers/net/tcpip/datalink/lan.c
===================================================================
RCS file: /CVS/ReactOS/reactos/drivers/net/tcpip/datalink/lan.c,v
retrieving revision 1.31
diff -u -r1.31 lan.c
--- drivers/net/tcpip/datalink/lan.c 4 Dec 2004 23:29:55 -0000 1.31
+++ drivers/net/tcpip/datalink/lan.c 5 Dec 2004 14:36:57 -0000
@@ -273,14 +273,18 @@
BOOLEAN WorkStart;
PLAN_WQ_ITEM WQItem;
PLAN_ADAPTER Adapter = (PLAN_ADAPTER)BindingContext;
+ KIRQL OldIrql;
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
if( Status != NDIS_STATUS_SUCCESS ) return;
+ TcpipAcquireSpinLock( &LanWorkLock, &OldIrql );
WQItem = ExAllocatePool( NonPagedPool, sizeof(LAN_WQ_ITEM) );
- if( !WQItem ) return;
+ if( !WQItem ) {
+ TcpipReleaseSpinLock( &LanWorkLock, OldIrql );
+ return;
+ }
- TcpipAcquireSpinLockAtDpcLevel( &LanWorkLock );
WorkStart = IsListEmpty( &LanWorkList );
WQItem->Packet = Packet;
WQItem->Adapter = Adapter;
@@ -288,7 +292,7 @@
InsertTailList( &LanWorkList, &WQItem->ListEntry );
if( WorkStart )
ExQueueWorkItem( &LanWorkItem, CriticalWorkQueue );
- TcpipReleaseSpinLockFromDpcLevel( &LanWorkLock );
+ TcpipReleaseSpinLock( &LanWorkLock, OldIrql );
}
NDIS_STATUS STDCALL ProtocolReceive(
@@ -322,6 +326,7 @@
PNDIS_PACKET NdisPacket;
PLAN_ADAPTER Adapter = (PLAN_ADAPTER)BindingContext;
PETH_HEADER EHeader = (PETH_HEADER)HeaderBuffer;
+ KIRQL OldIrql;
TI_DbgPrint(DEBUG_DATALINK, ("Called. (packetsize %d)\n",PacketSize));
@@ -359,9 +364,12 @@
TI_DbgPrint(DEBUG_DATALINK, ("Adapter: %x (MTU %d)\n",
Adapter, Adapter->MTU));
+ TcpipAcquireSpinLock( &LanWorkLock, &OldIrql );
+
NdisStatus = AllocatePacketWithBuffer( &NdisPacket, NULL,
PacketSize + HeaderBufferSize );
if( NdisStatus != NDIS_STATUS_SUCCESS ) {
+ TcpipReleaseSpinLock( &LanWorkLock, OldIrql );
return NDIS_STATUS_NOT_ACCEPTED;
}
@@ -407,6 +415,7 @@
PacketSize);
TI_DbgPrint(DEBUG_DATALINK, ("leaving\n"));
+ TcpipReleaseSpinLock( &LanWorkLock, OldIrql );
return NDIS_STATUS_SUCCESS;
}
More information about the Ros-dev
mailing list