FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [June 2016 Threads] When Stack Calls xNetworkInterfaceInitialise should NIC preserver Receive/Xmit buffer or Start Anew?Posted by joehinkle on June 20, 2016 When the Stack processes function prvProcessNetworkDownEvent() it call the NIC interface function xNetworkInterfaceInitialise().
Normal operation, this occurs when the stack is just starting. Should the stack call it because the network went down, what actions should the NIC driver take with respect to pending XMIT buffers and any Received but noot processed RCV buffers?
Simple thing would be to clean everything out as if the NIC were atarting anew but I'm concerned if the stack had pending XMIT buffers, what the stack would do if they suddenly disappeard.
Thanks.
When Stack Calls xNetworkInterfaceInitialise should NIC preserver Receive/Xmit buffer or Start Anew?Posted by rtel on June 20, 2016 I think it is best to start afresh (dropping the pending packets) as it may be necessary to perform a new DHCP cycle, and you may get a different IP address. If the dropped packets are UDP, then bad luck, if they are TCP, then the TCP protocol will handle the packets being dropped (if the connection can be recovered they will be resent).
When Stack Calls xNetworkInterfaceInitialise should NIC preserver Receive/Xmit buffer or Start Anew?Posted by joehinkle on June 20, 2016 I'm looking at the zero copy xNetworkInterfaceOutput();
The post says that once the buffer is provided to the NIC to be transmitted, the buffer pointer is made NULL in the descriptor and the descriptor is returned to the stack.
When the transmit has completed, how does the NIC driver return the "buffer" (the descriptor has already been returned) to the stack?
Is there a function in FreeRTOS_TCP that takes the pointer to a buff and reattaches it to its descriptor?
Should the NIC drviver reattach the buffer to the descriptor after transmission completes (descriptor has a pointer at the start of the network buffer)?
Thanks
When Stack Calls xNetworkInterfaceInitialise should NIC preserver Receive/Xmit buffer or Start Anew?Posted by joehinkle on June 20, 2016 Follow up on my previous question.
Is there a reason the NIC driver can't hold both the descriptor and buffer until the transmission has completed and then return them together?
The 4 byte filler in the network structure could be used as a link list to hold them until the transmission is complete.
When Stack Calls xNetworkInterfaceInitialise should NIC preserver Receive/Xmit buffer or Start Anew?Posted by edwards3 on June 21, 2016 Are you using bufferallocation_1.c? In there I see vNetworkBufferReleaseFromISR() for the buffer and vReleaseNetworkBufferAndDescriptor() for the buffer and descriptor.
When Stack Calls xNetworkInterfaceInitialise should NIC preserver Receive/Xmit buffer or Start Anew?Posted by joehinkle on June 21, 2016
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|