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 868D2A0543; Fri, 12 Aug 2022 21:19:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17F9842C47; Fri, 12 Aug 2022 21:18:38 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 4F15A40C35 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 110AAC3; Fri, 12 Aug 2022 22:18:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 110AAC3 Authentication-Results: shelob.oktetlabs.ru/110AAC3; 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 , Ferruh Yigit Subject: [PATCH 08/13] doc: add new port items and actions to switch representation Date: Fri, 12 Aug 2022 22:18:22 +0300 Message-Id: <20220812191827.3187441-9-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 Content-Transfer-Encoding: 8bit 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 Items PORT_REPRESENTOR and REPRESENTED_PORT as well as their action counterparts have been a part of the flow library for a year already. However, these haven't been described in the switch representation guide. Provide the missing description. Also, update relevant testpmd flow rule examples accordingly. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko --- .../prog_guide/switch_representation.rst | 126 +++++++++++++----- 1 file changed, 89 insertions(+), 37 deletions(-) diff --git a/doc/guides/prog_guide/switch_representation.rst b/doc/guides/prog_guide/switch_representation.rst index 4f2532a91e..9369e6e04c 100644 --- a/doc/guides/prog_guide/switch_representation.rst +++ b/doc/guides/prog_guide/switch_representation.rst @@ -538,8 +538,8 @@ exist between them and their represented resources. These may be immutable. In this case, traffic is received by default through the representor and neither the "transfer" attribute nor traffic origin in flow rule patterns are necessary. They simply have to be created on the representor port -directly and may target a different representor as described in `PORT_ID -action`_. +directly and may target a different representor as described +in `PORT_REPRESENTOR Action`_. Implicit traffic flow with port representor @@ -575,6 +575,36 @@ Implicit traffic flow with port representor Pattern Items And Actions ~~~~~~~~~~~~~~~~~~~~~~~~~ +PORT_REPRESENTOR Pattern Item +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Matches traffic entering the embedded switch from the given ethdev. + +- Matches **A**, **B** or **C** in `traffic steering`_. + +PORT_REPRESENTOR Action +^^^^^^^^^^^^^^^^^^^^^^^ + +At embedded switch level, sends matching traffic to the given ethdev. + +- Targets **A**, **B** or **C** in `traffic steering`_. + +REPRESENTED_PORT Pattern Item +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Matches traffic entering the embedded switch from +the entity represented by the given ethdev. + +- Matches **D**, **E** or **F** in `traffic steering`_. + +REPRESENTED_PORT Action +^^^^^^^^^^^^^^^^^^^^^^^ + +At embedded switch level, send matching traffic to +the entity represented by the given ethdev. + +- Targets **D**, **E** or **F** in `traffic steering`_. + PORT Pattern Item ^^^^^^^^^^^^^^^^^ @@ -672,7 +702,7 @@ with (e.g. ``VXLAN_ENCAP``) and using specific parameters (e.g. VNI for VXLAN). While they modify traffic and can be used multiple times (order matters), -unlike `PORT_ID action`_ and friends, they have no impact on steering. +unlike `PORT_REPRESENTOR Action`_ and friends, they don't impact on steering. As described in `actions order and repetition`_ this means they are useless if used alone in an action list, the resulting traffic gets dropped unless @@ -771,22 +801,15 @@ their representors :: - flow create 3 ingress pattern / end actions port_id id 4 / end - flow create 4 ingress pattern / end actions port_id id 3 / end - -More practical example with MAC address restrictions - -:: - - flow create 3 ingress - pattern eth dst is {VF 1 MAC} / end - actions port_id id 4 / end + flow create 3 transfer + pattern represented_port ethdev_port_id is 3 / end + actions represented_port ethdev_port_id 4 / end :: - flow create 4 ingress - pattern eth src is {VF 1 MAC} / end - actions port_id id 3 / end + flow create 3 transfer + pattern represented_port ethdev_port_id is 4 / end + actions represented_port ethdev_port_id 3 / end Sharing Broadcasts @@ -796,32 +819,58 @@ From outside to PF and VFs :: - flow create 3 ingress - pattern eth dst is ff:ff:ff:ff:ff:ff / end - actions port_id id 3 / port_id id 4 / port_id id 5 / end - -Note ``port_id id 3`` is necessary otherwise only VFs would receive matching + flow create 3 transfer + pattern + represented_port ethdev_port_id is 3 / + eth dst is ff:ff:ff:ff:ff:ff / + end + actions + port_representor ethdev_port_id 3 / + represented_port ethdev_port_id 4 / + represented_port ethdev_port_id 5 / + end + +Note ``port_representor ethdev_port_id 3`` is necessary otherwise only VFs would receive matching traffic. From PF to outside and VFs :: - flow create 3 egress - pattern eth dst is ff:ff:ff:ff:ff:ff / end - actions port / port_id id 4 / port_id id 5 / end + flow create 3 transfer + pattern + port_representor ethdev_port_id is 3 / + eth dst is ff:ff:ff:ff:ff:ff / + end + actions + represented_port ethdev_port_id 3 / + represented_port ethdev_port_id 4 / + represented_port ethdev_port_id 5 / + end From VFs to outside and PF :: - flow create 4 ingress - pattern eth dst is ff:ff:ff:ff:ff:ff src is {VF 1 MAC} / end - actions port_id id 3 / port_id id 5 / end - - flow create 5 ingress - pattern eth dst is ff:ff:ff:ff:ff:ff src is {VF 2 MAC} / end - actions port_id id 4 / port_id id 4 / end + flow create 3 transfer + pattern + represented_port ethdev_port_id is 4 / + eth dst is ff:ff:ff:ff:ff:ff / + end + actions + represented_port ethdev_port_id 3 / + port_representor ethdev_port_id 3 / + end + + flow create 3 transfer + pattern + represented_port ethdev_port_id is 5 / + eth dst is ff:ff:ff:ff:ff:ff / + end + actions + represented_port ethdev_port_id 3 / + port_representor ethdev_port_id 3 / + end Similar ``33:33:*`` rules based on known MAC addresses should be added for IPv6 traffic. @@ -852,10 +901,13 @@ endpoint might not be supported and action list must provide one :: - flow create 5 ingress - pattern eth src is {VF 2 MAC} / end - actions vxlan_encap vni 42 / port_id id 3 / end + flow create 3 transfer + pattern represented_port ethdev_port_id is 5 / end + actions vxlan_encap vni 42 / represented_port ethdev_port_id 3 / end - flow create 3 ingress - pattern vxlan vni is 42 / end - actions vxlan_decap / port_id id 5 / end + flow create 3 transfer + pattern + represented_port ethdev_port_id is 3 / + vxlan vni is 42 / + end + actions vxlan_decap / represented_port ethdev_port_id 5 / end -- 2.30.2