From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F3C9AA0524 for ; Thu, 6 May 2021 17:28:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E328B410EE; Thu, 6 May 2021 17:28:40 +0200 (CEST) Received: from spider.fraudbuster.mobi (spider.fraudbuster.mobi [62.4.12.223]) by mails.dpdk.org (Postfix) with ESMTP id 9602E410DB for ; Thu, 6 May 2021 17:28:39 +0200 (CEST) Received: from [10.8.0.214] (gypsy.fraudbuster.mobi [212.129.1.221]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by spider.fraudbuster.mobi (Postfix) with ESMTPSA id 4357A21BC7 for ; Thu, 6 May 2021 17:28:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fraudbuster.mobi; s=rsa-20200712; t=1620314919; bh=sLO2IlIUyggAYndKuaJaRqVPmrB2x+QhocqXRwLk44g=; h=To:From:Subject:Date:From; b=nlRdW73PRF8YY9oFgD0iqGvVQKBxgzdvnpU+N1kYdkly+HsvUmOCh1ejc9RzNTc0J tiI3x68WZZ/t1zXOb+LX1WIN1zcWZdR2glR6PJdLHxnhUKVdj8gBarxnN5uNp3moRV xxSGzBZumZF8FH90SsnYSoG6v2bJXu+TBJUCL/DJl1yb03gsevSru/HduPV/pgA3eH e55RVY0VQmVwaWc3fuI+jb18byxTN9+L2LX4QYjIDxsNfQXRxRJRNtcMazhLkivnhK NTVwM2B8Rp0XDZtLZDZCM//RkHwSre6I+yoXAfLyCLsJJIqRnDMM9oYLcvaBcZbb1r eUSrZ9m9QuBLQ== To: users@dpdk.org From: David Bouyeure Message-ID: Date: Thu, 6 May 2021 17:28:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 Content-Language: en-US X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:12876, ipnet:212.129.0.0/18, country:FR]; IP_WHITELIST(0.00)[212.129.1.221] X-Rspamd-Queue-Id: 4357A21BC7 X-Rspamd-Server: spider Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-users] mlx5 dv_flow_en doesn't behave as expected X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org Sender: "users" Hello all, I'm using rte_flow (dpdk 20.11.1) on Mellanox Connect-X6 to filter some flows. I recently was surprised by reading some of the mlx5 limitations(http://doc.dpdk.org/guides/nics/mlx5.html#limitations), regarding the Verbs flow engine against the DV flow engine. I wasn't aware of those 2 flow engines, neither of the following behavior: > * > > When using Verbs flow engine (|dv_flow_en| = 0), flow pattern > without any specific VLAN will match for VLAN packets as well: > > When VLAN spec is not specified in the pattern, the matching rule > will be created with VLAN as a wild card. Meaning, the flow rule: > > flow create 0 ingress pattern eth / vlan vid is 3 / ipv4 / end ... > > Will only match vlan packets with vid=3. and the flow rule: > > flow create 0 ingress pattern eth / ipv4 / end ... > > Will match any ipv4 packet (VLAN included). > > * > > When using Verbs flow engine (|dv_flow_en| = 0), > multi-tagged(QinQ) match is not supported. > > * > > When using DV flow engine (|dv_flow_en| = 1), flow pattern with > any VLAN specification will match only single-tagged packets > unless the ETH item |type| field is 0x88A8 or the VLAN item > |has_more_vlan| field is 1. The flow rule: > > flow create 0 ingress pattern eth / ipv4 / end ... > > Will match any ipv4 packet. The flow rules: > > flow create 0 ingress pattern eth / vlan / end ... > flow create 0 ingress pattern eth has_vlan is 1 / end ... > flow create 0 ingress pattern eth type is 0x8100 / end ... > > Will match single-tagged packets only, with any VLAN ID value. The > flow rules: > > flow create 0 ingress pattern eth type is 0x88A8 / end ... > flow create 0 ingress pattern eth / vlan has_more_vlan is 1 / end ... > > Will match multi-tagged packets only, with any VLAN ID value. > So, I retested some of my scenarios involving some eth / ipv4 rule pattern. And, indeed, it's not doing what I was expected. The following is supposed to discard any flow which isn't GTP or which is VLAN tagged: sudo dpdk-20.11.1/build/app/dpdk-testpmd -a 04:00.0 -c 0x0f  -- --rxq 16 --txq 16 -i # jump eth from 0 to 1 flow create 0 ingress group 0 priority 2 pattern eth / end actions count / jump group 1 / end # Allows gtp without vlan flow create 0 ingress group 1 priority 2 pattern eth / ipv4 / udp / gtp / end actions count / rss queues 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 end / end Playing a capture with X VLAN/GTP packets led to the rule #2(eth/ipv4/udp/gtp) being hit X times, which shouldn't. I'm sure that DV flow is used because I added some log messages in mlx5 PMD, and anyway running 'dpdk-testpmd -a 04:00.0,dv_flow_en=0' complains that groups aren't supported. In the above RSS rule, if I replace 'eth' by 'eth type is 0x0800', it does what I expect. I could had this IP4 ethernet type to some eth item, that would not be a problem, but I'm wondering if I missed something, at compile time for example? Thanks a lot.