[PATCH] dts: add ICMP to packet filter config

Patrick Robb probb at iol.unh.edu
Thu Apr 17 14:46:57 CEST 2025


On Tue, Apr 15, 2025 at 5:51 AM Luca Vizzarro <luca.vizzarro at arm.com> wrote:

> NICs like the Intel E810-C often produce ICMP packets. These packets
> are stray and can interfere with testing. Therefore, add an ICMP
> filtering option in the packet filter.
>

Okay, this sounds harmless. But, is Paul okay with this approach? My
understanding is that he wants the testsuites to be written such that they
don't require that the wire is "quiet" from LLDP, ICMP etc.


>
>
> @@ -234,10 +237,23 @@ def _set_packet_filter(self, filter_config:
> PacketFilteringConfig):
>
>          def _filter(packet: Packet) -> bool:
>              if ether := packet.getlayer(Ether):
> -                if filter_config.no_arp and ether.type == 0x0806:
> +                if filter_config.no_arp and ether.type == ETHER_TYPES.ARP:
>                      return False
>
> -                if filter_config.no_lldp and ether.type == 0x88CC:
> +                if filter_config.no_lldp and ether.type ==
> ETHER_TYPES.LLDP:
> +                    return False
> +
> +            if ipv4 := packet.getlayer(IP):
> +                if filter_config.no_icmp and ipv4.proto == IP_PROTOS.icmp:
> +                    return False
> +
> +            if ipv6 := packet.getlayer(IPv6):
> +                next_header = ipv6.nh
> +
> +                if next_header == IP_PROTOS.hopopt:
> +                    next_header = ipv6.payload.nh
> +
> +                if filter_config.no_icmp and next_header ==
> IP_PROTOS.ipv6_icmp:
>                      return False
>
>              return True
> --
> 2.43.0
>
>
^Looks good, thanks.

Reviewed-By: Patrick Robb <probb at iol.unh.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20250417/6a13fb80/attachment-0001.htm>


More information about the dev mailing list