rte_flow: no ability to match on packet length?

Stephen Hemminger stephen at networkplumber.org
Sun Mar 5 21:46:28 CET 2023


On Tue, 28 Feb 2023 15:12:31 +0000
Tony Hart <Tony.Hart at corero.com> wrote:

> I’m trying to use the Generic Flow API (rte_flow) to match IP packets based on their length (either L2, L3 or L4 lengths).
>  
> There doesn’t seem to be an item type that explicitly matches based on length (RTE_FLOW_ITEM_TYPE_x).  So I’ve tried using a mask with RTE_FLOW_ITEM_TYPE_IPV4 to match on the total_length field (and similar attempt to match on the UDP header dgram_len field) but the NIC I’m using (mlx5) returns an error (mask enables non supported bits).
>  
> Am I out of luck, or maybe missing something?
>  
> Thanks for any insights!
>  
> I’ve tried, DPDK: 20.11.7 and 22.11.1
> 
> Tony Hart | Chief Architect
> Tony.Hart at corero.com <mailto:Tony.Hart at corero.com> 

Short answer: yes, you are right there is no generic length match.

Longer answer: rte_flow is an API which is meant to provide access to the underlying
match features of NIC hardware. Supporting something requires that the HW/FW can do the
match, and that the driver writer has added (and tested) that match.

Hopefully the MLX5 experts can help answer what is possible.


More information about the users mailing list