[ros-dev] Ros boot failure with networking enabled in
real hardware - ed 2 with tcpip traces
Gge
gerard.gatineau at laposte.net
Sun Dec 5 21:26:41 CET 2004
art yerkes wrote:
> 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.
>
>
> ------------------------------------------------------------------------
>
> 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;
> }
>
>
> ------------------------------------------------------------------------
>
Arty,
I have tested your patch . The problem is not fixed
If you'll get a realtek8139 nic also , you will be able to test it in
the same conditions
Regards
Gge
More information about the Ros-dev
mailing list