cancel
Showing results for 
Search instead for 
Did you mean: 

ETH Level 3 and 4 filters

Bebbelin
Associate II

I have a STM32H732 processor connected to a ethernet switch with port based VLAN support.

I use the processor to connect to two different interfaces which are separated in the switch.

I wanted to be able to access the same two TCP ports in the processor from both interfaces.

So I configured ETH_L3_FILTER_0 and ETH_L3_FILTER_1 with the two different IP-addresses used on the two interfaces

And the ETH_L4_FILTER_0 and ETH_L4_FILTER_1 with the two different ports.

But that did not work as I hoped.

It looks like the L3_FILTER_0 and L4_FILTER_0 are used as one filter. and FILTER_1 as another.

And maybe that is as intented but it is not super clear in the documentation.
I may have to add that I have found and read...

Is this correct or is there perhaps a way to use the L3 and L4 as separate filters so that I can get four different filters allowing two IPs and two Ports in any combination of ports and IP?

Best regards

 

1 ACCEPTED SOLUTION

Accepted Solutions
STackPointer64
ST Employee

Hello @Bebbelin, and welcome to ST Community!

Your understanding is correct. The hardware pairs L3 and L4 filters into two combined filter contexts, not four independent ones. This means you cannot mix L3_FILTER_0 with L4_FILTER_1 or vice versa.

L3/L4 filters are mainly used for:

  • Offloading certain traffic to specific DMA queues.
  • Dropping unwanted traffic in hardware.

They are not strictly required to support multiple IPs and ports functionally. If your goal is simply to handle the same two TCP ports on two different IPs, you do not necessarily need L3/L4 hardware filtering. Instead, let your TCP/IP stack listen on:

  • IP_A:Port1
  • IP_A:Port2
  • IP_B:Port1
  • IP_B:Port2

The stack will distinguish flows by the 4-tuple (source IP, source port, destination IP, destination port) in software.

Best regards,

To improve visibility of answered topics, please click 'Accept as Solution' on the reply that resolved your issue or answered your question.

View solution in original post

3 REPLIES 3
mbarg.1
Lead

Have a look at Errata of your chip - you will find what works and what not and why.

Please mark as solution if you agree.

Thanks

Mike

STackPointer64
ST Employee

Hello @Bebbelin, and welcome to ST Community!

Your understanding is correct. The hardware pairs L3 and L4 filters into two combined filter contexts, not four independent ones. This means you cannot mix L3_FILTER_0 with L4_FILTER_1 or vice versa.

L3/L4 filters are mainly used for:

  • Offloading certain traffic to specific DMA queues.
  • Dropping unwanted traffic in hardware.

They are not strictly required to support multiple IPs and ports functionally. If your goal is simply to handle the same two TCP ports on two different IPs, you do not necessarily need L3/L4 hardware filtering. Instead, let your TCP/IP stack listen on:

  • IP_A:Port1
  • IP_A:Port2
  • IP_B:Port1
  • IP_B:Port2

The stack will distinguish flows by the 4-tuple (source IP, source port, destination IP, destination port) in software.

Best regards,

To improve visibility of answered topics, please click 'Accept as Solution' on the reply that resolved your issue or answered your question.

Super thank you!

I disabled L3 and just made two L4 filters listening on the ports to get some basic filtering from the HW.