Quality RTOS & Embedded Software

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


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner