eConsiderPacketForProcessing causes undefined reference error in STM32(FreeRTOS-Plus-TCP-V4.3.1)

I’m currently trying to integrate FreeRTOS-Plus-TCP-V4.3.1 on an STM32F4-based project. While building the project using the provided STM32 NetworkInterface implementation:

FreeRTOS/FreeRTOS-Plus-TCP/source/portable/NetworkInterface/STM32/NetworkInterface.c

I encountered the following linker error:
G:/STM32CubeIDE/workspace/freertos_offical/Debug/../FreeRTOS/FreeRTOS-Plus-TCP/source/portable/NetworkInterface/STM32/NetworkInterface.c:1769:(.text.prvAcceptPacket+0xa8): undefined reference to eConsiderPacketForProcessing'

Upon investigation, I noticed that the latest FreeRTOS+TCP source (FreeRTOS_IP.c) now defines:

eFrameProcessingResult_t eConsiderFrameForProcessing( const uint8_t * const pucEthernetBuffer );

It seems that the function previously named eConsiderPacketForProcessing() has been renamed to eConsiderFrameForProcessing() in recent versions.

However, NetworkInterface.c in the STM32 port still references the old function name, leading to a broken build.

Please let me know if this change is already tracked or need to report the issue~

Hey @ntustzeus

Not all configuration macros are implemented fully for all the network interfaces as they are supposed to be reference implementations. The function eConsiderPacketForProcessing is required when the ipconfigETHERNET_DRIVER_FILTERS_PACKETS is set, meaning that the packets need to be filtered at the network driver level, which is currently not implemented for the latest network interface of STM32. When ipconfigETHERNET_DRIVER_FILTERS_PACKETS is not set, the filtering of packets is done in the IP task [refer - prvAllowIPPacketIPv4 and prvAllowIPPacketIPv6]. Its just that enabling ipconfigETHERNET_DRIVER_FILTERS_PACKETS lets you make use of the hardware driver level functionalities to filter packets more efficiently and thus helps in offloading the work of IP task.

The plan is to have a universal implementation eConsiderPacketForProcessing for use in all network interfaces so that it can be better maintained and standardized across all the network interfaces. Some community members have shown interest in/are working on contributing similar changes; feel free to contribute if you are willing to add such functionality.

It seems that the function previously named eConsiderPacketForProcessing() has been renamed to eConsiderFrameForProcessing() in recent versions.

eConsiderFrameForProcessing is a different function that is used from the network interface level (RX thread) if theipconfigETHERNET_DRIVER_FILTERS_FRAME_TYPES is enabled, it will be called from the IP task to discard packets that do not contain a MAC address of interest. It’s defined as part of the FreeRTOS+TCP code base itself instead of network interface files because the definition should be the same for all network interfaces compared to eConsiderPacketForProcessing, where the definition can be different depending on the features of the network driver or underlying MAC hardware.

Thanks for the reply.

sorry for not read the code carefully, now I found the description in NetworkInterface.c

#if ipconfigIS_ENABLED( ipconfigETHERNET_DRIVER_FILTERS_PACKETS )
#include "FreeRTOS_Sockets.h"
#endif
/* TODO: There should be a universal check for use in network interfaces, similar to eConsiderFrameForProcessing.
 * So, don't use this macro, and filter anyways in the mean time. */

/* #if ipconfigIS_DISABLED( ipconfigETHERNET_DRIVER_FILTERS_PACKETS )
 #warning "Consider enabling ipconfigETHERNET_DRIVER_FILTERS_PACKETS for NetworkInterface"
 #endif */

When I got the compile error, I search the keyword eConsiderPacketForProcessing and found it only appears in NetworkInterface.c for STM32. so I didn’t think it is a universal implementation, but just a misused function.

sorry I also igonred the comment Create a eConsiderPacketForProcessing, because it seems like a plan(?) and it is not a weak function that we can override.

            /* TODO: Create a eConsiderPacketForProcessing */
            if( eConsiderPacketForProcessing( pxDescriptor->pucEthernetBuffer ) != eProcessBuffer )
            {
                iptraceETHERNET_RX_EVENT_LOST();
                FreeRTOS_debug_printf( ( "prvAcceptPacket: Packet discarded\n" ) );
                break;
            }

I think if the eConsiderPacketForProcessing is not implemented yet, maybe just add a warning like below so we can know what happened and then disable the #define.(when we don’t know how to impelement it)

#if ipconfigIS_ENABLED( ipconfigETHERNET_DRIVER_FILTERS_PACKETS )
 #error "Please implenent eConsiderPacketForProcessing or disable ipconfigETHERNET_DRIVER_FILTERS_PACKETS for NetworkInterface"
 #endif

thank you for your explanation~

This sounds good to me. Are you willing to create a pull request in Github with these changes?