Hello Dmitry,
I followed your suggestions, and this is what I came up with:
The issue is that when I implement this, I get an error on the drop filter: "Failed to create rule." Do you have any idea why this might be happening?
Thank you for your time.
Best regards,
Ali
Hi Ali,
2025-01-28 17:54 (UTC+0100), Sid ali cherrati:
> I am attempting to use DPDK's rte_flow API to filter incoming packets at
> the hardware level. My goal is to drop all packets except those with a
> specific IP address and UDP port.
>
> I have implemented the following flow filtering rule in my code:
> [...]
> However, despite this configuration, I continue to receive packets with
> other IP addresses and ports that do not match the specified filter.
Packets that do not match the rule pattern are processed as usual.
If without the rule queue RX_ID could receive any packet,
it will also receive them after the rule is created.
You need another rule with lower priority (BTW, 0 is the highest one)
that matches all packets and drops them or steers to other queues.
If you want your DPDK app to only process packets matching the rule
and to leave all other traffic for the OS to process,
flow isolated mode may be what you're looking for:
https://doc.dpdk.org/guides/prog_guide/ethdev/flow_offload.html#flow-isolated-mode
> Could you provide any insights into why the filtering isn't working as
> expected? Any advice on ensuring the rule is properly applied at the
> hardware level would be greatly appreciated.
The usual way to check that the rule is matched
is to all a counter to the rule and check if it increases.
I suggest using testpmd for playing with flow rules:
https://doc.dpdk.org/guides/testpmd_app_ug/testpmd_funcs.html#flow-rules-management
There was also a useful talk abound HW rules debugging on DPDK Summit:
https://dpdksummit2024.sched.com/event/1iAtU/debug-functional-and-performance-issues-in-rteflow-dariusz-sosnowski-nvidia-corp