Quality RTOS & Embedded Software

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




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) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists