Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

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

Thanks - I missed that.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS