Re: [edk2] UDP assert

Subject: Re: [edk2] UDP assert

From: Cameron Esfahani <>


Date: 2011-02-22 03:35:05

Thanks for the useful information.  Your debug code helped me figure out what was going wrong.

Due to a typo, the wrong RxData event was getting signaled, so the packet was never getting removed from DeliveredDgramQue, even though I was finished using it.

Thanks again for the help.

On Feb 20, 2011, at 11:12 PM, Du, Xiong wrote:

> Hi Cameron,
> DeliveredDgramQue is designed to track packets which have been delivered to upper layer, but upper layer drivers/apps have not signaled the recycle event in Udp4 completion token (RxData.RecycleSignal) yet.
> When a packet is delivered to upper layer, it will be moved from RcvdDgramQue to DeliveredDgramQue, the code in Udp4InstanceDeliverDgram () at line 1548 of Udp4Impl.c:
>    NetListRemoveHead (&Instance->RcvdDgramQue);
>    ...
>    InsertTailList (&Instance->DeliveredDgramQue, &Wrap->Link);
> When upper layer driver/app finished processing the packet, it should signal the recycle event. Then the packet will be removed from DeliveredDgramQue by Udp4Dxe in Udp4RecycleRxDataWrap() at line 1362 of Udp4Impl.c:
>  //
>  // Remove the Wrap from the list it belongs to.
>  //
>  RemoveEntryList (&Wrap->Link);
> In your case, there are still remaining packets in DeliveredDgramQue when DestroyChild() is invoked, which means not all delivered packets are signaled with recycle event.
> So, could you help to provide following information for analyse:
> 1. more calls on the call stack (i.e. where the Udp4ServiceBindingDestroyChild is called from).
> 2. packet dump in DeliveredDgramQue before the ASSERT.
> Please add following debug code right before the ASSERT to dump packet in DeliveredDgramQue:
>    if (!IsListEmpty (&Instance->DeliveredDgramQue)) {
>      LIST_ENTRY          *Entry;
>      UDP4_RXDATA_WRAP    *Wrap;
>      UINTN               Index;
>      UINTN               Index2;
>      EFI_UDP4_FRAGMENT_DATA    *FragmentTable;
>      NET_LIST_FOR_EACH (Entry, &Instance->DeliveredDgramQue) {
>        //
>        // Iterate the instances.
>        //
>        Wrap = NET_LIST_USER_STRUCT (Entry, UDP4_RXDATA_WRAP, Link);
>        Print (L"Dump of DeliveredDgramQue:\n");
>        Print (L"UdpSession.SourceAddress: %d.%d.%d.%d\n", Wrap->RxData.UdpSession.SourceAddress.Addr[0], Wrap->RxData.UdpSession.SourceAddress.Addr[1], Wrap->RxData.UdpSession.SourceAddress.Addr[2], Wrap->RxData.UdpSession.SourceAddress.Addr[3]);
>        Print (L"UdpSession.SourcePort: %d\n", Wrap->RxData.UdpSession.SourcePort);
>        Print (L"UdpSession.DestinationAddress: %d.%d.%d.%d\n", Wrap->RxData.UdpSession.DestinationAddress.Addr[0], Wrap->RxData.UdpSession.DestinationAddress.Addr[1], Wrap->RxData.UdpSession.DestinationAddress.Addr[2], Wrap->RxData.UdpSession.DestinationAddress.Addr[3]);
>        Print (L"UdpSession.DestinationPort: %d\n", Wrap->RxData.UdpSession.DestinationPort);
>        for (Index = 0; Index < Wrap->RxData.FragmentCount; Index++) {
>          FragmentTable = &Wrap->RxData.FragmentTable[Index];
>          for (Index2 = 0; Index2 < FragmentTable->FragmentLength; Index2++) {
>            Print (L"%02x ", ((UINT8 *) FragmentTable->FragmentBuffer)[Index2]);
>          }
>        }
>        Print (L"\n");
>      }
>    }
>    ASSERT (IsListEmpty (&Instance->DeliveredDgramQue));
> Thanks,
> Richard

Cameron Esfahani

"Americans are very skilled at creating a custom meaning from something that's mass-produced."

Ann Powers

Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
Collect, index and harness all the fast moving IT data generated by your 
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights. 
Free Software Download:
edk2-devel mailing list