arch/arm/stm32h7: do not log the frames of packet sockets as unknown.

A frame that a packet socket consumes was given to pkt_input() and then
logged as "Dropped, Unknown type" because it is neither IP nor ARP. With
a PTP grandmaster on the network that is one warning for each frame, and
the log of RAM fills in seconds, so it hides the messages of the start of
the system.

Do not log the frames of the type of PTP or of IPv6 when packet sockets
are enabled, as the driver of the legacy STM32 does.

Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com>
Assisted-by: Claude:claude-sonnet-5
This commit is contained in:
Daniel P. Carvalho 2026-09-21 19:29:52 -03:00 • committed by Michal Lenc
parent 0a4ab69e52
commit a4c608c591
2 changed files with 14 additions and 1 deletions

View file

@ -40,6 +40,7 @@
#include <arch/barriers.h>
#include <arpa/inet.h>
#include <netinet/if_ether.h>
#include <nuttx/arch.h>
#include <nuttx/irq.h>
@ -2392,7 +2393,18 @@ static void stm32_receive(struct stm32_ethmac_s *priv)
else
#endif
{
nwarn("WARNING: DROPPED Unknown type: %04x\n", BUF->type);
#ifdef CONFIG_NET_PKT
/* Frames that packet sockets consume (PTP over Ethernet and
* IPv6) were already given to pkt_input() above, so they are not
* unknown and must not be logged as dropped.
*/
if (BUF->type != HTONS(ETH_P_1588) &&
BUF->type != HTONS(ETHTYPE_IP6))
#endif
{
nwarn("WARNING: DROPPED Unknown type: %04x\n", BUF->type);
}
}
/* We are finished with the RX buffer. NOTE: If the buffer is

View file

@ -51,6 +51,7 @@
#define ETH_P_IPV6 ETHERTYPE_IPV6
#define ETH_P_ARP ETHERTYPE_ARP
#define ETH_P_TSN 0x22F0 /* TSN (IEEE 1722) packet */
#define ETH_P_1588 0x88F7 /* PTP (IEEE 1588) over Ethernet packet */
/****************************************************************************
* Public Type Definitions