From patchwork Fri Aug 12 19:18:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Malov X-Patchwork-Id: 114939 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8E14BA0543; Fri, 12 Aug 2022 21:19:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5406642C04; Fri, 12 Aug 2022 21:18:37 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 27FD540A7F for ; Fri, 12 Aug 2022 21:18:31 +0200 (CEST) Received: from bree.oktetlabs.ru (bree.oktetlabs.ru [192.168.34.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPS id D48CEC1; Fri, 12 Aug 2022 22:18:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru D48CEC1 Authentication-Results: shelob.oktetlabs.ru/D48CEC1; dkim=none; dkim-atps=neutral From: Ivan Malov To: dev@dpdk.org Cc: Ori Kam , Eli Britstein , Ilya Maximets , Thomas Monjalon , Stephen Hemminger , Jerin Jacob , Andrew Rybchenko , Aman Singh , Yuying Zhang Subject: [PATCH 07/13] doc: revisit outdated flow rule examples in testpmd tutorial Date: Fri, 12 Aug 2022 22:18:21 +0300 Message-Id: <20220812191827.3187441-8-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220812191827.3187441-1-ivan.malov@oktetlabs.ru> References: <20220812191827.3187441-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org There are testpmd examples which demonstrate flow alteration and steering between endpoints using outdated action PORT_ID. Revisit these examples to make use of new port-based actions. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko --- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 48 +++++---------------- 1 file changed, 11 insertions(+), 37 deletions(-) diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 330e34427d..c105200fe7 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -5098,49 +5098,23 @@ and 50% packets are duplicated and marked with 0x1234 and sent to queue 0. testpmd> flow create 0 ingress group 1 pattern eth / end actions sample ratio 2 index 0 / queue index 1 / end -Mirroring rule with port representors (with "transfer" attribute), the matched -ingress packets with encapsulation header are sent to port id 0, and also -mirrored the packets and sent to port id 2. +Match packets coming from a VM which is referred to by means of +its representor ethdev (port 1), mirror 50% of them to the +said representor (for bookkeeping) as well as encapsulate +all the packets and steer them to the physical port: :: - testpmd> set sample_actions 0 port_id id 2 / end - testpmd> flow create 1 ingress transfer pattern eth / end actions - sample ratio 1 index 0 / raw_encap / port_id id 0 / end + testpmd> set sample_actions 0 port_representor ethdev_port_id 1 / end -Mirroring rule with port representors (with "transfer" attribute), the matched -ingress packets are sent to port id 2, and also mirrored the packets with -encapsulation header and sent to port id 0. + testpmd> set vxlan ip-version ipv4 vni 4 udp-src 32 udp-dst 4789 ip-src 127.0.0.1 + ip-dst 127.0.0.2 eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22 -:: - - testpmd> set sample_actions 0 raw_encap / port_id id 0 / end - testpmd> flow create 0 ingress transfer pattern eth / end actions - sample ratio 1 index 0 / port_id id 2 / end + testpmd> flow create 0 transfer pattern represented_port ethdev_port_id is 1 / end + actions sample ratio 2 index 0 / vxlan_encap / + represented_port ethdev_port_id 0 / end -Mirroring rule with port representors (with "transfer" attribute), the matched -ingress packets are sent to port id 2, and also mirrored the packets with -VXLAN encapsulation header and sent to port id 0. - -:: - - testpmd> set vxlan ip-version ipv4 vni 4 udp-src 4 udp-dst 4 ip-src 127.0.0.1 - ip-dst 128.0.0.1 eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22 - testpmd> set sample_actions 0 vxlan_encap / port_id id 0 / end - testpmd> flow create 0 ingress transfer pattern eth / end actions - sample ratio 1 index 0 / port_id id 2 / end - -Mirroring rule with port representors (with "transfer" attribute), the matched -ingress packets are sent to port id 2, and also mirrored the packets with -NVGRE encapsulation header and sent to port id 0. - -:: - - testpmd> set nvgre ip-version ipv4 tni 4 ip-src 127.0.0.1 ip-dst 128.0.0.1 - eth-src 11:11:11:11:11:11 eth-dst 22:22:22:22:22:22 - testpmd> set sample_actions 0 nvgre_encap / port_id id 0 / end - testpmd> flow create 0 ingress transfer pattern eth / end actions - sample ratio 1 index 0 / port_id id 2 / end +The rule is inserted via port 0 (assumed to have "transfer" privilege). Sample integrity rules ~~~~~~~~~~~~~~~~~~~~~~